Added TinyMCE editor functions & Updated TinyMCE to TinyMCE-jQuery 3.4b1
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
/**
|
||||
* fullpage.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var doc;
|
||||
@@ -114,7 +124,7 @@ function init() {
|
||||
// Preprocess the HTML disable scripts and urls
|
||||
h = h.replace(/<script>/gi, '<script type="text/javascript">');
|
||||
h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
|
||||
h = h.replace(/(src=|href=)/g, 'mce_$1');
|
||||
h = h.replace(/(src=|href=)/g, 'data-mce-$1');
|
||||
|
||||
// Write in the content in the iframe
|
||||
doc.write(h + '</body></html>');
|
||||
@@ -123,7 +133,7 @@ function init() {
|
||||
// Parse xml and doctype
|
||||
xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
|
||||
xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
|
||||
docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
|
||||
docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
|
||||
f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
|
||||
|
||||
// Parse title
|
||||
@@ -170,7 +180,7 @@ function init() {
|
||||
var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
|
||||
|
||||
if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
|
||||
f.stylesheet.value = l.getAttribute('mce_href', 2) || '';
|
||||
f.stylesheet.value = l.getAttribute('data-mce-href', 2) || '';
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -268,8 +278,8 @@ function updateAction() {
|
||||
// Fix scripts without a type
|
||||
nl = doc.getElementsByTagName('script');
|
||||
for (i=0; i<nl.length; i++) {
|
||||
if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')
|
||||
nl[i].setAttribute('mce_type', 'text/javascript');
|
||||
if (tinyMCEPopup.dom.getAttrib(nl[i], 'data-mce-type') == '')
|
||||
nl[i].setAttribute('mce-type', 'text/javascript');
|
||||
}
|
||||
|
||||
// Get primary stylesheet
|
||||
@@ -279,13 +289,13 @@ function updateAction() {
|
||||
|
||||
tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
|
||||
|
||||
if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
|
||||
if (tinyMCEPopup.dom.getAttrib(l, 'data-mce-type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
|
||||
addlink = false;
|
||||
|
||||
if (f.stylesheet.value == '')
|
||||
l.parentNode.removeChild(l);
|
||||
else
|
||||
l.setAttribute('mce_href', f.stylesheet.value);
|
||||
l.setAttribute('data-mce-href', f.stylesheet.value);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -296,7 +306,7 @@ function updateAction() {
|
||||
l = doc.createElement('link');
|
||||
|
||||
l.setAttribute('type', 'text/css');
|
||||
l.setAttribute('mce_href', f.stylesheet.value);
|
||||
l.setAttribute('data-mce-href', f.stylesheet.value);
|
||||
l.setAttribute('rel', 'stylesheet');
|
||||
|
||||
head.appendChild(l);
|
||||
@@ -309,13 +319,22 @@ function updateAction() {
|
||||
setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
|
||||
setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
|
||||
|
||||
doc.body.dir = getSelectValue(f, 'langdir');
|
||||
setAttr(doc.body, 'dir', getSelectValue(f, 'langdir'));
|
||||
doc.body.style.cssText = f.style.value;
|
||||
|
||||
doc.body.setAttribute('vLink', f.visited_color.value);
|
||||
doc.body.setAttribute('link', f.link_color.value);
|
||||
doc.body.setAttribute('text', f.textcolor.value);
|
||||
doc.body.setAttribute('aLink', f.active_color.value);
|
||||
function setAttr(elm, name, value) {
|
||||
value = "" + value;
|
||||
|
||||
if (value.length > 0)
|
||||
elm.setAttribute(name, value);
|
||||
else
|
||||
elm.removeAttribute(name, value);
|
||||
}
|
||||
|
||||
setAttr(doc.body, 'vLink', f.visited_color.value);
|
||||
setAttr(doc.body, 'link', f.link_color.value);
|
||||
setAttr(doc.body, 'text', f.textcolor.value);
|
||||
setAttr(doc.body, 'aLink', f.active_color.value);
|
||||
|
||||
doc.body.style.fontFamily = getSelectValue(f, 'fontface');
|
||||
doc.body.style.fontSize = getSelectValue(f, 'fontsize');
|
||||
@@ -334,8 +353,8 @@ function updateAction() {
|
||||
doc.body.style.marginTop = f.topmargin.value + 'px';
|
||||
|
||||
html = doc.getElementsByTagName('html')[0];
|
||||
html.setAttribute('lang', f.langcode.value);
|
||||
html.setAttribute('xml:lang', f.langcode.value);
|
||||
setAttr(html, 'lang', f.langcode.value);
|
||||
setAttr(html, 'xml:lang', f.langcode.value);
|
||||
|
||||
if (f.bgimage.value != '')
|
||||
doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
|
||||
|
Reference in New Issue
Block a user