Line | |
---|
1 | /* |
---|
2 | Galleria History Plugin 2011-08-01 |
---|
3 | http://galleria.aino.se |
---|
4 | |
---|
5 | Copyright 2011, Aino |
---|
6 | Licensed under the MIT license. |
---|
7 | |
---|
8 | */ |
---|
9 | Galleria.requires(1.25,"The History Plugin requires Galleria version 1.2.5 or later."); |
---|
10 | (function(e,c){Galleria.History=function(){var k=[],l=!1,f=c.location,g=c.document,h=Galleria.IE,b="onhashchange"in c&&(g.mode===void 0||g.mode>7),d,i=function(a){a=d&&!b&&Galleria.IE?a||d.location:f;return parseInt(a.hash.substr(2),10)},m=i(f),n=[],o=function(){e.each(n,function(a,b){b.call(c,i())})},j=function(){e.each(k,function(a,b){b()});l=!0};b&&h<8&&(b=!1);b?j():e(function(){c.setInterval(function(){var a=i();if(!isNaN(a)&&a!=m)m=a,f.hash="/"+a,o()},50);h?e('<iframe tabindex="-1" title="empty">').hide().attr("src", |
---|
11 | "about:blank").one("load",function(){d=this.contentWindow;j()}).insertAfter(g.body):j()});return{change:function(a){n.push(a);if(b)c.onhashchange=o},set:function(a){if(!isNaN(a))!b&&h&&this.ready(function(){var b=d.document;b.open();b.close();d.location.hash="/"+a}),f.hash="/"+a},ready:function(a){l?a():k.push(a)}}}()})(jQuery,this); |
---|
Note: See
TracBrowser
for help on using the repository browser.