Category Archives: ALAA

Java2Script’s GTalk

I spent about three days writng an SWT based Google Talk client. And the client used Smack Jabber library, which has simple APIs. As writing the client, I kept the code compatible with Java2Script, which means that I can use the latest Java2Script daily release to pack it as a web servlet application and deploy it as rich internet application (RIA). Here is snapshot of Java2Script version of Google Talk:

Java2Script's GTalk

And here is the online Java2Script’s GTalk.

And because Java2Script’s SimpleRPC supports Cross Site Script, the above application can be loaded from any pages by adding the following HTML

Launch GoogleTalk

to your page.

Or you can just copy the above “javascript:…” part (without quotes) and paste it to address bar and go. You will get a Google Talk client (pure JavaScript) in your page (this page or other pages). This “javascript:…” part is considered as A Link An Application (ALAA).

By digging about Google Talk on Digg.com, I found that Google Talk Gadget on Google’s personalized homepage was really hitting the latest news.

Enjoy it.

Update:

The Java2Script’s Google Talk sources are available at SVN repository now:
http://j2s.svn.sourceforge.net/viewvc/j2s/trunk/demos/org.java2script.demo.gtalk/

And you can also download j2s-1.0.0-m5-gtalk.zip, unzip it and deploy gtalk.war to your Java servlet container.

Posted in A Link An Application, AJAX, ALAA, Java2Script News, RPC, Screenshot, Simple RPC, SWT | 83 Comments

Reload:A Link An Application

Copy following as a link and paste in your browser address bar (A new tab or a new window, or other existed tab page[Maybe a Google search result page, not this blog page]):

javascript:if(a="[email protected]://demo.java2script.org/org.eclipse.swt.examples/bin/",window["ClazzLoader"]!=null)$w$(a);else{var d=document,t="onreadystatechange",x=d.createElement("SCRIPT"),f=function(){var s=this.readyState;if(s==null||s=="loaded"||s=="complete"){$w$(a);}};x.src="http://archive.java2script.org/1.0.0-v20061220/j2slib.z.js";(typeof x[t]=="undefined")?x.onload=f:x[t]=f;d.getElementsByTagName("HEAD")[0].appendChild(x);void(0);}

According to your connection speed, it may take a few seconds before some Java2Script things come up. Enjoy it.

Replace the link’s “$wt.examples.controlexample.ControlExample @ http://demo.java2script.org/org.eclipse.swt.examples/bin/” with your Java2Script application URL. It’s class’s full name + @ + the class’s *.js bin root folder. If the URL is not very long (total javascript url string length < 500), it will be OK for modern browsers to load your application.

Posted in A Link An Application, AJAX, ALAA, JavaScript, Sharing, SWT | 173 Comments

A Link An Application

For example:

javascript:(function(){var d=document,b=%22http://java2script.ognize.com/1.0.0-m3/%22,t=%22onreadystatechange%22,x=d.createElement(%22SCRIPT%22),f=function(){var s=this.readyState;if(s==null||s==%22loaded%22||s==%22complete%22){var c=%22org.eclipse.swt.examples.controlexample.ControlExample%22;$CL1(b);$CL2(b+%22../control-examples/%22);$CL3(c,function(){eval(c+%22.main([]);%22);});}};x.src=b+%22j2slib.js%22;(typeof x[t]==%22undefined%22)?x.onload=f:x[t]=f;d.getElementsByTagName(%22HEAD%22)[0].appendChild(x);return;})();

will link to an SWT control examples. We can also call this as “A Link An Application”(ALAA).

OK, let’s see what is going on. Now load SWT control examples from java2script.ognize.com (test site only, may be slow and unstable, enjoy it) into this page.

Or, you can copy the link of SWT control examples, and then visit a new HTML page, for example, visit Google, and then paste the link to the location, and then go. You should find the SWT control examples will be loaded inside Google’s page. All you dealing with is just a link! But you alreay get an application everywhere inside your browser.
Users can also bookmark the “javascript:…” links. To bookmark a “javascript:…” link, you should first bookmark a normal HTML page, and then copy the “javascript:…” link location and paste as URL location in the bookmark’s properties dialog. Some browsers (e.g. Opera) will let you change URL when you’re bookmarking without a later modification of URL.
And whenever users want to load the application, users can click the bookmark, which will bring up the application in users’ currently visiting HTML page. For example, if you have already bookmarked the above SWT control examples application as “javascript:…” link. And if you are visiting visit W3C, and you can click the bookmark, and the application will be loaded without leaving the W3C pages.

That is the mean of “A link An Application”. A “javascript:…” link is an application, which may be hosted inside any given HTML pages. And the “javascript:…” link would be a very useful and complicated application besides those simple “javascript:history.go (-1);” or “javascript:alert(document.lastModified);”. So there are chances that you can deliver your useful and complicated web applications via generated “javascript:…” links into any other HTML paes or other web applications.

You can also considered the “javascript:…” link as plugin extensions to the browsers that needs no installations (Only bookmarking). There are plugins for Firefox or IE. Most of those plugins need installations and may also need manually updates or uninstallations. But the “javascript:…” links is free of those deployment instructions. All the application is just a “javascript:…” link. That is enough simple.

A link is an application. An application is a link.

Posted in A Link An Application, ALAA, Java, Java2Script News, JavaScript, Sharing, SWT | Comments Off on A Link An Application