I'm experimenting with Shindig -- the PHP version, since the Java version 
won't install properly under JBoss 5, and I don't have the patience to 
start downloading various Java app servers and see which will work.

I've noticed that the SVN trunk version fails with even basic gadgets. The 

issue appears to be the order in which the JavaScript is included. Namely, 

auth-init.js is included before config.js (both in 
features/src/main/javascript/features/core.*), but auth-init.js contains 
the line (28):

shindig.auth = new shindig.Auth();

which, in turn calls (auth.js line 159):

gadgets.config.register("shindig.auth", null, init);

The problem is, of course, that gadgets.config doesn't exist yet (it's 
defined later in config.js). As a result, we get the JavaScript error 
"Result of expression 'gadgets' [undefined] is not an object" (Safari) or 
"Error: gadgets is undefined" (FireFox).

If someone can provide me with a pointer to the area of the code where the 

order of including these pieces of JavaScript are, I'd be much obliged. I 
will provide a patch if I can fix it. Incidentally, both Safari and 
FireFox seem to abort processing the JavaScript processing in the HTML 
head block at that point, leaving 'gadgets' wholly undefined at that 
point.

Here's a gadget that demonstrates the problem:

<?xml version="1.0" encoding="UTF-8"?>
<Module>
        <ModulePrefs title="Hello" description="An example of a simple 
gadget" author="James McIninch" 
author_email="[email protected]" />
        <UserPref name="firstname" display_name="Your name" 
datatype="string" default_value="stranger" />
        <Content type="html" preferred_height="50" preferred_width="200">
                <![CDATA[
                    <script type="text/javascript">
                       var prefs   = new gadgets.Prefs();
                       var name  = prefs.getString("firstname");
                       document.getElementById("placeholder").innerHTML = 
name;
                    </script>
 
                    Hello, <span id="placeholder">name goes here</span>!
 
                    Er, did that work?
                ]]>
        </Content>
</Module>



Reply via email to