* Remember the last target (window/tab) and use it as the default next time.
Cette révision appartient à :
Anthony Lieuallen 2009-04-30 17:11:32 +00:00
Parent 89e3f91958
révision 72d82a9adf
3 fichiers modifiés avec 28 ajouts et 2 suppressions

Voir le fichier

@ -14,13 +14,16 @@
>
<script type='application/x-javascript' src='chrome://resurrect/content/resurrect.js'></script>
<script type='application/x-javascript'>
window.addEventListener('load', resurrect.loadTarget, false);
</script>
<vbox>
<groupbox>
<caption label='&resurrect.this;' />
<radiogroup>
<radio id='targetCurr' label='&resurrect.inCurrTab;' selected='true' />
<radiogroup id='targetGroup'>
<radio id='targetCurr' label='&resurrect.inCurrTab;' />
<radio id='targetTab' label='&resurrect.inNewTab;' />
<radio id='targetWin' label='&resurrect.inNewWin;' />
</radiogroup>

Voir le fichier

@ -67,6 +67,25 @@ var resurrect={
return null;
},
// // // // // // // // // // // // // // // // // // // // // // // // // // //
loadTarget:function() {
var pref=Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
var target=pref.getCharPref('extensions.resurrect.target');
document.getElementById('targetGroup').selectedItem=
document.getElementById(target);
},
saveTarget:function(el) {
var target=document.getElementById('targetGroup').selectedItem.id;
var pref=Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
pref.setCharPref('extensions.resurrect.target', target);
},
// // // // // // // // // // // // // // // // // // // // // // // // // // //
showDialog:function(url) {
@ -93,6 +112,8 @@ var resurrect={
},
clickedXul:function(event) {
resurrect.saveTarget(event.target);
return resurrect.clickHandler(
event,
window.arguments[0],

Voir le fichier

@ -1 +1,3 @@
pref("extensions.{0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3}.description", "chrome://resurrect/locale/overlay.properties");
pref("extensions.resurrect.target", "targetCurr");