Add TimeTravel (#16), fix contextmenu radio NEW_BGTAB
Cette révision appartient à :
Parent
6a94c66c48
révision
474a0279be
5 fichiers modifiés avec 18 ajouts et 1 suppressions
|
@ -49,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"
|
||||||
|
|
|
@ -41,6 +41,7 @@ chrome.storage.local.get('openIn', item => {
|
||||||
addResurrectItem(context, 'ArchiveList', 'archivelist', '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,
|
||||||
|
@ -54,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);
|
||||||
});
|
});
|
||||||
|
@ -82,6 +83,8 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
|
||||||
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-')) {
|
||||||
|
|
|
@ -47,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>
|
||||||
|
@ -39,6 +40,9 @@ img {
|
||||||
<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