Created
December 15, 2008 13:34
-
-
Save to/35955 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var tomb = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject; | |
var ctx = _jsaCScript.context; | |
if(ctx.onImage){ | |
var src = ctx.target.src; | |
var name = prompt('Source String'); | |
} else { | |
var name = trim(ctx.selection); | |
var string = prompt('Destination String'); | |
} | |
new tomb.Wedata.Item('Motsu', name, { | |
image_url : src, | |
string : string, | |
}).save(); | |
// ----[Utility]------------------------------------------------- | |
function trim(str){ | |
return ('' + str).replace(/^\s+|\s+$/g, ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment