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
function findArgs(input, delims, wordBased, leftBranch){ | |
var res = [{'': input}], source = '('+ delims.join('|') +')'; | |
if(wordBased) source = '\\b'+ source +'\\b'; | |
var parts = input.split(RegExp(source)); | |
if(parts.length < 2) return res; | |
// power sets of delimiter indices | |
var sets = [[]], {push} = sets; | |
for(let i = 1, l = parts.length; i < l; i += 2) |
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
CmdUtils.CreateCommand({ | |
name: 'selector-selector', | |
description: ( | |
<ul style="list-style-image:none"> | |
<li>Lets you type a CSS selector and highlights matched elements.</li> | |
<li>Hovering on an element creates a matching selector.</li> | |
</ul>+''), | |
help: [ | |
[<b>Left-click / Enter</b>, | |
'Copy and Quit'], |
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
const Name = 'gatherer', Gatherer = 'http://gatherer.wizards.com/', | |
Base = '<style>\ | |
a img {border:none}\ | |
tr {background-color:inherit !important}\ | |
td {padding:0 .2em 1ex !important; width:auto !important}\ | |
.error {font-style:oblique; line-height:1.8}\ | |
.logo {display:inline-block}\ | |
.logo > img {max-width:100%; vertical-align:middle}\ | |
.loading {opacity:0.9}\ | |
.loading + .logo {opacity:0.4}\ |
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
Cu.import("resource://ubiquity/modules/oauth.js") | |
const self = this, | |
H = Utils.escapeHtml, | |
Twitter = 'http://twitter.com/', | |
TWS = 'http://search.twitter.com/', | |
TWAPI = 'https://api.twitter.com/1.1/', | |
Yats = 'http://yats-data.com/yats/', | |
twicli = 'http://twicli.neocat.jp/', | |
Icon = 'chrome://ubiquity/skin/icons/twitter.ico', | |
Logo = '<a href='+ Twitter +' id=twlogo accesskey="/">' |
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
// 1. Should also work for <img>, <form>, <link>, etc. | |
// 2. Should also work for html string, DOM, and XML. | |
// 3. Should return the same (type of) object it received. | |
function absolutifyUrls(data, baseUrl) { | |
switch(typeof data){ | |
case "string": | |
return data.replace( | |
/\b(href|src|action)=([\"\']?)(?!https?:\/\/)(\S+)\2/ig, | |
function au_repl(_, a, q, path)( | |
a + "=" + q + Utils.url({uri: path, base: baseUrl}).spec + q)); |
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
/*=skin= | |
@name empty | |
@author satyr | |
=/skin=*/ | |
/* Use Stylish, maybe? */ | |
#ubiquity-preview{} |
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
CmdUtils.CreateCommand({ | |
name: 'email-shortcut-sample', | |
takes: {message: noun_arb_text}, | |
description: | |
'http://getsatisfaction.com/mozilla/topics/email_to_a_predefined_address', | |
execute: function(dob){ | |
(Utils.currentChromeWindow | |
.gUbiquity.__cmdManager.__cmdSource.getCommand('email') | |
.execute(context, dob, {to: {text: '[email protected]'}})); | |
}, |
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
diff --git a/ubiquity/feed-parts/header/en/nountypes.js b/ubiquity/feed-parts/header/en/nountypes.js | |
--- a/ubiquity/feed-parts/header/en/nountypes.js | |
+++ b/ubiquity/feed-parts/header/en/nountypes.js | |
@@ -711,17 +711,19 @@ var noun_type_commands = { | |
} | |
return cmds; | |
} | |
} | |
var noun_type_twitter_user = { |
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
const | |
H = Utils.escapeHtml, | |
Aliases = { | |
t: { | |
help: 'title', | |
get text(){ return info().title }, | |
}, | |
u: { | |
help: 'URL', | |
get text(){ return info().url }, |
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
// ==UserScript== | |
// @name GImageHacks | |
// @namespace http://d.hatena.ne.jp/murky-satyr | |
// @description Direct links to the image/page + AutoPagerize support | |
// @include http://*.google.tld/images?* | |
// ==/UserScript== | |
directLinkify([document]); | |
microFormatize(document); | |
setTimeout(function(){ | |
AutoPagerize.addDocumentFilter(microFormatize); |