diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3a2a904..766a04d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -49,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 01e89c8..e097779 100644 --- a/background.js +++ b/background.js @@ -41,6 +41,7 @@ chrome.storage.local.get('openIn', item => { 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, @@ -54,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); }); @@ -82,6 +83,8 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) { 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 781c689..b520ed5 100644 --- a/common.js +++ b/common.js @@ -47,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 f3881b9..ffe2df9 100644 --- a/popup.htm +++ b/popup.htm @@ -18,6 +18,7 @@ label { } img { vertical-align: bottom; + height: 16px; }
@@ -39,6 +40,9 @@ img { +