Update of /cvsroot/php-blog/serendipity/htmlarea
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8163/htmlarea
Modified Files:
htmlarea.js
Log Message:
hopefully finally fixed the IE-Slash-prefixing for links within the WYSIWYG
editor.
Tested with those URLs:
<a href="uploads/angel.jpg">relative</a><br />
<a href="/serendipity/uploads/angel.jpg">absolute</a><br />
<a href="/index.php">outside absolute</a><br />
<a href="http://www.supergarv.de/">outside full absolute</a><br />
<a href="http://www.supergarv.de/serendipity/index.php">inside full
absolute</a><br /><a
href="http://www.supergarv.de/path/index.php">pathed</a><br /><a
href="http://www.google.de/">google</a><br />
which will all get rewritten to use 'http://www.supergarv.de/' now. Sadly
this introduces a full absolute URL scope, but it's the only way I've gotten
it to work, since IE does some nasty, unasked URL-replacing internally.
Index: htmlarea.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htmlarea/htmlarea.js,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- htmlarea.js 13 Apr 2004 10:15:08 -0000 1.5
+++ htmlarea.js 7 Jun 2004 10:39:25 -0000 1.6
@@ -2058,13 +2058,14 @@
var baseurl = this.config.baseURL;
// strip to last directory in case baseurl points to a file
baseurl = baseurl.replace(/[^\/]+$/, '');
+ _baseurl = baseurl;
var basere = new RegExp(baseurl);
- string = string.replace(basere, "/");
+ string = string.replace(basere, this.config.baseURL);
// 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, baseurl);
};
String.prototype.trim = function() {
|