Hi Rich, First I don't know if I post here or GitHub so I am starting here. > Let me know if I need to bounce it over to GitHub. >
Here is fine, there too. It will take some time, but I think it pays out to find the courage and play with code. > I am trying to understand how to get Galleria into TW. > http://galleria.io/ > First things first, Adblock doesn't like it. After disabling it for the site, I actually see a site. Anyhow... I have downloaded the JavaScript and dragged and dropped it into TW. > galleria-1.4.2.min.js > galleria-1.4.2.js > One is enough, take minified... it's smaller, well, minified. > I then changed the Type to "application/javascript". > Is this the right way to get the code into TW? > Also, give it a "module-type <http://tiddlywiki.com/prerelease/#ModuleType>" of "library"... I think. > Next I need to use that code if the above is correct. > I am trying to work with the demo code > http://galleria.io/docs/getting_started/beginners_guide/#complete-code > > <!doctype html> > <html> > <head> > <script src=" > http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> > <script src="galleria/galleria-1.4.min.js"></script> > </head> > <body> > <div class="galleria"> > <img src="photo1.jpg"> > <img src="photo2.jpg"> > <img src="photo3.jpg"> > </div> > <script> > Galleria.loadTheme( > 'galleria/themes/classic/galleria.classic.min.js'); > Galleria.run('.galleria'); > </script> > </body> > </html> > Ok, the first thing you see is that galleria comes with an additional dependency, namely jquery. Would be interesing to know if and how loading such a library from google was supported as in your example. Alternatively, you could try including jQuery the same way you included galleria... not sure if that works though, never tried so far. Secondly, you'd need some js macro that instatiates and runs your galleria script on a selector, e.g. http://tb5.tiddlyspot.com/#Basic%20Javascript%20Macro That macro would perhaps do... <<galleria "some-class" "optional-template">> Possibly that macro needs to "require" those libaries for them to be available to whatever it tries to run. I guess that's not the right approach for jquery though, I wouldn't know yet. Maybe jquery needs to be loaded on startup... whichever way that is done. Take a look at how Felix is loading the requred vis.js library in Taskgraph... https://github.com/felixhayashi/tw-taskgraph/blob/master/src/plugins/felixhayashi/taskgraph/Taskgraph.js Best wishes, Tobias. -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/d/optout.
