_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;
// 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
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;