summaryrefslogtreecommitdiffstats
path: root/conkeror/.conkerorrc/site-js
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-03 21:38:57 +0100
committerGravatar Tom Willemse2013-11-03 21:38:57 +0100
commitc1623b38c2a8ee582f204c837130a0e945e07e09 (patch)
treed278daa4eecc6ea9440ff1dd1b3c76375431930a /conkeror/.conkerorrc/site-js
parent48833ba0ac58be4a7b6963008ff0e1016d5d8dd8 (diff)
downloaddotfiles-c1623b38c2a8ee582f204c837130a0e945e07e09.tar.gz
dotfiles-c1623b38c2a8ee582f204c837130a0e945e07e09.zip
Update conkeror config
Diffstat (limited to 'conkeror/.conkerorrc/site-js')
-rw-r--r--conkeror/.conkerorrc/site-js/quickdispatch.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/conkeror/.conkerorrc/site-js/quickdispatch.js b/conkeror/.conkerorrc/site-js/quickdispatch.js
new file mode 100644
index 0000000..15fc63c
--- /dev/null
+++ b/conkeror/.conkerorrc/site-js/quickdispatch.js
@@ -0,0 +1,33 @@
+define_variable("quickdispatch_prefix", "#",
+ "Prefix which indicates a quickdispatch URL.");
+define_variable("quickdispatch_list", {},
+ "List of key-value pairs representing the RegExp and"
+ + " replacement values for dispatches.");
+
+quickdispatch_list =
+ {"lh (\\d{1,5})(?:\\s+([a-z0-9%_/-]+))?$": "http://localhost:$1/$2",
+ "r ([a-zA-Z0-9_-]+)$": "http://reddit.com/r/$1",
+ "gh \\+([a-zA-Z0-9_-]+)$": "http://github.com/users/follow?target=$1",
+ "gh -([a-zA-Z0-9_-]+)$": "http://github.com/users/follow?target=$1",
+ "gh @([a-zA-Z0-9_-]*)$": "http://github.com/$1",
+ "ghw @([a-zA-Z0-9_-]+)$": "http://$1.github.io",
+ "gh ([a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+(?:/(pulls|wiki|graphs|network|admin))?)$": "http://github.com/$1",
+ "ghw ([a-zA-Z0-9_-]+)/([a-zA-z0-9_-]+)$": "http://$1.github.io/$2",
+ "gh my (dashboard|notifications|stars)$": "http://github.com/$1",
+ "gh my (issues|pulls)$": "http://github.com/dashboard/$1",
+ "gh my profile$": "http://github.com/settings/profile"};
+
+function read_url_qd_handler(input)
+{
+ var keys = Object.keys(quickdispatch_list);
+
+ for (var i = 0; i < keys.length; i++) {
+ var rx = new RegExp(quickdispatch_prefix + keys[i]);
+ if (rx.test(input))
+ return input.replace(rx, quickdispatch_list[keys[i]]);
+ }
+
+ return "http://example.com";
+}
+
+provide("quickdispatch");