================================================================================================
var noun_type_url = {
_name: "Valid URL",
suggest: function( text, html ) {
if (!text)
return [ CmdUtils.makeSugg("http://") ];
if(/[A-Za-z0-9_.-]+:\/\/([A-Za-z0-9_.-])/.test(text)){
return [ CmdUtils.makeSugg(text) ];
}
return [ CmdUtils.makeSugg("http://" + text) ];
}
};
CmdUtils.CreateCommand({
name: "url",
takes: {"your shout": noun_type_url},
preview: function( pblock, theShout ) {
pblock.innerHTML = "Will verify: " + theShout.text;
},
execute: function( theShout ) {
var msg = theShout.text;
displayMessage( msg );
}
})