Changeset 1042
- Timestamp:
- 10/01/08 20:52:00 (5 years ago)
- Location:
- branches/new-dialogs/modules
- Files:
-
- 4 modified
-
Gecko/Gecko.js (modified) (2 diffs)
-
InternetExplorer/InternetExplorer.js (modified) (2 diffs)
-
Opera/Opera.js (modified) (2 diffs)
-
WebKit/WebKit.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/new-dialogs/modules/Gecko/Gecko.js
r1035 r1042 589 589 * 590 590 * @param node DomNode 591 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.592 */ 593 594 Xinha.prototype.selectNodeContents = function(node, pos)591 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 592 */ 593 594 Xinha.prototype.selectNodeContents = function(node, collapseToStart) 595 595 { 596 596 this.focusEditor(); 597 597 this.forceRedraw(); 598 598 var range; 599 var collapsed = typeof pos== "undefined" ? true : false;599 var collapsed = typeof collapseToStart == "undefined" ? true : false; 600 600 var sel = this.getSelection(); 601 601 range = this._doc.createRange(); … … 616 616 sel.removeAllRanges(); 617 617 sel.addRange(range); 618 if (typeof pos!= "undefined")619 { 620 if ( pos)618 if (typeof collapseToStart != "undefined") 619 { 620 if (collapseToStart) 621 621 { 622 622 sel.collapse(range.startContainer, range.startOffset); -
branches/new-dialogs/modules/InternetExplorer/InternetExplorer.js
r1041 r1042 576 576 * 577 577 * @param node DomNode 578 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, pos)578 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, collapseToStart) 582 582 { 583 583 this.focusEditor(); 584 584 this.forceRedraw(); 585 585 var range; 586 var collapsed = typeof pos== "undefined" ? true : false;586 var collapsed = typeof collapseToStart == "undefined" ? true : false; 587 587 // Tables and Images get selected as "objects" rather than the text contents 588 588 if ( collapsed && node.tagName && node.tagName.toLowerCase().match(/table|img|input|select|textarea/) ) … … 679 679 { 680 680 range.moveToElementText(node); 681 } 682 } 683 if (typeof collapseToStart != "undefined") 684 { 685 range.collapse(collapseToStart); 686 if (!collapseToStart) 687 { 688 range.moveStart('character',-1); 689 range.moveEnd('character',-1); 681 690 } 682 691 } -
branches/new-dialogs/modules/Opera/Opera.js
r1001 r1042 576 576 * 577 577 * @param node DomNode 578 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, pos)578 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, collapseToStart) 582 582 { 583 583 this.focusEditor(); 584 584 this.forceRedraw(); 585 585 var range; 586 var collapsed = typeof pos== "undefined" ? true : false;586 var collapsed = typeof collapseToStart == "undefined" ? true : false; 587 587 var sel = this.getSelection(); 588 588 range = this._doc.createRange(); … … 595 595 { 596 596 range.selectNodeContents(node); 597 //(collapsed) && range.collapse(pos);598 597 } 599 598 sel.removeAllRanges(); 600 599 sel.addRange(range); 600 if (typeof collapseToStart != "undefined") 601 { 602 if (collapseToStart) 603 { 604 sel.collapse(range.startContainer, range.startOffset); 605 } else 606 { 607 sel.collapse(range.endContainer, range.endOffset); 608 } 609 } 601 610 }; 602 611 -
branches/new-dialogs/modules/WebKit/WebKit.js
r1039 r1042 574 574 * 575 575 * @param node DomNode 576 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.577 */ 578 579 Xinha.prototype.selectNodeContents = function(node, pos)576 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 577 */ 578 579 Xinha.prototype.selectNodeContents = function(node, collapseToStart) 580 580 { 581 581 this.focusEditor(); 582 582 this.forceRedraw(); 583 583 var range; 584 var collapsed = typeof pos== "undefined" ? true : false;584 var collapsed = typeof collapseToStart == "undefined" ? true : false; 585 585 var sel = this.getSelection(); 586 586 range = this._doc.createRange(); … … 596 596 sel.removeAllRanges(); 597 597 sel.addRange(range); 598 if (typeof pos!= "undefined")599 { 600 if ( pos)598 if (typeof collapseToStart != "undefined") 599 { 600 if (collapseToStart) 601 601 { 602 602 sel.collapse(range.startContainer, range.startOffset);
