[Mozile] path problems

James A. Overton james at overton.ca
Tue Dec 19 14:41:08 PST 2006


Thanks for the patch. But I see a problem: if the mozile.root doesn't  
end with a slash, the last part of it will be removed and the path  
will be broken again.

It would be better to add a mozile.setRoot(root) method and use it in  
every configuration.

mozile.setRoot = function(root) {
	if(!root) root = mozile.findRoot();
	if(root.length && root.charAt(root.length-1) == "/") root =  
root.substring(0, root.length-1);
	mozile.root = root;
}

That gets to the "root" of the problem. What do you think?

James


On 2006-Dec-19, at 4:54 PM, Reto Bachmann-Gmür wrote:

> with this patch images and the toolbar css are resolved consistently
> with the rng path, i.e. with the default config the request no longer
> contain a double-slash:
>
> Index: htmlToolbar.js
> ===================================================================
> RCS file: /cvs/mozile/www/0.8/src/gui/htmlToolbar.js,v
> retrieving revision 1.12
> diff -r1.12 htmlToolbar.js
> 176c176,177
> <     var src = [mozile.root, "images", name +
> filetype].join(mozile.filesep);
> ---
>>     var rootPath = mozile.root.substring(0,mozile.root.lastIndexOf 
>> ('/'));
>>     var src = [rootPath, "images", name + filetype].join 
>> (mozile.filesep);
> 203c204,205
> <     var href = [mozile.root, "src", "gui",
> "htmlToolbar.css"].join(mozile.filesep);
> ---
>>     var rootPath = mozile.root.substring(0,mozile.root.lastIndexOf 
>> ('/'));
>>     var href = [rootPath, "src", "gui",
> "htmlToolbar.css"].join(mozile.filesep);
>
>
>
> reto
>
> James A. Overton wrote:
>> Damn. I thought I'd fixed the path stuff. See core.js for the gory
>> details, maybe there's a simple fix.
>>
>> Is there a reason why you need to use "./lib/xhtml.rng"instead of
>> "lib/xhtml.rng"?
>>
>> James
>>
>>
>> On 2006-Dec-19, at 4:52 AM, Reto Bachmann-Gmür wrote:
>>
>>
>>> When I set
>>>
>>> mozile.root = "../scripts/mozile";
>>> mozile.useSchema("./lib/xhtml.rng");
>>>
>>> Mozile tries to load ../scripts/lib/xhtml.rng, whcih is not where
>>> it is.
>>>
>>> But when I set
>>>
>>> mozile.root = "../scripts/mozile/";
>>>
>>> The rng is loaded from the correct place but it fails to load the
>>> icons,
>>> as their URLs contain one additional slash as in:
>>>
>>> ../scripts/mozile//images/Mozile-16.png
>>>
>>> Cheers,
>>> Reto
>>>
>>> _______________________________________________
>>> Mozile mailing list
>>> Mozile at mozdev.org
>>> http://mozdev.org/mailman/listinfo/mozile
>>>
>>
>> _______________________________________________
>> Mozile mailing list
>> Mozile at mozdev.org
>> http://mozdev.org/mailman/listinfo/mozile
>>
>
>
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile



More information about the Mozile mailing list