Index: openacs-4/packages/xowiki/www/resources/wymeditor/jquery.wymeditor.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/wymeditor/jquery.wymeditor.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/resources/wymeditor/jquery.wymeditor.js 29 May 2008 19:13:44 -0000 1.4 +++ openacs-4/packages/xowiki/www/resources/wymeditor/jquery.wymeditor.js 12 Oct 2008 19:34:59 -0000 1.5 @@ -19,6 +19,7 @@ * Scott Lewis (lewiscot a-t gmail dotcom) * Bermi Ferrer (wymeditor a-t bermi dotorg) * Daniel Reszka (d.reszka a-t wymeditor dotorg) + * Jonatan Lundin (jonatan.lundin _at_ gmail.com) */ /* @@ -27,6 +28,19 @@ */ if(!WYMeditor) var WYMeditor = {}; +//Wrap the Firebug console in WYMeditor.console +(function() { + if ( !window.console || !console.firebug ) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + + WYMeditor.console = {}; + for (var i = 0; i < names.length; ++i) + WYMeditor.console[names[i]] = function() {} + + } else WYMeditor.console = window.console; +})(); + jQuery.extend(WYMeditor, { /* @@ -38,6 +52,7 @@ SKINS - An array of loaded WYMeditor skins. NAME - The "name" attribute. INDEX - A string replaced by the instance index. + WYM_INDEX - A string used to get/set the instance index. BASE_PATH - A string replaced by WYMeditor's base path. SKIN_PATH - A string replaced by WYMeditor's skin path. WYM_PATH - A string replaced by WYMeditor's main JS file path. @@ -47,6 +62,8 @@ IFRAME_BASE_PATH - A string replaced by the designmode iframe's base path. IFRAME_DEFAULT - The iframe's default base path. JQUERY_PATH - A string replaced by the computed jQuery path. + DIRECTION - A string replaced by the text direction (rtl or ltr). + LOGO - A string replaced by WYMeditor logo. TOOLS - A string replaced by the toolbar's HTML. TOOLS_ITEMS - A string replaced by the toolbar items. TOOL_NAME - A string replaced by a toolbar item's name. @@ -68,7 +85,7 @@ DIALOG_BODY - A string replaced by a dialog's HTML body. BODY - The BODY element. STRING - The "string" type. - BODY,P, + BODY,DIV,P, H1,H2,H3,H4,H5,H6, PRE,BLOCKQUOTE, A,BR,IMG, @@ -101,12 +118,13 @@ */ - VERSION : "0.5-a1", + VERSION : "0.5-a2", INSTANCES : [], STRINGS : [], SKINS : [], NAME : "name", INDEX : "{Wym_Index}", + WYM_INDEX : "wym_index", BASE_PATH : "{Wym_Base_Path}", CSS_PATH : "{Wym_Css_Path}", WYM_PATH : "{Wym_Wym_Path}", @@ -117,6 +135,8 @@ IFRAME_BASE_PATH : "{Wym_Iframe_Base_Path}", IFRAME_DEFAULT : "iframe/default/", JQUERY_PATH : "{Wym_Jquery_Path}", + DIRECTION : "{Wym_Direction}", + LOGO : "{Wym_Logo}", TOOLS : "{Wym_Tools}", TOOLS_ITEMS : "{Wym_Tools_Items}", TOOL_NAME : "{Wym_Tool_Name}", @@ -138,6 +158,7 @@ DIALOG_BODY : "{Wym_Dialog_Body}", STRING : "string", BODY : "body", + DIV : "div", P : "p", H1 : "h1", H2 : "h2", @@ -170,6 +191,7 @@ CREATE_LINK : "CreateLink", INSERT_IMAGE : "InsertImage", INSERT_TABLE : "InsertTable", + INSERT_HTML : "InsertHTML", PASTE : "Paste", INDENT : "Indent", OUTDENT : "Outdent", @@ -265,9 +287,6 @@ this._options.jQueryPath = this._options.jQueryPath || this.computeJqueryPath(); - //instanciate a WYMeditor Selection API class - this.selection = new WYMeditor.WymSelection(); - //initialize the editor instance this.init(); @@ -324,6 +343,8 @@ lang: "en", + direction: "ltr", + boxHtml: "
" + "
" + WYMeditor.TOOLS @@ -339,11 +360,13 @@ + WYMeditor.STATUS + "
" + "
" - + "WYMeditor" + + WYMeditor.LOGO + "
" + "
", + logoHtml: "WYMeditor", + iframeHtml:"
" + "