rich_table_component 0.0.13 → 0.0.14

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.
@@ -217,11 +217,11 @@ module ComponentHelper
217
217
  result += '<span class="last_page disabled">&gt;&gt;</span>'
218
218
  result += '<div class="per_page_part">'
219
219
  result += (select_tag 'per_page', (per_page_options.map{|m| "<option #{(m==params[:per_page].to_i ? 'selected=selected' : '')}>#{m}</option>"}.join.html_safe))
220
- result += '</div>'
220
+ result += 'Per hal. </div>'
221
221
  result += '<div class="go_to_page_part">'
222
222
  result += '<input type="text" value="1" name="page">'
223
223
  result += (link_to "Go", {controller: rtc_controller_name}, remote: true, class: "gotopage btn-mini")
224
- result += 'Pedr hal.</div>'
224
+ result += '</div>'
225
225
  result += '</div>'
226
226
  result.html_safe
227
227
  end
@@ -1,3 +1,3 @@
1
1
  module RichTableComponent
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
@@ -94,7 +94,7 @@ var ajaxifyTableGrid = function(){
94
94
  params.search = $elmt.find('input#search').val();
95
95
  }
96
96
  else{
97
- params = $.extend(params, getSerializeArray($elmt.find('form.rtc_advanced_search input').serializeArray()));
97
+ params = $.extend(params, getSerializeArray($elmt.find('form.rtc_advanced_search :input').serializeArray()));
98
98
  }
99
99
  params.pgos = true;
100
100
  settings.url += (settings.url.indexOf('?') >= 0 ? '&' : '?') + $.param(params);
@@ -119,7 +119,7 @@ var ajaxifyTableGrid = function(){
119
119
  params = getSerializeArray($elmt.find('input#search').serializeArray());
120
120
  }
121
121
  else{
122
- params = $.extend(params, getSerializeArray($elmt.find('form.rtc_advanced_search input').serializeArray()));
122
+ params = $.extend(params, getSerializeArray($elmt.find('form.rtc_advanced_search :input').serializeArray()));
123
123
  }
124
124
 
125
125
  $list_view = $elmt.find('.rtc_header .btn-group-view-toggle .btn.active').data('list-view');
@@ -253,7 +253,8 @@ var ajaxifyTableGrid = function(){
253
253
  message: t("searching"),
254
254
  image: LOADING_IMAGE
255
255
  });
256
-
256
+
257
+ params = {};
257
258
  params.page = 1;
258
259
  params.per_page = $.cookie('unm_pp');
259
260
  settings.url += (settings.url.indexOf('?') >= 0 ? '&' : '?') + $.param(params);
@@ -268,7 +269,13 @@ var ajaxifyTableGrid = function(){
268
269
  $('form.rtc_advanced_search .clear_advanced_search').live('click', function(){
269
270
  var $form = $(this).parents('form');
270
271
  $form.find('input').val('');
271
- $form.submit();
272
+
273
+ $form.find(':input')
274
+ .not(':button, :submit, :reset, :hidden')
275
+ .val('')
276
+ .removeAttr('checked')
277
+ .removeAttr('selected');
278
+
272
279
  });
273
280
 
274
281
  // HIDING ADVANCED SEARCH
@@ -320,8 +327,7 @@ var initCookies = function(){
320
327
 
321
328
  var clearAdvanceSearch = function(){
322
329
  $('form.rtc_advanced_search').find('input[type=text]').val('');
323
-
324
- $(':input', $('#advance_search form'))
330
+ $('form.rtc_advanced_search :input')
325
331
  .not(':button, :submit, :reset, :hidden')
326
332
  .val('')
327
333
  .removeAttr('checked')
@@ -0,0 +1,94 @@
1
+ /*!
2
+ * jQuery Cookie Plugin v1.3.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as anonymous module.
11
+ define(['jquery'], factory);
12
+ } else {
13
+ // Browser globals.
14
+ factory(jQuery);
15
+ }
16
+ }(function ($) {
17
+
18
+ var pluses = /\+/g;
19
+
20
+ function raw(s) {
21
+ return s;
22
+ }
23
+
24
+ function decoded(s) {
25
+ return decodeURIComponent(s.replace(pluses, ' '));
26
+ }
27
+
28
+ function converted(s) {
29
+ if (s.indexOf('"') === 0) {
30
+ // This is a quoted cookie as according to RFC2068, unescape
31
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
32
+ }
33
+ try {
34
+ return config.json ? JSON.parse(s) : s;
35
+ } catch(er) {}
36
+ }
37
+
38
+ var config = $.cookie = function (key, value, options) {
39
+
40
+ // write
41
+ if (value !== undefined) {
42
+ options = $.extend({}, config.defaults, options);
43
+
44
+ if (typeof options.expires === 'number') {
45
+ var days = options.expires, t = options.expires = new Date();
46
+ t.setDate(t.getDate() + days);
47
+ }
48
+
49
+ value = config.json ? JSON.stringify(value) : String(value);
50
+
51
+ return (document.cookie = [
52
+ config.raw ? key : encodeURIComponent(key),
53
+ '=',
54
+ config.raw ? value : encodeURIComponent(value),
55
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
56
+ options.path ? '; path=' + options.path : '',
57
+ options.domain ? '; domain=' + options.domain : '',
58
+ options.secure ? '; secure' : ''
59
+ ].join(''));
60
+ }
61
+
62
+ // read
63
+ var decode = config.raw ? raw : decoded;
64
+ var cookies = document.cookie.split('; ');
65
+ var result = key ? undefined : {};
66
+ for (var i = 0, l = cookies.length; i < l; i++) {
67
+ var parts = cookies[i].split('=');
68
+ var name = decode(parts.shift());
69
+ var cookie = decode(parts.join('='));
70
+
71
+ if (key && key === name) {
72
+ result = converted(cookie);
73
+ break;
74
+ }
75
+
76
+ if (!key) {
77
+ result[name] = converted(cookie);
78
+ }
79
+ }
80
+
81
+ return result;
82
+ };
83
+
84
+ config.defaults = {};
85
+
86
+ $.removeCookie = function (key, options) {
87
+ if ($.cookie(key) !== undefined) {
88
+ $.cookie(key, '', $.extend(options, { expires: -1 }));
89
+ return true;
90
+ }
91
+ return false;
92
+ };
93
+
94
+ }));
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rich_table_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -406,6 +406,7 @@ files:
406
406
  - vendor/assets/javascripts/admin/starqle.ui.jquery.js
407
407
  - vendor/assets/javascripts/ckeditor/config.js
408
408
  - vendor/assets/javascripts/jquery-ui-1.8.13.custom.min.js
409
+ - vendor/assets/javascripts/jquery.cookie.js
409
410
  - vendor/assets/javascripts/jquery.fileupload-ui.js
410
411
  - vendor/assets/javascripts/jquery.fileupload.js
411
412
  - vendor/assets/javascripts/jquery.tmpl.min.js