aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhogelog2010-01-25 14:20:30 +0000
committerhogelog2010-01-25 14:20:30 +0000
commitaa298f73ba1c5c181bb20c1e670c13b7f4dcf598 (patch)
treea2dcb6c226d80195550b8b91d17bed2575263eb9
parenteb609078dafd44cf99f9222f9d3a991279d6cff6 (diff)
downloadvimperator-plugins-aa298f73ba1c5c181bb20c1e670c13b7f4dcf598.tar.bz2
* tabcommands.js: add tab commands
* :lock, :protect, :freeze, :ren[ame], :dup[licate] git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36531 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--tabcommands.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/tabcommands.js b/tabcommands.js
new file mode 100644
index 0000000..eb1b4de
--- /dev/null
+++ b/tabcommands.js
@@ -0,0 +1,59 @@
+// PLUGIN_INFO//{{{
+var PLUGIN_INFO =
+<VimperatorPlugin>
+ <name>{NAME}</name>
+ <description>add some tab commands</description>
+ <author mail="konbu.komuro@gmail.com" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author>
+ <version>0.0.1</version>
+ <minVersion>2.2</minVersion>
+ <maxVersion>2.2</maxVersion>
+ <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/tabcommands.js</updateURL>
+ <detail><![CDATA[
+== COMMANDS ==
+dup[licate]:
+ duplicate current tab
+ren[ame]:
+ rename current tab
+freeze:
+ freeze (protect&lock) current tab
+protect:
+ protect current tab
+lock:
+ lock current tab
+
+]]></detail>
+</VimperatorPlugin>;
+//}}}
+(function(){
+commands.add(["dup[licate]"], "duplicate current tab", function(args) {
+ gBrowser.duplicateTab(gBrowser.mCurrentTab);
+});
+commands.add(["ren[ame]"], "rename current tab", function(args) {
+ gBrowser.renameTab(gBrowser.mCurrentTab);
+});
+commands.add(["freeze"], "freeze current tab", function(args) {
+ let protect = gBrowser.mCurrentTab.hasAttribute("protected");
+ let lock = gBrowser.mCurrentTab.hasAttribute("locked");
+ if (protect && lock) {
+ gBrowser.mCurrentTab.removeAttribute("protected");
+ gBrowser.mCurrentTab.removeAttribute("locked");
+ } else
+ gBrowser.freezeTab(gBrowser.mCurrentTab);
+});
+commands.add(["protect"], "protect current tab", function(args) {
+ let protect = gBrowser.mCurrentTab.hasAttribute("protected");
+ if (protect)
+ gBrowser.mCurrentTab.removeAttribute("protected");
+ else
+ gBrowser.mCurrentTab.setAttribute("protected", true);
+});
+commands.add(["lock"], "lock current tab", function(args) {
+ let lock = gBrowser.mCurrentTab.hasAttribute("locked");
+ if (lock)
+ gBrowser.mCurrentTab.removeAttribute("locked");
+ else
+ gBrowser.mCurrentTab.setAttribute("locked", true);
+});
+
+})();
+// vim: fdm=marker sw=4 ts=4 et: