cytoplasm 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/cytoplasm/actions-circle-add-1.png +0 -0
- data/app/assets/images/cytoplasm/actions-circle-remove-1.png +0 -0
- data/app/assets/images/cytoplasm/artwork-paintroll.png +0 -0
- data/app/assets/images/cytoplasm/edition-delete-1.png +0 -0
- data/app/assets/images/cytoplasm/transparent_bg.jpg +0 -0
- data/app/assets/javascripts/cytoplasm/cytoColorPicker.js.erb +39 -29
- data/app/assets/javascripts/cytoplasm/cytoMenu.js.erb +173 -0
- data/app/assets/javascripts/cytoplasm/cytoSlider.js.erb +2 -0
- data/app/assets/javascripts/cytoplasm/cytoTable.js.erb +90 -7
- data/app/assets/javascripts/cytoplasm/cytoplasm.js.erb +36 -9
- data/app/assets/javascripts/cytoplasm/jquery.color-2.1.0.min.js +2 -0
- data/app/controllers/cytoplasm/settings_controller.rb +3 -2
- data/app/views/cytoplasm/fonts/_li.html.erb +39 -8
- data/app/views/cytoplasm/fonts/_style_list.html.erb +76 -37
- data/app/views/cytoplasm/settings/_colors.html.erb +78 -43
- data/app/views/cytoplasm/settings/colors.html.erb +5 -1
- data/app/views/cytoplasm/settings/general.html.erb +2 -5
- data/app/views/cytoplasm/settings/layout.html.erb +1 -1
- data/lib/cytoplasm.rb +23 -8
- data/lib/cytoplasm/version.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +16 -14
- data/test/dummy/config/cytoplasm-config.yml +33 -15
- data/test/dummy/log/development.log +82949 -0
- data/test/dummy/public/cytoplasm/cytoplasm.vars.less +23 -15
- data/test/dummy/public/fonts/enabled.yml +7 -1
- data/test/dummy/public/fonts/googlewebfonts.yml +1 -0
- data/test/dummy/tmp/cache/assets/C26/8F0/sprockets%2F3b5053120e76678a259691793a539bb4 +0 -0
- data/test/dummy/tmp/cache/assets/C80/300/sprockets%2F0097f55cbf6b44214787f422f41291d3 +0 -0
- data/test/dummy/tmp/cache/assets/C8F/0F0/sprockets%2F369f11075c8c5f939359cb5cb0569281 +0 -0
- data/test/dummy/tmp/cache/assets/CA8/E70/sprockets%2F5b16b7419ca6425b68262503ac627e4d +0 -0
- data/test/dummy/tmp/cache/assets/CB5/A90/sprockets%2F595675d0d782f6212f20570d6e4a42ff +0 -0
- data/test/dummy/tmp/cache/assets/CD4/490/sprockets%2F5609c0966d710286dad06a9ea4b42c11 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/900/sprockets%2Fc68606f026190266d8099ada290bbaa4 +0 -0
- data/test/dummy/tmp/cache/assets/CF3/120/sprockets%2Fe2b304b015ce82a222d634e7e544b0b3 +0 -0
- data/test/dummy/tmp/cache/assets/D03/6B0/sprockets%2Fd3cfc780201b87a3439e35c5236bb71a +0 -0
- data/test/dummy/tmp/cache/assets/D04/CC0/sprockets%2F1c7e3330365910fa51cb5f8a4a841c7e +0 -0
- data/test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe +0 -0
- data/test/dummy/tmp/cache/assets/D14/170/sprockets%2F40a7b83bb067eea7ce2c8394e1529287 +0 -0
- data/test/dummy/tmp/cache/assets/D15/CE0/sprockets%2Fa1310379a19df3c1796f2f67dcd5915d +0 -0
- data/test/dummy/tmp/cache/assets/D19/600/sprockets%2F345fa0a7855237e1a82e64874af9d7cc +0 -0
- data/test/dummy/tmp/cache/assets/D26/750/sprockets%2Fb70b009a7a0d9e252ef0b082d5029be0 +0 -0
- data/test/dummy/tmp/cache/assets/D48/1C0/sprockets%2F7853aece2d8335fce33830d0b774ed68 +0 -0
- data/test/dummy/tmp/cache/assets/D66/290/sprockets%2Fe0bc90b225127451839ed2d6eca6ecb6 +0 -0
- data/test/dummy/tmp/cache/assets/D69/0A0/sprockets%2Fe6c078d521b528e004f5dd673ddb2a6d +0 -0
- data/test/dummy/tmp/cache/assets/D78/840/sprockets%2F326ec6387a9d1b45ec2cdf7093b79f0e +0 -0
- data/test/dummy/tmp/cache/assets/D83/C70/sprockets%2Ff536f7a68e692747fca1d2fcd5c07f57 +0 -0
- data/test/dummy/tmp/cache/assets/D87/200/sprockets%2Fe0c1351fbd86032af3fd4b32c408acd4 +0 -0
- data/test/dummy/tmp/cache/assets/D8D/930/sprockets%2Ff9a03a5e1622ce69a7d82ab0be00e6c3 +0 -0
- data/test/dummy/tmp/cache/assets/D91/130/sprockets%2F928ea21100ee49aa47c9ef50fa17dc1a +0 -0
- data/test/dummy/tmp/cache/assets/D94/9D0/sprockets%2F9cda9ba002e091c71087d8dba7aca098 +0 -0
- data/test/dummy/tmp/cache/assets/D97/1C0/sprockets%2Faa0ccf8e63f048456ade02a39fa8571a +0 -0
- data/test/dummy/tmp/cache/assets/E00/880/sprockets%2Fecb876bb310c1a3e6fd534ece45c9ed9 +0 -0
- data/test/dummy/tmp/cache/assets/E00/9A0/sprockets%2Ff1ece46dc13852f9cb8d4ed0fcf1640e +0 -0
- data/test/dummy/tmp/cache/assets/E8C/480/sprockets%2Fdacb331ac961cf7b7cbc69abe8fb74dd +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- metadata +45 -5
- data/app/assets/javascripts/cytoplasm/jquery.color.js +0 -663
@@ -161,7 +161,7 @@ var Cytoplasm;
|
|
161
161
|
// Set variables
|
162
162
|
var boldweight = (vars.fonts.faces.bold==vars.fonts.faces.regular)?"bold":"normal";
|
163
163
|
var lightweight = (vars.fonts.faces.light==vars.fonts.faces.regular)?"lighter":"normal";
|
164
|
-
var styletag = "body{margin:0;height:100%;overflow-y:scroll}h1,h2,h3,h4,h5,h6{margin:20px 0}header{overflow:hidden;h1{margin:0;white-space:nowrap;cursor:pointer;display:inline;text-shadow:0 0 10px rgba(0,0,0,0.5)}#logo{z-index:1000}}nav{ul{padding:0;list-style:none;li{display:inline-block}}}
|
164
|
+
var styletag = "body{margin:0;height:100%;overflow-y:scroll}h1,h2,h3,h4,h5,h6{margin:20px 0}header{overflow:hidden;h1{margin:0;white-space:nowrap;cursor:pointer;display:inline;text-shadow:0 0 10px rgba(0,0,0,0.5)}#logo{z-index:1000}}nav{ul{padding:0;list-style:none;li{display:inline-block}}}section{min-height:400px;background:white;overflow:hidden;box-shadow:0 0 10px rgba(0,0,0,0.8);clear:both;&>:first-child{margin-top:0;padding-top:0}&>:last-child{margin-bottom:0;padding-bottom:0}}footer{overflow:hidden}table.cytoTable{width:100%;margin-bottom:15px;box-shadow:0 0 10px rgba(0,0,0,0.5);td{padding:10px;&.labelcell{width:100px}&>h1,&>h2,&>h3,&>h4,&>h5,&>h6{margin:0;padding:0}}}.cytoField{width:100%;border:1px solid #aaa;border-radius:5px;font-size:14px;box-shadow:inset 0 0 5px rgba(0,0,0,0.25);&[type=text],&[type=password],&[type=email]{height:28px;padding:0 7px}}textarea.cytoField{resize:none;height:200px;padding:7px}button,input[type=submit]{&.cytoButton{border-radius:5px;cursor:pointer;&.large{width:100%;height:50px}}}";
|
165
165
|
var styles = $.extend(true,{},{
|
166
166
|
body:{
|
167
167
|
background:vars.colors.global.background,
|
@@ -192,25 +192,46 @@ var Cytoplasm;
|
|
192
192
|
header:{
|
193
193
|
margin:vars.layout.header.margin,
|
194
194
|
padding:vars.layout.header.padding,
|
195
|
+
height:vars.layout.header.height,
|
196
|
+
background:vars.colors.header.background,
|
197
|
+
color:vars.colors.header.text,
|
195
198
|
'#logo':{
|
196
199
|
position:vars.layout.header.logo.position,
|
197
200
|
top:vars.layout.header.logo.y+10
|
198
201
|
},
|
199
202
|
h1:{
|
200
|
-
color:"contrast("+vars.colors.
|
203
|
+
color:"contrast("+vars.colors.header.text+",black,white)",
|
201
204
|
"&:hover":{
|
202
205
|
color:vars.colors.global.accent
|
203
206
|
}
|
204
207
|
}
|
205
208
|
},
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
+
section:{
|
210
|
+
background:vars.colors.section.background,
|
211
|
+
color:vars.colors.section.text,
|
212
|
+
margin:vars.layout.section.margin,
|
213
|
+
padding:vars.layout.section.padding
|
209
214
|
},
|
210
|
-
|
215
|
+
footer:{
|
216
|
+
background:vars.colors.footer.background,
|
217
|
+
color:vars.colors.footer.text,
|
211
218
|
margin:vars.layout.footer.margin,
|
212
219
|
padding:vars.layout.footer.padding
|
213
220
|
},
|
221
|
+
a:{
|
222
|
+
'&:link':{
|
223
|
+
color:vars.colors.links.unvisited.text
|
224
|
+
},
|
225
|
+
'&:visited':{
|
226
|
+
color:vars.colors.links.visited.text
|
227
|
+
},
|
228
|
+
'&:hover':{
|
229
|
+
color:vars.colors.links.hover.text
|
230
|
+
},
|
231
|
+
'&:active':{
|
232
|
+
color:vars.colors.links.active.text
|
233
|
+
}
|
234
|
+
},
|
214
235
|
'table.cytoTable':{
|
215
236
|
background:vars.colors.plugins.cytoTable.background,
|
216
237
|
table:{
|
@@ -218,7 +239,7 @@ var Cytoplasm;
|
|
218
239
|
},
|
219
240
|
td:{
|
220
241
|
border:vars.colors.plugins.cytoTable.border,
|
221
|
-
"
|
242
|
+
"&[data-type=label]":{"font-size":vars.fonts.sizes.small}
|
222
243
|
}
|
223
244
|
},
|
224
245
|
'.cytoField':{"font-family":vars.fonts.faces.regular},
|
@@ -230,6 +251,12 @@ var Cytoplasm;
|
|
230
251
|
background:reverseGradient(vars.colors.plugins.cytoButton.background),
|
231
252
|
"box-shadow":vars.layout.plugins.cytoButton.shadow
|
232
253
|
}
|
254
|
+
},
|
255
|
+
'.cytoColorPicker-wrapper':{
|
256
|
+
'.ui-slider[data-attr=hue]':{
|
257
|
+
background:"linear-gradient(to right,#ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)",
|
258
|
+
"box-shadow":"inset 0px 0px 5px hsla(0,0%,0%,0.5)"
|
259
|
+
}
|
233
260
|
}
|
234
261
|
},userstyles);
|
235
262
|
|
@@ -240,7 +267,7 @@ var Cytoplasm;
|
|
240
267
|
var hRange = huge - normal;
|
241
268
|
$.each([1,2,3,4,5,6],function(i,num){
|
242
269
|
if (verbose) console.log("----- H"+num+" -----");
|
243
|
-
var factor = Math.pow(vars.fonts.
|
270
|
+
var factor = Math.pow(vars.fonts.heading_factor,i);
|
244
271
|
if (verbose) console.log("Factor: "+factor);
|
245
272
|
var size = parseInt(vars.fonts.sizes.normal) + (hRange/factor);
|
246
273
|
if (verbose) console.log("Size: "+size);
|
@@ -298,7 +325,7 @@ var Cytoplasm;
|
|
298
325
|
$.Cytoplasm = function(method){
|
299
326
|
if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
|
300
327
|
else if (typeof method == 'object' || !method) return methods.init.apply(this,arguments);
|
301
|
-
else $.error('Method ' + method + ' does not exist on
|
328
|
+
else $.error('Method ' + method + ' does not exist on $.Cytoplasm!');
|
302
329
|
};
|
303
330
|
|
304
331
|
$.Cytoplasm();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! jQuery Color v@2.1.0 http://github.com/jquery/jquery-color | jquery.org/license */
|
2
|
+
(function(a,b){function m(a,b,c){var d=h[b.type]||{};return a==null?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a)}function n(b){var c=f(),d=c._rgba=[];return b=b.toLowerCase(),l(e,function(a,e){var f,h=e.re.exec(b),i=h&&e.parse(h),j=e.space||"rgba";if(i)return f=c[j](i),c[g[j].cache]=f[g[j].cache],d=c._rgba=f._rgba,!1}),d.length?(d.join()==="0,0,0,0"&&a.extend(d,k.transparent),c):k[b]}function o(a,b,c){return c=(c+1)%1,c*6<1?a+(b-a)*c*6:c*2<1?b:c*3<2?a+(b-a)*(2/3-c)*6:a}var c="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1]*2.55,a[2]*2.55,a[3]*2.55,a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e)},g={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=f.support={},j=a("<p>")[0],k,l=a.each;j.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=j.style.backgroundColor.indexOf("rgba")>-1,l(g,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),f.fn=a.extend(f.prototype,{parse:function(c,d,e,h){if(c===b)return this._rgba=[null,null,null,null],this;if(c.jquery||c.nodeType)c=a(c).css(d),d=b;var i=this,j=a.type(c),o=this._rgba=[],p;d!==b&&(c=[c,d,e,h],j="array");if(j==="string")return this.parse(n(c)||k._default);if(j==="array")return l(g.rgba.props,function(a,b){o[b.idx]=m(c[b.idx],b)}),this;if(j==="object")return c instanceof f?l(g,function(a,b){c[b.cache]&&(i[b.cache]=c[b.cache].slice())}):l(g,function(b,d){var e=d.cache;l(d.props,function(a,b){if(!i[e]&&d.to){if(a==="alpha"||c[a]==null)return;i[e]=d.to(i._rgba)}i[e][b.idx]=m(c[a],b,!0)}),i[e]&&a.inArray(null,i[e].slice(0,3))<0&&(i[e][3]=1,d.from&&(i._rgba=d.from(i[e])))}),this},is:function(a){var b=f(a),c=!0,d=this;return l(g,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],l(e.props,function(a,b){if(g[b.idx]!=null)return c=g[b.idx]===f[b.idx],c})),c}),c},_space:function(){var a=[],b=this;return l(g,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var c=f(a),d=c._space(),e=g[d],i=this.alpha()===0?f("transparent"):this,j=i[e.cache]||e.to(i._rgba),k=j.slice();return c=c[e.cache],l(e.props,function(a,d){var e=d.idx,f=j[e],g=c[e],i=h[d.type]||{};if(g===null)return;f===null?k[e]=g:(i.mod&&(g-f>i.mod/2?f+=i.mod:f-g>i.mod/2&&(f-=i.mod)),k[e]=m((g-f)*b+f,d))}),this[d](k)},blend:function(b){if(this._rgba[3]===1)return this;var c=this._rgba.slice(),d=c.pop(),e=f(b)._rgba;return f(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return a==null?b>2?1:0:a});return c[3]===1&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return a==null&&(a=b>2?1:0),b&&b<3&&(a=Math.round(a*100)+"%"),a});return c[3]===1&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(d*255)),"#"+a.map(c,function(a,b){return a=(a||0).toString(16),a.length===1?"0"+a:a}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,g.hsla.to=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,e=a[3],f=Math.max(b,c,d),g=Math.min(b,c,d),h=f-g,i=f+g,j=i*.5,k,l;return g===f?k=0:b===f?k=60*(c-d)/h+360:c===f?k=60*(d-b)/h+120:k=60*(b-c)/h+240,j===0||j===1?l=j:j<=.5?l=h/i:l=h/(2-i),[Math.round(k)%360,l,j,e==null?1:e]},g.hsla.from=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],e=a[3],f=d<=.5?d*(1+c):d+c-d*c,g=2*d-f,h,i,j;return[Math.round(o(g,f,b+1/3)*255),Math.round(o(g,f,b)*255),Math.round(o(g,f,b-1/3)*255),e]},l(g,function(c,e){var g=e.props,h=e.cache,i=e.to,j=e.from;f.fn[c]=function(c){i&&!this[h]&&(this[h]=i(this._rgba));if(c===b)return this[h].slice();var d,e=a.type(c),k=e==="array"||e==="object"?c:arguments,n=this[h].slice();return l(g,function(a,b){var c=k[e==="object"?a:b.idx];c==null&&(c=n[b.idx]),n[b.idx]=m(c,b)}),j?(d=f(j(n)),d[h]=n,d):f(n)},l(g,function(b,e){if(f.fn[b])return;f.fn[b]=function(f){var g=a.type(f),h=b==="alpha"?this._hsla?"hsla":"rgba":c,i=this[h](),j=i[e.idx],k;return g==="undefined"?j:(g==="function"&&(f=f.call(this,j),g=a.type(f)),f==null&&e.empty?this:(g==="string"&&(k=d.exec(f),k&&(f=j+parseFloat(k[2])*(k[1]==="+"?1:-1))),i[e.idx]=f,this[h](i)))}})}),f.hook=function(b){var c=b.split(" ");l(c,function(b,c){a.cssHooks[c]={set:function(b,d){var e,g,h="";if(a.type(d)!=="string"||(e=n(d))){d=f(e||d);if(!i.rgba&&d._rgba[3]!==1){g=c==="backgroundColor"?b.parentNode:b;while((h===""||h==="transparent")&&g&&g.style)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(j){}d=d.blend(h&&h!=="transparent"?h:"_default")}d=d.toRgbaString()}try{b.style[c]=d}catch(d){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=f(b.elem,c),b.end=f(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},f.hook(c),a.cssHooks.borderColor={expand:function(a){var b={};return l(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},k=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery);
|
@@ -22,8 +22,9 @@ module Cytoplasm
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def update
|
25
|
-
|
26
|
-
|
25
|
+
conf = params.except(":action",":controller")
|
26
|
+
Cytoplasm.save_config(conf)
|
27
|
+
redirect_to cytoplasm_settings_url
|
27
28
|
end
|
28
29
|
|
29
30
|
def fetch_vars
|
@@ -1,7 +1,10 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
f["variants"] = f["familyinfo"] if dir == "fontsquirrel"
|
3
|
+
enabled = Cytoplasm::FontsController.is_enabled?(dir,fam)
|
4
|
+
%>
|
5
|
+
<li data-family="<%=fam%>" data-directory="<%=dir%>" data-uid="<%=uid = Cytoplasm.generate_uid()%>" style="padding:0px;list-style:none;margin:0px 0px 15px;">
|
6
|
+
<table class="cytoTable" style="margin:0px;">
|
7
|
+
<tr><td data-type="header" data-tag="h2"><%=link_to(fam,cytoplasm_show_font_url(dir,fam))%></td></tr>
|
5
8
|
<% unless f["variants"].nil? or f["variants"].empty? %><% f["variants"].each do |v| %>
|
6
9
|
<tr>
|
7
10
|
<% if dir=="fontsquirrel" %>
|
@@ -11,13 +14,19 @@
|
|
11
14
|
<td class="labelcell"><%=v%>:</td>
|
12
15
|
<td style="background:white;text-align:center;"><span class="gwf-preview" style="font-family:'<%=fam%>';font-size:48px;font-weight:<%=v%>;">AaBbCcDdEeFfGgHhIiJjKk</span></td>
|
13
16
|
<% end %>
|
17
|
+
<td class="iconcell"><%=image_tag("cytoplasm/actions-circle-"+((!enabled)?"add":"remove")+"-1.png")%></td>
|
18
|
+
<td class="iconcell"><%=image_tag("cytoplasm/artwork-paintroll.png")%></td>
|
19
|
+
<td class="iconcell"><%=image_tag("cytoplasm/edition-delete-1.png")%></td>
|
14
20
|
</tr>
|
15
21
|
<% end end %>
|
16
22
|
<tr>
|
17
|
-
<td
|
23
|
+
<td data-type="info">
|
18
24
|
<%=link_to("Details",((dir=="fontsquirrel")?"http://www.fontsquirrel.com/fonts/":"http://www.google.com/webfonts/specimen/")+fam,:class => "font_details",:target => "_blank")%> |
|
19
|
-
|
20
|
-
|
25
|
+
<% if enabled %>
|
26
|
+
<%=link_to("Preview","#",:class => "font_preview")%> |
|
27
|
+
<%=link_to("Set as...","#",:class => "font_set")%> |
|
28
|
+
<% end %>
|
29
|
+
<%=link_to((enabled)?"Disable":"Enable","#",:class => "font_enable_disable")%> |
|
21
30
|
<%=link_to("Uninstall","#",:class => "font_uninstall")%>
|
22
31
|
</td>
|
23
32
|
</tr>
|
@@ -28,6 +37,28 @@
|
|
28
37
|
(function($){
|
29
38
|
$.Cytoplasm("ready",function(){
|
30
39
|
|
40
|
+
$('[data-uid="<%=uid%>"] .font_preview').click(function(e){
|
41
|
+
e.preventDefault();
|
42
|
+
|
43
|
+
});
|
44
|
+
|
45
|
+
$('[data-uid="<%=uid%>"] .font_set').click(function(e){
|
46
|
+
e.preventDefault();
|
47
|
+
var opts = {};
|
48
|
+
<% Cytoplasm.vars()[:fonts][:faces].each do |style,currentFace| %>
|
49
|
+
$
|
50
|
+
opts["<%=style.capitalize%> (<%=currentFace%>)"] = function(e){
|
51
|
+
alert("<%=style%>");
|
52
|
+
/*$.post("<%=cytoplasm_update_url%>",{style:"<%=style%>"},function(data){
|
53
|
+
$.cytoAjaxResponse("");
|
54
|
+
});*/
|
55
|
+
};
|
56
|
+
<% end %>
|
57
|
+
$(this).CytoMenu({
|
58
|
+
options:opts
|
59
|
+
});
|
60
|
+
});
|
61
|
+
|
31
62
|
$('[data-uid="<%=uid%>"] .font_enable_disable').click(function(e){
|
32
63
|
e.preventDefault();
|
33
64
|
var $this = $(this);
|
@@ -48,7 +79,7 @@
|
|
48
79
|
} else return false;
|
49
80
|
});
|
50
81
|
|
51
|
-
$('.font_uninstall').click(function(e){
|
82
|
+
$('[data-uid="<%=uid%>"] .font_uninstall').click(function(e){
|
52
83
|
e.preventDefault();
|
53
84
|
var $this = $(this);
|
54
85
|
var li = $this.parents("li");
|
@@ -1,45 +1,84 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
<td class='
|
8
|
-
<td>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
1
|
+
<%
|
2
|
+
styles = Cytoplasm.vars()[:fonts][:faces].keys
|
3
|
+
sizes = Cytoplasm.vars()[:fonts][:sizes]
|
4
|
+
%>
|
5
|
+
<form id="cytoplasm_fonts_settings_form" action="<%=cytoplasm_update_url%>" method="post">
|
6
|
+
<table class="cytoTable">
|
7
|
+
<tr><td class='headercell' colspan=2><h3>Typography Settings</h3></td></tr>
|
8
|
+
<tr><td class='infocell' colspan=2>Select individual fonts below if desired.</td></tr>
|
9
|
+
|
10
|
+
<tr><td class='headercell' colspan=2><h4>Font Faces</h4></td></tr>
|
11
|
+
<% styles.each do |style| %>
|
12
|
+
<tr>
|
13
|
+
<td class='labelcell'><%=style.capitalize%>:</td>
|
14
|
+
<td>
|
15
|
+
<a href="#" target="_blank" class="font-preview"><img src="" style="display:none" /></a>
|
16
|
+
<select data-exclude="true" class="ind_font_fam_select cytoSelect">
|
17
|
+
<option value="Arial, Helvetica, sans-serif">Arial</option>
|
18
|
+
<option value="Arial Black, Gadget, sans-serif">Arial Black</option>
|
19
|
+
<option value="Comic Sans MS, cursive">Comic Sans MS</option>
|
20
|
+
<option value="Courier New, monospace">Courier New</option>
|
21
|
+
<option value="Georgia, serif">Georgia</option>
|
22
|
+
<option value="Impact, Charcoal">Impact</option>
|
23
|
+
<option value="Lucida Console, Monaco, monospace">Lucida Console</option>
|
24
|
+
<option value="Lucida Sans Unicode, Lucida Grande, sans-serif">Lucida Sans Unicode</option>
|
25
|
+
<option value="Palatino Linotype, Book Antiqua, Palatino, serif">Palatino Linotype</option>
|
26
|
+
<option value="Tahoma, Geneva, sans-serif">Tahoma</option>
|
27
|
+
<option value="Times New Roman, Times, serif">Times New Roman</option>
|
28
|
+
<option value="Trebuchet MS, sans-serif">Trebuchet MS</option>
|
29
|
+
<option value="Verdana, Geneva, sans-serif">Verdana</option>
|
30
|
+
</select>
|
31
|
+
<select name="fonts[faces][<%=style%>]" id="fontselect_<%=style%>" class="ind_font_select cytoSelect" data-style="<%=style.capitalize%>"></select>
|
32
|
+
</td>
|
33
|
+
</tr>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<tr><td class='headercell' colspan=2><h4>Sizing</h4></td></tr>
|
37
|
+
<tr>
|
38
|
+
<td class='labelcell'>Font Sizes:</td>
|
39
|
+
<td>
|
40
|
+
<% sizes.each do |size,value| %>
|
41
|
+
<input type="hidden" name="fonts[sizes][<%=size%>]" class="cytoSlider" value="<%=value%>" data-label="<%=size.capitalize%>" data-unit="px" />
|
42
|
+
<% end %>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
<tr>
|
46
|
+
<td class="labelcell">Other:</td>
|
47
|
+
<td>
|
48
|
+
<input type="hidden" name="fonts[heading_factor]" class="cytoSlider" data-label="Heading Factor" data-max="5" data-step="0.01" />
|
49
|
+
<p style="font-size:<%=Cytoplasm.vars("fonts.sizes.small")%>">The <b>Heading Factor</b> is used to calculate the font sizes for h1-h6 tags. H1 tags use the "Huge" size above; h6 tags use the "Normal" size. The higher you set the Heading Factor, the quicker the descent from "Huge" to "Normal" for the font sizes of the remaining heading tags.</p>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
|
53
|
+
<tr><td colspan=2><button class="cytoButton large">Save Settings</button></td></tr>
|
54
|
+
</table>
|
55
|
+
</form>
|
38
56
|
|
39
57
|
<script type="text/javascript">
|
40
58
|
(function($){
|
41
59
|
$.Cytoplasm("ready",function(){
|
60
|
+
var getInput = function(key){return $('input[name="'+key+'"]');};
|
61
|
+
var layoutFontUpdate = function(){
|
62
|
+
$.Cytoplasm("setStyles",{
|
63
|
+
"body":{
|
64
|
+
"font-family":getInput("fonts[faces][regular]"),
|
65
|
+
"font-size":getInput("fonts[sizes][normal]")
|
66
|
+
}
|
67
|
+
});
|
68
|
+
};
|
69
|
+
|
70
|
+
// Font selects
|
71
|
+
<% styles.each do |face| %>
|
72
|
+
|
73
|
+
<% end %>
|
74
|
+
|
75
|
+
// Font size sliders
|
76
|
+
<% sizes.keys.each do |size| %>
|
77
|
+
$('input[name="fonts[sizes][<%=size%>]"]').cytoSlider("options",{events:{change:function(cy){cy.widget.label.element.css("font-size",$(this).val());}}});
|
78
|
+
<% end %>
|
42
79
|
|
80
|
+
// Heading Factor slider
|
81
|
+
$('input[name="fonts[heading_factor]"]').cytoSlider("value",$.Cytoplasm("vars","fonts.heading_factor"));
|
43
82
|
});
|
44
83
|
})(jQuery);
|
45
84
|
</script>
|
@@ -1,62 +1,97 @@
|
|
1
|
+
<%
|
2
|
+
containers = {'header' => 'Header', 'section' => 'Content Section', 'footer' => 'Footer'}
|
3
|
+
links = ['unvisited','visited','hover','active']
|
4
|
+
%>
|
1
5
|
<table class="cytoTable">
|
2
6
|
<tr><td class='headercell' colspan=2><h3>Color Palette</h3></td></tr>
|
3
|
-
<% ['
|
7
|
+
<% ['background','text','accent'].each do |color| %>
|
4
8
|
<tr>
|
5
|
-
<td class='labelcell'><%=color%> Color:</td>
|
6
|
-
<td><input type="colorpicker" name="colors[global][<%=color
|
9
|
+
<td class='labelcell'><%=color.capitalize%> Color:</td>
|
10
|
+
<td><input type="colorpicker" name="colors[global][<%=color%>]" value="<%=Cytoplasm.vars("colors.global."+color)%>" /></td>
|
7
11
|
</tr>
|
8
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| %>
|
27
|
+
<tr>
|
28
|
+
<td class="labelcell"><%=link.capitalize%>:</td>
|
29
|
+
<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")%>" />
|
32
|
+
</td>
|
33
|
+
</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 %>
|
9
47
|
</table>
|
10
48
|
|
11
49
|
<script type="text/javascript">
|
12
50
|
(function($){
|
13
51
|
$.Cytoplasm("ready",function(){
|
14
52
|
// Color Pickers
|
15
|
-
var
|
16
|
-
if (color==null || h==null) return color;
|
17
|
-
if (s==null) s=0;
|
18
|
-
if (l==null) l=0;
|
19
|
-
if (a==null) a=1;
|
20
|
-
color = color.hue(color.hue()+h).saturation(color.saturation()+s).lightness(color.lightness()+l).alpha(a);
|
21
|
-
return color.toHslaString();
|
22
|
-
};
|
23
|
-
var percentToDecimal = function(percent) {return parseInt(percent)/100;};
|
53
|
+
var getVal = function(key){return $('input[name="'+key+'"]').cytoColorPicker("value");};
|
24
54
|
var layoutColorUpdate = function() {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
"
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
55
|
+
$.Cytoplasm("setStyles",{
|
56
|
+
"body":{
|
57
|
+
"background":getVal("colors[global][background]"),
|
58
|
+
color:getVal("colors[global][text]")
|
59
|
+
},
|
60
|
+
"header":{
|
61
|
+
"background":getVal("colors[header][background]"),
|
62
|
+
color:getVal("colors[header][text]")
|
63
|
+
},
|
64
|
+
"section":{
|
65
|
+
"background":getVal("colors[section][background]"),
|
66
|
+
color:getVal("colors[section][text]")
|
67
|
+
},
|
68
|
+
"footer":{
|
69
|
+
"background":getVal("colors[footer][background]"),
|
70
|
+
color:getVal("colors[footer][text]")
|
71
|
+
},
|
72
|
+
"a":{
|
73
|
+
"&:link":{
|
74
|
+
color:getVal("colors[link][unvisited][text]")
|
75
|
+
},
|
76
|
+
"&:visited":{
|
77
|
+
color:getVal("colors[link][visited][text]")
|
78
|
+
},
|
79
|
+
"&:hover":{
|
80
|
+
color:getVal("colors[link][hover][text]")
|
81
|
+
},
|
82
|
+
"&:active":{
|
83
|
+
color:getVal("colors[link][active][text]")
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
50
87
|
};
|
51
88
|
|
52
|
-
$('input[
|
53
|
-
$('input[name="colors[global][text]"]').cytoColorPicker("value",$.Cytoplasm("vars","colors.global.text"));
|
54
|
-
$('input[name="colors[global][accent]"]').cytoColorPicker("value",$.Cytoplasm("vars","colors.global.accent"));
|
55
|
-
|
56
|
-
$('input[type=colorpicker]').cytoColorPicker("options",{events:{change:layoutColorUpdate}});
|
89
|
+
$('input[type=colorpicker]').cytoColorPicker({events:{change:layoutColorUpdate}});
|
57
90
|
|
58
91
|
// Set up sliders
|
59
|
-
|
92
|
+
|
93
|
+
$("input[name="+['colors_table_background_offset','colors_table_opacity_offset','colors_table_border_offset','button_gradient_amount','button_border_offset'].join("],input[name=")+"]").cytoSlider("options",{events:{change:layoutColorUpdate}});
|
94
|
+
|
60
95
|
});
|
61
96
|
})(jQuery);
|
62
97
|
</script>
|