Created
March 31, 2015 11:07
-
-
Save poma/ce9ea5b7503d6e669c07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From f3ad98ac87f9f1c789b9e3f2fe1875cde089d680 Mon Sep 17 00:00:00 2001 | |
From: poma <[email protected]> | |
Date: Tue, 31 Mar 2015 03:13:15 +0300 | |
Subject: [PATCH] b | |
--- | |
js/ui/sidebar.js | 2 +- | |
manifest.json | 7 ++++++- | |
2 files changed, 7 insertions(+), 2 deletions(-) | |
diff --git a/js/ui/sidebar.js b/js/ui/sidebar.js | |
index 9263e6e..1d0d9fb 100644 | |
--- a/js/ui/sidebar.js | |
+++ b/js/ui/sidebar.js | |
@@ -1,7 +1,7 @@ | |
/* Copyright (c) 2012 Joel Thornton <[email protected]> See LICENSE.txt for license details. */ | |
var manager,bg,settings;$(document).ready(onReady); | |
-function onReady(){bg=chrome.extension.getBackgroundPage();settings=bg.settings;$.fx.off=!settings.get("animationEnabled");manager=new SidebarNavManager($("ul#sidebarButtons"),$("tr#sidebars"),$("table#main"),$("body"),"td");manager.addSidebarPanes(bg.paneCatalog.items);var a=settings.get("lastSidebarPaneId");if(void 0===a||-1==bg.paneCatalog.getPaneIds().indexOf(a))a=bg.paneCatalog.items[0].id;manager.showSidebarPane(a);$(window).load(function(){setTimeout(function(){manager.scrollToCurrentSidebarPane(!0)},0); | |
+function onReady(){bg=chrome.extension.getBackgroundPage();while (bg == undefined || bg.settings == undefined || bg.paneCatalog == undefined) {setTimeout(onReady, 1);return;};settings=bg.settings;$.fx.off=!settings.get("animationEnabled");manager=new SidebarNavManager($("ul#sidebarButtons"),$("tr#sidebars"),$("table#main"),$("body"),"td");manager.addSidebarPanes(bg.paneCatalog.items);var a=settings.get("lastSidebarPaneId");if(void 0===a||-1==bg.paneCatalog.getPaneIds().indexOf(a))a=bg.paneCatalog.items[0].id;manager.showSidebarPane(a);$(window).load(function(){setTimeout(function(){manager.scrollToCurrentSidebarPane(!0)},0); | |
setTimeout(function(){manager.scrollToCurrentSidebarPane(!0)},100)});$(document).keydown(onDocumentKeyDown).scroll(onDocumentScroll).mouseover(onDocumentMouseOver);$(window).resize(onWindowResize);$("#optionsButton").attr("title",getMessage("sidebars_optionsButtonTooltip")).tooltip({position:"bottom center",predelay:400,offset:[15,-15]}).click(onClickOptionsButton).mousedown(onMouseDownOptionsButton).mouseup(onMouseUpOptionsButton).mouseover(onMouseOverOptionsButton).mouseout(onMouseUpOptionsButton); | |
setI18NText();bg.sidebarHandler.registerSidebarPane("sidebarHost",window)}function onDocumentKeyDown(a){if(27==a.keyCode||a.ctrlKey&&70==a.keyCode||!a.ctrlKey&&!a.altKey&&48<=a.keyCode&&90>=a.keyCode||a.ctrlKey&&86==a.keyCode||a.ctrlKey&&115==a.keyCode)try{var b=$("#sidebarContainer__"+manager.currentSidebarId).children("iframe").get(0).contentWindow;b.jQuery(b.document).trigger(a);return!1}catch(c){}return!0}function onDocumentScroll(){manager.scrolling||manager.scrollToCurrentSidebarPane(!0)} | |
function onDocumentMouseOver(){settings.get("focusSidebarOnHover")&&bg.sidebarHandler.focus()}function onWindowResize(){bg.sidebarHandler.onResize();manager.scrollToCurrentSidebarPane(!0)}function onClickOptionsButton(){var a=chrome.extension.getURL("/options.html");chrome.tabs.query({url:a},function(b){0==b.length?chrome.tabs.create({url:a}):chrome.tabs.update(b[0].id,{active:!0})})} | |
diff --git a/manifest.json b/manifest.json | |
index 7894436..6b51b15 100644 | |
--- a/manifest.json | |
+++ b/manifest.json | |
@@ -14,11 +14,16 @@ | |
}, | |
"background": { | |
"page": "background.html" | |
- }, | |
+ }, | |
"browser_action": { | |
"default_icon": "images/sidewise_icon_16.png", | |
"default_title": "Open Sidewise" | |
}, | |
+ "sidebar_action": { | |
+ "default_icon": "images/sidewise_icon_16.png", | |
+ "default_title" : "Open Sidewise", | |
+ "default_panel": "sidebar.html" | |
+ }, | |
"content_scripts": [ | |
{ | |
"matches": ["http://*/*", "https://*/*"], | |
-- | |
1.8.1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment