]> code.citadel.org Git - citadel.git/blobdiff - webcit/tiny_mce/plugins/fullpage/editor_plugin_src.js
* Deleted tiny_mce - update is coming in the next commit
[citadel.git] / webcit / tiny_mce / plugins / fullpage / editor_plugin_src.js
diff --git a/webcit/tiny_mce/plugins/fullpage/editor_plugin_src.js b/webcit/tiny_mce/plugins/fullpage/editor_plugin_src.js
deleted file mode 100755 (executable)
index 8c61823..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/**\r
- * $Id: editor_plugin_src.js 232 2007-03-05 17:00:27Z spocke $\r
- *\r
- * @author Moxiecode\r
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
- */\r
-\r
-/* Import plugin specific language pack */\r
-tinyMCE.importPluginLanguagePack('fullpage');\r
-\r
-var TinyMCE_FullPagePlugin = {\r
-       getInfo : function() {\r
-               return {\r
-                       longname : 'Fullpage',\r
-                       author : 'Moxiecode Systems AB',\r
-                       authorurl : 'http://tinymce.moxiecode.com',\r
-                       infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',\r
-                       version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
-               };\r
-       },\r
-\r
-       getControlHTML : function(cn) {\r
-               switch (cn) {\r
-                       case "fullpage":\r
-                               return tinyMCE.getButtonHTML(cn, 'lang_fullpage_desc', '{$pluginurl}/images/fullpage.gif', 'mceFullPageProperties');\r
-               }\r
-\r
-               return "";\r
-       },\r
-\r
-       execCommand : function(editor_id, element, command, user_interface, value) {\r
-               // Handle commands\r
-               switch (command) {\r
-                       case "mceFullPageProperties":\r
-                               var template = new Array();\r
-\r
-                               template['file']   = '../../plugins/fullpage/fullpage.htm';\r
-                               template['width']  = 430;\r
-                               template['height'] = 485 + (tinyMCE.isOpera ? 5 : 0);\r
-\r
-                               template['width'] += tinyMCE.getLang('lang_fullpage_delta_width', 0);\r
-                               template['height'] += tinyMCE.getLang('lang_fullpage_delta_height', 0);\r
-\r
-                               tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});\r
-                       return true;\r
-\r
-                       case "mceFullPageUpdate":\r
-                               TinyMCE_FullPagePlugin._addToHead(tinyMCE.getInstanceById(editor_id));\r
-                               return true;\r
-          }\r
-\r
-          // Pass to next handler in chain\r
-          return false;\r
-       },\r
-\r
-       cleanup : function(type, content, inst) {\r
-               switch (type) {\r
-                       case "insert_to_editor":\r
-                               var tmp = content.toLowerCase();\r
-                               var pos = tmp.indexOf('<body'), pos2;\r
-\r
-                               // Split page in header and body chunks\r
-                               if (pos != -1) {\r
-                                       pos = tmp.indexOf('>', pos);\r
-                                       pos2 = tmp.lastIndexOf('</body>');\r
-                                       inst.fullpageTopContent = content.substring(0, pos + 1);\r
-                                       content = content.substring(pos + 1, pos2);\r
-                                       // tinyMCE.debug(inst.fullpageTopContent, content);\r
-                               } else {\r
-                                       if (!inst.fullpageTopContent) {\r
-                                               var docType = tinyMCE.getParam("fullpage_default_doctype", '<!DOCTYPE html PUBLIC "-/'+'/W3C//DTD XHTML 1.0 Transitional/'+'/EN" "http:/'+'/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');\r
-                                               var enc = tinyMCE.getParam("fullpage_default_encoding", 'utf-8');\r
-                                               var title = tinyMCE.getParam("fullpage_default_title", 'Untitled document');\r
-                                               var lang = tinyMCE.getParam("fullpage_default_langcode", 'en');\r
-                                               var pi = tinyMCE.getParam("fullpage_default_xml_pi", true);\r
-                                               var ff = tinyMCE.getParam("fullpage_default_font_family", "");\r
-                                               var fz = tinyMCE.getParam("fullpage_default_font_size", "");\r
-                                               var ds = tinyMCE.getParam("fullpage_default_style", "");\r
-                                               var dtc = tinyMCE.getParam("fullpage_default_text_color", "");\r
-\r
-                                               // Xml encode it\r
-                                               title = title.replace(/&/g, '&amp;');\r
-                                               title = title.replace(/\"/g, '&quot;');\r
-                                               title = title.replace(/</g, '&lt;');\r
-                                               title = title.replace(/>/g, '&gt;');\r
-\r
-                                               tmp = '';\r
-\r
-                                               // Make default chunk\r
-                                               if (pi)\r
-                                                       tmp += '<?xml version="1.0" encoding="' + enc + '"?>\n';\r
-\r
-                                               tmp += docType + '\n';\r
-                                               tmp += '<html xmlns="http:/'+'/www.w3.org/1999/xhtml" lang="' + lang + '" xml:lang="' + lang + '">\n';\r
-                                               tmp += '<head>\n';\r
-                                               tmp += '\t<title>' + title + '</title>\n';\r
-                                               tmp += '\t<meta http-equiv="Content-Type" content="text/html; charset=' + enc + '" />\n';\r
-                                               tmp += '</head>\n';\r
-                                               tmp += '<body';\r
-\r
-                                               if (ff != '' || fz != '') {\r
-                                                       tmp += ' style="';\r
-\r
-                                                       if (ds != '')\r
-                                                               tmp += ds + ";";\r
-\r
-                                                       if (ff != '')\r
-                                                               tmp += 'font-family: ' + ff + ";";\r
-\r
-                                                       if (fz != '')\r
-                                                               tmp += 'font-size: ' + fz + ";";\r
-\r
-                                                       tmp += '"';\r
-                                               }\r
-\r
-                                               if (dtc != '')\r
-                                                       tmp += ' text="' + dtc + '"';\r
-\r
-                                               tmp += '>\n';\r
-\r
-                                               inst.fullpageTopContent = tmp;\r
-                                       }\r
-                               }\r
-\r
-                               this._addToHead(inst);\r
-\r
-                               break;\r
-\r
-                       case "get_from_editor":\r
-                               if (inst.fullpageTopContent && !tinyMCE.getParam("fullpage_hide_in_source_view", false)) {\r
-                                       content = content.replace(/(\s)?mce\_[a-z_]+\=[^\s>]+(\s|\>)/i, ''); // Remove internal stuff\r
-                                       content = inst.fullpageTopContent + content + "\n</body>\n</html>";\r
-                               }\r
-\r
-                               break;\r
-\r
-                       case "submit_content":\r
-                               if (inst.fullpageTopContent && tinyMCE.getParam("fullpage_hide_in_source_view", false))\r
-                                       content = inst.fullpageTopContent + content + "\n</body>\n</html>";\r
-\r
-                               break;\r
-               }\r
-\r
-               // Pass through to next handler in chain\r
-               return content;\r
-       },\r
-\r
-       // Private plugin internal methods\r
-\r
-       _addToHead : function(inst) {\r
-               var doc = inst.getDoc();\r
-               var head = doc.getElementsByTagName("head")[0];\r
-               var body = doc.body;\r
-               var h = inst.fullpageTopContent;\r
-               var e = doc.createElement("body");\r
-               var nl, i, le, tmp;\r
-\r
-               // Remove stuff we don't want\r
-               h = h.replace(/(\r|\n)/gi, '');\r
-               h = h.replace(/<\?[^\>]*\>/gi, '');\r
-               h = h.replace(/<\/?(!DOCTYPE|head|html)[^\>]*\>/gi, '');\r
-               h = h.replace(/<script(.*?)<\/script>/gi, '');\r
-               h = h.replace(/<title(.*?)<\/title>/gi, '');\r
-               h = h.replace(/<(meta|base)[^>]*>/gi, '');\r
-\r
-               // Make link and style elements into pre\r
-               h = h.replace(/<link([^>]*)\/>/gi, '<pre mce_type="link" $1></pre>');\r
-               //h = h.replace(/<style([^>]*)>(.*?)<\/style>/gi, '<pre mce_type="style" $1>$2</pre>');\r
-\r
-               // Make body a div\r
-               h = h.replace(/<body/gi, '<div mce_type="body"');\r
-               h += '</div>';\r
-\r
-               // Now crapy MSIE can parse it\r
-               e.innerHTML = h;\r
-\r
-               // Reset all body attributes\r
-               body.vLink = body.aLink = body.link = body.text = '';\r
-               body.style.cssText = '';\r
-\r
-               // Delete all old links\r
-               nl = head.getElementsByTagName('link');\r
-               for (i=0; i<nl.length; i++) {\r
-                       if (tinyMCE.getAttrib(nl[i], 'mce_head') == "true")\r
-                               nl[i].parentNode.removeChild(nl[i]);\r
-               }\r
-\r
-               // Add link elements\r
-               nl = e.getElementsByTagName('pre');\r
-               for (i=0; i<nl.length; i++) {\r
-                       tmp = tinyMCE.getAttrib(nl[i], 'media');\r
-                       if (tinyMCE.getAttrib(nl[i], 'mce_type') == "link" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCE.getAttrib(nl[i], 'rel') == "stylesheet") {\r
-                               le = doc.createElement("link");\r
-\r
-                               le.rel = "stylesheet";\r
-                               le.href = tinyMCE.getAttrib(nl[i], 'href');\r
-                               le.setAttribute("mce_head", "true");\r
-\r
-                               head.appendChild(le);\r
-                       }\r
-               }\r
-\r
-               // Add body attributes\r
-               nl = e.getElementsByTagName('div');\r
-               if (nl.length > 0) {\r
-                       body.style.cssText = tinyMCE.getAttrib(nl[0], 'style');\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'leftmargin')) != '' && body.style.marginLeft == '')\r
-                               body.style.marginLeft = tmp + "px";\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'rightmargin')) != '' && body.style.marginRight == '')\r
-                               body.style.marginRight = tmp + "px";\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'topmargin')) != '' && body.style.marginTop == '')\r
-                               body.style.marginTop = tmp + "px";\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'bottommargin')) != '' && body.style.marginBottom == '')\r
-                               body.style.marginBottom = tmp + "px";\r
-\r
-                       body.dir = tinyMCE.getAttrib(nl[0], 'dir');\r
-                       body.vLink = tinyMCE.getAttrib(nl[0], 'vlink');\r
-                       body.aLink = tinyMCE.getAttrib(nl[0], 'alink');\r
-                       body.link = tinyMCE.getAttrib(nl[0], 'link');\r
-                       body.text = tinyMCE.getAttrib(nl[0], 'text');\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'background')) != '')\r
-                               body.style.backgroundImage = "url('" + tmp + "')";\r
-\r
-                       if ((tmp = tinyMCE.getAttrib(nl[0], 'bgcolor')) != '')\r
-                               body.style.backgroundColor = tmp;\r
-               }\r
-       }\r
-};\r
-\r
-tinyMCE.addPlugin("fullpage", TinyMCE_FullPagePlugin);\r