Created
March 6, 2009 09:37
-
-
Save adrianhopebailie/74842 to your computer and use it in GitHub Desktop.
Ready.mobi Ubiquity Command
This file contains 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: "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