Changeset 957
- Timestamp:
- 02/01/08 22:44:49 (5 years ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
XinhaCore.js (modified) (14 diffs)
-
XinhaLoader.js (modified) (1 diff)
-
modules/Gecko/Gecko.js (modified) (1 diff)
-
plugins/Equation/equation.js (modified) (8 diffs)
-
plugins/ExtendedFileManager/Classes/ExtendedFileManager.php (modified) (1 diff)
-
plugins/ExtendedFileManager/assets/manager.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r954 r957 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) … … 2431 2429 2432 2430 this.notifyOf('before_resize', {width:width, height:height}); 2431 this.firePluginEvent('onBeforeResize', width, height); 2433 2432 // We need to set the iframe & textarea to 100% height so that the htmlarea 2434 2433 // isn't "pushed out" when we get it's height, so we can change them later. … … 2619 2618 2620 2619 this.notifyOf('resize', {width:this._htmlArea.offsetWidth, height:this._htmlArea.offsetHeight}); 2620 this.firePluginEvent('onResize',this._htmlArea.offsetWidth, this._htmlArea.offsetWidth); 2621 2621 this._risizing = false; 2622 2622 }; … … 2657 2657 2658 2658 this.notifyOf('panel_change', {'action':'add','panel':div}); 2659 2659 this.firePluginEvent('onPanelChange','add',div); 2660 2660 return div; 2661 2661 }; … … 2676 2676 this._panels[panel.side].panels = clean; 2677 2677 this.notifyOf('panel_change', {'action':'remove','panel':panel}); 2678 this.firePluginEvent('onPanelChange','remove',panel); 2678 2679 }; 2679 2680 /** Hides a panel … … 2687 2688 panel.style.display = 'none'; 2688 2689 this.notifyOf('panel_change', {'action':'hide','panel':panel}); 2690 this.firePluginEvent('onPanelChange','hide',panel); 2689 2691 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2690 2692 } … … 2700 2702 panel.style.display = ''; 2701 2703 this.notifyOf('panel_change', {'action':'show','panel':panel}); 2704 this.firePluginEvent('onPanelChange','show',panel); 2702 2705 try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 2703 2706 } … … 2723 2726 } 2724 2727 this.notifyOf('panel_change', {'action':'multi_hide','sides':sides}); 2728 this.firePluginEvent('onPanelChange','multi_hide',sides); 2725 2729 }; 2726 2730 /** Shows the panel(s) on one or more sides … … 2744 2748 } 2745 2749 this.notifyOf('panel_change', {'action':'multi_show','sides':sides}); 2750 this.firePluginEvent('onPanelChange','multi_show',sides); 2746 2751 }; 2747 2752 /** Returns an array containig all properties that are set in an object … … 3013 3018 { 3014 3019 case "textmode": 3020 this.firePluginEvent('onBeforeMode', 'textmode'); 3015 3021 this.setCC("iframe"); 3016 3022 html = this.outwardHtml(this.getHTML()); … … 3027 3033 this._statusBarTextMode.style.display = ""; 3028 3034 } 3035 this.findCC("textarea"); 3029 3036 this.notifyOf('modechange', {'mode':'text'}); 3030 this.fi ndCC("textarea");3037 this.firePluginEvent('onMode', 'textmode'); 3031 3038 break; 3032 3039 3033 3040 case "wysiwyg": 3041 this.firePluginEvent('onBeforeMode', 'wysiwyg'); 3034 3042 this.setCC("textarea"); 3035 3043 html = this.inwardHtml(this.getHTML()); … … 3044 3052 this._statusBarTextMode.style.display = "none"; 3045 3053 } 3054 this.findCC("iframe"); 3046 3055 this.notifyOf('modechange', {'mode':'wysiwyg'}); 3047 this.findCC("iframe"); 3056 this.firePluginEvent('onMode', 'wysiwyg'); 3057 3048 3058 break; 3049 3059 … … 3053 3063 } 3054 3064 this._editMode = mode; 3055 3056 for ( var i in this.plugins )3057 {3058 var plugin = this.plugins[i].instance;3059 if ( plugin && typeof plugin.onMode == "function" )3060 {3061 plugin.onMode(mode);3062 }3063 }3064 3065 }; 3065 3066 /** Sets the HTML in fullpage mode. Actually the whole iframe document is rewritten. … … 4152 4153 this._timerUndo = setTimeout(function() { editor._timerUndo = null; }, this.config.undoTimeout); 4153 4154 } 4154 4155 // Insert a space in certain locations, this is just to make editing a little 4156 // easier (to "get out of" tags), it's not essential. 4157 // TODO: Make this work for IE? 4158 // TODO: Perhaps should use a plain space character, I'm not sure. 4159 // OK, I've disabled this temporarily, to be honest, I can't rightly remember what the 4160 // original problem was I was trying to solve with it. I think perhaps that EnterParagraphs 4161 // might solve the problem, whatever the hell it was. I'm going senile, I'm sure. 4162 // @todo : since this part is disabled since a long time, does it still need to be in the source ? 4163 if( 0 && Xinha.is_gecko ) 4164 { 4165 var s = this.getSelection(); 4166 // If the last character in the last text node of the parent tag 4167 // and the parent tag is not a block tag 4168 if ( s && s.isCollapsed && s.anchorNode && 4169 s.anchorNode.parentNode.tagName.toLowerCase() != 'body' && 4170 s.anchorNode.nodeType == 3 && s.anchorOffset == s.anchorNode.length && 4171 !( s.anchorNode.parentNode.nextSibling && s.anchorNode.parentNode.nextSibling.nodeType == 3 ) && 4172 !Xinha.isBlockElement(s.anchorNode.parentNode) ) 4173 { 4174 // Insert hair-width-space after the close tag if there isn't another text node on the other side 4175 // It could also work with zero-width-space (\u200B) but I don't like it so much. 4176 // Perhaps this won't work well in various character sets and we should use plain space (20)? 4177 try 4178 { 4179 s.anchorNode.parentNode.parentNode.insertBefore(this._doc.createTextNode('\t'), s.anchorNode.parentNode.nextSibling); 4180 } 4181 catch(ex) {} // Disregard 4182 } 4183 } 4184 4185 // FIXME: this should be using this.firePluginEvent('onUpdateToolbar') 4186 // but we have to make sure that the plugins using that event return false 4187 // if they should let the event fire on other plugins, currently the below 4188 // code doesn't take the return value into account 4189 4190 // check if any plugins have registered refresh handlers 4191 for ( var indexPlugin in this.plugins ) 4192 { 4193 var plugin = this.plugins[indexPlugin].instance; 4194 if ( plugin && typeof plugin.onUpdateToolbar == "function" ) 4195 { 4196 plugin.onUpdateToolbar(); 4197 } 4198 } 4199 4155 this.firePluginEvent('onUpdateToolbar'); 4200 4156 }; 4201 4157 -
trunk/XinhaLoader.js
r954 r957 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)); -
trunk/modules/Gecko/Gecko.js
r935 r957 696 696 697 697 //Control character for retaining edit location when switching modes 698 Xinha.prototype.cc = '|XinhaCaret|';698 Xinha.prototype.cc = String.fromCharCode(8286); 699 699 700 700 Xinha.prototype.setCC = function ( target ) -
trunk/plugins/Equation/equation.js
r942 r957 47 47 mathfontfamily = cfg.Equation.mathfontfamily; 48 48 49 //if (Xinha.is_ie) return; 50 if (!Xinha.is_ie) 49 this.enabled = !Xinha.is_ie; 50 51 if (this.enabled) 51 52 { 52 editor.notifyOn( 'modechange',53 function( e, args )54 {55 self.onModeChange( args );56 }57 );58 53 this.onBeforeSubmit = this.onBeforeUnload = function () {self.unParse();}; 59 54 } … … 91 86 this.parse(); 92 87 }; 93 Equation.prototype.onUpdateToolbar = function() 94 { 95 var e = this.editor; 96 if (!Xinha.is_ie && this.reParse) 97 { 98 AMprocessNode(e._doc.body, false); 99 this.reParse = false; 100 } 101 }; 88 102 89 // avoid changing the formula in the editor 103 90 Equation.prototype.onKeyPress = function(ev) 104 91 { 105 if ( !Xinha.is_ie)92 if (this.enabled) 106 93 { 107 94 e = this.editor; … … 122 109 return false; 123 110 } 124 Equation.prototype.onModeChange = function( args ) 125 { 126 var doc = this.editor._doc; 127 switch (args.mode) 128 { 129 case 'text': 130 this.unParse(); 131 break; 132 case 'wysiwyg': 133 this.parse(); 134 break; 135 } 136 }; 111 Equation.prototype.onBeforeMode = function( mode ) 112 { 113 if (this.enabled && mode == 'textmode') 114 { 115 this.unParse(); 116 } 117 } 118 Equation.prototype.onMode = function( mode ) 119 { 120 if (this.enabled && mode == 'wysiwyg') 121 { 122 this.parse(); 123 } 124 } 137 125 138 126 Equation.prototype.parse = function () 139 127 { 140 if ( !Xinha.is_ie)128 if (this.enabled) 141 129 { 142 130 var doc = this.editor._doc; … … 163 151 } catch (e) {} 164 152 node.parentNode.replaceChild(clone, node); 153 // insert space before and after the protected node, otherwide one could get stuck 154 clone.parentNode.insertBefore(doc.createTextNode(String.fromCharCode(32)),clone); 155 clone.parentNode.insertBefore(doc.createTextNode(String.fromCharCode(32)),clone.nextSibling); 165 156 } 166 157 } … … 178 169 node.innerHTML = formula; 179 170 node.setAttribute("title", null); 180 this.editor.setHTML(this.editor.getHTML());181 171 } 182 172 } … … 212 202 { 213 203 span.innerHTML = formula; 214 if ( !Xinha.is_ie) span.title = formula;204 if (this.enabled) span.title = formula; 215 205 } 216 206 else … … 222 212 else if (!param["editedNode"] && formula != '') 223 213 { 224 if ( !Xinha.is_ie)214 if (this.enabled) 225 215 { 226 216 var span = document.createElement('span'); … … 236 226 } 237 227 238 if ( !Xinha.is_ie) this.parse();//AMprocessNode(this.editor._doc.body, false);239 } 240 } 228 if (this.enabled) this.parse();//AMprocessNode(this.editor._doc.body, false); 229 } 230 } -
trunk/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php
r841 r957 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; -
trunk/plugins/ExtendedFileManager/assets/manager.js
r954 r957 66 66 window.resizeBy(0, page.y - dim.y + 5); 67 67 68 dim = Xinha.viewportSize(window); 69 68 70 if (!Xinha.is_ie) 69 71 { 70 var x = opener.screenX + (opener.outerWidth - w) / 2;71 var y = opener.screenY + (opener.outerHeight - h) / 2;72 var x = opener.screenX + (opener.outerWidth - dim.x) / 2; 73 var y = opener.screenY + (opener.outerHeight - dim.x) / 2; 72 74 } 73 75 else 74 76 {//IE does not have window.outer... , so center it on the screen at least 75 var x = (self.screen.availWidth - w) / 2;76 var y = (self.screen.availHeight - h) / 2;77 var x = (self.screen.availWidth - dim.x) / 2; 78 var y = (self.screen.availHeight - dim.y) / 2; 77 79 } 78 80 window.moveTo(x,y);
