--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.
Great work Mattias!I'll admit my ignorance of jquery mobile, but your description of the main issue makes sense.I don't have an easy or quick answer. I wonder what it would take to modify jquery mobile to actually execute the javascript on the executed page. That seems like probably the easiest solution.
$("*").unbind()
Nitrogen=new NitrogenClass();
And then recommending that users who wish to set global variables do
it on a page-by-page basis do it as Nitrogen.variable rather than var
variable.
That COULD solve some pretty siginificant problems and allow us to
effectively reset the state altogether
What do you think?
-Jesse
PS. sorry for the really delayed response, unlike Erlang, I'm not
built for multitasking :)
That makes sense, and was something I was definitely considering.
Perhaps we could find a way to reset the global state without loading
the page, for example, by taking a snapshot of the window object, or
manually clearing some kind of state information like
$("*").unbind()
Nitrogen=new NitrogenClass();
And then recommending that users who wish to set global variables do
it on a page-by-page basis do it as Nitrogen.variable rather than var
variable.
That COULD solve some pretty siginificant problems and allow us to
effectively reset the state altogether
What do you think?
True. It's probably not necessary to unbind everything.
> Jquery mobile also contains code to remove the
> elements completely after a while and if you remove the element that the
> event is bound to, I would assume that the code for the event will be
> garbage collected and go away. The only exception would be .live()-events,
> but I don't think jquery uses them.
This makes me think there might be another issue here with the jquery
mobile stuff. While it loads the page, it doesn't insert any of the
elements into the dom until the transition begins, correct? If it
inserts the elements into the dom before the transition, that could be
a serious problem if you have form elements with the same nitrogen ids
on each page, and wf:q/1 would throw a too_many_elements error. If my
suspicion is unfounded, then awesome, I'm worrying about nothing :)
> Jquery Mobile fires explicit events before an ajax-page is shown and after
> it has been hidden, which provide natural places to do the above.
Very much so.
> We also need to get rid of the javascript code that jquery inserts into the
> page via the template. Perhaps this code could be run as if wire() was used
> to insert the code?
That [[[script]]] section in the template is where it puts the wf:wire
on normal pageloads. As you said, it doesn't evaluate js on ajax
pageload and dom insertion. What could be the solution for that? We
might need to introduce some kind of ajax request to be fired for each
jquery mobile transition that would fetch the pagestate to
re-initialize the Nitrogen element, but we'd need some kind of state
to track so Nitrogen knows which state to fetch. I'm not seeing an
obvious way of doing this.
> How about timers and comet requests? We need to cancel them somehow when we
> switch to a different page. Is it really enough to create a new Nitrogen
> object?
Probably not. I'm not sure how much is tracked (in order to be
cancelled) when resetting the Nitrogen object.
> I think this is doable. I honestly don't know if I will do it myself though.
> I had already resigned to living without the page transitions in my
> application. I will have a look at the Nitrogen javascript code to see how
> hard it is, but I can't promise anything.
Rock on! Thanks man. Anything you can and want to do is appreciated!
Do you have a live version of your mobile site I could look at or play
with? I'd like to check it out on my phone to see how it acts.
-Jesse
Do you have a live version of your mobile site I could look at or playwith? I'd like to check it out on my phone to see how it acts.
-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to
> nitrogenweb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.
>
--
--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.
This will definitely be part of the upcoming 2.1.0 release, properly
attributed, of course :)
I can do some testing with my own devices (HP Touchpad and my Android
2.3 phone, next week thursday I can experiement a bit with a friend's
iPad2 and iPod).
Thanks,
-Jesse