diff options
author | alecpl <alec@alec.pl> | 2009-04-27 07:36:26 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-04-27 07:36:26 +0000 |
commit | 29da6414db77512106250b9832a0b4a0168bd7eb (patch) | |
tree | d3f36001953d24292166ef3ab1b62e87b3b89cf6 /program/js/tiny_mce/plugins/xhtmlxtras | |
parent | 1fb5874f276e9ce7731e8f166b19a371ce33b894 (diff) |
- Updated TinyMCE to 3.2.3 version
Diffstat (limited to 'program/js/tiny_mce/plugins/xhtmlxtras')
11 files changed, 57 insertions, 31 deletions
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/abbr.htm b/program/js/tiny_mce/plugins/xhtmlxtras/abbr.htm index 580028432..3928a17e1 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -9,7 +9,6 @@ <script type="text/javascript" src="js/element_common.js"></script>
<script type="text/javascript" src="js/abbr.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup.css" />
- <base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertAbbr();return false;" action="#">
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/acronym.htm b/program/js/tiny_mce/plugins/xhtmlxtras/acronym.htm index 54e4c9d9e..4d4ebaac0 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -9,7 +9,6 @@ <script type="text/javascript" src="js/element_common.js"></script>
<script type="text/javascript" src="js/acronym.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup.css" />
- <base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertAcronym();return false;" action="#">
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/attributes.htm b/program/js/tiny_mce/plugins/xhtmlxtras/attributes.htm index cfbb409ab..322b468e3 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -8,7 +8,6 @@ <script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/attributes.js"></script>
<link rel="stylesheet" type="text/css" href="css/attributes.css" />
- <base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertAction();return false;" action="#">
@@ -36,12 +35,12 @@ <td><label id="classlabel" for="classlist">{#class_name}</label></td>
<td>
<select id="classlist" name="classlist" class="mceEditableSelect">
- <option value="" selected>{#not_set}</option>
+ <option value="" selected="selected">{#not_set}</option>
</select>
</td>
</tr>
<tr>
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
<td><input id="style" name="style" type="text" value="" /></td>
</tr>
<tr>
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/cite.htm b/program/js/tiny_mce/plugins/xhtmlxtras/cite.htm index 7d9eaba4d..cdfaf4e85 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/cite.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -9,7 +9,6 @@ <script type="text/javascript" src="js/element_common.js"></script>
<script type="text/javascript" src="js/cite.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup.css" />
- <base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertCite();return false;" action="#">
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/del.htm b/program/js/tiny_mce/plugins/xhtmlxtras/del.htm index d03c4568a..f45676e3d 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/del.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/del.htm @@ -9,7 +9,6 @@ <script type="text/javascript" src="js/element_common.js"></script>
<script type="text/javascript" src="js/del.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup.css" />
- <base target="_self" />
</head>
<body id="xhtmlxtrasins" style="display: none">
<form onsubmit="insertDel();return false;" action="#">
@@ -31,7 +30,7 @@ <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
- <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
</tr>
</table>
</td>
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js index 6a3270d35..8c7f48e69 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ b/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');if(n){cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}else{cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})();
\ No newline at end of file +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(b,c){b.addCommand("mceCite",function(){b.windowManager.open({file:c+"/cite.htm",width:350+parseInt(b.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:c})});b.addCommand("mceAcronym",function(){b.windowManager.open({file:c+"/acronym.htm",width:350+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAbbr",function(){b.windowManager.open({file:c+"/abbr.htm",width:350+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceDel",function(){b.windowManager.open({file:c+"/del.htm",width:340+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceIns",function(){b.windowManager.open({file:c+"/ins.htm",width:340+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAttributes",function(){b.windowManager.open({file:c+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:c})});b.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});b.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});b.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});b.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});b.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});b.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});if(tinymce.isIE){function a(d,e){if(e.set){e.content=e.content.replace(/<abbr([^>]+)>/gi,"<html:abbr $1>");e.content=e.content.replace(/<\/abbr>/gi,"</html:abbr>")}}b.onBeforeSetContent.add(a);b.onPostProcess.add(a)}b.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"CITE,ACRONYM,ABBR,DEL,INS");d.setDisabled("cite",f);d.setDisabled("acronym",f);d.setDisabled("abbr",f);d.setDisabled("del",f);d.setDisabled("ins",f);d.setDisabled("attribs",g&&g.nodeName=="BODY");d.setActive("cite",0);d.setActive("acronym",0);d.setActive("abbr",0);d.setActive("del",0);d.setActive("ins",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1)}while(g=g.parentNode)}})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})();
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js index 143ed9216..bef06f2d2 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -104,16 +104,18 @@ cm.setDisabled('del', co);
cm.setDisabled('ins', co);
cm.setDisabled('attribs', n && n.nodeName == 'BODY');
+ cm.setActive('cite', 0);
+ cm.setActive('acronym', 0);
+ cm.setActive('abbr', 0);
+ cm.setActive('del', 0);
+ cm.setActive('ins', 0);
+ // Activate all
if (n) {
- cm.setDisabled(n.nodeName.toLowerCase(), 0);
- cm.setActive(n.nodeName.toLowerCase(), 1);
- } else {
- cm.setActive('cite', 0);
- cm.setActive('acronym', 0);
- cm.setActive('abbr', 0);
- cm.setActive('del', 0);
- cm.setActive('ins', 0);
+ do {
+ cm.setDisabled(n.nodeName.toLowerCase(), 0);
+ cm.setActive(n.nodeName.toLowerCase(), 1);
+ } while (n = n.parentNode);
}
});
},
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/ins.htm b/program/js/tiny_mce/plugins/xhtmlxtras/ins.htm index c0f056ff3..9fa21c433 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/ins.htm +++ b/program/js/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -9,7 +9,6 @@ <script type="text/javascript" src="js/element_common.js"></script>
<script type="text/javascript" src="js/ins.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup.css" />
- <base target="_self" />
</head>
<body id="xhtmlxtrasins" style="display: none">
<form onsubmit="insertIns();return false;" action="#">
@@ -31,7 +30,7 @@ <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
- <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
</tr>
</table>
</td>
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js b/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js index 005a619c7..7049f2beb 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js +++ b/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -27,7 +27,7 @@ function insertDel() { if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
- tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
+ insertInlineElement('del');
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
@@ -42,6 +42,16 @@ 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/program/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/program/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js index cc11835fa..70f168a6b 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js +++ b/program/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js @@ -160,19 +160,19 @@ SXE.insertElement = function(element_name) { if (tinymce.isIE && element_name.indexOf('html:') == 0)
element_name = element_name.substring(5).toLowerCase();
- h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
-
- tinyMCEPopup.execCommand('mceInsertContent', false, h);
-
- var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});
+ insertInlineElement(element_name);
+ var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
- elm.id = '';
- elm.setAttribute('id', '');
- elm.removeAttribute('id');
+ if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {
+ elm.id = '';
+ elm.setAttribute('id', '');
+ elm.removeAttribute('id');
+ elm.removeAttribute('_mce_new');
- setAllCommonAttribs(elm);
+ setAllCommonAttribs(elm);
+ }
}
}
} else {
@@ -218,4 +218,14 @@ SXE.removeClass = function(elm,cl) { SXE.addClass = function(elm,cl) {
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
return true;
-}
\ No newline at end of file +}
+
+function insertInlineElement(en) {
+ var ed = tinyMCEPopup.editor, dom = ed.dom;
+
+ 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);
+ });
+}
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/js/ins.js b/program/js/tiny_mce/plugins/xhtmlxtras/js/ins.js index b03ca1b5e..4fcc99825 100644 --- a/program/js/tiny_mce/plugins/xhtmlxtras/js/ins.js +++ b/program/js/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -26,7 +26,7 @@ function insertIns() { if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
- tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
+ insertInlineElement('INS');
var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
@@ -46,4 +46,14 @@ 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);
|