_reg_git_indexphpfolders: /^\/(((opdatering|webroot)(\/|$)|\/))/,
_reg_git_dnsdomains: /^\/(tv2|tv2news|tv2film|sputnik|charlie|zulu)(\.|\.d|\.dk)?$/,
_sitetypes: ['opdatering', 'robot', 'template'],
- _envs: ['test', 'snapshot'],
+ _envs: ['test', 'snapshot', 'stage'],
updateQuickbox: function(manual) {
if (!manual) manual = false;
var current_user = TV2Util.getPref('developer-initials');
_reg_viewgitbranch1: /[?;&]hb=php4[&;#]?/,
_reg_viewgitbranch2: /[?;&]h=refs\/heads\/php4[&;#]?/,
_reg_viewgitviewtype: /[?;&]a=(blob|tree|history)[&;#]?/,
- _reg_fromi2if: /^http:\/\/i2\.(?:[^.]+\.)?opdatering\.(?:php5\.(?:test|snapshot)\.)?tv2\.dk\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(?:\?|&)url=([^&]+)/,
- _reg_fromloginif: /^http:\/\/login\.(?:([^.]+)\.)?opdatering\.(?:php5\.(test|snapshot)\.)?tv2\.dk\/opslag\.php.*?(?:\?|&)(user_id|username)=([^&]+)/,
+ _reg_fromi2if: /^http:\/\/i2\.(?:[^.]+\.)?opdatering\.(?:php5\.(?:test|snapshot|stage)\.)?tv2\.dk\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(?:\?|&)url=([^&]+)/,
+ _reg_fromloginif: /^http:\/\/login\.(?:([^.]+)\.)?opdatering\.(?:php5\.(test|snapshot|stage)\.)?tv2\.dk\/opslag\.php.*?(?:\?|&)(user_id|username)=([^&]+)/,
_reg_frombugzilla: /^http:\/\/bugzilla\.tv2\.dk\/(show_bug.cgi.*?(?:\?|&)id=([0-9]+))?/,
_extractURL: function(paramUrl) {
var action = 'go-site';
} else {
url += '.t'; // test
}
+ } else if (env == 'stage') {
+ url += '.st'; // stage
} else {
url += '.s'; // snapshot
}
},
/* Main function for adding all the links for the menu popup */
- _reg_tv2: /^https?:\/\/([^/.]*)?([^/]*?)(\.(robot|opdatering|template)\.?)?(\.(php4|php5)\.?)?(\.((test|snapshot)3?)\.)?tv2\.dk((\/[^#\?]*).*)?$/,
+ _reg_tv2: /^https?:\/\/([^/.]*)?([^/]*?)(\.(robot|opdatering|template)\.?)?(\.(php4|php5)\.?)?(\.((test3?|snapshot3?|stage))\.)?tv2\.dk((\/[^#\?]*).*)?$/,
_reg_php: /^(.*\.php)/,
_reg_nodeid: /([0-9]{2,})/g,
_reg_i2files: /\/([0-9]+)-/,
}
}
- // Find live, test and snapshot url for current site
+ // Find live, test, stage and snapshot url for current site
var liveurl;
var live_sitename_complete = ((live_sitename=='www') ? '' : live_sitename+'.') + 'tv2.dk';
if (!git_sitename) {
}
// Construct corresponding live URL
- if (tv2_testsite) { // test or snapshot
+ if (tv2_testsite) { // test, snapshot or stage
if (tv2_sitetype) { /* opdatering, ... */
liveurl = tv2_sitename+'.'+tv2_sitetype+'.tv2.dk';
} else {
var testprompturl = git_sitename+'.'+'?'+(tv2_sitetype?'.'+tv2_sitetype:'')+'.'+tv2_apptype+'.test'+'.tv2.dk';
var testurl = git_sitename+'.'+initials+(tv2_sitetype?'.'+tv2_sitetype:'')+'.'+tv2_apptype+'.test'+'.tv2.dk';
var snapshoturl = git_sitename+(tv2_sitetype?'.'+tv2_sitetype:'')+'.'+tv2_apptype+'.snapshot'+'.tv2.dk';
+ var stageurl = git_sitename+(tv2_sitetype?'.'+tv2_sitetype:'')+'.'+tv2_apptype+'.stage'+'.tv2.dk';
// Add the two urls we are not at
- if (!tv2_testsite) { // always add swaps to snapshot and the test site
+ if (!tv2_testsite) { // always add swaps to stage, snapshot and the test site
links.push(new this.TV2Link('test_live_swap', testurl, tv2_uri, TV2Util.getStr('test.accesskey')));
links.push(new this.TV2Link('snapshot_live_swap', snapshoturl, tv2_uri, TV2Util.getStr('snapshot.accesskey')));
+ links.push(new this.TV2Link('stage_live_swap', stageurl, tv2_uri, TV2Util.getStr('stage.accesskey')));
links.push(new this.TV2Link('testprompt_swap', testprompturl, tv2_uri, TV2Util.getStr('testprompt.accesskey'), 'promptInitials'));
} else if (tv2_testtype == 'snapshot') {
links.push(new this.TV2Link('snapshot_live_swap', liveurl, tv2_uri, TV2Util.getStr('live.accesskey')));
+ links.push(new this.TV2Link('snapshot_stage_swap', stageurl, tv2_uri, TV2Util.getStr('stage.accesskey')));
links.push(new this.TV2Link('test_snapshot_swap', testurl, tv2_uri, TV2Util.getStr('test.accesskey')));
links.push(new this.TV2Link('testprompt_swap', testprompturl, tv2_uri, TV2Util.getStr('testprompt.accesskey'), 'promptInitials'));
+ } else if (tv2_testtype == 'stage') {
+ links.push(new this.TV2Link('stage_live_swap', liveurl, tv2_uri, TV2Util.getStr('live.accesskey')));
+ links.push(new this.TV2Link('snapshot_stage_swap', snapshoturl, tv2_uri, TV2Util.getStr('stage.accesskey')));
+ links.push(new this.TV2Link('test_stage_swap', testurl, tv2_uri, TV2Util.getStr('test.accesskey')));
+ links.push(new this.TV2Link('testprompt_swap', testprompturl, tv2_uri, TV2Util.getStr('testprompt.accesskey'), 'promptInitials'));
} else { // must be test
links.push(new this.TV2Link('test_live_swap', liveurl, tv2_uri, TV2Util.getStr('live.accesskey')));
links.push(new this.TV2Link('test_snapshot_swap', snapshoturl, tv2_uri, TV2Util.getStr('snapshot.accesskey')));
+ links.push(new this.TV2Link('test_stage_swap', stageurl, tv2_uri, TV2Util.getStr('stage.accesskey')));
if (tv2_user != initials) {
links.push(new this.TV2Link('test_swap', testurl, tv2_uri, TV2Util.getStr('test.accesskey')));
}
gitweb_type = 'gitweb_live';
} else if (tv2_testtype == 'snapshot') {
gitweb_type = 'gitweb_snapshot';
+ } else if (tv2_testtype == 'stage') {
+ gitweb_type = 'gitweb_stage';
} else {
gitweb_type = 'gitweb_test';
}
links.push(new this.TV2Link('gitweb_live', live_sitename + type + 'tv2.dk', tv2_uri, TV2Util.getStr('live.accesskey')));
links.push(new this.TV2Link('gitweb_test', tv2_sitename + '.' + initials + '.' + type + appType + 'test' + '.tv2.dk', tv2_uri, TV2Util.getStr('test.accesskey')));
links.push(new this.TV2Link('gitweb_snapshot', tv2_sitename + '.' + type + appType + 'snapshot' + '.tv2.dk', tv2_uri, TV2Util.getStr('snapshot.accesskey')));
+ links.push(new this.TV2Link('gitweb_stage', tv2_sitename + '.' + type + appType + 'stage' + '.tv2.dk', tv2_uri, TV2Util.getStr('stage.accesskey')));
links.push(new this.TV2Link('gitweb_testprompt', tv2_sitename + '.?.' + type + appType + 'test' + '.tv2.dk', tv2_uri, TV2Util.getStr('testprompt.accesskey'), 'promptInitials'));
} else {