Skip to content

Commit

Permalink
First release!
Browse files Browse the repository at this point in the history
  • Loading branch information
Tazzios committed Sep 24, 2021
1 parent 0560e0f commit 0b649e4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
Binary file added documentation/Demo text button.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions universalbuttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,22 @@ public function onDisplay($name, &$params)

case "1":


$js = " function buttonClick".$i."(editor) { let str = '". $value->code. "';";

// remove enters
$value->code= str_replace(array("\n", "\r"), ' ', $value->code);

$js = " function buttonClick".$i."(editor) { let str = '". $value->code . "';
";

$subforminputs = $value->variables;
$arr2 = (array) $subforminputs;

$iVariable=1;
foreach ($arr2 as $value2) {

$js .= " txt".$iVariable." = prompt('". $value2->Variablelabel. "','".$value2->variabledefault."');
str = str.replace(/%".$iVariable."/g,txt".$iVariable."); ";
str = str.replace(/%".$iVariable."/g,txt".$iVariable.");
";

$iVariable++;
}
Expand Down
4 changes: 2 additions & 2 deletions universalbuttons.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?><extension version="3.1" type="plugin" group="editors-xtd" method="upgrade"> <name>Universal buttons</name>
<author>Tazizos</author> <creationDate>September 2021</creationDate> <copyright></copyright> <license>GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html</license> <authorEmail></authorEmail> <authorUrl>https://github.com/Tazzios</authorUrl> <version>0.9</version> <description>Add custom editor buttons that opens additional webpages in a popup</description> <files> <filename plugin="universalbuttons">universalbuttons.php</filename> <filename>index.html</filename>
<author>Tazizos</author> <creationDate>September 2021</creationDate> <copyright></copyright> <license>GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html</license> <authorEmail></authorEmail> <authorUrl>https://github.com/Tazzios</authorUrl> <version>1.0</version> <description>Add custom editor buttons</description> <files> <filename plugin="universalbuttons">universalbuttons.php</filename> <filename>index.html</filename>
</files>
<config>
<fields name="params"> <fieldset name="basic"> <field name="buttons" type="subform" default='' label="Buttons" description="" multiple="true" min="0" max="50" > <form> <field name="Buttonlabel" type="text" default="" label="Button Label" description="Enter label text for the button" maxlength="20" size="10" /> <field name="Buttonicon" type="text" default="comment" label="Button icon" description="Enter a mce icon name to show. Some examples: comment,plus,info,new-tab,redo,upload,help,file-add,file" maxlength="20" size="10" /> <field name="usergroups" type="usergrouplist" label="Usergroup" description="Select the usergroups which have access to this button" multiple="true" /> <field name="style" type="radio" default="0" label="button style" description="" > <option value="0">Popup</option> <option value="1">Dialog</option> </field> <field showon="style:0" name="url" type="text" default="" label="Relative URL " description="insert the Relative url that need to be shown in the popup" maxlength="100" size="20" /> <field showon="style:0" name="Componentonly" type="radio" default="1" label="Component only" description="Load Component without the template, may not work for every page." > <option value="1">Yes</option> <option value="0">No</option> </field> <field showon="style:0" name="popupwidth" type="text" default="800" label="Popup width " description="" /> <field showon="style:0" name="popupheight" type="text" default="800" label="Popup height " description="" /> <field showon="style:1" name="code" type="textarea" default="" label="Text or htmlcode to insert" description="use %1 %2 as variable replace" filter="safehtml" maxlength="500" size="30" /> <field showon="style:1" name="variables" type="subform" default='' label="Variables" description="Create dialog windows to ask variable values" multiple="true" min="0" max="10" > <form> <field name="Variablelabel" type="text" default="" label="Label text" description="Instruction text to show in the prompt" maxlength="200" size="30" /> <field name="variabledefault" type="textarea" default="" label="Default text" description="Default answer that is placed in the prompt" maxlength="200" size="30" /> </form> </field> </form> </field>
</fieldset>
</fields>
</config>
</config> <updateservers> <server type="extension" priority="2" name="pdfviewer">https://raw.githubusercontent.com/tazzios/Universal-buttons/master/updates.xml</server> </updateservers>
</extension>
Expand Down
24 changes: 24 additions & 0 deletions updates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<updates>

<update>
<name>Universal buttons</name>
<description>Universal buttons</description>
<element>Universal buttons</element>
<type>plugin</type>
<folder>editors-xtd</folder>
<element>Universal buttons</element>
<version>1.0.0</version>
<infourl title="Release notes">https://github.com/Tazzios/Universal-buttons/releases/download/v1.0.0/universal.buttons-1.0.0.zip</infourl>
<downloads>
<downloadurl type="full" format="zip"></downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<client>0</client>
<maintainer>Tazzios</maintainer>
<maintainerurl>https://github.com/Tazzios/</maintainerurl>
<targetplatform name="joomla" version="3.([6789]|10)"/>
</update>
</updates>

0 comments on commit 0b649e4

Please sign in to comment.