prime-rails 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTQxNDZkNDgyODJkYzQ2ZDJmOWRkOTk1NzI5N2FjZjkzOTE1MjFjMw==
4
+ ZGQ5YTY2MjVjZDk0MzkzMDkwZjY3MTk2NThlYTBhNzZmZTczMThlMw==
5
5
  data.tar.gz: !binary |-
6
- NzZiN2RkYjhiNjMwNzJiNzZjOWUzMmU2NDM5M2M4YTZmZGIzMjdmMw==
6
+ NGZhOTdiYmIwNzIxNmY4YTkxYjY4YTFiY2Y1ODZjOGRmZjQ5ZWNhMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjUzODNhZDM3ZjQ1NzdmNDZhYWJhNGZjZDBhNGIxNWVmNTkzMGJmMGY4ODQz
10
- M2I0OTQxZDA1ZmIwNTNlZTJiYzRkM2UyZWEwMmE0NjRhMTI2Y2ZjNTI4OTZh
11
- NjYwZTM5NmIwNmUzZGExNzI1YmFhN2NjMWEyM2I4NjUzYWNmZjU=
9
+ ODY1YzJhY2UxMzg0NjY0OGEyZjVhMGVjZTg2NmEzMDQ1NTkwM2Y5MTljOWQ5
10
+ OTdhYzY0ZjU4YmM3ZjQ2YmE1NGQ5ZTBmMGU2OWQ0YTE4NWE2MDJiYThjNWE3
11
+ ZDY5MjM0Y2QyYzI5ZGNjZWFiNWVkMDQ1MDA3ZmNlN2I3N2Y5OTk=
12
12
  data.tar.gz: !binary |-
13
- NTEzMTAyYTZlN2I0MWYwMmYwNDc0ZDRlODlkNTk3ODhmYjkzYjkxY2RmODM3
14
- M2MyZjU3MDNhNzg5MTMzNzNjNmVkMzNkY2VkZGU2NzM2OGNjZWEwY2RlYWU5
15
- NDZmNDg0MjYwY2QzYTI2ZTVhYWJlYWM2YjIyZGYwMzY5ZGI2ZDk=
13
+ NmFkZTRjMzQ0ZjRkMjliZDM2YWFjNzE4Yzc1MzQyZjE0YjE2OTdmZTI0MjM4
14
+ NmU4ZGJlMWRiYzg5MTgzNmE2NzgxOTg5MWViYTJhMDk4ZDFmNWY3MjA4ODc3
15
+ MjUzZTFlYTkyZTk0NWYyMmQ0ZTgzYzg0Mzk0MzE1MTVlNzM1YWY=
@@ -371,5 +371,38 @@ PrimeFaces.widget.Autocomplete = PrimeFaces.widget.BaseWidget.extend({
371
371
  }
372
372
 
373
373
  this.jq.puiautocomplete(cfg);
374
+ }
375
+ });
376
+
377
+ /**
378
+ * PrimeFaces SplitButton Widget
379
+ */
380
+ PrimeFaces.widget.SplitButton = PrimeFaces.widget.BaseWidget.extend({
381
+ init: function(cfg) {
382
+ this._super(cfg);
383
+ this.jq.puisplitbutton(cfg);
384
+ }
385
+ });
386
+
387
+
388
+ /**
389
+ * PrimeFaces Paginator Widget
390
+ */
391
+ PrimeFaces.widget.Paginator = PrimeFaces.widget.BaseWidget.extend({
392
+ init: function(cfg) {
393
+ this._super(cfg);
394
+ this.inputPage = $(this.jqId + '_page');
395
+ this.form = this.jq.parents('form:first');
396
+ _self = this;
397
+
398
+ cfg.paginate = function(event,state){
399
+ _self.inputPage.val(state.page +1);
400
+ _self.form.submit();
401
+ };
402
+
403
+ this.jq.puipaginator(cfg);
404
+
405
+
406
+
374
407
  }
375
408
  });
@@ -0,0 +1,42 @@
1
+ module PaginatorHelper
2
+
3
+ def p_paginator(id,options={})
4
+ decoded_options = paginator_decode(id,options)
5
+ output = paginator_encode_markup(id,decoded_options)
6
+ output += paginator_encode_script(id,decoded_options)
7
+ end
8
+
9
+ protected
10
+
11
+ def paginator_decode(id,options={})
12
+ clientid = sanitize_to_id(id)
13
+ param_page = params[clientid+'_page'].nil? ? 0 : (params[clientid+'_page'].to_i) -1
14
+ options = options.merge(:page => param_page)
15
+ options
16
+ end
17
+
18
+ def paginator_encode_markup(id,options={})
19
+ clientid = sanitize_to_id(id)
20
+ options = options.stringify_keys
21
+ options = options.merge(:id => clientid)
22
+ output = content_tag('div',options) do
23
+ text_field_tag(clientid+'_page',nil,type: 'hidden')
24
+ end
25
+ output.html_safe
26
+ end
27
+
28
+ def paginator_encode_script(id,options={})
29
+ options = options.stringify_keys
30
+ clientid = sanitize_to_id(id)
31
+ widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
32
+ options_ui = options
33
+ options_ui = options_ui.merge(:id => clientid)
34
+ options_ui = options_ui.to_json
35
+
36
+ script = '$(function() {'
37
+ script += "PrimeFaces.cw('Paginator','#{widgetvar}',#{options_ui})"
38
+ script += '});'
39
+ p_javascript_tag(script, "id" => clientid+"_s")
40
+ end
41
+
42
+ end
@@ -0,0 +1,37 @@
1
+ module SplitbuttonHelper
2
+
3
+ def p_splitbutton(value,options={},&block)
4
+ output = splitbutton_encode_markup(value,options)
5
+ output += splitbutton_encode_script(options,&block)
6
+ end
7
+
8
+ def p_splitbutton_item(value,options={})
9
+ options = options.stringify_keys
10
+ output = {:text => value}
11
+ output = output.merge(options)
12
+ output = output.to_json
13
+ end
14
+
15
+ protected
16
+
17
+ def splitbutton_encode_markup(value,options={})
18
+ options = options.stringify_keys
19
+ output = button_tag(value, options)
20
+ output.html_safe
21
+ end
22
+
23
+ def splitbutton_encode_script(options={},&block)
24
+ options = options.stringify_keys
25
+ clientid = sanitize_to_id(options['id'])
26
+ widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
27
+ options_ui = options
28
+ options_ui = options_ui.merge(:items => capture(&block))
29
+ options_ui = options_ui.to_json
30
+
31
+ script = '$(function() {'
32
+ script += "PrimeFaces.cw('SplitButton','#{widgetvar}',#{options_ui})"
33
+ script += '});'
34
+ p_javascript_tag(script, "id" => clientid+"_s")
35
+ end
36
+
37
+ end
@@ -1,5 +1,5 @@
1
1
  module Prime
2
2
  module Rails
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prime-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lazaro Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-21 00:00:00.000000000 Z
11
+ date: 2013-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails
@@ -663,11 +663,13 @@ files:
663
663
  - app/helpers/menu_helper.rb
664
664
  - app/helpers/menubar_helper.rb
665
665
  - app/helpers/notify_helper.rb
666
+ - app/helpers/paginator_helper.rb
666
667
  - app/helpers/panel_helper.rb
667
668
  - app/helpers/picklist_helper.rb
668
669
  - app/helpers/progressbar_helper.rb
669
670
  - app/helpers/radiobutton_helper.rb
670
671
  - app/helpers/slide_menu_helper.rb
672
+ - app/helpers/splitbutton_helper.rb
671
673
  - app/helpers/tabview_helper.rb
672
674
  - app/helpers/tiered_menu_helper.rb
673
675
  - app/helpers/tooltip_helper.rb