cytoplasm 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. data/app/assets/javascripts/cytoplasm/cytoColorPicker.js.erb +11 -1
  2. data/app/assets/javascripts/cytoplasm/cytoNav.js.erb +87 -0
  3. data/app/assets/javascripts/cytoplasm/cytoSlider.js.erb +47 -62
  4. data/app/assets/javascripts/cytoplasm/cytoplasm.js.erb +0 -6
  5. data/app/views/cytoplasm/settings/_colors.html.erb +40 -37
  6. data/app/views/cytoplasm/settings/_layout.html.erb +189 -0
  7. data/app/views/cytoplasm/settings/colors.html.erb +1 -4
  8. data/app/views/cytoplasm/settings/layout.html.erb +1 -121
  9. data/lib/cytoplasm.rb +3 -1
  10. data/lib/cytoplasm/version.rb +1 -1
  11. data/test/dummy/log/development.log +18410 -0
  12. data/test/dummy/tmp/cache/assets/C8F/0F0/sprockets%2F369f11075c8c5f939359cb5cb0569281 +0 -0
  13. data/test/dummy/tmp/cache/assets/CD8/900/sprockets%2Fc68606f026190266d8099ada290bbaa4 +0 -0
  14. data/test/dummy/tmp/cache/assets/D03/6B0/sprockets%2Fd3cfc780201b87a3439e35c5236bb71a +0 -0
  15. data/test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe +0 -0
  16. data/test/dummy/tmp/cache/assets/D14/170/sprockets%2F40a7b83bb067eea7ce2c8394e1529287 +0 -0
  17. data/test/dummy/tmp/cache/assets/D15/CE0/sprockets%2Fa1310379a19df3c1796f2f67dcd5915d +0 -0
  18. data/test/dummy/tmp/cache/assets/D46/FF0/sprockets%2Fcda306170f19d43f6536cffcbe993248 +0 -0
  19. data/test/dummy/tmp/cache/assets/D47/070/sprockets%2Fa065e9eefc84070759e37f0a663bf6c0 +0 -0
  20. data/test/dummy/tmp/cache/assets/D5F/CD0/sprockets%2F1b1c9ff225e0707361d5f1cbf8ea214a +0 -0
  21. data/test/dummy/tmp/cache/assets/D69/0A0/sprockets%2Fe6c078d521b528e004f5dd673ddb2a6d +0 -0
  22. data/test/dummy/tmp/cache/assets/D78/840/sprockets%2F326ec6387a9d1b45ec2cdf7093b79f0e +0 -0
  23. data/test/dummy/tmp/cache/assets/E00/880/sprockets%2Fecb876bb310c1a3e6fd534ece45c9ed9 +0 -0
  24. metadata +12 -4
@@ -218,5 +218,15 @@
218
218
  };
219
219
 
220
220
  $(window).resize(function(){$('.cytoColorPicker').cytoColorPicker("resize");});
221
- $.Cytoplasm("ready",function(){$('.cytoColorPicker').cytoColorPicker();});
221
+ $.Cytoplasm("ready",function(){
222
+ $.Cytoplasm("addStyles","cytocolorpicker-styles",{
223
+ '.cytoColorPicker-wrapper':{
224
+ '.ui-slider[data-attr=hue]':{
225
+ background:"linear-gradient(to right,#ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)",
226
+ "box-shadow":"inset 0px 0px 5px hsla(0,0%,0%,0.5)"
227
+ }
228
+ }
229
+ });
230
+ $('.cytoColorPicker').cytoColorPicker();
231
+ });
222
232
  })(jQuery);
@@ -0,0 +1,87 @@
1
+ (function($){
2
+
3
+ var defaults = {
4
+ widget:{
5
+ wrapper:{
6
+ css:{},
7
+ element:false
8
+ },
9
+ nav:{
10
+ css:{},
11
+ element:false,
12
+ ul:{
13
+ css:{},
14
+ element:false,
15
+ li:{
16
+ css:{},
17
+ elements:[]
18
+ }
19
+ }
20
+ }
21
+ },
22
+ events:{
23
+ create:function(){},
24
+ destroy:function(){},
25
+ change:function(){},
26
+ resize:function(){}
27
+ }
28
+ };
29
+
30
+ var methods = {
31
+ init:function(options){
32
+ return this.each(function(){
33
+ // Initialize
34
+ var $this = $(this).addClass('cytoNav');
35
+ if ($this.data('cytoNav')!=null) return console.warn("You cannot reinstatiate cytoNav before calling the destroy method.\nProtip: Use the refresh method to reinstantiate in one move.");
36
+ var settings = $.extend(true,{},defaults,options);
37
+
38
+ // Generate widget
39
+ settings.widget.wrapper.element = $('<div />').addClass('cytoNav-wrapper').css(settings.widget.wrapper.css).appendTo($('header'));
40
+ settings.widget.nav.element = (($this.is("nav")) ? $this : $('<nav />')).addClass('cytoNav-nav').css(settings.widget.nav.css).appendTo(settings.widget.wrapper.element);
41
+ settings.widget.nav.ul.element = (($this.has("ul")) ? $this.find("ul").first() : $("<ul />")).addClass('cytoNav-ul').css(settings.widget.nav.ul.css).appendTo(settings.widget.nav.element);
42
+ if (settings.widget.nav.ul.element.has("li")) {
43
+ var lis = [];
44
+ settings.widget.nav.ul.element.find("li").each(function(){lis.push($(this))});
45
+ settings.widget.nav.ul.li.elements = $.merge(settings.widget.nav.ul.li.elements,lis);
46
+ }
47
+ $.each(settings.widget.nav.ul.li.elements,function(i,li){
48
+ li.addClass('cytoNav-li').css(settings.widget.nav.ul.li.css);
49
+ });
50
+
51
+ // Finalize
52
+ $this.data('cytoNav',settings);
53
+ settings.events.create.apply($this);
54
+ });
55
+ },
56
+ destroy:function(){
57
+ return this.each(function(){
58
+ var $this = $(this);
59
+
60
+ });
61
+ },
62
+ resize:function(){
63
+ return this.each(function(){
64
+ var $this = $(this);
65
+
66
+ });
67
+ },
68
+ value:function(){
69
+ return this.each(function(){
70
+ var $this = $(this);
71
+
72
+ });
73
+ }
74
+ };
75
+
76
+ $.fn.cytoNav=function(method){
77
+ if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
78
+ else if (typeof method == 'object' || !method) return methods.init.apply(this,arguments);
79
+ else $.error('Method ' + method + ' does not exist on $.cytoNav!');
80
+ };
81
+
82
+ $(window).resize(function(){$('.cytoNav').cytoNav('resize');});
83
+ $.Cytoplasm("ready",function(){
84
+ $('nav').cytoNav();
85
+ });
86
+
87
+ })(jQuery);
@@ -15,7 +15,7 @@
15
15
  unit:false
16
16
  }
17
17
  },
18
- slider:{
18
+ sliders:{
19
19
  css:{},
20
20
  elements:[],
21
21
  options:{
@@ -37,7 +37,8 @@
37
37
  events:{
38
38
  create:function(cy){},
39
39
  change:function(cy,event){},
40
- destroy:function(cy){}
40
+ destroy:function(cy){},
41
+ resize:function(cy,event){}
41
42
  }
42
43
  };
43
44
  var methods = {
@@ -56,10 +57,10 @@
56
57
  if ($this.data('dimensions')!=null) settings.dimensions = $this.data('dimensions');
57
58
  if ($this.data('label')!=null) settings.widget.label.html = $this.data('label');
58
59
  if ($this.data('unit')!=null) settings.widget.label.readout.unit = $this.data('unit');
59
- if ($this.data('min')!=null) settings.widget.slider.options.min = $this.data('min');
60
- if ($this.data('max')!=null) settings.widget.slider.options.max = $this.data('max');
61
- if ($this.data('step')!=null) settings.widget.slider.options.step = $this.data('step');
62
- if ($this.val()!=null && $this.val()!="") settings.widget.slider.options.value = parseInt($this.val());
60
+ if ($this.data('min')!=null) settings.widget.sliders.options.min = $this.data('min');
61
+ if ($this.data('max')!=null) settings.widget.sliders.options.max = $this.data('max');
62
+ if ($this.data('step')!=null) settings.widget.sliders.options.step = $this.data('step');
63
+ if ($this.val()!=null && $this.val()!="") settings.widget.sliders.options.value = parseInt($this.val());
63
64
  } else settings = options;
64
65
 
65
66
  // Generate widget
@@ -67,16 +68,16 @@
67
68
  settings.widget.label.element = $('<label />').attr("for",$this.attr("name")).addClass('cytoSlider-label').css(settings.widget.label.css).html(settings.widget.label.html+": ").prependTo(settings.widget.wrapper.element);
68
69
  settings.widget.label.readout.element = $('<span />').addClass("cytoSlider-label-readout").css(settings.widget.label.readout.css).appendTo(settings.widget.label.element);
69
70
 
70
- // Set up sliders
71
- $this.data('cytoSlider',settings);
72
- methods.setDimensions.apply($this,[settings.dimensions]);
73
-
74
71
  // Bindings
75
72
  $this.bind("change.cytoSlider",function(e){
76
73
  settings.widget.label.readout.element.html($(this).val());
77
74
  settings.events.change.apply($this,[settings,e]);
78
75
  });
79
76
 
77
+ // Generate sliders
78
+ $this.data('cytoSlider',settings);
79
+ methods.setDimensions.apply($this,[settings.dimensions]);
80
+
80
81
  // Save settings data to input
81
82
  $this.data('cytoSlider',settings);
82
83
  methods.resize.apply($this);
@@ -114,39 +115,12 @@
114
115
  var settings = $this.data('cytoSlider');
115
116
  if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the resize method!");
116
117
 
117
- settings.widget.wrapper.element.width(0);
118
+ var w = settings.widget.wrapper.element.width(0);
118
119
  setTimeout(function(){
119
- settings.widget.wrapper.element.width("auto");
120
+ w.width("auto");
120
121
  },1);
121
122
  });
122
123
  },
123
- addDimension:function(){
124
- return this.each(function(){
125
- var $this = $(this);
126
- var settings = $this.data('cytoSlider');
127
- if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the addDimension method!");
128
-
129
- var slider = $('<div />').addClass('cytoSlider-slider')
130
- .css(settings.widget.slider.css)
131
- .appendTo(settings.widget.wrapper.element)
132
- .slider(settings.widget.slider.options).slider("value",settings.widget.slider.options.value);
133
- settings.widget.slider.elements.push(slider);
134
-
135
- $this.data('cytoSlider',settings);
136
- });
137
- },
138
- removeDimension:function(){
139
- return this.each(function(){
140
- var $this = $(this);
141
- var settings = $this.data('cytoSlider');
142
- if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the addDimension method!");
143
-
144
- var slider = settings.widget.slider.elements.pop();
145
- slider.remove();
146
-
147
- $this.data('cytoSlider',settings);
148
- });
149
- },
150
124
  setDimensions:function(n){
151
125
  return this.each(function(){
152
126
  var $this = $(this);
@@ -154,40 +128,42 @@
154
128
  if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the setDimensions method!");
155
129
 
156
130
  // Reset sliders
157
- $.each(settings.widget.slider.elements,function(i,s){s.remove()});
158
- settings.widget.slider.elements = [];
131
+ if (settings.widget.sliders.elements.length) settings.widget.sliders.elements.each(function(){$(this).remove()});
159
132
 
160
- settings.dimensions = n;
133
+ // Create sliders
134
+ for (var i=0;i<n;i++) {
135
+ var slider = $('<div />').addClass('cytoSlider-slider')
136
+ .css(settings.widget.sliders.css)
137
+ .appendTo(settings.widget.wrapper.element)
138
+ .slider();
139
+ }
140
+ var sliders = settings.widget.wrapper.element.find('.cytoSlider-slider');
161
141
 
162
142
  // Set up options
163
- $.each(["slide","change"],function(i,v){
164
- var orig = settings.widget.slider.options[v];
165
- settings.widget.slider.options[v] = function(e,ui){
143
+ $.each(["slide","change"],function(i,event){
144
+ var orig = settings.widget.sliders.options[event];
145
+ settings.widget.sliders.options[event] = function(e,ui){
166
146
  var values = [];
167
- for (var i=0;i<settings.dimensions;i++) values.push(settings.widget.slider.elements[i].slider("value")+settings.widget.label.readout.unit);
168
- $this.val(values.join(" "));
169
- orig.apply(this,arguments);
170
- $this.trigger("change.cytoSlider");
147
+ $(this).parent().find('.cytoSlider-slider').each(function(){values.push($(this).slider("value")+settings.widget.label.readout.unit);});
148
+ $this.val(values.join(" ")).trigger("change.cytoSlider");
149
+ orig.apply($this,[e,ui]);
171
150
  };
172
151
  });
173
152
 
174
- // Create sliders
175
- for (var i=0;i<settings.dimensions;i++) {
176
- var slider = $('<div />').addClass('cytoSlider-slider')
177
- .css(settings.widget.slider.css)
178
- .appendTo(settings.widget.wrapper.element)
179
- .slider().slider("value",settings.widget.slider.options.value);
180
- settings.widget.slider.elements.push(slider);
181
- }
182
- if (settings.dimensions>1) {
183
- $.each(settings.widget.slider.elements,function(i,s){s.css("margin-top",10);});
184
- settings.widget.slider.elements[0].css("margin-top",0);
153
+ // Margin fix
154
+ if (n>1) {
155
+ sliders.each(function(){$(this).css("margin-top",10);});
156
+ $(sliders).first().css("margin-top",0);
185
157
  }
186
158
 
187
159
  // Set options
188
- $.each(settings.widget.slider.elements,function(i,s){s.slider("option",settings.widget.slider.options);});
160
+ sliders.each(function(){
161
+ $(this).slider("option",settings.widget.sliders.options);
162
+ });
189
163
 
190
164
  // Store settings
165
+ settings.dimensions = n;
166
+ settings.widget.sliders.elements = sliders;
191
167
  $this.data('cytoSlider',settings);
192
168
  });
193
169
  },
@@ -201,7 +177,16 @@
201
177
 
202
178
  if (set===false) value = $this.val();
203
179
  else {
204
- settings.widget.slider.element.slider("value",set);
180
+ if (set.indexOf(" ")>-1) {
181
+ set = set.split(" ");
182
+ methods.setDimensions.apply($this,[set.length]);
183
+ $.each(set,function(i,v){
184
+ settings.widget.sliders.elements[i].slider("value",parseFloat(v));
185
+ });
186
+ } else {
187
+ methods.setDimensions.apply($this,[1]);
188
+ settings.widget.sliders.elements[0].slider("value",parseFloat(set));
189
+ }
205
190
  $this.trigger('change.cytoSlider');
206
191
  }
207
192
  });
@@ -234,12 +234,6 @@ var Cytoplasm;
234
234
  background:reverseGradient(vars.colors.plugins.cytoButton.background),
235
235
  "box-shadow":vars.layout.plugins.cytoButton.shadow
236
236
  }
237
- },
238
- '.cytoColorPicker-wrapper':{
239
- '.ui-slider[data-attr=hue]':{
240
- background:"linear-gradient(to right,#ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)",
241
- "box-shadow":"inset 0px 0px 5px hsla(0,0%,0%,0.5)"
242
- }
243
237
  }
244
238
  },userstyles);
245
239
 
@@ -2,49 +2,52 @@
2
2
  containers = {'header' => 'Header', 'section' => 'Content Section', 'footer' => 'Footer'}
3
3
  links = ['unvisited','visited','hover','active']
4
4
  %>
5
- <table class="cytoTable">
6
- <tr><td class='headercell' colspan=2><h3>Color Palette</h3></td></tr>
7
- <% ['background','text','accent'].each do |color| %>
5
+ <form id="cytoplasm_colors_form" action="<%=cytoplasm_update_url%>" method="post">
6
+ <table class="cytoTable">
7
+ <tr><td class='headercell' colspan=2><h3>Color Palette</h3></td></tr>
8
+ <% ['background','text','accent'].each do |color| %>
9
+ <tr>
10
+ <td class='labelcell'><%=color.capitalize%> Color:</td>
11
+ <td><input type="colorpicker" name="colors[global][<%=color%>]" value="<%=Cytoplasm.vars("colors.global."+color)%>" /></td>
12
+ </tr>
13
+ <% end %>
14
+ <tr><td class='headercell' colspan=2><h3>Containers</h3></td></tr>
15
+ <% containers.each do |key,label| %>
8
16
  <tr>
9
- <td class='labelcell'><%=color.capitalize%> Color:</td>
10
- <td><input type="colorpicker" name="colors[global][<%=color%>]" value="<%=Cytoplasm.vars("colors.global."+color)%>" /></td>
17
+ <td class="labelcell"><%=label%>:</td>
18
+ <td>
19
+ <% ['background','text'].each do |color| %>
20
+ <label for="colors[<%=key%>][<%=color%>]"><%=color.capitalize%>:</label>
21
+ <input type="colorpicker" name="colors[<%=key%>][<%=color%>]" value="<%=Cytoplasm.vars("colors."+key+"."+color)%>" />
22
+ <% end %>
23
+ </td>
11
24
  </tr>
12
- <% end %>
13
- <tr><td class='headercell' colspan=2><h3>Containers</h3></td></tr>
14
- <% containers.each do |key,label| %>
15
- <tr>
16
- <td class="labelcell"><%=label%>:</td>
17
- <td>
18
- <% ['background','text'].each do |color| %>
19
- <label for="colors[<%=key%>][<%=color%>]"><%=color.capitalize%>:</label>
20
- <input type="colorpicker" name="colors[<%=key%>][<%=color%>]" value="<%=Cytoplasm.vars("colors."+key+"."+color)%>" />
21
- <% end %>
22
- </td>
23
- </tr>
24
- <% end %>
25
- <tr><td class='headercell' colspan=2><h3>Links</h3></td></tr>
26
- <% links.each do |link| %>
25
+ <% end %>
26
+ <tr><td class='headercell' colspan=2><h3>Links</h3></td></tr>
27
+ <% links.each do |link| %>
28
+ <tr>
29
+ <td class="labelcell"><%=link.capitalize%>:</td>
30
+ <td>
31
+ <label for="colors[link][<%=link%>][text]">Text:</label>
32
+ <input type="colorpicker" name="colors[link][<%=link%>][text]" value="<%=Cytoplasm.vars("colors.link."+link+".text")%>" />
33
+ </td>
34
+ </tr>
35
+ <% end %>
36
+ <tr><td class='headercell' colspan=2><h3>Plugins</h3></td></tr>
37
+ <% {"cytoTable" => ["background","text"],"cytoField" => ["background","text"],"cytoSelect" => ["background","text"],"cytoRadio" => ["background","text"],"cytoUpload" => ["background","text"],"cytoSlider" => ["text"]}.each do |plugin,colors| %>
27
38
  <tr>
28
- <td class="labelcell"><%=link.capitalize%>:</td>
39
+ <td class="labelcell"><%=plugin.capitalize%>:</td>
29
40
  <td>
30
- <label for="colors[link][<%=link%>][text]">Text:</label>
31
- <input type="colorpicker" name="colors[link][<%=link%>][text]" value="<%=Cytoplasm.vars("colors.link."+link+".text")%>" />
41
+ <% colors.each do |color| %>
42
+ <label for="colors[plugins][<%=plugin%>][<%=color%>]"><%=color.capitalize%>:</label>
43
+ <input type="colorpicker" name="colors[plugins][<%=plugin%>][<%=color%>]" value="<%=Cytoplasm.vars("colors.plugins."+plugin+"."+color)%>" />
44
+ <% end %>
32
45
  </td>
33
46
  </tr>
34
- <% end %>
35
- <tr><td class='headercell' colspan=2><h3>Plugins</h3></td></tr>
36
- <% {"cytoTable" => ["background","text"],"cytoField" => ["background","text"],"cytoSelect" => ["background","text"],"cytoRadio" => ["background","text"],"cytoUpload" => ["background","text"],"cytoSlider" => ["text"]}.each do |plugin,colors| %>
37
- <tr>
38
- <td class="labelcell"><%=plugin.capitalize%>:</td>
39
- <td>
40
- <% colors.each do |color| %>
41
- <label for="colors[plugins][<%=plugin%>][<%=color%>]"><%=color.capitalize%>:</label>
42
- <input type="colorpicker" name="colors[plugins][<%=plugin%>][<%=color%>]" value="<%=Cytoplasm.vars("colors.plugins."+plugin+"."+color)%>" />
43
- <% end %>
44
- </td>
45
- </tr>
46
- <% end %>
47
- </table>
47
+ <% end %>
48
+ </table>
49
+ <button class="cytoButton large">Save Colors</button>
50
+ </form>
48
51
 
49
52
  <script type="text/javascript">
50
53
  (function($){
@@ -0,0 +1,189 @@
1
+ <form id="cytoplasm_layout_settings_form" action="<%=cytoplasm_update_url%>" method="post" enctype="multipart/form-data">
2
+ <table id="layout_settings_table" class="cytoTable">
3
+ <tr><td class='headercell' colspan=2><h3>Body</h3></td></tr>
4
+ <tr>
5
+ <td class="labelcell">Layout Mode:</td>
6
+ <td>
7
+ <input type="radio" name="layout[mode]" value="fluid" data-label="Fluid" class="cytoRadio" />
8
+ <input type="radio" name="layout[mode]" value="boxed" data-label="Boxed" />
9
+ </td>
10
+ </tr>
11
+ <tr>
12
+ <td class="labelcell">Layout Padding:</td>
13
+ <td>
14
+ <input type="radio" name="layout[padding_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
15
+ <input type="radio" name="layout[padding_mode]" value="2" data-label="Horizontal and Vertical" />
16
+ <input type="radio" name="layout[padding_mode]" value="4" data-label="Side by Side" />
17
+ <input type="hidden" name="layout[padding]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.padding")%>" data-max="200" data-unit="px" data-label="Pixels of padding for the layout" />
18
+ </td>
19
+ </tr>
20
+ <tr><td class='headercell' colspan=2><h3>Header</h3></td></tr>
21
+ <tr>
22
+ <td class="labelcell">Position Mode:</td>
23
+ <td>
24
+ <input type="radio" name="layout[header][position]" value="inherit" data-label="Inherit" class="cytoRadio" checked="checked" />
25
+ <input type="radio" name="layout[header][position]" value="static" data-label="Static" />
26
+ <input type="radio" name="layout[header][position]" value="relative" data-label="Relative" />
27
+ <input type="radio" name="layout[header][position]" value="absolute" data-label="Absolute" />
28
+ <input type="radio" name="layout[header][position]" value="fixed" data-label="Fixed" />
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <td class="labelcell">Height:</td>
33
+ <td>
34
+ <input type="hidden" name="layout[header][height]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.header.height")%>" data-max="500" data-unit="px" data-label="Height of the header tag" />
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td class="labelcell">Margin:</td>
39
+ <td>
40
+ <input type="radio" name="layout[header][margin_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
41
+ <input type="radio" name="layout[header][margin_mode]" value="2" data-label="Horizontal and Vertical" />
42
+ <input type="radio" name="layout[header][margin_mode]" value="4" data-label="Side by Side" />
43
+ <input type="hidden" name="layout[header][margin]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.header.margin")%>" data-max="200" data-unit="px" data-label="Pixels of margin for the header" />
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td class="labelcell">Padding:</td>
48
+ <td>
49
+ <input type="radio" name="layout[header][padding_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
50
+ <input type="radio" name="layout[header][padding_mode]" value="2" data-label="Horizontal and Vertical" />
51
+ <input type="radio" name="layout[header][padding_mode]" value="4" data-label="Side by Side" />
52
+ <input type="hidden" name="layout[header][padding]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.header.padding")%>" data-max="200" data-unit="px" data-label="Pixels of padding for the header" />
53
+ </td>
54
+ </tr>
55
+ <tr><td class='headercell' colspan=2><h3>Content</h3></td></tr>
56
+ <tr>
57
+ <td class='labelcell'>Margin:</td>
58
+ <td>
59
+ <input type="radio" name="layout[section][margin_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
60
+ <input type="radio" name="layout[section][margin_mode]" value="2" data-label="Horizontal and Vertical" />
61
+ <input type="radio" name="layout[section][margin_mode]" value="4" data-label="Side by Side" />
62
+ <input type="hidden" name="layout[section][margin]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.section.margin")%>" data-max="200" data-unit="px" data-label="Pixels of margin for the content" />
63
+ </td>
64
+ </tr>
65
+ <tr>
66
+ <td class='labelcell'>Padding:</td>
67
+ <td>
68
+ <input type="radio" name="layout[section][padding_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
69
+ <input type="radio" name="layout[section][padding_mode]" value="2" data-label="Horizontal and Vertical" />
70
+ <input type="radio" name="layout[section][padding_mode]" value="4" data-label="Side by Side" />
71
+ <input type="hidden" name="layout[section][padding]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.section.padding")%>" data-max="200" data-unit="px" data-label="Pixels of padding for the content" />
72
+ </td>
73
+ </tr>
74
+ <tr><td class='headercell' colspan=2><h3>Footer</h3></td></tr>
75
+ <tr>
76
+ <td class='labelcell'>Margin:</td>
77
+ <td>
78
+ <input type="radio" name="layout[footer][margin_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
79
+ <input type="radio" name="layout[footer][margin_mode]" value="2" data-label="Horizontal and Vertical" />
80
+ <input type="radio" name="layout[footer][margin_mode]" value="4" data-label="Side by Side" />
81
+ <input type="hidden" name="layout[footer][margin]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.footer.margin")%>" data-max="200" data-unit="px" data-label="Pixels of margin for the footer" />
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td class='labelcell'>Padding:</td>
86
+ <td>
87
+ <input type="radio" name="layout[footer][padding_mode]" value="1" data-label="All Sides" class="cytoRadio" checked="checked" />
88
+ <input type="radio" name="layout[footer][padding_mode]" value="2" data-label="Horizontal and Vertical" />
89
+ <input type="radio" name="layout[footer][padding_mode]" value="4" data-label="Side by Side" />
90
+ <input type="hidden" name="layout[footer][padding]" class="cytoSlider" value="<%=Cytoplasm.vars("layout.footer.padding")%>" data-max="200" data-unit="px" data-label="Pixels of padding for the footer" />
91
+ </td>
92
+ </tr>
93
+ <tr><td class='headercell' colspan=2><h3>Plugins</h3></td></tr>
94
+ </table>
95
+
96
+ <button class="cytoButton large">Save Layout Settings</button>
97
+ </form>
98
+
99
+ <script type="text/javascript">
100
+ (function($){
101
+ $.Cytoplasm("ready",function(){
102
+ // Layout
103
+ // Layout Mode
104
+ $('input[name="layout[mode]"]').cytoRadio("value",$.Cytoplasm("vars","layout.mode"));
105
+ // Layout Padding
106
+ $('input[name="layout[padding_mode]"]').cytoRadio("options",{
107
+ events:{
108
+ change:function(cy,e){$('input[name="layout[padding]"]').cytoSlider("setDimensions",$(this).cytoRadio("value"));}
109
+ }
110
+ });
111
+ $('input[name="layout[padding]"]').cytoSlider("options",{widget:{sliders:{options:{
112
+ slide:function(e,ui){
113
+ $('body').css("padding",$(this).val());
114
+ },
115
+ change:function(e,ui){
116
+ $('body').css("padding",$(this).val());
117
+ setTimeout(function(){$(window).trigger("resize");},200);
118
+ }}}}});
119
+
120
+ // Header
121
+ $('input[name="layout[header][position]"]').cytoRadio("options",{events:{change:function(){
122
+ $('header').css("position",$(this).cytoRadio("value"));
123
+ switch ($(this).cytoRadio("value")) {
124
+ case "relative":
125
+ case "absolute":
126
+ case "fixed":
127
+
128
+ break;
129
+ }
130
+ }}});
131
+ $('input[name="layout[header][height]"]').cytoSlider("options",{events:{change:function(){
132
+ $('header').height($(this).val());
133
+ }}});
134
+ // Header Margin
135
+ $('input[name="layout[header][margin_mode]"]').cytoRadio("options",{
136
+ events:{
137
+ change:function(cy,e){$('input[name="layout[header][margin]"]').cytoSlider("setDimensions",$(this).cytoRadio("value"));}
138
+ }
139
+ });
140
+ $('input[name="layout[header][margin]"]').cytoSlider("options",{widget:{sliders:{options:{
141
+ slide:function(e,ui){
142
+ $('header').css("margin",$(this).val());
143
+ },
144
+ change:function(e,ui){
145
+ $('header').css("margin",$(this).val());
146
+ setTimeout(function(){$(window).trigger("resize");},200);
147
+ }}}}});
148
+ // Header Padding
149
+ $('input[name="layout[header][padding_mode]"]').cytoRadio("options",{
150
+ events:{
151
+ change:function(cy,e){$('input[name="layout[header][padding]"]').cytoSlider("setDimensions",$(this).cytoRadio("value"));}
152
+ }
153
+ });
154
+ $('input[name="layout[header][padding]"]').cytoSlider("options",{widget:{sliders:{options:{
155
+ slide:function(e,ui){
156
+ $('header').css("padding",$(this).val());
157
+ },
158
+ change:function(e,ui){
159
+ $('header').css("padding",$(this).val());
160
+ setTimeout(function(){$(window).trigger("resize");},200);
161
+ }}}}});
162
+
163
+ // Content
164
+ // Content Margin
165
+ $('input[name="layout[section][margin_mode]"]').cytoRadio("options",{events:{change:function(){
166
+ $('input[name="layout[section][margin]"]').cytoSlider("setDimensions",$(this).cytoRadio("value"));
167
+ }}});
168
+
169
+ $('input[name="layout[section][margin]"]').cytoSlider("options",{widget:{sliders:{options:{
170
+ slide:function(e,ui){
171
+ $('section').css("margin",$(this).val());
172
+ },
173
+ change:function(e,ui){
174
+ $('section').css("margin",$(this).val());
175
+ setTimeout(function(){$(window).trigger("resize");},200);
176
+ }}}}});
177
+ // Content Padding
178
+ $('input[name="layout[section][padding_mode]"]').cytoRadio("options",{events:{change:function(cy,e){$('input[name="layout[section][padding]"]').cytoSlider("setDimensions",$(this).cytoRadio("value"));}}});
179
+ $('input[name="layout[section][padding]"]').cytoSlider("options",{widget:{sliders:{options:{
180
+ slide:function(e,ui){
181
+ $('section').css("padding",$(this).val());
182
+ },
183
+ change:function(e,ui){
184
+ $('section').css("padding",$(this).val());
185
+ setTimeout(function(){$(window).trigger("resize");},200);
186
+ }}}}});
187
+ });
188
+ })(jQuery);
189
+ </script>