diff --git a/resources/library/interactive/barre_prof.wgt/config.xml b/resources/library/interactive/TextEditor.wgt/config.xml
similarity index 56%
rename from resources/library/interactive/barre_prof.wgt/config.xml
rename to resources/library/interactive/TextEditor.wgt/config.xml
index 57dd5912..e499c662 100644
--- a/resources/library/interactive/barre_prof.wgt/config.xml
+++ b/resources/library/interactive/TextEditor.wgt/config.xml
@@ -4,13 +4,11 @@
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.0"
- width="800"
- height="450"
+ width="200"
+ height="700"
ub:resizable="true">
-
]*>/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 00000000..12cdacaa --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 00000000..af7ae544 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g)}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},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(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..2a916a39 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,160 @@ +/** + * 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, showMenu, contextmenuNeverUseNative, realCtrlKey; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * 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) { + // Block TinyMCE menu on ctrlKey and work around Safari issue + if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) + return; + + Event.cancel(e); + + // Select the image if it's clicked. WebKit would other wise expand the selection + if (e.target.nodeName == 'IMG') + ed.selection.select(e.target); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); + Event.add(ed.getDoc(), 'click', function(e) { + hide(ed, e); + }); + + ed.nodeChanged(); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + realCtrlKey = 0; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + realCtrlKey = e.ctrlKey; + 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, p; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p = DOM.getPos(ed.getContentAreaContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', 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); +})(); diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/directionality/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100644 index 00000000..bce8e739 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100644 index 00000000..205d02cd --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100644 index 00000000..dbdd8ffb --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 00000000..aeee199d --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/emotions.htm b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/emotions.htm new file mode 100644 index 00000000..4ab6b945 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/emotions.htm @@ -0,0 +1,41 @@ + + + +
{#emotions_dlg.title} + + + + + + + + diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 00000000..ba90cc36 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.png new file mode 100644 index 00000000..4e3fd2fa Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 00000000..74d897a4 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.png new file mode 100644 index 00000000..c4f74a82 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 00000000..963a96b8 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.png new file mode 100644 index 00000000..480c3849 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 00000000..c7cf1011 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.png new file mode 100644 index 00000000..2da2197d Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 00000000..716f55e1 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.png new file mode 100644 index 00000000..801c3688 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 00000000..334d49e0 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.png new file mode 100644 index 00000000..34f97a47 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 00000000..4efd549e Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.png new file mode 100644 index 00000000..c38270d7 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 00000000..82c5b182 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.png new file mode 100644 index 00000000..8ba886c0 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 00000000..ca2451e1 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/resources/library/interactive/barre_prof.wgt/dojox/editor/plugins/resources/images/anchor.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.png similarity index 63% rename from resources/library/interactive/barre_prof.wgt/dojox/editor/plugins/resources/images/anchor.png rename to resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.png index 008511cb..be10965a 100644 Binary files a/resources/library/interactive/barre_prof.wgt/dojox/editor/plugins/resources/images/anchor.png and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 00000000..fe66220c Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.png new file mode 100644 index 00000000..fc3e1887 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 00000000..fd27edfa Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.png new file mode 100644 index 00000000..1ec09f88 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 00000000..0cc9bb71 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.png new file mode 100644 index 00000000..dfc27453 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 00000000..2075dc16 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.png new file mode 100644 index 00000000..07545790 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 00000000..bef7e257 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.png new file mode 100644 index 00000000..3e88c5af Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 00000000..0631c761 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.png new file mode 100644 index 00000000..4d655c80 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 00000000..648e6e87 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.png b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.png new file mode 100644 index 00000000..9f521d54 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.png differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/js/emotions.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/js/emotions.js new file mode 100644 index 00000000..e5c950fc --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100644 index 00000000..f6d5f4ba --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/dialog.htm b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/dialog.htm new file mode 100644 index 00000000..d6f2856a --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/dialog.htm @@ -0,0 +1,22 @@ + + + +{#example_dlg.title} + + + + + + + + + diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/editor_plugin.js new file mode 100644 index 00000000..ec1f81ea --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100644 index 00000000..edc1e776 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/img/example.gif b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/img/example.gif new file mode 100644 index 00000000..1ab5da44 Binary files /dev/null and b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/img/example.gif differ diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/js/dialog.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/js/dialog.js new file mode 100644 index 00000000..a7ee507e --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/langs/en.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/langs/en.js new file mode 100644 index 00000000..f3721d3a --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/langs/en_dlg.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100644 index 00000000..a9cd65f8 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js new file mode 100644 index 00000000..0a4551d3 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})(); \ No newline at end of file diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js new file mode 100644 index 00000000..e1c55e41 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * 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.ExampleDependencyPlugin', { + /** + * 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) { + }, + + + /** + * 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 Dependency plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', + version : "1.0" + }; + } + }); + + /** + * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. + * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). + * plugins in a depends list should typically be specified using the short name). If neccesary this can be done + * with an object which has the url to the plugin and the shortname. + */ + tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); +})(); diff --git a/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100644 index 00000000..28b721f9 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css @@ -0,0 +1,143 @@ +/* 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; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.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/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100644 index 00000000..eb0ec331 --- /dev/null +++ b/resources/library/interactive/TextEditor.wgt/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},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}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n