Changeset 975
- Timestamp:
- 02/20/08 19:12:57 (5 years ago)
- Location:
- branches/ray
- Files:
-
- 12 removed
- 57 modified
- 18 copied
-
Xinha.css (modified) (1 diff)
-
XinhaCore.js (modified) (50 diffs)
-
XinhaLoader.js (modified) (5 diffs)
-
contrib/compress.php (modified) (5 diffs)
-
contrib/compress_yui.php (copied) (copied from trunk/contrib/compress_yui.php)
-
contrib/php-xinha.php (modified) (2 diffs)
-
examples/Extended.html (deleted)
-
examples/ExtendedDemo.html (copied) (copied from trunk/examples/ExtendedDemo.html)
-
examples/Newbie.html (modified) (2 diffs)
-
examples/XinhaConfig.js (modified) (4 diffs)
-
examples/custom.css (deleted)
-
examples/dynamic.css (deleted)
-
examples/ext_example-body.html (deleted)
-
examples/ext_example-dest.php (deleted)
-
examples/ext_example-menu.php (deleted)
-
examples/ext_example.html (deleted)
-
examples/files (copied) (copied from trunk/examples/files)
-
examples/files/Extended.html (copied) (copied from trunk/examples/files/Extended.html)
-
examples/files/custom.css (copied) (copied from trunk/examples/files/custom.css)
-
examples/files/dynamic.css (copied) (copied from trunk/examples/files/dynamic.css)
-
examples/files/ext_example-body.html (copied) (copied from trunk/examples/files/ext_example-body.html)
-
examples/files/ext_example-dest.php (copied) (copied from trunk/examples/files/ext_example-dest.php)
-
examples/files/ext_example-menu.php (copied) (copied from trunk/examples/files/ext_example-menu.php)
-
examples/files/full_example.css (copied) (copied from trunk/examples/files/full_example.css)
-
examples/files/stylist.css (copied) (copied from trunk/examples/files/stylist.css)
-
examples/full_example.css (deleted)
-
examples/full_example.js (deleted)
-
examples/simple_example.html (modified) (4 diffs)
-
examples/stylist.css (deleted)
-
examples/testbed.html (modified) (7 diffs)
-
lang/es.js (modified) (2 diffs)
-
lang/fa.js (modified) (1 diff)
-
modules/ColorPicker/ColorPicker.js (modified) (5 diffs)
-
modules/Dialogs/XinhaDialog.js (modified) (4 diffs)
-
modules/Dialogs/dialog.js (modified) (1 diff)
-
modules/FullScreen/full-screen.js (modified) (1 diff)
-
modules/Gecko/Gecko.js (modified) (10 diffs)
-
modules/Gecko/lang (deleted)
-
modules/Gecko/paraHandlerDirty.js (deleted)
-
modules/GetHtml/DOMwalk.js (modified) (3 diffs)
-
modules/GetHtml/TransformInnerHTML.js (modified) (2 diffs)
-
modules/InternetExplorer/InternetExplorer.js (modified) (6 diffs)
-
modules/WebKit (copied) (copied from trunk/modules/WebKit)
-
modules/WebKit/WebKit.js (copied) (copied from trunk/modules/WebKit/WebKit.js)
-
plugins/ExtendedFileManager/Classes/ExtendedFileManager.php (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/EditorContent.js (modified) (24 diffs)
-
plugins/ExtendedFileManager/assets/dialog.js (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/dragTableCols.js (copied) (copied from trunk/plugins/ExtendedFileManager/assets/dragTableCols.js)
-
plugins/ExtendedFileManager/assets/editor.css (modified) (4 diffs)
-
plugins/ExtendedFileManager/assets/editor.js (modified) (8 diffs)
-
plugins/ExtendedFileManager/assets/editorFrame.css (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/editorFrame.js (modified) (4 diffs)
-
plugins/ExtendedFileManager/assets/imagelist.css (modified) (2 diffs)
-
plugins/ExtendedFileManager/assets/manager.css (modified) (2 diffs)
-
plugins/ExtendedFileManager/assets/manager.js (modified) (9 diffs)
-
plugins/ExtendedFileManager/assets/popup.js (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/wz_jsgraphics.js (modified) (6 diffs)
-
plugins/ExtendedFileManager/config.inc.php (modified) (4 diffs)
-
plugins/ExtendedFileManager/demo_images/linux/linux.gif (modified) (previous)
-
plugins/ExtendedFileManager/editor.php (copied) (copied from trunk/plugins/ExtendedFileManager/editor.php)
-
plugins/ExtendedFileManager/editorFrame.php (modified) (2 diffs)
-
plugins/ExtendedFileManager/extended-file-manager.js (modified) (5 diffs)
-
plugins/ExtendedFileManager/images.php (modified) (12 diffs)
-
plugins/ExtendedFileManager/lang/de.js (modified) (2 diffs)
-
plugins/ExtendedFileManager/lang/es.js (copied) (copied from trunk/plugins/ExtendedFileManager/lang/es.js)
-
plugins/ExtendedFileManager/lang/fr.js (copied) (copied from trunk/plugins/ExtendedFileManager/lang/fr.js)
-
plugins/ExtendedFileManager/manager.php (modified) (7 diffs)
-
plugins/ExtendedFileManager/resizer.php (modified) (1 diff)
-
plugins/ImageManager/Classes/GD.php (modified) (9 diffs)
-
plugins/ImageManager/Classes/IM.php (modified) (2 diffs)
-
plugins/ImageManager/Classes/ImageEditor.php (modified) (7 diffs)
-
plugins/ImageManager/assets/dialog.js (modified) (1 diff)
-
plugins/ImageManager/assets/images.js (modified) (1 diff)
-
plugins/ImageManager/demo_images/linux/linux.gif (modified) (previous)
-
plugins/ImageManager/editor.php (modified) (1 diff)
-
plugins/ImageManager/lang/es.js (copied) (copied from trunk/plugins/ImageManager/lang/es.js)
-
plugins/ImageManager/manager.php (modified) (1 diff)
-
plugins/ImageManager/resizer.php (modified) (1 diff)
-
plugins/InsertAnchor/insert-anchor.js (modified) (1 diff)
-
plugins/Linker/scan.php (modified) (3 diffs)
-
plugins/SaveSubmit/save-submit.js (modified) (2 diffs)
-
plugins/SmartReplace/smart-replace.js (modified) (5 diffs)
-
plugins/Stylist/stylist.js (modified) (3 diffs)
-
plugins/SuperClean/tidy.php (modified) (1 diff)
-
popups/popup.js (modified) (1 diff)
-
release-notes.txt (modified) (1 diff)
-
skins/silva/skin.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ray/Xinha.css
r862 r975 71 71 .htmlarea .toolbar select:hover, 72 72 .htmlarea .toolbar select:active { 73 margin-top: 2px;74 margin-bottom: 1px;75 color: ButtonText;76 height: 17px;73 position:relative; 74 top:-2px; 75 margin-bottom:-2px; 76 color: ButtonText; 77 77 } 78 78 -
branches/ray/XinhaCore.js
r911 r975 22 22 -- bar(); 23 23 -- } 24 -- * Don't change brace styles unless you're working on the non BSD-Style 25 -- area (so we don't get spurious changes in line numbering). 26 -- * Don't change indentation unless you're working on the badly indented 27 -- area (so we don't get spurious changes of large blocks of code). 24 -- * Don't change brace styles. 25 -- * Don't change indentation. 28 26 -- * Jedit is the recommended editor, a comment of this format should be 29 27 -- included in the top 10 lines of the file (see the embedded edit mode) … … 141 139 */ 142 140 Xinha.is_khtml = (Xinha.agt.indexOf("khtml") != -1); 141 /** Browser is WebKit 142 @type string 143 */ 144 Xinha.is_webkit = (Xinha.agt.indexOf("applewebkit") != -1); 143 145 /** Browser is Safari 144 146 @type string … … 157 159 */ 158 160 Xinha.is_win_ie = (Xinha.is_ie && !Xinha.is_mac); 159 /** Browserengine is Gecko (Mozilla) 161 /** Browserengine is Gecko (Mozilla), applies also to Safari 160 162 @type string 161 163 */ 162 Xinha.is_gecko = (navigator.product == "Gecko" && !Xinha.is_safari); // Safari lies! 164 Xinha.is_gecko = (navigator.product == "Gecko"); 165 Xinha.is_real_gecko = (navigator.product == "Gecko" && !Xinha.is_webkit); 166 Xinha.is_ff3 = Xinha.is_real_gecko && parseInt(navigator.productSub) >= "2007121016"; 167 Xinha.is_ff2 = Xinha.is_real_gecko && parseInt(navigator.productSub) < "2007121016"; 168 163 169 /** File is opened locally opened ("file://" protocol) 164 170 * @type string … … 178 184 Xinha.checkSupportedBrowser = function() 179 185 { 180 if ( Xinha.is_gecko ) 181 { 182 if ( navigator.productSub < 20021201 ) 183 { 184 alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported."); 186 if ( Xinha.is_opera ) 187 { 188 // alert("Sorry, Opera is not yet supported by Xinha."); 185 189 return false; 186 190 } 187 if ( navigator.productSub < 20030210 ) 188 { 189 alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work."); 190 } 191 } 192 if ( Xinha.is_opera ) 193 { 194 alert("Sorry, Opera is not yet supported by Xinha."); 195 } 196 return Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5; 191 return Xinha.is_gecko || (Xinha.is_opera && 0 && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5; 197 192 }; 198 193 /** Cache result of checking for browser support … … 219 214 if ( !textarea ) 220 215 { 221 throw ("Tried to create Xinha without textarea specified.");216 throw new Error ("Tried to create Xinha without textarea specified."); 222 217 } 223 218 … … 475 470 Xinha.Config = function() 476 471 { 477 var cfg = this;478 472 this.version = Xinha.version.Revision; 479 473 … … 704 698 * your absolute links, your external string might be some special code, say "{server_url}" 705 699 * an you say that the internal represenattion of that should be http://your.server/<br /> 706 * Example: <code>{ 'external_string' : 'internal_string'}</code><br />700 * Example: <code>{ 'html_string' : 'wysiwyg_string' }</code><br /> 707 701 * Default: <code>{}</code> (empty) 708 702 * @type Object 709 703 */ 710 this.specialReplacements = {}; // { 'external_string' : 'internal_string' }704 this.specialReplacements = {}; //{ 'html_string' : 'wysiwyg_string' } 711 705 712 706 /** Set to true if you want Word code to be cleaned upon Paste. This only works if … … 745 739 this.popupURL = "popups/"; 746 740 747 /** Remove given tags when rendering the HTML (these have to be a regexp, or null if this functionality is not desired)<br /> 741 /** RegExp allowing to remove certain HTML tags when rendering the HTML.<br /> 742 * Example: remove span and font tags 743 * <code> 744 * xinha_config.htmlRemoveTags = /span|font/; 745 * </code> 748 746 * Default: <code>null</code> 749 747 * @type RegExp|null … … 1428 1426 toolbar.className = "toolbar"; 1429 1427 toolbar.unselectable = "1"; 1428 toolbar.align = this.config.toolbarAlign; 1430 1429 1431 1430 Xinha.freeLater(this, '_toolBar'); … … 2046 2045 editor._browserSpecificPlugin = editor.registerPlugin('InternetExplorer'); 2047 2046 } 2048 else 2047 else if (Xinha.is_webkit) 2048 { 2049 url = _editor_url + 'modules/WebKit/WebKit.js'; 2050 if ( !Xinha.loadPlugins(["WebKit"], function() { editor.generate(); }, url ) ) 2051 { 2052 2053 return false; 2054 } 2055 editor._browserSpecificPlugin = editor.registerPlugin('WebKit'); 2056 } 2057 else if (Xinha.is_gecko) 2049 2058 { 2050 2059 url = _editor_url + 'modules/Gecko/Gecko.js'; … … 2118 2127 2119 2128 // If this is gecko, set up the paragraph handling now 2120 if ( Xinha.is_gecko && ( editor.config.mozParaHandler == 'best' || editor.config.mozParaHandler == 'dirty' ) ) 2121 { 2122 switch (this.config.mozParaHandler) 2123 { 2124 case 'dirty': 2125 var ParaHandlerPlugin = _editor_url + 'modules/Gecko/paraHandlerDirty.js'; 2126 break; 2127 default: 2128 var ParaHandlerPlugin = _editor_url + 'modules/Gecko/paraHandlerBest.js'; 2129 break; 2130 } 2131 if ( !Xinha.loadPlugins(["EnterParagraphs"], function() { editor.generate(); }, ParaHandlerPlugin ) ) 2129 if ( Xinha.is_gecko && editor.config.mozParaHandler != 'built-in' ) 2130 { 2131 if ( !Xinha.loadPlugins(["EnterParagraphs"], function() { editor.generate(); }, _editor_url + 'modules/Gecko/paraHandlerBest.js' ) ) 2132 2132 { 2133 2133 return false; … … 2447 2447 2448 2448 this.notifyOf('before_resize', {width:width, height:height}); 2449 this.firePluginEvent('onBeforeResize', width, height); 2449 2450 // We need to set the iframe & textarea to 100% height so that the htmlarea 2450 2451 // isn't "pushed out" when we get it's height, so we can change them later. … … 2628 2629 edcellwidth -= parseInt(this.config.panel_dimensions.right, 10); 2629 2630 } 2630 this._iframe.style.width = edcellwidth + 'px'; 2631 var iframeWidth = (this.config.iframeWidth)? parseInt(this.config.iframeWidth,10): null; 2632 this._iframe.style.width = (iframeWidth && iframeWidth < edcellwidth)? iframeWidth + "px": edcellwidth + "px"; 2631 2633 2632 2634 this._textArea.style.height = this._iframe.style.height; … … 2634 2636 2635 2637 this.notifyOf('resize', {width:this._htmlArea.offsetWidth, height:this._htmlArea.offsetHeight}); 2638 this.firePluginEvent('onResize',this._htmlArea.offsetWidth, this._htmlArea.offsetWidth); 2636 2639 this._risizing = false; 2637 2640 }; … … 2672 2675 2673 2676 this.notifyOf('panel_change', {'action':'add','panel':div}); 2674 2677 this.firePluginEvent('onPanelChange','add',div); 2675 2678 return div; 2676 2679 }; … … 2691 2694 this._panels[panel.side].panels = clean; 2692 2695 this.notifyOf('panel_change', {'action':'remove','panel':panel}); 2696 this.firePluginEvent('onPanelChange','remove',panel); 2693 2697 }; 2694 2698 /** Hides a panel … … 2702 2706 panel.style.display = 'none'; 2703 2707 this.notifyOf('panel_change', {'action':'hide','panel':panel}); 2708 this.firePluginEvent('onPanelChange','hide',panel); 2704 2709 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2705 2710 } … … 2715 2720 panel.style.display = ''; 2716 2721 this.notifyOf('panel_change', {'action':'show','panel':panel}); 2722 this.firePluginEvent('onPanelChange','show',panel); 2717 2723 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2718 2724 } … … 2738 2744 } 2739 2745 this.notifyOf('panel_change', {'action':'multi_hide','sides':sides}); 2746 this.firePluginEvent('onPanelChange','multi_hide',sides); 2740 2747 }; 2741 2748 /** Shows the panel(s) on one or more sides … … 2759 2766 } 2760 2767 this.notifyOf('panel_change', {'action':'multi_show','sides':sides}); 2768 this.firePluginEvent('onPanelChange','multi_show',sides); 2761 2769 }; 2762 2770 /** Returns an array containig all properties that are set in an object … … 2866 2874 } catch (ex) {} 2867 2875 } 2868 else if ( !Xinha.is_ gecko&& this._doc.body.contentEditable !== false )2876 else if ( !Xinha.is_designMode && this._doc.body.contentEditable !== false ) 2869 2877 { 2870 2878 this._doc.body.contentEditable = false; … … 2949 2957 html += Xinha.addCoreCSS(); 2950 2958 2951 if ( editor.config.pageStyle )2952 {2953 html += "<style type=\"text/css\">\n" + editor.config.pageStyle + "\n</style>";2954 }2955 2956 2959 if ( typeof editor.config.pageStyleSheets !== 'undefined' ) 2957 2960 { … … 2965 2968 } 2966 2969 } 2970 2971 if ( editor.config.pageStyle ) 2972 { 2973 html += "<style type=\"text/css\">\n" + editor.config.pageStyle + "\n</style>"; 2974 } 2975 2967 2976 html += "</head>\n"; 2968 html += "<body >\n";2977 html += "<body" + (editor.config.bodyID ? (" id=\"" + editor.config.bodyID + "\"") : '') + ">\n"; 2969 2978 html += editor.inwardHtml(editor._textArea.value); 2970 2979 html += "</body>\n"; … … 3027 3036 { 3028 3037 case "textmode": 3038 this.firePluginEvent('onBeforeMode', 'textmode'); 3029 3039 this.setCC("iframe"); 3030 3040 html = this.outwardHtml(this.getHTML()); … … 3041 3051 this._statusBarTextMode.style.display = ""; 3042 3052 } 3053 this.findCC("textarea"); 3043 3054 this.notifyOf('modechange', {'mode':'text'}); 3044 this.fi ndCC("textarea");3055 this.firePluginEvent('onMode', 'textmode'); 3045 3056 break; 3046 3057 3047 3058 case "wysiwyg": 3059 this.firePluginEvent('onBeforeMode', 'wysiwyg'); 3048 3060 this.setCC("textarea"); 3049 3061 html = this.inwardHtml(this.getHTML()); … … 3058 3070 this._statusBarTextMode.style.display = "none"; 3059 3071 } 3072 this.findCC("iframe"); 3060 3073 this.notifyOf('modechange', {'mode':'wysiwyg'}); 3061 this.findCC("iframe"); 3074 this.firePluginEvent('onMode', 'wysiwyg'); 3075 3062 3076 break; 3063 3077 … … 3067 3081 } 3068 3082 this._editMode = mode; 3069 3070 for ( var i in this.plugins )3071 {3072 var plugin = this.plugins[i].instance;3073 if ( plugin && typeof plugin.onMode == "function" )3074 {3075 plugin.onMode(mode);3076 }3077 }3078 3083 }; 3079 3084 /** Sets the HTML in fullpage mode. Actually the whole iframe document is rewritten. … … 3213 3218 var plugin = arguments[0]; 3214 3219 3215 // @todo : try to avoid the use of eval()3216 3220 // We can only register plugins that have been succesfully loaded 3217 if ( plugin === null || typeof plugin == 'undefined' || (typeof plugin == 'string' && eval('typeof ' + plugin)== 'undefined') )3221 if ( plugin === null || typeof plugin == 'undefined' || (typeof plugin == 'string' && typeof window[plugin] == 'undefined') ) 3218 3222 { 3219 3223 return false; … … 3235 3239 Xinha.prototype.registerPlugin2 = function(plugin, args) 3236 3240 { 3237 // @todo : try to avoid the use of eval() 3238 if ( typeof plugin == "string" ) 3239 { 3240 plugin = eval(plugin); 3241 if ( typeof plugin == "string" && typeof window[plugin] == 'function' ) 3242 { 3243 plugin = window[plugin]; 3241 3244 } 3242 3245 if ( typeof plugin == "undefined" ) … … 3288 3291 3289 3292 Xinha.setLoadingMessage (Xinha._lc("Loading plugin $plugin="+pluginName+"$")); 3290 // @todo : try to avoid the use of eval() 3293 3291 3294 // Might already be loaded 3292 //if ( eval('typeof ' + pluginName) != 'undefined' )3293 // @todo: try if this works to avoid the use of eval, I've been never getting here when testing3294 3295 if ( typeof window['pluginName'] != 'undefined' ) 3295 3296 { … … 3334 3335 { 3335 3336 var p = nuPlugins.pop(); 3337 if (p == 'FullScreen' && !url ) continue; //prevent trying to load FullScreen plugin from the plugins folder 3336 3338 if ( typeof Xinha._pluginLoadStatus[p] == 'undefined' ) 3337 3339 { … … 3508 3510 link.type = "text/css"; 3509 3511 if (id) link.id = id; 3510 if (prepend )3512 if (prepend && head.getElementsByTagName('link')[0]) 3511 3513 { 3512 3514 head.insertBefore(link,head.getElementsByTagName('link')[0]); … … 4171 4173 this._timerUndo = setTimeout(function() { editor._timerUndo = null; }, this.config.undoTimeout); 4172 4174 } 4173 4174 // Insert a space in certain locations, this is just to make editing a little 4175 // easier (to "get out of" tags), it's not essential. 4176 // TODO: Make this work for IE? 4177 // TODO: Perhaps should use a plain space character, I'm not sure. 4178 // OK, I've disabled this temporarily, to be honest, I can't rightly remember what the 4179 // original problem was I was trying to solve with it. I think perhaps that EnterParagraphs 4180 // might solve the problem, whatever the hell it was. I'm going senile, I'm sure. 4181 // @todo : since this part is disabled since a long time, does it still need to be in the source ? 4182 if( 0 && Xinha.is_gecko ) 4183 { 4184 var s = this.getSelection(); 4185 // If the last character in the last text node of the parent tag 4186 // and the parent tag is not a block tag 4187 if ( s && s.isCollapsed && s.anchorNode && 4188 s.anchorNode.parentNode.tagName.toLowerCase() != 'body' && 4189 s.anchorNode.nodeType == 3 && s.anchorOffset == s.anchorNode.length && 4190 !( s.anchorNode.parentNode.nextSibling && s.anchorNode.parentNode.nextSibling.nodeType == 3 ) && 4191 !Xinha.isBlockElement(s.anchorNode.parentNode) ) 4192 { 4193 // Insert hair-width-space after the close tag if there isn't another text node on the other side 4194 // It could also work with zero-width-space (\u200B) but I don't like it so much. 4195 // Perhaps this won't work well in various character sets and we should use plain space (20)? 4196 try 4197 { 4198 s.anchorNode.parentNode.parentNode.insertBefore(this._doc.createTextNode('\t'), s.anchorNode.parentNode.nextSibling); 4199 } 4200 catch(ex) {} // Disregard 4201 } 4202 } 4203 4204 // FIXME: this should be using this.firePluginEvent('onUpdateToolbar') 4205 // but we have to make sure that the plugins using that event return false 4206 // if they should let the event fire on other plugins, currently the below 4207 // code doesn't take the return value into account 4208 4209 // check if any plugins have registered refresh handlers 4210 for ( var indexPlugin in this.plugins ) 4211 { 4212 var plugin = this.plugins[indexPlugin].instance; 4213 if ( plugin && typeof plugin.onUpdateToolbar == "function" ) 4214 { 4215 plugin.onUpdateToolbar(); 4216 } 4217 } 4218 4175 this.firePluginEvent('onUpdateToolbar'); 4176 }; 4177 4178 /** Returns a editor object referenced by the id or name of the textarea or the textarea node itself 4179 * For example to retrieve the HTML of an editor made out of the textarea with the id "myTextArea" you would do<br /> 4180 * <code> 4181 * var editor = Xinha.getEditor("myTextArea"); 4182 * var html = editor.getEditorContent(); 4183 * </code> 4184 * @returns {Xinha|null} 4185 * @param {String|DomNode} ref id or name of the textarea or the textarea node itself 4186 */ 4187 Xinha.getEditor = function(ref) 4188 { 4189 for ( var i = __xinhas.length; i--; ) 4190 { 4191 var editor = __xinhas[i]; 4192 if ( editor && ( editor._textArea.id == ref || editor._textArea.name == ref || editor._textArea == ref ) ) 4193 { 4194 return editor; 4195 } 4196 } 4197 return null; 4198 }; 4199 /** Sometimes one wants to call a plugin method directly, e.g. from outside the editor. 4200 * This function returns the respective editor's instance of a plugin. 4201 * For example you might want to have a button to trigger SaveSubmit's save() method:<br /> 4202 * <code> 4203 * <button type="button" onclick="Xinha.getEditor('myTextArea').getPluginInstance('SaveSubmit').save();return false;">Save</button> 4204 * </code> 4205 * @returns {PluginObject|null} 4206 * @param {String} plugin name of the plugin 4207 */ 4208 Xinha.prototype.getPluginInstance = function (plugin) 4209 { 4210 if (this.plugins[plugin]) 4211 { 4212 return this.plugins[plugin].instance; 4213 } 4214 else return null; 4219 4215 }; 4220 4216 … … 4850 4846 4851 4847 // remove disabling of inline event handle inside Xinha iframe 4852 html = html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=['"])if\(window\. top && window\.top\.Xinha\)\{return false\}/gi,'$1');4848 html = html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=['"])if\(window\.parent && window\.parent\.Xinha\)\{return false\}/gi,'$1'); 4853 4849 4854 4850 // Figure out what our server name is, and how it's referenced … … 4911 4907 4912 4908 // disable inline event handle inside Xinha iframe 4913 html = html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=["'])/gi,'$1if(window. top && window.top.Xinha){return false}');4909 html = html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=["'])/gi,'$1if(window.parent && window.parent.Xinha){return false}'); 4914 4910 4915 4911 html = this.inwardSpecialReplacements(html); … … 5019 5015 if ( typeof this.config.stripSelfNamedAnchors != 'undefined' && this.config.stripSelfNamedAnchors ) 5020 5016 { 5021 var stripRe = new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp( document.location.href.replace(/&/g,'&')) + ')([#?][^\'" ]*)', 'g');5017 var stripRe = new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(unescape(document.location.href.replace(/&/g,'&'))) + ')([#?][^\'" ]*)', 'g'); 5022 5018 html = html.replace(stripRe, '$1$4'); 5023 5019 } … … 5028 5024 if ( typeof this.config.baseHref != 'undefined' && this.config.baseHref !== null ) 5029 5025 { 5030 baseRe = new RegExp( "((href|src|background)=\")(" + Xinha.escapeStringForRegExp(this.config.baseHref ) + ")", 'g' );5026 baseRe = new RegExp( "((href|src|background)=\")(" + Xinha.escapeStringForRegExp(this.config.baseHref.replace(/([^\/]\/)(?=.+\.)[^\/]*$/, "$1")) + ")", 'g' ); 5031 5027 } 5032 5028 else … … 5117 5113 Xinha._object = null; 5118 5114 5115 /** Arrays are identified as "object" in typeof calls. Adding this tag to the Array prototype allows to distinguish between the two 5116 */ 5117 Array.prototype.isArray = true; 5118 /** RegExps are identified as "object" in typeof calls. Adding this tag to the RegExp prototype allows to distinguish between the two 5119 */ 5120 RegExp.prototype.isRegExp = true; 5119 5121 /** function that returns a clone of the given object 5120 5122 * … … 5129 5131 return null; 5130 5132 } 5131 5132 var newObj = {}; 5133 5134 // check for array objects 5135 if ( obj.constructor.toString().match( /\s*function Array\(/ ) ) 5136 { 5137 newObj = obj.constructor(); 5138 } 5139 5140 // check for function objects (as usual, IE is fucked up) 5141 if ( obj.constructor.toString().match( /\s*function Function\(/ ) ) 5133 var newObj = (obj.isArray ) ? [] : {}; 5134 5135 // check for function and RegExp objects (as usual, IE is fucked up) 5136 if ( obj.constructor.toString().match( /\s*function Function\(/ ) || typeof obj == 'function' ) 5142 5137 { 5143 5138 newObj = obj; // just copy reference to it 5139 } 5140 else if ( obj.isRegExp ) 5141 { 5142 newObj = eval( obj.toString() ); //see no way without eval 5144 5143 } 5145 5144 else … … 5339 5338 Xinha._removeEvent(el, evs[i], func); 5340 5339 } 5340 }; 5341 5342 /** Adds a function that is executed in the moment the DOM is ready, but as opposed to window.onload before images etc. have been loaded 5343 * http://dean.edwards.name/weblog/2006/06/again/ 5344 * @public 5345 * @author Dean Edwards/Matthias Miller/ John Resig / Raimund Meyer 5346 * @param {Function} func the function to be executed 5347 * @param {Window} scope the window that is listened to 5348 */ 5349 Xinha.addOnloadHandler = function (func, scope) 5350 { 5351 scope = scope ? scope : window; 5352 5353 var init = function () 5354 { 5355 // quit if this function has already been called 5356 if (arguments.callee.done) return; 5357 // flag this function so we don't do the same thing twice 5358 arguments.callee.done = true; 5359 // kill the timer 5360 if (Xinha.onloadTimer) clearInterval(Xinha.onloadTimer); 5361 5362 func(); 5363 } 5364 if (Xinha.is_ie) 5365 { 5366 scope.document.write("<sc"+"ript id=__ie_onload defer src=javascript:void(0)><\/script>"); 5367 var script = scope.document.getElementById("__ie_onload"); 5368 script.onreadystatechange = function() 5369 { 5370 if (this.readyState == "loaded") // We want this as early as possible, so I changed 'complete' to 'loaded', because otherwise it fired even after window.onload 5371 { 5372 this.parentNode.removeChild(script); 5373 init(); // call the onload handler 5374 } 5375 }; 5376 } 5377 else if (/applewebkit|KHTML/i.test(navigator.userAgent) ) /* Safari/WebKit/KHTML */ 5378 { 5379 Xinha.onloadTimer = scope.setInterval(function() 5380 { 5381 if (/loaded|complete/.test(scope.document.readyState)) 5382 { 5383 init(); // call the onload handler 5384 } 5385 }, 10); 5386 } 5387 else /* for Mozilla/Opera9 */ 5388 { 5389 scope.document.addEventListener("DOMContentLoaded", init, false); 5390 5391 } 5392 Xinha._addEvent(scope, 'load', init); // incase anything went wrong 5341 5393 }; 5342 5394 … … 5759 5811 { 5760 5812 var coreCSS = 5761 "<style id=\"XinhaInternalCSS\" type=\"text/css\">"5813 "<style title=\"XinhaInternalCSS\" type=\"text/css\">" 5762 5814 + ".htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}\n" 5763 5815 + "html, body { border: 0px; } \n" 5764 5816 + "body { background-color: #ffffff; } \n" 5817 + "img, hr { cursor: default } \n" 5765 5818 +"</style>\n"; 5766 5819 … … 5777 5830 return coreCSS; 5778 5831 } 5832 } 5833 /** Allows plugins to add a stylesheet for internal use to the edited document that won't appear in the HTML output 5834 * 5835 * @see Xinha#stripCoreCSS 5836 * @param {String} stylesheet URL of the styleshett to be added 5837 */ 5838 Xinha.prototype.addEditorStylesheet = function (stylesheet) 5839 { 5840 var style = this._doc.createElement("link"); 5841 style.rel = 'stylesheet'; 5842 style.type = 'text/css'; 5843 style.title = 'XinhaInternalCSS'; 5844 style.href = stylesheet; 5845 this._doc.getElementsByTagName("HEAD")[0].appendChild(style); 5779 5846 } 5780 5847 /** Remove internal styles … … 5787 5854 Xinha.stripCoreCSS = function(html) 5788 5855 { 5789 return html.replace(/<style[^>]+ id="XinhaInternalCSS"(.|\n)*?<\/style>/i, '');5856 return html.replace(/<style[^>]+title="XinhaInternalCSS"(.|\n)*?<\/style>/ig, '').replace(/<link[^>]+title="XinhaInternalCSS"(.|\n)*?>/ig, ''); 5790 5857 } 5791 5858 /** Removes one CSS class (that is one of possible more parts … … 6046 6113 // Unless somebody already has, make a little function to debug things 6047 6114 6048 if ( typeof dump == 'undefined' )6049 { 6050 function dump (o)6115 if (typeof dumpValues == 'undefined') 6116 { 6117 function dumpValues(o) 6051 6118 { 6052 6119 var s = ''; 6053 6120 for ( var prop in o ) 6054 6121 { 6122 if (window.console && typeof window.console.log == 'function') 6123 { 6124 if (typeof console.firebug != 'undefined') 6125 console.log(o); 6126 else 6127 console.log(prop + ' = ' + o[prop] + '\n'); 6128 } 6129 else 6055 6130 s += prop + ' = ' + o[prop] + '\n'; 6056 6131 } 6132 if (s) 6133 { 6057 6134 var x = window.open("", "debugger"); 6058 6135 x.document.write('<pre>' + s + '</pre>'); 6059 6136 } 6137 } 6060 6138 } 6061 6139 if ( !Array.prototype.contains ) … … 6422 6500 6423 6501 var editors = {}; 6502 var textarea; 6424 6503 for ( var x = 0; x < editor_names.length; x++ ) 6425 6504 { 6426 if ( typeof editor_names[x] != 'object' ) 6427 { 6428 var textarea = Xinha.getElementById('textarea', editor_names[x] ); 6429 if ( !textarea ) continue; 6505 if ( typeof editor_names[x] == 'string' ) // the regular case, an id of a textarea 6506 { 6507 textarea = Xinha.getElementById('textarea', editor_names[x] ); 6508 if (!textarea) // the id may be specified for a textarea that is maybe on another page; we simply skip it and go on 6509 { 6510 editor_names[x] = null; 6511 continue; 6512 } 6513 } 6514 // make it possible to pass a reference instead of an id, for example from document.getElementsByTagName('textarea') 6515 else if ( typeof editor_names[x] == 'object' && editor_names[x].tagName && editor_names[x].tagName.toLowerCase() == 'textarea' ) 6516 { 6517 textarea = editor_names[x]; 6518 if ( !textarea.id ) // we'd like to have the textarea have an id 6519 { 6520 textarea.id = 'xinha_id_' + x; 6521 } 6430 6522 } 6431 6523 var editor = new Xinha(textarea, Xinha.cloneObject(default_config)); 6432 6524 editor.registerPlugins(plugin_names); 6433 editors[ editor_names[x]] = editor;6525 editors[textarea.id] = editor; 6434 6526 } 6435 6527 return editors; … … 6722 6814 for (var i=0;i<xinha_editors.length;i++) 6723 6815 { 6816 if (!document.getElementById(xinha_editors[i])) continue; 6724 6817 Xinha.loadingMessages.push(Xinha.createLoadingMessage(Xinha.getElementById('textarea', xinha_editors[i]))); 6725 6818 } … … 6738 6831 loading_message.className = "loading"; 6739 6832 6740 loading_message.style.left = Xinha.findPosX(textarea)+ 'px';6833 loading_message.style.left = (Xinha.findPosX(textarea) + textarea.offsetWidth / 2) - 106 + 'px'; 6741 6834 loading_message.style.top = (Xinha.findPosY(textarea) + textarea.offsetHeight / 2) - 50 + 'px'; 6742 loading_message.style.width = textarea.offsetWidth + 'px';6743 6744 6835 // main static message 6745 6836 var loading_main = document.createElement("div"); … … 6751 6842 loading_sub.className = "loading_sub"; 6752 6843 loading_sub.id = "loading_sub_" + textarea.id; 6753 text = text ? text : Xinha._lc(" Constructing object");6844 text = text ? text : Xinha._lc("Loading Core"); 6754 6845 loading_sub.appendChild(document.createTextNode(text)); 6755 6846 loading_message.appendChild(loading_main); … … 6795 6886 for (var i=0;i< xinha_editors.length;i++) 6796 6887 { 6888 if (!document.getElementById(xinha_editors[i])) continue; 6797 6889 var main = document.getElementById("loading_" + document.getElementById(xinha_editors[i]).id); 6798 6890 main.parentNode.removeChild(main); … … 6999 7091 try 7000 7092 { 7001 if (typeof XMLHttpRequest == "function")7093 if (typeof XMLHttpRequest != "undefined" && typeof XMLHttpRequest.constructor == 'function' ) // Safari's XMLHttpRequest is typeof object 7002 7094 { 7003 7095 return new XMLHttpRequest(); -
branches/ray/XinhaLoader.js
r890 r975 1 1 var Xinha = {}; 2 3 _editor_url = _editor_url.replace(/\x2f*$/, '/'); 4 2 5 Xinha.agt = navigator.userAgent.toLowerCase(); 3 6 Xinha.is_ie = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); … … 5 8 Xinha.is_opera = (Xinha.agt.indexOf("opera") != -1); 6 9 Xinha.is_khtml = (Xinha.agt.indexOf("khtml") != -1); 10 Xinha.is_webkit = (Xinha.agt.indexOf("applewebkit") != -1); 7 11 Xinha.is_safari = (Xinha.agt.indexOf("safari") != -1); 8 12 Xinha.opera_version = navigator.appVersion.substring(0, navigator.appVersion.indexOf(" "))*1; … … 13 17 Xinha.isRunLocally = document.URL.toLowerCase().search(/^file:/) != -1; 14 18 Xinha.is_designMode = (typeof document.designMode != 'undefined' && !Xinha.is_ie); // IE has designMode, but we're not using it 15 Xinha.isSupportedBrowser = Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5 ;19 Xinha.isSupportedBrowser = Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5 || Xinha.is_safari; 16 20 17 21 Xinha.loadPlugins = function(plugins, callbackIfNotReady) … … 108 112 for (var i=0;i<xinha_editors.length;i++) 109 113 { 110 Xinha.loadingMessages.push(Xinha.createLoadingMessage(document.getElementById(xinha_editors[i]))); 114 if (!document.getElementById(xinha_editors[i])) 115 { 116 continue; 117 } 118 Xinha.loadingMessages.push(Xinha.createLoadingMessage(document.getElementById(xinha_editors[i]))); 111 119 } 112 120 } … … 170 178 } 171 179 } 180 Xinha.addOnloadHandler = function (func) 181 { 182 // Dean Edwards/Matthias Miller/John Resig 183 // http://dean.edwards.name/weblog/2006/06/again/ 184 185 var init = function () 186 { 187 // quit if this function has already been called 188 if (arguments.callee.done) return; 189 // flag this function so we don't do the same thing twice 190 arguments.callee.done = true; 191 // kill the timer 192 if (Xinha.onloadTimer) clearInterval(Xinha.onloadTimer); 193 194 func.call(); 195 } 196 if (Xinha.is_ie) 197 { 198 document.write("<sc"+"ript id=__ie_onload defer src=javascript:void(0)><\/script>"); 199 var script = document.getElementById("__ie_onload"); 200 script.onreadystatechange = function() 201 { 202 if (this.readyState == "loaded") 203 { 204 init(); // call the onload handler 205 } 206 }; 207 } 208 else if (/WebKit/i.test(navigator.userAgent)) 209 { 210 Xinha.onloadTimer = setInterval(function() 211 { 212 if (/loaded|complete/.test(document.readyState)) 213 { 214 init(); // call the onload handler 215 } 216 }, 10); 217 } 218 else /* for Mozilla/Opera9 */ 219 { 220 document.addEventListener("DOMContentLoaded", init, false); 221 } 222 } -
branches/ray/contrib/compress.php
r911 r975 1 1 <? 2 2 die("Run this script to batch-compress the current Xinha snapshot. To run the script, open the file and uncomment the die() command"); 3 3 $repository_url = 'http://svn.xinha.webfactional.com/trunk'; 4 $version =''; 5 $date = date('r'); 4 6 error_reporting(E_ALL); 5 7 ini_set('show_errors',1); 6 8 7 9 $return = array(); 8 function scan($dir, $durl = '',$min_size=" 3000")10 function scan($dir, $durl = '',$min_size="0") 9 11 { 10 12 static $seen = array(); … … 48 50 scan("../"); 49 51 $cwd = getcwd(); 52 53 $root_dir = realpath($cwd.'/..'); 54 50 55 print "Processing ".count($return)." files<br />"; 51 56 52 $prefix = "/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */"; 57 $prefix = "/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */"; 58 if ($version) $prefix .= "\n/* This file is part of version $version released $date */"; 59 53 60 $core_prefix = ' 54 61 /*-------------------------------------------------------------------------- … … 58 65 -- BSD license) please read license.txt in this package for details. 59 66 -- 60 -- Copyright (c) 2005-200 7Xinha Developer Team and contributors67 -- Copyright (c) 2005-2008 Xinha Developer Team and contributors 61 68 -- 62 69 -- Xinha was originally based on work by Mihai Bazon which is: … … 71 78 print "Processed $file<br />"; 72 79 flush(); 80 $file_url = $repository_url.str_replace($root_dir,'',$file); 81 73 82 copy($file,$file."_uncompr.js"); 74 75 exec("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $prefix.$core_prefix : $prefix)."\" > $file && java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js >> $file 2>&1"); 83 84 $file_prefix = $prefix."\n/* The URL of the most recent version of this file is $file_url */"; 85 86 exec("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $file_prefix.$core_prefix : $file_prefix)."\" > $file && java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js >> $file 2>&1"); 76 87 if (preg_match('/js: ".*?", line \d+:/',file_get_contents($file))) 77 88 { … … 83 94 unlink($file."_uncompr.js"); 84 95 } 96 85 97 } 86 98 print "Operation complete." -
branches/ray/contrib/php-xinha.php
r761 r975 24 24 */ 25 25 26 function xinha_pass_to_php_backend($Data, $KeyLocation = 'Xinha:BackendKey' )26 function xinha_pass_to_php_backend($Data, $KeyLocation = 'Xinha:BackendKey', $ReturnPHP = FALSE) 27 27 { 28 28 … … 58 58 $backend_data[session_name()] = session_id(); 59 59 60 echo 'backend_data = ' . xinha_to_js($backend_data) . "; \n"; 61 60 if($ReturnPHP) 61 { 62 return array('backend_data' => $backend_data); 63 } 64 else 65 { 66 echo 'backend_data = ' . xinha_to_js($backend_data) . "; \n"; 67 } 62 68 } 63 69 -
branches/ray/examples/Newbie.html
r892 r975 11 11 _editor_skin = "silva"; // If you want use skin, add the name here 12 12 </script> 13 <script type="text/javascript" src="../Xinha Core.js"></script>13 <script type="text/javascript" src="../XinhaLoader.js"></script> 14 14 <script type="text/javascript" src="XinhaConfig.js"></script> 15 15 </head> … … 18 18 <form action=""> 19 19 <div> 20 <textarea id="myTextArea" name="myTextArea" rows=" 10" cols="50" style="width: 100%"></textarea>20 <textarea id="myTextArea" name="myTextArea" rows="25" cols="50" style="width: 100%"></textarea> 21 21 </div> 22 22 </form> -
branches/ray/examples/XinhaConfig.js
r892 r975 16 16 * current page will just be skipped. 17 17 ************************************************************************/ 18 18 19 19 xinha_editors = xinha_editors ? xinha_editors : 20 20 [ … … 38 38 [ 39 39 'CharacterMap', 40 'ContextMenu', 41 'ListType', 40 'SmartReplace', 42 41 'Stylist', 43 42 'Linker', … … 64 63 65 64 xinha_config = xinha_config ? xinha_config() : new Xinha.Config(); 66 67 65 68 66 // To adjust the styling inside the editor, we can load an external stylesheet like this … … 109 107 } 110 108 111 Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load 112 // and does not interfere with window.onload properties set by other scripts 109 Xinha.addOnloadHandler(xinha_init); // this executes the xinha_init function on page load 110 // and does not interfere with window.onload properties set by other scripts 111 -
branches/ray/examples/simple_example.html
r761 r975 5 5 <title>Simple example of Xinha</title> 6 6 <script type="text/javascript"> 7 /************************************************************************8 * Please refer to http://xinha.python-hosting.com/wiki/NewbieGuide9 ************************************************************************10 * You must set _editor_url to the URL (including trailing slash) where11 * where xinha is installed, it's highly recommended to use an absolute URL12 * eg: _editor_url = "/path/to/xinha/";13 * You may try a relative URL if you wish]14 * eg: _editor_url = "../";15 * in this example we do a little regular expression to find the absolute path.16 ************************************************************************/17 7 var _editor_url = document.location.href.replace(/examples\/simple_example\.html.*/, '') 18 // And the language we need to use in the editor. 8 19 9 var _editor_lang = "en"; 20 10 </script> … … 22 12 <script type="text/javascript" src="../XinhaCore.js"></script> 23 13 <script type="text/javascript"> 24 /************************************************************************ 25 * Plugins you will be using in the editors on this page. 26 * List all the plugins you will need, even if not all the editors will 27 * use all the plugins. 28 ************************************************************************ 29 * Please refer to http://xinha.python-hosting.com/wiki/Plugins for the 30 * list of availables plugins 31 ************************************************************************/ 14 32 15 var xinha_plugins = 33 16 [ 34 'CharacterMap', 35 'ContextMenu', 36 'FullScreen', 37 'ListType', 38 'SpellChecker', 39 'Stylist', 40 'SuperClean', 41 'TableOperations' 17 'Linker' 42 18 ]; 43 /************************************************************************44 * Names of the textareas you will be turning into editors45 ************************************************************************/46 19 var xinha_editors = 47 20 [ … … 49 22 'anotherOne' 50 23 ]; 51 /************************************************************************ 52 * Initialisation function 53 ************************************************************************/ 24 54 25 function xinha_init() 55 26 { 56 // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)57 27 if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; 58 /************************************************************************* 59 * We create a default configuration to be used by all the editors. 60 * If you wish to configure some of the editors differently this will be 61 * done later after editors are initiated. 62 ************************************************************************ 63 * Please refer to http://xinha.python-hosting.com/wiki/Documentation/Customise 64 * for the configuration parameters 65 ************************************************************************/ 28 66 29 var xinha_config = new Xinha.Config(); 67 /************************************************************************ 68 * We first create editors for the textareas. 69 * You can do this in two ways, either 70 * 71 * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); 72 * 73 * if you want all the editor objects to use the same set of plugins, OR; 74 * 75 * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); 76 * xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']); 77 * xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']); 78 * 79 * if you want to use a different set of plugins for one or more of the 80 * editors. 81 ************************************************************************/ 30 82 31 xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); 83 /************************************************************************ 84 * If you want to change the configuration variables of any of the 85 * editors, this is the place to do that, for example you might want to 86 * change the width and height of one of the editors, like this... 87 ************************************************************************/ 88 xinha_editors.myTextArea.config.width = '640px'; 89 xinha_editors.myTextArea.config.height = '480px'; 90 /************************************************************************ 91 * Or remove the statusbar on the other one, like this... 92 * For every possible configuration, please refer to 93 * http://xinha.python-hosting.com/wiki/Documentation/ConfigVariablesList 94 ************************************************************************/ 95 xinha_editors.anotherOne.config.statusBar = false; 96 /************************************************************************ 97 * Finally we "start" the editors, this turns the textareas into 98 * Xinha editors. 99 ************************************************************************/ 32 100 33 Xinha.startEditors(xinha_editors); 101 34 } 102 window.onload = xinha_init;35 Xinha.addOnloadHandler(xinha_init); 103 36 </script> 104 <link type="text/css" rel="stylesheet" title="blue-look" href="../skins/blue-look/skin.css"> 105 <link type="text/css" rel="alternate stylesheet" title="green-look" href="../skins/green-look/skin.css"> 106 <link type="text/css" rel="alternate stylesheet" title="xp-blue" href="../skins/xp-blue/skin.css"> 107 <link type="text/css" rel="alternate stylesheet" title="xp-green" href="../skins/xp-green/skin.css"> 108 <link type="text/css" rel="alternate stylesheet" title="inditreuse" href="../skins/inditreuse/skin.css"> 109 <link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="../skins/blue-metallic/skin.css"> 37 110 38 </head> 111 39 112 40 <body> 113 41 114 <form onsubmit="alert(this.myTextArea.value); alert(this.anotherOne.value);return false;">115 <textarea id="myTextArea" name="myTextArea" rows=" 10" cols="80" style="width:100%">42 <form onsubmit="alert(this.myTextArea.value); return false;"> 43 <textarea id="myTextArea" name="myTextArea" rows="25" cols="80"> 116 44 <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 117 45 Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis … … 122 50 Curabitur pharetra bibendum lectus.</p> 123 51 </textarea> 124 <textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%">125 <ul>126 <li> Phasellus et massa sed diam viverra semper. </li>127 <li> Mauris tincidunt felis in odio. </li>128 <li> Nulla placerat nunc ut pede. </li>129 <li> Vivamus ultrices mi sit amet urna. </li>130 <li> Quisque sed augue quis nunc laoreet volutpat.</li>131 <li> Nunc sit amet metus in tortor semper mattis. </li>132 </ul>133 </textarea>134 <input type="submit">135 </form>136 52 137 53 </body> -
branches/ray/examples/testbed.html
r911 r975 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE html 3 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> … … 30 32 // in this example we do a little regular expression to find the absolute path. 31 33 _editor_url = document.location.href.replace(/examples\/.*/, '') 32 _editor_lang = " de"; // And the language we need to use in the editor.34 _editor_lang = "en"; // And the language we need to use in the editor. 33 35 </script> 34 36 35 37 <!-- Load up the actual editor core --> 36 <script type="text/javascript" src="../Xinha Loader.js"></script>38 <script type="text/javascript" src="../XinhaCore.js"></script> 37 39 38 40 <script type="text/javascript"> … … 46 48 { 47 49 /** STEP 1 *************************************************************** 48 * First, specify the textareas that shall be turned into Xinhas. 49 * For each one add the respective id to the xinha_editors array. 50 * First, what are the plugins you will be using in the editors on this 51 * page. List all the plugins you will need, even if not all the editors 52 * will use all the plugins. 50 53 ************************************************************************/ 51 54 52 xinha_ editors = xinha_editors ? xinha_editors :55 xinha_plugins = xinha_plugins ? xinha_plugins : 53 56 [ 54 ' myTextArea'57 'CharacterMap', 'SpellChecker', 'Linker', 'SmartReplace' 55 58 ]; 59 // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) 60 if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; 56 61 57 62 /** STEP 2 *************************************************************** 58 * Now, what are the plugins you will be using in the editors on this 59 * page. List all the plugins you will need, even if not all the editors 60 * will use all the plugins. 63 * Now, what are the names of the textareas you will be turning into 64 * editors? 61 65 ************************************************************************/ 62 xinha_plugins = xinha_plugins ? xinha_plugins : 66 67 xinha_editors = xinha_editors ? xinha_editors : 63 68 [ 64 'CharacterMap', 65 'Linker', 66 'Stylist', 67 'SmartReplace', 68 'InsertSnippet' 69 'myTextArea' 69 70 ]; 70 // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)71 if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;72 71 73 72 /** STEP 3 *************************************************************** … … 85 84 86 85 xinha_config = xinha_config ? xinha_config : new Xinha.Config(); 87 88 xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 89 90 //xinha_config.CharacterMap.mode = 'panel'; 91 //xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 92 86 xinha_config.fullPage = true; 87 xinha_config.CharacterMap.mode = 'panel'; 93 88 /* 94 89 // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL … … 113 108 * 114 109 * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); 115 * xinha_editors['myTextArea'].registerPlugins(['Stylist' ,'FullScreen']);110 * xinha_editors['myTextArea'].registerPlugins(['Stylist']); 116 111 * xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']); 117 112 * … … 143 138 144 139 window.onload = xinha_init; 145 // window.onunload = Xinha.collectGarbageForIE;146 140 </script> 147 141 </head> … … 149 143 <body> 150 144 151 <form action="" id="editors_here" onsubmit="alert(this.myTextArea.value);"> 152 <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 153 <textarea id="myTextArea" name="myTextArea" style="width:100%;height:300px;"> 154 <table cellspacing="1" cellpadding="1" border="1" style="width: 100%;"><tbody><tr><td style="width: 25%;"> </td><td style="width: 25%;"> </td><td style="width: 25%;"> </td><td style="width: 25%;"> </td></tr><tr><td style="width: 25%;"> </td><td style="width: 25%;"> </td><td style="width: 25%;"> </td><td style="width: 25%;"> </td></tr></tbody></table><br /></textarea> 145 <form action="javascript:void(0);" id="editors_here" onsubmit="alert(this.myTextArea.value);"> 146 <div> 147 <textarea id="myTextArea" name="myTextArea" style="width:100%;height:320px;"> 148 <html> 149 <head> 150 <title>Hello</title> 151 <style type="text/css"> 152 li { color:red; } 153 </style> 154 </head> 155 <body><span style="color:purple"> 156 <img src="../images/xinha_logo.gif" usemap="#m1"> 157 <map name="m1"> 158 <area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"> 159 </map> 155 160 156 <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 161 <p> 162 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 163 Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis 164 velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique 165 ante elementum turpis. <span style="color:green">Aliquam </span> nisl. Nulla posuere neque non 166 tellus. Morbi vel nibh. <font face="Arial"><font color="#009933">Cum sociis natoque</font></font> penatibus et magnis dis 167 parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. 168 Curabitur pharetra bibendum lectus. 169 </p> 170 171 <ul> 172 <li style="color:green"> Phasellus et massa sed diam viverra semper. </li> 173 <li> Mauris tincidunt felis in odio. </li> 174 <li> Nulla placerat nunc ut pede. </li> 175 <li> Vivamus ultrices mi sit amet urna. </li> 176 <li> Quisque sed augue quis nunc laoreet volutpat.</li> 177 <li> Nunc sit amet metus in tortor semper mattis. </li> 178 </ul> 179 </span></body> 180 </html> 181 </textarea> 182 183 <input type="submit" /> <input type="reset" /> 184 </div> 157 185 </form> 158 <script language="javascript">186 <script type="text/javascript"> 159 187 document.write(document.compatMode); 160 188 </script> 189 <div> 161 190 <a href="#" onclick="xinha_editors.myTextArea.hidePanels();">Hide</a> 162 191 <a href="#" onclick="xinha_editors.myTextArea.showPanels();">Show</a> 192 </div> 193 163 194 </body> 164 195 </html> -
branches/ray/lang/es.js
r60 r975 1 1 // I18N constants 2 3 // LANG: "es", ENCODING: UTF-8 4 2 // LANG: "de", ENCODING: UTF-8 5 3 { 6 4 "Bold": "Negrita", … … 8 6 "Underline": "Subrayado", 9 7 "Strikethrough": "Tachado", 10 "Subscript": "Sub ?ndice",11 "Superscript": "Super ?ndice",12 "Justify Left": "Alinear a la Izquierda",13 "Justify Center": " Centrar",14 "Justify Right": "Alinear a la Derecha",8 "Subscript": "SubÃndice", 9 "Superscript": "SuperÃndice", 10 "Justify Left": "Alinear a la izquierda", 11 "Justify Center": "Alinear al centro", 12 "Justify Right": "Alinear a la derecha", 15 13 "Justify Full": "Justificar", 16 "Ordered List": "Lista Ordenada",17 "Bulleted List": "Lista No Ordenada",18 "Decrease Indent": " Aumentar Sangr?a",19 "Increase Indent": " Disminuir Sangr?a",20 "Font Color": "Color de l Texto",21 "Background Color": "Color de l Fondo",22 "Horizontal Rule": " L?nea Horizontal",23 "Insert Web Link": "Insertar Enlace",24 "Insert/Modify Image": "Insertar Imagen",25 "Insert Table": "Insertar Tabla",26 "Toggle HTML Source": "Ver Documento enHTML",27 "Enlarge Editor": " Ampliar Editor",28 "About this editor": " Acerca delEditor",14 "Ordered List": "Lista numerada", 15 "Bulleted List": "Lista no numerada", 16 "Decrease Indent": "Reducir sangrÃa", 17 "Increase Indent": "Aumentar sangrÃa", 18 "Font Color": "Color de la fuente", 19 "Background Color": "Color de fondo", 20 "Horizontal Rule": "Regla horizontal", 21 "Insert Web Link": "Insertar enlace web", 22 "Insert/Modify Image": "Insertar/modificar imagen", 23 "Insert Table": "Insertar una tabla", 24 "Toggle HTML Source": "Ver HTML", 25 "Enlarge Editor": "Editor a pantalla completa", 26 "About this editor": "Sobre este Editor", 29 27 "Help using editor": "Ayuda", 30 "Current style": "Estilo Actual",28 "Current style": "Estilo actual", 31 29 "Undoes your last action": "Deshacer", 32 30 "Redoes your last action": "Rehacer", 33 "Cut selection": "Cortar selecci?n",34 "Copy selection": "Copiar selecci?n",31 "Cut selection": "Cortar", 32 "Copy selection": "Copiar", 35 33 "Paste from clipboard": "Pegar desde el portapapeles", 34 "Direction left to right": "Dirección de izquierda a derecha", 35 "Direction right to left": "Dirección de derecha a izquierda", 36 "Remove formatting": "Borrar formato", 37 "Select all": "Seleccionar todo", 38 "Print document": "Imprimir documento", 39 "Clear MSOffice tags": "Borrar etiquetas de MSOffice", 40 "Clear Inline Font Specifications": "Borrar las etiquetas de fuente", 41 "Would you like to clear font typefaces?": "¿Desea eliminar las definiciaones de tipo de fuente?", 42 "Would you like to clear font sizes?": "¿Desea eliminar las definiciones de tamaño de fuente?", 43 "Would you like to clear font colours?": "¿Desea eliminar las definiciones de color de fuente?", 44 "Split Block": "Dividir el bloque", 45 "Toggle Borders": "Añadir/Quitar bordes", 46 "Save as": "Guardar como", 47 "Insert/Overwrite": "Insertar/Sobreescribir", 48 "— format —": "— formato —", 49 "— font —": "— fuente —", 50 "— size —": "— tamaño —", 51 "Heading 1": "Cabecera 1", 52 "Heading 2": "Cabecera 2", 53 "Heading 3": "Cabecera 3", 54 "Heading 4": "Cabecera 4", 55 "Heading 5": "Cabecera 5", 56 "Heading 6": "Cabecera 6", 57 "Normal": "Normal", 58 "Address": "Dirección", 59 "Formatted": "Formateado", 60 61 //dialogs 36 62 "OK": "Aceptar", 37 63 "Cancel": "Cancelar", 38 64 "Path": "Ruta", 39 "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG" 65 "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Se encuentra en MODO TEXTO. Use el botón [<>] para cambiar de nuevo al modo WYSIWYG", 66 "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "El botón de pegar no funciona en los navegadores de Mozilla por motivos de seguridad. Presione CTRL-V en su teclado para pegarlo directamente", 67 68 "You need to select some text before create a link": "Necesita seleccionar algún texto antes de crear un link", 69 "Your Document is not well formed. Check JavaScript console for details.": "Su documento no está bien formado. Compruebe la consola de JavaScript para obtener más detalles", 70 71 "Alignment:": "Alineación:", 72 "Not set": "No definido", 73 "Left": "Izquierda", 74 "Right": "Derecha", 75 "Texttop": "Texto Superior", 76 "Absmiddle": "Medio Absoluto", 77 "Baseline": "LÃnea base", 78 "Absbottom": "Inferior absoluto", 79 "Bottom": "Inferior", 80 "Middle": "Medio", 81 "Top": "Superior", 82 83 "Layout": "Distribución", 84 "Spacing": "Espaciado", 85 "Horizontal:": "horizontal:", 86 "Horizontal padding": "Relleno horizontal", 87 "Vertical:": "Vertical:", 88 "Vertical padding": "Relleno Vertical", 89 "Border thickness:": "Tamaño del borde:", 90 "Leave empty for no border": "VacÃo si no desea ningún borde", 91 92 //Insert Link 93 "Insert/Modify Link": "Insertar/Modificar un enlace", 94 "None (use implicit)": "VacÃo ( usar implÃcito )", 95 "New window (_blank)": "Nueva ventana (_blank)", 96 "Same frame (_self)": "Mismo marco (_self)", 97 "Top frame (_top)": "Marco superior (_top)", 98 "Other": "Otro", 99 "Target:": "Destino:", 100 "Title (tooltip):": "TÃtulo (Tooltip):", 101 "URL:": "URL:", 102 "You must enter the URL where this link points to": "Debe introducir la URL a donde apunta este enlace", 103 104 // Insert Table 105 "Insert Table": "Añadir una tabla", 106 "Rows:": "Filas:", 107 "Number of rows": "Número de filas", 108 "Cols:": "Columnas:", 109 "Number of columns": "Número de columnas", 110 "Width:": "Ancho:", 111 "Width of the table": "Ancho de la tabla", 112 "Percent": "Porcentaje", 113 "Pixels": "Pixels", 114 "Em": "Em", 115 "Width unit": "Unidad de anchura", 116 "Fixed width columns": "Columnas de ancho fijo", 117 "Positioning of this table": "Posición de esta tabla", 118 "Cell spacing:": "Espaciado entre celdas:", 119 "Space between adjacent cells": "Espaciado entre celdas adyacentes", 120 "Cell padding:": "Relleno de celdas:", 121 "Space between content and border in cell": "Escapcio entre el contenido y el borde de la celda", 122 "You must enter a number of rows": "Debe introducir un número de filas", 123 "You must enter a number of columns": "Debe introducir un número de columnas", 124 125 // Insert Image 126 "Insert Image": "Insertar una imagen", 127 "Image URL:": "Imagen URL:", 128 "Enter the image URL here": "", 129 "Preview": "Previsualizar", 130 "Preview the image in a new window": "Previsualizar en una nueva ventana", 131 "Alternate text:": "Texto alternativo:", 132 "For browsers that don't support images": "Para navegadores que no soportan imágenes", 133 "Positioning of this image": "Posición de la imagen", 134 "Image Preview:": "Previsualización de la imagen:", 135 "You must enter the URL": "Debe introducir la URL", 136 137 // Editor Help 138 "Keyboard shortcuts": "Atajos de teclado", 139 "The editor provides the following key combinations:": "El editor proporciona las siguientes combinaciones:", 140 "new paragraph": "Nuevo parrafo", 141 "insert linebreak": "Insertar salto de lÃnea", 142 "Set format to paragraph": "EStablecer el formato a parrafo", 143 "Clean content pasted from Word": "Limpiar el contenido pegado desde Word", 144 "Headings": "Cabeceras", 145 "Close": "Cerrar", 146 147 // Loading messages 148 "Loading in progress. Please wait!": "Carga en proceso. Por favor espere.", 149 "Loading plugin $plugin" : "Cargando el plugin $plugin", 150 "Register plugin $plugin" : "Registro de plugin $plugin", 151 "Constructing object": "Construyendo objeto", 152 "Generate Xinha framework": "Generar Xinha framework", 153 "Init editor size":"Iniciar el tamaño del editor", 154 "Create Toolbar": "Crear barra de herramientas", 155 "Create Statusbar" : "Crear barra de estado", 156 "Register right panel" : "Registrar panel derecho", 157 "Register left panel" : "Registrar panel izquierdo", 158 "Register bottom panel" : "Registar panel inferior", 159 "Register top panel" : "Registar panel superior", 160 "Finishing" : "Finalizando", 161 162 // ColorPicker 163 "Click a color..." : "Seleccione un color...", 164 "Sample" : "Muestra", 165 "Web Safe: " : "Color web: ", 166 "Color: " : "Color: " 40 167 } -
branches/ray/lang/fa.js
r761 r975 1 // I18N constants1 // I18N constants 2 2 // LANG: "fa", ENCODING: UTF-8 3 3 { 4 "Bold": "ضخÛÙ 5 ", 6 "Italic": "Ù 7 ÙØ±Øš", 8 "Underline": "Ø²ÛØ± خط", 9 "Strikethrough": "ر٠خط", 10 "Subscript": "Ø²ÛØ±ÙÙØ¯", 11 "Superscript": "ØšØ§ÙØ§ÙÙØ¯", 12 "Justify Left": "تراز از ÚÙŸ", 13 "Justify Center": "تراز در ÙØ³Ø·", 14 "Justify Right": "تراز در راست", 15 "Justify Full": "تراز از ÚÙŸ ٠راست", 16 "Ordered List": "ÙÙØ±Ø³Øª Ù 17 رتؚ", 18 "Bulleted List": "ÙÙØ±Ø³Øª Ú¯ÙÙÙ٠اÛ", 19 "Decrease Indent": "Ú©Ø§ÙØŽ Ø³Ø± خط", 20 "Increase Indent": "Ø§ÙØ²Ø§ÛØŽ سر خط", 21 "Font Color": "رÙÚ¯ ÙÙÙ 22 ", 23 "Background Color": "رÙÚ¯ ٟس ز٠24 ÛÙÙ", 25 "Horizontal Rule": "خط اÙÙÛ", 26 "Insert Web Link": "Ø§ÙØ²Ùد٠ÙÛÙÚ© ÙØš", 27 "Insert/Modify Image": "Ø§ÙØ²ÙØ¯Ù ÛØ§ ÙÛØ±Ø§ÛØŽ تصÙÛØ±", 28 "Insert Table": "Ø§ÙØ²Ùد٠جدÙÙ", 29 "Toggle HTML Source": "Ù 30 ØŽØ§ÙØ¯Ù ÛØ§ عد٠31 Ù 32 ØŽØ§ÙØ¯Ù Ù 33 ت٠در ÙØ§ÙØš HTML", 34 "Enlarge Editor": "ؚزرگ کرد٠ÙÛØ±Ø§ÛØŽ گر", 35 "About this editor": "درؚار٠اÛÙ ÙÛØ±Ø§ÛØŽ گر", 36 "Help using editor": "راÙÙÙ 37 Ø§Û Ø§Ø³ØªÙØ§Ø¯Ù ÙÛØ±Ø§ÛØŽ گر", 38 "Current style": "ØŽÛÙÙ Ú©ÙÙÙÛ", 39 "Undoes your last action": "ØšØ±Ú¯Ø±Ø¯Ø§ÙØ¯Ù آخرÛ٠ع٠40 Ù", 41 "Redoes your last action": "Ø§ÙØ¬Ø§Ù 42 Ù 43 جدد آخرÛ٠ع٠44 Ù", 45 "Cut selection": "ØšØ±ÛØ¯Ù Ø§ÙØªØ®Ø§Øš ؎دÙ", 46 "Copy selection": "Ú©ÙŸÛ Ø§ÙØªØ®Ø§Øš ؎دÙ", 47 "Paste from clipboard": "ÚØ³ØšØ§Ùد٠از تخت٠کار", 48 "Direction left to right": "Ø¬ÙØª از ÚÙŸ ؚ٠راست", 49 "Direction right to left": "Ø¬ÙØª از راست ØšÙ ÚÙŸ", 50 "Remove formatting": "ØØ°Ù ÙØ±Ù 51 ت ØšÙØ¯Û", 52 "Select all": "Ø§ÙØªØ®Ø§Øš ÙÙ 53 Ù", 54 "Print document": "ÚØ§ÙŸ Ø³ÙØ¯", 55 "Clear MSOffice tags": "ٟاک کرد٠٠56 ت٠از ØšØ±ÚØ³Øš ÙØ§Û MSOffice", 57 "Clear Inline Font Specifications": "ٟاک کرد٠٠58 ت٠از Ù 59 ؎خصات ÙÙÙØª", 60 "Would you like to clear font typefaces?": "Ø¢ÛØ§ ت٠61 اÛÙ Ø¯Ø§Ø±ÛØ¯ ØžØ§ÙØ± ÙÙÙ 62 را ٟاک Ú©ÙÛØ¯Ø", 63 "Would you like to clear font sizes?": "Ø¢ÛØ§ ت٠64 اÛÙ Ø¯Ø§Ø±ÛØ¯ Ø§ÙØ¯Ø§Ø²Ù ÙÙÙ 65 را ٟاک Ú©ÙÛØ¯", 66 "Would you like to clear font colours?": "Ø¢ÛØ§ ت٠67 اÛÙ Ø¯Ø§Ø±ÛØ¯ رÙÚ¯ ÙÙÙ 68 را ٟاک Ú©ÙÛØ¯Ø", 69 "Split Block": "ØšÙØ§Ú© جداسازÛ", 70 "Toggle Borders": "ÙØ¹Ø§Ù/ØºÛØ± ÙØ¹Ø§Ù Ú©Ø±Ø¯Ù ÙØšÙ ÙØ§", 71 "Save as": "Ø°Ø®ÛØ±Ù Ù 72 اÙÙØ¯...", 73 "Insert/Overwrite": "Ø§ÙØ²ÙدÙ/جاÙÙÛØ³Û", 74 "— format —": "— ÙØ§ÙØš —", 75 "Heading 1": "ØªÛØªØ± 1", 76 "Heading 2": "ØªÛØªØ± 2", 77 "Heading 3": "ØªÛØªØ± 3", 78 "Heading 4": "ØªÛØªØ± 4", 79 "Heading 5": "ØªÛØªØ± 5", 80 "Heading 6": "ØªÛØªØ± 6", 81 "Normal": "Ù 82 ع٠83 ÙÙÛ", 84 "Address": "آدرس", 85 "Formatted": "ÙØ§ÙØš ØšÙØ¯Û ؎دÙ", 4 "Bold": "ضخیم", 5 "Italic": "مورب", 6 "Underline": "زیر خط", 7 "Strikethrough": "رو خط", 8 "Subscript": "زیروند", 9 "Superscript": "بالاوند", 10 "Justify Left": "تراز از چپ", 11 "Justify Center": "تراز در وسط", 12 "Justify Right": "تراز در راست", 13 "Justify Full": "تراز از چپ و راست", 14 "Ordered List": "فهرست مرتب", 15 "Bulleted List": "فهرست گلوله ای", 16 "Decrease Indent": "کاهش سر خط", 17 "Increase Indent": "افزایش سر خط", 18 "Font Color": "رنگ فلم", 19 "Background Color": "رنگ پس زمینه", 20 "Horizontal Rule": "خط افقی", 21 "Insert Web Link": "افزودن لینک وب", 22 "Insert/Modify Image": "افزودن یا ویرایش تصویر", 23 "Insert Table": "افزودن جدول", 24 "Toggle HTML Source": "مشاهده یا عدم مشاهده متن در قالب HTML", 25 "Enlarge Editor": "بزرگ کردن ویرایش گر", 26 "About this editor": "درباره این ویرایش گر", 27 "Help using editor": "راهنمای استفاده ویرایش گر", 28 "Current style": "شیوه کنونی", 29 "Undoes your last action": "برگرداندن آخرین عمل", 30 "Redoes your last action": "انجام مجدد آخرین عمل", 31 "Cut selection": "بریدن انتخاب شده", 32 "Copy selection": "کپی انتخاب شده", 33 "Paste from clipboard": "چسباندن از تخته کار", 34 "Direction left to right": "جهت از چپ به راست", 35 "Direction right to left": "جهت از راست به چپ", 36 "Remove formatting": "حذف فرمت بندی", 37 "Select all": "انتخاب همه", 38 "Print document": "چاپ سند", 39 "Clear MSOffice tags": "پاک کردن متن از برچسب های MSOffice", 40 "Clear Inline Font Specifications": "پاک کردن متن از مشخصات فونت", 41 "Would you like to clear font typefaces?": "آیا تمایل دارید ظاهر فلم را پاک کنید؟", 42 "Would you like to clear font sizes?": "آیا تمایل دارید اندازه قلم را پاک کنید", 43 "Would you like to clear font colours?": "آیا تمایل دارید رنگ قلم را پاک کنید؟", 44 "Split Block": "بلاک جداسازی", 45 "Toggle Borders": "فعال/غیر فعال کردن لبه ها", 46 "Save as": "ذخیره مانند...", 47 "Insert/Overwrite": "افزودن/جانویسی", 48 "— format —": "— قالب —", 49 "Heading 1": "تیتر 1", 50 "Heading 2": "تیتر 2", 51 "Heading 3": "تیتر 3", 52 "Heading 4": "تیتر 4", 53 "Heading 5": "تیتر 5", 54 "Heading 6": "تیتر 6", 55 "Normal": "معمولی", 56 "Address": "آدرس", 57 "Formatted": "قالب بندی شده", 86 58 87 59 //dialogs 88 "OK": "ØšÙÙ", 89 "Cancel": "Ø§ÙØµØ±Ø§Ù", 90 "Path": "Ù 91 Ø³ÛØ±", 92 "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "در Ù 93 د Ù 94 تÙÛ ÙØ³ØªÛد. از دک٠95 Ù [<>] Ø§Ø³ØªÙØ§Ø¯Ù ÙÙ 96 اÛÛØ¯ تا ØšÙ Ù 97 د WYSIWYG ØšØ±Ú¯Ø±Ø¯ÛØ¯.", 98 "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "دک٠99 Ù ÚØ³ØšØ§Ùد٠در Ù 100 Ø±ÙØ±Ú¯Ø±ÙØ§Û Ø³Ø±Û Mozilla کار ÙÙ 101 Û Ú©ÙØ¯ (ØšÙ Ø¯ÙØ§ÛÙ ÙÙÛ Ø§Ù 102 ÙÛØªÛ).ØšØ±Ø§Û ÚØ³ØšØ§Ùد٠٠103 ستÙÛÙ 104 Ø Ø¯Ú©Ù 105 Ù CTRL-V را در ØµÙØÙ Ú©ÙÛØ¯ ؚزÙÛØ¯.", 106 "Your Document is not well formed. Check JavaScript console for details.": "Ø³ÙØ¯ ØŽÙ 107 ا ØšØ¯Ø±Ø³ØªÛ ÙØ§ÙØš ØšÙØ¯Û ÙØŽØ¯Ù است. ØšØ±Ø§Û Ø§Ø·ÙØ§Ø¹Ø§Øª ØšÛØŽØªØ± ÙŸØ§ÛØ§ÙÙ ÙÙ 108 Ø§ÛØŽ Ø¬Ø§ÙØ§Ø§Ø³Ú©Ø±Ûٟت را ØšØ±Ø±Ø³Û Ú©ÙÛØ¯.", 60 "OK": "بله", 61 "Cancel": "انصراف", 62 "Path": "مسیر", 63 "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "در مد متنی هستید. از دکمه [<>] استفاده نمایید تا به مد WYSIWYG برگردید.", 64 "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "دکمه چسباندن در مرورگرهای سری Mozilla کار نمی کند (به دلایل فنی امنیتی).برای چسباندن مستقیم ، دکمه CTRL-V را در صفحه کلید بزنید.", 65 "Your Document is not well formed. Check JavaScript console for details.": "سند شما بدرستی قالب بندی نشده است. برای اطلاعات بیشتر پایانه نمایش جاوااسکریپت را بررسی کنید.", 109 66 110 "Alignment:": "تراز ØšÙØ¯Û", 111 "Not set": "ØªÙØžÛÙ 112 ÙØŽØ¯Ù", 113 "Left": "ÚÙŸ", 114 "Right": "راست", 115 "Texttop": "ØšØ§ÙØ§Û Ù 116 تÙ", 117 "Absmiddle": "دÙÛÙØ§ ÙØ³Ø·", 118 "Baseline": "Ø§ØšØªØ¯Ø§Û Ø®Ø·", 119 "Absbottom": "دÙÛÙØ§ ٟاÛÛÙ", 120 "Bottom": "ٟاÛÛÙ", 121 "Middle": "ÙØ³Ø·", 122 "Top": "ØšØ§ÙØ§", 67 "Alignment:": "تراز بندی", 68 "Not set": "تنظیم نشده", 69 "Left": "چپ", 70 "Right": "راست", 71 "Texttop": "بالای متن", 72 "Absmiddle": "دقیقا وسط", 73 "Baseline": "ابتدای خط", 74 "Absbottom": "دقیقا پایین", 75 "Bottom": "پایین", 76 "Middle": "وسط", 77 "Top": "بالا", 123 78 124 "Layout": "ÙØ§ÛÙ", 125 "Spacing": "ÙØ§ØµÙ٠گذارÛ", 126 "Horizontal:": "اÙÙÛ", 127 "Horizontal padding": "ٟرکÙÙØ¯Ù اÙÙÛ", 128 "Vertical:": "ع٠129 ÙØ¯Û", 130 "Vertical padding": "ٟرکÙÙØ¯Ù ع٠131 ÙØ¯Û", 132 "Border thickness:": "ضخا٠133 ت ÙØšÙ", 134 "Leave empty for no border": "ØšØ±Ø§Û ØšØ¯ÙÙ ÙØšÙ خاÙÛ Ø±ÙØ§ Ú©Ù", 79 "Layout": "لایه", 80 "Spacing": "فاصله گذاری", 81 "Horizontal:": "افقی", 82 "Horizontal padding": "پرکننده افقی", 83 "Vertical:": "عمودی", 84 "Vertical padding": "پرکننده عمودی", 85 "Border thickness:": "ضخامت لبه", 86 "Leave empty for no border": "برای بدون لبه خالی رها کن", 135 87 136 88 //Insert Link 137 "Insert/Modify Link": "Ø§ÙØ²Ùد٠/ ÙÛØ±Ø§ÛØŽ ÙÛÙÚ©", 138 "None (use implicit)": "ÙÛÚکدا٠139 (Ø§Ø³ØªÙØ§Ø¯Ù از ؚدÙ٠؎رط)", 140 "New window (_blank)": "ÙŸÙØ¬Ø±Ù Ø¬Ø¯ÛØ¯ (_blank)", 141 "Same frame (_self)": "ÙØ±ÛÙ 142 Ûکسا٠(_self)", 143 "Top frame (_top)": "ÙØ±ÛÙ 144 ØšØ§ÙØ§ÛÛ (_top)", 145 "Other": "Ø³Ø§ÛØ±", 146 "Target:": "ÙØ¯Ù", 147 "Title (tooltip):": "عÙÙØ§Ù (راÙÙÙ 148 Ø§Û ÛÚ© خطÛ)", 89 "Insert/Modify Link": "افزودن / ویرایش لینک", 90 "None (use implicit)": "هیچکدام (استفاده از بدون شرط)", 91 "New window (_blank)": "پنجره جدید (_blank)", 92 "Same frame (_self)": "فریم یکسان (_self)", 93 "Top frame (_top)": "فریم بالایی (_top)", 94 "Other": "سایر", 95 "Target:": "هدف", 96 "Title (tooltip):": "عنوان (راهنمای یک خطی)", 149 97 "URL:": "URL:", 150 "You must enter the URL where this link points to": "ØšØ§ÛØ¯ URLÛ Ú©Ù Ø§ÛÙ ÙÛÙÚ© ؚ٠آ٠ا؎ار٠دارد را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯", 151 "You need to select some text before creating a link": "ØšØ§ÛØ¯ ÙØšÙ از ساخت ÙÛÙÚ© Ø Ù 152 تÙÛ Ø±Ø§ Ø§ÙØªØ®Ø§Øš ÙÙ 153 اÛÛØ¯", 98 "You must enter the URL where this link points to": "باید URLی که این لینک به آن اشاره دارد را وارد کنید", 99 "You need to select some text before creating a link": "باید قبل از ساخت لینک ، متنی را انتخاب نمایید", 154 100 155 101 // Insert Table 156 "Insert Table": " Ø§ÙØ²Ùد٠جدÙÙ",157 "Rows:": " ردÛÙ ÙØ§",158 "Number of rows": " تعداد ردÛÙ ÙØ§",159 "Cols:": " ستÙÙ ÙØ§",160 "Number of columns": " تعداد ستÙÙ ÙØ§",161 "Width:": " Ø·ÙÙ",162 "Width of the table": " Ø·Ù٠جدÙÙ",163 "Percent": " درصد",164 "Pixels": " ÙŸÛÚ©Ø³Ù ÙØ§",102 "Insert Table": "افزودن جدول", 103 "Rows:": "ردیف ها", 104 "Number of rows": "تعداد ردیف ها", 105 "Cols:": "ستون ها", 106 "Number of columns": "تعداد ستون ها", 107 "Width:": "طول", 108 "Width of the table": "طول جدول", 109 "Percent": "درصد", 110 "Pixels": "پیکسل ها", 165 111 "Em": "Em", 166 "Width unit": "ÙØ§ØØ¯ Ø·ÙÙ", 167 "Fixed width columns": "ستÙÙ ÙØ§Û Ø·Ù٠ثاؚت", 168 "Positioning of this table": "Ù 169 ÙÙØ¹Ûت ÛØ§ØšÛ اÛ٠جدÙÙ", 170 "Cell spacing:": "ÙØ§ØµÙ٠سÙÙÙ ÙØ§", 171 "Space between adjacent cells": "ÙØ§ØµÙÙ ØšÛ٠سÙÙÙ ÙØ§Û ÙÙ 172 Ø¬ÙØ§Ø±", 173 "Cell padding:": "ٟر Ú©ÙÙØ¯Ù سÙÙÙ", 174 "Space between content and border in cell": "ÙØ§ØµÙÙ ØšÛÙ Ù 175 ØØªÙا Ù ÙØšÙ در سÙÙÙ", 176 "You must enter a number of rows": "ØšØ§ÛØ¯ تعداد ردÛÙ ÙØ§ را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯", 177 "You must enter a number of columns": "ØšØ§ÛØ¯ تعداد ستÙÙ ÙØ§ را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯", 112 "Width unit": "واحد طول", 113 "Fixed width columns": "ستون های طول ثابت", 114 "Positioning of this table": "موقعیت یابی این جدول", 115 "Cell spacing:": "فاصله سلول ها", 116 "Space between adjacent cells": "فاصله بین سلول های همجوار", 117 "Cell padding:": "پر کننده سلول", 118 "Space between content and border in cell": "فاصله بین محتوا و لبه در سلول", 119 "You must enter a number of rows": "باید تعداد ردیف ها را وارد کنید", 120 "You must enter a number of columns": "باید تعداد ستون ها را وارد کنید", 178 121 179 122 // Insert Image 180 "Insert Image": "Ø§ÙØ²Ùد٠تصÙÛØ±", 181 "Image URL:": "URL تصÙÛØ±", 182 "Enter the image URL here": "URL تصÙÛØ± را اÛÙØ¬Ø§ ÙØ§Ø±Ø¯ Ú©ÙÛØ¯", 183 "Preview": "ÙŸÛØŽ ÙÙ 184 Ø§ÛØŽ", 185 "Preview the image in a new window": "ÙŸÛØŽ ÙÙ 186 Ø§ÛØŽ ØªØµÙÛØ± در ÙŸÙØ¬Ø±Ù Ø§Û Ø¬Ø¯ÛØ¯", 187 "Alternate text:": "Ù 188 ت٠جاÛگزÛÙ", 189 "For browsers that don't support images": "ØšØ±Ø§Û Ù 190 Ø±ÙØ±Ú¯Ø±ÙاÛÛ Ú©Ù Ø§Ø² تصاÙÛØ± ÙŸØŽØªÛØšØ§ÙÛ ÙÙ 191 Û Ú©ÙÙØ¯", 192 "Positioning of this image": "Ù 193 ÙÙØ¹Ûت ÛØ§ØšÛ تصÙÛØ±", 194 "Image Preview:": "ÙŸÛØŽ ÙÙ 195 Ø§ÛØŽ ØªØµÙÛØ±", 196 "You must enter the URL": "ØŽÙ 197 ا ØšØ§ÛØ¯ URL را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯", 123 "Insert Image": "افزودن تصویر", 124 "Image URL:": "URL تصویر", 125 "Enter the image URL here": "URL تصویر را اینجا وارد کنید", 126 "Preview": "پیش نمایش", 127 "Preview the image in a new window": "پیش نمایش تصویر در پنجره ای جدید", 128 "Alternate text:": "متن جایگزین", 129 "For browsers that don't support images": "برای مرورگرهایی که از تصاویر پشتیبانی نمی کنند", 130 "Positioning of this image": "موقعیت یابی تصویر", 131 "Image Preview:": "پیش نمایش تصویر", 132 "You must enter the URL": "شما باید URL را وارد کنید", 198 133 199 134 // toolbar 135 /* 200 136 "button_bold": "fr/bold.gif", 201 137 "button_underline": "fr/underline.gif", 202 138 "button_strikethrough": "fr/strikethrough.gif", 139 */ 203 140 204 141 // Editor Help 205 "Xinha Help": "راÙÙÙ 206 Ø§Û Xinha", 207 "Editor Help": "راÙÙÙ 208 Ø§Û ÙÛØ±Ø§Û؎گر", 209 "Keyboard shortcuts": "Ù 210 ÛØ§ÙØšØ±ÙØ§Û ØµÙØÙ Ú©ÙÛØ¯", 211 "The editor provides the following key combinations:": "ÙÛØ±Ø§Û؎گر Ø§Ø³ØªÙØ§Ø¯Ù از Ú©ÙÛØ¯ ÙØ§Û گرÙÙÛ Ø²ÛØ± را Ù 212 Ø³ÛØ± Ù 213 Û Ø³Ø§Ø²Ø¯ :", 142 "Xinha Help": "راهنمای Xinha", 143 "Editor Help": "راهنمای ویرایشگر", 144 "Keyboard shortcuts": "میانبرهای صفحه کلید", 145 "The editor provides the following key combinations:": "ویرایشگر استفاده از کلید های گروهی زیر را مسیر می سازد :", 214 146 "ENTER": "ENTREE", 215 "new paragraph": " ÙŸØ§Ø±Ø§Ú¯Ø±Ø§Ù Ø¬Ø¯ÛØ¯",147 "new paragraph": "پاراگراف جدید", 216 148 "SHIFT-ENTER": "SHIFT+ENTREE", 217 "insert linebreak": "Ø§ÙØ²Ùد٠جدا Ú©ÙÙØ¯Ù خط", 218 "Set format to paragraph": "تغÛÛØ± ÙØ§ÙØš ؚ٠ٟاراگراÙ", 219 "Clean content pasted from Word": "ت٠220 ÛØ² کرد٠٠221 ØØªÙØ§Û ÚØ³ØšØ§Ùد٠؎د٠از Word", 222 "Headings": "عÙÙØ§Ù گذارÛ", 223 "Close": "ؚستÙ", 149 "insert linebreak": "افزودن جدا کننده خط", 150 "Set format to paragraph": "تغییر قالب به پاراگراف", 151 "Clean content pasted from Word": "تمیز کردن محتوای چسبانده شده از Word", 152 "Headings": "عنوان گذاری", 153 "Close": "بستن", 224 154 225 155 // Loading messages 226 "Loading in progress. Please wait !": "ØšØ§Ø±Ú¯Ø°Ø§Ø±Û Ø¯Ø± ØØ§Ù Ø§ÙØ¬Ø§Ù 227 است. ÙØ·Ùا صؚر Ú©ÙÛØ¯ !", 228 "Constructing main object": "Ø³Ø§Ø®ØªÙ ØŽÛØ¡ اصÙÛ", 229 "Constructing object": "Ø³Ø§Ø®ØªÙ ØŽÛØ¡", 230 "Register panel right": "ثؚت ÙØ§Øš راست", 231 "Register panel left": "ثؚت ÙØ§Øš ÚÙŸ", 232 "Register panel top": "ثؚت ÙØ§Øš ØšØ§ÙØ§", 233 "Register panel bottom": "ثؚت ÙØ§Øš ٟاÛÛÙ", 234 "Create Toolbar": "ساخت ÙÙØ§Ø± اؚزار", 235 "Create StatusBar": "ساخت ÙÙØ§Ø± ÙØ¶Ø¹Ûت", 236 "Generate Xinha object": "تÙÙÛØ¯ ØŽÛØ¡ Xinha", 237 "Init editor size": "Ù 238 ÙØ¯Ø§Ø± دÙÛ Ø§ÙØ¯Ø§Ø²Ù ÙÛØ±Ø§Û؎گر", 239 "Init IFrame": "Ù 240 ÙØ¯Ø§Ø± دÙÛ IFrame", 241 "Register plugin $plugin": "ثؚت ÙŸÙØ§Ú¯ÛÙ $plugin" 156 "Loading in progress. Please wait !": "بارگذاری در حال انجام است. لطفا صبر کنید !", 157 "Constructing main object": "ساختن شیء اصلی", 158 "Constructing object": "ساختن شیء", 159 "Register panel right": "ثبت قاب راست", 160 "Register panel left": "ثبت قاب چپ", 161 "Register panel top": "ثبت قاب بالا", 162 "Register panel bottom": "ثبت قاب پایین", 163 "Create Toolbar": "ساخت نوار ابزار", 164 "Create StatusBar": "ساخت نوار وضعیت", 165 "Generate Xinha object": "تولید شیء Xinha", 166 "Init editor size": "مقدار دهی اندازه ویرایشگر", 167 "Init IFrame": "مقدار دهی IFrame", 168 "Register plugin $plugin": "ثبت پلاگین $plugin" 242 169 }; -
branches/ray/modules/ColorPicker/ColorPicker.js
r911 r975 105 105 Xinha.colorPicker.loadColors(); 106 106 } 107 108 this.is_ie_6 = (Xinha.is_ie && Xinha.ie_version < 7); 107 109 var picker = this; 108 110 var enablepick = false; … … 406 408 this.table.style.left = left + 'px'; 407 409 } 408 // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 409 /*@cc_on 410 this.iframe.style.top = this.table.style.top; 411 this.iframe.style.left = this.table.style.left; 412 @*/ 410 // IE6 ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 411 if (this.is_ie_6) 412 { 413 this.iframe.style.top = this.table.style.top; 414 this.iframe.style.left = this.table.style.left; 415 } 413 416 }; 414 417 … … 713 716 function createSavedColors(color) 714 717 { 715 var is_ie = false;716 /*@cc_on is_ie = true; @*/ 718 var is_ie = Xinha.is_ie; 719 717 720 var div = document.createElement('div'); 718 721 div.style.width = picker.cellsize + 'px';//13px'; … … 744 747 745 748 //put an iframe behind the table to mask select lists in ie 746 // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 747 /*@cc_on 748 if ( !this.iframe ) 749 { 750 this.iframe = document.createElement('iframe'); 751 this.iframe.frameBorder = 0; 752 this.iframe.src = "javascript:;"; 753 this.iframe.style.position = "absolute"; 754 this.iframe.style.width = this.table.offsetWidth; 755 this.iframe.style.height = this.table.offsetHeight; 756 document.body.insertBefore(this.iframe, this.table); 757 } 758 this.iframe.style.display = ''; 759 @*/ 749 // IE6 ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 750 if (this.is_ie_6) 751 { 752 if ( !this.iframe ) 753 { 754 this.iframe = document.createElement('iframe'); 755 this.iframe.frameBorder = 0; 756 this.iframe.src = "javascript:;"; 757 this.iframe.style.position = "absolute"; 758 this.iframe.style.width = this.table.offsetWidth; 759 this.iframe.style.height = this.table.offsetHeight; 760 document.body.insertBefore(this.iframe, this.table); 761 } 762 this.iframe.style.display = ''; 763 } 760 764 } 761 765 else … … 799 803 Xinha._removeEvent(document.body,'mousedown',closeOnBodyClick); 800 804 this.table.style.display = 'none'; 801 // IE ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 802 /*@cc_on 803 if ( this.iframe ) { this.iframe.style.display = 'none'; } 804 @*/ 805 // IE6 ONLY - prevent windowed elements (<SELECT>) to render above the colorpicker 806 if (this.is_ie_6) 807 { 808 if ( this.iframe ) { this.iframe.style.display = 'none'; } 809 } 805 810 }; 806 811 } // end Xinha.colorPicker -
branches/ray/modules/Dialogs/XinhaDialog.js
r890 r975 43 43 44 44 45 if (Xinha.is_ie )45 if (Xinha.is_ie && Xinha.ie_version < 7) 46 46 { // IE6 needs the iframe to hide select boxes 47 47 var backG = document.createElement("iframe"); … … 259 259 260 260 // unfortunately we have to hide the editor (iframe/caret bug) 261 if (Xinha.is_ gecko&& modal)261 if (Xinha.is_ff2 && modal) 262 262 { 263 263 this._restoreTo = [this.editor._textArea.style.display, this.editor._iframe.style.visibility, this.editor.hidePanels()]; … … 281 281 282 282 //rootElemStyle.display = ''; 283 Xinha.Dialog.fadeIn(this.rootElem);283 Xinha.Dialog.fadeIn(this.rootElem); 284 284 var dialogHeight = rootElem.offsetHeight; 285 285 var dialogWidth = rootElem.offsetWidth; … … 372 372 var dialog = this; 373 373 374 if (Xinha.is_ gecko&& this.modal)374 if (Xinha.is_ff2 && this.modal) 375 375 { 376 376 this.editor._textArea.style.display = this._restoreTo[0]; -
branches/ray/modules/Dialogs/dialog.js
r761 r975 28 28 init = window; // pass this window object by default 29 29 } 30 Dialog._geckoOpenModal(url, action, init); 30 if (typeof window.showModalDialog == 'function') 31 { 32 Dialog._return = function(retVal) { 33 if (typeof action == 'function') action (retVal); 34 } 35 var r = window.showModalDialog(url, init, "dialogheight=10;dialogwidth=10;resizable=yes"); 36 } 37 else 38 { 39 Dialog._geckoOpenModal(url, action, init); 40 } 31 41 } 32 42 -
branches/ray/modules/FullScreen/full-screen.js
r782 r975 186 186 this._htmlArea.style.left = e.config.fullScreenMargins[3] + 'px'; 187 187 this._htmlArea.style.top = e.config.fullScreenMargins[0] + 'px'; 188 if ( !Xinha.is_ie ) this._htmlArea.style.border = 'none';188 if ( !Xinha.is_ie && !Xinha.is_webkit ) this._htmlArea.style.border = 'none'; 189 189 this._isFullScreen = true; 190 190 resetScroll(); -
branches/ray/modules/Gecko/Gecko.js
r911 r975 189 189 /* This is now handled by a plugin 190 190 case 13: // ENTER 191 if( !ev.shiftKey && editor.config.mozParaHandler == 'dirty' ) 192 { 193 this.dom_checkInsertP(); 194 Xinha._stopEvent(ev); 195 } 191 196 192 break;*/ 197 193 … … 370 366 return true; // Indicate paste is done, stop command being issued to browser by Xinha.prototype.execCommand 371 367 } 368 break; 369 case 'removeformat': 370 var editor = this.editor; 371 var sel = editor.getSelection(); 372 var selSave = editor.saveSelection(sel); 373 var range = editor.createRange(sel); 374 375 var els = editor._doc.body.getElementsByTagName('*'); 376 377 var start = ( range.startContainer.nodeType == 1 ) ? range.startContainer : range.startContainer.parentNode; 378 var i, el; 379 if (sel.isCollapsed) range.selectNodeContents(editor._doc.body); 380 381 for (i=0; i<els.length;i++) 382 { 383 el = els[i]; 384 if ( range.isPointInRange(el, 0) || (els[i] == start && range.startOffset == 0)) 385 { 386 el.removeAttribute('style'); 387 } 388 } 389 this.editor._doc.execCommand(cmdID, UI, param); 390 editor.restoreSelection(selSave); 391 return true; 392 break; 372 393 } 373 394 … … 396 417 Xinha.prototype.insertNodeAtSelection = function(toBeInserted) 397 418 { 419 if ( toBeInserted.ownerDocument != this._doc ) // as of FF3, Gecko is strict regarding the ownerDocument of an element 420 { 421 try 422 { 423 toBeInserted = this._doc.adoptNode( toBeInserted ); 424 } catch (e) {} 425 } 398 426 var sel = this.getSelection(); 399 427 var range = this.createRange(sel); … … 404 432 var pos = range.startOffset; 405 433 var selnode = toBeInserted; 434 406 435 switch ( node.nodeType ) 407 436 { … … 616 645 { 617 646 var sel = this.getSelection(); 647 if (sel.isCollapsed) return ''; 618 648 var range = this.createRange(sel); 619 649 return Xinha.getHTML(range.cloneContents(), false, this); … … 692 722 693 723 //Control character for retaining edit location when switching modes 694 Xinha.prototype.cc = String.fromCharCode( 173);724 Xinha.prototype.cc = String.fromCharCode(8286); 695 725 696 726 Xinha.prototype.setCC = function ( target ) … … 706 736 var after = ta.value.substring( index, ta.value.length ); 707 737 708 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body)738 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 709 739 { 710 740 var tagEnd = after.indexOf(">") + 1; … … 712 742 } 713 743 else ta.value = before + cc + after; 744 ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 714 745 ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 715 746 ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); … … 718 749 { 719 750 var sel = this.getSelection(); 720 sel.getRangeAt(0).insertNode( document.createTextNode( cc ) );751 sel.getRangeAt(0).insertNode( this._doc.createTextNode( cc ) ); 721 752 } 722 753 } catch (e) {} … … 725 756 Xinha.prototype.findCC = function ( target ) 726 757 { 727 try 728 { 729 var findIn = ( target == 'textarea' ) ? window : this._iframe.contentWindow; 730 if( findIn.find( this.cc ) ) 731 { 732 if (target == "textarea") 733 { 734 var ta = this._textArea; 735 var start = pos = ta.selectionStart; 736 var end = ta.selectionEnd; 737 var scrollTop = ta.scrollTop; 738 ta.value = ta.value.substring( 0, start ) + ta.value.substring( end, ta.value.length ); 739 ta.selectionStart = pos; 740 ta.selectionEnd = pos; 741 ta.scrollTop = scrollTop 742 ta.focus(); 743 } 744 else 745 { 746 var sel = this.getSelection(); 747 sel.getRangeAt(0).deleteContents(); 748 this._iframe.contentWindow.focus(); 749 } 750 } 751 } catch (e) {} 758 if ( target == 'textarea' ) 759 { 760 var ta = this._textArea; 761 var pos = ta.value.indexOf( this.cc ); 762 if ( pos == -1 ) return; 763 var end = pos + this.cc.length; 764 var before = ta.value.substring( 0, pos ); 765 var after = ta.value.substring( end, ta.value.length ); 766 ta.value = before ; 767 768 ta.scrollTop = ta.scrollHeight; 769 var scrollPos = ta.scrollTop; 770 771 ta.value += after; 772 ta.setSelectionRange(pos,pos); 773 774 ta.focus(); 775 776 ta.scrollTop = scrollPos; 777 778 } 779 else 780 { 781 try 782 { 783 this._iframe.contentWindow.find( this.cc ); 784 var sel = this.getSelection(); 785 sel.getRangeAt(0).deleteContents(); 786 this.scrollToElement(); 787 this._iframe.contentWindow.focus(); 788 } catch (e) {} 789 } 752 790 }; 753 791 /*--------------------------------------------------------------------------*/ -
branches/ray/modules/GetHtml/DOMwalk.js
r892 r975 38 38 // Retrieves the HTML code from the given node. This is a replacement for 39 39 // getting innerHTML, using standard DOM calls. 40 // Wrapper catch a Mozilla-Exception with non well formed html source code40 // Wrapper legacy see #442 41 41 Xinha.getHTML = function(root, outputRoot, editor) 42 42 { 43 try 44 { 45 return Xinha.getHTMLWrapper(root,outputRoot,editor); 46 } 47 catch(ex) 48 { 49 alert(Xinha._lc('Your Document is not well formed. Check JavaScript console for details.')); 50 return editor._iframe.contentWindow.document.body.innerHTML; 51 } 43 return Xinha.getHTMLWrapper(root,outputRoot,editor); 52 44 }; 53 45 … … 155 147 } 156 148 var name = a.nodeName.toLowerCase(); 157 if ( /_moz_editor_bogus_node/.test(name) )149 if ( /_moz_editor_bogus_node/.test(name) || ( name == 'class' && a.nodeValue == 'webkit-block-placeholder') ) 158 150 { 159 151 html = ""; … … 189 181 { 190 182 value = a.nodeValue; 183 if (name == 'class') 184 { 185 value = value.replace(/Apple-style-span/,''); 186 if (!value) continue; 187 } 191 188 // IE seems not willing to return the original values - it converts to absolute 192 189 // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href") -
branches/ray/modules/GetHtml/TransformInnerHTML.js
r911 r975 34 34 35 35 Xinha.RegExpCache = [ 36 /*00*/ new RegExp().compile(/<\s*\/?([^\s\/>]+)[\s*\/>]/gi),//lowercase tags37 /*01*/ new RegExp().compile(/(\s+)_moz[^=>]*=[^\s>]*/gi),//strip _moz attributes38 /*02*/ new RegExp().compile(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g),// find attributes39 /*03*/ new RegExp().compile(/\/>/g),//strip singlet terminators40 /*04*/ new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g),//terminate singlet tags41 /*05*/ new RegExp().compile(/(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi),//expand singlet attributes42 /*06*/ new RegExp().compile(/(="[^']*)'([^'"]*")/),//check quote nesting43 /*07*/ new RegExp().compile(/&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g),//expand query ampersands not in html entities44 /*08*/ new RegExp().compile(/<\s+/g),//strip tagstart whitespace45 /*09*/ new RegExp().compile(/\s+(\/)?>/g),//trim whitespace46 /*10*/ new RegExp().compile(/\s{2,}/g),//trim extra whitespace47 /*11*/ new RegExp().compile(/\s+([^=\s]+)((="[^"]+")|([\s>]))/g),// lowercase attribute names48 /*12*/ new RegExp().compile(/\s+contenteditable(=[^>\s\/]*)?/gi),//strip contenteditable49 /*13*/ new RegExp().compile(/((href|src)=")([^\s]*)"/g), //find href and src for stripBaseHref()50 /*14*/ new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g),51 /*15*/ new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),//blocklevel closing tag52 /*16*/ new RegExp().compile(/<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),//blocklevel opening tag53 /*17*/ new RegExp().compile(/<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g),//singlet tag or output on 1 line54 /*18*/ new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags55 /*19*/ new RegExp().compile(/(<pre[^>]*>)([\s\S])*?(<\/pre>)/g),//find content inside pre tags56 /*20*/ new RegExp().compile(/(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g),//find content NOT inside comments57 /*21*/ new RegExp().compile(/\S*=""/g), //find empty attributes58 /*22*/ new RegExp().compile(/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g), //find all tags, including comments and php59 /*23*/ new RegExp().compile(/(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g)//find content NOT inside script tags36 /*00*/ /<\s*\/?([^\s\/>]+)[\s*\/>]/gi,//lowercase tags 37 /*01*/ /(\s+)_moz[^=>]*=[^\s>]*/gi,//strip _moz attributes 38 /*02*/ /\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g,// find attributes 39 /*03*/ /\/>/g,//strip singlet terminators 40 /*04*/ /<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g,//terminate singlet tags 41 /*05*/ /(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi,//expand singlet attributes 42 /*06*/ /(="[^']*)'([^'"]*")/,//check quote nesting 43 /*07*/ /&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g,//expand query ampersands not in html entities 44 /*08*/ /<\s+/g,//strip tagstart whitespace 45 /*09*/ /\s+(\/)?>/g,//trim whitespace 46 /*10*/ /\s{2,}/g,//trim extra whitespace 47 /*11*/ /\s+([^=\s]+)((="[^"]+")|([\s>]))/g,// lowercase attribute names 48 /*12*/ /\s+contenteditable(=[^>\s\/]*)?/gi,//strip contenteditable 49 /*13*/ /((href|src)=")([^\s]*)"/g, //find href and src for stripBaseHref() 50 /*14*/ /<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g, 51 /*15*/ /<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel closing tag 52 /*16*/ /<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel opening tag 53 /*17*/ /<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g,//singlet tag or output on 1 line 54 /*18*/ /(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g,//find content NOT inside pre and script tags 55 /*19*/ /(<pre[^>]*>)([\s\S])*?(<\/pre>)/g,//find content inside pre tags 56 /*20*/ /(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g,//find content NOT inside comments 57 /*21*/ /\S*=""/g, //find empty attributes 58 /*22*/ /<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g, //find all tags, including comments and php 59 /*23*/ /(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g //find content NOT inside script tags 60 60 ]; 61 61 // compile for performance; WebKit doesn't support this 62 if (typeof RegExp.prototype.compile == 'function') { 63 for (var i=0; i<Xinha.RegExpCache.length;i++ ) { 64 Xinha.RegExpCache[i] = new RegExp().compile(Xinha.RegExpCache[i]); 65 } 66 } 62 67 /** 63 68 * Cleans HTML into wellformed xhtml … … 74 79 replace(c[3], '>').//strip singlet terminators 75 80 replace(c[9], '$1>').//trim whitespace 76 replace(c[5], '$1$3="$3"$ 4').//expand singlet attributes81 replace(c[5], '$1$3="$3"$5').//expand singlet attributes 77 82 replace(c[4], '<$1$2 />').//terminate singlet tags 78 83 replace(c[6], '$1$2').//check quote nesting -
branches/ray/modules/InternetExplorer/InternetExplorer.js
r911 r975 158 158 } 159 159 160 InternetExplorer.prototype.onExecCommand = function(cmdID, UI, param) 161 { 162 switch(cmdID) 163 { 164 // #645 IE only saves the initial content of the iframe, so we create a temporary iframe with the current editor contents 165 case 'saveas': 166 var doc = null; 167 var editor = this.editor; 168 var iframe = document.createElement("iframe"); 169 iframe.src = "about:blank"; 170 iframe.style.display = 'none'; 171 document.body.appendChild(iframe); 172 try 173 { 174 if ( iframe.contentDocument ) 175 { 176 doc = iframe.contentDocument; 177 } 178 else 179 { 180 doc = iframe.contentWindow.document; 181 } 182 } 183 catch(ex) 184 { 185 //hope there's no exception 186 } 187 188 doc.open("text/html","replace"); 189 var html = ''; 190 if ( editor.config.browserQuirksMode === false ) 191 { 192 var doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; 193 } 194 else if ( editor.config.browserQuirksMode === true ) 195 { 196 var doctype = ''; 197 } 198 else 199 { 200 var doctype = Xinha.getDoctype(document); 201 } 202 if ( !editor.config.fullPage ) 203 { 204 html += doctype + "\n"; 205 html += "<html>\n"; 206 html += "<head>\n"; 207 html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + editor.config.charSet + "\">\n"; 208 if ( typeof editor.config.baseHref != 'undefined' && editor.config.baseHref !== null ) 209 { 210 html += "<base href=\"" + editor.config.baseHref + "\"/>\n"; 211 } 212 213 if ( typeof editor.config.pageStyleSheets !== 'undefined' ) 214 { 215 for ( var i = 0; i < editor.config.pageStyleSheets.length; i++ ) 216 { 217 if ( editor.config.pageStyleSheets[i].length > 0 ) 218 { 219 html += "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + editor.config.pageStyleSheets[i] + "\">"; 220 //html += "<style> @import url('" + editor.config.pageStyleSheets[i] + "'); </style>\n"; 221 } 222 } 223 } 224 225 if ( editor.config.pageStyle ) 226 { 227 html += "<style type=\"text/css\">\n" + editor.config.pageStyle + "\n</style>"; 228 } 229 230 html += "</head>\n"; 231 html += "<body>\n"; 232 html += editor.getEditorContent(); 233 html += "</body>\n"; 234 html += "</html>"; 235 } 236 else 237 { 238 html = editor.getEditorContent(); 239 if ( html.match(Xinha.RE_doctype) ) 240 { 241 editor.setDoctype(RegExp.$1); 242 } 243 } 244 doc.write(html); 245 doc.close(); 246 doc.execCommand(cmdID, UI, param); 247 document.body.removeChild(iframe); 248 return true; 249 break; 250 case 'removeformat': 251 var editor = this.editor; 252 var sel = editor.getSelection(); 253 var selSave = editor.saveSelection(sel); 254 255 var i, el, els; 256 257 function clean (el) 258 { 259 if (el.nodeType != 1) return; 260 el.removeAttribute('style'); 261 for (var j=0; j<el.childNodes.length;j++) 262 { 263 clean(el.childNodes[j]); 264 } 265 if ( (el.tagName.toLowerCase() == 'span' && !el.attributes.length ) || el.tagName.toLowerCase() == 'font') 266 { 267 el.outerHTML = el.innerHTML; 268 } 269 } 270 if ( editor.selectionEmpty(sel) ) 271 { 272 els = editor._doc.body.childNodes; 273 for (i = 0; i < els.length; i++) 274 { 275 el = els[i]; 276 if (el.nodeType != 1) continue; 277 if (el.tagName.toLowerCase() == 'span') 278 { 279 newNode = editor.convertNode(el, 'div'); 280 el.parentNode.replaceChild(newNode, el); 281 el = newNode; 282 } 283 clean(el); 284 } 285 } 286 editor._doc.execCommand(cmdID, UI, param); 287 288 editor.restoreSelection(selSave); 289 return true; 290 break; 291 } 292 293 return false; 294 }; 160 295 /*--------------------------------------------------------------------------*/ 161 296 /*------- IMPLEMENTATION OF THE ABSTRACT "Xinha.prototype" METHODS ---------*/ … … 298 433 Xinha.prototype.saveSelection = function() 299 434 { 300 return this.createRange(this. _getSelection())435 return this.createRange(this.getSelection()) 301 436 } 302 437 /** … … 360 495 { 361 496 var sel = this.getSelection(); 497 if (this.selectionEmpty) return ''; 362 498 var range = this.createRange(sel); 363 499 … … 393 529 Xinha.prototype.createRange = function(sel) 394 530 { 531 if (!sel) sel = this.getSelection(); 395 532 return sel.createRange(); 396 533 }; … … 447 584 var after = ta.value.substring( index + cc.length , ta.value.length ); 448 585 449 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body)586 if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 450 587 { 451 588 var tagEnd = after.indexOf(">") + 1; … … 453 590 } 454 591 else ta.value = before + cc + after; 592 ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 455 593 ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 456 594 ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); -
branches/ray/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php
r862 r975 810 810 break; 811 811 case 'moveFile': 812 $src = Files::make Path($this->getImagesDir(), $_GET['srcdir'].$_GET['file']);813 $dest = Files::make Path($this->getImagesDir(), $_GET['dir'].$_GET['file']);812 $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'].$_GET['file']); 813 $dest = Files::makeFile($this->getImagesDir(), $_GET['dir'].$_GET['file']); 814 814 return Files::rename($src,$dest); 815 815 break; -
branches/ray/plugins/ExtendedFileManager/assets/EditorContent.js
r796 r975 4 4 * Version: Updated on 08-01-2005 by Afru 5 5 * Version: Updated on 20-06-2006 by Krzysztof Kotowicz 6 * Package: ExtendedFileManager (EFM 1.1.1) 6 * Version: Updated on 04-11-2007 by Raimund Meyer 7 * Package: ExtendedFileManager (EFM 1.4) 7 8 * http://www.afrusoft.com/htmlarea 8 9 */ … … 47 48 if(el) {e=(document.layers)?el:el.style; 48 49 var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b); 49 //alert(xx+":"+yy);50 50 if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";} 51 51 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){ … … 53 53 xx+="px";yy+="px";}e.left=xx;e.top=yy;} 54 54 pic_x = parseInt(xx); pic_y = parseInt(yy); 55 //alert(xx+":"+yy);56 55 } 57 56 } … … 65 64 function init_resize() 66 65 { 67 if(mode == "scale")68 {66 //if(mode == "scale") 67 //{ 69 68 P7_Snap('theImage','ant',0,0); 70 69 … … 88 87 drawBoundHandle(); 89 88 jg_doc.paint(); 90 }89 //} 91 90 } 92 91 … … 99 98 if (markerImg.src.indexOf("img/t_white.gif")>0) 100 99 toggleMarker() ; 100 var theImage = document.getElementById('theImage'); 101 theImage._width = theImage.width; 102 theImage._height = theImage.height; 101 103 } 102 104 … … 141 143 function toggleMarker() 142 144 { 143 //alert("Toggle");144 145 if (ant == null) 145 146 ant = MM_findObj("ant"); … … 163 164 if (dragapproved) 164 165 { 165 //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x 166 //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y 167 var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x; 168 var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y; 169 170 //alert(canvas.style.left); 171 /*if (status !=null) 172 { 173 status.innerHTML = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height; 174 status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y; 175 status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id; 176 }*/ 177 178 /*jg_doc.clear(); 179 jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern); 180 jg_doc.paint(); 181 */ 166 var w = ns6? temp1+e.pageX - x : temp1+event.clientX + document.body.scrollLeft- x; 167 var h = ns6? temp2+e.pageY - y : temp2+event.clientY + document.body.scrollTop - y; 168 182 169 if (ant != null) 183 170 { … … 218 205 var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y 219 206 220 /*if (status !=null)221 {222 status.innerHTML = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy;223 }*/224 225 207 ant.style.left = dx; 226 208 ant.style.top = dy; … … 232 214 } 233 215 234 //Code add for constraints by Fr édéric Klee <fklee@isuisse.com>216 //Code add for constraints by Frédéric Klee <fklee@isuisse.com> 235 217 function moveHandle(e) 236 218 { … … 370 352 content.height = 0; 371 353 } 372 //alert(content.width+":"+content.height);373 354 } 374 355 resizeHandle = firedobj.id; 375 376 /*if(status!=null) {377 status.innerHTML = " obj:"+firedobj.id;378 }*/379 356 380 357 x=ns6? e.clientX: event.clientX … … 411 388 content.height = 0; 412 389 } 413 //alert(content.width+":"+content.height);414 390 } 415 391 … … 440 416 temp1=parseInt(z.style.left+0) 441 417 temp2=parseInt(z.style.top+0) 442 x=ns6? e.clientX: event.clientX 443 y=ns6? e.clientY: event.clientY 418 419 x=ns6? e.pageX: event.clientX + document.body.scrollLeft 420 y=ns6? e.pageY: event.clientY + document.body.scrollTop 444 421 document.onmousemove=move 445 422 return false … … 453 430 canvas = MM_findObj("imgCanvas"); 454 431 455 x=ns6? e.clientX: event.clientX 456 y=ns6? e.clientY: event.clientY 457 458 //jg_doc.draw 432 x=ns6? e.pageX: event.clientX + document.body.scrollLeft 433 y=ns6? e.pageY: event.clientY + document.body.scrollTop 434 459 435 dragapproved=true 460 436 document.onmousemove=measure … … 468 444 if (dragapproved) 469 445 { 470 mx2 = ns6? e. clientX : event.clientX;471 my2 = ns6? e. clientY : event.clientY;446 mx2 = ns6? e.pageX : event.clientX + document.body.scrollLeft; 447 my2 = ns6? e.pageY : event.clientY + document.body.scrollTop; 472 448 473 449 jg_doc.clear(); … … 569 545 jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle 570 546 jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle 571 572 //jg_doc.paint();573 547 } 574 548 … … 578 552 return false; 579 553 } 580 554 var zoom = 100 / parseInt( window.parent.document.getElementById('zoom').value, 10 ); 581 555 if(mode == "measure") { 582 //alert(pic_x); 556 583 557 mx1 = x - pic_x; 584 558 my1 = y - pic_y; … … 599 573 600 574 if (m_sx != null && !isNaN(mx1)) 601 m_sx.value = mx1 +"px";575 m_sx.value = mx1 * zoom +"px"; 602 576 if (m_sy != null && !isNaN(my1)) 603 m_sy.value = my1 +"px";577 m_sy.value = my1 * zoom+"px"; 604 578 if(m_w != null && !isNaN(mw)) 605 m_w.value = mw + "px";579 m_w.value = mw * zoom + "px"; 606 580 if(m_h != null && !isNaN(mh)) 607 m_h.value = mh + "px";581 m_h.value = mh * zoom + "px"; 608 582 609 583 if(m_d != null && !isNaN(md)) 610 m_d.value = md + "px";584 m_d.value = md * zoom + "px"; 611 585 if(m_a != null && !isNaN(ma)) 612 586 m_a.value = ma + ""; … … 615 589 r_ra.value = ma; 616 590 617 //alert("mx1:"+mx1+" my1"+my1);618 591 return false; 619 592 } … … 644 617 if(mode == 'crop') { 645 618 if(t_cx != null) 646 t_cx.value = cx ;619 t_cx.value = cx * zoom ; 647 620 if (t_cy != null) 648 t_cy.value = cy ;621 t_cy.value = cy * zoom ; 649 622 if(t_cw != null) 650 t_cw.value = cw ;623 t_cw.value = cw * zoom ; 651 624 if (t_ch != null) 652 t_ch.value = ch ;625 t_ch.value = ch * zoom ; 653 626 } 654 627 else if(mode == 'scale') { … … 662 635 } 663 636 if (s_sw != null) 664 s_sw.value = sw ;637 s_sw.value = sw * zoom ; 665 638 if (s_sh != null) 666 s_sh.value = sh; 667 } 668 639 s_sh.value = sh * zoom ; 640 } 669 641 } 670 642 … … 698 670 content.height = ah-1; 699 671 } 700 //alert(content.width+":"+content.height);701 672 } 702 673 if(mode == "crop") { … … 718 689 } 719 690 else if(mode == "scale") { 720 //alert("Resizing: iw:"+image.width+" nw:"+aw);721 691 document.theImage.height = ah; 722 692 document.theImage.width = aw; … … 725 695 726 696 P7_Snap('theImage','ant',0,0); 727 728 //alert("After Resizing: iw:"+image.width+" nw:"+aw);729 697 } 730 698 -
branches/ray/plugins/ExtendedFileManager/assets/dialog.js
r761 r975 16 16 17 17 function Dialog(url, action, init) { 18 if (typeof init == "undefined") { 19 init = window; // pass this window object by default 20 } 21 Dialog._geckoOpenModal(url, action, init); 18 if (typeof init == "undefined") { 19 init = window; // pass this window object by default 20 } 21 if (typeof window.showModalDialog == 'function') 22 { 23 Dialog._return = action; 24 var r = window.showModalDialog(url, init, "dialogheight=10;dialogwidth=10;resizable=yes"); 25 } 26 else 27 { 28 Dialog._geckoOpenModal(url, action, init); 29 } 22 30 } 23 31 -
branches/ray/plugins/ExtendedFileManager/assets/editor.css
r761 r975 8 8 #indicator 9 9 { 10 width: 2 5px;10 width: 20px; 11 11 height: 20px; 12 12 background-color: #eef; 13 13 padding: 15px 20px; 14 position: absolute;15 left: 0; top: 0;16 14 } 17 15 * html #indicator … … 21 19 #tools 22 20 { 23 width: 600px;24 height: 50px;25 21 background-color: #eef; 26 22 padding: 0; 27 position: absolute;28 left: 63px;29 23 border-left: 1px solid white; 30 24 border-bottom: 1px solid white; … … 32 26 #toolbar 33 27 { 34 width: 53px;35 height: 435px;36 28 background-color: #eef; 37 float: left;38 29 text-align: center; 39 30 padding: 5px; 40 position: absolute;41 top: 50px;42 31 border-top: 1px solid white; 43 32 border-right: 1px solid white; 33 vertical-align: top; 34 width:50px; 44 35 } 45 36 46 37 #contents 47 38 { 48 width: 600px; 49 height: 445px; 50 position: absolute; 51 left: 64px; top: 51px; 39 position: relative; 52 40 } 53 41 54 42 #editor 55 43 { 56 width: 600px;57 height: 445px;44 width: 100%; 45 height: 100%; 58 46 } 59 47 … … 120 108 vertical-align: middle; 121 109 } 122 #tools #tool_inputs110 #tools .tool_inputs 123 111 { 124 112 padding-top: 10px; -
branches/ray/plugins/ExtendedFileManager/assets/editor.js
r761 r975 4 4 * Version: Updated on 08-01-2005 by Afru 5 5 * Version: Updated on 20-06-2006 by Krzysztof Kotowicz 6 * Package: ExtendedFileManager (EFM 1.1.1)7 * http://www.afrusoft.com/htmlarea6 * Version: Updated on 20-01-2008 by Raimund Meyer 7 * Package: ExtendedFileManager (EFM 1.4) 8 8 */ 9 9 … … 40 40 41 41 //constraints on the scale, 42 //code by Fr édéric Klee <fklee@isuisse.com>42 //code by Frédéric Klee <fklee@isuisse.com> 43 43 if(action == 'scale') 44 44 { 45 45 var theImage = editor.window.document.getElementById('theImage'); 46 orginal_width = theImage. width ;47 orginal_height = theImage. height;46 orginal_width = theImage._width ; 47 orginal_height = theImage._height; 48 48 49 49 var w = document.getElementById('sw'); … … 52 52 h.value = orginal_height ; 53 53 } 54 54 if ( action == 'save' ) 55 { 56 var formatSelect = document.getElementById('save_format'); 57 var format = document.getElementById('save_filename').value.match(/\.(gif|png|jpe?g)/i)[1].toLowerCase(); 58 switch ( format ) 59 { 60 case 'png': 61 formatSelect.selectedIndex = '3'; 62 break; 63 case 'gif': 64 formatSelect.selectedIndex = '4'; 65 break; 66 default: 67 formatSelect.selectedIndex = '0'; 68 break; 69 } 70 formatSelect.onchange(); 71 } 55 72 } 56 73 } … … 70 87 } 71 88 72 //Togggle constraints, by Fr édéric Klee <fklee@isuisse.com>89 //Togggle constraints, by Frédéric Klee <fklee@isuisse.com> 73 90 function toggleConstraints() 74 91 { … … 92 109 } 93 110 94 //check the constraints, by Fr édéric Klee <fklee@isuisse.com>111 //check the constraints, by Frédéric Klee <fklee@isuisse.com> 95 112 function checkConstrains(changed) 96 113 { … … 133 150 } 134 151 152 function rotateSubActionSelect(selection) 153 { 154 var value = selection.options[selection.selectedIndex].value; 155 156 var rotate_preset_select = document.getElementById('rotate_preset_select'); 157 var flip = document.getElementById('flip'); 158 var angle = document.getElementById('ra').parentNode; 159 160 switch (value) 161 { 162 case 'rotate': 163 rotate_preset_select.style.display = ''; 164 flip.style.display = 'none'; 165 angle.style.display = ''; 166 break; 167 case 'flip': 168 rotate_preset_select.style.display = 'none'; 169 flip.style.display = ''; 170 angle.style.display = 'none'; 171 break; 172 } 173 } 135 174 function rotatePreset(selection) 136 175 { … … 148 187 149 188 var values = selected.split(","); 189 if ( values[0] != 'jpeg' ) document.getElementById('slider').style.display = 'none'; 190 else document.getElementById('slider').style.display = 'inline'; 150 191 if(values.length >1) { 151 192 updateSlider(parseInt(values[1])); 152 193 } 153 194 195 } 196 function zoom() 197 { 198 var theImage = editor.window.document.getElementById('theImage'); 199 var value = document.getElementById('zoom').value; 200 theImage.width = theImage._width * parseInt( value, 10 ) / 100; 201 theImage.height = theImage._height * parseInt( value, 10 )/ 100; 202 editor.reset(); 203 editor.pic_width = null; 204 editor.pic_height = null; 154 205 } 155 206 function addEvent(obj, evType, fn) … … 160 211 } 161 212 162 init = function() 163 { 164 var bottom = document.getElementById('bottom'); 213 var init = function() 214 { 165 215 if(window.opener) 166 216 { 167 __ dlg_init(null, {width: 673, height: 531});217 __xinha_dlg_init(); 168 218 __dlg_translate('ExtendedFileManager'); 169 219 } 170 } 171 172 addEvent(window, 'load', init); 220 addEvent(window, 'resize', winOnResize); 221 try { window.moveTo(0,0); } catch (e) {} 222 window.resizeTo(window.screen.availWidth,window.screen.availHeight); 223 winOnResize(); 224 } 225 function winOnResize () 226 { 227 if ( typeof editor.reset == 'function' && typeof editor.ant != 'undefined' ) editor.reset(); 228 var win = Xinha.viewportSize(window); 229 document.getElementById("contents").style.height = win.y - parseInt(document.getElementById("indicator").offsetHeight,10) - 5 + 'px'; 230 } 231 Xinha.addOnloadHandler( init, window ); -
branches/ray/plugins/ExtendedFileManager/assets/editorFrame.css
r761 r975 7 7 .handleBox{ z-index:105; } 8 8 .error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; } 9 10 #n-resize {cursor: n-resize } 11 #s-resize {cursor: s-resize } 12 #w-resize {cursor: w-resize } 13 #e-resize {cursor: e-resize } 14 #nw-resize {cursor: nw-resize } 15 #sw-resize {cursor: sw-resize } 16 #ne-resize {cursor: ne-resize } 17 #se-resize {cursor: se-resize } -
branches/ray/plugins/ExtendedFileManager/assets/editorFrame.js
r761 r975 4 4 * Version: Updated on 08-01-2005 by Afru 5 5 * Version: Updated on 20-06-2006 by Krzysztof Kotowicz 6 * Package: ExtendedFileManager (EFM 1.1.1) 6 * Version: Updated on 20-01-2008 by Raimund Meyer 7 * Package: ExtendedFileManager (EFM 1.4) 7 8 * http://www.afrusoft.com/htmlarea 8 9 */ … … 49 50 else if (action == 'rotate') 50 51 { 51 var flip = topDoc.getElementById('flip');52 var rotate_sub_action = topDoc.getElementById('rotate_sub_action'); 52 53 53 if( flip.value == 'hoz' || flip.value == 'ver')54 location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=flip¶ms="+ flip.value;54 if(rotate_sub_action.value == 'flip') 55 location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=flip¶ms="+topDoc.getElementById('flip').value; 55 56 else if (isNaN(parseFloat(r_ra.value))==false) 56 57 location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value); … … 69 70 { 70 71 var filename = encodeURI(s_file.value); 71 var quality = parseInt(s_quality.value);72 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename;73 //alert(url);74 location.href = url;72 var quality = parseInt(s_quality.value); 73 var format = s_format.value.split(","); 74 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename; 75 location.href = url; 75 76 } 76 77 } 78 else if (action == 'preview') { 79 var s_format = topDoc.getElementById('save_format'); 80 var s_quality = topDoc.getElementById('quality'); 81 var quality = parseInt(s_quality.value); 82 var format = s_format.value.split(","); 83 var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=preview¶ms="+format[0]+","+quality+"&file="+filename; 84 location.href = url; 85 } 77 86 } 78 87 … … 90 99 jg_doc = new jsGraphics("imgCanvas"); // draw directly into document 91 100 jg_doc.setColor("#000000"); // black 92 101 93 102 initEditor(); 103 if (window.parent.document.getElementById('zoom').value != '100') window.parent.zoom(); 104 reset(); 105 window.parent.document.getElementById('filesize').innerHTML = fileSize; 94 106 }; 95 107 -
branches/ray/plugins/ExtendedFileManager/assets/imagelist.css
r761 r975 30 30 padding:5px; 31 31 text-decoration:none; 32 overflow:hidden; 32 33 } 33 34 … … 42 43 } 43 44 44 .listview { width:100% }45 .listview { width:100%; } 45 46 .listview td, .listview th { text-align:left; font-size:small; } 46 .listview td.actions { text-align: right; }47 .listview td.actions { text-align: right;width:111px } 47 48 .listview td.actions img { border:0; } 48 49 49 .listview thead th {background-color: ButtonFace; border: 1px solid threedface; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; padding-top:2px; padding-bottom:2px; padding-left: 5px; padding-right: 5px; font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif;}50 .listview tbody td, .listview tbody th { padding-top:2px; padding-left: 3px; font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif;}50 .listview thead th {background-color: ButtonFace; border: 1px solid threedface; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; padding-top:2px; padding-bottom:2px; padding-left: 5px; padding-right: 5px; font-size: 9pt; font-family: "MS Sans Serif", "Bitstream Vera Sans", Geneva, Sans, sans-serif;font-weight:normal} 51 .listview tbody td, .listview tbody th {overflow:hidden; padding-top:2px; padding-left: 3px; font-size: 9pt; font-family: "MS Sans Serif", "Bitstream Vera Sans", Geneva, Sans, sans-serif;} 51 52 .listview tbody a, listview tbody a:visited { font-weight: normal; text-decoration: none; color: #000; border:0px; padding:2px;} 52 53 .listview tbody a:hover { background-color:#0B256B; color:#fff;} 53 54 54 .listview tbody tr:hover {background-color: rgb(221,221,255) ;55 .listview tbody tr:hover {background-color: rgb(221,221,255)}; -
branches/ray/plugins/ExtendedFileManager/assets/manager.css
r775 r975 10 10 .dirs { padding: 1em; } 11 11 12 .imageFrame { overflow-x:hidden; width: 100%; height: 1 45px; margin:0px; background-color: #fff;}12 .imageFrame { overflow-x:hidden; width: 100%; height: 155px; margin:0px; background-color: #fff;} 13 13 .smallWidth{ width: 4em; } 14 14 .largelWidth{ width: 30em; } … … 18 18 .buttons { width: 70px; text-align: center; } 19 19 .clearboth{ clear: both; } 20 #messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; }20 #messages {opacity:0.8;filter:Alpha(opacity=85);position:relative;height:20px;margin-bottom:-30px;background-color: white; border: none; text-align: center; padding: 5px; } 21 21 #message { font-size: 15px; font-weight: bold; color: #69c; } 22 22 iframe { border:1px inset; border-right:none; border-left:none; border-bottom:none; } 23 23 #controls {padding-bottom:10px;} 24 24 table { margin-top:10px; } 25 25 th, td { padding-right:3px; text-align:left; font-family:small-caption,helvetica,sans-serif; } -
branches/ray/plugins/ExtendedFileManager/assets/manager.js
r862 r975 5 5 * Version: Updated on 20-06-2006 by Krzysztof Kotowicz 6 6 * Version: Updated on 17-11-2006 by Raimund Meyer 7 * Package: ExtendedFileManager (EFM 1.1.3) 7 * Version: Updated on 20-01-2008 by Raimund Meyer 8 * Package: ExtendedFileManager (EFM 1.4) 8 9 * http://www.afrusoft.com/htmlarea 9 10 */ … … 46 47 } 47 48 48 //initialise the form 49 50 if (manager_mode == "link") 51 { 52 var offsetForInputs = (Xinha.is_ie) ? 165 : 150; 53 } 54 else 55 { 56 var offsetForInputs = (Xinha.is_ie) ? 230 : 210; 57 } 58 59 var h = 100 // space above files 60 + 250 // files iframe 61 + offsetForInputs; 62 63 var win_dim = {width:650,height:h}; 64 window.resizeTo(win_dim.width,win_dim.height); 65 if (!Xinha.is_ie) 66 { 67 var x = opener.screenX + (opener.outerWidth - win_dim.width) / 2; 68 var y = opener.screenY + (opener.outerHeight - win_dim.height) / 2; 69 } 70 else 71 {//IE does not have window.outer... , so center it on the screen at least 72 var x = (self.screen.availWidth - win_dim.width) / 2; 73 var y = (self.screen.availHeight - win_dim.height) / 2; 74 } 75 window.moveTo(x,y); 76 77 init = function () 78 { 79 80 81 __dlg_init(null, {width:650,height:h}); 82 49 function init () 50 { 51 if (typeof imgManager == 'undefined' ) 52 { 53 setTimeout(init,10); // sometimes we are too hasty 54 return; 55 } 56 57 var w = 650; 58 var h = 600; 59 60 window.resizeTo(w,h); 61 var page = Xinha.pageSize(window); 62 window.resizeTo(w,h); 63 64 var dim = Xinha.viewportSize(window); 65 66 window.resizeBy(0, page.y - dim.y + 5); 67 68 dim = Xinha.viewportSize(window); 69 70 if (!Xinha.is_ie) 71 { 72 var x = opener.screenX + (opener.outerWidth - dim.x) / 2; 73 var y = opener.screenY + (opener.outerHeight - dim.x) / 2; 74 } 75 else 76 {//IE does not have window.outer... , so center it on the screen at least 77 var x = (self.screen.availWidth - dim.x) / 2; 78 var y = (self.screen.availHeight - dim.y) / 2; 79 } 80 window.moveTo(x,y); 81 82 __xinha_dlg_init(); 83 83 __dlg_translate('ExtendedFileManager'); 84 84 … … 89 89 90 90 var param = window.dialogArguments.param; 91 91 var startDir = null; 92 92 93 if(manager_mode=="image" && param) 93 94 { … … 141 142 if (dreg.test(param['f_url'])) 142 143 { 143 changeDir(RegExp.$1); 144 var dirPath = document.getElementById('dirPath'); 145 for(var i = 0; i < dirPath.options.length; i++) 146 { 147 if(dirPath.options[i].value == encodeURIComponent(RegExp.$1)) 148 { 149 dirPath.options[i].selected = true; 150 break; 151 } 152 } 144 startDir = RegExp.$1; 153 145 } 154 146 … … 174 166 175 167 // Locate to the correct directory 176 var startDir;177 168 var dreg = new RegExp('^(.*/)([^/]+)$'); 178 169 if (dreg.test(param['f_href'])) … … 186 177 } 187 178 188 if (startDir)189 {190 changeDir(startDir);191 var dirPath = document.getElementById('dirPath');192 for(var i = 0; i < dirPath.options.length; i++)193 {194 if(dirPath.options[i].value == encodeURIComponent(RegExp.$1))195 {196 dirPath.options[i].selected = true;197 break;198 }199 }200 }201 202 179 if (param) 203 180 { … … 238 215 else if (!param) 239 216 { 240 varstartDir = document.cookie.match(new RegExp ("EFMStartDir" + manager_mode + "=(.*?)(;|$)"));217 startDir = document.cookie.match(new RegExp ("EFMStartDir" + manager_mode + "=(.*?)(;|$)")); 241 218 if (startDir) 242 219 { 243 220 startDir = startDir[1]; 244 changeDir(startDir);245 var dirPath = document.getElementById('dirPath');246 for(var i = 0; i < dirPath.options.length; i++)247 {248 if(dirPath.options[i].value == encodeURIComponent(startDir))249 {250 dirPath.options[i].selected = true;251 break;252 }253 }254 221 } 255 222 } 223 if ( startDir ) 224 { 225 iframeUrl += '&dir=' + startDir; 226 var dirPath = document.getElementById('dirPath'); 227 for(var i = 0; i < dirPath.options.length; i++) 228 { 229 if(dirPath.options[i].value == encodeURIComponent(startDir)) 230 { 231 dirPath.options[i].selected = true; 232 break; 233 } 234 } 235 }; 236 imgManager.location.replace(iframeUrl); 237 256 238 if (manager_mode == 'image' && typeof Xinha.colorPicker != "undefined" && document.getElementById('f_backgroundColor') && document.getElementById('f_backgroundColor').type == 'text') { 257 239 // Hookup color pickers … … 267 249 new Xinha.colorPicker.InputBinding(document.getElementById('f_borderColor'),pickerConfig); 268 250 } 251 setTimeout(function() { resize();addEvent(window, 'resize', resize); }, 500); 269 252 } 270 253 … … 566 549 { 567 550 var win = Xinha.viewportSize(window); 568 document.getElementById('imgManager').style.height = parseInt( win.y - 130 - offsetForInputs, 10 ) + 'px'; 569 551 var m = document.getElementById('messages'); 552 var messagesHeight = (m && m.style.display != 'none' ) ? parseInt( document.getElementById('messages').offsetHeight, 10 ) : 0; 553 document.getElementById('imgManager').style.height = parseInt( win.y - 130 - document.getElementById('controls').offsetHeight, 10 ) - messagesHeight + 'px'; 570 554 return true; 571 555 } 572 addEvent(window, 'resize', resize); 573 if (Xinha.is_gecko) 574 {// this runs the init function (translation) before all the images in the iframe have loaded 575 document.addEventListener("DOMContentLoaded", init, false); 576 } 577 else 578 { 579 addEvent(window, 'load', init); 580 } 556 557 Xinha.addOnloadHandler( init, window ); -
branches/ray/plugins/ExtendedFileManager/assets/popup.js
r802 r975 16 16 opener.Dialog._return(null); 17 17 } 18 function __dlg_init( bottom, win_dim ) { 19 __xinha_dlg_init(win_dim); 20 } 18 21 22 function __xinha_dlg_init( win_dim ) { 23 if(window.__dlg_init_done) return true; 24 25 if(window.opener._editor_skin) { 26 var head = document.getElementsByTagName("head")[0]; 27 var link = document.createElement("link"); 28 link.type = "text/css"; 29 link.href = window.opener._editor_url + 'skins/' + window.opener._editor_skin + '/skin.css'; 30 link.rel = "stylesheet"; 31 head.appendChild(link); 32 } 33 if (!window.dialogArguments && opener.Dialog._arguments) 34 { 35 window.dialogArguments = opener.Dialog._arguments; 36 } 37 38 Xinha.addDom0Event(document.body, 'keypress', __dlg_close_on_esc); 39 window.__dlg_init_done = true; 40 } 19 41 function __dlg_translate(context) { 20 42 var types = ["span", "option", "td", "th", "button", "div", "label", "a","img", "legend"]; -
branches/ray/plugins/ExtendedFileManager/assets/wz_jsgraphics.js
r761 r975 1 1 /*********************************************************************** 2 ** Title.........: Javascript Graphics3 ** Version.......: 1.04 ** Author........: Xiang Wei ZHUO <wei@zhuo.org>5 2 ** Filename......: wz_jsgraphics.js 6 ** Last changed..: 31 Aug 20037 ** Notes.........: Modified for Image Editor, added extra commands3 ** Last changed..: 2 November 2007 by Raimund Meyer updated to new version 4 ** Notes.........: Modified by Xiang Wei ZHUO <wei@zhuo.org> for Image Editor, added extra commands l. 690-740 8 5 **/ 9 6 10 7 /* This notice must be untouched at all times. 11 8 12 wz_jsgraphics.js v. 2.039 wz_jsgraphics.js v. 3.02 13 10 The latest version is available at 14 11 http://www.walterzorn.com … … 16 13 or http://www.walterzorn.de 17 14 18 Copyright (c) 2002-2003 Walter Zorn. All rights reserved. 19 Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de> 20 Last modified: 11. 6. 2003 15 Copyright (c) 2002-2004 Walter Zorn. All rights reserved. 16 Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) 17 Last modified: 26. 10. 2007 18 19 Performance optimizations for Internet Explorer 20 by Thomas Frank and John Holdsworth. 21 fillPolygon method implemented by Matthieu Haller. 21 22 22 23 High Performance JavaScript Graphics Library. 23 24 Provides methods 24 25 - to draw lines, rectangles, ellipses, polygons 25 with specifiable line thickness,26 - to fill rectangles and ellipses26 with specifiable line thickness, 27 - to fill rectangles, polygons, ellipses and arcs 27 28 - to draw text. 28 29 NOTE: Operations, functions and branching have rather been optimized 29 30 to efficiency and speed than to shortness of source code. 30 31 31 This program is free software; 32 you can redistribute it and/or modify it under the terms of the 33 GNU General Public License as published by the Free Software Foundation; 34 either version 2 of the License, or (at your option) any later version. 35 This program is distributed in the hope that it will be useful, 36 but WITHOUT ANY WARRANTY; 37 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 38 See the GNU General Public License 39 at http://www.gnu.org/copyleft/gpl.html for more details. 32 LICENSE: LGPL 33 34 This library is free software; you can redistribute it and/or 35 modify it under the terms of the GNU Lesser General Public 36 License (LGPL) as published by the Free Software Foundation; either 37 version 2.1 of the License, or (at your option) any later version. 38 39 This library is distributed in the hope that it will be useful, 40 but WITHOUT ANY WARRANTY; without even the implied warranty of 41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 42 Lesser General Public License for more details. 43 44 You should have received a copy of the GNU Lesser General Public 45 License along with this library; if not, write to the Free Software 46 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, 47 or see http://www.gnu.org/copyleft/lesser.html 40 48 */ 41 49 42 var jg_ihtm, jg_ie, jg_dom, jg_n4 = (document.layers && typeof document.classes != "undefined"); 43 44 function chkDHTM(x, i) 45 { 46 x = document.body || null; 47 jg_ie = (x && typeof x.insertAdjacentHTML != "undefined"); 48 jg_dom = (x && !jg_ie && 49 typeof x.appendChild != "undefined" && 50 typeof document.createRange != "undefined" && 51 typeof (i = document.createRange()).setStartBefore != "undefined" && 52 typeof i.createContextualFragment != "undefined"); 53 jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"); 54 } 55 56 function pntDoc() 57 { 58 this.wnd.document.write(this.htm); 59 this.htm = ''; 60 } 61 62 function pntCnvDom() 63 { 64 var x = document.createRange(); 65 x.setStartBefore(this.cnv); 66 x = x.createContextualFragment(this.htm); 67 this.cnv.appendChild(x); 68 this.htm = ''; 69 } 70 71 function pntCnvIe() 72 { 73 this.cnv.insertAdjacentHTML("BeforeEnd", this.htm); 74 this.htm = ''; 75 } 76 77 function pntCnvIhtm() 78 { 79 this.cnv.innerHTML += this.htm; 80 this.htm = ''; 81 } 82 83 function pntCnv() 84 { 85 this.htm = ''; 86 } 87 88 function mkDiv(x, y, w, h) 89 { 90 this.htm += '<div style="position:absolute;'+ 91 'left:' + x + 'px;'+ 92 'top:' + y + 'px;'+ 93 'width:' + w + 'px;'+ 94 'height:' + h + 'px;'+ 95 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 96 'overflow:hidden;background-color:' + this.color + ';'+ 97 '"><\/div>'; 98 99 //alert(this.htm); 100 } 101 102 function mkDivPrint(x, y, w, h) 103 { 104 this.htm += '<div style="position:absolute;'+ 105 'border-left:' + w + 'px solid ' + this.color + ';'+ 106 'left:' + x + 'px;'+ 107 'top:' + y + 'px;'+ 108 'width:' + w + 'px;'+ 109 'height:' + h + 'px;'+ 110 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 111 'overflow:hidden;background-color:' + this.color + ';'+ 112 '"><\/div>'; 113 } 114 115 function mkLyr(x, y, w, h) 116 { 117 this.htm += '<layer '+ 118 'left="' + x + '" '+ 119 'top="' + y + '" '+ 120 'width="' + w + '" '+ 121 'height="' + h + '" '+ 122 'bgcolor="' + this.color + '"><\/layer>\n'; 123 } 124 125 function mkLbl(txt, x, y) 126 { 127 this.htm += '<div style="position:absolute;white-space:nowrap;'+ 128 'left:' + x + 'px;'+ 129 'top:' + y + 'px;'+ 130 'font-family:' + this.ftFam + ';'+ 131 'font-size:' + this.ftSz + ';'+ 132 'color:' + this.color + ';' + this.ftSty + '">'+ 133 txt + 134 '<\/div>'; 135 } 136 137 function mkLin(x1, y1, x2, y2) 138 { 139 if (x1 > x2) 140 { 141 var _x2 = x2; 142 var _y2 = y2; 143 x2 = x1; 144 y2 = y1; 145 x1 = _x2; 146 y1 = _y2; 147 } 148 var dx = x2-x1, dy = Math.abs(y2-y1), 149 x = x1, y = y1, 150 yIncr = (y1 > y2)? -1 : 1; 151 152 if (dx >= dy) 153 { 154 var pr = dy<<1, 155 pru = pr - (dx<<1), 156 p = pr-dx, 157 ox = x; 158 while ((dx--) > 0) 159 { 160 ++x; 161 if (p > 0) 162 { 163 this.mkDiv(ox, y, x-ox, 1); 164 y += yIncr; 165 p += pru; 166 ox = x; 167 } 168 else p += pr; 169 } 170 this.mkDiv(ox, y, x2-ox+1, 1); 171 } 172 173 else 174 { 175 var pr = dx<<1, 176 pru = pr - (dy<<1), 177 p = pr-dy, 178 oy = y; 179 if (y2 <= y1) 180 { 181 while ((dy--) > 0) 182 { 183 if (p > 0) 184 { 185 this.mkDiv(x++, y, 1, oy-y+1); 186 y += yIncr; 187 p += pru; 188 oy = y; 189 } 190 else 191 { 192 y += yIncr; 193 p += pr; 194 } 195 } 196 this.mkDiv(x2, y2, 1, oy-y2+1); 197 } 198 else 199 { 200 while ((dy--) > 0) 201 { 202 y += yIncr; 203 if (p > 0) 204 { 205 this.mkDiv(x++, oy, 1, y-oy); 206 p += pru; 207 oy = y; 208 } 209 else p += pr; 210 } 211 this.mkDiv(x2, oy, 1, y2-oy+1); 212 } 213 } 214 } 215 216 function mkLin2D(x1, y1, x2, y2) 217 { 218 if (x1 > x2) 219 { 220 var _x2 = x2; 221 var _y2 = y2; 222 x2 = x1; 223 y2 = y1; 224 x1 = _x2; 225 y1 = _y2; 226 } 227 var dx = x2-x1, dy = Math.abs(y2-y1), 228 x = x1, y = y1, 229 yIncr = (y1 > y2)? -1 : 1; 230 231 232 var s = this.stroke; 233 if (dx >= dy) 234 { 235 if (s-0x3 > 0) 236 { 237 var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; 238 _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1; 239 } 240 else var _s = s; 241 var ad = Math.ceil(s/2); 242 243 var pr = dy<<1, 244 pru = pr - (dx<<1), 245 p = pr-dx, 246 ox = x; 247 while ((dx--) > 0) 248 { 249 ++x; 250 if (p > 0) 251 { 252 this.mkDiv(ox, y, x-ox+ad, _s); 253 y += yIncr; 254 p += pru; 255 ox = x; 256 } 257 else p += pr; 258 } 259 this.mkDiv(ox, y, x2-ox+ad+1, _s); 260 } 261 262 else 263 { 264 if (s-0x3 > 0) 265 { 266 var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; 267 _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1; 268 } 269 else var _s = s; 270 var ad = Math.round(s/2); 271 272 var pr = dx<<1, 273 pru = pr - (dy<<1), 274 p = pr-dy, 275 oy = y; 276 if (y2 <= y1) 277 { 278 ++ad; 279 while ((dy--) > 0) 280 { 281 if (p > 0) 282 { 283 this.mkDiv(x++, y, _s, oy-y+ad); 284 y += yIncr; 285 p += pru; 286 oy = y; 287 } 288 else 289 { 290 y += yIncr; 291 p += pr; 292 } 293 } 294 this.mkDiv(x2, y2, _s, oy-y2+ad); 295 } 296 else 297 { 298 while ((dy--) > 0) 299 { 300 y += yIncr; 301 if (p > 0) 302 { 303 this.mkDiv(x++, oy, _s, y-oy+ad); 304 p += pru; 305 oy = y; 306 } 307 else p += pr; 308 } 309 this.mkDiv(x2, oy, _s, y2-oy+ad+1); 310 } 311 } 312 } 313 314 function mkLinDott(x1, y1, x2, y2) 315 { 316 if (x1 > x2) 317 { 318 var _x2 = x2; 319 var _y2 = y2; 320 x2 = x1; 321 y2 = y1; 322 x1 = _x2; 323 y1 = _y2; 324 } 325 var dx = x2-x1, dy = Math.abs(y2-y1), 326 x = x1, y = y1, 327 yIncr = (y1 > y2)? -1 : 1, 328 drw = true; 329 if (dx >= dy) 330 { 331 var pr = dy<<1, 332 pru = pr - (dx<<1), 333 p = pr-dx; 334 while ((dx--) > 0) 335 { 336 if (drw) this.mkDiv(x, y, 1, 1); 337 drw = !drw; 338 if (p > 0) 339 { 340 y += yIncr; 341 p += pru; 342 } 343 else p += pr; 344 ++x; 345 } 346 if (drw) this.mkDiv(x, y, 1, 1); 347 } 348 349 else 350 { 351 var pr = dx<<1, 352 pru = pr - (dy<<1), 353 p = pr-dy; 354 while ((dy--) > 0) 355 { 356 if (drw) this.mkDiv(x, y, 1, 1); 357 drw = !drw; 358 y += yIncr; 359 if (p > 0) 360 { 361 ++x; 362 p += pru; 363 } 364 else p += pr; 365 } 366 if (drw) this.mkDiv(x, y, 1, 1); 367 } 368 } 369 370 function mkOv(left, top, width, height) 371 { 372 var a = width>>1, b = height>>1, 373 wod = width&1, hod = (height&1)+1, 374 cx = left+a, cy = top+b, 375 x = 0, y = b, 376 ox = 0, oy = b, 377 aa = (a*a)<<1, bb = (b*b)<<1, 378 st = (aa>>1)*(1-(b<<1)) + bb, 379 tt = (bb>>1) - aa*((b<<1)-1), 380 w, h; 381 while (y > 0) 382 { 383 if (st < 0) 384 { 385 st += bb*((x<<1)+0x3); 386 tt += (bb<<1)*(++x); 387 } 388 else if (tt < 0) 389 { 390 st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); 391 tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); 392 w = x-ox; 393 h = oy-y; 394 if (w&0x2 && h&0x2) 395 { 396 this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1); 397 this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); 398 } 399 else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); 400 ox = x; 401 oy = y; 402 } 403 else 404 { 405 tt -= aa*((y<<1)-0x3); 406 st -= (aa<<1)*(--y); 407 } 408 } 409 this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); 410 this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); 411 } 412 413 function mkOv2D(left, top, width, height) 414 { 415 var s = this.stroke; 416 width += s-1; 417 height += s-1; 418 var a = width>>1, b = height>>1, 419 wod = width&1, hod = (height&1)+1, 420 cx = left+a, cy = top+b, 421 x = 0, y = b, 422 aa = (a*a)<<1, bb = (b*b)<<1, 423 st = (aa>>1)*(1-(b<<1)) + bb, 424 tt = (bb>>1) - aa*((b<<1)-1); 425 426 427 if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0)) 428 { 429 var ox = 0, oy = b, 430 w, h, 431 pxl, pxr, pxt, pxb, pxw; 432 while (y > 0) 433 { 434 if (st < 0) 435 { 436 st += bb*((x<<1)+0x3); 437 tt += (bb<<1)*(++x); 438 } 439 else if (tt < 0) 440 { 441 st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); 442 tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); 443 w = x-ox; 444 h = oy-y; 445 446 if (w-1) 447 { 448 pxw = w+1+(s&1); 449 h = s; 450 } 451 else if (h-1) 452 { 453 pxw = s; 454 h += 1+(s&1); 455 } 456 else pxw = h = s; 457 this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); 458 ox = x; 459 oy = y; 460 } 461 else 462 { 463 tt -= aa*((y<<1)-0x3); 464 st -= (aa<<1)*(--y); 465 } 466 } 467 this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); 468 this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); 469 } 470 471 472 else 473 { 474 var _a = (width-((s-1)<<1))>>1, 475 _b = (height-((s-1)<<1))>>1, 476 _x = 0, _y = _b, 477 _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, 478 _st = (_aa>>1)*(1-(_b<<1)) + _bb, 479 _tt = (_bb>>1) - _aa*((_b<<1)-1), 480 481 pxl = new Array(), 482 pxt = new Array(), 483 _pxb = new Array(); 484 pxl[0] = 0; 485 pxt[0] = b; 486 _pxb[0] = _b-1; 487 while (y > 0) 488 { 489 if (st < 0) 490 { 491 st += bb*((x<<1)+0x3); 492 tt += (bb<<1)*(++x); 493 pxl[pxl.length] = x; 494 pxt[pxt.length] = y; 495 } 496 else if (tt < 0) 497 { 498 st += bb*((x<<1)+0x3) - (aa<<1)*(y-1); 499 tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3); 500 pxl[pxl.length] = x; 501 pxt[pxt.length] = y; 502 } 503 else 504 { 505 tt -= aa*((y<<1)-0x3); 506 st -= (aa<<1)*(--y); 507 } 508 509 if (_y > 0) 510 { 511 if (_st < 0) 512 { 513 _st += _bb*((_x<<1)+0x3); 514 _tt += (_bb<<1)*(++_x); 515 _pxb[_pxb.length] = _y-1; 516 } 517 else if (_tt < 0) 518 { 519 _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1); 520 _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3); 521 _pxb[_pxb.length] = _y-1; 522 } 523 else 524 { 525 _tt -= _aa*((_y<<1)-0x3); 526 _st -= (_aa<<1)*(--_y); 527 _pxb[_pxb.length-1]--; 528 } 529 } 530 } 531 532 var ox = 0, oy = b, 533 _oy = _pxb[0], 534 l = pxl.length, 535 w, h; 536 for (var i = 0; i < l; i++) 537 { 538 if (typeof _pxb[i] != "undefined") 539 { 540 if (_pxb[i] < _oy || pxt[i] < oy) 541 { 542 x = pxl[i]; 543 this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); 544 ox = x; 545 oy = pxt[i]; 546 _oy = _pxb[i]; 547 } 548 } 549 else 550 { 551 x = pxl[i]; 552 this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); 553 this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); 554 ox = x; 555 oy = pxt[i]; 556 } 557 } 558 this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); 559 this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); 560 } 561 } 562 563 function mkOvDott(left, top, width, height) 564 { 565 var a = width>>1, b = height>>1, 566 wod = width&1, hod = height&1, 567 cx = left+a, cy = top+b, 568 x = 0, y = b, 569 aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, 570 st = (aa2>>1)*(1-(b<<1)) + bb, 571 tt = (bb>>1) - aa2*((b<<1)-1), 572 drw = true; 573 while (y > 0) 574 { 575 if (st < 0) 576 { 577 st += bb*((x<<1)+0x3); 578 tt += (bb<<1)*(++x); 579 } 580 else if (tt < 0) 581 { 582 st += bb*((x<<1)+0x3) - aa4*(y-1); 583 tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3); 584 } 585 else 586 { 587 tt -= aa2*((y<<1)-0x3); 588 st -= aa4*(--y); 589 } 590 if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); 591 drw = !drw; 592 } 593 } 594 595 function mkRect(x, y, w, h) 596 { 597 var s = this.stroke; 598 this.mkDiv(x, y, w, s); 599 this.mkDiv(x+w, y, s, h); 600 this.mkDiv(x, y+h, w+s, s); 601 this.mkDiv(x, y+s, s, h-s); 602 } 603 604 function mkRectDott(x, y, w, h) 605 { 606 this.drawLine(x, y, x+w, y); 607 this.drawLine(x+w, y, x+w, y+h); 608 this.drawLine(x, y+h, x+w, y+h); 609 this.drawLine(x, y, x, y+h); 50 51 var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz; 52 53 54 function _chkDHTM(x, i) 55 { 56 x = document.body || null; 57 jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && document.createElement; 58 jg_dom = (x && !jg_ie && 59 typeof x.appendChild != "undefined" && 60 typeof document.createRange != "undefined" && 61 typeof (i = document.createRange()).setStartBefore != "undefined" && 62 typeof i.createContextualFragment != "undefined"); 63 jg_fast = jg_ie && document.all && !window.opera; 64 jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; 65 jg_ok = !!(jg_ie || jg_dom); 66 } 67 68 function _pntCnvDom() 69 { 70 var x = this.wnd.document.createRange(); 71 x.setStartBefore(this.cnv); 72 x = x.createContextualFragment(jg_fast? this._htmRpc() : this.htm); 73 if(this.cnv) this.cnv.appendChild(x); 74 this.htm = ""; 75 } 76 77 function _pntCnvIe() 78 { 79 if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this._htmRpc() : this.htm); 80 this.htm = ""; 81 } 82 83 function _pntDoc() 84 { 85 this.wnd.document.write(jg_fast? this._htmRpc() : this.htm); 86 this.htm = ''; 87 } 88 89 function _pntN() 90 { 91 ; 92 } 93 94 function _mkDiv(x, y, w, h) 95 { 96 this.htm += '<div style="position:absolute;'+ 97 'left:' + x + 'px;'+ 98 'top:' + y + 'px;'+ 99 'width:' + w + 'px;'+ 100 'height:' + h + 'px;'+ 101 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 102 'background-color:' + this.color + 103 (!jg_moz? ';overflow:hidden' : '')+ 104 ';"><\/div>'; 105 } 106 107 function _mkDivIe(x, y, w, h) 108 { 109 this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; 110 } 111 112 function _mkDivPrt(x, y, w, h) 113 { 114 this.htm += '<div style="position:absolute;'+ 115 'border-left:' + w + 'px solid ' + this.color + ';'+ 116 'left:' + x + 'px;'+ 117 'top:' + y + 'px;'+ 118 'width:0px;'+ 119 'height:' + h + 'px;'+ 120 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 121 'background-color:' + this.color + 122 (!jg_moz? ';overflow:hidden' : '')+ 123 ';"><\/div>'; 124 } 125 126 var _regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; 127 function _htmRpc() 128 { 129 return this.htm.replace( 130 _regex, 131 '<div style="overflow:hidden;position:absolute;background-color:'+ 132 '$1;left:$2;top:$3;width:$4;height:$5"></div>\n'); 133 } 134 135 function _htmPrtRpc() 136 { 137 return this.htm.replace( 138 _regex, 139 '<div style="overflow:hidden;position:absolute;background-color:'+ 140 '$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n'); 141 } 142 143 function _mkLin(x1, y1, x2, y2) 144 { 145 if(x1 > x2) 146 { 147 var _x2 = x2; 148 var _y2 = y2; 149 x2 = x1; 150 y2 = y1; 151 x1 = _x2; 152 y1 = _y2; 153 } 154 var dx = x2-x1, dy = Math.abs(y2-y1), 155 x = x1, y = y1, 156 yIncr = (y1 > y2)? -1 : 1; 157 158 if(dx >= dy) 159 { 160 var pr = dy<<1, 161 pru = pr - (dx<<1), 162 p = pr-dx, 163 ox = x; 164 while(dx > 0) 165 {--dx; 166 ++x; 167 if(p > 0) 168 { 169 this._mkDiv(ox, y, x-ox, 1); 170 y += yIncr; 171 p += pru; 172 ox = x; 173 } 174 else p += pr; 175 } 176 this._mkDiv(ox, y, x2-ox+1, 1); 177 } 178 179 else 180 { 181 var pr = dx<<1, 182 pru = pr - (dy<<1), 183 p = pr-dy, 184 oy = y; 185 if(y2 <= y1) 186 { 187 while(dy > 0) 188 {--dy; 189 if(p > 0) 190 { 191 this._mkDiv(x++, y, 1, oy-y+1); 192 y += yIncr; 193 p += pru; 194 oy = y; 195 } 196 else 197 { 198 y += yIncr; 199 p += pr; 200 } 201 } 202 this._mkDiv(x2, y2, 1, oy-y2+1); 203 } 204 else 205 { 206 while(dy > 0) 207 {--dy; 208 y += yIncr; 209 if(p > 0) 210 { 211 this._mkDiv(x++, oy, 1, y-oy); 212 p += pru; 213 oy = y; 214 } 215 else p += pr; 216 } 217 this._mkDiv(x2, oy, 1, y2-oy+1); 218 } 219 } 220 } 221 222 function _mkLin2D(x1, y1, x2, y2) 223 { 224 if(x1 > x2) 225 { 226 var _x2 = x2; 227 var _y2 = y2; 228 x2 = x1; 229 y2 = y1; 230 x1 = _x2; 231 y1 = _y2; 232 } 233 var dx = x2-x1, dy = Math.abs(y2-y1), 234 x = x1, y = y1, 235 yIncr = (y1 > y2)? -1 : 1; 236 237 var s = this.stroke; 238 if(dx >= dy) 239 { 240 if(dx > 0 && s-3 > 0) 241 { 242 var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; 243 _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; 244 } 245 else var _s = s; 246 var ad = Math.ceil(s/2); 247 248 var pr = dy<<1, 249 pru = pr - (dx<<1), 250 p = pr-dx, 251 ox = x; 252 while(dx > 0) 253 {--dx; 254 ++x; 255 if(p > 0) 256 { 257 this._mkDiv(ox, y, x-ox+ad, _s); 258 y += yIncr; 259 p += pru; 260 ox = x; 261 } 262 else p += pr; 263 } 264 this._mkDiv(ox, y, x2-ox+ad+1, _s); 265 } 266 267 else 268 { 269 if(s-3 > 0) 270 { 271 var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; 272 _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; 273 } 274 else var _s = s; 275 var ad = Math.round(s/2); 276 277 var pr = dx<<1, 278 pru = pr - (dy<<1), 279 p = pr-dy, 280 oy = y; 281 if(y2 <= y1) 282 { 283 ++ad; 284 while(dy > 0) 285 {--dy; 286 if(p > 0) 287 { 288 this._mkDiv(x++, y, _s, oy-y+ad); 289 y += yIncr; 290 p += pru; 291 oy = y; 292 } 293 else 294 { 295 y += yIncr; 296 p += pr; 297 } 298 } 299 this._mkDiv(x2, y2, _s, oy-y2+ad); 300 } 301 else 302 { 303 while(dy > 0) 304 {--dy; 305 y += yIncr; 306 if(p > 0) 307 { 308 this._mkDiv(x++, oy, _s, y-oy+ad); 309 p += pru; 310 oy = y; 311 } 312 else p += pr; 313 } 314 this._mkDiv(x2, oy, _s, y2-oy+ad+1); 315 } 316 } 317 } 318 319 function _mkLinDott(x1, y1, x2, y2) 320 { 321 if(x1 > x2) 322 { 323 var _x2 = x2; 324 var _y2 = y2; 325 x2 = x1; 326 y2 = y1; 327 x1 = _x2; 328 y1 = _y2; 329 } 330 var dx = x2-x1, dy = Math.abs(y2-y1), 331 x = x1, y = y1, 332 yIncr = (y1 > y2)? -1 : 1, 333 drw = true; 334 if(dx >= dy) 335 { 336 var pr = dy<<1, 337 pru = pr - (dx<<1), 338 p = pr-dx; 339 while(dx > 0) 340 {--dx; 341 if(drw) this._mkDiv(x, y, 1, 1); 342 drw = !drw; 343 if(p > 0) 344 { 345 y += yIncr; 346 p += pru; 347 } 348 else p += pr; 349 ++x; 350 } 351 } 352 else 353 { 354 var pr = dx<<1, 355 pru = pr - (dy<<1), 356 p = pr-dy; 357 while(dy > 0) 358 {--dy; 359 if(drw) this._mkDiv(x, y, 1, 1); 360 drw = !drw; 361 y += yIncr; 362 if(p > 0) 363 { 364 ++x; 365 p += pru; 366 } 367 else p += pr; 368 } 369 } 370 if(drw) this._mkDiv(x, y, 1, 1); 371 } 372 373 function _mkOv(left, top, width, height) 374 { 375 var a = (++width)>>1, b = (++height)>>1, 376 wod = width&1, hod = height&1, 377 cx = left+a, cy = top+b, 378 x = 0, y = b, 379 ox = 0, oy = b, 380 aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, 381 st = (aa2>>1)*(1-(b<<1)) + bb2, 382 tt = (bb2>>1) - aa2*((b<<1)-1), 383 w, h; 384 while(y > 0) 385 { 386 if(st < 0) 387 { 388 st += bb2*((x<<1)+3); 389 tt += bb4*(++x); 390 } 391 else if(tt < 0) 392 { 393 st += bb2*((x<<1)+3) - aa4*(y-1); 394 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 395 w = x-ox; 396 h = oy-y; 397 if((w&2) && (h&2)) 398 { 399 this._mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod); 400 this._mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod); 401 } 402 else this._mkOvQds(cx, cy, x-1, oy, w, h, wod, hod); 403 ox = x; 404 oy = y; 405 } 406 else 407 { 408 tt -= aa2*((y<<1)-3); 409 st -= aa4*(--y); 410 } 411 } 412 w = a-ox+1; 413 h = (oy<<1)+hod; 414 y = cy-oy; 415 this._mkDiv(cx-a, y, w, h); 416 this._mkDiv(cx+ox+wod-1, y, w, h); 417 } 418 419 function _mkOv2D(left, top, width, height) 420 { 421 var s = this.stroke; 422 width += s+1; 423 height += s+1; 424 var a = width>>1, b = height>>1, 425 wod = width&1, hod = height&1, 426 cx = left+a, cy = top+b, 427 x = 0, y = b, 428 aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, 429 st = (aa2>>1)*(1-(b<<1)) + bb2, 430 tt = (bb2>>1) - aa2*((b<<1)-1); 431 432 if(s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) 433 { 434 var ox = 0, oy = b, 435 w, h, 436 pxw; 437 while(y > 0) 438 { 439 if(st < 0) 440 { 441 st += bb2*((x<<1)+3); 442 tt += bb4*(++x); 443 } 444 else if(tt < 0) 445 { 446 st += bb2*((x<<1)+3) - aa4*(y-1); 447 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 448 w = x-ox; 449 h = oy-y; 450 451 if(w-1) 452 { 453 pxw = w+1+(s&1); 454 h = s; 455 } 456 else if(h-1) 457 { 458 pxw = s; 459 h += 1+(s&1); 460 } 461 else pxw = h = s; 462 this._mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod); 463 ox = x; 464 oy = y; 465 } 466 else 467 { 468 tt -= aa2*((y<<1)-3); 469 st -= aa4*(--y); 470 } 471 } 472 this._mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); 473 this._mkDiv(cx+a+wod-s, cy-oy, s, (oy<<1)+hod); 474 } 475 476 else 477 { 478 var _a = (width-(s<<1))>>1, 479 _b = (height-(s<<1))>>1, 480 _x = 0, _y = _b, 481 _aa2 = (_a*_a)<<1, _aa4 = _aa2<<1, _bb2 = (_b*_b)<<1, _bb4 = _bb2<<1, 482 _st = (_aa2>>1)*(1-(_b<<1)) + _bb2, 483 _tt = (_bb2>>1) - _aa2*((_b<<1)-1), 484 485 pxl = new Array(), 486 pxt = new Array(), 487 _pxb = new Array(); 488 pxl[0] = 0; 489 pxt[0] = b; 490 _pxb[0] = _b-1; 491 while(y > 0) 492 { 493 if(st < 0) 494 { 495 pxl[pxl.length] = x; 496 pxt[pxt.length] = y; 497 st += bb2*((x<<1)+3); 498 tt += bb4*(++x); 499 } 500 else if(tt < 0) 501 { 502 pxl[pxl.length] = x; 503 st += bb2*((x<<1)+3) - aa4*(y-1); 504 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 505 pxt[pxt.length] = y; 506 } 507 else 508 { 509 tt -= aa2*((y<<1)-3); 510 st -= aa4*(--y); 511 } 512 513 if(_y > 0) 514 { 515 if(_st < 0) 516 { 517 _st += _bb2*((_x<<1)+3); 518 _tt += _bb4*(++_x); 519 _pxb[_pxb.length] = _y-1; 520 } 521 else if(_tt < 0) 522 { 523 _st += _bb2*((_x<<1)+3) - _aa4*(_y-1); 524 _tt += _bb4*(++_x) - _aa2*(((_y--)<<1)-3); 525 _pxb[_pxb.length] = _y-1; 526 } 527 else 528 { 529 _tt -= _aa2*((_y<<1)-3); 530 _st -= _aa4*(--_y); 531 _pxb[_pxb.length-1]--; 532 } 533 } 534 } 535 536 var ox = -wod, oy = b, 537 _oy = _pxb[0], 538 l = pxl.length, 539 w, h; 540 for(var i = 0; i < l; i++) 541 { 542 if(typeof _pxb[i] != "undefined") 543 { 544 if(_pxb[i] < _oy || pxt[i] < oy) 545 { 546 x = pxl[i]; 547 this._mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod); 548 ox = x; 549 oy = pxt[i]; 550 _oy = _pxb[i]; 551 } 552 } 553 else 554 { 555 x = pxl[i]; 556 this._mkDiv(cx-x, cy-oy, 1, (oy<<1)+hod); 557 this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); 558 ox = x; 559 oy = pxt[i]; 560 } 561 } 562 this._mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); 563 this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); 564 } 565 } 566 567 function _mkOvDott(left, top, width, height) 568 { 569 var a = (++width)>>1, b = (++height)>>1, 570 wod = width&1, hod = height&1, hodu = hod^1, 571 cx = left+a, cy = top+b, 572 x = 0, y = b, 573 aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, 574 st = (aa2>>1)*(1-(b<<1)) + bb2, 575 tt = (bb2>>1) - aa2*((b<<1)-1), 576 drw = true; 577 while(y > 0) 578 { 579 if(st < 0) 580 { 581 st += bb2*((x<<1)+3); 582 tt += bb4*(++x); 583 } 584 else if(tt < 0) 585 { 586 st += bb2*((x<<1)+3) - aa4*(y-1); 587 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 588 } 589 else 590 { 591 tt -= aa2*((y<<1)-3); 592 st -= aa4*(--y); 593 } 594 if(drw && y >= hodu) this._mkOvQds(cx, cy, x, y, 1, 1, wod, hod); 595 drw = !drw; 596 } 597 } 598 599 function _mkRect(x, y, w, h) 600 { 601 var s = this.stroke; 602 this._mkDiv(x, y, w, s); 603 this._mkDiv(x+w, y, s, h); 604 this._mkDiv(x, y+h, w+s, s); 605 this._mkDiv(x, y+s, s, h-s); 606 } 607 608 function _mkRectDott(x, y, w, h) 609 { 610 this.drawLine(x, y, x+w, y); 611 this.drawLine(x+w, y, x+w, y+h); 612 this.drawLine(x, y+h, x+w, y+h); 613 this.drawLine(x, y, x, y+h); 610 614 } 611 615 612 616 function jsgFont() 613 617 { 614 this.PLAIN = 'font-weight:normal;';615 this.BOLD = 'font-weight:bold;';616 this.ITALIC = 'font-style:italic;';617 this.ITALIC_BOLD = this.ITALIC + this.BOLD;618 this.BOLD_ITALIC = this.ITALIC_BOLD;618 this.PLAIN = 'font-weight:normal;'; 619 this.BOLD = 'font-weight:bold;'; 620 this.ITALIC = 'font-style:italic;'; 621 this.ITALIC_BOLD = this.ITALIC + this.BOLD; 622 this.BOLD_ITALIC = this.ITALIC_BOLD; 619 623 } 620 624 var Font = new jsgFont(); … … 622 626 function jsgStroke() 623 627 { 624 this.DOTTED = -1; 625 } 626 628 this.DOTTED = -1; 629 } 627 630 var Stroke = new jsgStroke(); 628 631 629 function jsGraphics(id, wnd) 630 { 631 this.setColor = new Function('arg', 'this.color = arg;'); 632 633 632 function jsGraphics(cnv, wnd) 633 { 634 this.setColor = function(x) 635 { 636 this.color = x.toLowerCase(); 637 }; 638 639 this.setStroke = function(x) 640 { 641 this.stroke = x; 642 if(!(x+1)) 643 { 644 this.drawLine = _mkLinDott; 645 this._mkOv = _mkOvDott; 646 this.drawRect = _mkRectDott; 647 } 648 else if(x-1 > 0) 649 { 650 this.drawLine = _mkLin2D; 651 this._mkOv = _mkOv2D; 652 this.drawRect = _mkRect; 653 } 654 else 655 { 656 this.drawLine = _mkLin; 657 this._mkOv = _mkOv; 658 this.drawRect = _mkRect; 659 } 660 }; 661 662 this.setPrintable = function(arg) 663 { 664 this.printable = arg; 665 if(jg_fast) 666 { 667 this._mkDiv = _mkDivIe; 668 this._htmRpc = arg? _htmPrtRpc : _htmRpc; 669 } 670 else this._mkDiv = arg? _mkDivPrt : _mkDiv; 671 }; 672 673 this.setFont = function(fam, sz, sty) 674 { 675 this.ftFam = fam; 676 this.ftSz = sz; 677 this.ftSty = sty || Font.PLAIN; 678 }; 679 680 this.drawPolyline = this.drawPolyLine = function(x, y) 681 { 682 for (var i=x.length - 1; i;) 683 {--i; 684 this.drawLine(x[i], y[i], x[i+1], y[i+1]); 685 } 686 }; 687 /************** Xinha added *******************************************/ 688 689 this.setColor = new Function('arg', 'this.color = arg;'); 634 690 this.getColor = new Function('return this.color'); 635 691 636 this.setStroke = function(x) 637 { 638 this.stroke = x; 639 if (!(x+1)) 640 { 641 this.drawLine = mkLinDott; 642 this.mkOv = mkOvDott; 643 this.drawRect = mkRectDott; 644 } 645 else if (x-1 > 0) 646 { 647 this.drawLine = mkLin2D; 648 this.mkOv = mkOv2D; 649 this.drawRect = mkRect; 650 } 651 else 652 { 653 this.drawLine = mkLin; 654 this.mkOv = mkOv; 655 this.drawRect = mkRect; 656 } 657 }; 658 659 660 661 this.setPrintable = function(arg) 662 { 663 this.printable = arg; 664 this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv; 665 }; 666 667 668 669 this.setFont = function(fam, sz, sty) 670 { 671 this.ftFam = fam; 672 this.ftSz = sz; 673 this.ftSty = sty || Font.PLAIN; 674 }; 675 676 677 678 this.drawPolyline = this.drawPolyLine = function(x, y, s) 679 { 680 var i = x.length-1; while (i >= 0) 681 this.drawLine(x[i], y[i], x[--i], y[i]); 682 }; 683 684 685 686 this.fillRect = function(x, y, w, h) 687 { 688 this.mkDiv(x, y, w, h); 689 }; 690 691 692 this.fillRect = function(x, y, w, h) 693 { 694 this._mkDiv(x, y, w, h); 695 }; 696 692 697 this.fillRectPattern = function(x, y, w, h, url) 693 698 { … … 704 709 'z-index:100;"><\/div>'; 705 710 //alert(this.htm); 706 } 711 }; 707 712 708 713 this.drawHandle = function(x, y, w, h, cursor) … … 718 723 "cursor: '" + cursor + "';"+ 719 724 '" class="handleBox" id="' + cursor + '" ><\/div>'; 720 } 721 722 this.drawHandleBox = function(x, y, w, h, cursor)725 }; 726 727 this.drawHandleBox = function(x, y, w, h, cursor) 723 728 { 724 729 … … 732 737 "cursor: '" + cursor + "';"+ 733 738 '" class="handleBox" id="' + cursor + '" ><\/div>'; 734 735 736 }737 738 this.drawPolygon = function(x, y)739 {740 this.drawPolyline(x, y);741 this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);742 739 }; 743 740 744 745 746 this.drawEllipse = this.drawOval = function(x, y, w, h) 747 { 748 this.mkOv(x, y, w, h); 749 }; 750 751 752 753 this.fillEllipse = this.fillOval = function(left, top, w, h) 754 { 755 var a = (w -= 1)>>1, b = (h -= 1)>>1, 756 wod = (w&1)+1, hod = (h&1)+1, 757 cx = left+a, cy = top+b, 758 x = 0, y = b, 759 ox = 0, oy = b, 760 aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, 761 st = (aa2>>1)*(1-(b<<1)) + bb, 762 tt = (bb>>1) - aa2*((b<<1)-1), 763 pxl, dw, dh; 764 if (w+1) while (y > 0) 765 { 766 if (st < 0) 767 { 768 st += bb*((x<<1)+0x3); 769 tt += (bb<<1)*(++x); 770 } 771 else if (tt < 0) 772 { 773 st += bb*((x<<1)+0x3) - aa4*(y-1); 774 pxl = cx-x; 775 dw = (x<<1)+wod; 776 tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3); 777 dh = oy-y; 778 this.mkDiv(pxl, cy-oy, dw, dh); 779 this.mkDiv(pxl, cy+oy-dh+hod, dw, dh); 780 ox = x; 781 oy = y; 782 } 783 else 784 { 785 tt -= aa2*((y<<1)-0x3); 786 st -= aa4*(--y); 787 } 788 } 789 this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); 790 }; 791 792 this.drawString = mkLbl; 793 794 this.clear = function() 795 { 796 this.htm = ""; 797 if (this.cnv) this.cnv.innerHTML = this.defhtm; 798 799 }; 800 801 this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) 802 { 803 this.mkDiv(xr+cx, yt+cy, w, h); 804 this.mkDiv(xr+cx, yb+cy, w, h); 805 this.mkDiv(xl+cx, yb+cy, w, h); 806 this.mkDiv(xl+cx, yt+cy, w, h); 807 }; 808 809 this.setStroke(1); 810 this.setPrintable(false); 811 this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); 812 this.color = '#000000'; 813 this.htm = ''; 814 this.wnd = wnd || window; 815 816 if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); 817 if (typeof id != 'string' || !id) this.paint = pntDoc; 818 else 819 { 820 this.cnv = document.all? (this.wnd.document.all[id] || null) 821 : document.getElementById? (this.wnd.document.getElementById(id) || null) 822 : null; 823 this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; 824 this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; 825 } 826 } 741 /************** end Xinha added *******************************************/ 742 this.drawPolygon = function(x, y) 743 { 744 this.drawPolyline(x, y); 745 this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]); 746 }; 747 748 this.drawEllipse = this.drawOval = function(x, y, w, h) 749 { 750 this._mkOv(x, y, w, h); 751 }; 752 753 this.fillEllipse = this.fillOval = function(left, top, w, h) 754 { 755 var a = w>>1, b = h>>1, 756 wod = w&1, hod = h&1, 757 cx = left+a, cy = top+b, 758 x = 0, y = b, oy = b, 759 aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, 760 st = (aa2>>1)*(1-(b<<1)) + bb2, 761 tt = (bb2>>1) - aa2*((b<<1)-1), 762 xl, dw, dh; 763 if(w) while(y > 0) 764 { 765 if(st < 0) 766 { 767 st += bb2*((x<<1)+3); 768 tt += bb4*(++x); 769 } 770 else if(tt < 0) 771 { 772 st += bb2*((x<<1)+3) - aa4*(y-1); 773 xl = cx-x; 774 dw = (x<<1)+wod; 775 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 776 dh = oy-y; 777 this._mkDiv(xl, cy-oy, dw, dh); 778 this._mkDiv(xl, cy+y+hod, dw, dh); 779 oy = y; 780 } 781 else 782 { 783 tt -= aa2*((y<<1)-3); 784 st -= aa4*(--y); 785 } 786 } 787 this._mkDiv(cx-a, cy-oy, w, (oy<<1)+hod); 788 }; 789 790 this.fillArc = function(iL, iT, iW, iH, fAngA, fAngZ) 791 { 792 var a = iW>>1, b = iH>>1, 793 iOdds = (iW&1) | ((iH&1) << 16), 794 cx = iL+a, cy = iT+b, 795 x = 0, y = b, ox = x, oy = y, 796 aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, 797 st = (aa2>>1)*(1-(b<<1)) + bb2, 798 tt = (bb2>>1) - aa2*((b<<1)-1), 799 // Vars for radial boundary lines 800 xEndA, yEndA, xEndZ, yEndZ, 801 iSects = (1 << (Math.floor((fAngA %= 360.0)/180.0) << 3)) 802 | (2 << (Math.floor((fAngZ %= 360.0)/180.0) << 3)) 803 | ((fAngA >= fAngZ) << 16), 804 aBndA = new Array(b+1), aBndZ = new Array(b+1); 805 806 // Set up radial boundary lines 807 fAngA *= Math.PI/180.0; 808 fAngZ *= Math.PI/180.0; 809 xEndA = cx+Math.round(a*Math.cos(fAngA)); 810 yEndA = cy+Math.round(-b*Math.sin(fAngA)); 811 _mkLinVirt(aBndA, cx, cy, xEndA, yEndA); 812 xEndZ = cx+Math.round(a*Math.cos(fAngZ)); 813 yEndZ = cy+Math.round(-b*Math.sin(fAngZ)); 814 _mkLinVirt(aBndZ, cx, cy, xEndZ, yEndZ); 815 816 while(y > 0) 817 { 818 if(st < 0) // Advance x 819 { 820 st += bb2*((x<<1)+3); 821 tt += bb4*(++x); 822 } 823 else if(tt < 0) // Advance x and y 824 { 825 st += bb2*((x<<1)+3) - aa4*(y-1); 826 ox = x; 827 tt += bb4*(++x) - aa2*(((y--)<<1)-3); 828 this._mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); 829 oy = y; 830 } 831 else // Advance y 832 { 833 tt -= aa2*((y<<1)-3); 834 st -= aa4*(--y); 835 if(y && (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1])) 836 { 837 this._mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); 838 ox = x; 839 oy = y; 840 } 841 } 842 } 843 this._mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); 844 if(iOdds >> 16) // Odd height 845 { 846 if(iSects >> 16) // Start-angle > end-angle 847 { 848 var xl = (yEndA <= cy || yEndZ > cy)? (cx - x) : cx; 849 this._mkDiv(xl, cy, x + cx - xl + (iOdds & 0xffff), 1); 850 } 851 else if((iSects & 0x01) && yEndZ > cy) 852 this._mkDiv(cx - x, cy, x, 1); 853 } 854 }; 855 856 /* fillPolygon method, implemented by Matthieu Haller. 857 This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. 858 C source of GD 1.8.4 found at http://www.boutell.com/gd/ 859 860 THANKS to Kirsten Schulz for the polygon fixes! 861 862 The intersection finding technique of this code could be improved 863 by remembering the previous intertersection, and by using the slope. 864 That could help to adjust intersections to produce a nice 865 interior_extrema. */ 866 this.fillPolygon = function(array_x, array_y) 867 { 868 var i; 869 var y; 870 var miny, maxy; 871 var x1, y1; 872 var x2, y2; 873 var ind1, ind2; 874 var ints; 875 876 var n = array_x.length; 877 if(!n) return; 878 879 miny = array_y[0]; 880 maxy = array_y[0]; 881 for(i = 1; i < n; i++) 882 { 883 if(array_y[i] < miny) 884 miny = array_y[i]; 885 886 if(array_y[i] > maxy) 887 maxy = array_y[i]; 888 } 889 for(y = miny; y <= maxy; y++) 890 { 891 var polyInts = new Array(); 892 ints = 0; 893 for(i = 0; i < n; i++) 894 { 895 if(!i) 896 { 897 ind1 = n-1; 898 ind2 = 0; 899 } 900 else 901 { 902 ind1 = i-1; 903 ind2 = i; 904 } 905 y1 = array_y[ind1]; 906 y2 = array_y[ind2]; 907 if(y1 < y2) 908 { 909 x1 = array_x[ind1]; 910 x2 = array_x[ind2]; 911 } 912 else if(y1 > y2) 913 { 914 y2 = array_y[ind1]; 915 y1 = array_y[ind2]; 916 x2 = array_x[ind1]; 917 x1 = array_x[ind2]; 918 } 919 else continue; 920 921 // Modified 11. 2. 2004 Walter Zorn 922 if((y >= y1) && (y < y2)) 923 polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); 924 925 else if((y == maxy) && (y > y1) && (y <= y2)) 926 polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); 927 } 928 polyInts.sort(_CompInt); 929 for(i = 0; i < ints; i+=2) 930 this._mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); 931 } 932 }; 933 934 this.drawString = function(txt, x, y) 935 { 936 this.htm += '<div style="position:absolute;white-space:nowrap;'+ 937 'left:' + x + 'px;'+ 938 'top:' + y + 'px;'+ 939 'font-family:' + this.ftFam + ';'+ 940 'font-size:' + this.ftSz + ';'+ 941 'color:' + this.color + ';' + this.ftSty + '">'+ 942 txt + 943 '<\/div>'; 944 }; 945 946 /* drawStringRect() added by Rick Blommers. 947 Allows to specify the size of the text rectangle and to align the 948 text both horizontally (e.g. right) and vertically within that rectangle */ 949 this.drawStringRect = function(txt, x, y, width, halign) 950 { 951 this.htm += '<div style="position:absolute;overflow:hidden;'+ 952 'left:' + x + 'px;'+ 953 'top:' + y + 'px;'+ 954 'width:'+width +'px;'+ 955 'text-align:'+halign+';'+ 956 'font-family:' + this.ftFam + ';'+ 957 'font-size:' + this.ftSz + ';'+ 958 'color:' + this.color + ';' + this.ftSty + '">'+ 959 txt + 960 '<\/div>'; 961 }; 962 963 this.drawImage = function(imgSrc, x, y, w, h, a) 964 { 965 this.htm += '<div style="position:absolute;'+ 966 'left:' + x + 'px;'+ 967 'top:' + y + 'px;'+ 968 'width:' + w + 'px;'+ 969 'height:' + h + 'px;">'+ 970 '<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+ 971 '<\/div>'; 972 }; 973 974 this.clear = function() 975 { 976 this.htm = ""; 977 if(this.cnv) this.cnv.innerHTML = ""; 978 }; 979 980 this._mkOvQds = function(cx, cy, x, y, w, h, wod, hod) 981 { 982 var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h; 983 if(xr > xl+w) 984 { 985 this._mkDiv(xr, yt, w, h); 986 this._mkDiv(xr, yb, w, h); 987 } 988 else 989 w = xr - xl + w; 990 this._mkDiv(xl, yt, w, h); 991 this._mkDiv(xl, yb, w, h); 992 }; 993 994 this._mkArcDiv = function(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects) 995 { 996 var xrDef = cx + x + (iOdds & 0xffff), y2, h = oy - y, xl, xr, w; 997 998 if(!h) h = 1; 999 x = cx - x; 1000 1001 if(iSects & 0xff0000) // Start-angle > end-angle 1002 { 1003 y2 = cy - y - h; 1004 if(iSects & 0x00ff) 1005 { 1006 if(iSects & 0x02) 1007 { 1008 xl = Math.max(x, aBndZ[y]); 1009 w = xrDef - xl; 1010 if(w > 0) this._mkDiv(xl, y2, w, h); 1011 } 1012 if(iSects & 0x01) 1013 { 1014 xr = Math.min(xrDef, aBndA[y]); 1015 w = xr - x; 1016 if(w > 0) this._mkDiv(x, y2, w, h); 1017 } 1018 } 1019 else 1020 this._mkDiv(x, y2, xrDef - x, h); 1021 y2 = cy + y + (iOdds >> 16); 1022 if(iSects & 0xff00) 1023 { 1024 if(iSects & 0x0100) 1025 { 1026 xl = Math.max(x, aBndA[y]); 1027 w = xrDef - xl; 1028 if(w > 0) this._mkDiv(xl, y2, w, h); 1029 } 1030 if(iSects & 0x0200) 1031 { 1032 xr = Math.min(xrDef, aBndZ[y]); 1033 w = xr - x; 1034 if(w > 0) this._mkDiv(x, y2, w, h); 1035 } 1036 } 1037 else 1038 this._mkDiv(x, y2, xrDef - x, h); 1039 } 1040 else 1041 { 1042 if(iSects & 0x00ff) 1043 { 1044 if(iSects & 0x02) 1045 xl = Math.max(x, aBndZ[y]); 1046 else 1047 xl = x; 1048 if(iSects & 0x01) 1049 xr = Math.min(xrDef, aBndA[y]); 1050 else 1051 xr = xrDef; 1052 y2 = cy - y - h; 1053 w = xr - xl; 1054 if(w > 0) this._mkDiv(xl, y2, w, h); 1055 } 1056 if(iSects & 0xff00) 1057 { 1058 if(iSects & 0x0100) 1059 xl = Math.max(x, aBndA[y]); 1060 else 1061 xl = x; 1062 if(iSects & 0x0200) 1063 xr = Math.min(xrDef, aBndZ[y]); 1064 else 1065 xr = xrDef; 1066 y2 = cy + y + (iOdds >> 16); 1067 w = xr - xl; 1068 if(w > 0) this._mkDiv(xl, y2, w, h); 1069 } 1070 } 1071 }; 1072 1073 this.setStroke(1); 1074 this.setFont("verdana,geneva,helvetica,sans-serif", "12px", Font.PLAIN); 1075 this.color = "#000000"; 1076 this.htm = ""; 1077 this.wnd = wnd || window; 1078 1079 if(!jg_ok) _chkDHTM(); 1080 if(jg_ok) 1081 { 1082 if(cnv) 1083 { 1084 if(typeof(cnv) == "string") 1085 this.cont = document.all? (this.wnd.document.all[cnv] || null) 1086 : document.getElementById? (this.wnd.document.getElementById(cnv) || null) 1087 : null; 1088 else if(cnv == window.document) 1089 this.cont = document.getElementsByTagName("body")[0]; 1090 // If cnv is a direct reference to a canvas DOM node 1091 // (option suggested by Andreas Luleich) 1092 else this.cont = cnv; 1093 // Create new canvas inside container DIV. Thus the drawing and clearing 1094 // methods won't interfere with the container's inner html. 1095 // Solution suggested by Vladimir. 1096 this.cnv = this.wnd.document.createElement("div"); 1097 this.cnv.style.fontSize=0; 1098 this.cont.appendChild(this.cnv); 1099 this.paint = jg_dom? _pntCnvDom : _pntCnvIe; 1100 } 1101 else 1102 this.paint = _pntDoc; 1103 } 1104 else 1105 this.paint = _pntN; 1106 1107 this.setPrintable(false); 1108 } 1109 1110 function _mkLinVirt(aLin, x1, y1, x2, y2) 1111 { 1112 var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1), 1113 x = x1, y = y1, 1114 xIncr = (x1 > x2)? -1 : 1, 1115 yIncr = (y1 > y2)? -1 : 1, 1116 p, 1117 i = 0; 1118 if(dx >= dy) 1119 { 1120 var pr = dy<<1, 1121 pru = pr - (dx<<1); 1122 p = pr-dx; 1123 while(dx > 0) 1124 {--dx; 1125 if(p > 0) // Increment y 1126 { 1127 aLin[i++] = x; 1128 y += yIncr; 1129 p += pru; 1130 } 1131 else p += pr; 1132 x += xIncr; 1133 } 1134 } 1135 else 1136 { 1137 var pr = dx<<1, 1138 pru = pr - (dy<<1); 1139 p = pr-dy; 1140 while(dy > 0) 1141 {--dy; 1142 y += yIncr; 1143 aLin[i++] = x; 1144 if(p > 0) // Increment x 1145 { 1146 x += xIncr; 1147 p += pru; 1148 } 1149 else p += pr; 1150 } 1151 } 1152 for(var len = aLin.length, i = len-i; i;) 1153 aLin[len-(i--)] = x; 1154 }; 1155 1156 function _CompInt(x, y) 1157 { 1158 return(x - y); 1159 } 1160 -
branches/ray/plugins/ExtendedFileManager/config.inc.php
r761 r975 26 26 */ 27 27 28 if( empty($insertMode))29 $insertMode="image";28 if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; 29 if(!isset($insertMode)) $insertMode="image"; 30 30 31 31 /** … … 65 65 /* 66 66 The URL to the above path, the web browser needs to be able to see it. 67 It can be protected via .htaccess on apache or directory permissions on IIS, 68 check you web server documentation for futher information on directory protection 69 If this directory needs to be publicly accessiable, remove scripting capabilities 70 for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets 71 in this directory and its subdirectories. 67 Please remove scripting capabilities in this directory 68 for this directory (i.e. disable PHP, Perl, CGI; see .htaccess file in demo_images folder). 72 69 */ 73 70 $IMConfig['images_url'] = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['images_dir']; 74 71 //$IMConfig['files_url'] = 'url/to/files_dir'; 75 72 73 /* 74 Format of the Date Modified in list view. 75 It has to be a string understood by the PHP date() function (for possible values see http://http://php.net/manual/en/function.date.php) 76 */ 77 $IMConfig['date_format'] = "d.m.y H:i"; 76 78 /* 77 79 Possible values: true, false … … 123 125 GD does not require the following definition. 124 126 */ 125 define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); 127 define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); 128 //define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); 126 129 127 130 … … 288 291 "max" - the maximum allowed by the server (the value is retrieved from the server configuration). 289 292 */ 290 $IMConfig['max_filesize_kb_image'] = 200 0000;293 $IMConfig['max_filesize_kb_image'] = 200; 291 294 292 295 $IMConfig['max_filesize_kb_link'] = 5000; -
branches/ray/plugins/ExtendedFileManager/editorFrame.php
r761 r975 5 5 * Version: Updated on 08-01-2005 by Afru 6 6 * Version: Updated on 21-06-2006 by Krzysztof Kotowicz 7 * Package: ExtendedFileManager (EFM 1.1.1) 7 * Version: Updated on 20-01-2008 by Raimund Meyer 8 * Package: ExtendedFileManager (EFM 1.4) 8 9 * http://www.afrusoft.com/htmlarea 9 10 */ … … 38 39 39 40 var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure 40 41 var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; 41 var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; 42 var fileSize = "<?php echo (round($imageInfo['filesize'] / 1024,1)).' KB' ?>"; 43 42 44 43 45 <?php if ($editor->isFileSaved() == 1) { ?> -
branches/ray/plugins/ExtendedFileManager/extended-file-manager.js
r892 r975 1 1 /** 2 2 * ExtendedFileManager extended-file-manager.js file. 3 * Authors: Wei Zhuo, Afru 3 * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer 4 4 * Modified by: Krzysztof Kotowicz <koto@webworkers.pl> 5 5 * Version: Updated on 08-01-2005 by Afru 6 6 * Version: Modified on 20-06-2006 by Krzysztof Kotowicz 7 * Package: ExtendedFileManager (EFM 1.1.1) 8 * http://www.afrusoft.com/htmlarea 7 * Version: Updated on 29-10-2006 by Raimund Meyer 8 * Version: Updated on 20-01-2008 by Raimund Meyer 9 * Package: ExtendedFileManager (EFM 1.4) 9 10 */ 10 11 … … 35 36 cfg.addToolbarElement("linkfile", "createlink", 1); 36 37 }; 37 } 38 39 var manager = editor.config.ExtendedFileManager.backend + '__function=manager'; 40 if(cfg.ExtendedFileManager.backend_config != null) 41 { 42 manager += '&backend_config=' 43 + encodeURIComponent(cfg.ExtendedFileManager.backend_config); 44 manager += '&backend_config_hash=' 45 + encodeURIComponent(cfg.ExtendedFileManager.backend_config_hash); 46 manager += '&backend_config_secret_key_location=' 47 + encodeURIComponent(cfg.ExtendedFileManager.backend_config_secret_key_location); 48 } 49 50 if(cfg.ExtendedFileManager.backend_data != null) 51 { 52 for ( var i in cfg.ExtendedFileManager.backend_data ) 53 { 54 manager += '&' + i + '=' + encodeURIComponent(cfg.ExtendedFileManager.backend_data[i]); 55 } 56 } 57 cfg.ExtendedFileManager.manager = manager; 58 } 38 59 39 60 ExtendedFileManager._pluginInfo = { 40 61 name : "ExtendedFileManager", 41 version : "1. 1.1",42 developer : "Afru, Krzysztof Kotowicz ",43 developer_url : "http:// www.afrusoft.com/htmlarea/",62 version : "1.4", 63 developer : "Afru, Krzysztof Kotowicz, Raimund Meyer", 64 developer_url : "http://xinha.org", 44 65 license : "htmlArea" 45 66 }; … … 97 118 98 119 } 99 100 var manager = editor.config.ExtendedFileManager.backend + '__function=manager'; 101 if(editor.config.ExtendedFileManager.backend_config != null) 102 { 103 manager += '&backend_config=' 104 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config); 105 manager += '&backend_config_hash=' 106 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config_hash); 107 manager += '&backend_config_secret_key_location=' 108 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config_secret_key_location); 109 } 110 111 if(editor.config.ExtendedFileManager.backend_data != null) 112 { 113 for ( var i in editor.config.ExtendedFileManager.backend_data ) 114 { 115 manager += '&' + i + '=' + encodeURIComponent(editor.config.ExtendedFileManager.backend_data[i]); 116 } 117 } 118 119 Dialog(manager, function(param){ 120 Dialog(this.config.ExtendedFileManager.manager, function(param){ 120 121 if (!param) 121 122 { // user must have pressed Cancel … … 247 248 }; 248 249 249 var manager = _editor_url + 'plugins/ExtendedFileManager/manager.php?mode=link'; 250 if(editor.config.ExtendedFileManager.backend_config != null) 251 { 252 manager += '&backend_config=' 253 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config); 254 manager += '&backend_config_hash=' 255 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config_hash); 256 manager += '&backend_config_secret_key_location=' 257 + encodeURIComponent(editor.config.ExtendedFileManager.backend_config_secret_key_location); 258 } 259 260 if(editor.config.ExtendedFileManager.backend_data != null) 261 { 262 for ( var i in editor.config.ExtendedFileManager.backend_data ) 263 { 264 manager += '&' + i + '=' + encodeURIComponent(editor.config.ExtendedFileManager.backend_data[i]); 265 } 266 } 267 268 269 Dialog(manager, function(param){ 250 Dialog(this.config.ExtendedFileManager.manager+'&mode=link', function(param){ 270 251 if (!param) 271 252 return false; … … 304 285 editor.updateToolbar(); 305 286 }, outparam); 306 307 287 }; 308 288 -
branches/ray/plugins/ExtendedFileManager/images.php
r862 r975 6 6 * Version: Updated on 04-07-2006 by Krzysztof Kotowicz 7 7 * Version: Updated on 29-10-2006 by Raimund Meyer 8 * Package: ExtendedFileManager (EFM 1.1.3) 8 * Version: Updated on 20-01-2008 by Raimund Meyer
