Fixes #201
* Remember the last target (window/tab) and use it as the default next time.
Cette révision appartient à :
Parent
89e3f91958
révision
72d82a9adf
|
@ -14,13 +14,16 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<script type='application/x-javascript' src='chrome://resurrect/content/resurrect.js'></script>
|
<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>
|
<vbox>
|
||||||
<groupbox>
|
<groupbox>
|
||||||
<caption label='&resurrect.this;' />
|
<caption label='&resurrect.this;' />
|
||||||
|
|
||||||
<radiogroup>
|
<radiogroup id='targetGroup'>
|
||||||
<radio id='targetCurr' label='&resurrect.inCurrTab;' selected='true' />
|
<radio id='targetCurr' label='&resurrect.inCurrTab;' />
|
||||||
<radio id='targetTab' label='&resurrect.inNewTab;' />
|
<radio id='targetTab' label='&resurrect.inNewTab;' />
|
||||||
<radio id='targetWin' label='&resurrect.inNewWin;' />
|
<radio id='targetWin' label='&resurrect.inNewWin;' />
|
||||||
</radiogroup>
|
</radiogroup>
|
||||||
|
|
|
@ -67,6 +67,25 @@ var resurrect={
|
||||||
return null;
|
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) {
|
showDialog:function(url) {
|
||||||
|
@ -93,6 +112,8 @@ var resurrect={
|
||||||
},
|
},
|
||||||
|
|
||||||
clickedXul:function(event) {
|
clickedXul:function(event) {
|
||||||
|
resurrect.saveTarget(event.target);
|
||||||
|
|
||||||
return resurrect.clickHandler(
|
return resurrect.clickHandler(
|
||||||
event,
|
event,
|
||||||
window.arguments[0],
|
window.arguments[0],
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
pref("extensions.{0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3}.description", "chrome://resurrect/locale/overlay.properties");
|
pref("extensions.{0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3}.description", "chrome://resurrect/locale/overlay.properties");
|
||||||
|
|
||||||
|
pref("extensions.resurrect.target", "targetCurr");
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket