hobo_jquery_ui 1.4.0.pre4 → 1.4.0.pre5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0.pre4
1
+ 1.4.0.pre5
@@ -2,7 +2,7 @@ module HoboJqueryUi
2
2
  @@root = Pathname.new File.expand_path('../..', __FILE__)
3
3
  def self.root; @@root; end
4
4
 
5
- EDIT_LINK_BASE = "https://github.com/tablatom/hobo_tree_table/edit/master/hobo_jquery_ui"
5
+ EDIT_LINK_BASE = "https://github.com/tablatom/hobo/edit/master/hobo_jquery_ui"
6
6
 
7
7
  require 'hobo_jquery_ui/railtie' if defined?(Rails)
8
8
 
@@ -0,0 +1,38 @@
1
+ <%#
2
+
3
+ Given a list of pairs, renders a [jQuery-UI accordion](jqueryui.com/demos/accordion).
4
+
5
+ ### Example
6
+
7
+ <accordion-list with="&[['header 1', 'body 1'], ['header 2', 'body 2']]"/>
8
+
9
+ ### Attributes
10
+
11
+ All attributes supported by jQuery-UI accordion are passed through.
12
+
13
+ - sortable: if true, drag and drop sorting is allowed, although changes are not persistent
14
+
15
+ %>
16
+ <def tag="accordion-list" attrs="sortable">
17
+ <% options, attrs = attributes.partition_hash(['disabled', 'active', 'animated', 'autoHeight', 'clearStyle', 'collapsible', 'event', 'fillSpace', 'header', 'icons', 'navigation'])
18
+ events, html_attrs = attrs.partition_hash(['navigationFilter', 'create', 'change', 'changestart'])
19
+ add_classes!(html_attrs, "accordion-list")
20
+ add_data_rapid!(html_attrs, "accordion", :options => options, :events => events, :sortable => sortable)
21
+ %>
22
+ <div merge-attrs="&html_attrs">
23
+ <repeat>
24
+ <div class="hjq-accordion-element">
25
+ <do:first>
26
+ <h3 param="header-wrapper">
27
+ <a param="header" href="#"><view/></a>
28
+ </h3>
29
+ </do:first>
30
+ <do:last>
31
+ <div param="default">
32
+ <view param/>
33
+ </div>
34
+ </do:last>
35
+ </div>
36
+ </repeat>
37
+ </div>
38
+ </def>
@@ -15,13 +15,14 @@ There is one difference: accordion does not support the `href` option.
15
15
  add_data_rapid!(html_attrs, "accordion", :options => options, :events => events, :sortable => sortable)
16
16
  %>
17
17
  <div merge-attrs="&html_attrs">
18
- <repeat with="&parameters">
18
+ <% parameters.map do |param_name, param|
19
+ yield_output_buffer { %>
19
20
  <div class="hjq-accordion-element">
20
- <% attrs, params = this.call %>
21
- <% merge_attrs = attrs - [:name] %>
22
- <h3><a href="#"><%= attrs[:name] || this_key.to_s.titleize %></a></h3>
21
+ <% attrs, params = param.call -%>
22
+ <% merge_attrs = attrs - [:name] -%>
23
+ <h3><a href="#"><%= attrs[:name] || param_name.to_s.titleize %></a></h3>
23
24
  <div merge-attrs="&merge_attrs"><%= params[:default]._?.call %></div>
24
25
  </div>
25
- </repeat>
26
+ <% } end.join("").html_safe -%>
26
27
  </div>
27
28
  </def>
@@ -34,6 +34,15 @@ Remember that the default parameter is a list, even if you set per-section="1".
34
34
 
35
35
  This tag uses Enumerable#chunk, which is only available with Ruby 1.9.2 and later. If you are using Ruby 1.8.7, you must include the `backports` gem in your project.
36
36
 
37
+ ### Attributes:
38
+
39
+ - `per-section`, `chunker`: (see above). Only one of these should
40
+ be used. Using neither results is the same as saying
41
+ per-section="20"
42
+
43
+ - `sortable`: if set, the accordion is sortable, although the sort
44
+ order is not saved.
45
+
37
46
  -->
38
47
  <def tag="accordion-collection" attrs="per-section,chunker,sortable">
39
48
  <% options, attrs = attributes.partition_hash(['disabled', 'active', 'animated', 'autoHeight', 'clearStyle', 'collapsible', 'event', 'fillSpace', 'header', 'icons', 'navigation'])
data/taglibs/tabs.dryml CHANGED
@@ -46,16 +46,18 @@ Usage of Ruby 1.8 will result in an undefined tab order. Ruby 1.9 is recommend
46
46
  %>
47
47
  <div merge-attrs="&html_attrs">
48
48
  <ul>
49
- <repeat with="&parameters">
50
- <% attrs, params = this.call %>
51
- <li><a href="#{attrs[:href] || '#'+(attrs[:id] || this_key.to_s)}"><%= attrs[:name] || this_key.to_s.titleize %></a></li>
52
- </repeat>
49
+ <% parameters.map do |param_name, param|
50
+ yield_output_buffer { %>
51
+ <% attrs, params = param.call -%>
52
+ <li><a href="#{attrs[:href] || '#'+(attrs[:id] || param_name.to_s)}"><%= attrs[:name] || param_name.to_s.titleize %></a></li>
53
+ <% } end.join("").html_safe %>
53
54
  </ul>
54
55
 
55
- <repeat with="&parameters">
56
- <% attrs, params = this.call %>
57
- <% merge_attrs = attrs - [:id, :href, :name] %>
58
- <div id="#{attrs[:id] || this_key}" merge-attrs="&merge_attrs"><%= params[:default]._?.call %></div>
59
- </repeat>
56
+ <% parameters.map do |param_name, param|
57
+ yield_output_buffer { %>
58
+ <% attrs, params = param.call -%>
59
+ <% merge_attrs = attrs - [:id, :href, :name] -%>
60
+ <div id="#{attrs[:id] || param_name}" merge-attrs="&merge_attrs"><%= params[:default]._?.call %></div>
61
+ <% } end.join("").html_safe %>
60
62
  </div>
61
63
  </def>
@@ -0,0 +1,27 @@
1
+ <%#
2
+
3
+ This is a simple click-to-expand type widget with the same styling as
4
+ the jquery-ui accordion.
5
+
6
+ ### Example
7
+
8
+ <toggle open>
9
+ <heading:>Click me</heading:>
10
+ <content:>inner content</content:>
11
+ <toggle>
12
+
13
+ ### Attributes
14
+
15
+ `open`: if supplied, the content is initially displayed. Otherwise
16
+ it is initially hidden
17
+
18
+ %>
19
+ <def tag="toggle" attrs="open">
20
+ <div class="toggle ui-accordion ui-widget ui-helper-reset ui-accordion-icons" data-rapid="&data_rapid('toggle')" param="outer">
21
+ <h3 class="ui-accordion-header ui-state-default ui-helper-reset #{open ? 'ui-state-active ui-corner-top' : 'ui-corner-all'}" param>
22
+ <span class="ui-icon #{open ? 'ui-icon-triangle-1-s' : 'ui-icon-triangle-1-e'}" param></span>
23
+ <a href="#" param="heading"/>
24
+ </h3>
25
+ <div class="ui-accordion-content ui-widget-content ui-corner-bottom ui-helper-reset #{open ? 'ui-accordion-content-active' : 'hidden'}" param="content"/>
26
+ </div>
27
+ </def>
@@ -0,0 +1,11 @@
1
+ /* toggle */
2
+ (function($) {
3
+ $.fn.hjq_toggle = function(annotations) {
4
+ this.on("click", "div.toggle > h3", function(event) {
5
+ $this = $(this)
6
+ $this.toggleClass('ui-state-active ui-corner-top ui-corner-all');
7
+ $this.next().toggleClass('hidden ui-accordion-content-active');
8
+ $this.children("span.ui-icon").toggleClass('ui-icon-triangle-1-s ui-icon-triangle-1-e')
9
+ });
10
+ }
11
+ })( jQuery );
@@ -1,3 +1,3 @@
1
1
  /*
2
- * require_tree .
2
+ *= require_tree .
3
3
  */
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hobo_jquery_ui
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 1.4.0.pre4
5
+ version: 1.4.0.pre5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bryan Larsen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-03-28 00:00:00 Z
13
+ date: 2012-04-23 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jquery-ui-themes
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - "="
33
33
  - !ruby/object:Gem::Version
34
- version: 1.4.0.pre4
34
+ version: 1.4.0.pre5
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - "="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.4.0.pre4
45
+ version: 1.4.0.pre5
46
46
  type: :runtime
47
47
  version_requirements: *id003
48
48
  description: JQuery UI support for Hobo
@@ -61,6 +61,7 @@ files:
61
61
  - hobo_jquery_ui.gemspec
62
62
  - lib/hobo_jquery_ui.rb
63
63
  - lib/hobo_jquery_ui/railtie.rb
64
+ - taglibs/accordion-list.dryml
64
65
  - taglibs/accordion.dryml
65
66
  - taglibs/accordion_collection.dryml
66
67
  - taglibs/autocomplete.dryml
@@ -70,6 +71,7 @@ files:
70
71
  - taglibs/hobo_jquery_ui.dryml
71
72
  - taglibs/name_one.dryml
72
73
  - taglibs/tabs.dryml
74
+ - taglibs/toggle.dryml
73
75
  - vendor/assets/javascripts/combobox.js
74
76
  - vendor/assets/javascripts/hobo-jquery-ui/hjq-accordion.js
75
77
  - vendor/assets/javascripts/hobo-jquery-ui/hjq-autocomplete.js
@@ -77,6 +79,7 @@ files:
77
79
  - vendor/assets/javascripts/hobo-jquery-ui/hjq-datepicker.js
78
80
  - vendor/assets/javascripts/hobo-jquery-ui/hjq-dialog.js
79
81
  - vendor/assets/javascripts/hobo-jquery-ui/hjq-tabs.js
82
+ - vendor/assets/javascripts/hobo-jquery-ui/hjq-toggle.js
80
83
  - vendor/assets/javascripts/hobo_jquery_ui.js
81
84
  - vendor/assets/stylesheets/combobox.css
82
85
  - vendor/assets/stylesheets/hobo_jquery_ui.css