1 2 3 Previous Next

gmurray71

39 posts
gmurray71

Ajax Waiter Blog

Posted by gmurray71 Oct 26, 2008

I came across a situation where I needed an Ajax style spinner but could not download any images. I extended concepts from the jMaki Revolver to make an image free spinner all in JavaScript.


  window.waiter.show({ speed: 1,
                       delay : 40,
                       targetId : 'body',
                       textColor : '#FFF',
                       background: 'green',
                       opacity : 85,
                       message : 'Please wait 2'});

Test on this page

For detailed documentation on all the properties and more examples see the Ajax Waiter.

If there are features or enhancements you would like to see let me know.

gmurray71

jMaki 1.0 is Live Blog

Posted by gmurray71 Sep 25, 2007

Having experienced continuous development for over 2 years it is time to put a stake in the ground and call jMaki 1.0 ready for general use.

Included in the bundles:

  • The core jMaki framework.
  • Sample applications.
  • Ant task for creating applications and adding widgets and necessary dependencies to those applications.
  • All the scripts and widget libraries.

We provide bundles for both PHP and Java. The ant task for application creation allows you to create applications rapidly from the command line.

We also provide plugins for both Netbeans 5.x and 6.0 that will create jMaki applications with all the necessary resources in the correct places. Included support is:

  • The core jMaki Framework.
  • Templates to start out with.
  • Drag and drop widgets with templates.
  • Theming support.

How you experience jMaki is up to you. Find the bundles on the downloads page.

We have also started work on consolidating all the blogs, documents, and form posts on using jMaki into an online book. This is a work in progress and you can find the starting table of contents on our developer site.

I would like to thank everyone on the team and others not listed on the team page for their hard work in putting this release together. I like to encourage would encourage you to join the effort. jMaki is going places and we would love to have you along for the ride.

gmurray71

Re-Namespacing Dojo Blog

Posted by gmurray71 Aug 10, 2007

The motivation behind re-namespacing Dojo for jMaki was simple. We want to have both Dojo 0.4.3 and Dojo .9 running in the same web application and we also want to give our users the ability to use jMaki many years in the future. So I undertook the task of re-namespacing Dojo by hand and quickly found out that it was a involved task. Reason being there are 27350 instances of the word Dojo spread across 1013 files in the standard Dojo 0.4.3 Ajax release.To make things easier I have created a configurable ant task that will do the work.

Why ant? We figure it's the easiest to integrate with a build process and it's pretty easy to do string replacements that can be configured. You can see the RenamespaceTask.java here. You can find a compiled version of the jar file here.

We have provided a simple ant file that will compile the task and run it which you can get here.

Before using this task I strongly recommend you backup your files as this task will overwrite your existing files.

Here are the arguments I give to the task to re-namespace dojo and all of the occurrences in all js, css, and html files. This is the the most thorough and best option as it will re-namespace all dojo files and the dojo styles.

<target name="ns" description="Namespace Dojo Task" depends="jar">
  <taskdef name="renamespace" classname="org.jmaki.ant.ReNamespaceTask"
                 classpath="dist/ns-dojo.jar"/>
  <renamespace 
       ns="gojo"
       tokens="dojo" renameFile="dojo.js" >
    <fileset dir="/Users/gmurray/Desktop/dojo-0.4.3-ajax" />
  </renamespace>
</target>   

You simple need to provide a one or more filesets to files containing references to dojo. This simply replaces all the strings. Containing dojo.

You can do more advanced token sets that will not replace the styles and target only the dojo instances like the following.

<target name="ns" description="Namespace Dojo Task" depends="jar">
  <taskdef name="renamespace" classname="org.jmaki.ant.ReNamespaceTask"
                 classpath="dist/ns-dojo.jar"/>
  <renamespace
             ns="gojo"
             tokens="dojo.,{dojo},dojo=,dojo =,dojo:,(dojo,dojo[,/dojo,|dojo,&quot;dojo&quot;"
             renameFile="dojo.js"
             extensions="js,json,html">
    <fileset dir="/Users/gmurray/Desktop/dojo-0.4.3-ajax" />
  </renamespace>
</target> 

You may notice the renameFile attribute. This option will rename the dojo.js file to the same name as the namepace.

You need to rename the dojo.js to the same name as the namespace. If you leave the task defaults this will be automatically done. If you do not rename the dojo.js the dojo package loader will not look in the correct place for the dojo resources (I'm not clear why this was done but if the file names are not the same dojo will look up two directories for dojo resources). The re-namespace won't work if you don't rename.

You will also need to re-namespace your code that uses Dojo. You can add multiple filesets so this can be done in one sweep.

When choosing a name to re-namespace to you need a valid JavaScript identifier so you can not include "." or "-" in the name. For jMaki we chose "dj4d3" which is a bit cryptic but it is short and will not conflict with a future version of dojo or another library.

The beauty of re-namespacing is that you can now use two versions of Dojo in the same application and in the same page without conflicts. Both versions will share the same djConfig object which you may chose to also rename.

The ant task was tested with the Dojo .0.4.3 Ajax release. You can test it by simply downloading Dojo from the Dojo downloads page and run it against the release. Then check out the samples and tests.

Once again make sure to backup your work before running task. Let me know what what you think.

gmurray71

jMaki Actions Blog

Posted by gmurray71 Jul 29, 2007
gmurray71

jMaki Revolver Widget Blog

Posted by gmurray71 Jun 24, 2007
gmurray71

jMaki Extensions Blog

Posted by gmurray71 Jun 7, 2007

Just when we thought it was safe to call jMaki feature complete we got a lot of feedback for various features that could all be handled by a single extension feature.

What are extensions in jMaki?

Extensions are behavior / functionality that are shared across widgets. Extensions are loaded after the jmaki.js  and before glue (your application logic). Examples may include enhanced debugging support, sound, or controllers that are specific to an individual application.

What does an extension look like?

jmaki.namespace("jmaki.extensions.jmaki.ext.bar");

jmaki.extensions.jmaki.ext.bar.Extension = function(args) {
  jmaki.debug = true;
  jmaki.log("jMaki bar Extension intialized");
  jmaki.log("jMaki bar : extensionDir=" + args.extensionDir);
 }

Extensions are namespaced JavaScript objects that are mapped in the config.json file like the following:

{
  'config': {
    'version': '.9.3',
    'extensions' : [
          'jmaki.ext.foo' 
         ]
    }    
}

Extensions are like widgets in that the application will look under /resources/jmaki/ext/bar for a file called extension.js. The contents are like the file above. The extensions will be located in the resources directory and located using the extension name. The extension 'jmaki.ext.foo' would be located in the following directory:

resources
    |
    +jmaki
       |
       +ext
          |
          +foo
             |
             +extension.js

Extensions can also be loaded on a per URL basis or based on a wildcard like you may see in the code below:

{
  'config': {
    'version': '.9.3',
    'extensions' : [
          { url : '/basicArgs.jsp',  name : 'jmaki.ext.foo' },
          { url : '*.jsp', name : 'jmaki.ext.bar'},
          { url : '/relativedir/*', name : 'jmaki.ext.foo', args : { 'topic' : 'footopic'}}
         ]
    }    
}

Notice the url property can be a URL or contain a '*'. The mappings  can also provide an args property containing default data that is accessible in the extension (extension.js).

We also plan on adding a page level tag and or function for adding functions in the next release. It is our hope to keep the core of jMaki small and nimble. At the same time we want to future proof jMaki.Extensions are available in the PHP, Phobos, and Java versions of jMaki and may be found at the jMaki Downloads page.

Here are some extensions we are thinking about:

  • Back/Forward button tracking
  • Sound
  • Bookmarking
  • Google Gears Integration
  • Cross Widget Drag and Drop
  • JavaScript controllers

What kind of extensions would you like to see for jMaki?

gmurray71

jMaki at JavaOne 2007 Blog

Posted by gmurray71 Apr 26, 2007

Testing multiple browsers on different platforms in the past was time consuming and took a bit of work. Even with virtualization in use you had no way to do side by side comparisons of what different browsers would render. That was until Parallels introduced an upcoming feature called Coherence.

I installed Windows XP and Windows Vista and am running them in Coherence mode which allows me to do side by side comparisons of IE 6 in XP, IE 7 in Vista, Safari, and Firefox 2.0  all in one place.

whole_enchalada

Larger View

This is a developer and testers dream. Had I not done this myself I would swear the image was doctored. I have had no issues with the release candidates of Coherence and the only limiting factors are the amount of memory your have (I have 4 GB) and your screen size. This is a small price to pay for the benefits.

gmurray71

The Zen of jMaki Blog

Posted by gmurray71 Dec 12, 2006

Filter Blog

By date: