diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 430a3d0..766a04d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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" diff --git a/background.js b/background.js index fb62f96..e097779 100644 --- a/background.js +++ b/background.js @@ -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-')) { diff --git a/common.js b/common.js index 6d191ce..b520ed5 100644 --- a/common.js +++ b/common.js @@ -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; diff --git a/icons/cacheicons/mementoweb.png b/icons/cacheicons/mementoweb.png new file mode 100644 index 0000000..aa9ca10 Binary files /dev/null and b/icons/cacheicons/mementoweb.png differ diff --git a/popup.htm b/popup.htm index 0a465db..ffe2df9 100644 --- a/popup.htm +++ b/popup.htm @@ -18,6 +18,7 @@ label { } img { vertical-align: bottom; + height: 16px; }
@@ -30,12 +31,18 @@ img { + +