Changeset 957 for trunk


Ignore:
Timestamp:
02/01/08 22:44:49 (11 years ago)
Author:
ray
Message:

copied changes from branch 0.95_stable

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r954 r957  
    2222    --        bar(); 
    2323    --      } 
    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. 
    2826    --   * Jedit is the recommended editor, a comment of this format should be 
    2927    --     included in the top 10 lines of the file (see the embedded edit mode) 
     
    24312429   
    24322430  this.notifyOf('before_resize', {width:width, height:height}); 
     2431  this.firePluginEvent('onBeforeResize', width, height); 
    24332432  // We need to set the iframe & textarea to 100% height so that the htmlarea 
    24342433  // isn't "pushed out" when we get it's height, so we can change them later. 
     
    26192618      
    26202619  this.notifyOf('resize', {width:this._htmlArea.offsetWidth, height:this._htmlArea.offsetHeight}); 
     2620  this.firePluginEvent('onResize',this._htmlArea.offsetWidth, this._htmlArea.offsetWidth); 
    26212621  this._risizing = false; 
    26222622}; 
     
    26572657 
    26582658  this.notifyOf('panel_change', {'action':'add','panel':div}); 
    2659  
     2659  this.firePluginEvent('onPanelChange','add',div); 
    26602660  return div; 
    26612661}; 
     
    26762676  this._panels[panel.side].panels = clean; 
    26772677  this.notifyOf('panel_change', {'action':'remove','panel':panel}); 
     2678  this.firePluginEvent('onPanelChange','remove',panel); 
    26782679}; 
    26792680/** Hides a panel 
     
    26872688    panel.style.display = 'none'; 
    26882689    this.notifyOf('panel_change', {'action':'hide','panel':panel}); 
     2690    this.firePluginEvent('onPanelChange','hide',panel); 
    26892691    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    26902692  } 
     
    27002702    panel.style.display = ''; 
    27012703    this.notifyOf('panel_change', {'action':'show','panel':panel}); 
     2704    this.firePluginEvent('onPanelChange','show',panel); 
    27022705    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    27032706  } 
     
    27232726  } 
    27242727  this.notifyOf('panel_change', {'action':'multi_hide','sides':sides}); 
     2728  this.firePluginEvent('onPanelChange','multi_hide',sides); 
    27252729}; 
    27262730/** Shows the panel(s) on one or more sides 
     
    27442748  } 
    27452749  this.notifyOf('panel_change', {'action':'multi_show','sides':sides}); 
     2750  this.firePluginEvent('onPanelChange','multi_show',sides); 
    27462751}; 
    27472752/** Returns an array containig all properties that are set in an object 
     
    30133018  { 
    30143019    case "textmode": 
     3020      this.firePluginEvent('onBeforeMode', 'textmode'); 
    30153021      this.setCC("iframe"); 
    30163022      html = this.outwardHtml(this.getHTML()); 
     
    30273033        this._statusBarTextMode.style.display = ""; 
    30283034      } 
     3035      this.findCC("textarea"); 
    30293036      this.notifyOf('modechange', {'mode':'text'}); 
    3030       this.findCC("textarea");  
     3037      this.firePluginEvent('onMode', 'textmode'); 
    30313038    break; 
    30323039 
    30333040    case "wysiwyg": 
     3041      this.firePluginEvent('onBeforeMode', 'wysiwyg'); 
    30343042      this.setCC("textarea"); 
    30353043      html = this.inwardHtml(this.getHTML()); 
     
    30443052        this._statusBarTextMode.style.display = "none"; 
    30453053      } 
     3054      this.findCC("iframe"); 
    30463055      this.notifyOf('modechange', {'mode':'wysiwyg'}); 
    3047       this.findCC("iframe"); 
     3056      this.firePluginEvent('onMode', 'wysiwyg'); 
     3057 
    30483058    break; 
    30493059 
     
    30533063  } 
    30543064  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   } 
    30643065}; 
    30653066/** Sets the HTML in fullpage mode. Actually the whole iframe document is rewritten. 
     
    41524153    this._timerUndo = setTimeout(function() { editor._timerUndo = null; }, this.config.undoTimeout); 
    41534154  } 
    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'); 
    42004156}; 
    42014157 
  • trunk/XinhaLoader.js

    r954 r957  
    11var Xinha = {}; 
     2 
     3_editor_url = _editor_url.replace(/\x2f*$/, '/'); 
     4 
    25Xinha.agt       = navigator.userAgent.toLowerCase(); 
    36Xinha.is_ie    = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); 
  • trunk/modules/Gecko/Gecko.js

    r935 r957  
    696696 
    697697//Control character for retaining edit location when switching modes 
    698 Xinha.prototype.cc = '|XinhaCaret|';  
     698Xinha.prototype.cc = String.fromCharCode(8286);  
    699699 
    700700Xinha.prototype.setCC = function ( target ) 
  • trunk/plugins/Equation/equation.js

    r942 r957  
    4747        mathfontfamily = cfg.Equation.mathfontfamily; 
    4848         
    49         //if (Xinha.is_ie) return; 
    50         if (!Xinha.is_ie) 
     49        this.enabled = !Xinha.is_ie; 
     50         
     51        if (this.enabled) 
    5152        {        
    52                 editor.notifyOn( 'modechange', 
    53                         function( e, args ) 
    54                                 { 
    55                                         self.onModeChange( args ); 
    56                                 } 
    57                         ); 
    5853                this.onBeforeSubmit = this.onBeforeUnload = function () {self.unParse();}; 
    5954        } 
     
    9186        this.parse(); 
    9287}; 
    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 
    10289// avoid changing the formula in the editor 
    10390Equation.prototype.onKeyPress = function(ev) 
    10491{ 
    105         if (!Xinha.is_ie) 
     92        if (this.enabled) 
    10693        { 
    10794                e = this.editor; 
     
    122109        return false; 
    123110} 
    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 }; 
     111Equation.prototype.onBeforeMode = function( mode ) 
     112{ 
     113        if (this.enabled && mode == 'textmode') 
     114        { 
     115                this.unParse(); 
     116        } 
     117} 
     118Equation.prototype.onMode = function( mode ) 
     119{ 
     120        if (this.enabled && mode == 'wysiwyg') 
     121        { 
     122                this.parse(); 
     123        } 
     124} 
    137125 
    138126Equation.prototype.parse = function () 
    139127{ 
    140         if (!Xinha.is_ie) 
     128        if (this.enabled) 
    141129        { 
    142130                var doc = this.editor._doc; 
     
    163151                        } catch (e) {} 
    164152                        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); 
    165156                } 
    166157        } 
     
    178169                node.innerHTML = formula; 
    179170                node.setAttribute("title", null); 
    180                 this.editor.setHTML(this.editor.getHTML()); 
    181171        } 
    182172} 
     
    212202                        { 
    213203                                span.innerHTML = formula; 
    214                                 if (!Xinha.is_ie) span.title = formula; 
     204                                if (this.enabled) span.title = formula; 
    215205                        } 
    216206                        else 
     
    222212                else if (!param["editedNode"] && formula != '') 
    223213                { 
    224                         if (!Xinha.is_ie) 
     214                        if (this.enabled) 
    225215                        {                        
    226216                                var span = document.createElement('span'); 
     
    236226                } 
    237227 
    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  
    810810                        break; 
    811811                        case 'moveFile': 
    812                                 $src = Files::makePath($this->getImagesDir(), $_GET['srcdir'].$_GET['file']); 
    813                                 $dest = Files::makePath($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']); 
    814814                                return Files::rename($src,$dest); 
    815815                        break; 
  • trunk/plugins/ExtendedFileManager/assets/manager.js

    r954 r957  
    6666        window.resizeBy(0, page.y - dim.y + 5); 
    6767 
     68        dim = Xinha.viewportSize(window); 
     69         
    6870        if (!Xinha.is_ie) 
    6971        { 
    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; 
    7274        } 
    7375        else 
    7476        {//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;        
    7779        } 
    7880        window.moveTo(x,y); 
Note: See TracChangeset for help on using the changeset viewer.