From b4e155258f48a023210c7f7a4dfa6e1033391600 Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Thu, 12 Apr 2012 20:46:37 +1200 Subject: [PATCH] API-CHANGE Move tinymce plugins in thirdparty --- .../tinymce_ssbuttons/editor_plugin_src.js | 52 +++++++++++++ thirdparty/tinymce_ssbuttons/img/flash.gif | Bin 0 -> 241 bytes thirdparty/tinymce_ssbuttons/langs/de.js | 5 ++ thirdparty/tinymce_ssbuttons/langs/en.js | 5 ++ .../tinymce_ssmacron/editor_plugin_src.js | 46 ++++++++++++ thirdparty/tinymce_ssmacron/img/macron.png | Bin 0 -> 3260 bytes thirdparty/tinymce_ssmacron/js/macron.js | 71 ++++++++++++++++++ thirdparty/tinymce_ssmacron/macron.htm | 31 ++++++++ 8 files changed, 210 insertions(+) create mode 100644 thirdparty/tinymce_ssbuttons/editor_plugin_src.js create mode 100644 thirdparty/tinymce_ssbuttons/img/flash.gif create mode 100644 thirdparty/tinymce_ssbuttons/langs/de.js create mode 100644 thirdparty/tinymce_ssbuttons/langs/en.js create mode 100644 thirdparty/tinymce_ssmacron/editor_plugin_src.js create mode 100644 thirdparty/tinymce_ssmacron/img/macron.png create mode 100644 thirdparty/tinymce_ssmacron/js/macron.js create mode 100644 thirdparty/tinymce_ssmacron/macron.htm diff --git a/thirdparty/tinymce_ssbuttons/editor_plugin_src.js b/thirdparty/tinymce_ssbuttons/editor_plugin_src.js new file mode 100644 index 000000000..699f5f9e0 --- /dev/null +++ b/thirdparty/tinymce_ssbuttons/editor_plugin_src.js @@ -0,0 +1,52 @@ +(function() { + + // TinyMCE will stop loading if it encounters non-existent external script file + // when included through tiny_mce_gzip.php. Only load the external lang package if it is available. + var availableLangs = ['en', 'de']; + if(jQuery.inArray(tinymce.settings.language, availableLangs) != -1) { + tinymce.PluginManager.requireLangPack("ssbuttons"); + } + + var each = tinymce.each; + + tinymce.create('tinymce.plugins.SSButtons', { + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @returns Name/value array containing information about the plugin. + * @type Array + */ + getInfo : function() { + return { + longname : 'Special buttons for SilverStripe CMS', + author : 'Sam Minnée', + authorurl : 'http://www.siverstripe.com/', + infourl : 'http://www.silverstripe.com/', + version : "1.0" + }; + }, + + init : function(ed, url) { + ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'}); + ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'}); + + ed.addCommand("sslink", function(ed) { + jQuery('#Form_EditorToolbarLinkForm').entwine('ss').open(); + }); + + ed.addCommand("ssimage", function(ed) { + jQuery('#Form_EditorToolbarMediaForm').entwine('ss').open(); + }); + + // Disable link button when no link is selected + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('sslink', co && n.nodeName != 'A'); + cm.setActive('sslink', n.nodeName == 'A' && !n.name); + }); + } + }); + + // Adds the plugin class to the list of available TinyMCE plugins + tinymce.PluginManager.add("ssbuttons", tinymce.plugins.SSButtons); +})(); \ No newline at end of file diff --git a/thirdparty/tinymce_ssbuttons/img/flash.gif b/thirdparty/tinymce_ssbuttons/img/flash.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb192e6ceda8d19ad8e7d08dd1cfde0aa72ead2a GIT binary patch literal 241 zcmVOzlLa+Za}7>m0&NpCfJ0FQc3~F7DE)S%o1)Qi1n@vxX46qnD4hRS-NE*Pw!4UvE=#^N( literal 0 HcmV?d00001 diff --git a/thirdparty/tinymce_ssbuttons/langs/de.js b/thirdparty/tinymce_ssbuttons/langs/de.js new file mode 100644 index 000000000..0948d6ff2 --- /dev/null +++ b/thirdparty/tinymce_ssbuttons/langs/de.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('de.tinymce_ssbuttons',{ +insertlink: 'Link einfügen', +insertimage: 'Bild einfügen', +insertflash: 'Flash Objekt einfügen' +}); \ No newline at end of file diff --git a/thirdparty/tinymce_ssbuttons/langs/en.js b/thirdparty/tinymce_ssbuttons/langs/en.js new file mode 100644 index 000000000..91ed8fb0d --- /dev/null +++ b/thirdparty/tinymce_ssbuttons/langs/en.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('en.tinymce_ssbuttons', { +insertlink: 'Insert Link', +insertimage: 'Insert Image', +insertflash: 'Insert Flash Object' +}); \ No newline at end of file diff --git a/thirdparty/tinymce_ssmacron/editor_plugin_src.js b/thirdparty/tinymce_ssmacron/editor_plugin_src.js new file mode 100644 index 000000000..d30bd634c --- /dev/null +++ b/thirdparty/tinymce_ssmacron/editor_plugin_src.js @@ -0,0 +1,46 @@ +(function() { + var each = tinymce.each; + + /** + * Load via: + * HtmlEditorConfig::get('cms')->enablePlugins(array('ssmacron', '../tinymce_ssmacron')) + * HtmlEditorConfig::get('cms')->insertButtonsAfter ('advcode', 'ssmacron'); + */ + tinymce.create('tinymce.plugins.InsertMacron', { + getInfo : function() { + return { + longname : 'Button to insert macrons', + author : 'Hamish Friedlander. Heavily based on charmap that comes with TinyMCE', + authorurl : 'http://www.siverstripe.com/', + infourl : 'http://www.silverstripe.com/', + version : "1.0" + }; + }, + + + init : function(ed, url) { + // Register commands + ed.addCommand('mceInsertMacron', function() { + ed.windowManager.open({ + file : url + '/macron.htm', + width : 350 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 150 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('ssmacron', { + title : 'Insert a Macron', + cmd : 'mceInsertMacron', + image : url + '/img/macron.png' + }); + + } + }); + + // Adds the plugin class to the list of available TinyMCE plugins + tinymce.PluginManager.add("ssmacron", tinymce.plugins.InsertMacron); +})(); diff --git a/thirdparty/tinymce_ssmacron/img/macron.png b/thirdparty/tinymce_ssmacron/img/macron.png new file mode 100644 index 0000000000000000000000000000000000000000..80caf6dab1e5b64a1090f34c79faec373177839d GIT binary patch literal 3260 zcmV;t3`6s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_?4H~`jWX_Y}r?RIL&&qyQ|9R_k ztLNYS;`>X_Sp3-V3;B!BzpiXHU@Ojxjee3GFxc*yQMcEMlfr6-r z7r`LN!&0Y+DEh8?5M#YYU7|y$I(|p#RuO$2tdP1yL>DO#^@}`o5G;bgKDBl_1zilc zTQtWR-jA7qHvs=#*tQiinT*3UO<52G-tBhtlv2Ut@$iOWtOtXEx$WKYZH3Kdb8fL% zTmyhF0Pr0EY?36=@px2ofZdzMHfZiU0) zCyX)FH0`1#P*v4^N-6sN{@cZ3QANaK006qKH(f3lMx)X5mO!584|tx(N~Kc&m20(H z{y-q`n&UXER;#Bhf$4Pms@-nKP$={~9*^s(RBA60iA)J0NC?4jIJ`d|kKH?ih{$W2 zc9&9$PNx$YW2h*~fglK1Y&P4WD2nTDw|i#ipF#*(PN&n$jYi`RV~j4B%WtF6=nWxc ut*Yu{#+c~!df)BbVYyr;R'; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += ''; + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmN.innerHTML = codeN; +} diff --git a/thirdparty/tinymce_ssmacron/macron.htm b/thirdparty/tinymce_ssmacron/macron.htm new file mode 100644 index 000000000..b6108dee2 --- /dev/null +++ b/thirdparty/tinymce_ssmacron/macron.htm @@ -0,0 +1,31 @@ + + + + Insert a Macron + + + + + + + + + + + + +
Insert a Macron
+ + + + + + + + + +
 
 
+
+ + +