diff -r c72b545f1304 -r 67bd3121a12e includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js --- a/includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js Wed Dec 26 00:37:26 2007 -0500 +++ b/includes/clientside/tinymce/plugins/fullpage/editor_plugin_src.js Thu Dec 27 22:09:33 2007 -0500 @@ -1,227 +1,88 @@ /** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * $Id: editor_plugin_src.js 373 2007-11-12 17:57:47Z spocke $ * * @author Moxiecode * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. */ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('fullpage'); - -var TinyMCE_FullPagePlugin = { - 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 - }; - }, - - getControlHTML : function(cn) { - switch (cn) { - case "fullpage": - return tinyMCE.getButtonHTML(cn, 'lang_fullpage_desc', '{$pluginurl}/images/fullpage.gif', 'mceFullPageProperties'); - } - - return ""; - }, +(function() { + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; - execCommand : function(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceFullPageProperties": - var template = new Array(); - - template['file'] = '../../plugins/fullpage/fullpage.htm'; - template['width'] = 430; - template['height'] = 485 + (tinyMCE.isOpera ? 5 : 0); - - template['width'] += tinyMCE.getLang('lang_fullpage_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_fullpage_delta_height', 0); - - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - return true; - - case "mceFullPageUpdate": - TinyMCE_FullPagePlugin._addToHead(tinyMCE.getInstanceById(editor_id)); - return true; - } - - // Pass to next handler in chain - return false; - }, - - cleanup : function(type, content, inst) { - switch (type) { - case "insert_to_editor": - var tmp = content.toLowerCase(); - var pos = tmp.indexOf('
', pos); - pos2 = tmp.lastIndexOf(''); - inst.fullpageTopContent = content.substring(0, pos + 1); - content = content.substring(pos + 1, pos2); - // tinyMCE.debug(inst.fullpageTopContent, content); - } else { - if (!inst.fullpageTopContent) { - var docType = tinyMCE.getParam("fullpage_default_doctype", ''); - var enc = tinyMCE.getParam("fullpage_default_encoding", 'utf-8'); - var title = tinyMCE.getParam("fullpage_default_title", 'Untitled document'); - var lang = tinyMCE.getParam("fullpage_default_langcode", 'en'); - var pi = tinyMCE.getParam("fullpage_default_xml_pi", true); - var ff = tinyMCE.getParam("fullpage_default_font_family", ""); - var fz = tinyMCE.getParam("fullpage_default_font_size", ""); - var ds = tinyMCE.getParam("fullpage_default_style", ""); - var dtc = tinyMCE.getParam("fullpage_default_text_color", ""); + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + ed.getLang('fullpage.delta_width', 0), + height : 495 + ed.getLang('fullpage.delta_height', 0), + inline : 1 + }, { + plugin_url : url, + head_html : t.head + }); + }); - // Xml encode it - title = title.replace(/&/g, '&'); - title = title.replace(/\"/g, '"'); - title = title.replace(//g, '>'); - - tmp = ''; + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); - // Make default chunk - if (pi) - tmp += '\n'; - - tmp += docType + '\n'; - tmp += '\n'; - tmp += '\n'; - tmp += '\t