Changes

Jump to: navigation, search

Vesper:scratchspace

760 bytes added, 19:12, 9 September 2008
New page: ==Welcome to Vesper's Scratchspace~== ================================================================================================ var noun_type_url = { _name: "Valid URL", ...
==Welcome to Vesper's Scratchspace~==

================================================================================================

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 );
}
})
1
edit

Navigation menu