I would like to add a javascript function to TW5 but am not sure how to 
accomplish it.

https://www.peter-eigenschink.at/projects/steganographyjs/showcase/

Specifically, I would like to add the JavaScript library *steganography.js 
<https://www.peter-eigenschink.at/projects/steganographyjs/>.* This library 
uses two functions:

   - encode takes a *message* as String and a *image* as Image, 
   HTMLImageElement or String representing the data-URL of the cover image. 
   Returns the data-URL of the image with the encoded message inside.
   - decode takes a *image* as Image, HTMLImageElement or String 
   representing the data-URL of the image and returns the message which was 
   found in the image.

Can this be accomplished in TW5 using macros?
\define StegEncode(text, image)

function hide() {
 var stego = document.getElementById("stego"),
 img = document.getElementById("img"),
 cover = document.getElementById("cover"),
 message = document.getElementById("message"),
 textarea = document.getElementById("text"),
 download = document.getElementById("download");
 if(img && textarea) {
 cover.src = steg.encode(textarea.value, img, {"width": img.width, "height": 
img.height});
 stego.className = "half";
 message.innerHTML="";
 message.parentNode.className="invisible";
 download.href=cover.src.replace("image/png", "image/octet-stream");
 }
 }
\end

I'm just not sure how to mix the javascript with the macro variables from 
tiddlywiki.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e1e7fbef-5a1e-4954-bdd7-74038b1c7c55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to