Announcement

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

#1 2005-04-06 17:32:31

KingMoore
Xinha Community Member
Registered: 2005-04-06
Posts: 23

// external stylesheets to load (REFERENCE THESE ABSOLUTELY)

this setting is from htmlarea.js line 179. i have had to set it like this and it works:

// external stylesheets to load (REFERENCE THESE ABSOLUTELY)
  this.pageStyleSheets = ["http://www.mydomain.com/style/style.css"];

that works, but it causes problems, because i am using this on lots of different sites and it would be very useful if i could use a relative path. I actually created my own hack for this in the old HTMLAREA like this:

        editor._doc = doc;
        if (!editor.config.fullPage) {
            doc.open();
            var html = "<html>\n";
            html += "<head>\n";
            if (editor.config.baseURL)
                html += '<base href="' + editor.config.baseURL + '" />';
            html += "<style>" + editor.config.pageStyle +
                " html,body { border: 0px; }</style>\n";
        //STYLE SHEET HACK
            html += "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/style.css\" />\n";
        //****************
            html += "</head>\n";
            html += "<body>\n";

but it looks like some functionality has been added to Xinha to basically do exactly what i was trying to do... however i can no longer do it relatively. is there any way that I can accomplish this? Thanks.

Last edited by KingMoore (2005-04-06 17:33:34)

Offline

#2 2005-04-07 11:01:55

KingMoore
Xinha Community Member
Registered: 2005-04-06
Posts: 23

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

any ideas how to reference a relative style sheet?

Offline

#3 2005-04-07 13:40:00

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

this.pageStyleSheets does exactly the same as your hack!
if you look at the code:

      if(typeof editor.config.pageStyleSheets !== 'undefined')
      {
        for(style_i = 0; style_i < editor.config.pageStyleSheets.length; style_i++)
        {
          if(editor.config.pageStyleSheets[style_i].length > 0)
              html += "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + editor.config.pageStyleSheets[style_i] + "\">";
            //html += "<style> @import url('" + editor.config.pageStyleSheets[style_i] + "'); </style>\n";
        }
      }

you see that you can use any url here....


so that realtive urls don't work anymore might be another problem?

...but whats the problem with absolute urls anyway?


Niko

Offline

#4 2005-04-07 15:39:31

KingMoore
Xinha Community Member
Registered: 2005-04-06
Posts: 23

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

yeah that is what i was thinking. but i am confused because before i had

../style/style.css

and it worked fine... now it doesn't.

i can't use absolute URLs because they would need to be manually changed for every site I place this on and I am trying to avoid that. I was able to avoid it with HTMLArea using ../style/style.css

Offline

#5 2005-04-08 02:53:35

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

hmm... look at your web-server-logs if the css-file is requested, or use a sniffer or the Live Http Headers-extension for FF


Niko

Offline

#6 2005-04-12 13:05:37

KingMoore
Xinha Community Member
Registered: 2005-04-06
Posts: 23

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

I do not understand.

Offline

#7 2005-04-12 14:09:53

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

...for debug-purpose you might want to know if the browser requests the css-file (or WHAT css-file the browser requests)
and i told you some ways how you can do that
(i'm sure there others/betters? too)


Niko

Offline

#8 2005-04-13 13:37:12

KingMoore
Xinha Community Member
Registered: 2005-04-06
Posts: 23

Re: // external stylesheets to load (REFERENCE THESE ABSOLUTELY)

thanks.

Offline

Board footer

Powered by FluxBB