Changeset 678


Ignore:
Timestamp:
01/21/07 21:15:13 (8 years ago)
Author:
ray
Message:
  • applied new non-underscored function names to core files
  • added file info header to getHTML.js, insert_image.js, link.js
  • updated release-notes.txt
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r677 r678  
    33113311        } 
    33123312 
    3313         var deepestAncestor = this._getFirstAncestor(this._getSelection(), blocks); 
     3313        var deepestAncestor = this._getFirstAncestor(this.getSelection(), blocks); 
    33143314        if ( deepestAncestor ) 
    33153315        { 
     
    33943394  if( 0 && Xinha.is_gecko ) 
    33953395  { 
    3396     var s = this._getSelection(); 
     3396    var s = this.getSelection(); 
    33973397    // If the last character in the last text node of the parent tag 
    33983398    // and the parent tag is not a block tag 
     
    34523452Xinha.prototype._getFirstAncestor = function(sel, types) 
    34533453{ 
    3454   var prnt = this._activeElement(sel); 
     3454  var prnt = this.activeElement(sel); 
    34553455  if ( prnt === null ) 
    34563456  { 
     
    34583458    try 
    34593459    { 
    3460       prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
     3460      prnt = (Xinha.is_ie ? this.createRange(sel).parentElement() : this.createRange(sel).commonAncestorContainer); 
    34613461    } 
    34623462    catch(ex) 
     
    35043504{ 
    35053505  // Scan upwards to find a block level element that we can change or apply to 
    3506   var prnt = (Xinha.is_ie ? this._createRange(sel).parentElement : this._createRange(sel).commonAncestorContainer); 
     3506  var prnt = (Xinha.is_ie ? this.createRange(sel).parentElement : this.createRange(sel).commonAncestorContainer); 
    35073507 
    35083508  while ( prnt && ( prnt.nodeType == 1 ) ) 
     
    35513551  // expand it until we reach a block element in either direction 
    35523552  // then wrap the selection in a block and return 
    3553   var sel = this._getSelection(); 
     3553  var sel = this.getSelection(); 
    35543554  if ( Xinha.is_ie ) 
    35553555  { 
     
    35613561  } 
    35623562 
    3563   var rng = this._createRange(sel); 
     3563  var rng = this.createRange(sel); 
    35643564 
    35653565  // Expand UP 
     
    35993599Xinha.prototype._insertTable = function() 
    36003600{ 
    3601   var sel = this._getSelection(); 
    3602   var range = this._createRange(sel); 
     3601  var sel = this.getSelection(); 
     3602  var range = this.createRange(sel); 
    36033603  var editor = this;    // for nested functions 
    36043604  this._popupDialog( 
     
    37743774  if ( Xinha.is_ie ) 
    37753775  { 
    3776     var range = editor._createRange(editor._getSelection()); 
     3776    var range = editor.createRange(editor.getSelection()); 
    37773777    cback = function(color) 
    37783778    { 
     
    38923892    { 
    38933893      cmdID.match(/^justify(.*)$/); 
    3894       var ae = this._activeElement(this._getSelection());       
     3894      var ae = this.activeElement(this.getSelection());       
    38953895      if(ae && ae.tagName.toLowerCase() == 'img') 
    38963896      { 
     
    40454045  var p, body; 
    40464046  // Get the insertion point, we'll scrub any highlighted text the user wants rid of while we are there. 
    4047   var sel = this._getSelection(); 
    4048   var range = this._createRange(sel); 
     4047  var sel = this.getSelection(); 
     4048  var range = this.createRange(sel); 
    40494049  if ( !range.collapsed ) 
    40504050  { 
     
    42244224  this.activateEditor(); 
    42254225 
    4226   sel = this._getSelection(); 
     4226  sel = this.getSelection(); 
    42274227  sel.removeAllRanges(); 
    42284228  sel.collapse(newblock,0); 
  • trunk/functionsIE.js

    r677 r678  
    3535  name          : "Internet Explorer", 
    3636  origin        : "Xinha Core", 
    37   version       : "$LastChangedRevision$", 
     37  version       : "$LastChangedRevision$".replace(/^[^:]*: (.*) \$$/, '$1'), 
    3838  developer     : "The Xinha Core Developer Team", 
    39   developer_url : "$HeadURL$", 
     39  developer_url : "$HeadURL$".replace(/^[^:]*: (.*) \$$/, '$1'), 
    4040  license       : "htmlArea" 
    4141}; 
     
    108108{ 
    109109  var editor = this.editor; 
    110   var sel = editor._getSelection(); 
     110  var sel = editor.getSelection(); 
    111111  if ( sel.type == 'Control' ) 
    112112  { 
    113     var elm = editor._activeElement(sel); 
     113    var elm = editor.activeElement(sel); 
    114114    Xinha.removeFromParent(elm); 
    115115    return true; 
     
    121121  // where | is the cursor, and backspace over the last e, then the link 
    122122  // will de-link, which is a bit tedious 
    123   var range = editor._createRange(sel); 
     123  var range = editor.createRange(sel); 
    124124  var r2 = range.duplicate(); 
    125125  r2.moveStart("character", -1); 
     
    168168  if ( typeof sel == 'undefined' ) 
    169169  { 
    170     sel = this._getSelection(); 
    171   } 
    172   var range = this._createRange(sel); 
     170    sel = this.getSelection(); 
     171  } 
     172  var range = this.createRange(sel); 
    173173  switch ( sel.type ) 
    174174  { 
     
    214214 */ 
    215215  
    216 Xinha.prototype._activeElement = function(sel) 
    217 { 
    218   if ( ( sel === null ) || this._selectionEmpty(sel) ) 
     216Xinha.prototype.activeElement = function(sel) 
     217{ 
     218  if ( ( sel === null ) || this.selectionEmpty(sel) ) 
    219219  { 
    220220    return null; 
     
    274274  } 
    275275 
    276   return this._createRange(sel).htmlText === ''; 
     276  return this.createRange(sel).htmlText === ''; 
    277277}; 
    278278 
     
    313313Xinha.prototype.insertHTML = function(html) 
    314314{ 
    315   var sel = this._getSelection(); 
    316   var range = this._createRange(sel); 
     315  var sel = this.getSelection(); 
     316  var range = this.createRange(sel); 
    317317  this.focusEditor(); 
    318318  range.pasteHTML(html); 
     
    327327Xinha.prototype.getSelectedHTML = function() 
    328328{ 
    329   var sel = this._getSelection(); 
    330   var range = this._createRange(sel); 
     329  var sel = this.getSelection(); 
     330  var range = this.createRange(sel); 
    331331   
    332332  // Need to be careful of control ranges which won't have htmlText 
  • trunk/functionsMozilla.js

    r677 r678  
    3535  name          : "Gecko", 
    3636  origin        : "Xinha Core", 
    37   version       : "$LastChangedRevision$", 
     37  version       : "$LastChangedRevision$".replace(/^[^:]*: (.*) \$$/, '$1'), 
    3838  developer     : "The Xinha Core Developer Team", 
    39   developer_url : "$HeadURL$", 
     39  developer_url : "$HeadURL$".replace(/^[^:]*: (.*) \$$/, '$1'), 
    4040  license       : "htmlArea" 
    4141}; 
     
    5252{ 
    5353  var editor = this.editor; 
    54   var s = editor._getSelection(); 
     54  var s = editor.getSelection(); 
    5555   
    5656  // Handle shortcuts 
     
    7474      { 
    7575        // KEY select all 
    76         sel = editor._getSelection(); 
     76        sel = editor.getSelection(); 
    7777        sel.removeAllRanges(); 
    78         range = editor._createRange(); 
     78        range = editor.createRange(); 
    7979        range.selectNodeContents(editor._doc.body); 
    8080        sel.addRange(range); 
     
    380380Xinha.prototype.insertNodeAtSelection = function(toBeInserted) 
    381381{ 
    382   var sel = this._getSelection(); 
    383   var range = this._createRange(sel); 
     382  var sel = this.getSelection(); 
     383  var range = this.createRange(sel); 
    384384  // remove the current selection 
    385385  sel.removeAllRanges(); 
     
    396396        // do optimized insertion 
    397397        node.insertData(pos, toBeInserted.data); 
    398         range = this._createRange(); 
     398        range = this.createRange(); 
    399399        range.setEnd(node, pos + toBeInserted.length); 
    400400        range.setStart(node, pos + toBeInserted.length); 
     
    434434  if ( typeof sel == 'undefined' ) 
    435435  { 
    436     sel = this._getSelection(); 
    437   } 
    438   var range = this._createRange(sel); 
     436    sel = this.getSelection(); 
     437  } 
     438  var range = this.createRange(sel); 
    439439  try 
    440440  { 
     
    468468Xinha.prototype.activeElement = function(sel) 
    469469{ 
    470   if ( ( sel === null ) || this._selectionEmpty(sel) ) 
     470  if ( ( sel === null ) || this.selectionEmpty(sel) ) 
    471471  { 
    472472    return null; 
     
    530530  var range; 
    531531  var collapsed = typeof pos == "undefined" ? true : false; 
    532   var sel = this._getSelection(); 
     532  var sel = this.getSelection(); 
    533533  range = this._doc.createRange(); 
    534534  // Tables and Images get selected as "objects" rather than the text contents 
     
    553553Xinha.prototype.insertHTML = function(html) 
    554554{ 
    555   var sel = this._getSelection(); 
    556   var range = this._createRange(sel); 
     555  var sel = this.getSelection(); 
     556  var range = this.createRange(sel); 
    557557  this.focusEditor(); 
    558558  // construct a new document fragment with the given HTML 
     
    576576Xinha.prototype.getSelectedHTML = function() 
    577577{ 
    578   var sel = this._getSelection(); 
    579   var range = this._createRange(sel); 
     578  var sel = this.getSelection(); 
     579  var range = this.createRange(sel); 
    580580  return Xinha.getHTML(range.cloneContents(), false, this); 
    581581}; 
  • trunk/getHTML.js

    r677 r678  
     1 
     2  /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- 
     3    --  Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ 
     4    -- 
     5    --  Use of Xinha is granted by the terms of the htmlArea License (based on 
     6    --  BSD license)  please read license.txt in this package for details. 
     7    -- 
     8    --  Xinha was originally based on work by Mihai Bazon which is: 
     9    --      Copyright (c) 2003-2004 dynarch.com. 
     10    --      Copyright (c) 2002-2003 interactivetools.com, inc. 
     11    --      This copyright notice MUST stay intact for use. 
     12    -- 
     13    --  This is the standard implementation of the method for rendering HTML code from the DOM 
     14    -- 
     15    --  The file is loaded by the Xinha Core when no alternative method (plugin) is loaded. 
     16    -- 
     17    -- 
     18    --  $HeadURL$ 
     19    --  $LastChangedDate$ 
     20    --  $LastChangedRevision$ 
     21    --  $LastChangedBy$ 
     22    --------------------------------------------------------------------------*/ 
     23 
    124// Retrieves the HTML code from the given node.  This is a replacement for 
    225// getting innerHTML, using standard DOM calls. 
  • trunk/popups/insert_image.js

    r677 r678  
     1 
     2  /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- 
     3    --  Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ 
     4    -- 
     5    --  Use of Xinha is granted by the terms of the htmlArea License (based on 
     6    --  BSD license)  please read license.txt in this package for details. 
     7    -- 
     8    --  Xinha was originally based on work by Mihai Bazon which is: 
     9    --      Copyright (c) 2003-2004 dynarch.com. 
     10    --      Copyright (c) 2002-2003 interactivetools.com, inc. 
     11    --      This copyright notice MUST stay intact for use. 
     12    -- 
     13    --  This is the standard implementation of the Xinha.prototype._insertImage method, 
     14    --  which provides the functionality to insert an image in the editor. 
     15    -- 
     16    --  The file is loaded by the Xinha Core when no alternative method (plugin) is loaded. 
     17    -- 
     18    -- 
     19    --  $HeadURL$ 
     20    --  $LastChangedDate$ 
     21    --  $LastChangedRevision$ 
     22    --  $LastChangedBy$ 
     23    --------------------------------------------------------------------------*/ 
     24                                                     
     25 
    126// Called when the user clicks on "InsertImage" button.  If an image is already 
    227// there, it will just modify it's properties. 
     
    4065        if ( Xinha.is_ie ) 
    4166        { 
    42           var sel = editor._getSelection(); 
    43           var range = editor._createRange(sel); 
     67          var sel = editor.getSelection(); 
     68          var range = editor.createRange(sel); 
    4469          editor._doc.execCommand("insertimage", false, param.f_url); 
    4570          img = range.parentElement(); 
  • trunk/popups/link.js

    r677 r678  
     1 
     2  /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- 
     3    --  Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ 
     4    -- 
     5    --  Use of Xinha is granted by the terms of the htmlArea License (based on 
     6    --  BSD license)  please read license.txt in this package for details. 
     7    -- 
     8    --  Xinha was originally based on work by Mihai Bazon which is: 
     9    --      Copyright (c) 2003-2004 dynarch.com. 
     10    --      Copyright (c) 2002-2003 interactivetools.com, inc. 
     11    --      This copyright notice MUST stay intact for use. 
     12    -- 
     13    --  This is the standard implementation of the Xinha.prototype._createLink method, 
     14    --  which provides the functionality to insert a hyperlink in the editor. 
     15    -- 
     16    --  The file is loaded by the Xinha Core when no alternative method (plugin) is loaded. 
     17    -- 
     18    -- 
     19    --  $HeadURL$ 
     20    --  $LastChangedDate$ 
     21    --  $LastChangedRevision$ 
     22    --  $LastChangedBy$ 
     23    --------------------------------------------------------------------------*/ 
     24                                                     
     25 
    126Xinha.prototype._createLink = function(link) 
    227{ 
     
    1641  if ( !link ) 
    1742  { 
    18     var sel = editor._getSelection(); 
    19     var range = editor._createRange(sel); 
     43    var sel = editor.getSelection(); 
     44    var range = editor.createRange(sel); 
    2045    var compare = 0; 
    2146    if ( Xinha.is_ie ) 
  • trunk/release-notes.txt

    r677 r678  
    66Release History 
    77 
     8Xinha 0.92beta 
     9 - fixed Ticket #831 stop empty anchors from being removed 
     10 - Make htmlarea.js just load XinhaCore.js instead of being a copy of it. 
     11 - fixed Ticket #445 Toggle TableBorder doesn't work if this.fullpage=true or using FullPage plugin 
     12 - fixed Ticket #551 shape and coord attributes of area element are ignored by IE 
     13 - fixed Ticket #650 SpellChecker is not compatible with FullPage plugin 
     14 - fixed Ticket #816 CharacterMap and ListType panel modes make editor jump to top in IE 
     15 - fixed Ticket #570 change behaviour of justify when an image is selected to make the image float left/right,  
     16   click the justify button again to undo it 
     17 - fixed Ticket #891 noscript content got escaped 
     18 - fixed Ticket #857 Firefox fails to load in fullpage mode when <link ..> tag in wrong place. 
     19 - fixed Ticket #841 Spell Checker - Won't return to xinha. 
     20 - fixed Ticket #914 All buttons stay grey & this.getParentElement is not a function message when not calling 
     21   Xinha.loadPlugins() in xinha_init function 
     22 - fixed Ticket #911 Background color does not work in Firefox 
     23 - fixed Ticket #912 an error is thrown in Mozilla when clicking merge cells button and fewer than 2 cells are selected 
     24  
     25Xinha 0.91beta 
     26 - changed namespace from HTMLArea to Xinha 
     27 - the core file is now named XinhaCore.js instead of htmlarea.js, 
     28   please change your pages accordingly (the htmlarea.js will be removed!) 
     29 - the color picker script is now loaded on demand to reduce initial loading time 
     30  
    831Xinha 0.9beta 
    932This equals Xinha revision 635 of Jan 11 2007 
Note: See TracChangeset for help on using the changeset viewer.