Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 23 May 2010 11:58:33 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 3 Dec 2012 18:38:11 -0000 1.8 @@ -1,5 +1,5 @@ .htmlarea { background: #fff; } -.htmlarea td { margin:0;padding:0; } +.htmlarea td { margin:0 !important;padding:0 !important; } .htmlarea .toolbarRow { width:1px; @@ -386,92 +386,3 @@ { display: none; } - -.placesmanager -{ - width: 95%; - overflow: auto; -} - -.filemanager -{ - width: 95%; - height: 200px; - overflow: auto; - background-color: #fff; -} -.filemanager div.file -{ - min-width: 80px; - height: 100px; - position: relative; - float: left; - border: 1px outset #666; - margin: 4px; -} -.placesmanager div.file -{ - min-width: 60px; - height: 70px; - position: relative; - float: left; - border: 1px outset #666; - margin: 4px; -} -.filemanager div.file:hover, -.placesmanager div.file:hover -{ - border: 1px solid #333; - background: #fffff3; -} - -.filemanager div.selected, -.filemanager div.selected:hover, -.placesmanager div.selected, -.placesmanager div.selected:hover -{ - background: #ffffda; - border: 1px solid #000; -} -.filemanager .filename { - margin: 0.5em; - color: #222; -} -.filemanager div.selected .filename { - color: #000; -} -.filemanager img.thumb -{ - width: 50px; - height: 50px; - position: absolute; - top: 50%; - left: 50%; - margin: -25px 0 0 -25px; - border: 1px solid black; -} -.filemanager img.icon -{ - width: 32px; - height: 32px; - position: absolute; - top: 50%; - left: 50%; - margin: -16px 0 0 -16px; -} -.filemanager img.action -{ - width: 15px; - height: 15px; - position: absolute; -} -.filemanager img.delete -{ - bottom: 3px; - left: 20px; -} -.filemanager img.copy -{ - bottom: 3px; - left: 3px; -} Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 23 May 2010 11:58:33 -0000 1.8 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 3 Dec 2012 18:38:12 -0000 1.9 @@ -15,9 +15,9 @@ -- Developers - Coding Style: -- Before you are going to work on Xinha code, please see http://trac.xinha.org/wiki/Documentation/StyleGuide -- - -- $HeadURL: http://svn.xinha.org/trunk/XinhaCore.js $ - -- $LastChangedDate: 2010-05-12 09:40:06 +1200 (Wed, 12 May 2010) $ - -- $LastChangedRevision: 1263 $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/XinhaCore.js $ + -- $LastChangedDate: 2011-03-29 12:08:39 +1300 (Tue, 29 Mar 2011) $ + -- $LastChangedRevision: 1297 $ -- $LastChangedBy: gogo $ --------------------------------------------------------------------------*/ /*jslint regexp: false, rhino: false, browser: true, bitwise: false, forin: true, adsafe: false, evil: true, nomen: false, @@ -31,9 +31,9 @@ Xinha.version = { 'Release' : 'Trunk', - 'Head' : '$HeadURL: http://svn.xinha.org/trunk/XinhaCore.js $'.replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), - 'Date' : '$LastChangedDate: 2010-05-12 09:40:06 +1200 (Wed, 12 May 2010) $'.replace(/^[^:]*:\s*([0-9\-]*) ([0-9:]*) ([+0-9]*) \((.*)\)\s*\$/, '$4 $2 $3'), - 'Revision' : '$LastChangedRevision: 1263 $'.replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + 'Head' : '$HeadURL: http://svn.xinha.webfactional.com/trunk/XinhaCore.js $'.replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + 'Date' : '$LastChangedDate: 2011-03-29 12:08:39 +1300 (Tue, 29 Mar 2011) $'.replace(/^[^:]*:\s*([0-9\-]*) ([0-9:]*) ([+0-9]*) \((.*)\)\s*\$/, '$4 $2 $3'), + 'Revision' : '$LastChangedRevision: 1297 $'.replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), 'RevisionBy': '$LastChangedBy: gogo $'.replace(/^[^:]*:\s*(.*)\s*\$$/, '$1') }; @@ -228,7 +228,7 @@ } /** Creates a new Xinha object - * @version $Rev: 1263 $ $LastChangedDate: 2010-05-12 09:40:06 +1200 (Wed, 12 May 2010) $ + * @version $Rev: 1297 $ $LastChangedDate: 2011-03-29 12:08:39 +1300 (Tue, 29 Mar 2011) $ * @constructor * @param {String|DomNode} textarea the textarea to replace; can be either only the id or the DOM object as returned by document.getElementById() * @param {Xinha.Config} config optional if no Xinha.Config object is passed, the default config is used @@ -500,7 +500,7 @@ /** * This class creates an object that can be passed to the Xinha constructor as a parameter. * Set the object's properties as you need to configure the editor (toolbar etc.) - * @version $Rev: 1263 $ $LastChangedDate: 2010-05-12 09:40:06 +1200 (Wed, 12 May 2010) $ + * @version $Rev: 1297 $ $LastChangedDate: 2011-03-29 12:08:39 +1300 (Tue, 29 Mar 2011) $ * @constructor */ Xinha.Config = function() @@ -863,6 +863,11 @@ */ this.convertUrlsToLinks = true; + /** Set to true to hide media objects when a div-type dialog box is open, to prevent show-through + * Default: false + * @type Boolean + */ + this.hideObjectsBehindDialogs = false; /** Size of color picker cells
* Use number + "px"
@@ -1026,15 +1031,17 @@ *
    *xinha_config.formatblock =
    *{
-   *  "— size —": "",
-   *  "1 (8 pt)" : "1",
-   *  "2 (10 pt)": "2",
-   *  "3 (12 pt)": "3",
-   *  "4 (14 pt)": "4",
-   *  "5 (18 pt)": "5",
-   *  "6 (24 pt)": "6",
-   *  "7 (36 pt)": "7"
-   *};
+   *  "— format —": "", // — is mdash
+   *  "Heading 1": "h1",
+   *  "Heading 2": "h2",
+   *  "Heading 3": "h3",
+   *  "Heading 4": "h4",
+   *  "Heading 5": "h5",
+   *  "Heading 6": "h6",
+   *  "Normal"   : "p",
+   *  "Address"  : "address",
+   *  "Formatted": "pre"
+   *}
    *
* @type Object */ @@ -1051,9 +1058,33 @@ "Address" : "address", "Formatted": "pre" }; - + + /** You can provide custom functions that will be used to determine which of the + * "formatblock" options is currently active and selected in the dropdown. + * + * Example: + *
+   * xinha_config.formatblockDetector['h5'] = function(xinha, currentElement)
+   * {
+   *   if (my_special_matching_logic(currentElement)) {
+   *     return true;
+   *   } else {
+   *     return false;
+   *   }
+   * };
+   * 
+ * + * You probably don't want to mess with this, unless you are adding new, custom + * "formatblock" options which don't correspond to real HTML tags. If you want + * to do that, you can use this configuration option to tell xinha how to detect + * when it is within your custom context. + * + * For more, see: http://www.coactivate.org/projects/xinha/custom-formatblock-options + */ + this.formatblockDetector = {}; + this.dialogOptions = - { + { 'centered' : true, //true: dialog is shown in the center the screen, false dialog is shown near the clicked toolbar button 'greyout':true, //true: when showing modal dialogs, the page behind the dialoge is greyed-out 'closeOnEscape':true @@ -1149,7 +1180,7 @@ selectall: [ "Select all", ["ed_buttons_main.png",3,5], false, function(e) {e.execCommand("selectall");} ], inserthorizontalrule: [ "Horizontal Rule", ["ed_buttons_main.png",6,0], false, function(e) { e.execCommand("inserthorizontalrule"); } ], - createlink: [ "Insert Web Link", ["ed_buttons_main.png",6,1], false, function(e) { e._createLink(); } ], + createlink: [ "Insert Web Link", ["ed_buttons_main.png",6,1], false, function(e) { e.execCommand("createlink"); } ], insertimage: [ "Insert/Modify Image", ["ed_buttons_main.png",6,3], false, function(e) { e.execCommand("insertimage"); } ], inserttable: [ "Insert Table", ["ed_buttons_main.png",6,2], false, function(e) { e.execCommand("inserttable"); } ], @@ -1178,9 +1209,25 @@ this.dblclickList = { - "a": [function(e, target) {e._createLink(target);}], + "a": [function(e, target) {e.execCommand("createlink", false, target);}], "img": [function(e, target) {e._insertImage(target);}] }; + + /** + * HTML class attribute to apply to the tag within the editor's iframe. + * If it is not specified, no class will be set. + * + * Default: null + */ + this.bodyClass = null; + + /** + * HTML ID attribute to apply to the tag within the editor's iframe. + * If it is not specified, no ID will be set. + * + * Default: null + */ + this.bodyID = null; /** A container for additional icons that may be swapped within one button (like fullscreen) * @private @@ -2385,6 +2432,7 @@ switch (toolbar[i][j]) { case "popupeditor": + case "fullscreen": if (!this.plugins.FullScreen) { editor.registerPlugin('FullScreen'); @@ -3609,6 +3657,12 @@ { editor._onGenerate(); } + + if(editor._textArea.hasAttribute('onxinhaready')) + { + (function() { eval(editor._textArea.getAttribute('onxinhaready')) }).call(editor.textArea); + } + //ticket #1407 IE8 fires two resize events on one actual resize, seemingly causing an infinite loop (but not when Xinha is in an frame/iframe) Xinha.addDom0Event(window, 'resize', function(e) { @@ -3764,15 +3818,15 @@ return true; } Xinha._pluginLoadStatus[pluginName] = 'loading'; - - // This function will try to load a plugin in multiple passes. It tries to - // load the plugin from either the plugin or unsupported directory, using - // both naming schemes in this order: - // 1. /plugins -> CurrentNamingScheme - // 2. /plugins -> old-naming-scheme - // 3. /unsupported -> CurrentNamingScheme - // 4. /unsupported -> old-naming-scheme + /** This function will try to load a plugin in multiple passes. It tries to + * load the plugin from either the plugin or unsupported directory, using + * both naming schemes in this order: + * 1. /plugins -> CurrentNamingScheme + * 2. /plugins -> old-naming-scheme + * 3. /unsupported -> CurrentNamingScheme + * 4. /unsupported -> old-naming-scheme + */ function multiStageLoader(stage,pluginName) { var nextstage, dir, file, success_message; @@ -3793,13 +3847,13 @@ nextstage = 'unsupported_old_name'; dir = Xinha.getPluginDir(pluginName, true); file = pluginName + ".js"; - success_message = 'You are using the unsupported Xinha plugin '+pluginName+'. If you wish continued support, please see http://trac.xinha.org/ticket/1297'; + success_message = 'You are using the unsupported Xinha plugin '+pluginName+'. If you wish continued support, please see http://trac.xinha.org/wiki/Documentation/UnsupportedPlugins'; break; case 'unsupported_old_name': nextstage = ''; dir = Xinha.getPluginDir(pluginName, true); file = pluginName.replace(/([a-z])([A-Z])([a-z])/g, function (str, l1, l2, l3) { return l1 + "-" + l2.toLowerCase() + l3; }).toLowerCase() + ".js"; - success_message = 'You are using the unsupported Xinha plugin '+pluginName+'. If you wish continued support, please see http://trac.xinha.org/ticket/1297'; + success_message = 'You are using the unsupported Xinha plugin '+pluginName+'. If you wish continued support, please see http://trac.xinha.org/wiki/Documentation/UnsupportedPlugins'; break; default: Xinha._pluginLoadStatus[pluginName] = 'failed'; @@ -4156,7 +4210,8 @@ Xinha.loadStyle(nxt.url, nxt.plugin); return this.loadNext(); - case 'text/javascript': + case 'text/javascript': + this.loadedScripts.push(nxt); Xinha.loadScript(nxt.url, nxt.plugin, function() { self.loadNext(); }); } } @@ -4182,9 +4237,21 @@ for(var i = 0; i < this.loadedScripts.length; i++) { if(this.loadedScripts[i].url == url && this.loadedScripts[i].plugin == plugin) + { + if(!this.loaderRunning) this.loadNext(); return this; // Already done (or in process) + } } + for(var i = 0; i < this.pendingAssets.length; i++) + { + if(this.pendingAssets[i].url == url && this.pendingAssets[i].plugin == plugin) + { + if(!this.loaderRunning) this.loadNext(); + return this; // Already pending + } + } + return this.loadScript(url, plugin); } @@ -4877,23 +4944,24 @@ var blocks = []; for ( var indexBlock in this.config.formatblock ) { + var blockname = this.config.formatblock[indexBlock]; // prevent iterating over wrong type - if ( typeof this.config.formatblock[indexBlock] == 'string' ) + if ( typeof blockname == 'string' ) { - blocks[blocks.length] = this.config.formatblock[indexBlock]; + blocks[blocks.length] = this.config.formatblockDetector[blockname] || blockname; } } - var deepestAncestor = this._getFirstAncestor(this.getSelection(), blocks); + var match = this._getFirstAncestorAndWhy(this.getSelection(), blocks); + var deepestAncestor = match[0]; + var matchIndex = match[1]; + + if ( deepestAncestor ) { - for ( var x = 0; x < blocks.length; x++ ) - { - if ( blocks[x].toLowerCase() == deepestAncestor.tagName.toLowerCase() ) - { - btn.element.selectedIndex = x; - } - } + // the function can return null for its second element even if a match is found, + // but we passed in an array, so we know it will be a numerical index. + btn.element.selectedIndex = matchIndex; } else { @@ -5018,11 +5086,22 @@ /** Traverses the DOM upwards and returns the first element that is of one of the specified types * @param {Selection} sel Selection object as returned by getSelection - * @param {Array} types Array of matching criteria. Each criteria is either a string containing the tag name, or a callback used to select the element. + * @param {Array|String} types Array of matching criteria. Each criteria is either a string containing the tag name, or a callback used to select the element. * @returns {DomNode|null} */ Xinha.prototype._getFirstAncestor = function(sel, types) { + return this._getFirstAncestorAndWhy(sel, types)[0]; +}; + +/** Traverses the DOM upwards and returns the first element that is one of the specified types, + * and which (of the specified types) the found element successfully matched. + * @param {Selection} sel Selection object as returned by getSelection + * @param {Array|String} types Array of matching criteria. Each criteria is either a string containing the tag name, or a callback used to select the element. + * @returns {Array} The array will look like [{DomNode|null}, {Integer|null}] -- that is, it always contains two elements. The first element is the element that matched, or null if no match was found. The second is the numerical index that can be used to identify which element of the "types" was responsible for the match. It will be null if no match was found. It will also be null if the "types" argument was omitted. + */ +Xinha.prototype._getFirstAncestorAndWhy = function(sel, types) +{ var prnt = this.activeElement(sel); if ( prnt === null ) { @@ -5033,7 +5112,7 @@ } catch(ex) { - return null; + return [null, null]; } } @@ -5048,16 +5127,16 @@ { if ( types === null ) { - return prnt; + return [prnt, null]; } for (var index=0; index]*((type=[\"\']text\/)|(language=[\"\']))javascript[\"\'])/gi,'$1 type="text/javascript"'); html = html.replace(/(]*((type=[\"\']text\/)|(language=[\"\'])))(javascript)/gi,"$1freezescript"); // For IE's sake, make any URLs that are semi-absolute (="/....") to be @@ -7140,6 +7220,44 @@ } }; + +/** Use XMLHTTPRequest to send some some data to the server and return the result synchronously + * + * @param {String} url The address for the HTTPRequest + * @param data the data to send, streing or array + */ +Xinha._posturlcontent = function(url, data, returnXML) +{ + var req = null; + req = Xinha.getXMLHTTPRequestObject(); + + var content = ''; + if (typeof data == 'string') + { + content = data; + } + else if(typeof data == "object") + { + for ( var i in data ) + { + content += (content.length ? '&' : '') + i + '=' + encodeURIComponent(data[i]); + } + } + + req.open('POST', url, false); + req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'+(Xinha._postback_send_charset ? '; charset=UTF-8' : '')); + req.send(content); + + if ( ((req.status / 100) == 2) || Xinha.isRunLocally && req.status === 0 ) + { + return (returnXML) ? req.responseXML : req.responseText; + } + else + { + return ''; + } + +}; // Unless somebody already has, make a little function to debug things if (typeof dumpValues == 'undefined') @@ -7204,7 +7322,7 @@ { /** Walks through an array and, if the specified item exists in it, returns the position * @param {String} needle The string to search for - * @returns {Integer|null} Index position if item found, null otherwise + * @returns {Integer|-1} Index position if item found, -1 otherwise (same as built in js) */ Array.prototype.indexOf = function(needle) { @@ -7216,7 +7334,7 @@ return i; } } - return null; + return -1; }; } if ( !Array.prototype.append ) Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html 16 Jan 2009 08:36:13 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html 3 Dec 2012 18:38:12 -0000 1.3 @@ -3,8 +3,8 @@ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html 23 May 2010 11:58:33 -0000 1.9 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html 3 Dec 2012 18:38:12 -0000 1.10 @@ -13,7 +13,7 @@ -- of the file to remove the auto-example-generating code and allow for the -- use of the file as a boilerplate. -- - -- $HeadURL: http://svn.xinha.org/trunk/examples/testbed.html $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/testbed.html $ -- $LastChangedDate: 2009-11-08 17:36:46 +1300 (Sun, 08 Nov 2009) $ -- $LastChangedRevision: 1197 $ -- $LastChangedBy: gogo $ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-body.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-body.html 27 Mar 2009 08:20:43 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-body.html 3 Dec 2012 18:38:12 -0000 1.4 @@ -3,8 +3,8 @@ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-menu.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-menu.php,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-menu.php 27 Mar 2009 08:20:43 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/files/ext_example-menu.php 3 Dec 2012 18:38:12 -0000 1.4 @@ -10,8 +10,8 @@ -- frame to provide a menu for generating example editors using -- full_example-body.html, and full_example.js. -- - -- $HeadURL: http://svn.xinha.org/trunk/examples/files/ext_example-menu.php $ - -- $LastChangedDate: 2008-10-12 19:42:42 +0200 (So, 12. Okt 2008) $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/files/ext_example-menu.php $ + -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ -- $LastChangedRevision: 1084 $ -- $LastChangedBy: ray $ ---------------------------------------------------------------------------> Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/CreateLink/link.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/CreateLink/link.js,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/CreateLink/link.js 23 May 2010 11:58:33 -0000 1.8 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/CreateLink/link.js 3 Dec 2012 18:38:12 -0000 1.9 @@ -17,26 +17,31 @@ -- The file is loaded as a special plugin by the Xinha Core when no alternative method (plugin) is loaded. -- -- - -- $HeadURL: http://svn.xinha.org/trunk/modules/CreateLink/link.js $ - -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ - -- $LastChangedRevision: 1084 $ - -- $LastChangedBy: ray $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/CreateLink/link.js $ + -- $LastChangedDate: 2010-11-16 05:15:48 +1300 (Tue, 16 Nov 2010) $ + -- $LastChangedRevision: 1271 $ + -- $LastChangedBy: ejucovy $ --------------------------------------------------------------------------*/ function CreateLink(editor) { this.editor = editor; var cfg = editor.config; var self = this; - editor.config.btnList.createlink[3] = function() { self.show(self._getSelectedAnchor()); } + if(typeof editor._createLink == 'undefined') { + editor._createLink = function(target) { + if(!target) target = self._getSelectedAnchor(); + self.show(target); + } + } } CreateLink._pluginInfo = { name : "CreateLink", origin : "Xinha Core", - version : "$LastChangedRevision: 1084 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + version : "$LastChangedRevision: 1271 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), developer : "The Xinha Core Developer Team", - developer_url : "$HeadURL: http://svn.xinha.org/trunk/modules/CreateLink/link.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/CreateLink/link.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), sponsor : "", sponsor_url : "", license : "htmlArea" Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/XinhaDialog.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/XinhaDialog.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/XinhaDialog.js 23 May 2010 11:58:33 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/XinhaDialog.js 3 Dec 2012 18:38:12 -0000 1.4 @@ -14,9 +14,9 @@ -- This is the new all-in-one implementation of dialogs for Xinha -- -- - -- $HeadURL: http://svn.xinha.org/trunk/modules/Dialogs/XinhaDialog.js $ - -- $LastChangedDate: 2010-02-15 07:13:26 +1300 (Mon, 15 Feb 2010) $ - -- $LastChangedRevision: 1238 $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Dialogs/XinhaDialog.js $ + -- $LastChangedDate: 2010-06-18 12:23:58 +1200 (Fri, 18 Jun 2010) $ + -- $LastChangedRevision: 1267 $ -- $LastChangedBy: wymsy $ --------------------------------------------------------------------------*/ /*jslint regexp: false, rhino: false, browser: true, bitwise: false, forin: false, adsafe: false, evil: true, nomen: false, @@ -27,7 +27,7 @@ /** Xinha Dialog * * @constructor - * @version $LastChangedRevision: 1238 $ $LastChangedDate: 2010-02-15 07:13:26 +1300 (Mon, 15 Feb 2010) $ + * @version $LastChangedRevision: 1267 $ $LastChangedDate: 2010-06-18 12:23:58 +1200 (Fri, 18 Jun 2010) $ * @param {Xinha} editor Xinha object * @param {String} html string The HTML for the dialog's UI * @param {String} localizer string the "context" parameter for Xinha._lc(), typically the name of the plugin @@ -537,6 +537,23 @@ } } }); + //hide object & embed tags in document so they won't show through + if (this.editor.config.hideObjectsBehindDialogs) + { + this.objTags = this.editor._doc.getElementsByTagName('object'); + this.embedTags = this.editor._doc.getElementsByTagName('embed'); + for (var j=0; j +{ + "definition list": "Список с определением", + "definition term": "Заголовок", + "definition description": "Пояснение" +} Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js 23 May 2010 11:58:33 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js 3 Dec 2012 18:38:12 -0000 1.4 @@ -238,14 +238,17 @@ f_usetarget : editor.config.makeLinkShowsTarget, baseHref: editor.config.baseHref }; - } else + } + else + { outparam.param = { f_href : Xinha.is_ie ? link.href : link.getAttribute("href"), f_title : link.title, f_target : link.target, f_usetarget : editor.config.makeLinkShowsTarget, baseHref: editor.config.baseHref }; + } Dialog(this.config.ExtendedFileManager.manager+'&mode=link', function(param){ if (!param) Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/manager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/manager.js,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/manager.js 23 May 2010 11:58:33 -0000 1.8 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/manager.js 3 Dec 2012 18:38:13 -0000 1.9 @@ -151,7 +151,7 @@ else if(manager_mode=="link" && param) { var target_select = document.getElementById("f_target"); - var absoluteURL = new RegExp('^https?://'); + var absoluteURL = new RegExp('^(/|(https?://))'); if (param.f_href.length > 0 && !absoluteURL.test(param.f_href) && typeof param.baseHref == "string") { // URL is not absolute, prepend baseHref @@ -551,4 +551,4 @@ return true; } -Xinha.addOnloadHandler( init, window ); \ No newline at end of file +Xinha.addOnloadHandler( init, window ); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/FormOperations/FormOperations.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/FormOperations/FormOperations.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/FormOperations/FormOperations.js 23 May 2010 11:58:33 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/FormOperations/FormOperations.js 3 Dec 2012 18:38:13 -0000 1.4 @@ -2,7 +2,7 @@ /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- -- FormOperations Plugin -- - -- $HeadURL: http://svn.xinha.org/trunk/plugins/FormOperations/FormOperations.js $ + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/plugins/FormOperations/FormOperations.js $ -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ -- $LastChangedRevision: 1084 $ -- $LastChangedBy: ray $ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/backend.php,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/backend.php 23 May 2010 11:58:33 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/backend.php 3 Dec 2012 18:38:13 -0000 1.4 @@ -30,7 +30,7 @@ */ // Strip slashes if MQGPC is on -set_magic_quotes_runtime(0); +if(function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0); if(get_magic_quotes_gpc()) { $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/Classes/Transform.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/Classes/Transform.php,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/Classes/Transform.php 23 May 2010 11:58:33 -0000 1.11 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/Classes/Transform.php 3 Dec 2012 18:38:14 -0000 1.12 @@ -130,7 +130,7 @@ include_once "../ImageManager/Classes/$driver.php"; $classname = "Image_Transform_Driver_{$driver}"; - $obj =& new $classname; + $obj = new $classname; return $obj; } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js 2 Feb 2007 21:05:01 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js 3 Dec 2012 18:38:14 -0000 1.2 @@ -1,11 +1,11 @@ // I18N constants -// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1 // Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de { "language select": "Taalkeuze", "— language —": "— taal —", "Greek": "Grieks", "English": "Engels", "French": "Frans", - "Latin": "Latijns" -}; \ No newline at end of file + "Latin": "Latijn" +}; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Linker/Linker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Linker/Linker.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Linker/Linker.js 23 May 2010 11:58:34 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Linker/Linker.js 3 Dec 2012 18:38:14 -0000 1.3 @@ -31,16 +31,17 @@ this.lConfig = editor.config.Linker; var linker = this; - if(editor.config.btnList.createlink) - { - editor.config.btnList.createlink[3] - = function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); }; + if(typeof editor._createLink == 'undefined') { + editor._createLink = function(target) { + if(!target) target = linker._getSelectedAnchor(); + linker._createLink(target); + } } - else + if(!editor.config.btnList.createlink) { editor.config.registerButton( 'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false, - function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); } + function(e, objname, obj) { editor.execCommand("createlink"); } ); } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js 3 Dec 2012 18:38:14 -0000 1.2 @@ -36,7 +36,7 @@ { outparam = { - f_url : Xinha.is_ie ? image.src : image.src, + f_url : image.getAttribute('src'), //Xinha.is_ie ? image.src : image.src, f_alt : image.alt, f_border : image.style.borderWidth ? image.style.borderWidth : image.border, f_align : image.hasAttribute('align') ? image.align : null, @@ -72,7 +72,25 @@ uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, onComplete: function(path, file) { self.ImageManagerReturn(path,file); }, onHide: function() { if(this.swf && this.swf.box) this.swf.box.style.display = 'none'; }, - onShow: function() { if(this.swf && this.swf.box) this.swf.box.style.display = ''; }, + onShow: function() { + if(this.swf && this.swf.box) this.swf.box.style.display = ''; + if(self.current_image) + { + var src = self.current_image.getAttribute('src'); + if(!src.match(/^(([a-z]+:)|\/)/i)) + { + src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; + if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) + { + src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); + } + } + var path = src.replace(self.phpcfg.images_url+'/', '').split('/'); + var base = path.pop(); + path = self.phpcfg.images_url.split('/').pop() + (path.length ? ('/' + path.join('/')) : ''); + this.load(path, true, (function() { this.fillInfo(base); }).bind(this)); + } + }, onDetails: function(details) { this.info.adopt(self.ImageManagerAttributes(details)); @@ -177,7 +195,7 @@ div.style.position = 'relative'; var img = div.appendChild(document.createElement('img')); - img.src = '/plugins/ImageManager/img/locked.gif'; + img.src = Xinha.getPluginDir("ImageManager") + '/img/locked.gif'; img.width = 25; img.height = 32; img.alt = 'Constrain Proportions'; @@ -200,21 +218,25 @@ if(self.phpcfg.UseHSpaceVSpace) { // HSPACE/VSPACE var th = tr.appendChild(document.createElement('th')); - var label = th.appendChild(document.createTextNode('Margin:')); + var label = th.appendChild(document.createTextNode('L/R Margin:')); var td = tr.appendChild(document.createElement('td')); var input = td.appendChild(document.createElement('input')); input.name = 'f_hspace'; input.size = 3; input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_hspace'; - td.appendChild(document.createTextNode(' x ')); + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('T/B Margin:')); + var td = tr.appendChild(document.createElement('td')); var input = td.appendChild(document.createElement('input')); input.name = 'f_vspace'; input.size = 3; input.type = 'text'; td.appendChild(document.createTextNode(' px ')); - th.className = td.className = 'filemanager-f_hspace filemanager-f_vspace'; + th.className = td.className = 'filemanager-f_vspace'; } else { @@ -290,11 +312,11 @@ input.name = 'f_align'; input.title = 'Positioning of this image'; input.options[0] = new Option('', true, true); - input.options[1] = new Option('Left'); - input.options[2] = new Option('Right'); - input.options[3] = new Option('Top'); - input.options[4] = new Option('Middle'); - input.options[5] = new Option('Bottom'); + input.options[1] = new Option('Left', 'left'); + input.options[2] = new Option('Right', 'right'); + input.options[3] = new Option('Top', 'top'); + input.options[4] = new Option('Middle', 'middle'); + input.options[5] = new Option('Bottom', 'bottom'); // @TODO Constrain Ratio th.className = td.className = 'filemanager-f_align'; @@ -419,43 +441,64 @@ f_height: f('f_height').value, table: this._ImageManagerAttributesTable - } - + } return details; } // If details were supplied, we set the appropriate ones. if( - (f('f_width').value && f('f_width').value != details.width) - || (f('f_height').value && f('f_height').value != details.height) + ( (f('f_width').value && f('f_width').value != details.width) + || (f('f_height').value && f('f_height').value != details.height) ) + && + (!details.url || !this.current_image || this.current_image.getAttribute('src') != details.url) ) { - new Dialog('This image is a different size, would you like to use the new size?', { - language: { - confirm: 'Shrink/Grow To Fit', - decline: 'Fullsize' - }, - - buttons: [ - 'confirm', - 'decline' - ], - - onConfirm: function(){ - if(f('f_constrain').checked) - { - var new_size = self.ScaleImage(details, {width: f('f_width').value, height: f('f_height').value}); + // Check if this is the same image + var warn = function() { + new Dialog('This image is a different size, would you like to use the new size?', { + language: { + confirm: 'Shrink/Grow To Fit', + decline: 'Fullsize' + }, - f('f_width').value = f('f_width').value ? new_size.width : ''; - f('f_height').value = f('f_height').value ? new_size.height : ''; + buttons: [ + 'confirm', + 'decline' + ], + + onConfirm: function(){ + if(f('f_constrain').checked) + { + var new_size = self.ScaleImage(details, {width: f('f_width').value, height: f('f_height').value}); + + f('f_width').value = f('f_width').value ? new_size.width : ''; + f('f_height').value = f('f_height').value ? new_size.height : ''; + } + }, + + onDecline: function(){ + f('f_width').value = ''; + f('f_height').value = ''; } - }, + }); + } - onDecline: function(){ - f('f_width').value = ''; - f('f_height').value = ''; + if(!details.url) warn(); + else if(!this.current_image) warn(); + else + { + var src = self.current_image.getAttribute('src'); + if(!src.match(/^(([a-z]+:)|\/)/i)) + { + src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; + if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) + { + src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); + } + } + if(details.url != src) warn(); } - }); + } f('f_align').style.visibility = ''; // Ensure that the select hasn't been hidden by an overlay and not put back @@ -536,7 +579,7 @@ case "f_margin": { - if(value.length) + if(value && value.length) { img.style.margin = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); } @@ -547,7 +590,7 @@ } break; - case "f_align" : if(img.align && img.align !== true) { img.align = value; } else { img.removeAttribute('align'); } break; + case "f_align" : if(value && value !== true) { img.align = value; } else { img.removeAttribute('align'); } break; case "f_width" : { Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js 3 Dec 2012 18:38:14 -0000 1.2 @@ -51,30 +51,33 @@ MootoolsFileManager.AssetLoader .loadStyle('mootools-filemanager/Css/FileManager.css', 'MootoolsFileManager') .loadStyle('mootools-filemanager/Css/Additions.css', 'MootoolsFileManager') - .loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager') - .loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager') - .loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager') .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') .loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager') - .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager'); + .loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager'); } MootoolsFileManager.AssetLoader.loadStyle('MootoolsFileManager.css', 'MootoolsFileManager'); function MootoolsFileManager(editor) -{ +{ this.editor = editor; var self = this; var cfg = editor.config; // Do a callback to the PHP backend and get it to "decode" the configuration for us into a - // javascript object. - Xinha._postback(editor.config.MootoolsFileManager.backend+'__function=read-config', editor.config.MootoolsFileManager.backend_data, - function(phpcfg) - { - eval ('var f = '+phpcfg+';'); - self.phpcfg = f; self.hookUpButtons(); - }); + // javascript object. + + // IMPORTANT: we need to do this synchronously to ensure that the buttons are added to the toolbar + // before the toolbar is drawn. + + var phpcfg = Xinha._posturlcontent(editor.config.MootoolsFileManager.backend+'__function=read-config', editor.config.MootoolsFileManager.backend_data); + + eval ('var f = '+phpcfg+';'); + self.phpcfg = f; + self.hookUpButtons(); return; }; @@ -115,9 +118,9 @@ MootoolsFileManager.AssetLoader.loadScriptOnce('MootoolsFileManager.ImageManager.js', 'MootoolsFileManager'); // Override our Editors insert image button action. - self.editor._insertImage = function() + self.editor._insertImage = function(image) { - MootoolsFileManager.AssetLoader.whenReady(function() { self.OpenImageManager(); }); + MootoolsFileManager.AssetLoader.whenReady(function() { self.OpenImageManager(image); }); } } }; @@ -222,4 +225,4 @@ } return Xinha._colorToRgb(color); -} \ No newline at end of file +} Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php 3 Dec 2012 18:38:14 -0000 1.2 @@ -30,8 +30,8 @@ */ // Strip slashes if MQGPC is on -set_magic_quotes_runtime(0); -if(get_magic_quotes_gpc()) +if(function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0); +if(function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) { $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); while(count($to_clean)) @@ -56,7 +56,7 @@ { if(preg_match('/([0-9\.])+([a-zA-Z]+)/', $s, $M)) { - switch(strtolower($M)) + switch(strtolower($M[2])) { case 'm': return floor(floatval($M[1]) * 1024 * 1024); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php 3 Dec 2012 18:38:14 -0000 1.2 @@ -136,7 +136,18 @@ $IMConfig['base_dir'] = getcwd(); $IMConfig['base_url'] = preg_replace('/\/backend\.php.*/', '', $_SERVER['REQUEST_URI']); +/** +== HTML Compatability == + + For most people the default of using CSS will be fine, but if the HTML you are editing + in Xinha is destined for an email you will probably want to use hspace and vspace + instead of CSS margins because of poor Email support for CSS. + +*/ + +$IMConfig['UseHSpaceVSpace'] = TRUE; + /** // Future use, not yet required. Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php 3 Dec 2012 18:38:14 -0000 1.2 @@ -92,10 +92,10 @@ 'default' => null, 'extension' => strtolower(pathinfo($file, PATHINFO_EXTENSION)), ), $options); - + $options['extension'] = strtolower($options['extension']); $mime = null; $ini = error_reporting(0); - if (function_exists('finfo_open') && $f = finfo_open(FILEINFO_MIME, getenv('MAGIC'))){ + if (function_exists('finfo_open') && $f = @finfo_open(FILEINFO_MIME, getenv('MAGIC'))){ $mime = finfo_file($f, $file); finfo_close($f); } @@ -121,4 +121,4 @@ } -class UploadException extends Exception {} \ No newline at end of file +class UploadException extends Exception {} Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php 23 May 2010 11:58:34 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php 3 Dec 2012 18:38:14 -0000 1.2 @@ -109,7 +109,7 @@ // Check memory limit. $memory_limit = ini_get('memory_limit'); - if (eregi('([0-9]+)M', $memory_limit, $matches)) { + if (preg_match('/([0-9]+)M/i', $memory_limit, $matches)) { // could be stored as "16M" rather than 16777216 for example $memory_limit = $matches[1] * 1048576; } @@ -1492,7 +1492,7 @@ if ($hex) { $return_string .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT); } else { - $return_string .= ' '.(ereg("[\x20-\x7E]", $string{$i}) ? $string{$i} : '�'); + $return_string .= ' '.(preg_match("/[\x20-\x7E]/", $string{$i}) ? $string{$i} : '�'); } if ($spaces) { $return_string .= ' '; @@ -1595,4 +1595,4 @@ -?> \ No newline at end of file +?> Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/Files/Test/smurfs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/Files/Test/smurfs.jpg,v diff -u Binary files differ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js 3 Dec 2012 18:38:16 -0000 1.1 @@ -0,0 +1,80 @@ +/* +Script: Language.pt.js + MooTools FileManager - Language Strings in European Portuguese + +Translation: + [Alexandre Rocha](http://twitter.com/procy0n) +*/ + +FileManager.Language.en = { + more: 'Detalhes', + width: 'Largura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Seleccionar ficheiro', + upload: 'Enviar', + create: 'Criar pasta', + createdir: 'Por favor especifique o nome da pasta:', + cancel: 'Cancelar', + + information: 'Informação', + type: 'Tipo:', + size: 'Tamanho:', + dir: 'Caminho:', + modified: 'Última modificação:', + preview: 'Pré-visualizar', + close: 'Fechar', + destroy: 'Apagar', + destroyfile: 'Tem a certeza que quer apagar este ficheiro?', + + rename: 'Renomear', + renamefile: 'Por favor introduza o novo nome do ficheiro:', + + download: 'Descarregar', + nopreview: 'Pré-visualização não disponível', + + title: 'Título:', + artist: 'Artista:', + album: 'Album:', + length: 'Duração:', + bitrate: 'Taxa de bits:', + + deselect: 'Desfazer', + + nodestroy: 'Apagamento de ficheiros desactivado neste servidor.', + + 'upload.disabled': 'Envio de ficheiros desactivado neste servidor.', + 'upload.authenticated': 'Não está autenticado para o envio de ficheiros.', + 'upload.path': 'A pasta especificada para envio de ficheiros não existe. Por favor contacte o administrador do site.', + 'upload.exists': 'O caminho especificado já existe. Por favor contacte o administrador do site.', + 'upload.mime': 'Tipo de ficheiro especificado não permitido.', + 'upload.extension': 'Extensão do ficheiro enviado desconhecido ou não permitido.', + 'upload.size': 'Tamanho do ficheiro demasiado grande para ser processado neste servidor. Por favor envie um ficheiro mais pequeno.', + 'upload.partial': 'Envio incompleto do ficheiro, por favor tente novamente.', + 'upload.nofile': 'Nenhum ficheiro seleccionado para enviar.', + 'upload.default': 'Erro no envio do ficheiro.', + + /* FU */ + uploader: { + unknown: 'Erro desconhecido', + sizeLimitMin: 'Não é permitido anexar "${name}" (${size}), o tamanho mínimo do ficheiro é de${size_min}!', + sizeLimitMax: 'Não é permitido anexar "${name}" (${size}), o tamanho máximo do ficheiro é de ${size_max}!' + }, + + flash: { + hidden: 'Para activar o envio, desbloqueie-o no navegador e recarregue a página (ver Adblock).', + disabled: 'Para activar o envio, active o ficheiro Flash e recarregue a página (ver Flashblock).', + flash: 'Para enviar ficheiros precisa de instalar Adobe Flash.' + }, + + resizeImages: 'Redimensionar imagens grandes ao enviar', + + serialize: 'Guardar galeria', + gallery: { + text: 'Legenda da imagem', + save: 'Guardar', + remove: 'Remover da galeria', + drag: 'Arraste os items para criar a galeria...' + } +}; \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js 23 May 2010 12:00:02 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js 3 Dec 2012 18:38:16 -0000 1.2 @@ -25,21 +25,23 @@ Element.implement({ - appearOn: function(el, opacity, options){ - opacity = $type(opacity) == 'array' ? [opacity[0] || 1, opacity[1] || 0] : [opacity || 1, 0]; - - this.set({ - opacity: opacity[1], - tween: options || {duration: 200} - }); - - $(el).addEvents({ - mouseenter: this.fade.bind(this, opacity[0]), - mouseleave: this.fade.bind(this, opacity[1]) - }); - - return this; - }, + appearOn: function(el) { + + var params = Array.link($A(arguments).erase(arguments[0]), {options: Object.type, opacity: $defined}), + opacity = $type(params.opacity) == 'array' ? [params.opacity[0] || 1, params.opacity[1] || 0] : [params.opacity || 1, 0]; + + this.set({ + opacity: opacity[1], + tween: params.options || {duration: 500} + }); + + $$(el).addEvents({ + mouseenter: this.fade.bind(this, opacity[0]), + mouseleave: this.fade.bind(this, opacity[1]) + }); + + return this; + }, center: function(offsets){ var scroll = document.getScroll(), Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js 23 May 2010 12:00:02 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js 3 Dec 2012 18:38:16 -0000 1.2 @@ -309,7 +309,13 @@ this.switchButton(); }, - load: function(dir, nofade){ + /* XINHA: We add a callback capability which will be called whe the loading is completed. + * NOTE: For some reason, MFM wants the dir to include the last component of the prefix + * eg if your images_dir is /fancy/images and you want to load /fancy/images/foo/bar you must pass + * images/foo/bar -- crazy annoying + */ + + load: function(dir, nofade, callback){ this.deselect(); if (!nofade) this.info.fade(0); @@ -319,6 +325,7 @@ url: this.options.url, onSuccess: (function(j){ this.fill(j, nofade); + if(callback) callback(j); }).bind(this), data: { directory: dir @@ -443,7 +450,8 @@ el.inject(new Element('li').inject(this.browser)).store('parent', el.getParent()); icons = $$(icons.map(function(icon){ return icon.appearOn(icon, [1, 0.7]); })).appearOn(el.getParent('li'), 0.7); }, this); - + this.CurrentFiles = j.files; // XINHA - fillInfo() will use this to find a pre-selected file + var self = this, revert = function(el){ el.set('opacity', 1).store('block', true).removeClass('drag').removeClass('move').setStyles({ opacity: 1, @@ -453,7 +461,7 @@ left: 0, top: 0 }).inject(el.retrieve('parent')); - el.getElements('img.browser-icon').set('opacity', 0); + // el.getElements('img.browser-icon').set('opacity', 0); // XINHA - NOT REQUIRED? document.removeEvents('keydown', self.bound.keydown).removeEvents('keyup', self.bound.keydown); self.imageadd.fade(0); @@ -551,8 +559,35 @@ fillInfo: function(file, path){ if (!file) file = this.CurrentDir; if (!path) path = this.Directory; - + if (!file) return; + + /* XINHA: In order to facilitate pre-selecting an image/file for modification, we can pass in a filename (just the basename) + as file and we will search in the current files for it. You must have done a load first, and call the fillInfo as a result of the load. + YourImageManager.load('path/to/dir', true, function() { YourImageManager.fillInfo('file.jpg'); }); + */ + var self = this; + if(typeof file == 'string') + { + if(this.CurrentFiles) + { + this.CurrentFiles.each(function(f) + { + if(typeof file != 'string') return; + if(f.name == file) + { + file = f; + if(file.element) + { + self.Current = file.element.addClass('selected'); + self.switchButton(); + } + + } + }); + } + } + var size = this.size(file.size); this.info.fade(1).getElement('img').set({ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js 23 May 2010 12:00:02 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js 3 Dec 2012 18:38:16 -0000 1.2 @@ -123,10 +123,10 @@ if (!path.contains('?')) path += '?noCache=' + $time(); // cache in IE // container options for Swiff class - this.options.container = this.box = new Element('span', {'class': 'swiff-uploader-box'}).inject($(this.options.container) || document.body); + this.options.container = this.box = new Element('span', {'class': 'swiff-uploader-box'}).inject(document.id(this.options.container) || document.body); // target - this.target = $(this.options.target); + this.target = document.id(this.options.target); if (this.target) { var scroll = window.getScroll(); this.box.setStyles({ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/PersistentStorage/dialog.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/PersistentStorage/dialog.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/PersistentStorage/dialog.css 3 Dec 2012 18:38:16 -0000 1.1 @@ -0,0 +1,89 @@ + +.placesmanager +{ + width: 95%; + overflow: auto; +} + +.filemanager +{ + width: 95%; + height: 200px; + overflow: auto; + background-color: #fff; +} +.filemanager div.file +{ + min-width: 80px; + height: 100px; + position: relative; + float: left; + border: 1px outset #666; + margin: 4px; +} +.placesmanager div.file +{ + min-width: 60px; + height: 70px; + position: relative; + float: left; + border: 1px outset #666; + margin: 4px; +} +.filemanager div.file:hover, +.placesmanager div.file:hover +{ + border: 1px solid #333; + background: #fffff3; +} + +.filemanager div.selected, +.filemanager div.selected:hover, +.placesmanager div.selected, +.placesmanager div.selected:hover +{ + background: #ffffda; + border: 1px solid #000; +} +.filemanager .filename { + margin: 0.5em; + color: #222; +} +.filemanager div.selected .filename { + color: #000; +} +.filemanager img.thumb +{ + width: 50px; + height: 50px; + position: absolute; + top: 50%; + left: 50%; + margin: -25px 0 0 -25px; + border: 1px solid black; +} +.filemanager img.icon +{ + width: 32px; + height: 32px; + position: absolute; + top: 50%; + left: 50%; + margin: -16px 0 0 -16px; +} +.filemanager img.action +{ + width: 15px; + height: 15px; + position: absolute; +} +.filemanager img.delete +{ + bottom: 3px; + left: 20px; +} +.filemanager img.copy +{ + bottom: 3px; + left: 3px; +} Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js 23 May 2010 12:00:02 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js 3 Dec 2012 18:38:17 -0000 1.4 @@ -15,9 +15,11 @@ // Object that will encapsulate all the table operations provided by // HTMLArea-3.0 (except "insert table" which is included in the main file) Xinha.Config.prototype.TableOperations = { - 'showButtons' : true // Set to false to hide all but inserttable and toggleborders buttons on the toolbar + 'showButtons' : true, // Set to false to hide all but inserttable and toggleborders buttons on the toolbar // this is useful if you have the ContextMenu plugin and want to save toolbar space // (the context menu can perform all the button operations) + 'addToolbarLineBreak': true // By default TableOperations adds a 'linebreak' in the toolbar. + // Set to false to prevent this and instead just append the buttons without a 'linebreak'. } function TableOperations(editor) { @@ -29,12 +31,16 @@ // register the toolbar buttons provided by this plugin - // Remove existing inserttable and toggleborders, we will replace it in our group - cfg.removeToolbarElement(' inserttable toggleborders '); - - var toolbar = ["linebreak", "inserttable", "toggleborders"]; - - + // Remove existing inserttable and toggleborders, we will replace it in our group + cfg.removeToolbarElement(' inserttable toggleborders '); + + var toolbar; + if( cfg.TableOperations.addToolbarLineBreak ) { + toolbar = ["linebreak", "inserttable", "toggleborders"]; + } else { + toolbar = ["inserttable", "toggleborders"]; + } + for (var i = 0; i < bl.length; ++i) { var btn = bl[i]; if (!btn) { @@ -62,7 +68,8 @@ { Xinha._loadback(_editor_url + 'modules/InlineStyler/InlineStyler.js'); } - + + cfg.dblclickList['td'] = [function() { self.dialogTableProperties() }]; } TableOperations._pluginInfo = { Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/UnFormat/UnFormat.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/UnFormat/UnFormat.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/UnFormat/UnFormat.js 16 Jan 2009 09:05:49 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/UnFormat/UnFormat.js 3 Dec 2012 18:38:17 -0000 1.2 @@ -37,7 +37,7 @@ UnFormat.prototype.onUpdateToolbar = function(editor){ if (!(UnFormat.dialogReady && UnFormat.methodsReady)) { - this.editor._toolbarObjects.UnFormat.state("enabled", false); + this.editor._toolbarObjects.unformat.state("enabled", false); } else this.onUpdateToolbar = null; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.css,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.css 16 Jan 2009 09:05:49 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.css 3 Dec 2012 18:38:17 -0000 1.5 @@ -14,6 +14,11 @@ height:25px; } +.htmlarea .toolbarRow td.toolBarElement +{ + margin:0px; padding:0px; +} + .htmlarea .toolbar .button { background-image: url(button-background.png); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/skins/blue-look/skin.xml 3 Dec 2012 18:38:17 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + + + + + Crystal + \ No newline at end of file