Merge pull request #32 from girst/master

Fixes #12 and #16, plus two bugfixes
Cette révision appartient à :
arantius 2017-11-17 09:28:58 -05:00 révisé par GitHub
révision 24fbfd4080
Signature inconnue de Forgejo
ID de la clé GPG: 4AEE18F83AFDEB23
5 fichiers modifiés avec 35 ajouts et 2 suppressions

Voir le fichier

@ -34,6 +34,11 @@
"description": "with The Internet Archive"
},
"resurrectArchiveList": {
"message": "with The Internet Archive (list all)",
"description": "with The Internet Archive (list all)"
},
"resurrectArchiveIs": {
"message": "with archive.is",
"description": "with archive.is"
@ -44,6 +49,11 @@
"description": "with WebCite"
},
"resurrectMementoWeb": {
"message": "with Memento Timetravel",
"description": "with Memento Timetravel"
},
"resurrectConfigCurrentTab": {
"message": "in the current tab",
"description": "in the current tab"

Voir le fichier

@ -36,10 +36,12 @@ chrome.storage.local.get('openIn', item => {
}, onCreated);
addResurrectItem(context, 'Google', 'google', 'google');
addResurrectItem(context, 'GoogleText', 'google-text', 'google');
addResurrectItem(context, 'GoogleText', 'googletext', 'google');
addResurrectItem(context, 'Archive', 'archive', 'waybackmachine');
addResurrectItem(context, 'ArchiveList', 'archivelist', 'waybackmachine');
addResurrectItem(context, 'ArchiveIs', 'archiveis', 'archiveis');
addResurrectItem(context, 'Webcitation', 'webcitation', 'webcitation');
addResurrectItem(context, 'MementoWeb', 'mementoweb', 'mementoweb');
chrome.contextMenus.create({
id: 'resurrect-separator-config-' + context,
@ -53,7 +55,7 @@ chrome.storage.local.get('openIn', item => {
addConfigItem(
context, 'NewTab', 'new-tab', openIn == openInEnum.NEW_TAB);
addConfigItem(
context, 'BgTab', 'bg-tab', openIn == openInEnum.BG_TAB);
context, 'BgTab', 'bg-tab', openIn == openInEnum.NEW_BGTAB);
addConfigItem(
context, 'NewWindow', 'new-window', openIn == openInEnum.NEW_WINDOW);
});
@ -75,10 +77,14 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
goToUrl(genGoogleTextUrl(url), openIn);
} else if (id.startsWith('resurrect-archive-')) {
goToUrl(genIaUrl(url), openIn);
} else if (id.startsWith('resurrect-archivelist-')) {
goToUrl(genIaListUrl(url), openIn);
} else if (id.startsWith('resurrect-archiveis-')) {
goToUrl(genArchiveIsUrl(url), openIn);
} else if (id.startsWith('resurrect-webcitation-')) {
goToUrl(genWebCiteUrl(url), openIn);
} else if (id.startsWith('resurrect-mementoweb-')) {
goToUrl(genMementoUrl(url), openIn);
} else if (id.startsWith('resurrect-current-tab-')) {
setOpenIn(openInEnum.CURRENT_TAB);
} else if (id.startsWith('resurrect-new-tab-')) {

Voir le fichier

@ -34,6 +34,11 @@ function genIaUrl(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) {
return 'https://archive.is/'+url;
}
@ -42,6 +47,11 @@ function genWebCiteUrl(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) {
openIn = where;

BIN
icons/cacheicons/mementoweb.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 821 B

Voir le fichier

@ -18,6 +18,7 @@ label {
}
img {
vertical-align: bottom;
height: 16px;
}
</style>
<form>
@ -30,12 +31,18 @@ img {
<button data-locale="resurrectArchive" data-gen="genIaUrl">
<img src="icons/cacheicons/waybackmachine.png">
</button>
<button data-locale="resurrectArchiveList" data-gen="genIaListUrl">
<img src="icons/cacheicons/waybackmachine.png">
</button>
<button data-locale="resurrectArchiveIs" data-gen="genArchiveIsUrl">
<img src="icons/cacheicons/archiveis.png">
</button>
<button data-locale="resurrectWebcitation" data-gen="genWebCiteUrl">
<img src="icons/cacheicons/webcitation.png">
</button>
<button data-locale="resurrectMementoWeb" data-gen="genMementoUrl">
<img src="icons/cacheicons/mementoweb.png">
</button>
<br>