Skip to content

Instantly share code, notes, and snippets.

@adrianhopebailie
Created March 6, 2009 09:37
Show Gist options
  • Save adrianhopebailie/74842 to your computer and use it in GitHub Desktop.
Save adrianhopebailie/74842 to your computer and use it in GitHub Desktop.
Ready.mobi Ubiquity Command
CmdUtils.CreateCommand({
name: "ready",
icon: "http://ready.mobi/images/favicon.ico",
homepage: "http://ready.mobi/",
author: { name: "Adrian Hope-Bailie", email: "ahopebailie@mtld.mobi"},
license: "GPL",
description: "Checks the current page for mobile readiness",
help: "Simply run ready from any page and the current page will be checked for mobile readiness.",
takes: {"url": noun_type_url},
_readyURL: function(url){
url = Utils.trim(url);
var preview = url;
if(url.length == 0){
url = Application.activeWindow.activeTab.document.URL;
}
return "http://ready.mobi/results.jsp" + Utils.paramsToString({uri: url});
},
preview: function( pblock, url) {
url = Utils.trim(url.text);
if(url.length == 0){
url = "the current page";
}
pblock.innerHTML = "Checks if " + url + " will render on a mobile device.";
},
execute: function(url) {
Utils.openUrlInBrowser(this._readyURL(url.text));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment