Changeset 890


Ignore:
Timestamp:
09/13/07 14:52:14 (12 years ago)
Author:
ray
Message:

update branch

Location:
branches/ray
Files:
30 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/ray/XinhaCore.js

    r862 r890  
    28472847  { 
    28482848    this._doc.body.contentEditable = true; 
    2849  
    2850     if (this._iframe.contentWindow.event.srcElement.tagName.toLowerCase() == 'html') // if  clicked below the text (=body), the text cursor does not appear, see #1019  
    2851     { 
    2852       var r = this._doc.body.createTextRange(); 
    2853       setTimeout (function () { r.collapse();  r.select();},100); // won't do without timeout, dunno why 
    2854     } 
    28552849  } 
    28562850 
     
    31413135{ 
    31423136  var editor=this; 
    3143   var doc = (Xinha.is_ie) ? this._doc.getElementsByTagName("html")[0] : this._doc; // #1019 Cusor not jumping to editable part of window when clicked in IE, see also #1039 
     3137  var doc = this._doc; 
    31443138 
    31453139  editor.whenDocReady( 
     
    31563150        } 
    31573151      ); 
     3152      if (Xinha.is_ie) 
     3153      { // #1019 Cusor not jumping to editable part of window when clicked in IE, see also #1039 
     3154        Xinha._addEvent( 
     3155        editor._doc.getElementsByTagName("html")[0], 
     3156        "click", 
     3157          function() 
     3158          { 
     3159            if (editor._iframe.contentWindow.event.srcElement.tagName.toLowerCase() == 'html') // if  clicked below the text (=body), the text cursor does not appear, see #1019 
     3160            { 
     3161               var r = editor._doc.body.createTextRange(); 
     3162               r.collapse();   
     3163               r.select() 
     3164               //setTimeout (function () { r.collapse();  r.select();},100); // won't do without timeout, dunno why 
     3165             } 
     3166             return true; 
     3167          } 
     3168        ); 
     3169      } 
    31583170 
    31593171      // intercept some events; for updating the toolbar & keyboard handlers 
     
    33173329{ 
    33183330  if ( !Xinha.isSupportedBrowser ) return; 
    3319    
     3331  Xinha.setLoadingMessage (Xinha._lc("Loading plugins")); 
    33203332  // Rip the ones that are loaded and look for ones that have failed 
    33213333  var retVal = true; 
  • branches/ray/XinhaLoader.js

    r791 r890  
    77Xinha.is_safari  = (Xinha.agt.indexOf("safari") != -1); 
    88Xinha.opera_version = navigator.appVersion.substring(0, navigator.appVersion.indexOf(" "))*1; 
    9 Xinha.is_mac       = (Xinha.agt.indexOf("mac") != -1); 
     9Xinha.is_mac   = (Xinha.agt.indexOf("mac") != -1); 
    1010Xinha.is_mac_ie = (Xinha.is_ie && Xinha.is_mac); 
    1111Xinha.is_win_ie = (Xinha.is_ie && !Xinha.is_mac); 
     
    158158}; 
    159159Xinha._lc = function(string) {return string;} 
     160 
     161Xinha._addEvent = function(el, evname, func)  
     162{ 
     163  if ( document.addEventListener ) 
     164  { 
     165    el.addEventListener(evname, func, true); 
     166  } 
     167  else 
     168  { 
     169    el.attachEvent("on" + evname, func); 
     170  } 
     171} 
  • branches/ray/examples/testbed.html

    r796 r890  
    3030    // in this example we do a little regular expression to find the absolute path. 
    3131    _editor_url  = document.location.href.replace(/examples\/.*/, '') 
    32     _editor_lang = "en";      // And the language we need to use in the editor. 
     32    _editor_lang = "de";      // And the language we need to use in the editor. 
    3333  </script> 
    3434 
     
    6565         'Linker', 
    6666         'Stylist', 
    67          'SmartReplace' 
     67         'SmartReplace', 
     68                 'InsertSnippet' 
    6869       ]; 
    6970             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :) 
  • branches/ray/modules/Dialogs/XinhaDialog.js

    r862 r890  
    280280    //Xinha._addEvent(window, 'resize', this.onResizeWin ); 
    281281 
    282     rootElemStyle.display   = ''; 
    283  
     282    //rootElemStyle.display   = ''; 
     283Xinha.Dialog.fadeIn(this.rootElem); 
    284284    var dialogHeight = rootElem.offsetHeight; 
    285285    var dialogWidth = rootElem.offsetWidth; 
     
    367367  else 
    368368  { 
    369     this.rootElem.style.display = 'none'; 
    370     this.hideBackground(); 
     369    //this.rootElem.style.display = 'none'; 
     370    Xinha.Dialog.fadeOut(this.rootElem); 
     371        this.hideBackground(); 
    371372    var dialog = this; 
    372373 
     
    393394    } 
    394395  } 
    395     // Restore the selection 
     396   // Restore the selection --> should this happen only with modals? 
    396397  this.editor.restoreSelection(this._lastRange); 
    397398   
     
    654655Xinha.Dialog.prototype.hideBackground = function() 
    655656{ 
    656   this.background.style.display = 'none'; 
     657  //this.background.style.display = 'none'; 
     658  Xinha.Dialog.fadeOut(this.background); 
    657659} 
    658660Xinha.Dialog.prototype.showBackground = function() 
    659661{ 
    660   this.background.style.display = ''; 
     662  //this.background.style.display = ''; 
     663  Xinha.Dialog.fadeIn(this.background,70); 
    661664} 
    662665Xinha.Dialog.prototype.posBackground = function(pos) 
     
    945948  Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) + 10; 
    946949} 
     950Xinha.Dialog.setOpacity = function(el,value) 
     951{ 
     952        if (typeof el.style.filter != 'undefined') 
     953        { 
     954                el.style.filter = (value < 100) ?  'alpha(opacity='+value+')' : ''; 
     955        } 
     956        else 
     957        { 
     958                el.style.opacity = value/100; 
     959        } 
     960} 
     961Xinha.Dialog.fadeIn = function(el,endOpacity,delay,step) 
     962{ 
     963        delay = delay || 1; 
     964        step = step || 25; 
     965        endOpacity = endOpacity || 100; 
     966        el.op = el.op || 0; 
     967        var op = el.op; 
     968        if (el.style.display == 'none') 
     969        { 
     970                Xinha.Dialog.setOpacity(el,0); 
     971                el.style.display = ''; 
     972        } 
     973        if (op < endOpacity) 
     974        { 
     975                el.op += step; 
     976                Xinha.Dialog.setOpacity(el,op); 
     977                el.timeOut = setTimeout(function(){Xinha.Dialog.fadeIn(el,endOpacity,delay,step);},delay); 
     978        } 
     979        else 
     980        { 
     981                Xinha.Dialog.setOpacity(el,endOpacity); 
     982                el.op = endOpacity; 
     983                el.timeOut = null; 
     984        } 
     985} 
     986 
     987Xinha.Dialog.fadeOut = function(el,delay,step) 
     988{ 
     989        delay = delay || 1; 
     990        step = step || 30; 
     991        if (typeof el.op == 'undefined') el.op = 100; 
     992        var op = el.op; 
     993 
     994        if (op >= 0) 
     995        { 
     996                el.op -= step; 
     997                Xinha.Dialog.setOpacity(el,op); 
     998                el.timeOut = setTimeout(function(){Xinha.Dialog.fadeOut(el,delay,step);},delay); 
     999        } 
     1000        else 
     1001        { 
     1002                Xinha.Dialog.setOpacity(el,0); 
     1003                el.style.display = 'none'; 
     1004                el.op = 0; 
     1005                el.timeOut = null; 
     1006        } 
     1007} 
     1008 
     1009 
  • branches/ray/modules/GetHtml/DOMwalk.js

    r862 r890  
    5252}; 
    5353 
    54 Xinha.emptyAttributes = " checked disabled ismap readonly nowrap compact declare selected defer multiple noresize noshade "; 
    55 Xinha.elGetsNewLine = function (el) { return (" br meta link title ".indexOf(" " + el.tagName.toLowerCase() + " ") != -1);}; 
     54Xinha.emptyAttributes = " checked disabled ismap readonly nowrap compact declare selected defer multiple noresize noshade " 
    5655 
    5756Xinha.getHTMLWrapper = function(root, outputRoot, editor, indent) 
     
    133132      { 
    134133        closed = (!(root.hasChildNodes() || Xinha.needsClosingTag(root))); 
    135         html += ((Xinha.isBlockElement(root) || Xinha.elGetsNewLine(root)) ? ('\n' + indent) : '') + "<" + root.tagName.toLowerCase(); 
     134        html += ((Xinha.isBlockElement(root)) ? ('\n' + indent) : '') + "<" + root.tagName.toLowerCase(); 
    136135        var attrs = root.attributes; 
    137136         
  • branches/ray/modules/InternetExplorer/InternetExplorer.js

    r862 r890  
    306306Xinha.prototype.restoreSelection = function(savedSelection) 
    307307{ 
    308   savedSelection.select(); 
     308  try { savedSelection.select() } catch (e) {}; 
    309309} 
    310310 
  • branches/ray/plugins/SaveSubmit/save-submit.js

    r761 r890  
    3434SaveSubmit._pluginInfo = { 
    3535  name          : "SaveSubmit", 
    36   version       : "1.0", 
     36  version       : "1.05", 
    3737  developer     : "Raimund Meyer", 
    3838  developer_url : "http://rheinauf.de", 
     
    4141  sponsor_url   : "", 
    4242  license       : "htmlArea" 
    43 } 
    44  
    45 SaveSubmit.prototype.onGenerateOnce = function() { 
    46         this.initial_html = this.editor.getInnerHTML(); 
    4743} 
    4844 
     
    7369} 
    7470SaveSubmit.prototype.getChanged = function() { 
    75         if (this.initial_html === null) this.initial_html = this.editor.getInnerHTML(); 
     71        if (!this.initial_html) this.initial_html = this.editor.getInnerHTML(); 
    7672        if (this.initial_html != this.editor.getInnerHTML() && this.changed == false) { 
    7773                this.changed = true; 
  • branches/ray/plugins/Stylist/stylist.js

    r806 r890  
    596596  var editor = this.editor; 
    597597  var rootElem = this.dialog.rootElem; 
     598   
     599  if (rootElem.style.display == 'none') return; 
     600   
    598601  var panelContainer = rootElem.parentNode; 
    599602 
Note: See TracChangeset for help on using the changeset viewer.