From f7bf7be619457e542d679b80046c735f2efe9c57 Mon Sep 17 00:00:00 2001 From: Gustavo Cruz Date: Mon, 3 Dec 2012 17:51:48 -0400 Subject: [PATCH] Advances in the PM Grids properties plugin --- .../plugins/pmGrids/VariablePicker.html | 66 +++++++++++++ .../tiny_mce/plugins/pmGrids/editor_plugin.js | 63 +++++++++++++ .../plugins/pmGrids/editor_plugin_src.js | 63 +++++++++++++ .../tiny_mce/plugins/pmGrids/img/grids.png | Bin 0 -> 5717 bytes .../tiny_mce/plugins/pmGrids/img/picker.png | Bin 0 -> 595 bytes .../tiny_mce/plugins/pmGrids/langs/en.js | 3 + .../tiny_mce/plugins/pmGrids/pmGrids.html | 87 ++++++++++++++++++ .../uploader.php => pmGrids/pmGrids.php} | 0 .../tiny_mce/plugins/pmGrids/progress.gif | Bin 0 -> 2005 bytes .../pmVariablePicker/VariablePicker.html | 1 + gulliver/system/class.wysiwygEditor.php | 22 ++--- .../processes/processes_FilesOptions.xml | 3 +- 12 files changed, 295 insertions(+), 13 deletions(-) create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/VariablePicker.html create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin.js create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin_src.js create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/grids.png create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/picker.png create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/langs/en.js create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html rename gulliver/js/tinymce/jscripts/tiny_mce/plugins/{pmVariablePicker/uploader.php => pmGrids/pmGrids.php} (100%) create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/progress.gif diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/VariablePicker.html b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/VariablePicker.html new file mode 100644 index 000000000..1210d28e6 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/VariablePicker.html @@ -0,0 +1,66 @@ + + + + + + + + +
' +
+ + + + + + + + + + + + +
+ + +      + + +
+
+ +
+ +
+ + + + + + + + + +
Result@#SYS_LANG
DescriptionDescription @#SYS_LANG
+
+ +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin.js new file mode 100644 index 000000000..655d90fd3 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin.js @@ -0,0 +1,63 @@ +/** +* Name: editor_plugin_src.js (for pmGrids tinyMCE plugin) +**/ + +(function(){ + var strPluginURL; + tinymce.create('tinymce.plugins.pmGridsPlugin', { + init: function(ed, url) + { + strPluginURL = url; // store the URL for future use.. + ed.addCommand('mcepmGrids', function() { + pmGrids(); + }); + ed.addButton('pmGrids', { + title: 'pmGrids', + label : ' @# Grids', + cmd: 'mcepmGrids', + image: url + '/img/grids.png' + }); + }, + createControl: function(n, cm) { + return null; + }, + getPluginURL: function() { + return strPluginURL; + } + }); + tinymce.PluginManager.add('pmGrids', tinymce.plugins.pmGridsPlugin); +})(); + +// this function can get called from the plugin inint (above) or from the callback on advlink/advimg plugins.. +// in the latter case, win and type will be set.. In the rist case, we will just update the main editor window +// with the path of the uploaded file +function pmGrids(field_name, url, type, win) { + //tinyMCE.activeEditor.anyVariable='path/to/ProcessMaker' + tinyMCE.activeEditor.windowManager.open({ // open the plugin popup + file : '/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html', + title : '', + width : '600px', + height : '330px', + resizable : "yes", + scrollbars : "no", + overflow : false, + inline : 1, // This parameter only has an effect if you use the inlinepopups plugin! + close_previous : "no" + }, { + window : win, + input : field_name + }); + + return false; +} +// This function will get called when the uploader is done uploading the file and ready to update +// calling dialog and close the upload popup +// strReturnURL should be the string with the path to the uploaded file +function closePluginPopup(){ + tinyMCEPopup.close(); // close popup window +} + +function updateEditorContent(serializedHTML){ + tinyMCE.activeEditor.execCommand('mceInsertContent', false, serializedHTML); +} + diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin_src.js new file mode 100644 index 000000000..655d90fd3 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin_src.js @@ -0,0 +1,63 @@ +/** +* Name: editor_plugin_src.js (for pmGrids tinyMCE plugin) +**/ + +(function(){ + var strPluginURL; + tinymce.create('tinymce.plugins.pmGridsPlugin', { + init: function(ed, url) + { + strPluginURL = url; // store the URL for future use.. + ed.addCommand('mcepmGrids', function() { + pmGrids(); + }); + ed.addButton('pmGrids', { + title: 'pmGrids', + label : ' @# Grids', + cmd: 'mcepmGrids', + image: url + '/img/grids.png' + }); + }, + createControl: function(n, cm) { + return null; + }, + getPluginURL: function() { + return strPluginURL; + } + }); + tinymce.PluginManager.add('pmGrids', tinymce.plugins.pmGridsPlugin); +})(); + +// this function can get called from the plugin inint (above) or from the callback on advlink/advimg plugins.. +// in the latter case, win and type will be set.. In the rist case, we will just update the main editor window +// with the path of the uploaded file +function pmGrids(field_name, url, type, win) { + //tinyMCE.activeEditor.anyVariable='path/to/ProcessMaker' + tinyMCE.activeEditor.windowManager.open({ // open the plugin popup + file : '/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html', + title : '', + width : '600px', + height : '330px', + resizable : "yes", + scrollbars : "no", + overflow : false, + inline : 1, // This parameter only has an effect if you use the inlinepopups plugin! + close_previous : "no" + }, { + window : win, + input : field_name + }); + + return false; +} +// This function will get called when the uploader is done uploading the file and ready to update +// calling dialog and close the upload popup +// strReturnURL should be the string with the path to the uploaded file +function closePluginPopup(){ + tinyMCEPopup.close(); // close popup window +} + +function updateEditorContent(serializedHTML){ + tinyMCE.activeEditor.execCommand('mceInsertContent', false, serializedHTML); +} + diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/grids.png b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/grids.png new file mode 100644 index 0000000000000000000000000000000000000000..dbac360f10514a0530bec2fbb07671fb901f60d8 GIT binary patch literal 5717 zcmcIo2{@GP`hUe|%~Dw^=^H~OF`IoF>x?ZsBcqKm^BNN~!^~^#OH{V%BdKf=l@wB_ zDWNPy8&XMGD z2tSa)WSb)2R$WITm~>O5mw^+;DVPWbFzuqaphuK5nHCjDGod5R&7=ttco={MLR3Tq zD~Qd*N0=goxOn(~!DBQMAvA#kO_7!YLIlOh6+z^1L4-aEhr;R7Fot>v13i?U0nQMo zuYPy071ccG&(#y92KsI z;&2>ci&U8iPaQaJsOCE-#V|Q6qHOJPiTF3HnR(3!Do~HZ|yff)NxFg78C-gxka65;<_S(I9)a zKSx+hKiV)Y>0BZciZn&Ka;c0^P#6uwzuLIcICMCQSVPSBi2cHb2ytN?ViZUVK)8d! zp?*P3+Ar~}SyX0_7l#Wsp+Ks|FB0Qta8K@c^Is$qdS>Z#8h)mhgu|JpVi^R@jAn*G zOhG5X2T|D!cz<>2a59DlK}a)UpqODG+y_}K4x5Ltgdi@{FI3o!oH=Y=!E=yHV^V_< z&Kv{@wClfcflYBFnI|01qFZzCJpY!{#*_V0TEAIBgy2^iW?_XI{^lgWon_`^zSJluMO4V^~~1L-r}V0Mc6zqVVr z)y;s12Y~QdF?am@vbE0{(*oea7aUh;!A(eTG9YJq$M^J|T?YaEFDsqd-g$Qvc=R6t0|1#Ng0~2eb!;gBNV_nJL|50@ zs|~`QNJIp4IsVKb5C9@Nb37Pik6~rgiQe~C4v8^`9XRevk_dOJ{V|HEtF_go6gDKP z=RZ|)t6OAkE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4gfwsl+u1R5x}jS&DDJGhlh|{_#Ukfj;`Re@O0<)IZ)T0c-?%eLFgVh_{%EKO6c9 z<3$bk4CQ?6p^VCCUwe{++M!GpK$%r>Sku18x4dhVn`2{t=oG+bRp@6oYsXGTyEu&< zmwMBx`zRo@c3+HSV$A3Q(7U(ime^ye{}%1!e%H(PE1L49-W&n+7;cI^LCV%{ckX3M z={OZW{AzSkWF$X$`LPtlI?DLEVT6@l3lbXg-AW8%k7%hc zKq3|(|DiB)7))~beC@ni;LbjICtuIYUCrBve4=W4KSFq=T?Whkv{@S?51fYuu8>>h zyua3?iP<_{`T}xO+*I~>yxJ%AiW0x?t=EF4{xTu3Q5h^+GO?Bxa&;>IQRvoD%E(oA zzyg^9#g5k=YeOqC-L*}9y6_Ik{gj-Sir02!Wl-?b;v{|Gf_UxG_N+v4A5p+?b-}U8 Tq-PQEMgsQM&ZJT+-`)QNQVRIk literal 0 HcmV?d00001 diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/picker.png b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/img/picker.png new file mode 100644 index 0000000000000000000000000000000000000000..0d16423393449c9f17e7ba22f250dfcd735141d6 GIT binary patch literal 595 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1rX+877l!}s{b%+Ad7K3vkswhI zFm^kcZ3hx8D{xE)(qO#|6+TOsF)%PTc)B=-Se!mP*;>cNQKW7E%)Q#Pr*<%DAJN_z zxw~XVh@4_zhKplsiuNLbt6@UDNmu2jdWDE+DF$-1dZa8C5L~$U!;Mqf@8<@-Ia~Vu zUEJIwDxc3=7C*D^w>186-8tax#rYfS)N`u7go_#c<(%YiS6Tj{*&vgr-f81Wr882N z^-WAJj8Pgb^B^Z^3cik+f@QJTDY0D=RV2t6^U#$SGARwUwPVFHE8OK zMI3)aH&18ojrbPFC;U{t(dFyM%l~p$@%A2@(=m_dY?;dAcNwj&tB-zr%5&{5yW^Ur z?;d)bzj*q(+xp#~TYE1jubs)|?BW#O`K5Bx&a&ATu3e20d8zhii_cjVHh%uRi8IU> zzude)p`kNNvpkC-QGv0QvuH3PL77+kvY#s;W? N!PC{xWt~$(69D=V>#qO+ literal 0 HcmV?d00001 diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/langs/en.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/langs/en.js new file mode 100644 index 000000000..82cc06aa9 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.ccSimpleUploader', { + desc:"Upload File to Server" +}); diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html new file mode 100644 index 000000000..003b4ebc7 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + + +
+
+
+ Chose a grid +
+
+
+ +
+
+
+
+
+ Prefix +
+
+
+ +
+
+
+
+
+ +
+
+
+ Border +
+
+
+
+
+ +
+
+
+ Headers +
+
+
+ +
+
+ +
+ + diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.php similarity index 100% rename from gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php rename to gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/pmGrids.php diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/progress.gif b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/progress.gif new file mode 100644 index 0000000000000000000000000000000000000000..2aea68c8e3aef0278954931058f765c714048b17 GIT binary patch literal 2005 zcmZ?wbhEHboW>x)aD;*3|NsBrzkh%K{{7nbYo|P$((`Oe^|R{Ydq7mYckkY)dr@1r zZuPnsw07-Mr)y4z*Q^Y$8Md^vR99CQ7Z<0crTu3h02Kdo`?-b$J39ur8tEA@GXj+> z{$ycgXAou30ciy}gMsy5!c~uu%y}8B*5$n3SD8J%PIq zAK$z3{6+b-b$oB%rM-L4@bT@3FW)}C{Pk<*^(HO`=2@H?0t}7~%=~I9JJu_1ty{}9T9@-mc}&)dJ+q5M*IsX3%5c0*0WYf^ zeu2;X)erw$%H~HTN%T7|y7VQ(YO=R#idU;!d*7OCRd+S_CFGTtY0N(QI5hDrA0r}O zc<`CJ!Q=fFps5V`D@Zg|geIoS(8N>~nwY9X6H`rSVyX>IOm(4&sXjC@HH0Rn#?Zvn z6q=X{DqZrxrAxpAXz2nfpEq!wF-g2%xbD4;|K+v?8{BoIO7}}9pR@s%&ngcb*E+4g zF<0c!+qC@;re1N>Yd@d9GU=?_?#-8)YyPdXU)s9o-Z_0QXVk)m=9YlU9vWK0iB_Ez zB&hbKAXR52x%a`<+4klIAKZ1i7)~s?=#pVI{X%Szq^RV&8>_aNx#mee_)sSEnrU1A zmRV==W^SLbV~?-@-mQIm_MOweyPB)9skTM5K9Ie$tF^X0fOW#eo|?YN)27duIcxSD JU0{u14FIuDN~Hh* literal 0 HcmV?d00001 diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html index 1210d28e6..32ce5319a 100644 --- a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html @@ -3,6 +3,7 @@ + diff --git a/gulliver/system/class.wysiwygEditor.php b/gulliver/system/class.wysiwygEditor.php index b658f8362..28b75fe55 100644 --- a/gulliver/system/class.wysiwygEditor.php +++ b/gulliver/system/class.wysiwygEditor.php @@ -98,17 +98,17 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field tinyMCE.activeEditor.processID =formProcessID; }, onchange_callback: function(inst) { - if(inst.isDirty()) { - inst.save(); - } - return true; - }, + if(inst.isDirty()) { + inst.save(); + } + return true; + }, handle_event_callback : function(e) { - if(this.isDirty()) { - this.save(); - } - return true; - } + if(this.isDirty()) { + this.save(); + } + return true; + } }); '; break; @@ -118,7 +118,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field var formProcessID = document.getElementById("form[PRO_UID]").value; tinyMCE.init({ theme : "advanced", - plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras,pmSimpleUploader,pmVariablePicker", + plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras,pmSimpleUploader,pmVariablePicker,pmGrids", mode : "specific_textareas", editor_selector : "tmceEditor", width : "770", diff --git a/workflow/engine/xmlform/processes/processes_FilesOptions.xml b/workflow/engine/xmlform/processes/processes_FilesOptions.xml index d2b0353d0..0f8147ab7 100755 --- a/workflow/engine/xmlform/processes/processes_FilesOptions.xml +++ b/workflow/engine/xmlform/processes/processes_FilesOptions.xml @@ -85,8 +85,7 @@ function editFile(pro_uid, fileName){ position : {x:50,y:50,center:true}, title : '', control : {close:true,resize:false}, - fx : {modal:true}, - fx : {shadow:true,modal:true} + fx : {shadow:true,modal:true} }; oPanel.make();