cytoplasm 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/app/assets/javascripts/cytoplasm/cytoLogo.js.erb +3 -0
  2. data/app/assets/javascripts/cytoplasm/cytoRadio.js.erb +3 -2
  3. data/app/assets/javascripts/cytoplasm/cytoplasm.js.erb +45 -18
  4. data/app/assets/stylesheets/cytoplasm/cytoplasm.less +1 -5
  5. data/app/controllers/cytoplasm/fonts_controller.rb +26 -6
  6. data/app/controllers/cytoplasm/settings_controller.rb +4 -0
  7. data/app/views/cytoplasm/fonts/_installer.html.erb +107 -0
  8. data/app/views/cytoplasm/fonts/_li.html.erb +65 -0
  9. data/app/views/cytoplasm/fonts/_list.html.erb +20 -0
  10. data/app/views/cytoplasm/fonts/index.html.erb +5 -159
  11. data/app/views/cytoplasm/fonts/show.html.erb +11 -0
  12. data/app/views/cytoplasm/settings/colors.html.erb +1 -0
  13. data/app/views/cytoplasm/settings/{edit.html.erb → general.html.erb} +3 -193
  14. data/app/views/cytoplasm/settings/index.html.erb +4 -6
  15. data/app/views/cytoplasm/settings/layout.html.erb +56 -0
  16. data/config/routes.rb +5 -2
  17. data/lib/cytoplasm.rb +13 -5
  18. data/lib/cytoplasm/version.rb +1 -1
  19. data/test/dummy/app/views/demos/index.html.erb +12 -11
  20. data/test/dummy/app/views/demos/jquery.html.erb +107 -0
  21. data/test/dummy/app/views/home/index.html.erb +26 -57
  22. data/test/dummy/app/views/layouts/application.html.erb +2 -2
  23. data/test/dummy/config/routes.rb +2 -0
  24. data/test/dummy/log/development.log +99955 -0
  25. data/test/dummy/log/test.log +20 -0
  26. data/test/dummy/public/cytoplasm/cytoplasm.vars.less +7 -1
  27. data/test/dummy/public/fonts/Vitamin/VITAMINO-webfont.eot +0 -0
  28. data/test/dummy/public/fonts/Vitamin/VITAMINO-webfont.svg +136 -0
  29. data/test/dummy/public/fonts/Vitamin/VITAMINO-webfont.ttf +0 -0
  30. data/test/dummy/public/fonts/Vitamin/VITAMINO-webfont.woff +0 -0
  31. data/test/dummy/public/fonts/Vitamin/VITAMIN_-webfont.eot +0 -0
  32. data/test/dummy/public/fonts/Vitamin/VITAMIN_-webfont.svg +137 -0
  33. data/test/dummy/public/fonts/Vitamin/VITAMIN_-webfont.ttf +0 -0
  34. data/test/dummy/public/fonts/Vitamin/VITAMIN_-webfont.woff +0 -0
  35. data/test/dummy/public/fonts/Vitamin/demo.html +38 -0
  36. data/test/dummy/public/fonts/Vitamin/pizzadude.dk License.txt +8 -0
  37. data/test/dummy/public/fonts/Vitamin/stylesheet.css +28 -0
  38. data/test/dummy/public/fonts/enabled.yml +6 -2
  39. data/test/dummy/tmp/cache/assets/C84/4A0/sprockets%2F8a760be2f29a644c90004cd461744978 +0 -0
  40. data/test/dummy/tmp/cache/assets/CAC/280/sprockets%2F408a235a236b0a3aa1302733211db5ba +0 -0
  41. data/test/dummy/tmp/cache/assets/CAE/FD0/sprockets%2F3bb22e4d409072c2278c1771893ec19e +0 -0
  42. data/test/dummy/tmp/cache/assets/D03/6B0/sprockets%2Fd3cfc780201b87a3439e35c5236bb71a +0 -0
  43. data/test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe +0 -0
  44. data/test/dummy/tmp/cache/assets/D14/170/sprockets%2F40a7b83bb067eea7ce2c8394e1529287 +0 -0
  45. data/test/dummy/tmp/cache/assets/D28/830/sprockets%2F1cd2012fe85799b84951d6fc7c8ff079 +0 -0
  46. data/test/dummy/tmp/cache/assets/D36/B20/sprockets%2F0dd47218aa33bc293a136c358f2eed67 +0 -0
  47. data/test/dummy/tmp/cache/assets/D50/750/sprockets%2F7fbcc321810c8f493f86364fee480ed9 +0 -0
  48. data/test/dummy/tmp/cache/assets/D73/5F0/sprockets%2F6aee922214ffea56b31595f1a5ed8c92 +0 -0
  49. data/test/dummy/tmp/cache/assets/DBE/210/sprockets%2Fbedb89fd02eac0dc7aa93c820c612343 +0 -0
  50. data/test/dummy/tmp/cache/assets/E69/B60/sprockets%2Ffdbf7ec615e9a92e4857cdade17f4daa +0 -0
  51. metadata +52 -16
  52. data/app/views/cytoplasm/fonts/_font_li.html.erb +0 -23
  53. data/test/dummy/tmp/pids/server.pid +0 -1
@@ -4,171 +4,17 @@
4
4
 
5
5
  <% if @enabled["fontsquirrel"].any? or @enabled["googlewebfonts"].any? %>
6
6
  <h3>Enabled Fonts</h3>
7
- <p>These fonts are loaded at runtime. Remember: <b>less is more!</b> Enabling lots of fonts can slow page loading times and clutter up layouts.</p>
8
-
9
- <% {"fontsquirrel" => "FontSquirrel","googlewebfonts" => "Google Web Fonts"}.each do |dir,name| %>
10
- <% if @enabled[dir].any? %>
11
- <h6><%=name%></h6>
12
- <ul>
13
- <% @enabled[dir].each do |fam,f| %>
14
- <%=render :partial => 'font_li', :locals => {:fam => fam, :f => f, :dir => dir} %>
15
- <% end %>
16
- </ul>
17
- <% end %>
18
- <% end %>
19
-
7
+ <p>The following fonts are being loaded into every page of your site. To use them, simply add a font-family CSS rule referencing the <b>CSS Name</b> to any element.</p>
8
+ <p><b>Remember: less is more!</b> Loading tons of fonts can severely affect page load times, and using more than a few at a time is widely considered poor design practice anyway. It is recommended that you simply disable any fonts that you aren't using.</p>
9
+ <%=render :partial => 'list', :object => @enabled %>
20
10
  <hr />
21
11
  <% end %>
22
12
 
23
13
  <% if @installed["fontsquirrel"].any? or @installed["googlewebfonts"].any? %>
24
14
  <h3>Installed Fonts</h3>
25
15
  <p>This includes all fonts that are currently installed into this Cytoplasm project.</p>
26
-
27
- <% {"fontsquirrel" => "FontSquirrel","googlewebfonts" => "Google Web Fonts"}.each do |dir,name| %>
28
- <% if @installed[dir].any? %>
29
- <h6><%=name%></h6>
30
- <ul>
31
- <% @installed[dir].each do |fam,f| %>
32
- <%=render :partial => 'font_li', :locals => {:fam => fam, :f => f, :dir => dir} %>
33
- <% end %>
34
- </ul>
35
- <% end %>
36
- <% end %>
37
-
16
+ <%=render :partial => 'list', :object => @installed %>
38
17
  <hr />
39
18
  <% end %>
40
19
 
41
- <h3>Install New Fonts</h3>
42
-
43
- <p>
44
- <input type="radio" name="fonts_directory" data-label="Font Squirrel API" value="fontsquirrel" data-exclude="true" checked="checked" class="cytoRadio" />
45
- <input type="radio" name="fonts_directory" data-label="Google Web Fonts" value="googlewebfonts" data-exclude="true" />
46
- </p>
47
- <p><select name="fonts_family" id="fontfamilyselect" data-exclude="true" class="cytoSelect"></select></p>
48
- <p><input type="checkbox" id="font_import_autoenable" data-exclude="true" checked="checked" /> Automatically enable this font after installing</p>
49
- <p><button id="font_import_button" class="cytoButton large">Install Font Family</button></p>
50
-
51
- <script type="text/javascript">
52
- (function($){
53
- $.Cytoplasm("ready",function(){
54
- $.cytoAjax("/cytoplasm/fonts/fetch_all",function(data){
55
- var fds = $('input[name=fonts_directory]');
56
- var ffs = $('#fontfamilyselect');
57
- var iae = $('#font_import_autoenable');
58
- var ib = $('#font_import_button');
59
-
60
- // Directory select
61
- fds.cytoRadio("options",{
62
- events:{
63
- change:$.debounce(100,true,function(e){
64
- var fonts = {};
65
- var imported = {};
66
- switch ($(this).cytoRadio("value")) {
67
- case "fontsquirrel":
68
- $.each(data.fontsquirrel,function(fam,f){fonts[fam] = f.family_name;});
69
- if (data.imported.length>0) {
70
- $.each(data.imported,function(fam,f){imported[fam] = fam;});
71
- iffs.cytoSelect("update",imported);
72
- }
73
- break;
74
- case "googlewebfonts":
75
- $.each(data.googlewebfonts,function(fam,f){fonts[fam] = fam;});
76
- break;
77
- default:return false;
78
- }
79
- ffs.cytoSelect("update",fonts);
80
- })
81
- }
82
- });
83
-
84
- // Family select
85
- ffs.cytoSelect("options",{
86
- events:{
87
- change:function(cy,e){
88
- var dir = fds.cytoRadio("value");
89
- var f = data[dir][$(this).cytoSelect("value")];
90
- if (f!=null) switch (dir) {
91
- case "fontsquirrel":
92
- // Check if font has already been imported
93
- if (!$.isEmptyObject(data.imported[dir]) && data.imported[dir][f.family_urlname] != null) ib.addClass('active').html("Font Family Installed");
94
- else ib.removeClass('active').html("Install Font Family");
95
- break;
96
- case "googlewebfonts":
97
- console.log(data.imported[dir][f.family]);
98
- if (!$.isEmptyObject(data.imported[dir]) && data.imported[dir][f.family] != null) ib.addClass('active').html("Font Family Installed");
99
- else ib.removeClass('active').html("Install Font Family");
100
- break;
101
- }
102
- }
103
- }
104
- });
105
-
106
- // Font Import Button
107
- ib.css({"margin-top":10}).click(function(e){
108
- e.preventDefault();
109
- var dir = fds.cytoRadio("value");
110
- var f = data[dir][ffs.cytoSelect("value")];
111
- var name = (dir=="fontsquirrel") ? f.family_name : f.family;
112
- var urlname = (dir=="fontsquirrel") ? f.family_urlname : f.family;
113
- if (!ib.hasClass('active')) {
114
- // Import font
115
- $.cytoAjax("/cytoplasm/fonts/import",{directory:dir,family:urlname},function(data){
116
- if (!iae.prop("checked")) $.cytoAjaxResponse('Font "'+name+'" has been installed successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
117
- else $.cytoAjax("/cytoplasm/fonts/enable",{family:urlname,directory:dir},function(data2){
118
- $.cytoAjaxResponse('Font "'+name+'" has been enabled successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
119
- });
120
- ib.addClass('active').html("Font Family Installed");
121
- });
122
- } else {
123
- // Remove font
124
- if (confirm("Are you sure you want to uninstall this font from your fonts library?")) $.cytoAjax("/cytoplasm/fonts/remove",{directory:dir,family:f},function(data){
125
- $.cytoAjaxResponse('Font "'+name+'" has been uninstalled successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
126
- ib.removeClass('active').html("Install Font Family");
127
- });
128
- }
129
- });
130
-
131
- });
132
-
133
- });
134
- })(jQuery);
135
- </script>
136
-
137
- <script type="text/javascript">
138
- (function($){
139
- $.Cytoplasm("ready",function(){
140
- $('.font_enable_disable').click(function(e){
141
- e.preventDefault();
142
- var $this = $(this);
143
- var li = $this.parents("li");
144
- var fam = li.data('family');
145
- var dir = li.data('directory');
146
-
147
- if ($this.html()=="Enable") {
148
- $.cytoAjax("/cytoplasm/fonts/enable",{family:fam,directory:dir},function(data){
149
- $.cytoAjaxResponse('Font "'+fam+'" has been enabled successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
150
- $this.html("Disable");
151
- });
152
- } else if ($this.html()=="Disable") {
153
- $.cytoAjax("/cytoplasm/fonts/disable",{family:li.data('family'),directory:dir},function(data){
154
- $.cytoAjaxResponse('Font "'+fam+'" has been disabled successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
155
- $this.html("Enable");
156
- });
157
- } else return false;
158
- });
159
-
160
- $('.font_uninstall').click(function(e){
161
- e.preventDefault();
162
- var $this = $(this);
163
- var li = $this.parents("li");
164
- var fam = li.data('family');
165
- var dir = li.data('directory');
166
-
167
- if (confirm('Are you sure you want to uninstall this font?')) $.cytoAjax("/cytoplasm/fonts/remove",{family:fam,directory:dir},function(data){
168
- $.cytoAjaxResponse('Font "'+fam+'" has been uninstalled successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
169
- li.hide(400);
170
- });
171
- });
172
- });
173
- })(jQuery);
174
- </script>
20
+ <%=render :partial => 'installer'%>
@@ -0,0 +1,11 @@
1
+ <h2><%=@font['family_name']%></h2>
2
+
3
+ <table class="cytoTable">
4
+ <tr><td colspan=2><h3>Variants</h3></td></tr>
5
+ <% @font['familyinfo'].each do |variant| %>
6
+ <tr>
7
+ <td class="labelcell"><%=variant['style_name']%>:</td>
8
+ <td style="background:white;text-align:center;"><%=image_tag(variant['sample_image'])%></td>
9
+ </tr>
10
+ <% end %>
11
+ </table>
@@ -0,0 +1 @@
1
+ <h2>Cytoplasm Colors Settings</h2>
@@ -1,17 +1,9 @@
1
- <h2>Cytoplasm Settings</h2>
1
+ <h2>Cytoplasm General Settings</h2>
2
+ <p>This interface generates a YAML file at config/initializers/cytoplasm.vars.yml.</p>
3
+
2
4
  <form id="site_settings_form" action="" method="post">
3
- <p class="callback_message" id="success_message"></p>
4
- <p class="callback_message" id="status_message"></p>
5
- <p class="callback_message" id="error_message"></p>
6
5
  <table id="layout_settings_table" class='cytoTable' cellpadding=0 cellspacing=0>
7
6
  <tr><td class='headercell' colspan=2><h3>General</h3></td></tr>
8
- <tr>
9
- <td class='labelcell'>Layout Mode:</td>
10
- <td>
11
- <input type="radio" name="layout_mode" value="fluid" data-label="Fluid" class="cytoRadio" />
12
- <input type="radio" name="layout_mode" value="boxed" data-label="Boxed" />
13
- </td>
14
- </tr>
15
7
  <tr>
16
8
  <td class='labelcell'>Layout Padding:</td>
17
9
  <td><input type="hidden" name="layout_padding" class="cytoSlider" value="20" data-max="200" data-unit="px" data-label="Amount of padding for your content" /></td>
@@ -116,21 +108,6 @@
116
108
  </tr>
117
109
 
118
110
  <tr><td class='headercell' colspan=2><h3>Fonts</h3></td></tr>
119
- <tr>
120
- <td class='labelcell'>Font Directory:</td>
121
- <td>
122
- <input type="radio" name="fonts_directory" data-label="Standard Web Fonts" value="standard" data-exclude="true" class="cytoRadio" />
123
- <input type="radio" name="fonts_directory" data-label="Font Squirrel API" value="fontsquirrel" data-exclude="true" />
124
- <input type="radio" name="fonts_directory" data-label="Google Web Fonts" value="googlewebfonts" data-exclude="true" />
125
- </td>
126
- </tr>
127
- <tr>
128
- <td class='labelcell'>Font Family:</td>
129
- <td>
130
- <select name="fonts_family" id="fontfamilyselect" data-exclude="true" class="cytoSelect"></select>
131
- <button id="font_import_button" class="cytoButton large">Import Font Family</button>
132
- </td>
133
- </tr>
134
111
  <tr><td class='infocell' colspan=2>Select individual fonts below if desired.</td></tr>
135
112
  <% ['Light','Regular','Bold'].each do |style| %>
136
113
  <tr>
@@ -306,173 +283,6 @@
306
283
  $('input[name=nav_background_color],input[name=nav_background_gradient_start],input[name=nav_background_gradient_stop]').cytoColorPicker("options",{widget:{wrapper:{css:{'margin-top':10}}}});
307
284
  $('input[name=nav_background_color]').cytoColorPicker("value",$.Cytoplasm("vars","layout.header.nav.background"));
308
285
 
309
- // Fetch fonts
310
- $.cytoAjax("/cytoplasm/fonts/fetch_all",function(data){
311
- console.log(data);
312
- var fds = $('input[name=fonts_directory]');
313
- var ffs = $('#fontfamilyselect');
314
- var iffs = $('.ind_font_fam_select');
315
- var ifs = $('.ind_font_select');
316
-
317
- /*
318
- // Fetch family details
319
- $.cytoAjax("settings/fs_fetch_family.php",{family:f.family_urlname},function(data){
320
- ifs.each(function(){
321
- var select = $(this);
322
-
323
- // Populate list
324
- var fam = {};
325
- $.each(data.family,function(i,member){
326
- fam[member.fontface_name] = member;
327
- select.append($('<option />').val(member.fontface_name).html(member.fontface_name+" ("+member.style_name+")"));
328
- });
329
- // Try to select defaults
330
- var font = _page.less["fonts_"+select.data('style').toLowerCase()]
331
- if (font.charAt(0)=='"') font = font.slice(1,-1);
332
- if (fam[font] != null) select.val(font);
333
- else $.each(fam,function(ffname,member){
334
- if (member.style_name.indexOf(select.data('style'))>-1 || member.style_name.indexOf(select.data('style').toLowerCase())>-1) {
335
- select.val(ffname);
336
- return false;
337
- }
338
- });
339
- // Set preview image and refresh cytoSelect
340
- select.parent().siblings('a.font-preview').css({background:'white',display:'block',width:"100%","text-align":"center","padding-top":5,"border-top-left-radius":5,"border-top-right-radius":5,"box-shadow":"0px 0px 10px rgba(0,0,0,0.5)"}).children('img').attr("src",fam[select.val()].listing_image).show();
341
- select.cytoSelect("refresh").data('font',fam[select.val()]);
342
- });
343
- });
344
- */
345
-
346
- // Directory select
347
- fds.cytoRadio("value",$.Cytoplasm("conf","fontloader.directory")).cytoRadio("options",{
348
- events:{
349
- change:$.debounce(100,true,function(e){
350
- var fonts = {};
351
- var imported = {};
352
- switch ($(this).cytoRadio("value")) {
353
- case "fontsquirrel":
354
- if (!$('#font_import_button').is(':visible')) $('#font_import_button').show(400);
355
- var importedFamily = {};
356
- $.each(data.fontsquirrel,function(fam,f){fonts[fam] = f.family_name;});
357
- if (data.imported.length>0) {
358
- $.each(data.imported,function(fam,f){imported[fam] = fam;});
359
- iffs.cytoSelect("update",imported);
360
- }
361
- break;
362
- case "googlewebfonts":
363
- if ($('#font_import_button').is(':visible')) $('#font_import_button').hide(400);
364
- $.each(data.googlewebfonts,function(fam,f){fonts[fam] = fam;});
365
- break;
366
- default:return false;
367
- }
368
- ffs.cytoSelect("update",fonts);
369
- })
370
- }
371
- });
372
-
373
- // Family select
374
- ffs.cytoSelect("options",{
375
- events:{
376
- change:function(cy,e){
377
- var dir = fds.cytoRadio("value");
378
- var f = data[dir][$(this).cytoSelect("value")];
379
- if (f!=null) switch (dir) {
380
- case "fontsquirrel":
381
- // Check if font has already been imported
382
- if (data.imported.length>0 && data.imported[f.family_urlname] != null) $('#font_import_button').addClass('active').html("Font Family Imported");
383
- else $('#font_import_button').removeClass('active').html("Import Font Family");
384
-
385
- break;
386
- case "googlewebfonts":
387
-
388
- break;
389
- }
390
- }
391
- }
392
- });
393
-
394
- // Font Import Button
395
- $('#font_import_button').css({"margin-top":10}).click(function(e){
396
- e.preventDefault();
397
- var $this = $(this);
398
- var f = data[fds.cytoRadio("value")][ffs.cytoSelect("value")];
399
- if (!$this.hasClass('active')) {
400
- // Import font
401
- $.cytoAjax("settings/fs_import.php",{family:f},function(data){
402
- $.cytoAjaxResponse('Font "'+f.family_name+'" has been imported successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
403
- $this.addClass('active').html("Font Family Imported");
404
- });
405
- } else {
406
- // Remove font
407
- if (confirm("Are you sure you want to remove this font from your fonts library?")) $.cytoAjax("settings/fs_remove.php",{family:f},function(data){
408
- $.cytoAjaxResponse('Font "'+f.family_name+'" has been removed successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
409
- $this.removeClass('active').html("Import Font Family");
410
- });
411
- }
412
- });
413
-
414
- // Individual font selects
415
- $('.font-preview').css({background:'white',display:'block',width:"100%","text-align":"center","padding-top":5,"border-top-left-radius":5,"border-top-right-radius":5,"box-shadow":"0px 0px 10px rgba(0,0,0,0.5)"});
416
- iffs.cytoSelect("options",{
417
- widget:{
418
- valueButton:{
419
- css:{
420
- 'border-top-left-radius':0,
421
- 'border-bottom-left-radius':0
422
- }
423
- },
424
- arrowButton:{
425
- css:{
426
- 'border-top-right-radius':0,
427
- 'border-bottom-right-radius':0
428
- }
429
- }
430
- },
431
- events:{
432
- change:function(cy,e){
433
- if (data.imported[$(this).cytoSelect("value")] == undefined) return;
434
- var subsets = {};
435
- var fs = $('select[name="'+$(this).attr('name').split("_").slice(0,-1).join("_")+'"]');
436
- $.each(data.imported[$(this).cytoSelect("value")],function(i,f){subsets[f.fontface_name] = f.fontface_name;});
437
- fs.cytoSelect("update",subsets).cytoSelect("value",$.Cytoplasm("vars","fonts.faces."+fs.data('style').toLowerCase()));
438
- }
439
- }
440
- });
441
-
442
- ifs.cytoSelect("options",{
443
- widget:{
444
- valueButton:{css:{'border-top-left-radius':0}},
445
- arrowButton:{css:{'border-top-right-radius':0}},
446
- optionsList:{
447
- li:{
448
- hover:function(cy,e){
449
- var $this = cy.widget.wrapper.element.children('select.cytoSelect');
450
- var fs = $('select[name="'+$this.attr('name')+'_family"]');
451
- $(this).css({background:$.Cytoplasm("vars","colors.global.accent")});
452
- if (data.imported.length>0) {
453
- var font = data.imported[fs.cytoSelect("value")][$this.cytoSelect("value")];
454
- cy.widget.wrapper.element.siblings('a.font-preview').attr('href',"http://www.fontsquirrel.com/fonts/"+font.family_urlname).children('img').attr("src",font.listing_image).show();
455
- } else {
456
-
457
- }
458
- }
459
- }
460
- }
461
- },
462
- events:{
463
- change:function(cy,e){
464
- var fs = $('select[name="'+$(this).attr('name')+'_family"]');
465
- if (data.imported>0) {
466
- var font = data.imported[fs.cytoSelect("value")][$(this).cytoSelect("value")];
467
- cy.widget.wrapper.element.siblings('a.font-preview').attr('href',"http://www.fontsquirrel.com/fonts/"+font.family_urlname).children('img').attr("src",font.listing_image).show();
468
- } else {
469
-
470
- }
471
- }
472
- }
473
- });
474
- });
475
-
476
286
  // Font size sliders
477
287
  $.each(['fonts_small','fonts_normal','fonts_huge'],function(i,prop){$('input[name='+prop+']').cytoSlider("options",{events:{change:function(cy){cy.widget.label.element.css("font-size",$(this).val());}}});});
478
288
 
@@ -1,13 +1,11 @@
1
- <h2 style="margin:0px;">Welcome to Cytoplasm's Management Interface!</h2>
2
- <p>This portion of Cytoplasm serves as a management tool for your website's graphical layout.</p>
1
+ <h2 style="margin:0px;">Cytoplasm Backstage</h2>
3
2
 
4
3
  <hr />
5
4
 
6
5
  <ul>
7
- <li><%=link_to("Tweak your current layout",cytoplasm_edit_url)%></li>
8
- <li><%=link_to("Save and publish your current layout as a theme","#")%></li>
9
- <li><%=link_to("Load up a layout theme","#")%></li>
10
- <li><%=link_to("Browse layout themes","#")%></li>
6
+ <li><%=link_to("General Settings",cytoplasm_general_settings_url)%></li>
7
+ <li><%=link_to("Layout Settings",cytoplasm_layout_settings_url)%></li>
8
+ <li><%=link_to("Colors Settings",cytoplasm_colors_settings_url)%></li>
11
9
  <li><%=link_to("Manage Fonts",cytoplasm_fonts_url)%></li>
12
10
  </ul>
13
11
 
@@ -0,0 +1,56 @@
1
+ <h2>Cytoplasm Layout Settings</h2>
2
+ <p>This interface generates a YAML file at config/initializers/cytoplasm.vars.yml.</p>
3
+
4
+ <form id="cytoplasm_settings_form" action="" method="post" enctype="multipart/form-data">
5
+ <table id="layout_settings_table" class="cytoTable">
6
+ <tr><td class='headercell' colspan=2><h3>General</h3></td></tr>
7
+ <tr>
8
+ <td class="labelcell">Layout Mode:</td>
9
+ <td>
10
+ <input type="radio" name="layout[mode]" value="fluid" data-label="Fluid" class="cytoRadio" />
11
+ <input type="radio" name="layout[mode]" value="boxed" data-label="Boxed" />
12
+ </td>
13
+ </tr>
14
+ <tr>
15
+ <td class="labelcell">Layout Padding:</td>
16
+ <td>
17
+ <input type="radio" name="layout[padding_mode]" value="all" data-label="All Sides" class="cytoRadio" checked="checked" />
18
+ <input type="radio" name="layout[padding_mode]" value="hv" data-label="Horizontal and Vertical" />
19
+ <input type="radio" name="layout[padding_mode]" value="sbs" data-label="Side by Side" />
20
+ <input type="hidden" name="layout[padding]" class="cytoSlider" value="20" data-max="200" data-unit="px" data-label="Pixels of padding for the layout" />
21
+ </td>
22
+ </tr>
23
+ <tr><td class='headercell' colspan=2><h3>Header</h3></td></tr>
24
+ <tr><td class='headercell' colspan=2><h3>Content</h3></td></tr>
25
+ <tr>
26
+ <td class='labelcell'>Margin:</td>
27
+ <td>
28
+ <input type="radio" name="layout_content_margin_mode" value="all" data-label="All Sides" class="cytoRadio" checked="checked" />
29
+ <input type="radio" name="layout_content_margin_mode" value="hv" data-label="Horizontal and Vertical" />
30
+ <input type="radio" name="layout_content_margin_mode" value="sbs" data-label="Side by Side" />
31
+ <input type="hidden" name="layout[content][margin]" class="cytoSlider" value="20" data-max="200" data-unit="px" data-label="Pixels of margin for the content" />
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td class='labelcell'>Padding:</td>
36
+ <td>
37
+ <input type="radio" name="layout[content][padding_mode]" value="all" data-label="All Sides" class="cytoRadio" checked="checked" />
38
+ <input type="radio" name="layout[content][padding_mode]" value="hv" data-label="Horizontal and Vertical" />
39
+ <input type="radio" name="layout[content][padding_mode]" value="sbs" data-label="Side by Side" />
40
+ <input type="hidden" name="layout[content][padding]" class="cytoSlider" value="20" data-max="200" data-unit="px" data-label="Pixels of padding for the content" />
41
+ </td>
42
+ </tr>
43
+ <tr><td class='headercell' colspan=2><h3>Footer</h3></td></tr>
44
+ <tr><td class='headercell' colspan=2><h3>Plugins</h3></td></tr>
45
+ </table>
46
+ </form>
47
+
48
+ <script type="text/javascript">
49
+ (function($){
50
+ $.Cytoplasm("ready",function(){
51
+ $('input[name="layout[content][margin_mode]"]').cytoRadio("options",{events:{change:function(){
52
+ console.log("changed!");
53
+ }}});
54
+ });
55
+ })(jQuery);
56
+ </script>