2 * Galleria SlideShowPro Plugin v 1.1
3 * http://galleria.aino.se
6 * Licensed under the MIT license.
11 var G = window.Galleria;
12 if (typeof G == 'undefined') {
16 var S = G.SSP = function(url) {
17 var query = "select * from xml where url='" + url + "' limit 1";
18 var encodedQuery = encodeURIComponent(query.toLowerCase());
19 var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodedQuery + '&format=json&callback=?';
22 if (url.substr(0,7) == 'http://') {
23 var a = document.createElement('a');
25 this.domain = a.protocol+'//'+a.hostname;
26 this.path = url.substring(0,(url.lastIndexOf("/")) + 1);
29 $.getJSON(yql, function(data) {
39 getAlbum: function(index, callback) {
40 this.ready(function() {
41 var data = this.parseData(index);
42 callback.call(this, data);
46 getAbsoluteUrl: function(path) {
47 if (path.substr(0,7) != 'http://') {
48 if (path.substr(0,1) != '/') {
49 path = this.path + path;
51 path = this.domain + path;
56 parseData: function(index) {
57 var albums = this.data.query.results.gallery.album;
58 var album = albums[index] || albums;
59 var path = album.lgPath || '';
60 var thumbPath = album.tnPath || path;
65 G.prototype.loop(album.img, function(img) {
67 image: scope.getAbsoluteUrl(path+img.src),
68 thumb: scope.getAbsoluteUrl(thumbPath+img.src),
72 obj.description = img.caption
81 ready: function(callback) {
83 G.prototype.wait(function() {
88 G.raise('YQL not available.')