prime-rails 0.0.8 → 0.0.9
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 +28 -0
- data/app/assets/themes/aristo/theme.css +3 -3
- data/app/helpers/menu_helper.rb +50 -0
- data/app/helpers/menubar_helper.rb +58 -0
- data/lib/prime/rails/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWIwNjMyY2Y2Y2UzMjYwNDlmNzM0ODVjNTk3MWM5ZDhjOTZkZGM0YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmIxMzlmYTY5MTBlZjVjZWFhODQyOTcyYWYxMjEyMWIxZDIzZTJiNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjg2ZjIwNzAwOGRkMGRjNjNhMmFhNTIxMTJkNWQ2MWFiNDZlZGI4ODVlNzQ0
|
10
|
+
ODc2YzJmZTEzMGJiMjk3NGVmOTYwMmRkOThjZmEwNWMyMzhlYjAzNGQ4M2M0
|
11
|
+
Y2U3ZDBjNTEyMTk1OTk3ZjZmMTU1ZTFhM2IyN2I5NjQ1MDI2N2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmNjZGRiYjVkNDIxZWJmZjI1NjdjMzEwNTZlNWU4Y2RjOWJiMTc2NDgyYzVi
|
14
|
+
NWMwOWNiMTFmMTI2NjE1OTFjNGY3Y2YzNjE0ODM1ZTgzMmI1MGViYjE5MzRh
|
15
|
+
NjM0ZmY0YzdiMzlmNjVjZTkwYzFkNzRhODZlZWI4YzI0MjYxNGQ=
|
@@ -197,4 +197,32 @@ PrimeFaces.widget.Growl = PrimeFaces.widget.BaseWidget.extend({
|
|
197
197
|
addMessage(cfg.messages);
|
198
198
|
}
|
199
199
|
}
|
200
|
+
});
|
201
|
+
|
202
|
+
/**
|
203
|
+
* PrimeFaces Menu Widget
|
204
|
+
*/
|
205
|
+
PrimeFaces.widget.Menu = PrimeFaces.widget.BaseWidget.extend({
|
206
|
+
init: function(cfg) {
|
207
|
+
this._super(cfg);
|
208
|
+
_self = this;
|
209
|
+
|
210
|
+
if (this.cfg.trigger) {
|
211
|
+
this.cfg.trigger = $(PrimeFaces.escapeClientId(this.cfg.trigger))
|
212
|
+
}
|
213
|
+
|
214
|
+
this.jq.puimenu(cfg);
|
215
|
+
}
|
216
|
+
});
|
217
|
+
|
218
|
+
/**
|
219
|
+
* PrimeFaces Menubar Widget
|
220
|
+
*/
|
221
|
+
PrimeFaces.widget.Menubar = PrimeFaces.widget.BaseWidget.extend({
|
222
|
+
init: function(cfg) {
|
223
|
+
this._super(cfg);
|
224
|
+
_self = this;
|
225
|
+
|
226
|
+
this.jq.puimenubar(cfg);
|
227
|
+
}
|
200
228
|
});
|
@@ -1236,15 +1236,15 @@ a {
|
|
1236
1236
|
background: #c4c4c4 -moz-linear-gradient(top, rgba(255,255,255,0.8), rgba(255,255,255,0));
|
1237
1237
|
}
|
1238
1238
|
|
1239
|
-
html .pui-menu .pui-menu-list {
|
1239
|
+
*html .pui-menu .pui-menu-list {
|
1240
1240
|
background: none;
|
1241
1241
|
}
|
1242
1242
|
|
1243
|
-
html .pui-menubar .pui-menu-child {
|
1243
|
+
*html .pui-menubar .pui-menu-child {
|
1244
1244
|
background: #ffffff;
|
1245
1245
|
}
|
1246
1246
|
|
1247
|
-
html .pui-menu .pui-menuitem-link {
|
1247
|
+
*html .pui-menu .pui-menuitem-link {
|
1248
1248
|
border-color: #c4c4c4;
|
1249
1249
|
filter: chroma(color=#c4c4c4);
|
1250
1250
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module MenuHelper
|
2
|
+
|
3
|
+
def p_menu(id,options={},&block)
|
4
|
+
output = menu_encode_markup(id,options,&block)
|
5
|
+
output += menu_encode_script(id,options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def p_submenu(label,&block)
|
9
|
+
output = content_tag('li') do
|
10
|
+
content_tag('h3', label);
|
11
|
+
end
|
12
|
+
output += capture(&block)
|
13
|
+
end
|
14
|
+
|
15
|
+
def p_menu_item(path,options={})
|
16
|
+
options = options.stringify_keys
|
17
|
+
value = options.delete('value')
|
18
|
+
options["data-icon"] = options['icon']
|
19
|
+
output = content_tag('li') do
|
20
|
+
link_to(value,path,options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
def menu_encode_markup(id,options={},&block)
|
27
|
+
clientid = sanitize_to_id(id)
|
28
|
+
options = options.stringify_keys
|
29
|
+
options = options.merge(:id => clientid)
|
30
|
+
output = content_tag('ul', options) do
|
31
|
+
capture(&block)
|
32
|
+
end
|
33
|
+
output.html_safe
|
34
|
+
end
|
35
|
+
|
36
|
+
def menu_encode_script(id,options={})
|
37
|
+
options = options.stringify_keys
|
38
|
+
clientid = sanitize_to_id(id)
|
39
|
+
widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
|
40
|
+
options_ui = options
|
41
|
+
options_ui = options_ui.merge(:id => clientid)
|
42
|
+
options_ui = options_ui.to_json
|
43
|
+
|
44
|
+
script = '$(function() {'
|
45
|
+
script += "PrimeFaces.cw('Menu','#{widgetvar}',#{options_ui})"
|
46
|
+
script += '});'
|
47
|
+
javascript_tag(script, "id" => clientid+"_s")
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module MenubarHelper
|
2
|
+
|
3
|
+
def p_menubar(id,options={},&block)
|
4
|
+
output = menubar_encode_markup(id,options,&block)
|
5
|
+
output += menubar_encode_script(id,options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def p_submenubar(options = {},&block)
|
9
|
+
options = options.stringify_keys
|
10
|
+
output = content_tag('li') do
|
11
|
+
data_icon = {}
|
12
|
+
data_icon["data-icon"] = options.delete('icon')
|
13
|
+
content = content_tag('a', options['label'],data_icon);
|
14
|
+
|
15
|
+
if block_given?
|
16
|
+
content += content_tag('ul') do
|
17
|
+
capture(&block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def p_menubar_item(path,options={})
|
24
|
+
options = options.stringify_keys
|
25
|
+
value = options.delete('value')
|
26
|
+
options["data-icon"] = options['icon']
|
27
|
+
output = content_tag('li') do
|
28
|
+
link_to(value,path,options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
|
34
|
+
def menubar_encode_markup(id,options={},&block)
|
35
|
+
clientid = sanitize_to_id(id)
|
36
|
+
options = options.stringify_keys
|
37
|
+
options = options.merge(:id => clientid)
|
38
|
+
output = content_tag('ul', options) do
|
39
|
+
capture(&block)
|
40
|
+
end
|
41
|
+
output.html_safe
|
42
|
+
end
|
43
|
+
|
44
|
+
def menubar_encode_script(id,options={})
|
45
|
+
options = options.stringify_keys
|
46
|
+
clientid = sanitize_to_id(id)
|
47
|
+
widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid
|
48
|
+
options_ui = options
|
49
|
+
options_ui = options_ui.merge(:id => clientid)
|
50
|
+
options_ui = options_ui.to_json
|
51
|
+
|
52
|
+
script = '$(function() {'
|
53
|
+
script += "PrimeFaces.cw('Menubar','#{widgetvar}',#{options_ui})"
|
54
|
+
script += '});'
|
55
|
+
javascript_tag(script, "id" => clientid+"_s")
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
data/lib/prime/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lazaro Nixon
|
@@ -654,6 +654,8 @@ files:
|
|
654
654
|
- app/helpers/dialog_helper.rb
|
655
655
|
- app/helpers/fieldset_helper.rb
|
656
656
|
- app/helpers/growl_helper.rb
|
657
|
+
- app/helpers/menu_helper.rb
|
658
|
+
- app/helpers/menubar_helper.rb
|
657
659
|
- app/helpers/panel_helper.rb
|
658
660
|
- app/helpers/progressbar_helper.rb
|
659
661
|
- app/helpers/radiobutton_helper.rb
|