From: unknown Date: Fri, 8 Aug 2008 14:01:54 +0000 (+0200) Subject: fixed a bug with wrong opdatering and robot site names using the LIVE_SITENAME variable X-Git-Url: https://git.jkkn.net/?a=commitdiff_plain;h=dd6ec345e01ca01e1719ec276674153bb82d47d2;p=tv2developer fixed a bug with wrong opdatering and robot site names using the LIVE_SITENAME variable --- diff --git a/content/tv2developer.js b/content/tv2developer.js index eb5dce4..d42e42b 100644 --- a/content/tv2developer.js +++ b/content/tv2developer.js @@ -178,6 +178,7 @@ var TV2Developer = { _reg_i2files: /\/([0-9]+)-/, _reg_fromviewcvs: /^http:\/\/viewcvs\.tv2.dk:7467\/cgi-bin\/viewvc\.cgi\/([^/]+)\.tv2\.dk\/(webroot|robot|opdatering|template)([^#\?]+)/, _reg_fromi2if: /^\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(\?|&)url=([^&]+)/, + _reg_cutdomain: /^(.*)\.tv2\.dk$/, getLinks: function() { var links = new Array(); var currentURL = getBrowser().currentURI.spec; @@ -203,27 +204,34 @@ var TV2Developer = { // php4 site var php4 = this._isPhp4(tv2_sitename); var testType = php4 ? '3' : ''; - - // Find live, test and snapshot url for current site - var liveurl; - var live_sitename = (tv2_sitename=='www') ? '' : tv2_sitename+'.'; - var live_sitename_complete = live_sitename + 'tv2.dk'; - var cvs_sitename = tv2_sitename ? tv2_sitename : 'www'; // Handle sites with aliases (e.g. ol2008.tv2.dk is ol.tv2.dk on live... ) + var cvs_sitename; + var live_sitename = tv2_sitename; + var docWin = getBrowser().contentWindow; if (docWin.wrappedJSObject) { var docObj = docWin.wrappedJSObject; if (docObj.TV2_PROJECTNAME) { - var nodomain = /^(.*)\.tv2\.dk$/.exec(docObj.TV2_PROJECTNAME); + var nodomain = this._reg_cutdomain.exec(docObj.TV2_PROJECTNAME); if (nodomain) { cvs_sitename = nodomain[1]; } } if (docObj.TV2_LIVESITE) { - live_sitename_complete = docObj.TV2_LIVESITE; + var nodomain = this._reg_cutdomain.exec(docObj.TV2_LIVESITE); + if (nodomain) { + live_sitename = nodomain[1]; + } } } + + // Find live, test and snapshot url for current site + var liveurl; + var live_sitename_complete = (live_sitename=='www') ? '' : live_sitename+'.' + 'tv2.dk'; + if (!cvs_sitename) { + cvs_sitename = tv2_sitename ? tv2_sitename : 'www'; + } // Construct corresponding live URL if (tv2_testsite) { // test or snapshot @@ -259,7 +267,7 @@ var TV2Developer = { links.push(new this.TV2LinkSplit()); // Add link to .opdatering, .template, .robot - var _prefix = cvs_sitename + (tv2_user ? '.' + tv2_user : ''); + var _prefix = (tv2_testsite ? cvs_sitename : live_sitename) + (tv2_user ? '.' + tv2_user : ''); var _postfix = (tv2_testsite ? '.' + tv2_testsite : '') + '.tv2.dk'; var opdatering = _prefix + '.opdatering' + _postfix; //var template = _prefix + '.template' + _postfix; diff --git a/version b/version index 5712157..5eef0f1 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.10.1 +0.10.2