From 6fa5b437a48485927e5d90abe061ee723f3b45c2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 20 Jan 2014 18:46:28 +0100 Subject: Update to TinyMCE 4.x --- program/js/tiny_mce/plugins/template/blank.htm | 12 -- .../js/tiny_mce/plugins/template/css/template.css | 23 --- .../js/tiny_mce/plugins/template/editor_plugin.js | 1 - .../tiny_mce/plugins/template/editor_plugin_src.js | 159 --------------------- .../js/tiny_mce/plugins/template/js/template.js | 106 -------------- .../js/tiny_mce/plugins/template/langs/ar_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/az_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/bg_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/bn_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/br_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/bs_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ca_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/cs_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/cy_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/da_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/de_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/el_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/en_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/eo_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/es_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/et_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/eu_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/fa_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/fi_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/fr_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/gl_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/he_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/hi_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/hr_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/hu_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/hy_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/id_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/is_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/it_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ja_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ka_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ko_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/lt_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/lv_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/mk_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ms_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/nb_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/nl_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/nn_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/pl_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ps_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/pt_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ro_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ru_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/si_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/sk_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/sl_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/sq_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/sr_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/sv_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/ta_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/th_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/tr_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/uk_dlg.js | 1 - .../js/tiny_mce/plugins/template/langs/vi_dlg.js | 1 - .../tiny_mce/plugins/template/langs/zh-cn_dlg.js | 1 - .../tiny_mce/plugins/template/langs/zh-tw_dlg.js | 1 - program/js/tiny_mce/plugins/template/template.htm | 31 ---- 63 files changed, 389 deletions(-) delete mode 100644 program/js/tiny_mce/plugins/template/blank.htm delete mode 100644 program/js/tiny_mce/plugins/template/css/template.css delete mode 100644 program/js/tiny_mce/plugins/template/editor_plugin.js delete mode 100644 program/js/tiny_mce/plugins/template/editor_plugin_src.js delete mode 100644 program/js/tiny_mce/plugins/template/js/template.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ar_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/az_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/bg_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/bn_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/br_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/bs_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ca_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/cs_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/cy_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/da_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/de_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/el_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/en_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/eo_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/es_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/et_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/eu_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/fa_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/fi_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/fr_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/gl_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/he_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/hi_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/hr_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/hu_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/hy_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/id_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/is_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/it_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ja_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ka_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ko_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/lt_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/lv_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/mk_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ms_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/nb_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/nl_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/nn_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/pl_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ps_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/pt_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ro_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ru_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/si_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/sk_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/sl_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/sq_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/sr_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/sv_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/ta_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/th_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/tr_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/uk_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/vi_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/zh-cn_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/langs/zh-tw_dlg.js delete mode 100644 program/js/tiny_mce/plugins/template/template.htm (limited to 'program/js/tiny_mce/plugins/template') diff --git a/program/js/tiny_mce/plugins/template/blank.htm b/program/js/tiny_mce/plugins/template/blank.htm deleted file mode 100644 index ecde53fae..000000000 --- a/program/js/tiny_mce/plugins/template/blank.htm +++ /dev/null @@ -1,12 +0,0 @@ - - - blank_page - - - - - - - diff --git a/program/js/tiny_mce/plugins/template/css/template.css b/program/js/tiny_mce/plugins/template/css/template.css deleted file mode 100644 index 2d23a4938..000000000 --- a/program/js/tiny_mce/plugins/template/css/template.css +++ /dev/null @@ -1,23 +0,0 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} diff --git a/program/js/tiny_mce/plugins/template/editor_plugin.js b/program/js/tiny_mce/plugins/template/editor_plugin.js deleted file mode 100644 index ebe3c27d7..000000000 --- a/program/js/tiny_mce/plugins/template/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - }; - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); - - // Replace mdate - if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - - // Replace selection - if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) - n.innerHTML = sel; - }); - - t._replaceVals(el); - - ed.execCommand('mceInsertContent', false, el.innerHTML); - ed.addVisual(); - }, - - _replaceVals : function(e) { - var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') - vl[k](e); - } - }); - }); - }, - - _getDateTime : function(d, fmt) { - if (!fmt) - return ""; - - function addZeros(value, len) { - var i; - - value = "" + value; - - if (value.length < len) { - for (i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - } - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); -})(); \ No newline at end of file diff --git a/program/js/tiny_mce/plugins/template/js/template.js b/program/js/tiny_mce/plugins/template/js/template.js deleted file mode 100644 index bc3045d24..000000000 --- a/program/js/tiny_mce/plugins/template/js/template.js +++ /dev/null @@ -1,106 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x - - {#template_dlg.title} - - - - - -
-
-
{#template_dlg.desc}
-
- -
-
-
-
- {#template_dlg.preview} - -
-
- -
- - -
-
- - -- cgit v1.2.3