Merge pull request #32 from girst/master
Fixes #12 and #16, plus two bugfixes
Cette révision appartient à :
révision
24fbfd4080
5 fichiers modifiés avec 35 ajouts et 2 suppressions
|
@ -34,6 +34,11 @@
|
||||||
"description": "with The Internet Archive"
|
"description": "with The Internet Archive"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"resurrectArchiveList": {
|
||||||
|
"message": "with The Internet Archive (list all)",
|
||||||
|
"description": "with The Internet Archive (list all)"
|
||||||
|
},
|
||||||
|
|
||||||
"resurrectArchiveIs": {
|
"resurrectArchiveIs": {
|
||||||
"message": "with archive.is",
|
"message": "with archive.is",
|
||||||
"description": "with archive.is"
|
"description": "with archive.is"
|
||||||
|
@ -44,6 +49,11 @@
|
||||||
"description": "with WebCite"
|
"description": "with WebCite"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"resurrectMementoWeb": {
|
||||||
|
"message": "with Memento Timetravel",
|
||||||
|
"description": "with Memento Timetravel"
|
||||||
|
},
|
||||||
|
|
||||||
"resurrectConfigCurrentTab": {
|
"resurrectConfigCurrentTab": {
|
||||||
"message": "in the current tab",
|
"message": "in the current tab",
|
||||||
"description": "in the current tab"
|
"description": "in the current tab"
|
||||||
|
|
|
@ -36,10 +36,12 @@ chrome.storage.local.get('openIn', item => {
|
||||||
}, onCreated);
|
}, onCreated);
|
||||||
|
|
||||||
addResurrectItem(context, 'Google', 'google', 'google');
|
addResurrectItem(context, 'Google', 'google', 'google');
|
||||||
addResurrectItem(context, 'GoogleText', 'google-text', 'google');
|
addResurrectItem(context, 'GoogleText', 'googletext', 'google');
|
||||||
addResurrectItem(context, 'Archive', 'archive', 'waybackmachine');
|
addResurrectItem(context, 'Archive', 'archive', 'waybackmachine');
|
||||||
|
addResurrectItem(context, 'ArchiveList', 'archivelist', 'waybackmachine');
|
||||||
addResurrectItem(context, 'ArchiveIs', 'archiveis', 'archiveis');
|
addResurrectItem(context, 'ArchiveIs', 'archiveis', 'archiveis');
|
||||||
addResurrectItem(context, 'Webcitation', 'webcitation', 'webcitation');
|
addResurrectItem(context, 'Webcitation', 'webcitation', 'webcitation');
|
||||||
|
addResurrectItem(context, 'MementoWeb', 'mementoweb', 'mementoweb');
|
||||||
|
|
||||||
chrome.contextMenus.create({
|
chrome.contextMenus.create({
|
||||||
id: 'resurrect-separator-config-' + context,
|
id: 'resurrect-separator-config-' + context,
|
||||||
|
@ -53,7 +55,7 @@ chrome.storage.local.get('openIn', item => {
|
||||||
addConfigItem(
|
addConfigItem(
|
||||||
context, 'NewTab', 'new-tab', openIn == openInEnum.NEW_TAB);
|
context, 'NewTab', 'new-tab', openIn == openInEnum.NEW_TAB);
|
||||||
addConfigItem(
|
addConfigItem(
|
||||||
context, 'BgTab', 'bg-tab', openIn == openInEnum.BG_TAB);
|
context, 'BgTab', 'bg-tab', openIn == openInEnum.NEW_BGTAB);
|
||||||
addConfigItem(
|
addConfigItem(
|
||||||
context, 'NewWindow', 'new-window', openIn == openInEnum.NEW_WINDOW);
|
context, 'NewWindow', 'new-window', openIn == openInEnum.NEW_WINDOW);
|
||||||
});
|
});
|
||||||
|
@ -75,10 +77,14 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
|
||||||
goToUrl(genGoogleTextUrl(url), openIn);
|
goToUrl(genGoogleTextUrl(url), openIn);
|
||||||
} else if (id.startsWith('resurrect-archive-')) {
|
} else if (id.startsWith('resurrect-archive-')) {
|
||||||
goToUrl(genIaUrl(url), openIn);
|
goToUrl(genIaUrl(url), openIn);
|
||||||
|
} else if (id.startsWith('resurrect-archivelist-')) {
|
||||||
|
goToUrl(genIaListUrl(url), openIn);
|
||||||
} else if (id.startsWith('resurrect-archiveis-')) {
|
} else if (id.startsWith('resurrect-archiveis-')) {
|
||||||
goToUrl(genArchiveIsUrl(url), openIn);
|
goToUrl(genArchiveIsUrl(url), openIn);
|
||||||
} else if (id.startsWith('resurrect-webcitation-')) {
|
} else if (id.startsWith('resurrect-webcitation-')) {
|
||||||
goToUrl(genWebCiteUrl(url), openIn);
|
goToUrl(genWebCiteUrl(url), openIn);
|
||||||
|
} else if (id.startsWith('resurrect-mementoweb-')) {
|
||||||
|
goToUrl(genMementoUrl(url), openIn);
|
||||||
} else if (id.startsWith('resurrect-current-tab-')) {
|
} else if (id.startsWith('resurrect-current-tab-')) {
|
||||||
setOpenIn(openInEnum.CURRENT_TAB);
|
setOpenIn(openInEnum.CURRENT_TAB);
|
||||||
} else if (id.startsWith('resurrect-new-tab-')) {
|
} else if (id.startsWith('resurrect-new-tab-')) {
|
||||||
|
|
10
common.js
10
common.js
|
@ -34,6 +34,11 @@ function genIaUrl(url) {
|
||||||
return 'https://web.archive.org/web/'+dateStr+'/'+url;
|
return 'https://web.archive.org/web/'+dateStr+'/'+url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function genIaListUrl(url) {
|
||||||
|
let dateStr =(new Date()).toISOString().replace(/-|T|:|\..*/g, '');
|
||||||
|
return 'https://web.archive.org/web/*/'+url;
|
||||||
|
}
|
||||||
|
|
||||||
function genArchiveIsUrl(url) {
|
function genArchiveIsUrl(url) {
|
||||||
return 'https://archive.is/'+url;
|
return 'https://archive.is/'+url;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +47,11 @@ function genWebCiteUrl(url) {
|
||||||
return 'http://webcitation.org/query.php?url='+encodeURIComponent(url);
|
return 'http://webcitation.org/query.php?url='+encodeURIComponent(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function genMementoUrl(url) {
|
||||||
|
let dateStr =(new Date()).toISOString().replace(/-|T|:|\..*/g, '');
|
||||||
|
return 'http://timetravel.mementoweb.org/list/'+dateStr+'/'+encodeURIComponent(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function setOpenIn(where) {
|
function setOpenIn(where) {
|
||||||
openIn = where;
|
openIn = where;
|
||||||
|
|
BIN
icons/cacheicons/mementoweb.png
Fichier normal
BIN
icons/cacheicons/mementoweb.png
Fichier normal
Fichier binaire non affiché.
Après Largeur: | Hauteur: | Taille: 821 o |
|
@ -18,6 +18,7 @@ label {
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
|
height: 16px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<form>
|
<form>
|
||||||
|
@ -30,12 +31,18 @@ img {
|
||||||
<button data-locale="resurrectArchive" data-gen="genIaUrl">
|
<button data-locale="resurrectArchive" data-gen="genIaUrl">
|
||||||
<img src="icons/cacheicons/waybackmachine.png">
|
<img src="icons/cacheicons/waybackmachine.png">
|
||||||
</button>
|
</button>
|
||||||
|
<button data-locale="resurrectArchiveList" data-gen="genIaListUrl">
|
||||||
|
<img src="icons/cacheicons/waybackmachine.png">
|
||||||
|
</button>
|
||||||
<button data-locale="resurrectArchiveIs" data-gen="genArchiveIsUrl">
|
<button data-locale="resurrectArchiveIs" data-gen="genArchiveIsUrl">
|
||||||
<img src="icons/cacheicons/archiveis.png">
|
<img src="icons/cacheicons/archiveis.png">
|
||||||
</button>
|
</button>
|
||||||
<button data-locale="resurrectWebcitation" data-gen="genWebCiteUrl">
|
<button data-locale="resurrectWebcitation" data-gen="genWebCiteUrl">
|
||||||
<img src="icons/cacheicons/webcitation.png">
|
<img src="icons/cacheicons/webcitation.png">
|
||||||
</button>
|
</button>
|
||||||
|
<button data-locale="resurrectMementoWeb" data-gen="genMementoUrl">
|
||||||
|
<img src="icons/cacheicons/mementoweb.png">
|
||||||
|
</button>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket