On 14/03/2011 10:06, Scott Wilson wrote:
Hi everyone,
Since Ross added the JQuery Mobile template and Freeder widget I've
been exploring JQuery Mobile [1], which is a framework for mobile web
applications. As one of the goals of Wookie is to realize the idea of
"one app, any platform" I think its a good idea to build widgets that
are mobile friendly, and so using a framework like this is a good
idea.
However, while JQM mostly works well it is still in alpha, and has
some rough edges. One thing is that quite understandably the
framework is focussed on mobile applications where the widget is the
top-level browser object. So when you put a couple of widgets using
JQM in iFrames, odd things can happen.
Yes, I discovered this over the weekend. Along with a few issues with
properties that I have not yet explored fully.
One of these is navigation - for many functions JQM uses
history.back() to change the state of the page when traversing menus.
This causes problems with iFrames as browsers have different
strategies for handling page history with multiple iFrames in it. In
nearly all cases it does something a bit odd; in Safari it just
refuses to work at all.
I managed to create a workaround which I've also flagged to the JQM
project [2]. However, I suspect its not the only issue we'll need a
temporary workaround for, and so what I've done is I've created a
JQueryMobile Feature for Wookie as that gives us some control of
which version of the library and CSS gets loaded for Widgets.
This sounds like a great idea.
I'll check this in shortly; when its in place you don't include the
JQM JS or CSS in your HTML but instead include this in your
config.xml:
<feature name="http://jquerymobile.com" required="true"/>
Yay!
For now this will load a local patched version of JQM rather than the
one from the CDN.
This is the right approach to take anyway. We've found some issues with
the CDN anyway (it's alpha so there are backward incompatible changes).
However, we need to keep track of the changes we make. Since
JQueryMobile is on GitHub I've forked it for our use [1]. That way we
can create pull requests and track our changes. I've not made Scotts
change yet as I'm not on a dev machine. Naturally I'm happy to provide
commit access to any Wookie committer.
Ross
[1] https://github.com/rgardler/jquery-mobile