diff --git a/public/dispatch.cgi b/public/dispatch.cgi old mode 100755 new mode 100644 diff --git a/public/dispatch.fcgi b/public/dispatch.fcgi old mode 100755 new mode 100644 diff --git a/public/dispatch.rb b/public/dispatch.rb old mode 100755 new mode 100644 diff --git a/public/javascripts/lightview.js b/public/javascripts/lightview.js index 1dd60c5..db9ce3e 100644 --- a/public/javascripts/lightview.js +++ b/public/javascripts/lightview.js @@ -1,151 +1,151 @@ -// Lightview 2.4.0.4 - 21-12-2008 -// Copyright (c) 2008 Nick Stakenburg (http://www.nickstakenburg.com) -// -// Licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License -// http://creativecommons.org/licenses/by-nc-nd/3.0/ - -// More information on this project: -// http://www.nickstakenburg.com/projects/lightview/ - -var Lightview = { - Version: '2.4.0.4', - - // Configuration - options: { - backgroundColor: '#f5f5f5', // Background color of the view - border: 8, // Size of the border - buttons: { - opacity: { // Opacity of inner buttons - disabled: 0.4, - normal: 0.75, - hover: 1 - }, - side: { display: true }, // Toggle side buttons - innerPreviousNext: { display: true }, // Toggle the inner previous and next button - slideshow: { display: true }, // Toggle slideshow button - topclose: { side: 'right' } // 'right' or 'left' - }, - controller: { // The controller is used on sets - backgroundColor: '#4d4d4d', - border: 6, - buttons: { - innerPreviousNext: true, - side: false - }, - margin: 18, - opacity: 0.7, - radius: 6, - setNumberTemplate: '#{position} of #{total}' - }, - cyclic: false, // Makes galleries cyclic, no end/begin - images: '../images/lightview/', // The directory of the images, from this file - imgNumberTemplate: 'Image #{position} of #{total}', // Want a different language? change it here - keyboard: true, // Toggle keyboard buttons - menubarPadding: 2, // Space between menubar and content in px - overlay: { // Overlay - background: '#000', // Background color, Mac Firefox & Mac Safari use overlay.png - close: true, - opacity: 0.85, - display: true - }, - preloadHover: false, // Preload images on mouseover - radius: 8, // Corner radius of the border - removeTitles: true, // Set to false if you want to keep title attributes intact - resizeDuration: 0.45, // The duration of the resize effect in seconds - slideshowDelay: 5, // Delay in seconds before showing the next slide - titleSplit: '::', // The characters you want to split title with - transition: function(pos) { // Or your own transition - return ((pos/=0.5) < 1 ? 0.5 * Math.pow(pos, 4) : - -0.5 * ((pos-=2) * Math.pow(pos,3) - 2)); - }, - viewport: true, // Stay within the viewport, true is recommended - zIndex: 5000, // zIndex of #lightview, #overlay is this -1 - - startDimensions: { // Dimensions Lightview starts at - width: 100, - height: 100 - }, - closeDimensions: { // Modify if you've changed the close button images - large: { width: 77, height: 22 }, - small: { width: 25, height: 22 } - }, - sideDimensions: { // Modify if you've changed the side button images - width: 16, - height: 22 - }, - - defaultOptions : { // Default options for each type of view - image: { - menubar: 'bottom', - closeButton: 'large' - }, - gallery: { - menubar: 'bottom', - closeButton: 'large' - }, - ajax: { - width: 400, - height: 300, - menubar: 'top', - closeButton: 'small', - overflow: 'auto' - }, - iframe: { - width: 400, - height: 300, - menubar: 'top', - scrolling: true, - closeButton: 'small' - }, - inline: { -// width: 400, -// height: 300, - autosize: 'true', - menubar: 'top', - closeButton: 'small', - overflow: 'auto' - }, - flash: { - width: 400, - height: 300, - menubar: 'bottom', - closeButton: 'large' - }, - quicktime: { - width: 480, - height: 220, - autoplay: true, - controls: true, - closeButton: 'large' - } - } - }, - classids: { - quicktime: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - flash: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' - }, - codebases: { - quicktime: 'http://www.apple.com/qtactivex/qtplugin.cab#version=7,5,5,0', - flash: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' - }, - errors: { - requiresPlugin: "
Please download and install the required plugin from:
#{pluginspage}Please download and install the required plugin from:
#{pluginspage}]*>/gi,"[quote]"); - rep(/<\/blockquote>/gi,"[/quote]"); - rep(/
/gi,"\n"); - rep(/
/gi,"\n"); - rep(/
/gi,"\n"); - rep(//gi,""); - rep(/<\/p>/gi,"\n"); - rep(/ /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); +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(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(/ /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/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js index 60d4f2d..8f6e02f 100644 --- a/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js +++ b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js @@ -1,616 +1,616 @@ -/** - * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.Compat2x', { - getInfo : function() { - return { - longname : 'Compat2x', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - } - }); - - (function() { - // Extend tinyMCE/EditorManager - tinymce.extend(tinyMCE, { - addToLang : function(p, l) { - each(l, function(v, k) { - tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v; - }); - }, - - getInstanceById : function(n) { - return this.get(n); - } - }); - })(); - - (function() { - var EditorManager = tinymce.EditorManager; - - tinyMCE.instances = {}; - tinyMCE.plugins = {}; - tinymce.PluginManager.onAdd.add(function(pm, n, p) { - tinyMCE.plugins[n] = p; - }); - - tinyMCE.majorVersion = tinymce.majorVersion; - tinyMCE.minorVersion = tinymce.minorVersion; - tinyMCE.releaseDate = tinymce.releaseDate; - tinyMCE.baseURL = tinymce.baseURL; - tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera; - tinyMCE.isMSIE5 = tinymce.isIE; - tinyMCE.isMSIE5_0 = tinymce.isIE; - tinyMCE.isMSIE7 = tinymce.isIE; - tinyMCE.isGecko = tinymce.isGecko; - tinyMCE.isSafari = tinymce.isWebKit; - tinyMCE.isOpera = tinymce.isOpera; - tinyMCE.isMac = false; - tinyMCE.isNS7 = false; - tinyMCE.isNS71 = false; - tinyMCE.compat = true; - - // Extend tinyMCE class - TinyMCE_Engine = tinyMCE; - tinymce.extend(tinyMCE, { - getParam : function(n, dv) { - return this.activeEditor.getParam(n, dv); - }, - - addEvent : function(e, na, f, sc) { - tinymce.dom.Event.add(e, na, f, sc || this); - }, - - getControlHTML : function(n) { - return EditorManager.activeEditor.controlManager.createControl(n); - }, - - loadCSS : function(u) { - tinymce.DOM.loadCSS(u); - }, - - importCSS : function(doc, u) { - if (doc == document) - this.loadCSS(u); - else - new tinymce.dom.DOMUtils(doc).loadCSS(u); - }, - - log : function() { - console.debug.apply(console, arguments); - }, - - getLang : function(n, dv) { - var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv); - - // Is number - if (/^[0-9\-.]+$/g.test(v)) - return parseInt(v); - - return v; - }, - - isInstance : function(o) { - return o != null && typeof(o) == "object" && o.execCommand; - }, - - triggerNodeChange : function() { - EditorManager.activeEditor.nodeChanged(); - }, - - regexpReplace : function(in_str, reg_exp, replace_str, opts) { - var re; - - if (in_str == null) - return in_str; - - if (typeof(opts) == "undefined") - opts = 'g'; - - re = new RegExp(reg_exp, opts); - - return in_str.replace(re, replace_str); - }, - - trim : function(s) { - return tinymce.trim(s); - }, - - xmlEncode : function(s) { - return tinymce.DOM.encode(s); - }, - - explode : function(s, d) { - var o = []; - - tinymce.each(s.split(d), function(v) { - if (v != '') - o.push(v); - }); - - return o; - }, - - switchClass : function(id, cls) { - var b; - - if (/^mceButton/.test(cls)) { - b = EditorManager.activeEditor.controlManager.get(id); - - if (!b) - return; - - switch (cls) { - case "mceButtonNormal": - b.setDisabled(false); - b.setActive(false); - return; - - case "mceButtonDisabled": - b.setDisabled(true); - return; - - case "mceButtonSelected": - b.setActive(true); - b.setDisabled(false); - return; - } - } - }, - - addCSSClass : function(e, n, b) { - return tinymce.DOM.addClass(e, n, b); - }, - - hasCSSClass : function(e, n) { - return tinymce.DOM.hasClass(e, n); - }, - - removeCSSClass : function(e, n) { - return tinymce.DOM.removeClass(e, n); - }, - - getCSSClasses : function() { - var cl = EditorManager.activeEditor.dom.getClasses(), o = []; - - each(cl, function(c) { - o.push(c['class']); - }); - - return o; - }, - - setWindowArg : function(n, v) { - EditorManager.activeEditor.windowManager.params[n] = v; - }, - - getWindowArg : function(n, dv) { - var wm = EditorManager.activeEditor.windowManager, v; - - v = wm.getParam(n); - if (v === '') - return ''; - - return v || wm.getFeature(n) || dv; - }, - - getParentNode : function(n, f) { - return this._getDOM().getParent(n, f); - }, - - selectElements : function(n, na, f) { - var i, a = [], nl, x; - - for (x=0, na = na.split(','); x- - - {#emotions_dlg.title} - - -- - - - - + + + + {#emotions_dlg.title} + + ++ + + + + diff --git a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js index c549367..e5c950f 100644 --- a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js +++ b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js @@ -1,22 +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); +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/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js index 3b57ad9..f6d5f4b 100644 --- a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +++ b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -1,20 +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" +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/public/javascripts/tiny_mce/plugins/example/dialog.htm b/public/javascripts/tiny_mce/plugins/example/dialog.htm index b4c6284..58edf9a 100644 --- a/public/javascripts/tiny_mce/plugins/example/dialog.htm +++ b/public/javascripts/tiny_mce/plugins/example/dialog.htm @@ -1,27 +1,27 @@ - - - - {#example_dlg.title} - - - - - - - - - + + + +{#example_dlg.title} + + + + + + + + + diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js index 5050550..d0b5ff2 100644 --- a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +++ b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js @@ -1,81 +1,81 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(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); +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(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/public/javascripts/tiny_mce/plugins/example/js/dialog.js b/public/javascripts/tiny_mce/plugins/example/js/dialog.js index fa83411..a7ee507 100644 --- a/public/javascripts/tiny_mce/plugins/example/js/dialog.js +++ b/public/javascripts/tiny_mce/plugins/example/js/dialog.js @@ -1,19 +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); +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/public/javascripts/tiny_mce/plugins/example/langs/en.js b/public/javascripts/tiny_mce/plugins/example/langs/en.js index e0784f8..f3721d3 100644 --- a/public/javascripts/tiny_mce/plugins/example/langs/en.js +++ b/public/javascripts/tiny_mce/plugins/example/langs/en.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example',{ - desc : 'This is just a template button' -}); +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js index ebcf948..a9cd65f 100644 --- a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +++ b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example_dlg',{ - title : 'This is just a example title' -}); +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css index 7a3334f..1854eca 100644 --- a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +++ b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css @@ -1,182 +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; -} - +/* 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/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js index 019682d..789e534 100644 --- a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -1,142 +1,142 @@ -/** - * $Id: editor_plugin_src.js 920 2008-09-09 14:05:33Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(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); - - 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]; - } else - v = k; - - ed.dom.setAttrib(ed.getBody(), 'style', v); - } - } - } - }, - - _createSerializer : function() { - return new tinymce.dom.Serializer({ - dom : this.editor.dom, - apply_source_formatting : true - }); - }, - - _setContent : function(ed, o) { - var t = this, sp, ep, c = o.content, v, st = ''; - - // 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; - - 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); +/** + * $Id: editor_plugin_src.js 920 2008-09-09 14:05:33Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(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); + + 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]; + } else + v = k; + + ed.dom.setAttrib(ed.getBody(), 'style', v); + } + } + } + }, + + _createSerializer : function() { + return new tinymce.dom.Serializer({ + dom : this.editor.dom, + apply_source_formatting : true + }); + }, + + _setContent : function(ed, o) { + var t = this, sp, ep, c = o.content, v, st = ''; + + // 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; + + 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); })(); \ No newline at end of file diff --git a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm index d74da0d..eabc823 100644 --- a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +++ b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm @@ -1,577 +1,577 @@ - - - -{#fullpage_dlg.title} - - - - - -- - - - - + + + + {#fullpage_dlg.title} + + + + + ++ + + + + diff --git a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js index 89059ef..6c994e9 100644 --- a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +++ b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js @@ -1,461 +1,461 @@ -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, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; - - // Setup doctype select box - doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i=0; i 1) - 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(/ - - - - - - - - - -