From 3d1836aa494e0910e60622afdc49b8f25c812089 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 28 Jan 2015 10:17:44 +0000 Subject: [PATCH] need to split off domain first, as it could contain app-name part of template eg. stylite.report.xet and https://my.stylite.de/egw/... --- etemplate/js/etemplate2.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 9f1c49ce09..22bd2a1b7e 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -324,7 +324,17 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) { this.name = _name; // store top-level template name to have it available in widgets // store template base url, in case initial template is loaded via webdav, to use that for further loads too - this.template_base_url = _url.split(_name.split('.').shift())[0]; + // need to split off domain first, as it could contain app-name part of template eg. stylite.report.xet and https://my.stylite.de/egw/... + if (_url[0] != '/') + { + this.template_base_url = _url.match(/https?:\/\/[^/]+/).shift(); + _url = _url.split(this.template_base_url)[1]; + } + else + { + this.template_base_url = ''; + } + this.template_base_url += _url.split(_name.split('.').shift())[0]; egw().debug("info", "Loaded data", _data); var currentapp = this.app = _data.currentapp || window.egw_appName;