prime-rails 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.
- checksums.yaml +8 -8
- data/app/assets/javascripts/primefaces-rails.js +70 -1
- data/app/helpers/autocomplete_helper.rb +33 -0
- data/app/helpers/notify_helper.rb +34 -0
- data/app/helpers/picklist_helper.rb +34 -0
- data/lib/prime/rails/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZTQxNDZkNDgyODJkYzQ2ZDJmOWRkOTk1NzI5N2FjZjkzOTE1MjFjMw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NzZiN2RkYjhiNjMwNzJiNzZjOWUzMmU2NDM5M2M4YTZmZGIzMjdmMw==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MjUzODNhZDM3ZjQ1NzdmNDZhYWJhNGZjZDBhNGIxNWVmNTkzMGJmMGY4ODQz
|
|
10
|
+
M2I0OTQxZDA1ZmIwNTNlZTJiYzRkM2UyZWEwMmE0NjRhMTI2Y2ZjNTI4OTZh
|
|
11
|
+
NjYwZTM5NmIwNmUzZGExNzI1YmFhN2NjMWEyM2I4NjUzYWNmZjU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NTEzMTAyYTZlN2I0MWYwMmYwNDc0ZDRlODlkNTk3ODhmYjkzYjkxY2RmODM3
|
|
14
|
+
M2MyZjU3MDNhNzg5MTMzNzNjNmVkMzNkY2VkZGU2NzM2OGNjZWEwY2RlYWU5
|
|
15
|
+
NDZmNDg0MjYwY2QzYTI2ZTVhYWJlYWM2YjIyZGYwMzY5ZGI2ZDk=
|
|
@@ -63,7 +63,16 @@ PrimeFaces.widget.Dialog = PrimeFaces.widget.BaseWidget.extend({
|
|
|
63
63
|
init: function(cfg) {
|
|
64
64
|
this._super(cfg);
|
|
65
65
|
this.jq.puidialog(cfg);
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
show: function() {
|
|
69
|
+
this.jq.puidialog('show');
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
hide: function() {
|
|
73
|
+
this.jq.puidialog('hide');
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
});
|
|
68
77
|
|
|
69
78
|
/**
|
|
@@ -303,4 +312,64 @@ PrimeFaces.widget.Galleria = PrimeFaces.widget.BaseWidget.extend({
|
|
|
303
312
|
this._super(cfg);
|
|
304
313
|
this.jq.puigalleria(cfg);
|
|
305
314
|
}
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* PrimeFaces Notify Widget
|
|
319
|
+
*/
|
|
320
|
+
PrimeFaces.widget.Notify = PrimeFaces.widget.BaseWidget.extend({
|
|
321
|
+
init: function(cfg) {
|
|
322
|
+
this._super(cfg);
|
|
323
|
+
this.jq.puinotify(cfg);
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
show: function() {
|
|
327
|
+
this.jq.puinotify('show',this.jq.html());
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
hide: function() {
|
|
331
|
+
this.jq.puinotify('hide');
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* PrimeFaces Picklist Widget
|
|
337
|
+
*/
|
|
338
|
+
PrimeFaces.widget.Picklist = PrimeFaces.widget.BaseWidget.extend({
|
|
339
|
+
init: function(cfg) {
|
|
340
|
+
this._super(cfg);
|
|
341
|
+
this.jq.puipicklist(cfg);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* PrimeFaces Autocomplete Widget
|
|
347
|
+
*/
|
|
348
|
+
PrimeFaces.widget.Autocomplete = PrimeFaces.widget.BaseWidget.extend({
|
|
349
|
+
init: function(cfg) {
|
|
350
|
+
this._super(cfg);
|
|
351
|
+
|
|
352
|
+
if (cfg.content) {
|
|
353
|
+
contentFunc = cfg.content;
|
|
354
|
+
cfg.content = function(data) { return contentFunc.format({ 'option.label': data.label },{ 'option.value': data.value } );};
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (cfg.url) {
|
|
358
|
+
form = this.jq.parents('form:first');
|
|
359
|
+
cfg.completeSource = function(request, response) {
|
|
360
|
+
$.ajax({
|
|
361
|
+
type: "POST",
|
|
362
|
+
url: cfg.url,
|
|
363
|
+
data: form.serializeArray(),
|
|
364
|
+
dataType: "json",
|
|
365
|
+
context: this,
|
|
366
|
+
success: function(data) {
|
|
367
|
+
response.call(this, data);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
this.jq.puiautocomplete(cfg);
|
|
374
|
+
}
|
|
306
375
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module AutocompleteHelper
|
|
2
|
+
|
|
3
|
+
def p_autocomplete(name, value = nil, options = {})
|
|
4
|
+
output = autocomplete_encode_markup(name, value, options)
|
|
5
|
+
output += autocomplete_encode_script(name, value, options)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
protected
|
|
9
|
+
|
|
10
|
+
def autocomplete_encode_markup(name, value = nil, options = {})
|
|
11
|
+
options = options.stringify_keys
|
|
12
|
+
clientid = sanitize_to_id(name)
|
|
13
|
+
options.delete('completeSource')
|
|
14
|
+
options.delete('content')
|
|
15
|
+
output = tag :input, { "type" => "text", "name" => name, "id" => clientid, "value" => value }.update(options.stringify_keys)
|
|
16
|
+
output.html_safe
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def autocomplete_encode_script(name, value = nil, options = {})
|
|
20
|
+
options = options.stringify_keys
|
|
21
|
+
clientid = sanitize_to_id(name)
|
|
22
|
+
widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
|
|
23
|
+
options_ui = options
|
|
24
|
+
options_ui = options_ui.merge(:id => clientid)
|
|
25
|
+
options_ui = options_ui.to_json
|
|
26
|
+
|
|
27
|
+
script = '$(function() {'
|
|
28
|
+
script += "PrimeFaces.cw('Autocomplete','#{widgetvar}',#{options_ui})"
|
|
29
|
+
script += '});'
|
|
30
|
+
p_javascript_tag(script, "id" => clientid+"_s")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module NotifyHelper
|
|
2
|
+
|
|
3
|
+
def p_notify(id,options={},&block)
|
|
4
|
+
output = notify_encode_markup(id,options,&block)
|
|
5
|
+
output += notify_encode_script(id,options)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
protected
|
|
9
|
+
|
|
10
|
+
def notify_encode_markup(id,options={},&block)
|
|
11
|
+
clientid = sanitize_to_id(id)
|
|
12
|
+
options = options.stringify_keys
|
|
13
|
+
options = options.merge(:id => clientid)
|
|
14
|
+
output = content_tag('div', options) do
|
|
15
|
+
capture(&block)
|
|
16
|
+
end
|
|
17
|
+
output.html_safe
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def notify_encode_script(id,options={})
|
|
21
|
+
options = options.stringify_keys
|
|
22
|
+
clientid = sanitize_to_id(id)
|
|
23
|
+
widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
|
|
24
|
+
options_ui = options
|
|
25
|
+
options_ui = options_ui.merge(:id => clientid)
|
|
26
|
+
options_ui = options_ui.to_json
|
|
27
|
+
|
|
28
|
+
script = '$(function() {'
|
|
29
|
+
script += "PrimeFaces.cw('Notify','#{widgetvar}',#{options_ui})"
|
|
30
|
+
script += '});'
|
|
31
|
+
p_javascript_tag(script, "id" => clientid+"_s")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module PicklistHelper
|
|
2
|
+
|
|
3
|
+
def p_picklist(id,options={},&block)
|
|
4
|
+
output = picklist_encode_markup(id,options,&block)
|
|
5
|
+
output += picklist_encode_script(id,options)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
protected
|
|
9
|
+
|
|
10
|
+
def picklist_encode_markup(id,options={},&block)
|
|
11
|
+
clientid = sanitize_to_id(id)
|
|
12
|
+
options = options.stringify_keys
|
|
13
|
+
options = options.merge(:id => clientid)
|
|
14
|
+
output = content_tag('div', options) do
|
|
15
|
+
capture(&block)
|
|
16
|
+
end
|
|
17
|
+
output.html_safe
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def picklist_encode_script(id,options={})
|
|
21
|
+
options = options.stringify_keys
|
|
22
|
+
clientid = sanitize_to_id(id)
|
|
23
|
+
widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
|
|
24
|
+
options_ui = options
|
|
25
|
+
options_ui = options_ui.merge(:id => clientid)
|
|
26
|
+
options_ui = options_ui.to_json
|
|
27
|
+
|
|
28
|
+
script = '$(function() {'
|
|
29
|
+
script += "PrimeFaces.cw('Picklist','#{widgetvar}',#{options_ui})"
|
|
30
|
+
script += '});'
|
|
31
|
+
p_javascript_tag(script, "id" => clientid+"_s")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
data/lib/prime/rails/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.0.14
|
|
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-
|
|
11
|
+
date: 2013-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jquery-rails
|
|
@@ -652,6 +652,7 @@ files:
|
|
|
652
652
|
- app/assets/themes/vader/images/ui-icons_f29a00_256x240.png
|
|
653
653
|
- app/assets/themes/vader/theme.css
|
|
654
654
|
- app/helpers/accordion_helper.rb
|
|
655
|
+
- app/helpers/autocomplete_helper.rb
|
|
655
656
|
- app/helpers/breadcrumb_helper.rb
|
|
656
657
|
- app/helpers/context_menu_helper.rb
|
|
657
658
|
- app/helpers/dialog_helper.rb
|
|
@@ -661,7 +662,9 @@ files:
|
|
|
661
662
|
- app/helpers/lightbox_helper.rb
|
|
662
663
|
- app/helpers/menu_helper.rb
|
|
663
664
|
- app/helpers/menubar_helper.rb
|
|
665
|
+
- app/helpers/notify_helper.rb
|
|
664
666
|
- app/helpers/panel_helper.rb
|
|
667
|
+
- app/helpers/picklist_helper.rb
|
|
665
668
|
- app/helpers/progressbar_helper.rb
|
|
666
669
|
- app/helpers/radiobutton_helper.rb
|
|
667
670
|
- app/helpers/slide_menu_helper.rb
|
|
@@ -670,7 +673,8 @@ files:
|
|
|
670
673
|
- app/helpers/tooltip_helper.rb
|
|
671
674
|
- app/views/prime-rails/_breadcrumbs.html.erb
|
|
672
675
|
homepage: https://github.com/lazaronixon/prime-rails
|
|
673
|
-
licenses:
|
|
676
|
+
licenses:
|
|
677
|
+
- Apache V2
|
|
674
678
|
metadata: {}
|
|
675
679
|
post_install_message:
|
|
676
680
|
rdoc_options: []
|