simpleslider 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a689826c6d7c89a788bd9c6c8b5e1799b940dd6
4
- data.tar.gz: ff1b18f6f8a8d88bda0eafed983066452e2115a5
3
+ metadata.gz: e9c9adfae2c0ca29523a2b381e10c89c3695086e
4
+ data.tar.gz: 56bc6d0e5349f628624e5e2dc30dfec57dbd670e
5
5
  SHA512:
6
- metadata.gz: 43770ed36c8e7cdf1be92ec0c9e582df51b5245bfe4be5dfd4f561722d14dd2c972b66078498cda14f8e89b524e8641fc802ee5d479ac2f5ae67d8ba879a44b8
7
- data.tar.gz: 583b9e314aa0e427885d82d91da33b7bdec541a8282062bf6c25849972aefd111d063a1f8884f1bd696e37bf617f253401764bf8bd8e354d646f3e5b12b419fa
6
+ metadata.gz: 75f23694b2d85f56984a27a6db51da3ad844273a9d88f746d22ce1c2acbf058989a5706748b5075b3bbf9a1cb6bf87c018d7524558c32e9d1dca8f721623cb3f
7
+ data.tar.gz: eabe08766d56cf917957c7276dcc49ad6e735f253c784684c47a37468581e7392b95543e8018f3ff94d07a6cb6ac22c0ec691dae355d5e2c56e4602a6f21fd88
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  simpleslider
2
2
  ============
3
3
 
4
- Rubygem for jquery.simpleslider (https://github.com/vlewin/jquery.simpleslider)
4
+ Rubygem for [jquery.simpleslider] (https://github.com/vlewin/jquery.simpleslider) (only packaged assets)
5
+
6
+ For further information see [simpleslider-demo] (https://github.com/vlewin/simpleslider-demo)
@@ -1,12 +1,11 @@
1
- /*! Simpleslider - v0.1.0 - 2014-03-03
1
+ /*! Simpleslider - v0.1.0 - 2014-03-06
2
2
  * https://github.com/vlewin/jquery.simpleslider
3
3
  * Copyright (c) 2014 Vladislav Lewinn; Licensed MIT */
4
- /*! Simpleslider - v0.1.0 - 2014-02-28
4
+ /*! Simpleslider - v1.0.1 - 2014-02-28
5
5
  * https://github.com/vlewin/jquery.simpleslider
6
6
  * Copyright (c) 2014 Vladislav Lewinn; Licensed MIT */
7
7
 
8
8
  /*global $:false */
9
-
10
9
  var SimpleSlider = function(element, opts) {
11
10
  this.init = function() {
12
11
  this.id = element.selector;
@@ -29,7 +28,12 @@ var SimpleSlider = function(element, opts) {
29
28
  //=== Chainable methods
30
29
  this.showBreadCrumb = function() {
31
30
  if(this.breadcrumb) {
32
- var parentName = location.pathname.replace(/\//g, '').capitalize();
31
+ var parentName = $(this.id).find('section').data('crumb');
32
+
33
+ if(!parentName) {
34
+ parentName = location.pathname.replace(/\//g, '').capitalize();
35
+ }
36
+
33
37
  var childName = this.activeLink().data('title');
34
38
  var back_arrow = '<i class="fa fa-lg fa-arrow-circle-left"></i> ';
35
39
  var parent = '<li><a class="' + this.back_link_selector.replace('.', '') +'">' + back_arrow + parentName + '</a>';
@@ -47,7 +51,7 @@ var SimpleSlider = function(element, opts) {
47
51
  };
48
52
 
49
53
  this.html = function(data) {
50
- $(this.id).find('ul li:last-of-type').html(data);
54
+ $(this.id).find('section article:last-of-type').html(data);
51
55
  return this;
52
56
  };
53
57
 
@@ -57,19 +61,17 @@ var SimpleSlider = function(element, opts) {
57
61
  };
58
62
 
59
63
  this.slide = function(direction) {
60
- var first_slide = $(this.id).find('ul li:first-of-type');
61
-
62
- // if (typeof(animation) === 'undefined') {
63
- // first_slide.addClass('animated');
64
- // } else {
65
- // first_slide.removeClass('animated');
66
- // }
64
+ var $first_slide = $(this.id).find('section article:first-of-type');
65
+ var $last_slide = $(this.id).find('section article:last-of-type');
67
66
 
68
67
  if (direction === 'right') {
69
- first_slide.css('margin-left', '-100%');
68
+ $first_slide.css('margin-left', '-100%').css('visibility', 'hidden');
69
+ $last_slide.css('visibility', 'visible');
70
70
  } else {
71
- first_slide.css('margin-left', '0%');
71
+ $first_slide.css('margin-left', '0%').css('visibility', 'visible');
72
+ $last_slide.css('visibility', 'hidden');
72
73
  }
74
+
73
75
  return this;
74
76
  };
75
77
 
@@ -79,13 +81,12 @@ var SimpleSlider = function(element, opts) {
79
81
  plugin.showBreadCrumb().slide('right').html(data);
80
82
  });
81
83
 
82
- $(this.id).find('ul li:last-of-type').addClass('active');
83
-
84
84
  return this;
85
85
  };
86
86
 
87
87
  this.back = function() {
88
- $(this.id).find('ul li:last-of-type').removeClass('active');
88
+ $(this.id).find('section article:first-of-type').css('visibility', 'visible');
89
+ $(this.id).find('section article:last-of-type').css('visibility', 'hidden');
89
90
  this.hideBreadCrumb().slide('left');
90
91
  };
91
92
 
@@ -94,8 +95,6 @@ var SimpleSlider = function(element, opts) {
94
95
  var plugin = this;
95
96
 
96
97
  $(window).on('load', function(e) {
97
- // console.info('Window.onload');
98
-
99
98
  if (location.hash) {
100
99
  e.preventDefault();
101
100
 
@@ -113,8 +112,6 @@ var SimpleSlider = function(element, opts) {
113
112
  });
114
113
 
115
114
  $(window).on('popstate', function(e) {
116
- // console.info('window.popstate');
117
-
118
115
  if (location.hash) {
119
116
  e.preventDefault();
120
117
 
@@ -167,8 +164,8 @@ var SimpleSlider = function(element, opts) {
167
164
 
168
165
  $.fn.simpleslider = function(options) {
169
166
  var opts = $.extend({}, $.fn.simpleslider.defaults, options);
170
- var slider_instance = new SimpleSlider($(this), opts);
171
- return slider_instance.init();
167
+ var div_instance = new SimpleSlider($(this), opts);
168
+ return div_instance.init();
172
169
  };
173
170
 
174
171
 
@@ -1,4 +1,4 @@
1
- /*! Simpleslider - v0.1.0 - 2014-03-03
1
+ /*! Simpleslider - v0.1.0 - 2014-03-06
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=location.pathname.replace(/\//g,"").capitalize(),b=this.activeLink().data("title"),c='<i class="fa fa-lg fa-arrow-circle-left"></i> ',d='<li><a class="'+this.back_link_selector.replace(".","")+'">'+c+a+"</a>",e="<li><a>"+b+"</a></li>";$(this.breadcrumb_selector).html(d).append(e).show()}return this},this.hideBreadCrumb=function(){return this.breadcrumb&&$(this.breadcrumb_selector).html(""),this},this.html=function(a){return $(this.id).find("ul li: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("ul li:first-of-type");return"right"===a?b.css("margin-left","-100%"):b.css("margin-left","0%"),this},this.forward=function(a){var b=this;return $.get(a,function(a){b.showBreadCrumb().slide("right").html(a)}),$(this.id).find("ul li:last-of-type").addClass("active"),this},this.back=function(){$(this.id).find("ul li:last-of-type").removeClass("active"),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.pathname.replace(c,d);return a.forward(this.pathname),window.history.pushState({path:e},$(this).data("title"),e),!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]};
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=this.activeLink().data("title"),c='<i class="fa fa-lg fa-arrow-circle-left"></i> ',d='<li><a class="'+this.back_link_selector.replace(".","")+'">'+c+a+"</a>",e="<li><a>"+b+"</a></li>";$(this.breadcrumb_selector).html(d).append(e).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.forward=function(a){var b=this;return $.get(a,function(a){b.showBreadCrumb().slide("right").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.pathname.replace(c,d);return a.forward(this.pathname),window.history.pushState({path:e},$(this).data("title"),e),!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]};
@@ -10,7 +10,7 @@
10
10
  width: 100%;
11
11
  }
12
12
 
13
- #simpleslider > ul {
13
+ #simpleslider > section {
14
14
  position: relative;
15
15
  z-index: 1;
16
16
  font-size: 0;
@@ -25,7 +25,7 @@
25
25
  box-sizing: border-box;
26
26
  }
27
27
 
28
- #simpleslider > ul > li {
28
+ #simpleslider > section > article {
29
29
  position: relative;
30
30
  display: inline-block;
31
31
  width: 100%;
@@ -44,23 +44,16 @@
44
44
  -webkit-box-sizing: border-box;
45
45
  box-sizing: border-box;
46
46
 
47
- -moz-transition: all 0.3s ease;
48
- -o-transition: all 0.3s ease;
49
- -webkit-transition: all 0.3s ease;
50
- transition: all 0.3s ease;
47
+ -moz-transition: all 0.2s ease;
48
+ -o-transition: all 0.2s ease;
49
+ -webkit-transition: all 0.2s ease;
50
+ transition: all 0.2s ease;
51
51
 
52
52
  vertical-align: top;
53
53
  white-space: normal;
54
54
  }
55
55
 
56
- /*#simpleslider > ul > li.animated {
57
- -moz-transition: all 0.3s ease;
58
- -o-transition: all 0.3s ease;
59
- -webkit-transition: all 0.3s ease;
60
- transition: all 0.3s ease;
61
- }*/
62
-
63
- #breadcrumb {
56
+ ul#breadcrumb {
64
57
  margin-bottom: 10px;
65
58
  padding: 5px 0;
66
59
  display: none;
@@ -1,3 +1,3 @@
1
1
  module SimpleSlider
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/simpleslider.gemspec CHANGED
@@ -12,29 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.description = %q{Rubygem for jquery.simpleslider (https://github.com/vlewin/jquery.simpleslider)}
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
- # s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
15
  s.require_paths = ["lib"]
17
-
18
16
  s.licenses = ["MIT"]
19
-
20
17
  s.add_dependency "jquery-rails"
21
- # specify any dependencies here; for example:
22
- # s.add_development_dependency "rspec"
23
- # s.add_runtime_dependency "railties"
24
18
  end
25
-
26
- # Gem::Specification.new do |s|
27
- # s.name = 'svarog-client'
28
- # s.version = '1.0.0'
29
- # s.date = Time.now.strftime('%F')
30
- # s.summary = "Svarog Client"
31
- # s.description = "This gem provides a very simple command line tool to send notifications to the Svarog server"
32
- # s.authors = ["Vladislav Lewin"]
33
- # s.email = 'vlewin[at]suse.de'
34
- # s.files = Dir.glob("lib/**/*")
35
- # s.executables << 'svarog-client'
36
- # s.homepage = 'https://github.com/vlewin/svarog-client'
37
-
38
- # s.add_runtime_dependency 'rest-client'
39
- # s.add_runtime_dependency 'choice'
40
- # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpleslider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Lewin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails