simpleslider 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc64bb70efe1259dad08f25970c26571b86e4d7
|
4
|
+
data.tar.gz: 9f998280154dad42680864fb73c2ecc7fa93979e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 265fc69dffa81ccce727f26b3badff3f0042a47bcae8470815353c737773dd59fcf11fbe8e15f3534792a17fea14ccaeefaaa43d4b20c5d77c3cc595f1530dda
|
7
|
+
data.tar.gz: 8904b2616dccb7501572c7206182c2057f5d453a34b7b99cd4d93d4be6d1419e6396859c2e1fa5c60877413da458e33c763bd02d16a08ce57ca685bce97900f9
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*! Simpleslider -
|
1
|
+
/*! Simpleslider - v1.0.3 - 2014-03-13
|
2
2
|
* https://github.com/vlewin/jquery.simpleslider
|
3
3
|
* Copyright (c) 2014 Vladislav Lewinn; Licensed MIT */
|
4
|
-
/*! Simplediv -
|
4
|
+
/*! Simplediv - 1.0.3 - 2014-03-13
|
5
5
|
* https://github.com/vlewin/jquery.simplediv
|
6
6
|
* Copyright (c) 2014 Vladislav Lewinn; Licensed MIT */
|
7
7
|
|
@@ -11,6 +11,7 @@ var SimpleSlider = function(element, opts) {
|
|
11
11
|
this.init = function() {
|
12
12
|
this.id = element.selector;
|
13
13
|
this.element = $(this.selector);
|
14
|
+
this.spinner = opts.spinner;
|
14
15
|
this.breadcrumb = opts.breadcrumb;
|
15
16
|
this.breadcrumb_selector = opts.breadcrumb_selector;
|
16
17
|
this.link_selector = opts.link_selector;
|
@@ -37,7 +38,6 @@ var SimpleSlider = function(element, opts) {
|
|
37
38
|
|
38
39
|
var pathname = (location.pathname+location.hash);
|
39
40
|
var childName = sessionStorage.getItem(pathname);
|
40
|
-
|
41
41
|
var back_arrow = '<i class="fa fa-lg fa-arrow-circle-left"></i> ';
|
42
42
|
var parent = '<li><a class="' + this.back_link_selector.replace('.', '') +'">' + back_arrow + parentName + '</a>';
|
43
43
|
var child = '<li><a>' + childName + '</a></li>';
|
@@ -59,7 +59,12 @@ var SimpleSlider = function(element, opts) {
|
|
59
59
|
};
|
60
60
|
|
61
61
|
this.wait = function() {
|
62
|
-
this.
|
62
|
+
if(this.spinner) {
|
63
|
+
this.html(this.spinner);
|
64
|
+
} else {
|
65
|
+
this.html('<img src="/assets/spinner.gif" alt="Spinner"> Please wait ...');
|
66
|
+
}
|
67
|
+
|
63
68
|
return this;
|
64
69
|
};
|
65
70
|
|
@@ -84,8 +89,10 @@ var SimpleSlider = function(element, opts) {
|
|
84
89
|
|
85
90
|
this.forward = function(pageurl) {
|
86
91
|
var plugin = this;
|
92
|
+
plugin.wait().slide('right');
|
93
|
+
|
87
94
|
$.get(pageurl, function(data) {
|
88
|
-
plugin.showBreadCrumb().
|
95
|
+
plugin.showBreadCrumb().html(data);
|
89
96
|
});
|
90
97
|
|
91
98
|
return this;
|
@@ -194,3 +201,4 @@ Number.prototype.px = function () {
|
|
194
201
|
Array.prototype.last = function () {
|
195
202
|
return this[this.length - 1];
|
196
203
|
};
|
204
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Simpleslider -
|
1
|
+
/*! Simpleslider - v1.0.3 - 2014-03-13
|
2
2
|
* https://github.com/vlewin/jquery.simpleslider
|
3
3
|
* Copyright (c) 2014 Vladislav Lewinn; Licensed MIT */
|
4
|
-
var SimpleSlider=function(a,b){this.init=function(){return this.id=a.selector,this.element=$(this.selector),this.breadcrumb=b.breadcrumb,this.breadcrumb_selector=b.breadcrumb_selector,this.link_selector=b.link_selector,this.back_link_selector=b.back_link_selector,this.bind(),this},this.activeLink=function(){return $(this.id).find("a[data-target='"+location.hash+"']")},this.showBreadCrumb=function(){if(this.breadcrumb){var a=$(this.id).find("section").data("crumb");a||(a=location.pathname.replace(/\//g,"").capitalize());var b=location.pathname+location.hash,c=sessionStorage.getItem(b),d='<i class="fa fa-lg fa-arrow-circle-left"></i> ',e='<li><a class="'+this.back_link_selector.replace(".","")+'">'+d+a+"</a>",f="<li><a>"+c+"</a></li>";$(this.breadcrumb_selector).html(e).append(f).show()}return this},this.hideBreadCrumb=function(){return this.breadcrumb&&$(this.breadcrumb_selector).html(""),this},this.html=function(a){return $(this.id).find("section article:last-of-type").html(a),this},this.wait=function(){return this.html('<img src="/assets/spinner.gif" alt="Spinner"> Please wait ...'),this},this.slide=function(a){var b=$(this.id).find("section article:first-of-type"),c=$(this.id).find("section article:last-of-type");return"right"===a?(b.css("margin-left","-100%").css("visibility","hidden"),c.css("visibility","visible")):(b.css("margin-left","0%").css("visibility","visible"),c.css("visibility","hidden")),this},this.remember=function(a,b){sessionStorage.setItem(a,b)},this.forward=function(a){var b=this;return
|
4
|
+
var SimpleSlider=function(a,b){this.init=function(){return this.id=a.selector,this.element=$(this.selector),this.spinner=b.spinner,this.breadcrumb=b.breadcrumb,this.breadcrumb_selector=b.breadcrumb_selector,this.link_selector=b.link_selector,this.back_link_selector=b.back_link_selector,this.bind(),this},this.activeLink=function(){return $(this.id).find("a[data-target='"+location.hash+"']")},this.showBreadCrumb=function(){if(this.breadcrumb){var a=$(this.id).find("section").data("crumb");a||(a=location.pathname.replace(/\//g,"").capitalize());var b=location.pathname+location.hash,c=sessionStorage.getItem(b),d='<i class="fa fa-lg fa-arrow-circle-left"></i> ',e='<li><a class="'+this.back_link_selector.replace(".","")+'">'+d+a+"</a>",f="<li><a>"+c+"</a></li>";$(this.breadcrumb_selector).html(e).append(f).show()}return this},this.hideBreadCrumb=function(){return this.breadcrumb&&$(this.breadcrumb_selector).html(""),this},this.html=function(a){return $(this.id).find("section article:last-of-type").html(a),this},this.wait=function(){return this.html(this.spinner?this.spinner:'<img src="/assets/spinner.gif" alt="Spinner"> Please wait ...'),this},this.slide=function(a){var b=$(this.id).find("section article:first-of-type"),c=$(this.id).find("section article:last-of-type");return"right"===a?(b.css("margin-left","-100%").css("visibility","hidden"),c.css("visibility","visible")):(b.css("margin-left","0%").css("visibility","visible"),c.css("visibility","hidden")),this},this.remember=function(a,b){sessionStorage.setItem(a,b)},this.forward=function(a){var b=this;return b.wait().slide("right"),$.get(a,function(a){b.showBreadCrumb().html(a)}),this},this.back=function(){$(this.id).find("section article:first-of-type").css("visibility","visible"),$(this.id).find("section article:last-of-type").css("visibility","hidden"),this.hideBreadCrumb().slide("left")},this.bind=function(){var a=this;$(window).on("load",function(b){return location.hash?(b.preventDefault(),a.forward(location.href.replace("#","")),!1):void window.history.pushState({path:location.pathname},"Index",location.pathname)}),$(window).on("popstate",function(b){return location.hash?(b.preventDefault(),a.forward(location.href.replace("#","")),!1):void a.back()}),$(document).on("click",this.link_selector,function(b){b.preventDefault();var c=$(this).data("id"),d=$(this).data("target"),e=$(this).data("title"),f=this.pathname.replace(c,d);return a.remember(f,e),a.forward(this.pathname),window.history.pushState({path:f},$(this).data("title"),f),!1}),$(document).on("click",this.back_link_selector,function(b){return location.hash?(b.preventDefault(),a.back(),window.history.pushState({path:location.pathname},"Index",location.pathname),!1):void 0})}};$.fn.simpleslider=function(a){var b=$.extend({},$.fn.simpleslider.defaults,a),c=new SimpleSlider($(this),b);return c.init()},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.string=function(){return this.replace(".","")},Number.prototype.px=function(){return this+"px"},Array.prototype.last=function(){return this[this.length-1]};
|
data/lib/simpleslider/version.rb
CHANGED