For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 13 replies, 3 voices, and was last updated 13 years, 3 months ago by
support-michael.
-
AuthorPosts
-
YannMemberhi ,
i’ve a problem, i try to create an image gallery with this method
http://www.photoswipe.com/latest/examples/04-jquery-mobile.html#Gallery1
when i call directly from my iphone my script (.asp) the image gallery run as well.
i tried to place this in my mobi file like that:if (newPageId=='#m1-galerie') { $("head").append( $(" <link href='/gallery/styles.css' type='text/css' rel='stylesheet'/>")); $("head").append( $(" <link href='/gallery/photoswipe.css' type='text/css' rel='stylesheet'/>")); callOtherDomain("http://m.resto.chrom.fr/galerie/gallery.asp","m1-galerie-ResultGalerie"); }
function callOtherDomain(url,target) { // native XMLHttpRequest object //alert(url); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = function() {ajaxDone(target);}; req.open("GET", url, true); req.send(null); // IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = function() {ajaxDone(target);}; req.open("GET", url, true); req.send(); } } setTimeout("ajax(page,'scriptoutput')", 10000); } function ajaxDone(target) { // only if req is "loaded" phoneui.showActivityDialog('Chargement...'); if (req.readyState == 4) { // only if "OK" if (req.status == 200 || req.status == 304) { results = req.responseText; document.getElementById(target).innerHTML = results; } else { document.getElementById(target).innerHTML="Erreur veuillez recharger la page SVP." } phoneui.hideActivityDialog(); }
m1-galerie-ResultGalerie is a text fields
when i test my page is loaded and displayed in my m1-galerie-ResultGalerie but wiht no effect.
can you help me please?
thanks
YannFebruary 6, 2012 at 10:34 am #323008
YannMemberHello ,
i tested from google chrom and i ve this error message in js console:
XMLHttpRequest cannot load file:///C:/Users/Yann/Desktop/index-www/gallery/lib/klass.min.js?_=1328545728722. Origin null is not allowed by Access-Control-Allow-Origin.??????????????
i don’t understand because this is a local file
any idea?
thanks , YannFebruary 6, 2012 at 11:20 am #323009
support-michaelKeymasterA couple of thoughts:
1) @support-vadim pointed out that Chrome by default does not allow to load files from file:// protocol
http://www.google.com/support/forum/p/Chrome/thread?tid=171316324d16747b&hl=en2) Check and see if the MobiOne Local Server is enabled? If yes try disabling it and see if the problem clears
From Window>Settings, got to Local Server and disableFebruary 6, 2012 at 12:09 pm #323014
YannMemberThanks Wayne
but i don’t found a solution.
my remote page run as well with safari or chrome,
i tried to call remote page from safari on my iphone.
But when i call from MobiOne Test center nothing happen
i change index_custom.js and add CSS & JS
helppppppppFebruary 6, 2012 at 3:11 pm #323027
YannMemberis it possible to call a entir remote web page via ajax?
because when i call my remote web page with js tag she’s run as well
so, i put js in index_custom.js like that:$("head").append( $(" <link href='gallery/styles.css' type='text/css' rel='stylesheet'/>")); $("head").append( $("<script type='text/javascript' src='gallery/lib/klass.min.js'></script>")); $("head").append( $("<script type='text/javascript' src='gallery/lib/code.photoswipe-3.0.4.min.js'></script>")); $("head").append( $("<script type='text/javascript' src='gallery/lib/galerie.js'></script>")); callOtherDomain("http://xxxxxx.fr/xml/galerie/gallery.asp","m1-galerie-ResultGalerie");
Css files are loaded but js file seems missing in ressource monitor
Thanks for your help
YannFebruary 7, 2012 at 9:10 am #323050
YannMember@Wayne
Hello, do you have an example of remote photo gallery ?
my photos are hosted by a remote server and i would like to load them by ajax because this app will be compiled for appstore.
in my remote page i’ve the list of photo hosted by remote server.
thanks
YannFebruary 7, 2012 at 11:09 am #323056
support-michaelKeymasterhi yanni,
No I have not developed an image gallery. I have been in discussion with the dev team about how to do this. Last week I started researching use of a carousel widget that we hope to add to the palette in the next couple of months. It can be used to hold a wide range of UI components.
My approach to an image gallery would be to include the widget in my UI (bundled in my app) and fetch the images dynamcially. Furthermore if it is a large gallery I would consider fetching images incrementally. Think of how some of the news readers or facebook’s timeline incrementally fetch images as you reach the end of the list. Here is a brief video of the carousel widget that I hacked into one of my UI’s for demo purposes.
http://www.genuitec.com/support-genuitec/viewtopic.php?p=5356#p5356
The widget is swipeview from http://cubiq.org/. I only embedded text it in for demo purposes. But it can accept images.In this example I had to make a 1 line tweak to the css and add <div> to my html. I did not try resizing such as device orientation.
February 7, 2012 at 12:23 pm #323061
YannMemberThanks Wayne,
it’s very interesing for me, i hope you ll find a solution to integrate image gallery component in MobiOne.
So, your video is “may be” a solution for me, do you have an example or mobi file about this demo (SwipeView)
PS: my first app has been accepted by AppleStore :o)thanks a lot
YannFebruary 7, 2012 at 12:26 pm #323062
support-michaelKeymasterFebruary 7, 2012 at 1:52 pm #323065April 18, 2012 at 2:30 pm #325385
bezorisMemberAnyone ever resolve this? Even better would be a skeleton project…
I’m also attempting to implement a photoswipe gallery (for ipad)… All is remote after a loading page image button. Everything is fine until a thumbnail tap, then safari launches to display the full image (a painting in this case).
i realize that it’s Android launch day for you guys, but some direction would be great!
Best, Chris.
April 20, 2012 at 3:32 am #325433
YannMemberHello,
in my project i used this
http://cubiq.org/swipeview
YannApril 20, 2012 at 9:11 am #325442
bezorisMemberThanks Yann… Looks good I’ll check it out.
Did you add swipeview as custom js, or leave it completely remote? Just curious.
Thanks, Chris.
April 20, 2012 at 9:41 am #325444
support-michaelKeymasterHere is ref to an example screencast of a UI I created a while back using swipeview with mobione:
http://www.genuitec.com/support-genuitec/viewtopic.php?p=5356#p5356The integration of swipeview is a manual process. I did not try integrating images but should be doable, it’s just javascript.
-
AuthorPosts