diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/css/advhr.css b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/css/advhr.css new file mode 100644 index 0000000000..0e22834985 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/css/advhr.css @@ -0,0 +1,5 @@ +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin.js new file mode 100644 index 0000000000..4d3b062dee --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin_src.js new file mode 100644 index 0000000000..0c652d3303 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/editor_plugin_src.js @@ -0,0 +1,57 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedHRPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvancedHr', function() { + ed.windowManager.open({ + file : url + '/rule.htm', + width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), + height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('advhr', { + title : 'advhr.advhr_desc', + cmd : 'mceAdvancedHr' + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('advhr', n.nodeName == 'HR'); + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'HR') + ed.selection.select(e); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/js/rule.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/js/rule.js new file mode 100644 index 0000000000..b6cbd66c75 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/advhr/js/rule.js @@ -0,0 +1,43 @@ +var AdvHRDialog = { + init : function(ed) { + var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; + + w = dom.getAttrib(n, 'width'); + f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); + f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; + f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); + selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); + }, + + update : function() { + var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; + + h = '
]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(/
/gi,"\n");b(/
/gi,"\n");b(//gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/bbcode/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 0000000000..4e7eb3377f --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/bbcode/editor_plugin_src.js @@ -0,0 +1,120 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/
(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/ (.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/ (.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/ (.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/ (.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/ (.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(/ /gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/ ]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
/gi,"\n"); + rep(/
/gi,"\n"); + rep(/
/gi,"\n"); + rep(//gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ |\u00a0/gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
"); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin.js new file mode 100644 index 0000000000..221306f34f --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var g=this,h,e;g.editor=d;g.onContextMenu=new tinymce.util.Dispatcher(this);e=d.onContextMenu.add(function(i,j){if(!j.ctrlKey){if(h){i.selection.setRng(h)}g._getMenu(i).showMenu(j.clientX||j.pageX,j.clientY||j.pageX);a.add(i.getDoc(),"click",function(k){f(i,k)});a.cancel(j)}});d.onRemove.add(function(){if(g._menu){g._menu.removeAll()}});function f(i,j){h=null;if(j&&j.button==2){h=i.selection.getRng();return}if(g._menu){g._menu.removeAll();g._menu.destroy();a.remove(i.getDoc(),"click",f)}}d.onMouseDown.add(f);d.onKeyDown.add(f);d.onKeyDown.add(function(i,j){if(j.shiftKey&&!j.ctrlKey&&!j.altKey&&j.keyCode===121){a.cancel(j);e(i,j)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 0000000000..4455910282 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,156 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, lastRng, showMenu; + + t.editor = ed; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + showMenu = ed.onContextMenu.add(function(ed, e) { + if (!e.ctrlKey) { + // Restore the last selection since it was removed + if (lastRng) + ed.selection.setRng(lastRng); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageX); + Event.add(ed.getDoc(), 'click', function(e) { + hide(ed, e); + }); + Event.cancel(e); + } + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + lastRng = null; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + lastRng = ed.selection.getRng(); + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + var keys = UmbClientMgr.uiKeys(); + + m.add({ title: keys['defaultdialogs_cut'], icon: 'cut', cmd: 'Cut' }).setDisabled(col); + m.add({ title: keys['general_copy'], icon: 'copy', cmd: 'Copy' }).setDisabled(col); + m.add({ title: keys['defaultdialogs_paste'], icon: 'paste', cmd: 'Paste' }); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({ title: keys['defaultdialogs_insertlink'], icon: 'link', cmd: ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui: true }); + m.add({ title: keys['relatedlinks_removeLink'], icon: 'unlink', cmd: 'UnLink' }); + } + + m.addSeparator(); + m.add({ title: keys['defaultdialogs_insertimage'], icon: 'image', cmd: ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui: true }); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin.js new file mode 100644 index 0000000000..bce8e73995 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin_src.js new file mode 100644 index 0000000000..4444959bf3 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/directionality/editor_plugin_src.js @@ -0,0 +1,82 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + ed.addCommand('mceDirectionLTR', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "ltr") + ed.dom.setAttrib(e, "dir", "ltr"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addCommand('mceDirectionRTL', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "rtl") + ed.dom.setAttrib(e, "dir", "rtl"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin.js new file mode 100644 index 0000000000..dbdd8ffb58 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin_src.js new file mode 100644 index 0000000000..71d5416972 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,43 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +})(tinymce); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/emotions.htm b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/emotions.htm new file mode 100644 index 0000000000..2c91002e4e --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/emotions.htm @@ -0,0 +1,41 @@ + + + +
{#emotions_dlg.title} + + + + + + + + diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cool.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 0000000000..ba90cc36fb Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cool.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cry.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 0000000000..74d897a4f6 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-cry.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-embarassed.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 0000000000..963a96b8a7 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-foot-in-mouth.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 0000000000..16f68cc1e9 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-frown.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 0000000000..716f55e161 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-frown.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-innocent.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 0000000000..334d49e0e6 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-innocent.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-kiss.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 0000000000..4efd549ed3 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-kiss.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-laughing.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 0000000000..1606c119e7 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-laughing.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-money-mouth.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 0000000000..ca2451e102 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-sealed.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 0000000000..b33d3cca1e Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-sealed.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-smile.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 0000000000..e6a9e60d5d Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-smile.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-surprised.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 0000000000..cb99cdd913 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-surprised.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-tongue-out.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 0000000000..2075dc1605 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-undecided.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 0000000000..bef7e25730 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-undecided.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-wink.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 0000000000..9faf1aff8f Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-wink.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-yell.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 0000000000..648e6e8791 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/img/smiley-yell.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/js/emotions.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/js/emotions.js new file mode 100644 index 0000000000..c549367096 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/js/emotions.js @@ -0,0 +1,22 @@ +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/da_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/da_dlg.js new file mode 100644 index 0000000000..0e37b795e2 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/da_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('da.emotions_dlg',{ +title:"Inds\u00E6t hum\u00F8rikon", +desc:"Hum\u00F8rikoner", +cool:"Cool", +cry:"Gr\u00E6de", +embarassed:"Flov", +foot_in_mouth:"Fod i munden", +frown:"Forskr\u00E6kket", +innocent:"Uskyldig", +kiss:"Kys", +laughing:"Grine", +money_mouth:"Pengemund", +sealed:"Lukket", +smile:"Smil", +surprised:"Overrasket", +tongue_out:"Tunge ud", +undecided:"Ubeslutsom", +wink:"Vink", +yell:"R\u00E5be" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/de_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/de_dlg.js new file mode 100644 index 0000000000..3940a2a54b --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/de_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('de.emotions_dlg',{ +title:"Smiley einf\u00FCgen", +desc:"Smilies", +cool:"Cool", +cry:"Weinend", +embarassed:"Verlegen", +foot_in_mouth:"Reingefallen", +frown:"Stirnrunzelnd", +innocent:"Unschuldig", +kiss:"K\u00FCssend", +laughing:"Lachend", +money_mouth:"Geld", +sealed:"Verschlossen", +smile:"L\u00E4chelnd", +surprised:"\u00DCberrascht", +tongue_out:"Zunge raus", +undecided:"Unentschlossen", +wink:"Zwinkernd", +yell:"Br\u00FCllend" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/en_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/en_dlg.js new file mode 100644 index 0000000000..3b57ad9e3c --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/en_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('en.emotions_dlg',{ +title:"Insert emotion", +desc:"Emotions", +cool:"Cool", +cry:"Cry", +embarassed:"Embarassed", +foot_in_mouth:"Foot in mouth", +frown:"Frown", +innocent:"Innocent", +kiss:"Kiss", +laughing:"Laughing", +money_mouth:"Money mouth", +sealed:"Sealed", +smile:"Smile", +surprised:"Surprised", +tongue_out:"Tongue out", +undecided:"Undecided", +wink:"Wink", +yell:"Yell" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/es_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/es_dlg.js new file mode 100644 index 0000000000..0d95db55d0 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/es_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('es.emotions_dlg',{ +title:"Insertar emoticon", +desc:"Emoticones", +cool:"Todo bien", +cry:"Llora", +embarassed:"Verg\u00FCenza", +foot_in_mouth:"Pie en la boca", +frown:"Triste", +innocent:"Inocente", +kiss:"Beso", +laughing:"Risa", +money_mouth:"Dinero boca", +sealed:"Sellado", +smile:"Sonrisa", +surprised:"Sorprendido", +tongue_out:"Lengua fuera", +undecided:"Indeciso", +wink:"Gui\u00F1o", +yell:"Enfadado" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/fr_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/fr_dlg.js new file mode 100644 index 0000000000..b47571864d --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/fr_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('fr.emotions_dlg',{ +title:"Ins\u00E9rer \u00E9motion", +desc:"\u00C9motions", +cool:"Cool", +cry:"En pleurs", +embarassed:"Embarass\u00E9", +foot_in_mouth:"Pied de nez", +frown:"D\u00E9\u00E7u", +innocent:"Innocent", +kiss:"Bisou", +laughing:"Rigolant", +money_mouth:"Avare", +sealed:"Bouche cousue", +smile:"Sourire", +surprised:"Surpris", +tongue_out:"Langue tir\u00E9e", +undecided:"Non d\u00E9cid\u00E9", +wink:"Clin d'oeil", +yell:"Criant" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/it_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/it_dlg.js new file mode 100644 index 0000000000..8b9efb7849 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/it_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('it.emotions_dlg',{ +title:"Inserisci faccina", +desc:"Faccina", +cool:"Fico", +cry:"Piango", +embarassed:"Imbarazzato", +foot_in_mouth:"Piede in bocca", +frown:"Triste", +innocent:"Santarellino", +kiss:"Bacio", +laughing:"Risatona", +money_mouth:"Bocca danarosa", +sealed:"Bocca sigillata", +smile:"Sorridente", +surprised:"Sorpreso", +tongue_out:"Linguaccia", +undecided:"Indeciso", +wink:"Occhiolino", +yell:"Arrabbiato" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/nl_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/nl_dlg.js new file mode 100644 index 0000000000..f98e1da701 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/nl_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('nl.emotions_dlg',{ +title:"Emotie invoegen", +desc:"Emoties", +cool:"Stoer", +cry:"Huilen", +embarassed:"Schamen", +foot_in_mouth:"Verstomd", +frown:"Wenkbrouw ophalen", +innocent:"Onschuldig", +kiss:"Zoenen", +laughing:"Lachen", +money_mouth:"Hebberig", +sealed:"Afgesloten", +smile:"Lachen", +surprised:"Verrast", +tongue_out:"Tong uitsteken", +undecided:"Onbeslist", +wink:"Knipogen", +yell:"Roepen" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/no_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/no_dlg.js new file mode 100644 index 0000000000..698a8d8946 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/no_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('no.emotions_dlg',{ +title:"Sett inn hum\u00F8rfjes", +desc:"Hum\u00F8rfjes", +cool:"Cool", +cry:"Gret", +embarassed:"Flau", +foot_in_mouth:"Fot i munnen", +frown:"Skuffa", +innocent:"Uskyldig", +kiss:"Kyss", +laughing:"Ler", +money_mouth:"Pengar i munnen", +sealed:"Hemmelig", +smile:"Glad", +surprised:"Overraska", +tongue_out:"Rekke tunge", +undecided:"Skeptisk", +wink:"Blunke", +yell:"Skrik" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/sv_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/sv_dlg.js new file mode 100644 index 0000000000..cc6c35687b --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/emotions/langs/sv_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('sv.emotions_dlg',{ +title:"Infoga smiley", +desc:"Smileys", +cool:"Cool", +cry:"Gr\u00E5ter", +embarassed:"Sk\u00E4ms", +foot_in_mouth:"Foten i munnen", +frown:"Rynkar p\u00E5 n\u00E4san", +innocent:"Oskyldig", +kiss:"Kyss", +laughing:"Skrattande", +money_mouth:"Guld i mun", +sealed:"Tyst", +smile:"Glad", +surprised:"F\u00F6rv\u00E5nad", +tongue_out:"Tungan ute", +undecided:"Obest\u00E4md", +wink:"Fl\u00F6rt", +yell:"Skrikandes" +}); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/dialog.htm b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/dialog.htm new file mode 100644 index 0000000000..50b2b34451 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/dialog.htm @@ -0,0 +1,22 @@ + + + +{#example_dlg.title} + + + + + + + + + diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin.js new file mode 100644 index 0000000000..ec1f81ea40 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin_src.js new file mode 100644 index 0000000000..9a0e7da15d --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/editor_plugin_src.js @@ -0,0 +1,84 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/img/example.gif b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/img/example.gif new file mode 100644 index 0000000000..1ab5da4461 Binary files /dev/null and b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/img/example.gif differ diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/js/dialog.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/js/dialog.js new file mode 100644 index 0000000000..fa8341132f --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/js/dialog.js @@ -0,0 +1,19 @@ +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en.js new file mode 100644 index 0000000000..e0784f80f4 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en_dlg.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en_dlg.js new file mode 100644 index 0000000000..ebcf948dac --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/example/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/css/fullpage.css b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/css/fullpage.css new file mode 100644 index 0000000000..7a3334f08d --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/css/fullpage.css @@ -0,0 +1,182 @@ +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.addbutton, .removebutton, .moveupbutton, .movedownbutton { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: default; + display: block; + width: 20px; + height: 20px; +} + +#doctypes { + width: 200px; +} + +.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.addbutton { + background-image: url('../images/add.gif'); + float: left; + margin-right: 3px; +} + +.removebutton { + background-image: url('../images/remove.gif'); + float: left; +} + +.moveupbutton { + background-image: url('../images/move_up.gif'); + float: left; + margin-right: 3px; +} + +.movedownbutton { + background-image: url('../images/move_down.gif'); + float: left; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + +.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin.js new file mode 100644 index 0000000000..20fb9b9624 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(e,a){var p,d,g,l,b,m,n,h=this.head.match(/body(.*?)>/i),j="",c,f=this.head.match(/]*?)>/i);if(h&&h[1]){p=h[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(p){for(d=0,g=p.length;d",a);h.head=f.substring(0,a+1);j=f.indexOf("\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n\n "+d.getParam("fullpage_default_title","Untitled document")+" \n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n\n";h.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin_src.js new file mode 100644 index 0000000000..256d241db0 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/editor_plugin_src.js @@ -0,0 +1,166 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + head_html : t.head + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onSetContent.add(t._setBodyAttribs, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _setBodyAttribs : function(ed, o) { + var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i), bddir = '',htattr, hattr = this.head.match(/]*?)>/i); + + if (attr && attr[1]) { + bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); + + if (bdattr) { + for(i = 0, len = bdattr.length; i < len; i++) { + kv = bdattr[i].split('='); + k = kv[0].replace(/\s/,''); + v = kv[1]; + + if (v) { + v = v.replace(/^\s+/,'').replace(/\s+$/,''); + t = v.match(/^["'](.*)["']$/); + + if (t) + v = t[1]; + if(k == 'dir') + bddir = v; + } else + v = k; + + ed.dom.setAttrib(ed.getBody(), 'style', v); + } + } + } + //if found fetch the dir-attribute from the html-tag and apply it to the editor-body + if(bddir == '' && hattr && hattr[1]){ + htattr = hattr[1].match(/dir\s*=\s*["']([^"']*)["']/i); + if (htattr && htattr[1]) + bddir = htattr[1]; + } + bd = ed.getBody(); + bd.setAttribute('dir', bddir); + }, + + _createSerializer : function() { + return new tinymce.dom.Serializer({ + dom : this.editor.dom, + indent : true, + apply_source_formatting : true, + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head' + }); + }, + + _setContent : function(ed, o) { + var t = this, sp, ep, c = o.content, v, st = ''; + + // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate + if (o.format == 'raw' && t.head) + return; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + c = c.replace(/<(\/?)BODY/gi, '<$1body'); + sp = c.indexOf('', sp); + t.head = c.substring(0, sp + 1); + + ep = c.indexOf('\n'; + + t.head += ed.getParam('fullpage_default_doctype', ''); + t.head += '\n\n\n' + ed.getParam('fullpage_default_title', 'Untitled document') + ' \n'; + + if (v = ed.getParam('fullpage_default_encoding')) + t.head += '\n'; + + if (v = ed.getParam('fullpage_default_font_family')) + st += 'font-family: ' + v + ';'; + + if (v = ed.getParam('fullpage_default_font_size')) + st += 'font-size: ' + v + ';'; + + if (v = ed.getParam('fullpage_default_text_color')) + st += 'color: ' + v + ';'; + + t.head += '\n\n'; + t.foot = '\n\n'; + } + }, + + _getContent : function(ed, o) { + var t = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/fullpage.htm b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/fullpage.htm new file mode 100644 index 0000000000..80ff016928 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/fullpage.htm @@ -0,0 +1,571 @@ + + + +{#fullpage_dlg.title} + + + + + + + + + + diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/js/fullpage.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/js/fullpage.js new file mode 100644 index 0000000000..222e4ea130 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/fullpage/js/fullpage.js @@ -0,0 +1,492 @@ +/** + * 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; + +var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + +var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + +var defaultMediaTypes = + 'all=all,' + + 'screen=screen,' + + 'print=print,' + + 'tty=tty,' + + 'tv=tv,' + + 'projection=projection,' + + 'handheld=handheld,' + + 'braille=braille,' + + 'aural=aural'; + +var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; +var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + +function init() { + var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, dir, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; + + // Setup doctype select box + doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i=0; i1) + addSelectValue(f, 'doctypes', p[0], p[1]); + } + + // Setup fonts select box + fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i=0; i 1) + addSelectValue(f, 'fontface', p[0], p[1]); + } + + // Setup fontsize select box + fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i=0; i 1) { + addSelectValue(f, 'element_style_media', p[0], p[1]); + addSelectValue(f, 'element_link_media', p[0], p[1]); + } + } + + // Setup encodings select box + encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i=0; i 1) { + addSelectValue(f, 'docencoding', p[0], p[1]); + addSelectValue(f, 'element_script_charset', p[0], p[1]); + addSelectValue(f, 'element_link_charset', p[0], p[1]); + } + } + + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); + document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Add iframe + dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); + doc = dom.get('documentIframe').contentWindow.document; + h = tinyMCEPopup.getWindowArg('head_html'); + + // Preprocess the HTML disable scripts and urls + h = h.replace(/ + + + + + + + + +