Changeset 998
- Timestamp:
- 05/01/08 12:33:36 (5 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
XinhaCore.js (modified) (4 diffs)
-
modules/Gecko/Gecko.js (modified) (1 diff)
-
modules/WebKit/WebKit.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r994 r998 698 698 699 699 700 /** Sometimes we want to be able to replace some string in the html com ng in and going out700 /** Sometimes we want to be able to replace some string in the html coming in and going out 701 701 * so that in the editor we use the "internal" string, and outside and in the source view 702 702 * we use the "external" string this is useful for say making special codes for … … 708 708 */ 709 709 this.specialReplacements = {}; //{ 'html_string' : 'wysiwyg_string' } 710 711 /** A filter function for the HTML used inside the editor<br /> 712 * Default: function (html) { return html } 713 * 714 * @param {String} html The whole document's HTML content 715 * @return {String} The processed HTML 716 */ 717 this.inwardHtml = function (html) { return html } 718 719 /** A filter function for the generated HTML<br /> 720 * Default: function (html) { return html } 721 * 722 * @param {String} html The whole document's HTML content 723 * @return {String} The processed HTML 724 */ 725 this.outwardHtml = function (html) { return html } 710 726 711 727 /** Set to true if you want Word code to be cleaned upon Paste. This only works if … … 4880 4896 html = Xinha.stripCoreCSS(html); 4881 4897 } 4882 4898 4899 if (typeof this.config.outwardHtml == 'function' ) 4900 { 4901 html = this.config.outwardHtml(html); 4902 } 4903 4883 4904 return html; 4884 4905 }; … … 4926 4947 html = Xinha.addCoreCSS(html); 4927 4948 } 4928 4949 4950 if (typeof this.config.inwardHtml == 'function' ) 4951 { 4952 html = this.config.inwardHtml(html); 4953 } 4954 4929 4955 return html; 4930 4956 }; -
trunk/modules/Gecko/Gecko.js
r981 r998 782 782 try 783 783 { 784 this._iframe.contentWindow.find( this.cc ); 785 var sel = this.getSelection(); 786 sel.getRangeAt(0).deleteContents(); 787 this.scrollToElement(); 784 var doc = this._doc; 785 doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(this.cc),'<span id="XinhaEditingPostion"></span>'); 786 var posEl = doc.getElementById('XinhaEditingPostion'); 787 this.selectNodeContents(posEl); 788 posEl.scrollIntoView(true); 789 posEl.parentNode.removeChild(posEl); 790 788 791 this._iframe.contentWindow.focus(); 789 792 } catch (e) {} -
trunk/modules/WebKit/WebKit.js
r963 r998 772 772 { 773 773 var self = this; 774 window.setTimeout(function () // something's not working? try a timeout ;) 775 { 776 try 777 { 778 if( self._iframe.contentWindow.find( self.cc ) ) 779 { 780 var sel = self.getSelection(); 781 sel.getRangeAt(0).deleteContents(); 782 sel.collapseToStart(); 783 self._iframe.contentWindow.focus(); 784 } 785 } catch (e) {alert(e)} 786 } 787 ,200); 774 try 775 { 776 var doc = this._doc; 777 doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(this.cc),'<span id="XinhaEditingPostion"></span>'); 778 var posEl = doc.getElementById('XinhaEditingPostion'); 779 this.selectNodeContents(posEl); 780 this.scrollToElement(posEl); 781 posEl.parentNode.removeChild(posEl); 782 783 this._iframe.contentWindow.focus(); 784 } catch (e) {} 788 785 } 789 786 };
