fixed a bug with wrong opdatering and robot site names using the LIVE_SITENAME variable
authorunknown <JKKN@.tv2.local>
Fri, 8 Aug 2008 14:01:54 +0000 (16:01 +0200)
committerunknown <JKKN@.tv2.local>
Fri, 8 Aug 2008 14:01:54 +0000 (16:01 +0200)
content/tv2developer.js
version

index eb5dce4a30adbff791aa497439f49e38b8036d19..d42e42b577a042005c932047a5c0ef7b49d5b9b2 100644 (file)
@@ -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 571215736a666e8d79d7a7958b5ffc400514fb53..5eef0f10e8cd5cac36342fc9b6dc9855e024361f 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.10.1
+0.10.2