coral works
Cette révision appartient à :
Parent
c95389d19b
révision
0cc9bfb016
3 fichiers modifiés avec 100 ajouts et 7 suppressions
23
content/resurrect-select-mirror.xul
Fichier normal
23
content/resurrect-select-mirror.xul
Fichier normal
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE overlay SYSTEM "chrome://resurrect/locale/overlay.dtd">
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<dialog id="resurrect-select-mirror"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&resurrect.title;"
|
||||
buttons="accept, cancel"
|
||||
onload="resurrect.loadMirrors()"
|
||||
ondialogaccept="resurrect.selectMirror(event);"
|
||||
persist="width height screenX screenY"
|
||||
>
|
||||
|
||||
<script type='application/x-javascript' src='chrome://resurrect/content/resurrect.js'></script>
|
||||
|
||||
<vbox>
|
||||
<label value='&resurrect.selectmirror;' />
|
||||
|
||||
<listbox id='mirror' rows='0' onselect='resurrect.selectMirror(event);'>
|
||||
</listbox>
|
||||
</vbox>
|
||||
<spacer flex="1" />
|
||||
</dialog>
|
|
@ -1,5 +1,30 @@
|
|||
/*
|
||||
Enumerating: document.location
|
||||
document.location.hash = #x
|
||||
document.location.host = www.google.com
|
||||
document.location.hostname = www.google.com
|
||||
document.location.href = http://www.google.com/search?q=foo&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official#x
|
||||
document.location.pathname = /search
|
||||
document.location.port =
|
||||
document.location.protocol = http:
|
||||
document.location.search = ?q=foo&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official
|
||||
document.location.replace = function replace() { [native code] }
|
||||
document.location.assign = function assign() { [native code] }
|
||||
document.location.reload = function reload() { [native code] }
|
||||
*/
|
||||
|
||||
var resurrect={
|
||||
clickTarget:null,
|
||||
|
||||
mirrors:[
|
||||
{name:'CoralCDN', id:'coralcdn'},
|
||||
{name:'Google Cache', id:'google'},
|
||||
{name:'Yahoo! Cache', id:'yahoo'},
|
||||
{name:'MSN Cache', id:'msn'},
|
||||
{name:'The Internet Archive', id:'archive'}
|
||||
],
|
||||
|
||||
originalDoc:null,
|
||||
gotoUrl:null,
|
||||
|
||||
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
||||
|
||||
|
@ -68,9 +93,53 @@ var resurrect={
|
|||
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
||||
|
||||
showDialog:function(url) {
|
||||
alert(url);
|
||||
resurrect.originalDoc=getBrowser().contentWindow.document;
|
||||
resurrect.gotoUrl=url;
|
||||
|
||||
window.openDialog(
|
||||
'chrome://resurrect/content/resurrect-select-mirror.xul',
|
||||
'_blank',
|
||||
'modal,centerscreen,resizable=no,chrome,dependent'
|
||||
);
|
||||
},
|
||||
|
||||
loadMirrors:function() {
|
||||
var listbox=document.getElementById('mirror');
|
||||
for (var i=0, mirror=null; mirror=resurrect.mirrors[i]; i++) {
|
||||
var listitem=document.createElement('listitem');
|
||||
listitem.setAttribute('label', mirror.name);
|
||||
listitem.setAttribute('value', mirror.id);
|
||||
listbox.appendChild(listitem);
|
||||
}
|
||||
listbox.setAttribute('rows', listbox.getRowCount());
|
||||
},
|
||||
|
||||
selectMirror:function(event) {
|
||||
var listbox=document.getElementById('mirror');
|
||||
|
||||
var gotoUrl=null;
|
||||
|
||||
var rawUrl=opener.resurrect.gotoUrl;
|
||||
var encUrl=encodeURIComponent(rawUrl);
|
||||
|
||||
switch (listbox.value) {
|
||||
case 'coralcdn':
|
||||
gotoUrl=rawUrl.substring(0, 8)+
|
||||
rawUrl.substring(8).replace(/\//, '.nyud.net:8080/');
|
||||
break;
|
||||
}
|
||||
if (gotoUrl) {
|
||||
opener.resurrect.originalDoc.location.assign(gotoUrl);
|
||||
}
|
||||
|
||||
//setTimeout avoids error message when selecting in listbox
|
||||
setTimeout(window.close, 0);
|
||||
}
|
||||
|
||||
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
||||
|
||||
}//end var resurrect
|
||||
|
||||
window.addEventListener('load', resurrect.onLoad, false);
|
||||
if ('undefined'!=typeof gBrowser) {
|
||||
window.addEventListener('load', resurrect.onLoad, false);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<!ENTITY resurrect.title "Resurrect">
|
||||
<!ENTITY resurrect.accesskey "u">
|
||||
<!ENTITY resurrect.thispage "Resurrect this page">
|
||||
<!ENTITY resurrect.thislink "Resurrect this link">
|
||||
<!ENTITY resurrect.title "Resurrect">
|
||||
<!ENTITY resurrect.accesskey "u">
|
||||
<!ENTITY resurrect.thispage "Resurrect this page">
|
||||
<!ENTITY resurrect.thislink "Resurrect this link">
|
||||
<!ENTITY resurrect.selectmirror "Select a mirror:">
|
Chargement…
Référencer dans un nouveau ticket