Initial import, basic find-the-url functionality

Cette révision appartient à :
Anthony Lieuallen 2006-05-14 21:48:10 +00:00
révision c95389d19b
6 fichiers modifiés avec 124 ajouts et 0 suppressions

5
chrome.manifest Fichier normal
Voir le fichier

@ -0,0 +1,5 @@
content resurrect content/
overlay chrome://browser/content/browser.xul chrome://resurrect/content/resurrect-overlay.xul
skin resurrect classic/1.0 skin/
locale resurrect en-US locale/en-US/

18
content/resurrect-overlay.xul Fichier normal
Voir le fichier

@ -0,0 +1,18 @@
<?xml version='1.0'?>
<!DOCTYPE overlay SYSTEM "chrome://resurrect/locale/overlay.dtd">
<overlay id='resurrect-overlay' xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
<script type='application/x-javascript' src='chrome://resurrect/content/resurrect.js'></script>
<popup id="contentAreaContextMenu">
<menuitem id="resurrect-page-context" insertafter="context-bookmarkpage"
label="&resurrect.thispage;" accesskey="&resurrect.accesskey;"
oncommand="resurrect.page(event);"
/>
<menuitem id="resurrect-link-context" insertafter="context-bookmarklink"
label="&resurrect.thislink;" accesskey="&resurrect.accesskey;"
oncommand="resurrect.link(event);"
/>
</popup>
</overlay>

76
content/resurrect.js Fichier normal
Voir le fichier

@ -0,0 +1,76 @@
var resurrect={
clickTarget:null,
// // // // // // // // // // // // // // // // // // // // // // // // // // //
onLoad:function() {
window.removeEventListener('load', resurrect.onLoad, false);
document.getElementById('contentAreaContextMenu')
.addEventListener('popupshowing', resurrect.toggleContextItems, false);
},
toggleContextItems:function(event) {
resurrect.clickTarget=event.target;
var onDocument=!(
gContextMenu.isContentSelected || gContextMenu.onTextInput ||
gContextMenu.onLink || gContextMenu.onImage
);
document.getElementById('resurrect-page-context')
.setAttribute('hidden', !onDocument);
document.getElementById('resurrect-link-context')
.setAttribute('hidden', !gContextMenu.onLink);
},
// // // // // // // // // // // // // // // // // // // // // // // // // // //
dumpProps:function(obj, withFuncs) {
dump('--------------------------------------------\n');
dump(obj+'\n\n');
var s='';
for (i in obj) {
try {
if (!withFuncs && 'function'==typeof obj[i]) continue;
s=i+': '+obj[i];
s=s.replace(/\n\s*./, 'n');
dump( s.substring(0, 79)+'\n' );
} catch (e) { }
}
dump('\n');
},
findTag:function(tagName) {
var el=document.popupNode;
try {
while (el && el.tagName && tagName!=el.tagName) {
el=el.parentNode;
}
return el;
} catch (e) { }
return null;
},
// // // // // // // // // // // // // // // // // // // // // // // // // // //
page:function(event) {
var doc=resurrect.findTag('HTML').ownerDocument;
resurrect.showDialog(doc.location.href);
},
link:function(event) {
var a=resurrect.findTag('A');
resurrect.showDialog(a.href);
},
// // // // // // // // // // // // // // // // // // // // // // // // // // //
showDialog:function(url) {
alert(url);
}
}//end var resurrect
window.addEventListener('load', resurrect.onLoad, false);

21
install.rdf Fichier normal
Voir le fichier

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>{0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3}</em:id>
<em:name>Resurrect Pages</em:name>
<em:version>1.0</em:version>
<em:description>Resurrect dead pages, by finding ghost copies.</em:description>
<em:creator>Anthony Lieuallen</em:creator>
<em:homepageURL>http://www.arantius.com/article/resurrect</em:homepageURL>
<em:updateURL>http://www.arantius.com/misc/firefox-extensions/mine/updates.rdf</em:updateURL>
<em:iconURL>chrome://resurrect/skin/em-icon.png</em:iconURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>1.6</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

4
locale/en-US/overlay.dtd Fichier normal
Voir le fichier

@ -0,0 +1,4 @@
<!ENTITY resurrect.title "Resurrect">
<!ENTITY resurrect.accesskey "u">
<!ENTITY resurrect.thispage "Resurrect this page">
<!ENTITY resurrect.thislink "Resurrect this link">

BIN
skin/em-icon.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 2.1 KiB