]> code.citadel.org Git - citadel.git/blobdiff - webcit/tiny_mce/plugins/fullpage/js/fullpage.js
Upgrade TinyMCE
[citadel.git] / webcit / tiny_mce / plugins / fullpage / js / fullpage.js
index 89059ef6670a4cbb12cc718ae4c62befebf1ae75..a1bb719a383e61708aaccd6a9e237bfbc55a870c 100644 (file)
@@ -1,3 +1,13 @@
+/**\r
+ * fullpage.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
 tinyMCEPopup.requireLangPack();\r
 \r
 var doc;\r
@@ -114,7 +124,7 @@ function init() {
        // Preprocess the HTML disable scripts and urls\r
        h = h.replace(/<script>/gi, '<script type="text/javascript">');\r
        h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');\r
-       h = h.replace(/(src=|href=)/g, 'mce_$1');\r
+       h = h.replace(/(src=|href=)/g, '_mce_$1');\r
 \r
        // Write in the content in the iframe\r
        doc.write(h + '</body></html>');\r
@@ -123,7 +133,7 @@ function init() {
        // Parse xml and doctype\r
        xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
        xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
-       docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);\r
+       docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');\r
        f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);\r
 \r
        // Parse title\r
@@ -170,7 +180,7 @@ function init() {
                var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';\r
 \r
                if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {\r
-                       f.stylesheet.value = l.getAttribute('mce_href', 2) || '';\r
+                       f.stylesheet.value = l.getAttribute('_mce_href', 2) || '';\r
                        return false;\r
                }\r
        });\r
@@ -268,8 +278,8 @@ function updateAction() {
        // Fix scripts without a type\r
        nl = doc.getElementsByTagName('script');\r
        for (i=0; i<nl.length; i++) {\r
-               if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')\r
-                       nl[i].setAttribute('mce_type', 'text/javascript');\r
+               if (tinyMCEPopup.dom.getAttrib(nl[i], '_mce_type') == '')\r
+                       nl[i].setAttribute('_mce_type', 'text/javascript');\r
        }\r
 \r
        // Get primary stylesheet\r
@@ -279,13 +289,13 @@ function updateAction() {
 \r
                tmp = tinyMCEPopup.dom.getAttrib(l, 'media');\r
 \r
-               if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {\r
+               if (tinyMCEPopup.dom.getAttrib(l, '_mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {\r
                        addlink = false;\r
 \r
                        if (f.stylesheet.value == '')\r
                                l.parentNode.removeChild(l);\r
                        else\r
-                               l.setAttribute('mce_href', f.stylesheet.value);\r
+                               l.setAttribute('_mce_href', f.stylesheet.value);\r
 \r
                        break;\r
                }\r
@@ -296,7 +306,7 @@ function updateAction() {
                l = doc.createElement('link');\r
 \r
                l.setAttribute('type', 'text/css');\r
-               l.setAttribute('mce_href', f.stylesheet.value);\r
+               l.setAttribute('_mce_href', f.stylesheet.value);\r
                l.setAttribute('rel', 'stylesheet');\r
 \r
                head.appendChild(l);\r