window.open(uri, "_blank", winopts);
}
+ function url_prefix(url) {
+ if (url.match(/^\//)) url = urls.remote + url;
+ if (! url.match(/^(http|chrome):\/\//) && ! url.match(/^data:/) ) url = 'http://' + url;
+ dump('url_prefix = ' + url + '\n');
+ return url;
+ }
if (typeof data.modal_xulG_stack == 'undefined') data.modal_xulG_stack = {};
/* FIXME - not a perfect key.. could imagine two top-level windows both opening modal windows */
key = url;
- if (typeof xulG == 'object') if (typeof xulG.url_prefix == 'function') {
- key = key.replace( xulG.url_prefix('/'), '/' );
- }
+ if (typeof xulG == 'object') {
+ if (typeof xulG.url_prefix == 'function') {
+ key = key.replace( xulG.url_prefix('/'), '/' );
+ }
+ } else if (typeof url_prefix == 'function') {
+ key = key.replace( url_prefix('/'), '/' );
+ }
if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = [];
data.modal_xulG_stack[key].push( my_xulG );
data.stash('modal_xulG_stack');