Changeset 261
- Timestamp:
- 07/16/05 23:36:48 (8 years ago)
- Files:
-
- 1 modified
-
trunk/htmlarea.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htmlarea.js
r260 r261 245 245 // that don't have a url prefixing them 246 246 this.stripSelfNamedAnchors = true; 247 248 // sometimes high-ascii in links can cause problems for servers (basically they don't recognise them) 249 // so you can use this flag to ensure that all characters other than the normal ascii set (actually 250 // only ! through ~) are escaped in URLs to % codes 251 this.only7BitPrintablesInURLs = true; 247 252 248 253 // sometimes we want to be able to replace some string in the html comng in and going out … … 1948 1953 { 1949 1954 var html = this.outwardHtml(this.getHTML()); 1950 this. _textArea.value = html;1955 this.setHTML(html); 1951 1956 1952 1957 // Hide the iframe … … 1969 1974 var html = this.inwardHtml(this.getHTML()); 1970 1975 this.deactivateEditor(); 1971 if (!this.config.fullPage) 1972 { 1973 this._doc.body.innerHTML = html; 1974 } 1975 else 1976 { 1977 this.setFullHTML(html); 1978 } 1976 this.setHTML(html); 1979 1977 this._iframe.style.display = ''; 1980 1978 this._textArea.style.display = "none"; … … 4238 4236 // completely change the HTML inside 4239 4237 HTMLArea.prototype.setHTML = function(html) { 4240 switch (this._editMode) 4241 { 4242 case "wysiwyg" : 4243 { 4244 if (!this.config.fullPage) 4245 { 4246 this._doc.body.innerHTML = html; 4247 } 4248 else 4249 { 4250 this.setFullHTML(html); 4251 } 4252 } 4253 break; 4254 4255 case "textmode" : 4256 { 4257 this._textArea.value = html; 4258 } 4259 break; 4260 4261 default : 4262 { 4263 alert("Mode <" + mode + "> not defined!"); 4264 } 4265 break; 4266 } 4267 return false; 4238 if (!this.config.fullPage) 4239 { 4240 this._doc.body.innerHTML = html; 4241 } 4242 else 4243 { 4244 this.setFullHTML(html); 4245 } 4246 this._textArea.value = html; 4268 4247 }; 4269 4248 … … 4712 4691 value = editor.stripBaseURL(value); 4713 4692 } 4693 4694 // High-ascii (8bit) characters in links seem to cause problems for some sites, 4695 // while this seems to be consistent with RFC 3986 Section 2.4 4696 // because these are not "reserved" characters, it does seem to 4697 // cause links to international resources not to work. See ticket:167 4698 4699 // IE always returns high-ascii characters un-encoded in links even if they 4700 // were supplied as % codes (it unescapes them when we pul the value from the link). 4701 4702 // Hmmm, very strange if we use encodeURI here, or encodeURIComponent in place 4703 // of escape below, then the encoding is wrong. I mean, completely. 4704 // Nothing like it should be at all. Using escape seems to work though. 4705 // It's in both browsers too, so either I'm doing something wrong, or 4706 // something else is going on? 4707 4708 if(editor.config.only7BitPrintablesInURLs) 4709 { 4710 value = value.replace(/([^!-~]+)/g, function(match) { return escape(match); }); 4711 } 4714 4712 } 4715 4713 } else { // IE fails to put style in attributes list … … 4755 4753 return html; 4756 4754 }; 4755 4756 /** @see getHTMLWrapper (search for "value = a.nodeValue;") */ 4757 4757 4758 4758 HTMLArea.prototype.stripBaseURL = function(string)
