From 677558fe715f532c349d41952e2cd33d14948b60 Mon Sep 17 00:00:00 2001
From: JT Smith ?D4+~Q)yv*DxG*fuwFhK|Sl?PZERsk9MKg GP~Ew(> VGE1K
zlm*UwV~eojLuDzo(dY5PHBt0 ","gi");content=tinyMCE.regexpReplace(content,"\r\r"," ","gi");content=tinyMCE.regexpReplace(content,"\n\n"," ","gi");if((pos=content.indexOf(' '))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after=" ";content=before+content.substring(pos+7)+after;}}content=tinyMCE.regexpReplace(content,"\r\n"," ", "gi");
+ content = tinyMCE.regexpReplace(content, "\r\r", " ", "gi");
+ content = tinyMCE.regexpReplace(content, "\n\n", " ", "gi");
+
+ // Has paragraphs
+ if ((pos = content.indexOf(' ')) != -1) {
+ tinyMCE.execCommand("Delete");
+
+ var node = tinyMCE.selectedInstance.getFocusElement();
+
+ // Get list of elements to break
+ var breakElms = new Array();
+
+ do {
+ if (node.nodeType == 1) {
+ // Don't break tables and break at body
+ if (node.nodeName == "TD" || node.nodeName == "BODY")
+ break;
+
+ breakElms[breakElms.length] = node;
+ }
+ } while(node = node.parentNode);
+
+ var before = "", after = " ";
+ content = before + content.substring(pos+7) + after;
+ }
+ }
+
+ content = tinyMCE.regexpReplace(content, "\r\n", " xZ)@m7c
?Dit_LD4s}h+;^epc0
zJW;hfd*8z&ZHCk9Lg!I*En}q+Xx0mX!xv!31T=BCmu41;XO0>3@RM5mX}{TcINJv1
zm<$F7F&kfYM_Rf}bI!=e&j`U0j_swm2be6St+OeFaiaQ6$V0S!msKdKGsdgqlW9@4
z>xbOTw)%o2VIP`Y^>U+a-CDGy?A>19&pJ6kxZghbiO|qElgpR0v)T_85;&)_W`YK<
zFg}l3omlFo_KOIX=}p*~%{gT|$4zI>_Ipy#)byr|t;MHe`7V@NgPRf7iuBd7S{EEH
z4Vo+!uF+{;x8|Hw+l6=S`&Ws=1}JB11*bBV;l!TH#H@LghI%!IxDR5c@lQoFUuaiM
zGtP#WzHL@zfK$1nk}$*c^51(-
zCDyWQ=H)l1cWHNx7YIC6cHeqB<<^4)SuW~MON}M1q1>kID=BFWcB?2Km>?^ecNGkwfoQLZ@T}kL0xzq+yFO$JMaLW;1=)#-rzPs^2U5&
z?+5%p|M|
';case "rtl":return '
';}return "";}function TinyMCE_directionality_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case "mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;}function TinyMCE_directionality_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonNormal');if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm)return;var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonSelected');return true;}
\ No newline at end of file
diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js
new file mode 100644
index 000000000..2edb660a8
--- /dev/null
+++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js
@@ -0,0 +1,71 @@
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn');
+
+function TinyMCE_directionality_getControlHTML(control_name) {
+ var safariPatch = '" onclick="';
+
+ if (tinyMCE.isSafari)
+ safariPatch = "";
+
+ switch (control_name) {
+ case "ltr":
+ return '
';
+
+ case "rtl":
+ return '
';
+ }
+
+ return "";
+}
+
+function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mceDirectionLTR":
+ var inst = tinyMCE.getInstanceById(editor_id);
+ var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+ if (elm)
+ elm.setAttribute("dir", "ltr");
+
+ tinyMCE.triggerNodeChange(false);
+ return true;
+
+ case "mceDirectionRTL":
+ var inst = tinyMCE.getInstanceById(editor_id);
+ var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+ if (elm)
+ elm.setAttribute("dir", "rtl");
+
+ tinyMCE.triggerNodeChange(false);
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+}
+
+function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+ function getAttrib(elm, name) {
+ return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+ }
+
+ tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal');
+ tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal');
+
+ if (node == null)
+ return;
+
+ var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+ if (!elm)
+ return;
+
+ var dir = getAttrib(elm, "dir");
+ if (dir == "ltr" || dir == "")
+ tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected');
+ else
+ tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected');
+
+ return true;
+}
diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/directionality/images/ltr.gif b/www/extras/tinymce/jscripts/tiny_mce/plugins/directionality/images/ltr.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1f8e046b781c2307b36c949c8de750bee37213ed
GIT binary patch
literal 314
zcmZ?wbhEHb6k!lyxXJ(m|NsAYuy6?Q2-vY>cSA#yfyaa^S8o^uEGU@pAfVzxLdSze
z8?S6Rcz@f$TRRS3J9_%2L&1fBh6e{vTwAqzt%An{hl~vg9T%2uJbL2HWru
';
+ }
+
+ return "";
+}
+
+function TinyMCE_fullscreen_execCommand(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mceFullScreen":
+ if (tinyMCE.getParam('fullscreen_is_enabled')) {
+ // In fullscreen mode
+ window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(editor_id));
+ top.close();
+ } else {
+ tinyMCE.setWindowArg('editor_id', editor_id);
+
+ var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+ }
+
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+}
+
+
diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/www/extras/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm
new file mode 100644
index 000000000..30644e66d
--- /dev/null
+++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm
@@ -0,0 +1,72 @@
+
+
+
';case "pasteword":return '
';case "selectall":return '
';}return '';}function TinyMCE_paste_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePasteText":if(tinyMCE.isMSIE&&!tinyMCE.getParam('paste_use_dialog',false))TinyMCE_paste__insertText(clipboardData.getData("Text"),true);else{var template=new Array();template['file']='../../plugins/paste/pastetext.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",mceDo:'insert'});}return true;case "mcePasteWord":if(tinyMCE.isMSIE&&!tinyMCE.getParam('paste_use_dialog',false)){var html=TinyMCE_paste__clipboardHTML();if(html&&html.length>0)TinyMCE_paste__insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",mceDo:'insert'});}return true;case "mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;}function TinyMCE_paste__insertText(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("plaintext_create_paragraphs",true)){content=tinyMCE.regexpReplace(content,"\r\n\r\n","
","gi");content=tinyMCE.regexpReplace(content,"\r","
","gi");content=tinyMCE.regexpReplace(content,"\n","
","gi");}tinyMCE.execCommand("mceInsertRawHTML",false,content);}}function TinyMCE_paste__insertWordContent(content){if(content&&content.length>0){content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");content=content.replace(/<\/?span[^>]*>/gi,"");content=content.replace(/<(\w[^>]*)style="([^"]*)"([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\/?font[^>]*>/gi, "");
+ content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+ content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+ content = content.replace(/\/? */gi, "");
+ content = content.replace('
' ,'gi');
+ }
+
+ if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
+ content = content.replace(/<\/?p[^>]*>/gi, "");
+ }
+
+ content = content.replace(/<\/?div[^>]*>/gi, "");
+
+ // Insert cleaned content
+ tinyMCE.execCommand("mceAddUndoLevel");
+ tinyMCE.execCommand("mceInsertContent",false,content);}}function TinyMCE_paste__clipboardHTML(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}
\ No newline at end of file
diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js
new file mode 100644
index 000000000..e9a2d8d06
--- /dev/null
+++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js
@@ -0,0 +1,173 @@
+// Tiny MCE Paste Plugin
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('paste', 'en,sv,cs,zh_cn,fr_ca');
+
+function TinyMCE_paste_getControlHTML(control_name) {
+ switch (control_name) {
+ case "pastetext":
+ return '
';
+
+ case "pasteword":
+ return '
';
+
+ case "selectall":
+ return '
';
+ }
+
+ return '';
+}
+
+function TinyMCE_paste_execCommand(editor_id, element, command, user_interface, value) {
+ switch (command) {
+ case "mcePasteText":
+ if (tinyMCE.isMSIE && !tinyMCE.getParam('paste_use_dialog', false))
+ TinyMCE_paste__insertText(clipboardData.getData("Text"), true);
+ else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", mceDo : 'insert'});
+ }
+
+ return true;
+
+ case "mcePasteWord":
+ if (tinyMCE.isMSIE && !tinyMCE.getParam('paste_use_dialog', false)) {
+ var html = TinyMCE_paste__clipboardHTML();
+
+ if (html && html.length > 0)
+ TinyMCE_paste__insertWordContent(html);
+ } else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", mceDo : 'insert'});
+ }
+
+ return true;
+
+ case "mceSelectAll":
+ tinyMCE.execInstanceCommand(editor_id, 'selectall');
+ return true;
+
+ }
+
+ // Pass to next handler in chain
+ return false;
+}
+
+function TinyMCE_paste__insertText(content, bLinebreaks) {
+
+ if (content && content.length > 0) {
+ if (bLinebreaks) {
+ // Special paragraph treatment
+ if (tinyMCE.getParam("plaintext_create_paragraphs", true)) {
+ content = tinyMCE.regexpReplace(content, "\r\n\r\n", "
", "gi");
+ content = tinyMCE.regexpReplace(content, "\r", "
", "gi");
+ content = tinyMCE.regexpReplace(content, "\n", "
", "gi");
+ }
+
+ tinyMCE.execCommand("mceInsertRawHTML", false, content);
+ }
+}
+
+function TinyMCE_paste__insertWordContent(content) {
+
+ if (content && content.length > 0) {
+ // Cleanup Word content
+ content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments
+ content = content.replace(/<\/?span[^>]*>/gi, "");
+ content = content.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\/?font[^>]*>/gi, "");
+ content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+ content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+ content = content.replace(/\/? */gi, "");
+ content = content.replace('