aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js
diff options
context:
space:
mode:
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js17
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js14
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js8
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js17
4 files changed, 10 insertions, 46 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
index d62a219e6..9c99995ad 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
@@ -53,7 +53,6 @@ function insertAction() {
var inst = tinyMCEPopup.editor;
var elm = inst.selection.getNode();
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
setAllAttribs(elm);
tinyMCEPopup.execCommand("mceEndUndoLevel");
tinyMCEPopup.close();
@@ -72,21 +71,7 @@ function setAttrib(elm, attrib, value) {
value = valueElm.value;
}
- if (value != "") {
- dom.setAttrib(elm, attrib.toLowerCase(), value);
-
- if (attrib == "style")
- attrib = "style.cssText";
-
- if (attrib.substring(0, 2) == 'on')
- value = 'return true;' + value;
-
- if (attrib == "class")
- attrib = "className";
-
- elm[attrib]=value;
- } else
- elm.removeAttribute(attrib);
+ dom.setAttrib(elm, attrib.toLowerCase(), value);
}
function setAllAttribs(elm) {
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js
index 9e5d8c571..1f957dc78 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js
@@ -21,17 +21,17 @@ function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
+ elm.removeAttribute('data-mce-new');
}
function insertDel() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
insertInlineElement('del');
- var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
+ var elementArray = SXE.inst.dom.select('del[data-mce-new]');
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
@@ -45,16 +45,6 @@ function insertDel() {
tinyMCEPopup.close();
}
-function insertInlineElement(en) {
- var ed = tinyMCEPopup.editor, dom = ed.dom;
-
- ed.getDoc().execCommand('FontName', false, 'mceinline');
- tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
- if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
- dom.replace(dom.create(en), n, 1);
- });
-}
-
function removeDel() {
SXE.removeElement('del');
tinyMCEPopup.close();
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
index 5b494a566..4e5d9c3bb 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
@@ -154,7 +154,6 @@ SXE.initElementDialog = function(element_name) {
SXE.insertElement = function(element_name) {
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
@@ -165,11 +164,11 @@ SXE.insertElement = function(element_name) {
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
- if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {
+ if (SXE.inst.dom.getAttrib(elm, 'data-mce-new')) {
elm.id = '';
elm.setAttribute('id', '');
elm.removeAttribute('id');
- elm.removeAttribute('_mce_new');
+ elm.removeAttribute('data-mce-new');
setAllCommonAttribs(elm);
}
@@ -186,7 +185,6 @@ SXE.removeElement = function(element_name){
element_name = element_name.toLowerCase();
elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
tinyMCE.execCommand('mceRemoveNode', false, elm);
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
@@ -226,6 +224,6 @@ function insertInlineElement(en) {
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select('span,font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
- dom.replace(dom.create(en, {_mce_new : 1}), n, 1);
+ dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1);
});
}
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
index 3774f0a18..c4addfb01 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
@@ -21,16 +21,17 @@ function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
+ elm.removeAttribute('data-mce-new');
}
function insertIns() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
+
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
- insertInlineElement('INS');
- var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
+ insertInlineElement('ins');
+ var elementArray = SXE.inst.dom.select('ins[data-mce-new]');
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
@@ -49,14 +50,4 @@ function removeIns() {
tinyMCEPopup.close();
}
-function insertInlineElement(en) {
- var ed = tinyMCEPopup.editor, dom = ed.dom;
-
- ed.getDoc().execCommand('FontName', false, 'mceinline');
- tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
- if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
- dom.replace(dom.create(en), n, 1);
- });
-}
-
tinyMCEPopup.onInit.add(init);