document.getElementById('mac-accesskeys').checked =
(this._keyBranch.getIntPref('menuAccessKey') != 0);
}
- // fill in php5 sites
- this.php5sitesFillIn(TV2Util.getPref('php5sites', ''));
- document.getElementById('php5auto').selectedIndex =
- (TV2Util.hasPref('php5sites') ? 1 : 0);
+ // fill in php4 sites
+ this.php4sitesFillIn(TV2Util.getPref('php4sites', ''));
+ document.getElementById('php4auto').selectedIndex =
+ (TV2Util.hasPref('php4sites') ? 1 : 0);
},
/* fill in list */
- php5sitesFillIn: function(php5set) {
- var php5sites = php5set.split(',').sort();
- var php5list = document.getElementById('php5sites');
- var child = php5list.childNodes;
+ php4sitesFillIn: function(php4set) {
+ var php4sites = php4set.split(',').sort();
+ var php4list = document.getElementById('php4sites');
+ var child = php4list.childNodes;
for (var i=child.length-1; i>=0; --i) {
if (child[i].tagName == 'listitem') {
- php5list.removeChild(child[i]);
+ php4list.removeChild(child[i]);
}
}
- for (var i=0; i<php5sites.length; i++) {
- if (php5sites[i] == '') continue;
- var php5item = document.createElement('listitem');
- php5item.setAttribute('label', php5sites[i]);
- php5list.appendChild(php5item);
+ for (var i=0; i<php4sites.length; i++) {
+ if (php4sites[i] == '') continue;
+ var php4item = document.createElement('listitem');
+ php4item.setAttribute('label', php4sites[i]);
+ php4list.appendChild(php4item);
}
},
- php5sitesSelect: function(obj) {
- document.getElementById('php5sites_remove').disabled = (obj.selectedItem) ? false : true;
+ php4sitesSelect: function(obj) {
+ document.getElementById('php4sites_remove').disabled = (obj.selectedItem) ? false : true;
},
- php5sitesAdd: function(obj) {
- var add = prompt(TV2Util.getStr('optionsDialog.enterphp5site'), '');
+ php4sitesAdd: function(obj) {
+ var add = prompt(TV2Util.getStr('optionsDialog.enterphp4site'), '');
if (add && add != '') {
- var php5sites = document.getElementById('php5sites');
- var php5childs = php5sites.childNodes;
+ var php4sites = document.getElementById('php4sites');
+ var php4childs = php4sites.childNodes;
var insertBefore = null;
// place at right sorted place in list
- for (var i=0; i<php5childs.length; i++) {
- if (php5childs[i].tagName == 'listitem') {
- var item = php5childs[i].getAttribute('label');
+ for (var i=0; i<php4childs.length; i++) {
+ if (php4childs[i].tagName == 'listitem') {
+ var item = php4childs[i].getAttribute('label');
if (item > add) {
- insertBefore = php5childs[i];
+ insertBefore = php4childs[i];
break;
}
}
}
var newItem = document.createElement('listitem');
newItem.setAttribute('label', add);
- php5sites.insertBefore(newItem, insertBefore);
- php5sites.selectedItem = newItem;
+ php4sites.insertBefore(newItem, insertBefore);
+ php4sites.selectedItem = newItem;
this.update();
- php5sites.focus();
+ php4sites.focus();
}
},
- php5sitesRemove: function(obj) {
- var php5sites = document.getElementById('php5sites');
- php5sites.removeChild(php5sites.selectedItem);
+ php4sitesRemove: function(obj) {
+ var php4sites = document.getElementById('php4sites');
+ php4sites.removeChild(php4sites.selectedItem);
this.update();
- php5sites.focus();
+ php4sites.focus();
},
- php5sitesAuto: function(obj) {
- var php5sites = document.getElementById('php5sites');
+ php4sitesAuto: function(obj) {
+ var php4sites = document.getElementById('php4sites');
var useDefaults = (obj.selectedIndex == 0);
- if (useDefaults && !php5sites.disabled) {
- this.php5sitesFillIn(TV2Util.getDefaultPref('php5sites'));
+ if (useDefaults && !php4sites.disabled) {
+ this.php4sitesFillIn(TV2Util.getDefaultPref('php4sites'));
} else {
- php5sites.focus();
+ php4sites.focus();
}
- php5sites.disabled = useDefaults;
- document.getElementById('php5sites_add').disabled = useDefaults;
+ php4sites.disabled = useDefaults;
+ document.getElementById('php4sites_add').disabled = useDefaults;
this.update();
},
this._keyBranch.clearUserPref('menuAccessKey');
}
}
- // save php5 sites list
- var php5auto = document.getElementById('php5auto');
- if (php5auto.selectedIndex == 1) {
- var php5childs = document.getElementById('php5sites').childNodes;
- var php5sites = [];
- for (var i=0; i<php5childs.length; i++) {
- if (php5childs[i].tagName == 'listitem') {
- php5sites.push(php5childs[i].getAttribute('label'));
+ // save php4 sites list
+ var php4auto = document.getElementById('php4auto');
+ if (php4auto.selectedIndex == 1) {
+ var php4childs = document.getElementById('php4sites').childNodes;
+ var php4sites = [];
+ for (var i=0; i<php4childs.length; i++) {
+ if (php4childs[i].tagName == 'listitem') {
+ php4sites.push(php4childs[i].getAttribute('label'));
}
}
- TV2Util.setPref('php5sites', php5sites.join(','));
+ TV2Util.setPref('php4sites', php4sites.join(','));
} else {
- if (TV2Util.hasPref('php5sites')) {
- TV2Util.clearPref('php5sites');
+ if (TV2Util.hasPref('php4sites')) {
+ TV2Util.clearPref('php4sites');
}
}
},
</groupbox>
<groupbox>
- <caption label="&optionsDialog.php5sites.label;" tooltiptext="&optionsDialog.php5sites.tooltiptext;"/>
- <radiogroup id="php5auto" onselect="TV2Options.php5sitesAuto(this)">
- <radio label="&optionsDialog.php5sites.defaults;"/>
- <radio label="&optionsDialog.php5sites.custom;"/>
+ <caption label="&optionsDialog.php4sites.label;" tooltiptext="&optionsDialog.php4sites.tooltiptext;"/>
+ <radiogroup id="php4auto" onselect="TV2Options.php4sitesAuto(this)">
+ <radio label="&optionsDialog.php4sites.defaults;"/>
+ <radio label="&optionsDialog.php4sites.custom;"/>
</radiogroup>
- <listbox id="php5sites" onselect="TV2Options.php5sitesSelect(this)"/>
+ <listbox id="php4sites" onselect="TV2Options.php4sitesSelect(this)"/>
<hbox align="center">
<spacer flex="1"/>
- <button label="&optionsDialog.php5sites.addsite;" accesskey="&optionsDialog.php5sites.addsite.accesskey;" id="php5sites_add" oncommand="TV2Options.php5sitesAdd()" disabled="true"/>
- <button label="&optionsDialog.php5sites.removesite;" accesskey="&optionsDialog.php5sites.removesite.accesskey;" id="php5sites_remove" oncommand="TV2Options.php5sitesRemove()" disabled="true"/>
+ <button label="&optionsDialog.php4sites.addsite;" accesskey="&optionsDialog.php4sites.addsite.accesskey;" id="php4sites_add" oncommand="TV2Options.php4sitesAdd()" disabled="true"/>
+ <button label="&optionsDialog.php4sites.removesite;" accesskey="&optionsDialog.php4sites.removesite.accesskey;" id="php4sites_remove" oncommand="TV2Options.php4sitesRemove()" disabled="true"/>
<spacer flex="1"/>
</hbox>
</groupbox>
}
+ // auto php4 if known php4 site
+ auto_php4 |= this._isPhp4(site);
+
// defaults
if (!protocol) protocol = 'http';
if (!uri) uri = '/';
site = 'globals';
// must update entered url manually since it was stored before these changes
entered_url = this._makeUrl(protocol, env, sitetype, php4, username, site, uri, false);
- //php5branch = true; // may want this auto default
+ if (!manual && !php5branch) {
+ // auto default to php5branch
+ this._autoChange = true;
+ php5branch = document.getElementById('php5branch').checked = true;
+ this._autoChange = false;
+ }
}
var cvs_sitename = (!site) ? 'www' : site.replace(/-(static|dyn)/, '');
url = 'http://viewcvs.tv2.dk:7467/cgi-bin/viewvc.cgi/';
/* method to extract short url */
_reg_fromviewcvs: /^http:\/\/viewcvs\.tv2.dk:7467\/cgi-bin\/viewvc\.cgi\/(([^/.]+)(?:\.tv2\.dk)?(?:\/(?:(webroot|robot|opdatering|template\/))|(\/[^#?/]*))([^#?]*)(.*)?)?/,
- _reg_viewcvsbranch: /^\?(?:.*&)?pathrev=PHP5(?:&|$)/,
- _reg_viewcvsviewsource: /^\?(?:.*&)?view=markup(?:&|$)/,
+ _reg_viewcvsbranch: /^\?(?:.*&)?pathrev=PHP5(?:&|#|$)/,
+ _reg_viewcvsviewsource: /^\?(?:.*&)?view=markup(?:&|#|$)/,
_reg_fromi2if: /^http:\/\/i2\.(?:[^.]+\.)?opdatering\.(?:(?:test|snapshot)\.)?tv2\.dk\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(\?|&)url=([^&]+)/,
_extractURL: function(url) {
var action = 'go-site';
TV2Util.setPref('alternativ-initials', document.getElementById('testname').value);
}
window.close();
- opener.openUILink(document.getElementById('url').value, 'current', false, false, false);
- /* allow ctrl, alt, but don't google */
- }
+
+ // Open in selection
+ var openin = document.getElementById('openin').selectedItem.id;
+ if (openin == 'openin-newtab') openin = 'tab'
+ else if (openin == 'openin-newwindow') openin = 'window'
+ else openin = 'current';
+
+ opener.openUILinkIn(document.getElementById('url').value, openin);
+ },
+
+ _isPhp4: function(site) {
+ if (!site) site = 'www';
+ return ((','+TV2Util.getPref('php4sites')+',').indexOf(','+site+',') != -1);
+ },
};
</groupbox>
</hbox>
</radiogroup>
+
+ <radiogroup id="openin">
+ <groupbox flex="1">
+ <caption label="&quickbox.openin;"/>
+ <hbox>
+ <radio id="openin-current" label="&quickbox.openin.current;" accesskey="&quickbox.openin.current.accesskey;"/>
+ <radio id="openin-newtab" label="&quickbox.openin.newtab;" accesskey="&quickbox.openin.newtab.accesskey;"/>
+ <radio id="openin-newwindow" label="&quickbox.openin.newwindow;" accesskey="&quickbox.openin.newwindow.accesskey;"/>
+ </hbox>
+ </groupbox>
+ </radiogroup>
</dialog>
TV2Link: function(type, domain, uri, accesskey, flags) {
this.type = type;
+ // Postfix label with up to 25 chars of uri
this.label = domain;
+ if (uri.length > 25) {
+ this.label += uri.substr(0, 23) + '\u2026';
+ } else {
+ this.label += uri;
+ }
this.url = 'http://' + domain + uri;
if (accesskey) this.accesskey = accesskey;
this.disabled = false;
return def;
},
- _isPhp5: function(site) {
+ _isPhp4: function(site) {
if (!site) site = 'www';
- return ((','+TV2Util.getPref('php5sites')+',').indexOf(','+site+',') != -1);
+ return ((','+TV2Util.getPref('php4sites')+',').indexOf(','+site+',') != -1);
},
/* Main function for adding all the links for the menu popup */
if (tv2_sitename) tv2_sitename = tv2_sitename.replace(/-(dyn|static)$/, '');
if (tv2_user) tv2_user = tv2_user.replace(/^\./, '');
- // php5 site
- var php5 = this._isPhp5(tv2_sitename);
- var testType = php5 ? '' : '3';
+ // php4 site
+ var php4 = this._isPhp4(tv2_sitename);
+ var testType = php4 ? '3' : '';
// Find live, test and snapshot url for current site
var liveurl;
} else {
viewcvs_type = 'viewcvs_test';
}
- links.push(new this.TV2LinkWithLabel(viewcvs_type, TV2Util.getStr('lookupInViewCVS'), viewcvs,
- TV2Util.getStr('lookupInViewCVS.accesskey')));
links.push(new this.TV2LinkWithLabel(viewcvs_type, TV2Util.getStr('lookupInViewCVSSource'), viewcvs_source,
TV2Util.getStr('lookupInViewCVSSource.accesskey')));
+ links.push(new this.TV2LinkWithLabel(viewcvs_type, TV2Util.getStr('lookupInViewCVS'), viewcvs,
+ TV2Util.getStr('lookupInViewCVS.accesskey')));
// Update and I2 base URL
var updatepostfix = (tv2_user ? '.' + tv2_user : '')
// Add run pdo_log link
if ((onI2interface != 'tool/pdo_log/frameset') &&
- ((!tv2_testsite && php5) || // only php5 live sites
+ ((!tv2_testsite && !php4) || // only php5 live sites
(tv2_testsite && tv2_testsite != 'snapshot3' && tv2_testsite != 'test3'))) { /* not supported on php4 sites */
links.push(new this.TV2LinkWithLabel('tool/pdo_log/frameset', TV2Util.getStr('performDbPdoLog'),
i2link + '/tool/pdo_log/frameset.php?url='+tango+'&autostop=1&prefix='+initials,
tv2_uri = tv2_uri.substr(0, tv2_uri.length-9);
}
- // php5 sites
- var php5 = this._isPhp5(tv2_sitename);
- var testType = php5 ? '' : '3';
+ // php4 sites
+ var php4 = this._isPhp4(tv2_sitename);
+ var testType = php4 ? '3' : '';
var live_sitename = (tv2_sitetype=='webroot' && tv2_sitename=='www') ? '': (tv2_sitename+'.');
var type = (tv2_sitetype=='webroot')? '' : tv2_sitetype+'.';
pref('tv2developer.firstRun', true);
pref('tv2developer.developer-initials', 'CHANGE-THIS');
pref('tv2developer.lastaction-linktype', 'tango/entry');
-pref('tv2developer.php5sites', 'www,i2,common,ttvpumpe,1234,nyhederne,krimi,radio');
+pref('tv2developer.php4sites', '2000,ally,annonceinfo,arkivsalg,auth,betaling,betalingsputnik,bryllup,dagsdato,finans,formel1,harris,hovsa,inc,it,konsol,loginsputnik,louth,million,piszulu,playmoney,podcast-files,pokermoney,rss,sms,spil,spil-deal,spil-million,spil-solo,sputnikmobil,swim,titoonic,trafikken,tv2,tv2r,tvsputnik,wimbledon,wptmoney,zulu');
<!ENTITY optionsDialog.mac.accesskeys "Slå genvejstaster til i Firefox på Mac">
<!ENTITY optionsDialog.mac.accesskeys.tooltiptext "Ændring af dette felt kræver genstart af Firefox">
-<!ENTITY optionsDialog.php5sites.label "PHP 5 konverterede sites">
-<!ENTITY optionsDialog.php5sites.tooltiptext "Sites i denne liste vil blive betragtet som PHP 5 sites.">
-<!ENTITY optionsDialog.php5sites.defaults "Brug standard PHP 5 sites">
-<!ENTITY optionsDialog.php5sites.custom "Vælg manuelt PHP 5 sites:">
-<!ENTITY optionsDialog.php5sites.addsite "Tilføj site">
-<!ENTITY optionsDialog.php5sites.addsite.accesskey "t">
-<!ENTITY optionsDialog.php5sites.removesite "Fjern site">
-<!ENTITY optionsDialog.php5sites.removesite.accesskey "f">
+<!ENTITY optionsDialog.php4sites.label "Gamle PHP 4 sites">
+<!ENTITY optionsDialog.php4sites.tooltiptext "Sites i denne liste vil blive betragtet som PHP 4 sites.">
+<!ENTITY optionsDialog.php4sites.defaults "Brug standard PHP 4 sites">
+<!ENTITY optionsDialog.php4sites.custom "Vælg manuelt PHP 4 sites:">
+<!ENTITY optionsDialog.php4sites.addsite "Tilføj site">
+<!ENTITY optionsDialog.php4sites.addsite.accesskey "t">
+<!ENTITY optionsDialog.php4sites.removesite "Fjern site">
+<!ENTITY optionsDialog.php4sites.removesite.accesskey "f">
<!ENTITY config.label "Konfigurér">
<!ENTITY config.accesskey "c">
<!ENTITY quickbox.contentid.accesskey "i">
<!ENTITY quickbox.ttvpage "Slå op som TTV side i I2">
-<!ENTITY quickbox.ttvpage.accesskey "a">
+<!ENTITY quickbox.ttvpage.accesskey "v">
+
+<!ENTITY quickbox.openin "Åbn i">
+<!ENTITY quickbox.openin.current "nuværende vindue">
+<!ENTITY quickbox.openin.current.accesskey "z">
+
+<!ENTITY quickbox.openin.newtab "ny tab">
+<!ENTITY quickbox.openin.newtab.accesskey "a">
+
+<!ENTITY quickbox.openin.newwindow "nyt window">
+<!ENTITY quickbox.openin.newwindow.accesskey "y">
# Options dialog
-optionsDialog.enterphp5site=Indtast navn på PHP 5 site:
+optionsDialog.enterphp4site=Indtast navn på PHP 4 site:
<!ENTITY optionsDialog.mac.accesskeys "Enable accesskeys in Firefox on Mac">
<!ENTITY optionsDialog.mac.accesskeys.tooltiptext "Changing this requires restart of Firefox">
-<!ENTITY optionsDialog.php5sites.label "PHP 5 enabled sites">
-<!ENTITY optionsDialog.php5sites.tooltiptext "Sites listed here will be seen as PHP 5 sites.">
-<!ENTITY optionsDialog.php5sites.defaults "Use default PHP 5 sites">
-<!ENTITY optionsDialog.php5sites.custom "Custom PHP 5 sites:">
-<!ENTITY optionsDialog.php5sites.addsite "Add site">
-<!ENTITY optionsDialog.php5sites.addsite.accesskey "a">
-<!ENTITY optionsDialog.php5sites.removesite "Remove site">
-<!ENTITY optionsDialog.php5sites.removesite.accesskey "r">
+<!ENTITY optionsDialog.php4sites.label "PHP 4 legacy sites">
+<!ENTITY optionsDialog.php4sites.tooltiptext "Sites listed here will be seen as PHP 4 sites.">
+<!ENTITY optionsDialog.php4sites.defaults "Use default PHP 4 sites">
+<!ENTITY optionsDialog.php4sites.custom "Custom PHP 4 sites:">
+<!ENTITY optionsDialog.php4sites.addsite "Add site">
+<!ENTITY optionsDialog.php4sites.addsite.accesskey "a">
+<!ENTITY optionsDialog.php4sites.removesite "Remove site">
+<!ENTITY optionsDialog.php4sites.removesite.accesskey "r">
<!ENTITY config.label "Configure">
<!ENTITY config.accesskey "c">
<!ENTITY quickbox.contentid.accesskey "i">
<!ENTITY quickbox.ttvpage "Lookup as TTV Page">
-<!ENTITY quickbox.ttvpage.accesskey "a">
+<!ENTITY quickbox.ttvpage.accesskey "v">
+
+<!ENTITY quickbox.openin "Open in">
+<!ENTITY quickbox.openin.current "current window">
+<!ENTITY quickbox.openin.current.accesskey "z">
+
+<!ENTITY quickbox.openin.newtab "new tab">
+<!ENTITY quickbox.openin.newtab.accesskey "a">
+
+<!ENTITY quickbox.openin.newwindow "new window">
+<!ENTITY quickbox.openin.newwindow.accesskey "y">
# Options dialog
-optionsDialog.enterphp5site=Enter name of PHP 5 site:
+optionsDialog.enterphp4site=Enter name of PHP 4 site: