* Remember the last target (window/tab) and use it as the default next time.
This commit is contained in:
Anthony Lieuallen 2009-04-30 17:11:32 +00:00
parent 89e3f91958
commit 72d82a9adf
3 changed files with 28 additions and 2 deletions

View file

@ -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>

View file

@ -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],

View file

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