Update of /cvsroot/php-blog/serendipity/htmlarea
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11472
Modified Files:
htmlarea.js
Log Message:
IE strips leading '/' from inserted images. It shouldn't, because viewing
images in /archives/ then links to the wrong path.
Index: htmlarea.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/htmlarea.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- htmlarea.js 25 Mar 2004 10:50:46 -0000 1.3
+++ htmlarea.js 25 Mar 2004 14:25:52 -0000 1.4
@@ -1936,7 +1936,11 @@
var blockTags = " body form textarea fieldset ul ol dl li div " +
"p h1 h2 h3 h4 h5 h6 quote pre table thead " +
"tbody tfoot tr td iframe address ";
- return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+ if (el && el.tagName) {
+ return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+ } else {
+ return false;
+ }
};
HTMLArea.needsClosingTag = function(el) {
@@ -2061,7 +2065,7 @@
// strip host-part of URL which is added by MSIE to links relative to server root
baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
basere = new RegExp(baseurl);
- return string.replace(basere, "");
+ return '/' + string.replace(basere, "");
};
String.prototype.trim = function() {
|