From ccdb0a2428bbdc56e8288442f844a4bb3b8f9a11 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 28 Jul 2018 10:51:52 +0900 Subject: Clean old codes --- src/background/shared/zooms.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/background/shared/zooms.js (limited to 'src/background/shared/zooms.js') diff --git a/src/background/shared/zooms.js b/src/background/shared/zooms.js deleted file mode 100644 index 17b28fa..0000000 --- a/src/background/shared/zooms.js +++ /dev/null @@ -1,32 +0,0 @@ -// For chromium -// const ZOOM_SETTINGS = [ -// 0.25, 0.33, 0.50, 0.66, 0.75, 0.80, 0.90, 1.00, -// 1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00, 4.00, 5.00 -// ]; - -const ZOOM_SETTINGS = [ - 0.33, 0.50, 0.66, 0.75, 0.80, 0.90, 1.00, - 1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00 -]; - -const zoomIn = async(tabId = undefined) => { - let current = await browser.tabs.getZoom(tabId); - let factor = ZOOM_SETTINGS.find(f => f > current); - if (factor) { - return browser.tabs.setZoom(tabId, factor); - } -}; - -const zoomOut = async(tabId = undefined) => { - let current = await browser.tabs.getZoom(tabId); - let factor = [].concat(ZOOM_SETTINGS).reverse().find(f => f < current); - if (factor) { - return browser.tabs.setZoom(tabId, factor); - } -}; - -const neutral = (tabId = undefined) => { - return browser.tabs.setZoom(tabId, 1); -}; - -export { zoomIn, zoomOut, neutral }; -- cgit v1.2.3