* Wire up the new UI, in the net error page.
Cette révision appartient à :
Parent
86dd923b97
révision
c3f0e65cf5
|
@ -290,7 +290,11 @@
|
||||||
<xul:button id="errorTryAgain" label="&retry.label;" oncommand="retryThis(this);" />
|
<xul:button id="errorTryAgain" label="&retry.label;" oncommand="retryThis(this);" />
|
||||||
|
|
||||||
<fieldset id='resurrect'>
|
<fieldset id='resurrect'>
|
||||||
<legend>
|
<!-- fake elements so getElementById() doesn't die -->
|
||||||
|
<div id='targetTab' style='display: none;'></div>
|
||||||
|
<div id='targetWin' style='display: none;'></div>
|
||||||
|
|
||||||
|
<legend>
|
||||||
<img src='chrome://resurrect/skin/tb-icon-small.png' />
|
<img src='chrome://resurrect/skin/tb-icon-small.png' />
|
||||||
&resurrect.thispage;
|
&resurrect.thispage;
|
||||||
</legend>
|
</legend>
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
</radiogroup>
|
</radiogroup>
|
||||||
|
|
||||||
<label value='&resurrect.fromMirror;' />
|
<label value='&resurrect.fromMirror;' />
|
||||||
|
<vbox id='resurrect'>
|
||||||
<button
|
<button
|
||||||
value='coralcdn' label=' &resurrect.coralcdn;'
|
value='coralcdn' label=' &resurrect.coralcdn;'
|
||||||
image='chrome://resurrect/skin/cacheicons/coralcdn.png'
|
image='chrome://resurrect/skin/cacheicons/coralcdn.png'
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
value='msn' label=' &resurrect.msn;'
|
value='msn' label=' &resurrect.msn;'
|
||||||
image='chrome://resurrect/skin/cacheicons/msn.png'
|
image='chrome://resurrect/skin/cacheicons/msn.png'
|
||||||
/>
|
/>
|
||||||
|
</vbox>
|
||||||
|
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
var resurrect={
|
var resurrect={
|
||||||
|
|
||||||
mirrors:[
|
|
||||||
{name:'CoralCDN', id:'coralcdn'},
|
|
||||||
{name:'Google Cache', id:'google'},
|
|
||||||
{name:'The Internet Archive', id:'archive'},
|
|
||||||
{name:'MSN Cache', id:'msn'},
|
|
||||||
{name:'Yahoo! Cache', id:'yahoo'}
|
|
||||||
],
|
|
||||||
|
|
||||||
originalDoc:null,
|
originalDoc:null,
|
||||||
disabled:false,
|
disabled:false,
|
||||||
|
|
||||||
|
@ -19,7 +11,7 @@ var resurrect={
|
||||||
document.getElementById('contentAreaContextMenu')
|
document.getElementById('contentAreaContextMenu')
|
||||||
.addEventListener('popupshowing', resurrect.toggleContextItems, false);
|
.addEventListener('popupshowing', resurrect.toggleContextItems, false);
|
||||||
|
|
||||||
window.document.getElementById("appcontent").addEventListener(
|
window.document.getElementById('appcontent').addEventListener(
|
||||||
'DOMContentLoaded', resurrect.attachClickEvent, false
|
'DOMContentLoaded', resurrect.attachClickEvent, false
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -43,15 +35,9 @@ var resurrect={
|
||||||
|
|
||||||
var contentDoc=event.target;
|
var contentDoc=event.target;
|
||||||
if (contentDoc.documentURI.match(/^about:neterror/)) {
|
if (contentDoc.documentURI.match(/^about:neterror/)) {
|
||||||
contentDoc.getElementById('mirror').addEventListener(
|
contentDoc.getElementById('resurrect').addEventListener(
|
||||||
'click', resurrect.clickedHtml, false
|
'click', resurrect.clickedHtml, false
|
||||||
);
|
);
|
||||||
try {
|
|
||||||
// because this button isn't always there
|
|
||||||
contentDoc.getElementById('mirrorSelect').addEventListener(
|
|
||||||
'click', resurrect.clickedHtml, false
|
|
||||||
);
|
|
||||||
} catch (e) { }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -80,7 +66,7 @@ var resurrect={
|
||||||
with (gBrowser) {
|
with (gBrowser) {
|
||||||
selectedTab=aTab;
|
selectedTab=aTab;
|
||||||
mTabBox.selectedPanel=getBrowserForTab(mCurrentTab).parentNode;
|
mTabBox.selectedPanel=getBrowserForTab(mCurrentTab).parentNode;
|
||||||
mCurrentTab.selected = true;
|
mCurrentTab.selected=true;
|
||||||
updateCurrentBrowser();
|
updateCurrentBrowser();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -100,6 +86,7 @@ var resurrect={
|
||||||
|
|
||||||
clickedHtml:function(event) {
|
clickedHtml:function(event) {
|
||||||
return resurrect.clickHandler(
|
return resurrect.clickHandler(
|
||||||
|
event,
|
||||||
event.target.ownerDocument,
|
event.target.ownerDocument,
|
||||||
event.target.ownerDocument,
|
event.target.ownerDocument,
|
||||||
event.target.ownerDocument.location.href
|
event.target.ownerDocument.location.href
|
||||||
|
@ -108,39 +95,29 @@ var resurrect={
|
||||||
|
|
||||||
clickedXul:function(event) {
|
clickedXul:function(event) {
|
||||||
return resurrect.clickHandler(
|
return resurrect.clickHandler(
|
||||||
|
event,
|
||||||
event.target.ownerDocument,
|
event.target.ownerDocument,
|
||||||
window.arguments[0],
|
window.arguments[0],
|
||||||
window.arguments[1]
|
window.arguments[1]
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
clickHandler:function(ownerDoc, contentDoc, rawUrl) {
|
clickHandler:function(event, ownerDoc, contentDoc, rawUrl) {
|
||||||
// Check, set, disabled status.
|
if (resurrect.disabled) return;
|
||||||
var listbox=ownerDoc.getElementById('mirror');
|
|
||||||
|
|
||||||
if (-1==listbox.selectedIndex) return false;
|
|
||||||
if (resurrect.disabled) return false;
|
|
||||||
|
|
||||||
resurrect.disabled=true;
|
resurrect.disabled=true;
|
||||||
listbox.setAttribute('disabled', true);
|
|
||||||
|
|
||||||
var button=contentDoc.getElementById('mirrorSelect');
|
|
||||||
if (!button && ownerDoc.documentElement.getButton) {
|
|
||||||
button=ownerDoc.documentElement.getButton('accept');
|
|
||||||
}
|
|
||||||
button.setAttribute('disabled', true);
|
|
||||||
|
|
||||||
// Run the actual code. After timeout for UI repaint.
|
// Run the actual code. After timeout for UI repaint.
|
||||||
setTimeout(resurrect.selectMirror, 1, ownerDoc, contentDoc, rawUrl);
|
setTimeout(
|
||||||
|
resurrect.selectMirror, 1,
|
||||||
|
event.target.getAttribute('value'), ownerDoc, contentDoc, rawUrl
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
selectMirror:function(ownerDoc, contentDoc, rawUrl) {
|
selectMirror:function(mirror, ownerDoc, contentDoc, rawUrl) {
|
||||||
var listbox=ownerDoc.getElementById('mirror');
|
|
||||||
|
|
||||||
var gotoUrl=null;
|
var gotoUrl=null;
|
||||||
var encUrl=encodeURIComponent(rawUrl);
|
var encUrl=encodeURIComponent(rawUrl);
|
||||||
|
|
||||||
switch (listbox.value) {
|
switch (mirror) {
|
||||||
case 'coralcdn':
|
case 'coralcdn':
|
||||||
gotoUrl=rawUrl.substring(0, 8)+
|
gotoUrl=rawUrl.substring(0, 8)+
|
||||||
rawUrl.substring(8).replace(/\//, '.nyud.net:8080/');
|
rawUrl.substring(8).replace(/\//, '.nyud.net:8080/');
|
||||||
|
@ -212,16 +189,16 @@ var resurrect={
|
||||||
} else {
|
} else {
|
||||||
contentDoc.location.assign(gotoUrl);
|
contentDoc.location.assign(gotoUrl);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ('chrome://resurrect/content/resurrect-select-mirror.xul'==window.document.location) {
|
if ('chrome://resurrect/content/resurrect-select-mirror.xul'==window.document.location) {
|
||||||
// setTimeout avoids errors because the window is gone
|
// setTimeout avoids errors because the window is gone
|
||||||
setTimeout(window.close, 0);
|
setTimeout(window.close, 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resurrect.disabled=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
|
||||||
|
|
||||||
}//end var resurrect
|
}//end var resurrect
|
||||||
|
|
||||||
if ('undefined'!=typeof gBrowser) {
|
if ('undefined'!=typeof gBrowser) {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<!ENTITY resurrect.textonly " (text only)">
|
<!ENTITY resurrect.textonly " (text only)">
|
||||||
<!ENTITY resurrect.yahoo "Yahoo! Cache">
|
<!ENTITY resurrect.yahoo "Yahoo! Cache">
|
||||||
<!ENTITY resurrect.archive "The Internet Archive">
|
<!ENTITY resurrect.archive "The Internet Archive">
|
||||||
<!ENTITY resurrect.msn "MSN Cache">
|
<!ENTITY resurrect.msn "Live Search (MSN) Cache">
|
||||||
<!ENTITY resurrect.inCurrTab "In the current tab/window">
|
<!ENTITY resurrect.inCurrTab "In the current tab/window">
|
||||||
<!ENTITY resurrect.inNewTab "In a new tab">
|
<!ENTITY resurrect.inNewTab "In a new tab">
|
||||||
<!ENTITY resurrect.inNewWin "In a new window">
|
<!ENTITY resurrect.inNewWin "In a new window">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
div#errorPageContainer {
|
div#errorPageContainer {
|
||||||
padding-right: 17em;
|
padding-right: 20em;
|
||||||
max-width: 47em;
|
max-width: 45em;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset#resurrect {
|
fieldset#resurrect {
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket