Okay, after splitting my JS up into logical pieces and deploying them using
the module approach I can get jquery mobile to work. Perhaps the loading
times or sequence of script run was breaking things before?
Some trivial behaviours I added to a sidebar including a swipe out:
(function () {
define(["jquery"], function ($) {
$("#go").click(function () {
$("#sidebar").show("fast");
});
$("#stop").click(function () {
$("#sidebar").hide("fast");
});
$("#sidebar").on("swipeleft", function () {
$("#sidebar").hide("slow");
});
});
}).call(this);
My locate module, I couldn't get to drips with the utils url extender so
have coded manually:
(function () {
define(["t5/core/ajax"], function (ajax) {
geoLocate = function (eventLinkURI) {
if (navigator.geolocation) {
navigator.geolocation
.getCurrentPosition(function (position)
{
var geolink = eventLinkURI
+ "?lat=" + position.coords.latitude
+ "&long=" + position.coords.longitude;
ajax(geolink, null);
}, geoError);
}
};
function geoError() {
alert('There was a problem determining your location. Some
features may not be available.');
}
return {
geoLocate: geoLocate
};
});
}).call(this);
I still can't figure out how to access functions defined in modules
directly using onclick= though, any ideas how to export them for direct
client side access?
On Fri, Sep 2, 2016 at 9:49 PM, Qbyte Consulting <[email protected]>
wrote:
> I tried to add jquery mobile to my T5.4 project for swipe but it cracks
> up. Same for angularjs.
>
> Is there additional config required to add js libraries? Since I have
> jquery set up already I figured I could just add the mobile.
>
> Sent from my iPhone
>
> > On 2 Sep 2016, at 19:40, Thiago H de Paula Figueiredo <
> [email protected]> wrote:
> >
> >> On Fri, 02 Sep 2016 15:18:24 -0300, Svein-Erik Løken <[email protected]>
> wrote:
> >>
> >> I cannot find any swipe and touch JavaScript library in Tapestry. Are
> there any plans to include one in Tapestry in the future?
> >
> > No, as it's pretty easy to use almost any JS library or framework inside
> Tapestry. ;) :)
> >
> >> If it is - I will use that library now. The Tapestry dev team use to
> find the best library :) It seems that Hammer JS and Touch Swipe are
> popular(?). Any recommendation?
> >
> > I'm sorry, but I haven't used any of them.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>