jquery-bootstrap-pagination 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5fe90a359d24b67688cad8fc478e711e6d833e7e
4
+ data.tar.gz: 18df3798a64479c3a6dde1b4947f81cfc5181771
5
+ SHA512:
6
+ metadata.gz: abcadac0c5f4d0da8664e748cac09086d817c4b23ec6dae8f1d6632147b76d5406639074451a3aad0ad0ad1637d3b2955e53a6a13bf885b5d48ab57bbe5b7e24
7
+ data.tar.gz: 20cd02574649b743a7f77230c91f4b6091fd59edf050e529f11e2c3e13b86bbbb77d1d1c6116b20b619c637442f18fe3b89d4a68197d65fed23a0352b08bdbf0
@@ -6,79 +6,84 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.3.2)
10
- childprocess (0.3.6)
11
- ffi (~> 1.0, >= 1.0.6)
12
- coderay (1.0.8)
9
+ childprocess (0.3.9)
10
+ ffi (~> 1.0, >= 1.0.11)
11
+ coderay (1.0.9)
13
12
  coffee-script (2.2.0)
14
13
  coffee-script-source
15
14
  execjs
16
- coffee-script-source (1.4.0)
17
- diff-lcs (1.1.3)
15
+ coffee-script-source (1.6.2)
16
+ diff-lcs (1.2.4)
18
17
  execjs (1.4.0)
19
18
  multi_json (~> 1.0)
20
- ffi (1.2.0)
21
- guard (1.5.4)
22
- listen (>= 0.4.2)
19
+ ffi (1.9.0)
20
+ formatador (0.2.4)
21
+ guard (1.8.0)
22
+ formatador (>= 0.2.4)
23
+ listen (>= 1.0.0)
23
24
  lumberjack (>= 1.0.2)
24
25
  pry (>= 0.9.10)
25
26
  thor (>= 0.14.6)
26
- guard-coffeescript (1.2.1)
27
+ guard-coffeescript (1.3.2)
27
28
  coffee-script (>= 2.2.0)
28
29
  guard (>= 1.1.0)
29
30
  guard-jasmine-headless-webkit (0.3.2)
30
31
  guard (>= 0.4.0)
31
32
  jasmine-headless-webkit (>= 0.7.0)
32
- hike (1.2.1)
33
- jasmine (1.3.0)
34
- jasmine-core (>= 1.3.0)
33
+ hike (1.2.3)
34
+ jasmine (1.3.2)
35
+ jasmine-core (~> 1.3.1)
35
36
  rack (~> 1.0)
36
37
  rspec (>= 1.3.1)
37
38
  selenium-webdriver (>= 0.1.3)
38
- jasmine-core (1.3.0)
39
+ jasmine-core (1.3.1)
39
40
  jasmine-headless-webkit (0.8.4)
40
41
  coffee-script
41
42
  jasmine-core (~> 1.1)
42
43
  multi_json
43
44
  rainbow
44
45
  sprockets (~> 2)
45
- libwebsocket (0.1.7.1)
46
- addressable
47
- websocket
48
- listen (0.6.0)
49
- lumberjack (1.0.2)
46
+ listen (1.1.6)
47
+ rb-fsevent (>= 0.9.3)
48
+ rb-inotify (>= 0.9)
49
+ rb-kqueue (>= 0.2)
50
+ lumberjack (1.0.3)
50
51
  method_source (0.8.1)
51
- multi_json (1.4.0)
52
- pry (0.9.10)
52
+ multi_json (1.7.6)
53
+ pry (0.9.12.2)
53
54
  coderay (~> 1.0.5)
54
55
  method_source (~> 0.8)
55
- slop (~> 3.3.1)
56
- rack (1.4.1)
56
+ slop (~> 3.4)
57
+ rack (1.5.2)
57
58
  rainbow (1.1.4)
58
- rb-fsevent (0.9.2)
59
- rspec (2.12.0)
60
- rspec-core (~> 2.12.0)
61
- rspec-expectations (~> 2.12.0)
62
- rspec-mocks (~> 2.12.0)
63
- rspec-core (2.12.1)
64
- rspec-expectations (2.12.0)
65
- diff-lcs (~> 1.1.3)
66
- rspec-mocks (2.12.0)
59
+ rb-fsevent (0.9.3)
60
+ rb-inotify (0.9.0)
61
+ ffi (>= 0.5.0)
62
+ rb-kqueue (0.2.0)
63
+ ffi (>= 0.5.0)
64
+ rspec (2.13.0)
65
+ rspec-core (~> 2.13.0)
66
+ rspec-expectations (~> 2.13.0)
67
+ rspec-mocks (~> 2.13.0)
68
+ rspec-core (2.13.1)
69
+ rspec-expectations (2.13.0)
70
+ diff-lcs (>= 1.1.3, < 2.0)
71
+ rspec-mocks (2.13.1)
67
72
  rubyzip (0.9.9)
68
- selenium-webdriver (2.26.0)
73
+ selenium-webdriver (2.33.0)
69
74
  childprocess (>= 0.2.5)
70
- libwebsocket (~> 0.1.3)
71
75
  multi_json (~> 1.0)
72
76
  rubyzip
73
- slop (3.3.3)
74
- sprockets (2.8.1)
77
+ websocket (~> 1.0.4)
78
+ slop (3.4.5)
79
+ sprockets (2.10.0)
75
80
  hike (~> 1.2)
76
81
  multi_json (~> 1.0)
77
82
  rack (~> 1.0)
78
83
  tilt (~> 1.1, != 1.3.0)
79
- thor (0.16.0)
80
- tilt (1.3.3)
81
- websocket (1.0.4)
84
+ thor (0.18.1)
85
+ tilt (1.4.1)
86
+ websocket (1.0.7)
82
87
 
83
88
  PLATFORMS
84
89
  ruby
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Bootstrap
3
3
  module Pagination
4
- VERSION = "1.0.4"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -7,7 +7,7 @@
7
7
  $(".my-pagination").pagination({total_pages: 3, current_page: 1});
8
8
 
9
9
  $(".my-pagination").pagination({
10
- total_pages: 3,
10
+ total_pages: 3,
11
11
  current_page: 1,
12
12
  callback: function(event, page) {
13
13
  alert("Clicked: " + page);
@@ -47,7 +47,10 @@
47
47
  @settings = $.extend(defaults, options)
48
48
 
49
49
  # add a click handler event to the view:
50
- $("a", @el).live "click", @clicked
50
+ if $(document).on
51
+ $(@el).on("click", "a", @clicked)
52
+ else
53
+ $("a", @el).live("click", @clicked)
51
54
 
52
55
  # add this view to the original element
53
56
  # so it can be accessed later:
@@ -4,40 +4,36 @@
4
4
 
5
5
  (function($) {
6
6
  /*
7
- $(".my-pagination").pagination();
7
+ $(".my-pagination").pagination();
8
8
 
9
- $(".my-pagination").pagination({total_pages: 3, current_page: 1});
9
+ $(".my-pagination").pagination({total_pages: 3, current_page: 1});
10
10
 
11
- $(".my-pagination").pagination({
12
- total_pages: 3,
13
- current_page: 1,
14
- callback: function(event, page) {
15
- alert("Clicked: " + page);
16
- }
17
- });
11
+ $(".my-pagination").pagination({
12
+ total_pages: 3,
13
+ current_page: 1,
14
+ callback: function(event, page) {
15
+ alert("Clicked: " + page);
16
+ }
17
+ });
18
18
  */
19
19
 
20
20
  var PaginationView;
21
+
21
22
  $.fn.pagination = function(options) {
22
23
  return this.each(function() {
23
24
  return new PaginationView($(this), options).render();
24
25
  });
25
26
  };
26
27
  return PaginationView = (function() {
27
-
28
28
  function PaginationView(el, options) {
29
29
  var defaults;
30
+
30
31
  this.el = el;
31
32
  this.clicked = __bind(this.clicked, this);
32
-
33
33
  this.render = __bind(this.render, this);
34
-
35
34
  this.pages = __bind(this.pages, this);
36
-
37
35
  this.buildLi = __bind(this.buildLi, this);
38
-
39
36
  this.buildLinks = __bind(this.buildLinks, this);
40
-
41
37
  defaults = {
42
38
  current_page: 1,
43
39
  total_pages: 1,
@@ -49,12 +45,17 @@
49
45
  ignore_single_page: true
50
46
  };
51
47
  this.settings = $.extend(defaults, options);
52
- $("a", this.el).live("click", this.clicked);
48
+ if ($(document).on) {
49
+ $(this.el).on("click", "a", this.clicked);
50
+ } else {
51
+ $("a", this.el).live("click", this.clicked);
52
+ }
53
53
  this.el.data("paginationView", this);
54
54
  }
55
55
 
56
56
  PaginationView.prototype.buildLinks = function() {
57
57
  var current_page, links, page, _i, _len, _ref;
58
+
58
59
  current_page = this.settings.current_page;
59
60
  links = [];
60
61
  if (this.settings.first) {
@@ -86,6 +87,7 @@
86
87
 
87
88
  PaginationView.prototype.pages = function() {
88
89
  var buf, current_page, max, page, pages, total_pages, _i, _j, _k, _l, _m, _ref, _ref1, _ref2, _ref3;
90
+
89
91
  total_pages = this.settings.total_pages;
90
92
  current_page = this.settings.current_page;
91
93
  pages = [];
@@ -133,6 +135,7 @@
133
135
 
134
136
  PaginationView.prototype.render = function() {
135
137
  var html, link, _i, _len, _ref;
138
+
136
139
  this.el.html("");
137
140
  if (this.settings.total_pages === 1 && this.settings.ignore_single_page) {
138
141
  return;
@@ -161,6 +164,7 @@
161
164
 
162
165
  PaginationView.prototype.clicked = function(event) {
163
166
  var page;
167
+
164
168
  page = parseInt($(event.target).attr("data-page"));
165
169
  if (this.settings.callback != null) {
166
170
  this.settings.callback(event, page);
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-bootstrap-pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mark Bates
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-12 00:00:00.000000000 Z
11
+ date: 2013-06-10 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A simple and clean pagination implementation for jQuery and Twitter Bootstrap.
15
14
  email:
@@ -38,27 +37,26 @@ files:
38
37
  - vendor/assets/javascripts/jquery-bootstrap-pagination.js
39
38
  homepage: http://github.com/markbates/jquery-bootstrap-pagination
40
39
  licenses: []
40
+ metadata: {}
41
41
  post_install_message:
42
42
  rdoc_options: []
43
43
  require_paths:
44
44
  - lib
45
45
  required_ruby_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ! '>='
47
+ - - '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
- none: false
51
50
  required_rubygems_version: !ruby/object:Gem::Requirement
52
51
  requirements:
53
- - - ! '>='
52
+ - - '>='
54
53
  - !ruby/object:Gem::Version
55
54
  version: '0'
56
- none: false
57
55
  requirements: []
58
56
  rubyforge_project:
59
- rubygems_version: 1.8.24
57
+ rubygems_version: 2.0.3
60
58
  signing_key:
61
- specification_version: 3
59
+ specification_version: 4
62
60
  summary: A simple and clean pagination implementation for jQuery and Twitter Bootstrap.
63
61
  test_files:
64
62
  - spec/javascripts/jquery-bootstrap-pagination_spec.coffee