What's the most useful hack you've discovered for Mozilla's new Ubiquity tool?
That it can close Firefox faster then I can with the mouse and that little [x] thing in the corner... :-P
My co-worker has had 3 blue-screens on his machine since installing it. Not totally convinced this is what did it, but it's the only thing he's changed today. I'm uninstalling it for now (and so is he).
"translate this" and "edit-page". I think I'd find the Google Apps features useful if they supported hosted domains.
I just wrote this:
makeSearchCommand({
name: "stackoverflow-tagsearch",
author: { name: "Jörg W Mittag", email: "[email protected]"},
license: "MIT X11",
url: "http://Beta.StackOverflow.Com/questions/tagged/{QUERY}",
icon: "http://StackOverflow.Com/favicon.ico",
description: "Searches <a href=\"http://StackOverflow.Com\">StackOverflow.Com</a> for the given tag(s).",
help: "Searches <a href=\"http://StackOverflow.Com\">StackOverflow.Com</a> for the given tag(s).",
preview: function(pBlock, directObj) {
if (directObj.text)
pBlock.innerHtml = "Searches <a href=\"http://StackOverflow.Com\">StackOverflow.Com</a> for " + directObj.text;
else
pBlock.innerHTML = "Searches <a href=\"http://StackOverflow.Com\">StackOverflow.Com</a> for the given tag(s).";
}
});
Nice toy!
Now I need to figure out how to HTTP POST to http://Beta.StackOverflow.Com/search with JQuery and Ubiquity ... If only there was a site where I could ask that question!
I wrote this a few days ago: http://www.appidx.com/ubiq/stackoverflow.html
The execute portion refuses to run with POST data. The code is the right code, and I've tried with the native code of the function with the XUL component javascript and it likewise refuses to run. Any help would be appreciated. The preview on the other hand works fine.
CmdUtils.CreateCommand({
name: "stackoverflow",
author: {name: "Aryeh Goldsmith"},
homepage: "http://www.appidx.com/ubiq/",
icon: "http://stackoverflow.com/favicon.ico",
takes: {search: noun_arb_text},
license: "MPL",
description: "Searches the highlighted text on stackoverflow.",
_version: "52",
preview: function ( pblock, inputObject) {
var query = inputObject.text;
pblock.innerHTML = "Search stackoverflow.com for " + query + "<br/>";
var url = "http://stackoverflow.com/search";
params = {"search-text": query, "hiddenstuff": ''};
jQuery.post( url, params, function( html ) {
var $ = jQuery;
pblock.innerHTML += "<div style='display:none;'>" + html + "</div>";
var ques = $(pblock).find('.summary h3');
var details = $(pblock).find('.summary .excerpt');
var out = "<div style='margin-bottom: 6px;'><b>Previewing the first 5 results:</b></div>";
for (var j = 0; j< ques.size() && j < 5; j++) {
out += "<div style='padding: 5px;'><b>" + ques[j].innerHTML + "</b><br />";
out += details[j].innerHTML + "</div>";
}
pblock.innerHTML = out;
});
},
execute: function( inputObject ) {
var query = inputObject.text;
var url = "http://stackoverflow.com/search";
var params = {
"search-text": query,
hiddenstuff: ""
};
// The following refuses to work... why? I just don't know! AFAIK it's correct.
openUrl(url, params);
},
})