Browse Source

cleanse code

pull/1/head
10sr 13 years ago
parent
commit
c2fbfe5e14
1 changed files with 30 additions and 38 deletions
  1. +30
    -38
      .keysnail.js

+ 30
- 38
.keysnail.js View File

@@ -194,14 +194,36 @@ ext.add('send-escape', function (ev, arg) {
ev.target.dispatchEvent(key.stringToKeyEvent("ESC", true)); ev.target.dispatchEvent(key.stringToKeyEvent("ESC", true));
}, 'escape'); }, 'escape');




ext.add("open-hatebu-comment", function (ev, arg) { ext.add("open-hatebu-comment", function (ev, arg) {
if (window.loadURI) { if (window.loadURI) {
loadURI("javascript:location.href='http://b.hatena.ne.jp/entry?mode=more&url='+escape(location.href);"); loadURI("javascript:location.href='http://b.hatena.ne.jp/entry?mode=more&url='+escape(location.href);");
} }
}, 'hatebu'); }, 'hatebu');


ext.add("fullscreen-page",function (ev) {
getBrowser().selectedTab = getBrowser().addTab("http://home.tiscali.nl/annejan/swf/timeline.swf");
BrowserFullScreen();
}, "fullscreen page");

ext.add("focus-on-content", function(){
let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();
}, "forcus on content");

ext.add("hide-sidebar", function(){
var sidebarBox = document.getElementById("sidebar-box");
if (!sidebarBox.hidden) {
toggleSidebar(sidebarBox.getAttribute("sidebarcommand"));
}
}, "hide-sidebar");

ext.add("close-and-next-tab", function (ev, arg) {
var n = gBrowser.mCurrentTab._tPos;
BrowserCloseTabOrWindow();
gBrowser.selectedTab = gBrowser.mTabs[n];
}, "close and focus to next tab");

///////////////////////////////////// /////////////////////////////////////
// google itranslate // google itranslate
(function(){ (function(){
@@ -278,13 +300,6 @@ ext.add("restart-firefox-add-menu", function(){
menu.appendChild(menuelm); menu.appendChild(menuelm);
}, "add restart firefox menu"); }, "add restart firefox menu");


//////////////////////////////////////
//
ext.add("fullscreen-page",function (ev) {
getBrowser().selectedTab = getBrowser().addTab("http://home.tiscali.nl/annejan/swf/timeline.swf");
BrowserFullScreen();
}, "fullscreen page");

////////////////////////////////////// //////////////////////////////////////
// restart firefox // restart firefox
// http://keysnail.g.hatena.ne.jp/Shinnya/20100723/1279878815 // http://keysnail.g.hatena.ne.jp/Shinnya/20100723/1279878815
@@ -500,31 +515,6 @@ ext.add("echo-closed-tabs", function () {


}, "List closed tabs"); }, "List closed tabs");


///////////////////////////////////////
//
ext.add("focus-on-content", function(){
document.getElementById("searchbar").focus();
document.commandDispatcher.advanceFocus();
document.commandDispatcher.advanceFocus();
}, "forcus on content");

ext.add("_focus-on-content", function(){
gBrowser.focus();
_content.focus();
}, "focus on content");

ext.add("hide-sidebar", function(){
var sidebarBox = document.getElementById("sidebar-box");
if (!sidebarBox.hidden) {
toggleSidebar(sidebarBox.getAttribute("sidebarcommand"));
}
}, "hide-sidebar");

ext.add("close-and-next-tab", function (ev, arg) {
var n = gBrowser.mCurrentTab._tPos;
BrowserCloseTabOrWindow();
gBrowser.selectedTab = gBrowser.mTabs[n];
}, "close and focus to next tab")
//}}%PRESERVE% //}}%PRESERVE%
// ========================================================================= // // ========================================================================= //


@@ -548,6 +538,12 @@ hook.setHook('KeySnailInitialized', function () {
}); });


hook.setHook('KeyBoardQuit', function (aEvent) { hook.setHook('KeyBoardQuit', function (aEvent) {
ext.exec("hide-sidebar");

let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();

command.closeFindBar(); command.closeFindBar();
if (util.isCaretEnabled()) { if (util.isCaretEnabled()) {
command.resetMark(aEvent); command.resetMark(aEvent);
@@ -557,10 +553,6 @@ hook.setHook('KeyBoardQuit', function (aEvent) {
key.generateKey(aEvent.originalTarget, KeyEvent.DOM_VK_ESCAPE, true); key.generateKey(aEvent.originalTarget, KeyEvent.DOM_VK_ESCAPE, true);
}); });
hook.addToHook('KeyBoardQuit', function (aEvent) { hook.addToHook('KeyBoardQuit', function (aEvent) {
ext.exec("hide-sidebar");
let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();
}); });


hook.setHook('Unload', function () { hook.setHook('Unload', function () {


Loading…
Cancel
Save