Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 Re: User Discussion & Help » How to remove the baseURL... » 2005-04-13 00:38:04

RwD

*kick*

I take it nobody ever noticed this, nobody knows anything about this and it is just me roll

#2 User Discussion & Help » How to remove the baseURL... » 2005-04-08 06:37:58

RwD
Replies: 1

I had this problem in IE with the baseURL being attached to any link I made not containing http://
So when I created any link IE prepended http://localhost/ to it (as long as http:// wasn't in). This, obviously, is a test on my localhost but the problem also occurred on the online domain.

Now I found a part in the code that handles this (HTMLArea.prototype.stripBaseURL) but it was not functional the way I expected it.

After putting in some alert statements I found out why the url was not transformed because alert(string.replace(basere, "")); returned "http://null/index.php" rather then the displayed "http://localhost/index.php" in the textarea. Well it may be obvious that after finding the problem I took the path of the least resistance and changed the basere variable to "http://null/" which indeed fixed the entire problem.

I do not know why this problem occurs at all as the comments suggest this code is meant to fix the problem allready so that's why I am asking if someone can explain this to me. So this is not a bug report yet; I'll add that if people here can confirm this is in fact a bug and not something wrong on my side. The changed version of the disfunctional function is added below.

Anybody?? tongue

HTMLArea.prototype.stripBaseURL = function(string) {
  var baseurl = this.config.baseURL;

  // strip to last directory in case baseurl points to a file
  baseurl = baseurl.replace(/[^\/]+$/, '');
  var basere = new RegExp(baseurl);
  string = string.replace(basere, "");

  // 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);
  basere = 'http://null/';
  return string.replace(basere, "");
};

#3 Re: User Discussion & Help » Newbie Guide » 2005-03-21 09:07:22

RwD

This is in the Newbie Guide:

      /** STEP 3 ***************************************************************
       * We first create editors for the textareas.
       *
       * You can do this in two ways, either
       *
       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
       *
       * if you want all the editor objects to use the same set of plugins, OR;
       *
       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
       *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
       *
       * if you want to use a different set of plugins for one or more of the
       * editors.
       ************************************************************************/

However, "registerPlugins" is not a function existing anywhere in the code at all.

I created this function to make a functional registerPlugins function that I put somewhere in the htmlarea.js:
    HTMLArea.prototype.registerPlugins = function(plugin_names)
    {
      if(plugin_names)
      {
        for(var i = 0; i < plugin_names.length; i++)
        {
          this.registerPlugin(eval(plugin_names[i]));
        }
      }
    }

What I basically did was copy the code from the makeeditors function and add it in the new HTMLArea method called registerPlugins.

Board footer

Powered by FluxBB