cytoplasm 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +38 -0
- data/app/assets/images/cytoplasm/triangle-medium-circle-1.png +0 -0
- data/app/assets/images/cytoplasm/triangle-medium-circle-2.png +0 -0
- data/app/assets/images/cytoplasm/triangle-medium-circle-3.png +0 -0
- data/app/assets/images/cytoplasm/triangle-medium-circle-4.png +0 -0
- data/app/assets/javascripts/cytoplasm/cytoAjax.js.erb +53 -0
- data/app/assets/javascripts/cytoplasm/cytoColorPicker.js.erb +204 -0
- data/app/assets/javascripts/cytoplasm/cytoRadio.js.erb +210 -0
- data/app/assets/javascripts/cytoplasm/cytoSelect.js.erb +414 -0
- data/app/assets/javascripts/cytoplasm/cytoSlider.js.erb +170 -0
- data/app/assets/javascripts/cytoplasm/cytoTable.js.erb +48 -0
- data/app/assets/javascripts/cytoplasm/cytoUpload.js.erb +200 -0
- data/app/assets/javascripts/cytoplasm/cytoplasm.js.erb +220 -0
- data/app/assets/javascripts/cytoplasm/jquery.ba-throttle-debounce.min.js +9 -0
- data/app/assets/javascripts/cytoplasm/jquery.color.js +663 -0
- data/app/assets/javascripts/cytoplasm/less-1.3.1.min.js +9 -0
- data/app/assets/stylesheets/cytoplasm/cytoplasm.less +113 -0
- data/app/controllers/cytoplasm/fonts_controller.rb +46 -0
- data/app/controllers/cytoplasm/settings_controller.rb +34 -0
- data/app/views/cytoplasm/settings/edit.html.erb +529 -0
- data/app/views/cytoplasm/settings/index.html.erb +18 -0
- data/config/routes.rb +6 -0
- data/lib/cytoplasm.rb +317 -0
- data/lib/cytoplasm/ajax.rb +34 -0
- data/lib/cytoplasm/railtie.rb +12 -0
- data/lib/cytoplasm/version.rb +3 -0
- data/lib/tasks/cytoplasm_tasks.rake +4 -0
- data/test/cytoplasm_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/about.js +2 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/demos.js +2 -0
- data/test/dummy/app/assets/javascripts/docs.js +2 -0
- data/test/dummy/app/assets/javascripts/downloads.js +2 -0
- data/test/dummy/app/assets/javascripts/home.js +2 -0
- data/test/dummy/app/assets/stylesheets/about.css +4 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/demos.css +4 -0
- data/test/dummy/app/assets/stylesheets/docs.css +4 -0
- data/test/dummy/app/assets/stylesheets/downloads.css +4 -0
- data/test/dummy/app/assets/stylesheets/home.css +4 -0
- data/test/dummy/app/controllers/about_controller.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/demos_controller.rb +4 -0
- data/test/dummy/app/controllers/docs_controller.rb +5 -0
- data/test/dummy/app/controllers/downloads_controller.rb +4 -0
- data/test/dummy/app/controllers/home_controller.rb +7 -0
- data/test/dummy/app/helpers/about_helper.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/demos_helper.rb +2 -0
- data/test/dummy/app/helpers/docs_helper.rb +2 -0
- data/test/dummy/app/helpers/downloads_helper.rb +2 -0
- data/test/dummy/app/helpers/home_helper.rb +2 -0
- data/test/dummy/app/views/about/index.html.erb +2 -0
- data/test/dummy/app/views/demos/index.html.erb +15 -0
- data/test/dummy/app/views/docs/index.html.erb +15 -0
- data/test/dummy/app/views/downloads/index.html.erb +60 -0
- data/test/dummy/app/views/home/index.html.erb +74 -0
- data/test/dummy/app/views/layouts/application.html.erb +30 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cytoplasm.vars.yml +4 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +65 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +178434 -0
- data/test/dummy/log/production.log +4 -0
- data/test/dummy/log/test.log +43 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/cytoplasm/cytoplasm.vars.less +36 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/functional/about_controller_test.rb +9 -0
- data/test/dummy/test/functional/demos_controller_test.rb +9 -0
- data/test/dummy/test/functional/docs_controller_test.rb +7 -0
- data/test/dummy/test/functional/downloads_controller_test.rb +9 -0
- data/test/dummy/test/functional/home_controller_test.rb +9 -0
- data/test/dummy/test/unit/helpers/about_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/demos_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/docs_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/downloads_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/home_helper_test.rb +4 -0
- data/test/dummy/tmp/cache/assets/C23/A50/sprockets%2F1011830ce123d00a75be4330f2721412 +0 -0
- data/test/dummy/tmp/cache/assets/C2E/4E0/sprockets%2F5b29288e435665a224409e7d76530c95 +0 -0
- data/test/dummy/tmp/cache/assets/C75/590/sprockets%2Fc3abe8a0059292e1e3818278c0434027 +0 -0
- data/test/dummy/tmp/cache/assets/C77/C20/sprockets%2F165a39476f3fa731c0af49432141049c +0 -0
- data/test/dummy/tmp/cache/assets/C87/580/sprockets%2Fd904f7e82971fdde744127c702222195 +0 -0
- data/test/dummy/tmp/cache/assets/C8F/0F0/sprockets%2F369f11075c8c5f939359cb5cb0569281 +0 -0
- data/test/dummy/tmp/cache/assets/CA0/B40/sprockets%2F26961c657dc345435242accb433d260a +0 -0
- data/test/dummy/tmp/cache/assets/CA3/4B0/sprockets%2Fb78b7754bf248ba091802070be5c1630 +0 -0
- data/test/dummy/tmp/cache/assets/CA7/8F0/sprockets%2F901b96894219d63a767e8898f73d4ce7 +0 -0
- data/test/dummy/tmp/cache/assets/CAC/280/sprockets%2F408a235a236b0a3aa1302733211db5ba +0 -0
- data/test/dummy/tmp/cache/assets/CAE/FD0/sprockets%2F3bb22e4d409072c2278c1771893ec19e +0 -0
- data/test/dummy/tmp/cache/assets/CB2/AD0/sprockets%2F0c26131d87e0691ba9904e46ff5820b9 +0 -0
- data/test/dummy/tmp/cache/assets/CB8/330/sprockets%2F8d9120752c9f38f7a5e164395e5d0c04 +0 -0
- data/test/dummy/tmp/cache/assets/CBA/320/sprockets%2Fa34641007e856c6bd67567e2ac8668c4 +0 -0
- data/test/dummy/tmp/cache/assets/CCE/F60/sprockets%2F37d1a6c1a8d398c4404b1b00076912fd +0 -0
- data/test/dummy/tmp/cache/assets/CD7/990/sprockets%2F55411442048c5a69b45be06da29ee62c +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/900/sprockets%2Fc68606f026190266d8099ada290bbaa4 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e +0 -0
- data/test/dummy/tmp/cache/assets/CE1/E60/sprockets%2F08ae5c39217fa93841884cfcb0037c46 +0 -0
- data/test/dummy/tmp/cache/assets/CE2/AE0/sprockets%2F79562f7c45761a5d0dba9361d11ae594 +0 -0
- data/test/dummy/tmp/cache/assets/CE3/080/sprockets%2F7d4d7689d6fa8236f0b4848c03ba1215 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/530/sprockets%2F70521f5a32e550f6da0d76e896c7183e +0 -0
- data/test/dummy/tmp/cache/assets/CE5/D30/sprockets%2F8c9834a63b25a66203918a75ff56e2ac +0 -0
- data/test/dummy/tmp/cache/assets/CEE/7F0/sprockets%2F8b32778387c589166e26a7e5a6aa4cc3 +0 -0
- data/test/dummy/tmp/cache/assets/CF3/120/sprockets%2Fe2b304b015ce82a222d634e7e544b0b3 +0 -0
- data/test/dummy/tmp/cache/assets/CF7/ED0/sprockets%2F8061089f9dc8af8cc6353949d9b9d212 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683 +0 -0
- data/test/dummy/tmp/cache/assets/D03/6B0/sprockets%2Fd3cfc780201b87a3439e35c5236bb71a +0 -0
- data/test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c +0 -0
- data/test/dummy/tmp/cache/assets/D06/7A0/sprockets%2Fa46b76e739460d2691f4121ffa8a0ca0 +0 -0
- data/test/dummy/tmp/cache/assets/D0D/A10/sprockets%2F5c22f257a7abbc8e5720b17433657f6d +0 -0
- data/test/dummy/tmp/cache/assets/D0E/4A0/sprockets%2F6b27287928ba630c1b25dfa80ee18b48 +0 -0
- data/test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe +0 -0
- data/test/dummy/tmp/cache/assets/D12/010/sprockets%2F8067431ced3f34f1c97d34c3b4fb7049 +0 -0
- data/test/dummy/tmp/cache/assets/D12/1E0/sprockets%2Fba248329196c372b79d1f4c4f2a771bf +0 -0
- data/test/dummy/tmp/cache/assets/D14/170/sprockets%2F40a7b83bb067eea7ce2c8394e1529287 +0 -0
- data/test/dummy/tmp/cache/assets/D15/8E0/sprockets%2F4752afcb2967724e7e47b58b200d8ed2 +0 -0
- data/test/dummy/tmp/cache/assets/D15/CE0/sprockets%2Fa1310379a19df3c1796f2f67dcd5915d +0 -0
- data/test/dummy/tmp/cache/assets/D21/A50/sprockets%2Feb094bfe70c49891ce65c0178d88d904 +0 -0
- data/test/dummy/tmp/cache/assets/D2D/E60/sprockets%2F34ec37e4221a9a127bf1de1ee52951b0 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D47/930/sprockets%2F1a738430fd705a9dddde85a18dd29782 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D50/750/sprockets%2F7fbcc321810c8f493f86364fee480ed9 +0 -0
- data/test/dummy/tmp/cache/assets/D52/430/sprockets%2F6ada07f0c9869f9f35b05fa0988dc717 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D60/2A0/sprockets%2Ff1857b8a367fbae328221040cfcb2f1c +0 -0
- data/test/dummy/tmp/cache/assets/D65/180/sprockets%2F346621e7334bd914afc87bc6a9d1bc0a +0 -0
- data/test/dummy/tmp/cache/assets/D65/F10/sprockets%2F0a60d2fd5c544ea66af4d382b5e3d147 +0 -0
- data/test/dummy/tmp/cache/assets/D68/A20/sprockets%2F8b8272d3eaf9323f1c34114cbcbf56f3 +0 -0
- data/test/dummy/tmp/cache/assets/D69/0A0/sprockets%2Fe6c078d521b528e004f5dd673ddb2a6d +0 -0
- data/test/dummy/tmp/cache/assets/D69/0B0/sprockets%2Fb9e3ae8763ce66c2090d9413bdd400fa +0 -0
- data/test/dummy/tmp/cache/assets/D6E/3E0/sprockets%2F1be4cbdc9c19703c546405f087aee92d +0 -0
- data/test/dummy/tmp/cache/assets/D73/5F0/sprockets%2F6aee922214ffea56b31595f1a5ed8c92 +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/C40/sprockets%2F9dcd7a6999affe28e91e514cee079016 +0 -0
- data/test/dummy/tmp/cache/assets/D88/700/sprockets%2Fe13c6f31271a8ac23e63ef0a118ebe2b +0 -0
- data/test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0 +0 -0
- data/test/dummy/tmp/cache/assets/DA4/140/sprockets%2F24502b9d4e4eea6f709e089c0fdff30f +0 -0
- data/test/dummy/tmp/cache/assets/DBE/210/sprockets%2Fbedb89fd02eac0dc7aa93c820c612343 +0 -0
- data/test/dummy/tmp/cache/assets/DBE/950/sprockets%2F46cc27391a6badaac462d9b3aa43ec73 +0 -0
- data/test/dummy/tmp/cache/assets/DC7/E10/sprockets%2Fac6d2602a61a59c16ad89cbf2d2d48de +0 -0
- data/test/dummy/tmp/cache/assets/DC8/E80/sprockets%2F117e87cbd2939c4a9afcbbca2a3684d0 +0 -0
- data/test/dummy/tmp/cache/assets/DCD/AD0/sprockets%2Ffb914fa2e51ab43f0f857f0fddd8713b +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DEB/B50/sprockets%2Fdcfb6dd7dae66f42a5a10e80a33d1b24 +0 -0
- data/test/dummy/tmp/cache/assets/DEC/A90/sprockets%2F3f26f0f2e3ea4a0e194b22be6c3b5cce +0 -0
- data/test/dummy/tmp/cache/assets/E00/880/sprockets%2Fecb876bb310c1a3e6fd534ece45c9ed9 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E05/E70/sprockets%2Fead5bfd3417fc5de81d3794c3e443cfe +0 -0
- data/test/dummy/tmp/cache/assets/E1A/970/sprockets%2Ff89b4657cfc95e2d28f6fad44c58edfb +0 -0
- data/test/dummy/tmp/cache/assets/E2E/720/sprockets%2Ff76ac8420ca62debb77ecbfe7d0c6d45 +0 -0
- data/test/dummy/tmp/cache/assets/E38/2A0/sprockets%2Fc6e8ba43cbed7d3981f70bcfeb3a69c9 +0 -0
- data/test/dummy/tmp/cache/assets/E69/B60/sprockets%2Ffdbf7ec615e9a92e4857cdade17f4daa +0 -0
- data/test/dummy/tmp/cache/assets/E71/0E0/sprockets%2Fcbbecea061be6e609adc04133b9badab +0 -0
- data/test/dummy/tmp/cache/assets/E8C/480/sprockets%2Fdacb331ac961cf7b7cbc69abe8fb74dd +0 -0
- data/test/dummy/tmp/cache/assets/E8D/B40/sprockets%2Fb862bf7fb4b4c634aeaa9dfc97babc6b +0 -0
- data/test/test_helper.rb +15 -0
- metadata +420 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
//
|
2
|
+
// LESS - Leaner CSS v1.3.1
|
3
|
+
// http://lesscss.org
|
4
|
+
//
|
5
|
+
// Copyright (c) 2009-2011, Alexis Sellier
|
6
|
+
// Licensed under the Apache 2.0 License.
|
7
|
+
//
|
8
|
+
(function(e,t){function n(t){return e.less[t.split("/")[1]]}function h(){var e=document.getElementsByTagName("style");for(var t=0;t<e.length;t++)e[t].type.match(l)&&(new r.Parser({filename:document.location.href.replace(/#.*$/,""),dumpLineNumbers:r.dumpLineNumbers})).parse(e[t].innerHTML||"",function(n,r){var i=r.toCSS(),s=e[t];s.type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.innerHTML=i})}function p(e,t){for(var n=0;n<r.sheets.length;n++)d(r.sheets[n],e,t,r.sheets.length-(n+1))}function d(t,n,i,s){var o=t.contents||{},a=e.location.href.replace(/[#?].*$/,""),f=t.href.replace(/\?.*$/,""),l=u&&u.getItem(f),c=u&&u.getItem(f+":timestamp"),h={css:l,timestamp:c};/^[a-z-]+:/.test(f)||(f.charAt(0)=="/"?f=e.location.protocol+"//"+e.location.host+f:f=a.slice(0,a.lastIndexOf("/")+1)+f),g(t.href,t.type,function(e,u){if(!i&&h&&u&&(new Date(u)).valueOf()===(new Date(h.timestamp)).valueOf())m(h.css,t),n(null,null,e,t,{local:!0,remaining:s});else try{o[f]=e,(new r.Parser({optimization:r.optimization,paths:[f.replace(/[\w\.-]+$/,"")],mime:t.type,filename:f,contents:o,dumpLineNumbers:r.dumpLineNumbers})).parse(e,function(r,i){if(r)return E(r,f);try{n(r,i,e,t,{local:!1,lastModified:u,remaining:s}),b(document.getElementById("less-error-message:"+v(f)))}catch(r){E(r,f)}})}catch(a){E(a,f)}},function(e,t){throw new Error("Couldn't load "+t+" ("+e+")")})}function v(e){return e.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function m(e,t,n){var r,i=t.href?t.href.replace(/\?.*$/,""):"",s="less:"+(t.title||v(i));if((r=document.getElementById(s))===null){r=document.createElement("style"),r.type="text/css",t.media&&(r.media=t.media),r.id=s;var o=t&&t.nextSibling||null;document.getElementsByTagName("head")[0].insertBefore(r,o)}if(r.styleSheet)try{r.styleSheet.cssText=e}catch(a){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(e){r.childNodes.length>0?r.firstChild.nodeValue!==e.nodeValue&&r.replaceChild(e,r.firstChild):r.appendChild(e)})(document.createTextNode(e));if(n&&u){w("saving "+i+" to cache.");try{u.setItem(i,e),u.setItem(i+":timestamp",n)}catch(a){w("failed to save")}}}function g(e,t,n,i){function a(t,n,r){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):typeof r=="function"&&r(t.status,e)}var o=y(),u=s?r.fileAsync:r.async;typeof o.overrideMimeType=="function"&&o.overrideMimeType("text/css"),o.open("GET",e,u),o.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),o.send(null),s&&!r.fileAsync?o.status===0||o.status>=200&&o.status<300?n(o.responseText):i(o.status,e):u?o.onreadystatechange=function(){o.readyState==4&&a(o,n,i)}:a(o,n,i)}function y(){if(e.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return w("browser doesn't support AJAX."),null}}function b(e){return e&&e.parentNode.removeChild(e)}function w(e){r.env=="development"&&typeof console!="undefined"&&console.log("less: "+e)}function E(e,t){var n="less-error-message:"+v(t),i='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',s=document.createElement("div"),o,u,a=[],f=e.filename||t,l=f.match(/([^\/]+)$/)[1];s.id=n,s.className="less-error-message",u="<h3>"+(e.message||"There is an error in your .less file")+"</h3>"+'<p>in <a href="'+f+'">'+l+"</a> ";var c=function(e,t,n){e.extract[t]&&a.push(i.replace(/\{line\}/,parseInt(e.line)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.stack?u+="<br/>"+e.stack.split("\n").slice(1).join("<br/>"):e.extract&&(c(e,0,""),c(e,1,"line"),c(e,2,""),u+="on line "+e.line+", column "+(e.column+1)+":</p>"+"<ul>"+a.join("")+"</ul>"),s.innerHTML=u,m([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),s.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),r.env=="development"&&(o=setInterval(function(){document.body&&(document.getElementById(n)?document.body.replaceChild(s,document.getElementById(n)):document.body.insertBefore(s,document.body.firstChild),clearInterval(o))},10))}Array.isArray||(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"||e instanceof Array}),Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var n=this.length>>>0;for(var r=0;r<n;r++)r in this&&e.call(t,this[r],r,this)}),Array.prototype.map||(Array.prototype.map=function(e){var t=this.length>>>0,n=new Array(t),r=arguments[1];for(var i=0;i<t;i++)i in this&&(n[i]=e.call(r,this[i],i,this));return n}),Array.prototype.filter||(Array.prototype.filter=function(e){var t=[],n=arguments[1];for(var r=0;r<this.length;r++)e.call(n,this[r])&&t.push(this[r]);return t}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=this.length>>>0,n=0;if(t===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var r=arguments[1];else do{if(n in this){r=this[n++];break}if(++n>=t)throw new TypeError}while(!0);for(;n<t;n++)n in this&&(r=e.call(null,r,this[n],n,this));return r}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length,n=arguments[1]||0;if(!t)return-1;if(n>=t)return-1;n<0&&(n+=t);for(;n<t;n++){if(!Object.prototype.hasOwnProperty.call(this,n))continue;if(e===this[n])return n}return-1}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),String.prototype.trim||(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")});var r,i;typeof environment=="object"&&{}.toString.call(environment)==="[object Environment]"?(typeof e=="undefined"?r={}:r=e.less={},i=r.tree={},r.mode="rhino"):typeof e=="undefined"?(r=exports,i=n("./tree"),r.mode="node"):(typeof e.less=="undefined"&&(e.less={}),r=e.less,i=e.less.tree={},r.mode="browser"),r.Parser=function(t){function g(){a=c[u],f=o,h=o}function y(){c[u]=a,o=f,h=o}function b(){o>h&&(c[u]=c[u].slice(o-h),h=o)}function w(e){var t=e.charCodeAt(0);return t===32||t===10||t===9}function E(e){var t,n,r,i,a;if(e instanceof Function)return e.call(p.parsers);if(typeof e=="string")t=s.charAt(o)===e?e:null,r=1,b();else{b();if(!(t=e.exec(c[u])))return null;r=t[0].length}if(t)return S(r),typeof t=="string"?t:t.length===1?t[0]:t}function S(e){var t=o,n=u,r=o+c[u].length,i=o+=e;while(o<r){if(!w(s.charAt(o)))break;o++}return c[u]=c[u].slice(e+(o-i)),h=o,c[u].length===0&&u<c.length-1&&u++,t!==o||n!==u}function x(e,t){var n=E(e);if(!!n)return n;T(t||(typeof e=="string"?"expected '"+e+"' got '"+s.charAt(o)+"'":"unexpected token"))}function T(e,t){throw{index:o,type:t||"Syntax",message:e}}function N(e){return typeof e=="string"?s.charAt(o)===e:e.test(c[u])?!0:!1}function C(e,t){return e.filename&&t.filename&&e.filename!==t.filename?p.imports.contents[e.filename]:s}function k(e,t){for(var n=e,r=-1;n>=0&&t.charAt(n)!=="\n";n--)r++;return{line:typeof e=="number"?(t.slice(0,e).match(/\n/g)||"").length:null,column:r}}function L(e){return r.mode==="browser"||r.mode==="rhino"?e.filename:n("path").resolve(e.filename)}function A(e,t,n){return{lineNumber:k(e,t).line+1,fileName:L(n)}}function O(e,t){var n=C(e,t),r=k(e.index,n),i=r.line,s=r.column,o=n.split("\n");this.type=e.type||"Syntax",this.message=e.message,this.filename=e.filename||t.filename,this.index=e.index,this.line=typeof i=="number"?i+1:null,this.callLine=e.call&&k(e.call,n).line+1,this.callExtract=o[k(e.call,n).line],this.stack=e.stack,this.column=s,this.extract=[o[i-1],o[i],o[i+1]]}var s,o,u,a,f,l,c,h,p,d=this,t=t||{};t.contents||(t.contents={});var v=function(){},m=this.imports={paths:t&&t.paths||[],queue:[],files:{},contents:t.contents,mime:t&&t.mime,error:null,push:function(e,n){var i=this;this.queue.push(e),r.Parser.importer(e,this.paths,function(t,r){i.queue.splice(i.queue.indexOf(e),1);var s=e in i.files;i.files[e]=r,t&&!i.error&&(i.error=t),n(t,r,s),i.queue.length===0&&v(t)},t)}};return this.env=t=t||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null,p={imports:m,parse:function(e,a){var f,d,m,g,y,b,w=[],S,x=null;o=u=h=l=0,s=e.replace(/\r\n/g,"\n"),s=s.replace(/^\uFEFF/,""),c=function(e){var n=0,r=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,i=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,o=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,u=0,a,f=e[0],l;for(var c=0,h,p;c<s.length;c++){r.lastIndex=c,(a=r.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0])),h=s.charAt(c),i.lastIndex=o.lastIndex=c,(a=o.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0]),h=s.charAt(c)),!l&&h==="/"&&(p=s.charAt(c+1),(p==="/"||p==="*")&&(a=i.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0]),h=s.charAt(c)));switch(h){case"{":if(!l){u++,f.push(h);break};case"}":if(!l){u--,f.push(h),e[++n]=f=[];break};case"(":if(!l){l=!0,f.push(h);break};case")":if(l){l=!1,f.push(h);break};default:f.push(h)}}return u>0&&(x=new O({index:c,type:"Parse",message:"missing closing `}`",filename:t.filename},t)),e.map(function(e){return e.join("")})}([[]]);if(x)return a(x);try{f=new i.Ruleset([],E(this.parsers.primary)),f.root=!0}catch(T){return a(new O(T,t))}f.toCSS=function(e){var s,o,u;return function(s,o){var u=[],a;s=s||{},typeof o=="object"&&!Array.isArray(o)&&(o=Object.keys(o).map(function(e){var t=o[e];return t instanceof i.Value||(t instanceof i.Expression||(t=new i.Expression([t])),t=new i.Value([t])),new i.Rule("@"+e,t,!1,0)}),u=[new i.Ruleset(null,o)]);try{var f=e.call(this,{frames:u}).toCSS([],{compress:s.compress||!1,dumpLineNumbers:t.dumpLineNumbers})}catch(l){throw new O(l,t)}if(a=p.imports.error)throw a instanceof O?a:new O(a,t);return s.yuicompress&&r.mode==="node"?n("./cssmin").compressor.cssmin(f):s.compress?f.replace(/(\s)+/g,"$1"):f}}(f.eval);if(o<s.length-1){o=l,b=s.split("\n"),y=(s.slice(0,o).match(/\n/g)||"").length+1;for(var N=o,C=-1;N>=0&&s.charAt(N)!=="\n";N--)C++;x={type:"Parse",message:"Syntax Error on line "+y,index:o,filename:t.filename,line:y,column:C,extract:[b[y-2],b[y-1],b[y]]}}this.imports.queue.length>0?v=function(e){e?a(e):a(null,f)}:a(x,f)},parsers:{primary:function(){var e,t=[];while((e=E(this.mixin.definition)||E(this.rule)||E(this.ruleset)||E(this.mixin.call)||E(this.comment)||E(this.directive))||E(/^[\s\n]+/))e&&t.push(e);return t},comment:function(){var e;if(s.charAt(o)!=="/")return;if(s.charAt(o+1)==="/")return new i.Comment(E(/^\/\/.*/),!0);if(e=E(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new i.Comment(e)},entities:{quoted:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=='"'&&s.charAt(t)!=="'")return;n&&E("~");if(e=E(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new i.Quoted(e[0],e[1]||e[2],n)},keyword:function(){var e;if(e=E(/^[_A-Za-z-][_A-Za-z0-9-]*/))return i.colors.hasOwnProperty(e)?new i.Color(i.colors[e].slice(1)):new i.Keyword(e)},call:function(){var e,n,r,s,a=o;if(!(e=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(c[u])))return;e=e[1],n=e.toLowerCase();if(n==="url")return null;o+=e.length;if(n==="alpha"){s=E(this.alpha);if(typeof s!="undefined")return s}E("("),r=E(this.entities.arguments);if(!E(")"))return;if(e)return new i.Call(e,r,a,t.filename)},arguments:function(){var e=[],t;while(t=E(this.entities.assignment)||E(this.expression)){e.push(t);if(!E(","))break}return e},literal:function(){return E(this.entities.ratio)||E(this.entities.dimension)||E(this.entities.color)||E(this.entities.quoted)},assignment:function(){var e,t;if((e=E(/^\w+(?=\s?=)/i))&&E("=")&&(t=E(this.entity)))return new i.Assignment(e,t)},url:function(){var e;if(s.charAt(o)!=="u"||!E(/^url\(/))return;return e=E(this.entities.quoted)||E(this.entities.variable)||E(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",x(")"),new i.URL(e.value!=null||e instanceof i.Variable?e:new i.Anonymous(e),m.paths)},variable:function(){var e,n=o;if(s.charAt(o)==="@"&&(e=E(/^@@?[\w-]+/)))return new i.Variable(e,n,t.filename)},variableCurly:function(){var e,n,r=o;if(s.charAt(o)==="@"&&(n=E(/^@\{([\w-]+)\}/)))return new i.Variable("@"+n[1],r,t.filename)},color:function(){var e;if(s.charAt(o)==="#"&&(e=E(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)))return new i.Color(e[1])},dimension:function(){var e,t=s.charCodeAt(o);if(t>57||t<45||t===47)return;if(e=E(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi|dpcm|dppx|rem|vw|vh|vmin|vm|ch)?/))return new i.Dimension(e[1],e[2])},ratio:function(){var e,t=s.charCodeAt(o);if(t>57||t<48)return;if(e=E(/^(\d+\/\d+)/))return new i.Ratio(e[1])},javascript:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=="`")return;n&&E("~");if(e=E(/^`([^`]*)`/))return new i.JavaScript(e[1],o,n)}},variable:function(){var e;if(s.charAt(o)==="@"&&(e=E(/^(@[\w-]+)\s*:/)))return e[1]},shorthand:function(){var e,t;if(!N(/^[@\w.%-]+\/[@\w.-]+/))return;g();if((e=E(this.entity))&&E("/")&&(t=E(this.entity)))return new i.Shorthand(e,t);y()},mixin:{call:function(){var e=[],n,r,u=[],a,f=o,l=s.charAt(o),c,h,p=!1;if(l!=="."&&l!=="#")return;g();while(n=E(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))e.push(new i.Element(r,n,o)),r=E(">");if(E("(")){while(a=E(this.expression)){h=a,c=null;if(a.value.length==1){var d=a.value[0];if(d instanceof i.Variable&&E(":")){if(!(h=E(this.expression)))throw new Error("Expected value");c=d.name}}u.push({name:c,value:h});if(!E(","))break}if(!E(")"))throw new Error("Expected )")}E(this.important)&&(p=!0);if(e.length>0&&(E(";")||N("}")))return new i.mixin.Call(e,u,f,t.filename,p);y()},definition:function(){var e,t=[],n,r,u,a,f,c=!1;if(s.charAt(o)!=="."&&s.charAt(o)!=="#"||N(/^[^{]*(;|})/))return;g();if(n=E(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=n[1];do{if(s.charAt(o)==="."&&E(/^\.{3}/)){c=!0;break}if(!(u=E(this.entities.variable)||E(this.entities.literal)||E(this.entities.keyword)))break;if(u instanceof i.Variable)if(E(":"))a=x(this.expression,"expected expression"),t.push({name:u.name,value:a});else{if(E(/^\.{3}/)){t.push({name:u.name,variadic:!0}),c=!0;break}t.push({name:u.name})}else t.push({value:u})}while(E(","));E(")")||(l=o,y()),E(/^when/)&&(f=x(this.conditions,"expected condition")),r=E(this.block);if(r)return new i.mixin.Definition(e,t,r,f,c);y()}}},entity:function(){return E(this.entities.literal)||E(this.entities.variable)||E(this.entities.url)||E(this.entities.call)||E(this.entities.keyword)||E(this.entities.javascript)||E(this.comment)},end:function(){return E(";")||N("}")},alpha:function(){var e;if(!E(/^\(opacity=/i))return;if(e=E(/^\d+/)||E(this.entities.variable))return x(")"),new i.Alpha(e)},element:function(){var e,t,n,r;n=E(this.combinator),e=E(/^(?:\d+\.\d+|\d+)%/)||E(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||E("*")||E("&")||E(this.attribute)||E(/^\([^)@]+\)/)||E(/^[\.#](?=@)/)||E(this.entities.variableCurly),e||E("(")&&(r=E(this.entities.variableCurly)||E(this.entities.variable))&&E(")")&&(e=new i.Paren(r));if(e)return new i.Element(n,e,o)},combinator:function(){var e,t=s.charAt(o);if(t===">"||t==="+"||t==="~"){o++;while(s.charAt(o).match(/\s/))o++;return new i.Combinator(t)}return s.charAt(o-1).match(/\s/)?new i.Combinator(" "):new i.Combinator(null)},selector:function(){var e,t,n=[],r,u;if(E("("))return e=E(this.entity),x(")"),new i.Selector([new i.Element("",e,o)]);while(t=E(this.element)){r=s.charAt(o),n.push(t);if(r==="{"||r==="}"||r===";"||r===",")break}if(n.length>0)return new i.Selector(n)},tag:function(){return E(/^[A-Za-z][A-Za-z-]*[0-9]?/)||E("*")},attribute:function(){var e="",t,n,r;if(!E("["))return;if(t=E(/^(?:[_A-Za-z0-9-]|\\.)+/)||E(this.entities.quoted))(r=E(/^[|~*$^]?=/))&&(n=E(this.entities.quoted)||E(/^[\w-]+/))?e=[t,r,n.toCSS?n.toCSS():n].join(""):e=t;if(!E("]"))return;if(e)return"["+e+"]"},block:function(){var e;if(E("{")&&(e=E(this.primary))&&E("}"))return e},ruleset:function(){var e=[],n,r,u,a;g(),t.dumpLineNumbers&&(a=A(o,s,t));while(n=E(this.selector)){e.push(n),E(this.comment);if(!E(","))break;E(this.comment)}if(e.length>0&&(r=E(this.block))){var f=new i.Ruleset(e,r,t.strictImports);return t.dumpLineNumbers&&(f.debugInfo=a),f}l=o,y()},rule:function(){var e,t,n=s.charAt(o),r,a;g();if(n==="."||n==="#"||n==="&")return;if(e=E(this.variable)||E(this.property)){e.charAt(0)!="@"&&(a=/^([^@+\/'"*`(;{}-]*);/.exec(c[u]))?(o+=a[0].length-1,t=new i.Anonymous(a[1])):e==="font"?t=E(this.font):t=E(this.value),r=E(this.important);if(t&&E(this.end))return new i.Rule(e,t,r,f);l=o,y()}},"import":function(){var e,t,n=o;g();var r=E(/^@import(?:-(once))?\s+/);if(r&&(e=E(this.entities.quoted)||E(this.entities.url))){t=E(this.mediaFeatures);if(E(";"))return new i.Import(e,m,t,r[1]==="once",n)}y()},mediaFeature:function(){var e,t,n=[];do if(e=E(this.entities.keyword))n.push(e);else if(E("(")){t=E(this.property),e=E(this.entity);if(!E(")"))return null;if(t&&e)n.push(new i.Paren(new i.Rule(t,e,null,o,!0)));else{if(!e)return null;n.push(new i.Paren(e))}}while(e);if(n.length>0)return new i.Expression(n)},mediaFeatures:function(){var e,t=[];do if(e=E(this.mediaFeature)){t.push(e);if(!E(","))break}else if(e=E(this.entities.variable)){t.push(e);if(!E(","))break}while(e);return t.length>0?t:null},media:function(){var e,n,r,u;t.dumpLineNumbers&&(u=A(o,s,t));if(E(/^@media/)){e=E(this.mediaFeatures);if(n=E(this.block))return r=new i.Media(n,e),t.dumpLineNumbers&&(r.debugInfo=u),r}},directive:function(){var e,t,n,r,u,a,f,l,c;if(s.charAt(o)!=="@")return;if(t=E(this["import"])||E(this.media))return t;g(),e=E(/^@[a-z-]+/),f=e,e.charAt(1)=="-"&&e.indexOf("-",2)>0&&(f="@"+e.slice(e.indexOf("-",2)+1));switch(f){case"@font-face":l=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":l=!0;break;case"@page":case"@document":case"@supports":case"@keyframes":l=!0,c=!0}c&&(e+=" "+(E(/^[^{]+/)||"").trim());if(l){if(n=E(this.block))return new i.Directive(e,n)}else if((t=E(this.entity))&&E(";"))return new i.Directive(e,t);y()},font:function(){var e=[],t=[],n,r,s,o;while(o=E(this.shorthand)||E(this.entity))t.push(o);e.push(new i.Expression(t));if(E(","))while(o=E(this.expression)){e.push(o);if(!E(","))break}return new i.Value(e)},value:function(){var e,t=[],n;while(e=E(this.expression)){t.push(e);if(!E(","))break}if(t.length>0)return new i.Value(t)},important:function(){if(s.charAt(o)==="!")return E(/^! *important/)},sub:function(){var e;if(E("(")&&(e=E(this.expression))&&E(")"))return e},multiplication:function(){var e,t,n,r;if(e=E(this.operand)){while(!N(/^\/\*/)&&(n=E("/")||E("*"))&&(t=E(this.operand)))r=new i.Operation(n,[r||e,t]);return r||e}},addition:function(){var e,t,n,r;if(e=E(this.multiplication)){while((n=E(/^[-+]\s+/)||!w(s.charAt(o-1))&&(E("+")||E("-")))&&(t=E(this.multiplication)))r=new i.Operation(n,[r||e,t]);return r||e}},conditions:function(){var e,t,n=o,r;if(e=E(this.condition)){while(E(",")&&(t=E(this.condition)))r=new i.Condition("or",r||e,t,n);return r||e}},condition:function(){var e,t,n,r,s=o,u=!1;E(/^not/)&&(u=!0),x("(");if(e=E(this.addition)||E(this.entities.keyword)||E(this.entities.quoted))return(r=E(/^(?:>=|=<|[<=>])/))?(t=E(this.addition)||E(this.entities.keyword)||E(this.entities.quoted))?n=new i.Condition(r,e,t,s,u):T("expected expression"):n=new i.Condition("=",e,new i.Keyword("true"),s,u),x(")"),E(/^and/)?new i.Condition("and",n,E(this.condition)):n},operand:function(){var e,t=s.charAt(o+1);s.charAt(o)==="-"&&(t==="@"||t==="(")&&(e=E("-"));var n=E(this.sub)||E(this.entities.dimension)||E(this.entities.color)||E(this.entities.variable)||E(this.entities.call);return e?new i.Operation("*",[new i.Dimension(-1),n]):n},expression:function(){var e,t,n=[],r;while(e=E(this.addition)||E(this.entity))n.push(e);if(n.length>0)return new i.Expression(n)},property:function(){var e;if(e=E(/^(\*?-?[_a-z0-9-]+)\s*:/))return e[1]}}}};if(r.mode==="browser"||r.mode==="rhino")r.Parser.importer=function(e,t,n,r){!/^([a-z-]+:)?\//.test(e)&&t.length>0&&(e=t[0]+e),d({href:e,title:e,type:r.mime,contents:r.contents},function(i){i&&typeof r.errback=="function"?r.errback.call(null,e,t,n,r):n.apply(null,arguments)},!0)};(function(e){function t(t){return e.functions.hsla(t.h,t.s,t.l,t.a)}function n(t){if(t instanceof e.Dimension)return parseFloat(t.unit=="%"?t.value/100:t.value);if(typeof t=="number")return t;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function r(e){return Math.min(1,Math.max(0,e))}e.functions={rgb:function(e,t,n){return this.rgba(e,t,n,1)},rgba:function(t,r,i,s){var o=[t,r,i].map(function(e){return n(e)}),s=n(s);return new e.Color(o,s)},hsl:function(e,t,n){return this.hsla(e,t,n,1)},hsla:function(e,t,r,i){function u(e){return e=e<0?e+1:e>1?e-1:e,e*6<1?o+(s-o)*e*6:e*2<1?s:e*3<2?o+(s-o)*(2/3-e)*6:o}e=n(e)%360/360,t=n(t),r=n(r),i=n(i);var s=r<=.5?r*(t+1):r+t-r*t,o=r*2-s;return this.rgba(u(e+1/3)*255,u(e)*255,u(e-1/3)*255,i)},hue:function(t){return new e.Dimension(Math.round(t.toHSL().h))},saturation:function(t){return new e.Dimension(Math.round(t.toHSL().s*100),"%")},lightness:function(t){return new e.Dimension(Math.round(t.toHSL().l*100),"%")},red:function(t){return new e.Dimension(t.rgb[0])},green:function(t){return new e.Dimension(t.rgb[1])},blue:function(t){return new e.Dimension(t.rgb[2])},alpha:function(t){return new e.Dimension(t.toHSL().a)},luma:function(t){return new e.Dimension(Math.round((.2126*(t.rgb[0]/255)+.7152*(t.rgb[1]/255)+.0722*(t.rgb[2]/255))*t.alpha*100),"%")},saturate:function(e,n){var i=e.toHSL();return i.s+=n.value/100,i.s=r(i.s),t(i)},desaturate:function(e,n){var i=e.toHSL();return i.s-=n.value/100,i.s=r(i.s),t(i)},lighten:function(e,n){var i=e.toHSL();return i.l+=n.value/100,i.l=r(i.l),t(i)},darken:function(e,n){var i=e.toHSL();return i.l-=n.value/100,i.l=r(i.l),t(i)},fadein:function(e,n){var i=e.toHSL();return i.a+=n.value/100,i.a=r(i.a),t(i)},fadeout:function(e,n){var i=e.toHSL();return i.a-=n.value/100,i.a=r(i.a),t(i)},fade:function(e,n){var i=e.toHSL();return i.a=n.value/100,i.a=r(i.a),t(i)},spin:function(e,n){var r=e.toHSL(),i=(r.h+n.value)%360;return r.h=i<0?360+i:i,t(r)},mix:function(t,n,r){r||(r=new e.Dimension(50));var i=r.value/100,s=i*2-1,o=t.toHSL().a-n.toHSL().a,u=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,a=1-u,f=[t.rgb[0]*u+n.rgb[0]*a,t.rgb[1]*u+n.rgb[1]*a,t.rgb[2]*u+n.rgb[2]*a],l=t.alpha*i+n.alpha*(1-i);return new e.Color(f,l)},greyscale:function(t){return this.desaturate(t,new e.Dimension(100))},contrast:function(e,t,n,r){return typeof n=="undefined"&&(n=this.rgba(255,255,255,1)),typeof t=="undefined"&&(t=this.rgba(0,0,0,1)),typeof r=="undefined"?r=.43:r=r.value,(.2126*(e.rgb[0]/255)+.7152*(e.rgb[1]/255)+.0722*(e.rgb[2]/255))*e.alpha<r?n:t},e:function(t){return new e.Anonymous(t instanceof e.JavaScript?t.evaluated:t)},escape:function(t){return new e.Anonymous(encodeURI(t.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(t){var n=Array.prototype.slice.call(arguments,1),r=t.value;for(var i=0;i<n.length;i++)r=r.replace(/%[sda]/i,function(e){var t=e.match(/s/i)?n[i].value:n[i].toCSS();return e.match(/[A-Z]$/)?encodeURIComponent(t):t});return r=r.replace(/%%/g,"%"),new e.Quoted('"'+r+'"',r)},round:function(t,r){var i=typeof r=="undefined"?0:r.value;if(t instanceof e.Dimension)return new e.Dimension(n(t).toFixed(i),t.unit);if(typeof t=="number")return t.toFixed(i);throw{type:"Argument",message:"argument must be a number"}},ceil:function(e){return this._math("ceil",e)},floor:function(e){return this._math("floor",e)},_math:function(t,r){if(r instanceof e.Dimension)return new e.Dimension(Math[t](n(r)),r.unit);if(typeof r=="number")return Math[t](r);throw{type:"Argument",message:"argument must be a number"}},argb:function(t){return new e.Anonymous(t.toARGB())},percentage:function(t){return new e.Dimension(t.value*100,"%")},color:function(t){if(t instanceof e.Quoted)return new e.Color(t.value.slice(1));throw{type:"Argument",message:"argument must be a string"}},iscolor:function(t){return this._isa(t,e.Color)},isnumber:function(t){return this._isa(t,e.Dimension)},isstring:function(t){return this._isa(t,e.Quoted)},iskeyword:function(t){return this._isa(t,e.Keyword)},isurl:function(t){return this._isa(t,e.URL)},ispixel:function(t){return t instanceof e.Dimension&&t.unit==="px"?e.True:e.False},ispercentage:function(t){return t instanceof e.Dimension&&t.unit==="%"?e.True:e.False},isem:function(t){return t instanceof e.Dimension&&t.unit==="em"?e.True:e.False},_isa:function(t,n){return t instanceof n?e.True:e.False},multiply:function(e,t){var n=e.rgb[0]*t.rgb[0]/255,r=e.rgb[1]*t.rgb[1]/255,i=e.rgb[2]*t.rgb[2]/255;return this.rgb(n,r,i)},screen:function(e,t){var n=255-(255-e.rgb[0])*(255-t.rgb[0])/255,r=255-(255-e.rgb[1])*(255-t.rgb[1])/255,i=255-(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},overlay:function(e,t){var n=e.rgb[0]<128?2*e.rgb[0]*t.rgb[0]/255:255-2*(255-e.rgb[0])*(255-t.rgb[0])/255,r=e.rgb[1]<128?2*e.rgb[1]*t.rgb[1]/255:255-2*(255-e.rgb[1])*(255-t.rgb[1])/255,i=e.rgb[2]<128?2*e.rgb[2]*t.rgb[2]/255:255-2*(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},softlight:function(e,t){var n=t.rgb[0]*e.rgb[0]/255,r=n+e.rgb[0]*(255-(255-e.rgb[0])*(255-t.rgb[0])/255-n)/255;n=t.rgb[1]*e.rgb[1]/255;var i=n+e.rgb[1]*(255-(255-e.rgb[1])*(255-t.rgb[1])/255-n)/255;n=t.rgb[2]*e.rgb[2]/255;var s=n+e.rgb[2]*(255-(255-e.rgb[2])*(255-t.rgb[2])/255-n)/255;return this.rgb(r,i,s)},hardlight:function(e,t){var n=t.rgb[0]<128?2*t.rgb[0]*e.rgb[0]/255:255-2*(255-t.rgb[0])*(255-e.rgb[0])/255,r=t.rgb[1]<128?2*t.rgb[1]*e.rgb[1]/255:255-2*(255-t.rgb[1])*(255-e.rgb[1])/255,i=t.rgb[2]<128?2*t.rgb[2]*e.rgb[2]/255:255-2*(255-t.rgb[2])*(255-e.rgb[2])/255;return this.rgb(n,r,i)},difference:function(e,t){var n=Math.abs(e.rgb[0]-t.rgb[0]),r=Math.abs(e.rgb[1]-t.rgb[1]),i=Math.abs(e.rgb[2]-t.rgb[2]);return this.rgb(n,r,i)},exclusion:function(e,t){var n=e.rgb[0]+t.rgb[0]*(255-e.rgb[0]-e.rgb[0])/255,r=e.rgb[1]+t.rgb[1]*(255-e.rgb[1]-e.rgb[1])/255,i=e.rgb[2]+t.rgb[2]*(255-e.rgb[2]-e.rgb[2])/255;return this.rgb(n,r,i)},average:function(e,t){var n=(e.rgb[0]+t.rgb[0])/2,r=(e.rgb[1]+t.rgb[1])/2,i=(e.rgb[2]+t.rgb[2])/2;return this.rgb(n,r,i)},negation:function(e,t){var n=255-Math.abs(255-t.rgb[0]-e.rgb[0]),r=255-Math.abs(255-t.rgb[1]-e.rgb[1]),i=255-Math.abs(255-t.rgb[2]-e.rgb[2]);return this.rgb(n,r,i)},tint:function(e,t){return this.mix(this.rgb(255,255,255),e,t)},shade:function(e,t){return this.mix(this.rgb(0,0,0),e,t)}}})(n("./tree")),function(e){e.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(n("./tree")),function(e){e.Alpha=function(e){this.value=e},e.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(e){return this.value.eval&&(this.value=this.value.eval(e)),this}}}(n("../tree")),function(e){e.Anonymous=function(e){this.value=e.value||e},e.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Assignment=function(e,t){this.key=e,this.value=t},e.Assignment.prototype={toCSS:function(){return this.key+"="+(this.value.toCSS?this.value.toCSS():this.value)},eval:function(t){return this.value.eval?new e.Assignment(this.key,this.value.eval(t)):this}}}(n("../tree")),function(e){e.Call=function(e,t,n,r){this.name=e,this.args=t,this.index=n,this.filename=r},e.Call.prototype={eval:function(t){var n=this.args.map(function(e){return e.eval(t)});if(!(this.name in e.functions))return new e.Anonymous(this.name+"("+n.map(function(e){return e.toCSS(t)}).join(", ")+")");try{return e.functions[this.name].apply(e.functions,n)}catch(r){throw{type:r.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(r.message?": "+r.message:""),index:this.index,filename:this.filename}}},toCSS:function(e){return this.eval(e).toCSS()}}}(n("../tree")),function(e){e.Color=function(e,t){Array.isArray(e)?this.rgb=e:e.length==6?this.rgb=e.match(/.{2}/g).map(function(e){return parseInt(e,16)}):this.rgb=e.split("").map(function(e){return parseInt(e+e,16)}),this.alpha=typeof t=="number"?t:1},e.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(e){return Math.round(e)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},operate:function(t,n){var r=[];n instanceof e.Color||(n=n.toColor());for(var i=0;i<3;i++)r[i]=e.operate(t,this.rgb[i],n.rgb[i]);return new e.Color(r,this.alpha+n.alpha)},toHSL:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255,r=this.alpha,i=Math.max(e,t,n),s=Math.min(e,t,
|
9
|
+
n),o,u,a=(i+s)/2,f=i-s;if(i===s)o=u=0;else{u=a>.5?f/(2-i-s):f/(i+s);switch(i){case e:o=(t-n)/f+(t<n?6:0);break;case t:o=(n-e)/f+2;break;case n:o=(e-t)/f+4}o/=6}return{h:o*360,s:u,l:a,a:r}},toARGB:function(){var e=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+e.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},compare:function(e){return e.rgb?e.rgb[0]===this.rgb[0]&&e.rgb[1]===this.rgb[1]&&e.rgb[2]===this.rgb[2]&&e.alpha===this.alpha?0:-1:-1}}}(n("../tree")),function(e){e.Comment=function(e,t){this.value=e,this.silent=!!t},e.Comment.prototype={toCSS:function(e){return e.compress?"":this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Condition=function(e,t,n,r,i){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this.index=r,this.negate=i},e.Condition.prototype.eval=function(e){var t=this.lvalue.eval(e),n=this.rvalue.eval(e),r=this.index,i,i=function(e){switch(e){case"and":return t&&n;case"or":return t||n;default:if(t.compare)i=t.compare(n);else{if(!n.compare)throw{type:"Type",message:"Unable to perform comparison",index:r};i=n.compare(t)}switch(i){case-1:return e==="<"||e==="=<";case 0:return e==="="||e===">="||e==="=<";case 1:return e===">"||e===">="}}}(this.op);return this.negate?!i:i}}(n("../tree")),function(e){e.Dimension=function(e,t){this.value=parseFloat(e),this.unit=t||null},e.Dimension.prototype={eval:function(){return this},toColor:function(){return new e.Color([this.value,this.value,this.value])},toCSS:function(){var e=this.value+this.unit;return e},operate:function(t,n){return new e.Dimension(e.operate(t,this.value,n.value),this.unit||n.unit)},compare:function(t){return t instanceof e.Dimension?t.value>this.value?-1:t.value<this.value?1:0:-1}}}(n("../tree")),function(e){e.Directive=function(t,n){this.name=t,Array.isArray(n)?(this.ruleset=new e.Ruleset([],n),this.ruleset.allowImports=!0):this.value=n},e.Directive.prototype={toCSS:function(e,t){return this.ruleset?(this.ruleset.root=!0,this.name+(t.compress?"{":" {\n ")+this.ruleset.toCSS(e,t).trim().replace(/\n/g,"\n ")+(t.compress?"}":"\n}\n")):this.name+" "+this.value.toCSS()+";\n"},eval:function(t){var n=this;return this.ruleset&&(t.frames.unshift(this),n=new e.Directive(this.name),n.ruleset=this.ruleset.eval(t),t.frames.shift()),n},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)}}}(n("../tree")),function(e){e.Element=function(t,n,r){this.combinator=t instanceof e.Combinator?t:new e.Combinator(t),typeof n=="string"?this.value=n.trim():n?this.value=n:this.value="",this.index=r},e.Element.prototype.eval=function(t){return new e.Element(this.combinator,this.value.eval?this.value.eval(t):this.value,this.index)},e.Element.prototype.toCSS=function(e){var t=this.value.toCSS?this.value.toCSS(e):this.value;return t==""&&this.combinator.value.charAt(0)=="&"?"":this.combinator.toCSS(e||{})+t},e.Combinator=function(e){e===" "?this.value=" ":this.value=e?e.trim():""},e.Combinator.prototype.toCSS=function(e){return{"":""," ":" ",":":" :","+":e.compress?"+":" + ","~":e.compress?"~":" ~ ",">":e.compress?">":" > "}[this.value]}}(n("../tree")),function(e){e.Expression=function(e){this.value=e},e.Expression.prototype={eval:function(t){return this.value.length>1?new e.Expression(this.value.map(function(e){return e.eval(t)})):this.value.length===1?this.value[0].eval(t):this},toCSS:function(e){return this.value.map(function(t){return t.toCSS?t.toCSS(e):""}).join(" ")}}}(n("../tree")),function(e){e.Import=function(t,n,r,i,s){var o=this;this.once=i,this.index=s,this._path=t,this.features=r&&new e.Value(r),t instanceof e.Quoted?this.path=/\.(le?|c)ss(\?.*)?$/.test(t.value)?t.value:t.value+".less":this.path=t.value.value||t.value,this.css=/css(\?.*)?$/.test(this.path),this.css||n.push(this.path,function(t,n,r){t&&(t.index=s),r&&o.once&&(o.skip=r),o.root=n||new e.Ruleset([],[])})},e.Import.prototype={toCSS:function(e){var t=this.features?" "+this.features.toCSS(e):"";return this.css?"@import "+this._path.toCSS()+t+";\n":""},eval:function(t){var n,r=this.features&&this.features.eval(t);if(this.skip)return[];if(this.css)return this;n=new e.Ruleset([],this.root.rules.slice(0));for(var i=0;i<n.rules.length;i++)n.rules[i]instanceof e.Import&&Array.prototype.splice.apply(n.rules,[i,1].concat(n.rules[i].eval(t)));return this.features?new e.Media(n.rules,this.features.value):n.rules}}}(n("../tree")),function(e){e.JavaScript=function(e,t,n){this.escaped=n,this.expression=e,this.index=t},e.JavaScript.prototype={eval:function(t){var n,r=this,i={},s=this.expression.replace(/@\{([\w-]+)\}/g,function(n,i){return e.jsify((new e.Variable("@"+i,r.index)).eval(t))});try{s=new Function("return ("+s+")")}catch(o){throw{message:"JavaScript evaluation error: `"+s+"`",index:this.index}}for(var u in t.frames[0].variables())i[u.slice(1)]={value:t.frames[0].variables()[u].value,toJS:function(){return this.value.eval(t).toCSS()}};try{n=s.call(i)}catch(o){throw{message:"JavaScript evaluation error: '"+o.name+": "+o.message+"'",index:this.index}}return typeof n=="string"?new e.Quoted('"'+n+'"',n,this.escaped,this.index):Array.isArray(n)?new e.Anonymous(n.join(", ")):new e.Anonymous(n)}}}(n("../tree")),function(e){e.Keyword=function(e){this.value=e},e.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value},compare:function(t){return t instanceof e.Keyword?t.value===this.value?0:1:-1}},e.True=new e.Keyword("true"),e.False=new e.Keyword("false")}(n("../tree")),function(e){e.Media=function(t,n){var r=this.emptySelectors();this.features=new e.Value(n),this.ruleset=new e.Ruleset(r,t),this.ruleset.allowImports=!0},e.Media.prototype={toCSS:function(e,t){var n=this.features.toCSS(t);return this.ruleset.root=e.length===0||e[0].multiMedia,"@media "+n+(t.compress?"{":" {\n ")+this.ruleset.toCSS(e,t).trim().replace(/\n/g,"\n ")+(t.compress?"}":"\n}\n")},eval:function(t){t.mediaBlocks||(t.mediaBlocks=[],t.mediaPath=[]);var n=t.mediaBlocks.length;t.mediaPath.push(this),t.mediaBlocks.push(this);var r=new e.Media([],[]);return this.debugInfo&&(this.ruleset.debugInfo=this.debugInfo,r.debugInfo=this.debugInfo),r.features=this.features.eval(t),t.frames.unshift(this.ruleset),r.ruleset=this.ruleset.eval(t),t.frames.shift(),t.mediaBlocks[n]=r,t.mediaPath.pop(),t.mediaPath.length===0?r.evalTop(t):r.evalNested(t)},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)},emptySelectors:function(){var t=new e.Element("","&",0);return[new e.Selector([t])]},evalTop:function(t){var n=this;if(t.mediaBlocks.length>1){var r=this.emptySelectors();n=new e.Ruleset(r,t.mediaBlocks),n.multiMedia=!0}return delete t.mediaBlocks,delete t.mediaPath,n},evalNested:function(t){var n,r,i=t.mediaPath.concat([this]);for(n=0;n<i.length;n++)r=i[n].features instanceof e.Value?i[n].features.value:i[n].features,i[n]=Array.isArray(r)?r:[r];return this.features=new e.Value(this.permute(i).map(function(t){t=t.map(function(t){return t.toCSS?t:new e.Anonymous(t)});for(n=t.length-1;n>0;n--)t.splice(n,0,new e.Anonymous("and"));return new e.Expression(t)})),new e.Ruleset([],[])},permute:function(e){if(e.length===0)return[];if(e.length===1)return e[0];var t=[],n=this.permute(e.slice(1));for(var r=0;r<n.length;r++)for(var i=0;i<e[0].length;i++)t.push([e[0][i]].concat(n[r]));return t},bubbleSelectors:function(t){this.ruleset=new e.Ruleset(t.slice(0),[this.ruleset])}}}(n("../tree")),function(e){e.mixin={},e.mixin.Call=function(t,n,r,i,s){this.selector=new e.Selector(t),this.arguments=n,this.index=r,this.filename=i,this.important=s},e.mixin.Call.prototype={eval:function(e){var t,n,r=[],i=!1;for(var s=0;s<e.frames.length;s++)if((t=e.frames[s].find(this.selector)).length>0){n=this.arguments&&this.arguments.map(function(t){return{name:t.name,value:t.value.eval(e)}});for(var o=0;o<t.length;o++)if(t[o].match(n,e))try{Array.prototype.push.apply(r,t[o].eval(e,this.arguments,this.important).rules),i=!0}catch(u){throw{message:u.message,index:this.index,filename:this.filename,stack:u.stack}}if(i)return r;throw{type:"Runtime",message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(e){return e.toCSS()}).join(", ")+")`",index:this.index,filename:this.filename}}throw{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.filename}}},e.mixin.Definition=function(t,n,r,i,s){this.name=t,this.selectors=[new e.Selector([new e.Element(null,t)])],this.params=n,this.condition=i,this.variadic=s,this.arity=n.length,this.rules=r,this._lookups={},this.required=n.reduce(function(e,t){return!t.name||t.name&&!t.value?e+1:e},0),this.parent=e.Ruleset.prototype,this.frames=[]},e.mixin.Definition.prototype={toCSS:function(){return""},variable:function(e){return this.parent.variable.call(this,e)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(t,n){var r=new e.Ruleset(null,[]),i,s;for(var o=0,u,a;o<this.params.length;o++){s=n&&n[o];if(s&&s.name){r.rules.unshift(new e.Rule(s.name,s.value.eval(t))),n.splice(o,1),o--;continue}if(a=this.params[o].name)if(this.params[o].variadic&&n){i=[];for(var f=o;f<n.length;f++)i.push(n[f].value.eval(t));r.rules.unshift(new e.Rule(a,(new e.Expression(i)).eval(t)))}else{if(!(u=s&&s.value||this.params[o].value))throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+n.length+" for "+this.arity+")"};r.rules.unshift(new e.Rule(a,u.eval(t)))}}return r},eval:function(t,n,r){var i=this.evalParams(t,n),s,o=[],u,a;for(var f=0;f<Math.max(this.params.length,n&&n.length);f++)o.push(n[f]&&n[f].value||this.params[f].value);return i.rules.unshift(new e.Rule("@arguments",(new e.Expression(o)).eval(t))),u=r?this.rules.map(function(t){return new e.Rule(t.name,t.value,"!important",t.index)}):this.rules.slice(0),(new e.Ruleset(null,u)).eval({frames:[this,i].concat(this.frames,t.frames)})},match:function(e,t){var n=e&&e.length||0,r,i;if(!this.variadic){if(n<this.required)return!1;if(n>this.params.length)return!1;if(this.required>0&&n>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(t,e)].concat(t.frames)}))return!1;r=Math.min(n,this.arity);for(var s=0;s<r;s++)if(!this.params[s].name&&e[s].value.eval(t).toCSS()!=this.params[s].value.eval(t).toCSS())return!1;return!0}}}(n("../tree")),function(e){e.Operation=function(e,t){this.op=e.trim(),this.operands=t},e.Operation.prototype.eval=function(t){var n=this.operands[0].eval(t),r=this.operands[1].eval(t),i;if(n instanceof e.Dimension&&r instanceof e.Color){if(this.op!=="*"&&this.op!=="+")throw{name:"OperationError",message:"Can't substract or divide a color from a number"};i=r,r=n,n=i}return n.operate(this.op,r)},e.operate=function(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n}}}(n("../tree")),function(e){e.Paren=function(e){this.value=e},e.Paren.prototype={toCSS:function(e){return"("+this.value.toCSS(e)+")"},eval:function(t){return new e.Paren(this.value.eval(t))}}}(n("../tree")),function(e){e.Quoted=function(e,t,n,r){this.escaped=n,this.value=t||"",this.quote=e.charAt(0),this.index=r},e.Quoted.prototype={toCSS:function(){return this.escaped?this.value:this.quote+this.value+this.quote},eval:function(t){var n=this,r=this.value.replace(/`([^`]+)`/g,function(r,i){return(new e.JavaScript(i,n.index,!0)).eval(t).value}).replace(/@\{([\w-]+)\}/g,function(r,i){var s=(new e.Variable("@"+i,n.index)).eval(t);return"value"in s?s.value:s.toCSS()});return new e.Quoted(this.quote+r+this.quote,r,this.escaped,this.index)},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Ratio=function(e){this.value=e},e.Ratio.prototype={toCSS:function(e){return this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Rule=function(t,n,r,i,s){this.name=t,this.value=n instanceof e.Value?n:new e.Value([n]),this.important=r?" "+r.trim():"",this.index=i,this.inline=s||!1,t.charAt(0)==="@"?this.variable=!0:this.variable=!1},e.Rule.prototype.toCSS=function(e){return this.variable?"":this.name+(e.compress?":":": ")+this.value.toCSS(e)+this.important+(this.inline?"":";")},e.Rule.prototype.eval=function(t){return new e.Rule(this.name,this.value.eval(t),this.important,this.index,this.inline)},e.Shorthand=function(e,t){this.a=e,this.b=t},e.Shorthand.prototype={toCSS:function(e){return this.a.toCSS(e)+"/"+this.b.toCSS(e)},eval:function(){return this}}}(n("../tree")),function(e){e.Ruleset=function(e,t,n){this.selectors=e,this.rules=t,this._lookups={},this.strictImports=n},e.Ruleset.prototype={eval:function(t){var n=this.selectors&&this.selectors.map(function(e){return e.eval(t)}),r=new e.Ruleset(n,this.rules.slice(0),this.strictImports),i=[];r.root=this.root,r.allowImports=this.allowImports,this.debugInfo&&(r.debugInfo=this.debugInfo),t.frames.unshift(r);if(r.root||r.allowImports||!r.strictImports){for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.Import?i=i.concat(r.rules[s].eval(t)):i.push(r.rules[s]);r.rules=i,i=[]}for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Definition&&(r.rules[s].frames=t.frames.slice(0));var o=t.mediaBlocks&&t.mediaBlocks.length||0;for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Call?i=i.concat(r.rules[s].eval(t)):i.push(r.rules[s]);r.rules=i;for(var s=0,u;s<r.rules.length;s++)u=r.rules[s],u instanceof e.mixin.Definition||(r.rules[s]=u.eval?u.eval(t):u);t.frames.shift();if(t.mediaBlocks)for(var s=o;s<t.mediaBlocks.length;s++)t.mediaBlocks[s].bubbleSelectors(n);return r},match:function(e){return!e||e.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(t,n){return n instanceof e.Rule&&n.variable===!0&&(t[n.name]=n),t},{})},variable:function(e){return this.variables()[e]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(t){return t instanceof e.Ruleset||t instanceof e.mixin.Definition})},find:function(t,n){n=n||this;var r=[],i,s,o=t.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach(function(i){if(i!==n)for(var o=0;o<i.selectors.length;o++)if(s=t.match(i.selectors[o])){t.elements.length>i.selectors[o].elements.length?Array.prototype.push.apply(r,i.find(new e.Selector(t.elements.slice(1)),n)):r.push(i);break}}),this._lookups[o]=r)},toCSS:function(t,n){var r=[],i=[],s=[],o=[],u=[],a,f,l;this.root||this.joinSelectors(u,t,this.selectors);for(var c=0;c<this.rules.length;c++)l=this.rules[c],l.rules||l instanceof e.Directive||l instanceof e.Media?o.push(l.toCSS(u,n)):l instanceof e.Comment?l.silent||(this.root?o.push(l.toCSS(n)):i.push(l.toCSS(n))):l.toCSS&&!l.variable?i.push(l.toCSS(n)):l.value&&!l.variable&&i.push(l.value.toString());o=o.join("");if(this.root)r.push(i.join(n.compress?"":"\n"));else if(i.length>0){f=e.debugInfo(n,this),a=u.map(function(e){return e.map(function(e){return e.toCSS(n)}).join("").trim()}).join(n.compress?",":",\n");for(var c=i.length-1;c>=0;c--)s.indexOf(i[c])===-1&&s.unshift(i[c]);i=s,r.push(f+a+(n.compress?"{":" {\n ")+i.join(n.compress?"":"\n ")+(n.compress?"}":"\n}\n"))}return r.push(o),r.join("")+(n.compress?"\n":"")},joinSelectors:function(e,t,n){for(var r=0;r<n.length;r++)this.joinSelector(e,t,n[r])},joinSelector:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;for(i=0;i<r.elements.length;i++)f=r.elements[i],f.value==="&"&&(u=!0);if(!u){if(n.length>0)for(i=0;i<n.length;i++)t.push(n[i].concat(r));else t.push([r]);return}g=[],a=[[]];for(i=0;i<r.elements.length;i++){f=r.elements[i];if(f.value!=="&")g.push(f);else{y=[],g.length>0&&this.mergeElementsOnToSelectors(g,a);for(s=0;s<a.length;s++){l=a[s];if(n.length==0)l.length>0&&(l[0].elements=l[0].elements.slice(0),l[0].elements.push(new e.Element(f.combinator,"",0))),y.push(l);else for(o=0;o<n.length;o++)c=n[o],h=[],p=[],v=!0,l.length>0?(h=l.slice(0),m=h.pop(),d=new e.Selector(m.elements.slice(0)),v=!1):d=new e.Selector([]),c.length>1&&(p=p.concat(c.slice(1))),c.length>0&&(v=!1,d.elements.push(new e.Element(f.combinator,c[0].elements[0].value,0)),d.elements=d.elements.concat(c[0].elements.slice(1))),v||h.push(d),h=h.concat(p),y.push(h)}a=y,g=[]}}g.length>0&&this.mergeElementsOnToSelectors(g,a);for(i=0;i<a.length;i++)t.push(a[i])},mergeElementsOnToSelectors:function(t,n){var r,i;if(n.length==0){n.push([new e.Selector(t)]);return}for(r=0;r<n.length;r++)i=n[r],i.length>0?i[i.length-1]=new e.Selector(i[i.length-1].elements.concat(t)):i.push(new e.Selector(t))}}}(n("../tree")),function(e){e.Selector=function(e){this.elements=e},e.Selector.prototype.match=function(e){var t=this.elements.length,n=e.elements.length,r=Math.min(t,n);if(t<n)return!1;for(var i=0;i<r;i++)if(this.elements[i].value!==e.elements[i].value)return!1;return!0},e.Selector.prototype.eval=function(t){return new e.Selector(this.elements.map(function(e){return e.eval(t)}))},e.Selector.prototype.toCSS=function(e){return this._css?this._css:(this.elements[0].combinator.value===""?this._css=" ":this._css="",this._css+=this.elements.map(function(t){return typeof t=="string"?" "+t.trim():t.toCSS(e)}).join(""),this._css)}}(n("../tree")),function(t){t.URL=function(e,t){this.value=e,this.paths=t},t.URL.prototype={toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(n){var r=this.value.eval(n);return typeof e!="undefined"&&typeof r.value=="string"&&!/^(?:[a-z-]+:|\/)/.test(r.value)&&this.paths.length>0&&(r.value=this.paths[0]+(r.value.charAt(0)==="/"?r.value.slice(1):r.value)),new t.URL(r,this.paths)}}}(n("../tree")),function(e){e.Value=function(e){this.value=e,this.is="value"},e.Value.prototype={eval:function(t){return this.value.length===1?this.value[0].eval(t):new e.Value(this.value.map(function(e){return e.eval(t)}))},toCSS:function(e){return this.value.map(function(t){return t.toCSS(e)}).join(e.compress?",":", ")}}}(n("../tree")),function(e){e.Variable=function(e,t,n){this.name=e,this.index=t,this.file=n},e.Variable.prototype={eval:function(t){var n,r,i=this.name;i.indexOf("@@")==0&&(i="@"+(new e.Variable(i.slice(1))).eval(t).value);if(n=e.find(t.frames,function(e){if(r=e.variable(i))return r.value.eval(t)}))return n;throw{type:"Name",message:"variable "+i+" is undefined",filename:this.file,index:this.index}}}}(n("../tree")),function(e){e.debugInfo=function(t,n){var r="";if(t.dumpLineNumbers&&!t.compress)switch(t.dumpLineNumbers){case"comments":r=e.debugInfo.asComment(n);break;case"mediaquery":r=e.debugInfo.asMediaQuery(n);break;case"all":r=e.debugInfo.asComment(n)+e.debugInfo.asMediaQuery(n)}return r},e.debugInfo.asComment=function(e){return"/* line "+e.debugInfo.lineNumber+", "+e.debugInfo.fileName+" */\n"},e.debugInfo.asMediaQuery=function(e){return'@media -sass-debug-info{filename{font-family:"'+e.debugInfo.fileName+'";}line{font-family:"'+e.debugInfo.lineNumber+'";}}\n'},e.find=function(e,t){for(var n=0,r;n<e.length;n++)if(r=t.call(e,e[n]))return r;return null},e.jsify=function(e){return Array.isArray(e.value)&&e.value.length>1?"["+e.value.map(function(e){return e.toCSS(!1)}).join(", ")+"]":e.toCSS(!1)}}(n("./tree"));var s=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);r.env=r.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||s?"development":"production"),r.async=r.async||!1,r.fileAsync=r.fileAsync||!1,r.poll=r.poll||(s?1e3:1500),r.watch=function(){return this.watchMode=!0},r.unwatch=function(){return this.watchMode=!1};if(r.env==="development"){r.optimization=0,/!watch/.test(location.hash)&&r.watch();var o=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);o&&(r.dumpLineNumbers=o[1]),r.watchTimer=setInterval(function(){r.watchMode&&p(function(e,t,n,r,i){t&&m(t.toCSS(),r,i.lastModified)})},r.poll)}else r.optimization=3;var u;try{u=typeof e.localStorage=="undefined"?null:e.localStorage}catch(a){u=null}var f=document.getElementsByTagName("link"),l=/^text\/(x-)?less$/;r.sheets=[];for(var c=0;c<f.length;c++)(f[c].rel==="stylesheet/less"||f[c].rel.match(/stylesheet/)&&f[c].type.match(l))&&r.sheets.push(f[c]);r.refresh=function(e){var t,n;t=n=new Date,p(function(e,r,i,s,o){o.local?w("loading "+s.href+" from cache."):(w("parsed "+s.href+" successfully."),m(r.toCSS(),s,o.lastModified)),w("css for "+s.href+" generated in "+(new Date-n)+"ms"),o.remaining===0&&w("css generated in "+(new Date-t)+"ms"),n=new Date},e),h()},r.refreshStyles=h,r.refresh(r.env==="development"),typeof define=="function"&&define.amd&&define("less",[],function(){return r})})(window);
|
@@ -0,0 +1,113 @@
|
|
1
|
+
// Cytoplasm LESS Module
|
2
|
+
// By MacKinley Smith
|
3
|
+
|
4
|
+
// Global Element Styles
|
5
|
+
body {
|
6
|
+
margin:0;
|
7
|
+
height:100%;
|
8
|
+
overflow-y:scroll;
|
9
|
+
}
|
10
|
+
|
11
|
+
// Header
|
12
|
+
header {
|
13
|
+
margin:0px;
|
14
|
+
padding:10px;
|
15
|
+
overflow:hidden;
|
16
|
+
|
17
|
+
h1 {
|
18
|
+
margin:0px;
|
19
|
+
white-space:nowrap;
|
20
|
+
cursor:pointer;
|
21
|
+
display:inline;
|
22
|
+
text-shadow:0px 0px 10px rgba(0,0,0,0.5);
|
23
|
+
}
|
24
|
+
#logo {
|
25
|
+
z-index:1000;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
// Navigation
|
30
|
+
nav {
|
31
|
+
ul {
|
32
|
+
padding:0px;
|
33
|
+
list-style:none;
|
34
|
+
li {
|
35
|
+
display:inline-block;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
// Main Content
|
41
|
+
#main_content {
|
42
|
+
min-height:400px;
|
43
|
+
margin:0px;
|
44
|
+
padding:20px;
|
45
|
+
background:white;
|
46
|
+
overflow:hidden;
|
47
|
+
box-shadow:0px 0px 10px rgba(0,0,0,0.8);
|
48
|
+
clear:both;
|
49
|
+
|
50
|
+
&>:first-child {
|
51
|
+
margin-top:0px;
|
52
|
+
padding-top:0px;
|
53
|
+
}
|
54
|
+
&>:last-child {
|
55
|
+
margin-bottom:0px;
|
56
|
+
padding-bottom:0px;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// Footer
|
61
|
+
footer {
|
62
|
+
padding:10px;
|
63
|
+
}
|
64
|
+
|
65
|
+
// jQuery Plugins
|
66
|
+
// CytoTable
|
67
|
+
table.cytoTable {
|
68
|
+
width:100%;
|
69
|
+
margin-bottom:15px;
|
70
|
+
box-shadow:0px 0px 10px rgba(0,0,0,0.5);
|
71
|
+
|
72
|
+
td {
|
73
|
+
padding:10px;
|
74
|
+
|
75
|
+
&.labelcell {
|
76
|
+
width:100px;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// CytoField
|
82
|
+
input.cytoField {
|
83
|
+
width:100%;
|
84
|
+
height:28px;
|
85
|
+
border:1px solid #aaa;
|
86
|
+
border-radius:5px;
|
87
|
+
|
88
|
+
&[type=radio] {width:auto}
|
89
|
+
&[type=text], &[type=password] {
|
90
|
+
padding:0px 7px;
|
91
|
+
box-shadow:inset 0px 0px 5px rgba(0,0,0,0.25);
|
92
|
+
font-size:14px;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
// CytoButton
|
97
|
+
button, input[type=submit] {
|
98
|
+
&.cytoButton {
|
99
|
+
border-radius:5px;
|
100
|
+
cursor:pointer;
|
101
|
+
|
102
|
+
&.large {
|
103
|
+
width:100%;
|
104
|
+
height:50px;
|
105
|
+
}
|
106
|
+
&.active {
|
107
|
+
box-shadow:inset 0px 0px 10px rgba(0,0,0,0.5);
|
108
|
+
}
|
109
|
+
&:active {
|
110
|
+
box-shadow:inset 0px 0px 10px rgba(0,0,0,0.5);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
module Cytoplasm
|
5
|
+
class FontsController < ApplicationController
|
6
|
+
|
7
|
+
def fetch_imported
|
8
|
+
imported = {}
|
9
|
+
fontsdir = "public/fonts"
|
10
|
+
|
11
|
+
# Find fonts directory, create one if it doesn't exist
|
12
|
+
if File.exists?(fontsdir)
|
13
|
+
fontsdir = Dir.open(fontsdir)
|
14
|
+
else
|
15
|
+
Dir.chdir("public")
|
16
|
+
fontsdir = Dir.mkdir("fonts")
|
17
|
+
Dir.chdir("../")
|
18
|
+
end
|
19
|
+
|
20
|
+
fontsdir.each do |file|
|
21
|
+
imported[file] = fetch_fs_family(file) if File.directory?(file) and file!="." and file!=".."
|
22
|
+
end
|
23
|
+
return imported
|
24
|
+
end
|
25
|
+
|
26
|
+
def fetch_fs_family(font)
|
27
|
+
return fetch_json("http://www.fontsquirrel.com/api/familyinfo/"+font)
|
28
|
+
end
|
29
|
+
|
30
|
+
def fetch_all
|
31
|
+
success = {"fontsquirrel" => {}, "googlewebfonts" => {},"imported" => {}}
|
32
|
+
|
33
|
+
success["fontsquirrel"] = fetch_json("http://www.fontsquirrel.com/api/fontlist/all")
|
34
|
+
fetch_json("https://www.googleapis.com/webfonts/v1/webfonts?key="+Cytoplasm.conf("fontloader.googlewebfonts_apikey"))["items"].each {|f| success["googlewebfonts"][f["family"]] = f}
|
35
|
+
success["imported"] = fetch_imported()
|
36
|
+
|
37
|
+
render :text => Cytoplasm::Ajax.ajax_success(success)
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def fetch_json(url)
|
42
|
+
return ActiveSupport::JSON.decode(open(url).read)
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Cytoplasm
|
2
|
+
class SettingsController < ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def edit
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
def update
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch_conf
|
17
|
+
Cytoplasm.configure_with("config/initializers/cytoplasm.yml")
|
18
|
+
return Cytoplasm.conf()
|
19
|
+
end
|
20
|
+
|
21
|
+
def fetch_vars
|
22
|
+
Cytoplasm.load_vars_from("config/initializers/cytoplasm.vars.yml")
|
23
|
+
return Cytoplasm.vars()
|
24
|
+
end
|
25
|
+
|
26
|
+
def fetch
|
27
|
+
success = {}
|
28
|
+
success["conf"] = fetch_conf()
|
29
|
+
success["vars"] = fetch_vars()
|
30
|
+
render :text => Cytoplasm::Ajax.ajax_success(success)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,529 @@
|
|
1
|
+
<h2>Cytoplasm Settings</h2>
|
2
|
+
<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
|
+
<table id="layout_settings_table" class='cytoTable' cellpadding=0 cellspacing=0>
|
7
|
+
<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
|
+
<tr>
|
16
|
+
<td class='labelcell'>Layout Padding:</td>
|
17
|
+
<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>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td class='labelcell'>jQuery-UI Theme:</td>
|
21
|
+
<td>
|
22
|
+
<select name="layout_jqueryui_theme" class="cytoSelect">
|
23
|
+
<option value="ui-lightness">UI lightness</option>
|
24
|
+
<option value="ui-darkness">UI darkness</option>
|
25
|
+
<option value="smoothness">Smoothness</option>
|
26
|
+
<option value="start">Start</option>
|
27
|
+
<option value="redmond">Redmond</option>
|
28
|
+
<option value="sunny">Sunny</option>
|
29
|
+
<option value="overcast">Overcast</option>
|
30
|
+
<option value="le-frog">Le Frog</option>
|
31
|
+
<option value="flick">Flick</option>
|
32
|
+
<option value="pepper-grinder">Pepper Grinder</option>
|
33
|
+
<option value="eggplant">Eggplant</option>
|
34
|
+
<option value="dark-hive">Dark Hive</option>
|
35
|
+
<option value="cupertino">Cupertino</option>
|
36
|
+
<option value="south-street">South Street</option>
|
37
|
+
<option value="blitzer">Blitzer</option>
|
38
|
+
<option value="humanity">Humanity</option>
|
39
|
+
<option value="hot-sneaks">Hot Sneaks</option>
|
40
|
+
<option value="excite-bike">Excite Bike</option>
|
41
|
+
<option value="vader">Vader</option>
|
42
|
+
<option value="dot-luv">Dot Luv</option>
|
43
|
+
<option value="mint-choc">Mint Choc</option>
|
44
|
+
<option value="black-tie">Black Tie</option>
|
45
|
+
<option value="trontastic">Trontastic</option>
|
46
|
+
<option value="swanky-purse">Swanky Purse</option>
|
47
|
+
</select>
|
48
|
+
</td>
|
49
|
+
</tr>
|
50
|
+
|
51
|
+
<tr><td class='headercell' colspan=2><h3>Logo</h3></td></tr>
|
52
|
+
<tr>
|
53
|
+
<td class='labelcell'>Logo Image:</td>
|
54
|
+
<td><input type="file" name="logo_image" class="cytoUpload" /></td>
|
55
|
+
</tr>
|
56
|
+
<tr>
|
57
|
+
<td class='labelcell'>Logo Position:</td>
|
58
|
+
<td>
|
59
|
+
<input type="radio" name="logo_position" data-label="Badge" value="badge" class="cytoRadio" />
|
60
|
+
<input type="radio" name="logo_position" data-label="Inside NavBar" value="nav" />
|
61
|
+
<input type="radio" name="logo_position" data-label="Custom..." value="custom" />
|
62
|
+
|
63
|
+
<div id="logo_position_custom_settings">
|
64
|
+
<h4>Advanced Logo Settings</h4>
|
65
|
+
<div class="inline-input">
|
66
|
+
<label for="logo_position_mode">Logo Position Mode:</label>
|
67
|
+
<input type="radio" name="logo_position_mode" data-label="Static" value="static" class="cytoRadio" />
|
68
|
+
<input type="radio" name="logo_position_mode" data-label="Relative" value="relative" />
|
69
|
+
<input type="radio" name="logo_position_mode" data-label="Absolute" value="absolute" />
|
70
|
+
<input type="radio" name="logo_position_mode" data-label="Fixed" value="fixed" />
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<input type="hidden" name="logo_x_offset" class="cytoSlider" data-label="Logo X Offset" data-unit="px" />
|
74
|
+
<input type="hidden" name="logo_y_offset" class="cytoSlider" data-label="Logo Y Offset" data-unit="px" />
|
75
|
+
</div>
|
76
|
+
</td>
|
77
|
+
</tr>
|
78
|
+
<tr>
|
79
|
+
<td class='labelcell'>Logo Side:</td>
|
80
|
+
<td>
|
81
|
+
<input type="radio" name="logo_side" data-label="Left" value="left" class="cytoRadio" />
|
82
|
+
<input type="radio" name="logo_side" data-label="Center" value="center" />
|
83
|
+
<input type="radio" name="logo_side" data-label="Right" value="right" />
|
84
|
+
</td>
|
85
|
+
</tr>
|
86
|
+
|
87
|
+
<tr><td class='headercell' colspan=2><h3>Navigation</h3></td></tr>
|
88
|
+
<tr>
|
89
|
+
<td class='labelcell'>Alignment:</td>
|
90
|
+
<td>
|
91
|
+
<input type="radio" name="nav_side" data-label="Left" value="left" class="cytoRadio" />
|
92
|
+
<input type="radio" name="nav_side" data-label="Center" value="center" />
|
93
|
+
<input type="radio" name="nav_side" data-label="Right" value="right" />
|
94
|
+
</td>
|
95
|
+
</tr>
|
96
|
+
<tr>
|
97
|
+
<td class='labelcell'>Background:</td>
|
98
|
+
<td>
|
99
|
+
<div class="inline-input">
|
100
|
+
<input type="radio" name="nav_background_mode" data-label="Transparent" value="transparent" class="cytoRadio" />
|
101
|
+
<input type="radio" name="nav_background_mode" data-label="Color..." value="color" />
|
102
|
+
<input type="radio" name="nav_background_mode" data-label="Gradient..." value="gradient" />
|
103
|
+
<input type="radio" name="nav_background_mode" data-label="Image..." value="image" />
|
104
|
+
</div>
|
105
|
+
<div class="inline-input nav-mode-wrapper" data-mode="color">
|
106
|
+
<input type="colorpicker" name="nav_background_color" class="cytoColorPicker" />
|
107
|
+
</div>
|
108
|
+
<div class="inline-input nav-mode-wrapper" data-mode="gradient">
|
109
|
+
<input type="colorpicker" name="nav_background_gradient_start" class="cytoColorPicker" />
|
110
|
+
<input type="colorpicker" name="nav_background_gradient_stop" class="cytoColorPicker" />
|
111
|
+
</div>
|
112
|
+
<div class="inline-input nav-mode-wrapper" data-mode="image">
|
113
|
+
<input type="file" name="nav_background_file" class="cytoUpload" />
|
114
|
+
</div>
|
115
|
+
</td>
|
116
|
+
</tr>
|
117
|
+
|
118
|
+
<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
|
+
<tr><td class='infocell' colspan=2>Select individual fonts below if desired.</td></tr>
|
135
|
+
<% ['Light','Regular','Bold'].each do |style| %>
|
136
|
+
<tr>
|
137
|
+
<td class='labelcell'><%=style%>:</td>
|
138
|
+
<td>
|
139
|
+
<a href="#" target="_blank" class="font-preview"><img src="" style="display:none" /></a>
|
140
|
+
<select data-exclude="true" name="fonts_<%=style.downcase%>_family" class="ind_font_fam_select cytoSelect">
|
141
|
+
<option value="Arial, Helvetica, sans-serif">Arial</option>
|
142
|
+
<option value="Arial Black, Gadget, sans-serif">Arial Black</option>
|
143
|
+
<option value="Comic Sans MS, cursive">Comic Sans MS</option>
|
144
|
+
<option value="Courier New, monospace">Courier New</option>
|
145
|
+
<option value="Georgia, serif">Georgia</option>
|
146
|
+
<option value="Impact, Charcoal">Impact</option>
|
147
|
+
<option value="Lucida Console, Monaco, monospace">Lucida Console</option>
|
148
|
+
<option value="Lucida Sans Unicode, Lucida Grande, sans-serif">Lucida Sans Unicode</option>
|
149
|
+
<option value="Palatino Linotype, Book Antiqua, Palatino, serif">Palatino Linotype</option>
|
150
|
+
<option value="Tahoma, Geneva, sans-serif">Tahoma</option>
|
151
|
+
<option value="Times New Roman, Times, serif">Times New Roman</option>
|
152
|
+
<option value="Trebuchet MS, sans-serif">Trebuchet MS</option>
|
153
|
+
<option value="Verdana, Geneva, sans-serif">Verdana</option>
|
154
|
+
</select>
|
155
|
+
<select name="fonts_<%=style.downcase%>" id="fontselect_<%=style.downcase%>" class="ind_font_select cytoSelect" data-style="<%=style%>"></select>
|
156
|
+
</td>
|
157
|
+
</tr>
|
158
|
+
<% end %>
|
159
|
+
|
160
|
+
<tr>
|
161
|
+
<td class='labelcell'>Font Sizes:</td>
|
162
|
+
<td>
|
163
|
+
<% ['Small','Normal','Huge'].each do |size| %>
|
164
|
+
<input type="hidden" name="fonts_<%=size.downcase%>" class="cytoSlider" value="<%=Cytoplasm.vars('fonts_'+size.downcase)%>" data-label="<%=size%>" data-unit="px" />
|
165
|
+
<% end %>
|
166
|
+
</td>
|
167
|
+
</tr>
|
168
|
+
|
169
|
+
<tr><td class='headercell' colspan=2><h3>Color Palette</h3></td></tr>
|
170
|
+
<% ['Background','Text','Accent'].each do |color| %>
|
171
|
+
<tr>
|
172
|
+
<td class='labelcell'><%=color%> Color:</td>
|
173
|
+
<td><input type="colorpicker" name="colors_<%=color.downcase%>" class="cytoColorPicker" /></td>
|
174
|
+
</tr>
|
175
|
+
<% end %>
|
176
|
+
|
177
|
+
<tr><td class='headercell' colspan=2><h3>Table Settings</h3></td></tr>
|
178
|
+
<tr>
|
179
|
+
<td class='labelcell'>Background Colors:</td>
|
180
|
+
<td>
|
181
|
+
<input type="hidden" name="colors_table_background_offset" class="cytoSlider" data-label="Background Offset" data-unit="%" data-min=-100 data-max=100 />
|
182
|
+
<input type="hidden" name="colors_table_opacity_offset" class="cytoSlider" data-label="Table Opacity" data-unit="%" value="<%=Cytoplasm.vars('colors_table_opacity_offset')%>" />
|
183
|
+
<input type="hidden" name="colors_table_border_offset" class="cytoSlider" data-min=-100 data-max=100 data-label="Border Offset" data-unit="%" />
|
184
|
+
</td>
|
185
|
+
</tr>
|
186
|
+
<tr>
|
187
|
+
<td class='labelcell'>Button Settings:</td>
|
188
|
+
<td>
|
189
|
+
<input type="hidden" name="button_gradient_amount" class="cytoSlider" data-label="Gradient Amount" data-unit="%" value="<%=Cytoplasm.vars('button_gradient_amount')%>" />
|
190
|
+
<input type="hidden" name="button_border_offset" class="cytoSlider" data-label="Border Offset" data-unit="%" data-min=-100 data-max=100 value="<%=Cytoplasm.vars('button_border_offset')%>" />
|
191
|
+
</td>
|
192
|
+
</tr>
|
193
|
+
|
194
|
+
<tr><td colspan=2><button class="cytoButton large">Save Settings</button></td></tr>
|
195
|
+
</table>
|
196
|
+
</form>
|
197
|
+
|
198
|
+
<script type="text/javascript">
|
199
|
+
(function($){
|
200
|
+
$.Cytoplasm("ready",function(){
|
201
|
+
// Get data about what we're editing from PHP
|
202
|
+
var _editing = "<%=params[:editing]%>";
|
203
|
+
|
204
|
+
// Layout
|
205
|
+
// Layout Mode
|
206
|
+
$('input[name=layout_mode]').cytoRadio("value",$.Cytoplasm("vars","layout.mode"));
|
207
|
+
// Main Content Padding
|
208
|
+
$('input[name=layout_padding]').cytoSlider("options",{widget:{slider:{options:{change:function(e,ui){
|
209
|
+
$('#main_content').css("padding",$(this).slider("value"));
|
210
|
+
setTimeout(function(){$(window).trigger("resize");},1000);
|
211
|
+
}}}}});
|
212
|
+
|
213
|
+
// jQuery UI Theme
|
214
|
+
$('select[name=layout_jqueryui_theme]').cytoSelect("value",$.Cytoplasm("conf","jqueryui.theme"));
|
215
|
+
|
216
|
+
// Logo
|
217
|
+
// Logo Position
|
218
|
+
var top;
|
219
|
+
var custom_settings = $('#logo_position_custom_settings').hide().children('h4:first-child').css({margin:"10px 0px",padding:0}).end();
|
220
|
+
$('input[name=logo_position]').cytoRadio("options",{
|
221
|
+
events:{
|
222
|
+
change:function(e){
|
223
|
+
switch ($(this).cytoRadio("value")) {
|
224
|
+
case "badge":
|
225
|
+
top = 10;
|
226
|
+
if (custom_settings.is(':visible')) custom_settings.hide(400);
|
227
|
+
break;
|
228
|
+
case "nav":
|
229
|
+
top = -66;
|
230
|
+
if (custom_settings.is(':visible')) custom_settings.hide(400);
|
231
|
+
break;
|
232
|
+
case "custom":
|
233
|
+
custom_settings.show(400,function(){$('input[name=logo_position_mode]').cytoRadio("refresh");});
|
234
|
+
break;
|
235
|
+
default:return false;
|
236
|
+
}
|
237
|
+
$('#logo').css({top:top});
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}).cytoRadio("value",$.Cytoplasm("vars","layout.header.logo.position"));
|
241
|
+
$('input[name=logo_position_mode]').cytoRadio("options",{events:{change:function(e){$('#logo').css('position',$(this).cytoRadio('value'));}}}).cytoRadio("value",$.Cytoplasm("vars","layout.header.logo.position"));
|
242
|
+
$('input[name=logo_x_offset]').cytoSlider("value",$.Cytoplasm("vars","layout.header.logo.x"));
|
243
|
+
$('input[name=logo_y_offset]').cytoSlider("value",$.Cytoplasm("vars","layout.header.logo.y"));
|
244
|
+
|
245
|
+
// Logo Side
|
246
|
+
$('input[name=logo_side]').cytoRadio("options",{
|
247
|
+
events:{
|
248
|
+
change:function(e){
|
249
|
+
switch ($(this).cytoRadio("value")) {
|
250
|
+
case "left":
|
251
|
+
$('#logo').css({left:10,right:''});
|
252
|
+
break;
|
253
|
+
case "center":
|
254
|
+
$('#logo').css({left:($(window).width()/2)-($('#logo').width()/2),right:''});
|
255
|
+
break;
|
256
|
+
case "right":
|
257
|
+
$('#logo').css({right:10,left:''});
|
258
|
+
break;
|
259
|
+
default:return false;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}).cytoRadio("value",$.Cytoplasm("vars","layout.header.logo.align"));
|
264
|
+
// Offset sliders
|
265
|
+
$('input[name=logo_x_offset]').cytoSlider("options",{
|
266
|
+
widget:{
|
267
|
+
slider:{
|
268
|
+
options:{
|
269
|
+
min:-($(window).width()-$('#logo').outerWidth(true)),
|
270
|
+
max:($(window).width()-$('#logo').outerWidth(true))
|
271
|
+
}
|
272
|
+
}
|
273
|
+
},
|
274
|
+
events:{
|
275
|
+
change:function(e){
|
276
|
+
var side = $('input[name=logo_side]').cytoRadio("value");
|
277
|
+
var invert = (side == "right") ? -1 : 1;
|
278
|
+
$('#logo').css(side,parseInt($(this).val())*invert);
|
279
|
+
}
|
280
|
+
}
|
281
|
+
});
|
282
|
+
$('input[name=logo_y_offset]').cytoSlider("options",{
|
283
|
+
widget:{
|
284
|
+
slider:{
|
285
|
+
options:{
|
286
|
+
min:-($(window).height()-$('#logo').outerHeight(true)),
|
287
|
+
max:($(window).height()-$('#logo').outerHeight(true))
|
288
|
+
}
|
289
|
+
}
|
290
|
+
},
|
291
|
+
events:{change:function(e){$('#logo').css("top",$(this).val());}}
|
292
|
+
});
|
293
|
+
|
294
|
+
// Nav
|
295
|
+
// Nav Side
|
296
|
+
$('input[name=nav_side]').cytoRadio("options",{events:{change:function(e){$('header > nav > ul').css("text-align",$(this).cytoRadio("value"));}}}).cytoRadio("value",$.Cytoplasm("vars","layout.header.nav.align"));
|
297
|
+
// Nav Background
|
298
|
+
$('input[name=nav_background_mode]').cytoRadio("options",{
|
299
|
+
events:{
|
300
|
+
change:function(e){
|
301
|
+
var $this = $(this);
|
302
|
+
var showIt = function(){$(".nav-mode-wrapper[data-mode='"+$this.cytoRadio("value")+"']").show(400,function(){$(this).find('input[type=colorpicker]').cytoColorPicker("resize");});};
|
303
|
+
if ($('.nav-mode-wrapper:visible').length) $('.nav-mode-wrapper:visible').hide(400,showIt);
|
304
|
+
else showIt();
|
305
|
+
}
|
306
|
+
}
|
307
|
+
}).cytoRadio("value",$.Cytoplasm("vars","layout.header.nav.background"));
|
308
|
+
$('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}}}});
|
309
|
+
$('input[name=nav_background_color]').cytoColorPicker("value",$.Cytoplasm("vars","layout.header.nav.background"));
|
310
|
+
|
311
|
+
// Fetch fonts
|
312
|
+
$.cytoAjax("/cytoplasm/fonts/fetch_all",function(data){
|
313
|
+
console.log(data);
|
314
|
+
|
315
|
+
// Directory select
|
316
|
+
var fds = $('input[name=fonts_directory]');
|
317
|
+
var ffs = $('#fontfamilyselect');
|
318
|
+
var iffs = $('.ind_font_fam_select');
|
319
|
+
var ifs = $('.ind_font_select');
|
320
|
+
|
321
|
+
/*
|
322
|
+
// Fetch family details
|
323
|
+
$.cytoAjax("settings/fs_fetch_family.php",{family:f.family_urlname},function(data){
|
324
|
+
ifs.each(function(){
|
325
|
+
var select = $(this);
|
326
|
+
|
327
|
+
// Populate list
|
328
|
+
var fam = {};
|
329
|
+
$.each(data.family,function(i,member){
|
330
|
+
fam[member.fontface_name] = member;
|
331
|
+
select.append($('<option />').val(member.fontface_name).html(member.fontface_name+" ("+member.style_name+")"));
|
332
|
+
});
|
333
|
+
// Try to select defaults
|
334
|
+
var font = _page.less["fonts_"+select.data('style').toLowerCase()]
|
335
|
+
if (font.charAt(0)=='"') font = font.slice(1,-1);
|
336
|
+
if (fam[font] != null) select.val(font);
|
337
|
+
else $.each(fam,function(ffname,member){
|
338
|
+
if (member.style_name.indexOf(select.data('style'))>-1 || member.style_name.indexOf(select.data('style').toLowerCase())>-1) {
|
339
|
+
select.val(ffname);
|
340
|
+
return false;
|
341
|
+
}
|
342
|
+
});
|
343
|
+
// Set preview image and refresh cytoSelect
|
344
|
+
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();
|
345
|
+
select.cytoSelect("refresh").data('font',fam[select.val()]);
|
346
|
+
});
|
347
|
+
});
|
348
|
+
*/
|
349
|
+
|
350
|
+
fds.cytoRadio("value",$.Cytoplasm("conf","fontloader.directory")).cytoRadio("options",{
|
351
|
+
events:{
|
352
|
+
change:$.debounce(100,true,function(e){
|
353
|
+
var fonts = {};
|
354
|
+
var imported = {};
|
355
|
+
switch ($(this).cytoRadio("value")) {
|
356
|
+
case "fontsquirrel":
|
357
|
+
if (!$('#font_import_button').is(':visible')) $('#font_import_button').show(400);
|
358
|
+
var importedFamily = {};
|
359
|
+
$.each(data.fontsquirrel,function(fam,f){fonts[fam] = f.family_name;});
|
360
|
+
if (data.imported.length>0) {
|
361
|
+
$.each(data.imported,function(fam,f){imported[fam] = fam;});
|
362
|
+
iffs.cytoSelect("update",imported);
|
363
|
+
}
|
364
|
+
break;
|
365
|
+
case "googlewebfonts":
|
366
|
+
if ($('#font_import_button').is(':visible')) $('#font_import_button').hide(400);
|
367
|
+
$.each(data.googlewebfonts,function(fam,f){fonts[fam] = fam;});
|
368
|
+
break;
|
369
|
+
default:return false;
|
370
|
+
}
|
371
|
+
ffs.cytoSelect("update",fonts);
|
372
|
+
})
|
373
|
+
}
|
374
|
+
});
|
375
|
+
|
376
|
+
ffs.cytoSelect("options",{
|
377
|
+
events:{
|
378
|
+
change:function(cy,e){
|
379
|
+
var dir = fds.cytoRadio("value");
|
380
|
+
var f = data[dir][$(this).cytoSelect("value")];
|
381
|
+
if (f!=null) switch (dir) {
|
382
|
+
case "fontsquirrel":
|
383
|
+
// Check if font has already been imported
|
384
|
+
if (data.imported.length>0 && data.imported[f.family_urlname] != null) $('#font_import_button').addClass('active').html("Font Family Imported");
|
385
|
+
else $('#font_import_button').removeClass('active').html("Import Font Family");
|
386
|
+
|
387
|
+
break;
|
388
|
+
case "googlewebfonts":
|
389
|
+
|
390
|
+
break;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
}
|
394
|
+
});
|
395
|
+
|
396
|
+
// Font Import Button
|
397
|
+
$('#font_import_button').css({"margin-top":10}).click(function(e){
|
398
|
+
e.preventDefault();
|
399
|
+
var $this = $(this);
|
400
|
+
var f = data[fds.cytoRadio("value")][ffs.cytoSelect("value")];
|
401
|
+
if (!$this.hasClass('active')) {
|
402
|
+
// Import font
|
403
|
+
$.cytoAjax("settings/fs_import.php",{family:f},function(data){
|
404
|
+
$.cytoAjaxResponse('Font "'+f.family_name+'" has been imported successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
|
405
|
+
$this.addClass('active').html("Font Family Imported");
|
406
|
+
});
|
407
|
+
} else {
|
408
|
+
// Remove font
|
409
|
+
if (confirm("Are you sure you want to remove this font from your fonts library?")) $.cytoAjax("settings/fs_remove.php",{family:f},function(data){
|
410
|
+
$.cytoAjaxResponse('Font "'+f.family_name+'" has been removed successfully.<br /><a href="#" onClick="window.location.reload();">You must reload to apply these changes.</a>');
|
411
|
+
$this.removeClass('active').html("Import Font Family");
|
412
|
+
});
|
413
|
+
}
|
414
|
+
});
|
415
|
+
|
416
|
+
// Individual font selects
|
417
|
+
$('.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)"});
|
418
|
+
iffs.cytoSelect("options",{
|
419
|
+
widget:{
|
420
|
+
valueButton:{
|
421
|
+
css:{
|
422
|
+
'border-top-left-radius':0,
|
423
|
+
'border-bottom-left-radius':0
|
424
|
+
}
|
425
|
+
},
|
426
|
+
arrowButton:{
|
427
|
+
css:{
|
428
|
+
'border-top-right-radius':0,
|
429
|
+
'border-bottom-right-radius':0
|
430
|
+
}
|
431
|
+
}
|
432
|
+
},
|
433
|
+
events:{
|
434
|
+
change:function(cy,e){
|
435
|
+
if (data.imported[$(this).cytoSelect("value")] == undefined) return;
|
436
|
+
var subsets = {};
|
437
|
+
var fs = $('select[name="'+$(this).attr('name').split("_").slice(0,-1).join("_")+'"]');
|
438
|
+
$.each(data.imported[$(this).cytoSelect("value")],function(i,f){subsets[f.fontface_name] = f.fontface_name;});
|
439
|
+
fs.cytoSelect("update",subsets).cytoSelect("value",$.Cytoplasm("vars","fonts.faces."+fs.data('style').toLowerCase()));
|
440
|
+
}
|
441
|
+
}
|
442
|
+
});
|
443
|
+
|
444
|
+
ifs.cytoSelect("options",{
|
445
|
+
widget:{
|
446
|
+
valueButton:{css:{'border-top-left-radius':0}},
|
447
|
+
arrowButton:{css:{'border-top-right-radius':0}},
|
448
|
+
optionsList:{
|
449
|
+
li:{
|
450
|
+
hover:function(cy,e){
|
451
|
+
var $this = cy.widget.wrapper.element.children('select.cytoSelect');
|
452
|
+
var fs = $('select[name="'+$this.attr('name')+'_family"]');
|
453
|
+
$(this).css({background:$.Cytoplasm("vars","colors.global.accent")});
|
454
|
+
if (data.imported.length>0) {
|
455
|
+
var font = data.imported[fs.cytoSelect("value")][$this.cytoSelect("value")];
|
456
|
+
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();
|
457
|
+
} else {
|
458
|
+
|
459
|
+
}
|
460
|
+
}
|
461
|
+
}
|
462
|
+
}
|
463
|
+
},
|
464
|
+
events:{
|
465
|
+
change:function(cy,e){
|
466
|
+
var fs = $('select[name="'+$(this).attr('name')+'_family"]');
|
467
|
+
if (data.imported>0) {
|
468
|
+
var font = data.imported[fs.cytoSelect("value")][$(this).cytoSelect("value")];
|
469
|
+
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();
|
470
|
+
} else {
|
471
|
+
|
472
|
+
}
|
473
|
+
}
|
474
|
+
}
|
475
|
+
});
|
476
|
+
});
|
477
|
+
|
478
|
+
// Font size sliders
|
479
|
+
$.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());}}});});
|
480
|
+
|
481
|
+
// Color Pickers
|
482
|
+
var colorTweak = function(color,h,s,l,a) {
|
483
|
+
if (color==null || h==null) return color;
|
484
|
+
if (s==null) s=0;
|
485
|
+
if (l==null) l=0;
|
486
|
+
if (a==null) a=1;
|
487
|
+
color = color.hue(color.hue()+h).saturation(color.saturation()+s).lightness(color.lightness()+l).alpha(a);
|
488
|
+
return color.toHslaString();
|
489
|
+
};
|
490
|
+
var percentToDecimal = function(percent) {return parseInt(percent)/100;};
|
491
|
+
var layoutColorUpdate = function() {
|
492
|
+
var color = $('input[name=colors_background]').val();
|
493
|
+
try {
|
494
|
+
color = $.Color(color);
|
495
|
+
var l = (color.lightness!=null) ? parseFloat(color.lightness()) : 0;
|
496
|
+
$('body').css({
|
497
|
+
"background-color":color,
|
498
|
+
color:$('input[name=colors_text]').val()
|
499
|
+
});
|
500
|
+
$('.formTable td').css({
|
501
|
+
"background-color":colorTweak(color,0,0,percentToDecimal($('input[name=colors_table_background_offset]').val()),percentToDecimal($('input[name=colors_table_opacity_offset]').val())),
|
502
|
+
"border-color":colorTweak(color,0,0,percentToDecimal($('input[name=colors_table_border_offset]').val()))
|
503
|
+
});
|
504
|
+
/*$('button').css({
|
505
|
+
"border-color":"1px solid "+((l<0.5)?colorTweak(color,0,0,percentToDecimal($('input[name=button_border_offset]').val())):"#333333"),
|
506
|
+
"background":"linear-gradient(to bottom,"+colorTweak(color,0,0,percentToDecimal($('input[name=button_gradient_amount]').val()))+" 0%,"+colorTweak(color,0,0,-percentToDecimal($('input[name=button_gradient_amount]').val()))+" 100%) no-repeat scroll 0 0 transparent",
|
507
|
+
"color":((l<0.5)?"white":"black")
|
508
|
+
});*/
|
509
|
+
} catch (e) {
|
510
|
+
console.warn("There was an error updating the layout! "+e);
|
511
|
+
return false;
|
512
|
+
}
|
513
|
+
};
|
514
|
+
|
515
|
+
$('input[name=colors_background]').cytoColorPicker("value",$.Cytoplasm("vars","colors.global.background"));
|
516
|
+
$('input[type=colorpicker]').cytoColorPicker("options",{events:{change:layoutColorUpdate}});
|
517
|
+
// Set up sliders
|
518
|
+
$.each(['colors_table_background_offset','colors_table_opacity_offset','colors_table_border_offset','button_gradient_amount','button_border_offset'],function(i,prop){$('input[name="'+prop+'"]').cytoSlider("options",{events:{change:layoutColorUpdate}});});
|
519
|
+
|
520
|
+
// Form Submission
|
521
|
+
$('#site_settings_form').submit(function(e){
|
522
|
+
e.preventDefault();
|
523
|
+
$.cytoAjax("settings/save_layout.php",{form:$(':input:not([data-exclude=true])',this).serializeArray()},function(data){
|
524
|
+
$.cytoAjaxResponse("Your settings were saved successfully.<br /><a href='dash'>Return to dashboard</a>");
|
525
|
+
});
|
526
|
+
});
|
527
|
+
});
|
528
|
+
})(jQuery);
|
529
|
+
</script>
|