« Previous | Next »

A Touch of Amber

01 Sep 2012

Update 26 Jun 2022: This site is retooling, as such some Javascript files are not being served and this post's demonstration has been disabled.

I last wrote about Jtalk in Mar 2011. Jtalk has since been renamed to Amber.

This is placeholder text. You will see this text if you're reading this post from the blog's main page or RSS feed. Go on, click on the post's title to see Jtalk in action.


If you see a "Hello World" message in the above paragraph, you're seeing my old post updated from Jtalk to Amber. The HTML head contains the following:

<script src="/amber/js/amber.js" type="application/javascript">
<script type="application/javascript">
    loadAmber({files:['/PN-SamadhiWeb.deploy.js'], prefix:['']});
</script>

PN-SamadhiWeb.deploy.js contains Smalltalk written in Amber, then saved in its "compiled" Javascript form.

The HTML body source for the Hello World paragraph looks like this:

<div id="jtalk_do_it">
<p>This is placeholder text. You will see this text if you're reading this
post from the blog's main page or RSS feed.  Go on, click on the post's
title to see Jtalk in action.</p>
</div>

<script type="application/javascript">
smalltalk.init(smalltalk.SmdwHelloWorld);
jQuery(document).ready(function() {
    smalltalk.SmdwHelloWorld._new()._appendToJQuery_("#jtalk_do_it"._asJQuery().empty());
});
</script>

Not surprisingly, SmdwHelloWorld's renderOn: method looks thusly:

renderOn: html
    html p with: 'Hello world from Amber!'.
Tags: Amber, Jtalk