From 8e7123dd8408d4d5e8af23dacd1ade47ec6f98ba Mon Sep 17 00:00:00 2001 From: Matthew Harrison-Jones Date: Mon, 13 May 2013 18:25:16 +0100 Subject: [PATCH] Custom inputs using iCheck See #7 --- core/admin/assets/js/settings.js | 4 ++ core/admin/assets/lib/icheck/css/grey.png | Bin 0 -> 2186 bytes core/admin/assets/lib/icheck/css/grey@2x.png | Bin 0 -> 4483 bytes core/admin/assets/lib/icheck/css/icheck.css | 62 ++++++++++++++++++ .../assets/lib/icheck/jquery.icheck.min.js | 11 ++++ core/admin/views/default.hbs | 2 + 6 files changed, 79 insertions(+) create mode 100644 core/admin/assets/lib/icheck/css/grey.png create mode 100644 core/admin/assets/lib/icheck/css/grey@2x.png create mode 100644 core/admin/assets/lib/icheck/css/icheck.css create mode 100644 core/admin/assets/lib/icheck/jquery.icheck.min.js diff --git a/core/admin/assets/js/settings.js b/core/admin/assets/js/settings.js index 8f458d93e4..6ad3eb1159 100644 --- a/core/admin/assets/js/settings.js +++ b/core/admin/assets/js/settings.js @@ -16,6 +16,10 @@ $(document).ready(function() { $('.settings-menu li').on('click', changePage); + + $('input').iCheck({ + checkboxClass: 'icheckbox_square-grey' + }); }); }(jQuery)); \ No newline at end of file diff --git a/core/admin/assets/lib/icheck/css/grey.png b/core/admin/assets/lib/icheck/css/grey.png new file mode 100644 index 0000000000000000000000000000000000000000..f69375854d3c5a283121d10352be8a1729a16cc4 GIT binary patch literal 2186 zcmV;52zB>~P)Z%D!>FuvY(_oi& z45m$JV~n1H4;m)Kf|MM~@vBoy6qFJkuXLd|w$JKkKYFKlfr& z20jOzzyX3_0Q7=((2P0;BFwQwh%rBz#;wgjqkh)FCnUL2W7gd0e<)ZFYh%aeMeqtZ z4t@igKo7VFxIifzqZ7OVegOg!Tf+Uh5*GR&A{)V8G-Ak)Mhe8(xN-U889!@-o{*KG z0=U5i;01n=39>;x8*e9GUyp4AYCS5kCERb9u+U#X9t2g9{FGUrL_Z|dPshYp^fYYV z2e3H<-sh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Kc$Ri zN>959qZMk^xKTad@OE1#%s=@1cf1>JC!M4pch&ehf;4yb3tobJ`qS*t)n!P2Bq>m9 z!Cd6^Qnxz(^lO`gm}gtp))7)*{;ezHf*6M*cy!4x8n^INx(B_!gTWfgr6rC(IGl@0cm!v|KDhO4_QNQl+@D+PF)UeE+oWa^T(d88d`QB|d;WZB zMqIOTKb}8>;ZGF{4CJbnr7I)^%Gy`L;uQ*qP}~sp_@Nk67jrUn;CyToWR5A{2r+={t@AA4NccJSc5ct_1Dy5Fy!zRYq+5LQros8c$Lcb&Pw|Vk=gLVl zszn@Uc!kC#Qm9mshjE8Cm1@T^06K6P|9rS#Aa_gBpMX_K&$`lbMm#)uDqR@ zRO~WV9-LmeHGj(gApT7;shx71-(2_fC2jhjN(Xhw>h{61oSrk|&|h~w4Drz99C zy8EodQ5I@o@@SJ?3hZ9(gqGN9M$m*HC-ggHTd(~q{z2%&uPRj=m%ZmIat4mSLY1oY zA<^I54c2?Nf;h@~UB3E%W=U$N|DQcYy~W%&<$v!4dk{{WPIVP`y>>oVgdFXhZEN7Z G$^QeNB@0pj literal 0 HcmV?d00001 diff --git a/core/admin/assets/lib/icheck/css/icheck.css b/core/admin/assets/lib/icheck/css/icheck.css new file mode 100644 index 0000000000..ffef066fcc --- /dev/null +++ b/core/admin/assets/lib/icheck/css/icheck.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, grey +----------------------------------- */ +.icheckbox_square-grey, +.iradio_square-grey { + display: block; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; + float: left; + margin-right: 6px; +} + +.icheckbox_square-grey { + background-position: 0 0; +} +.icheckbox_square-grey.hover { + background-position: -24px 0; +} +.icheckbox_square-grey.checked { + background-position: -48px 0; +} +.icheckbox_square-grey.disabled { + background-position: -72px 0; + cursor: default; +} +.icheckbox_square-grey.checked.disabled { + background-position: -96px 0; +} + +.iradio_square-grey { + background-position: -120px 0; +} +.iradio_square-grey.hover { + background-position: -144px 0; +} +.iradio_square-grey.checked { + background-position: -168px 0; +} +.iradio_square-grey.disabled { + background-position: -192px 0; + cursor: default; +} +.iradio_square-grey.checked.disabled { + background-position: -216px 0; +} + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), +only screen and (-moz-min-device-pixel-ratio: 1.5), +only screen and (-o-min-device-pixel-ratio: 3/2), +only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-grey, + .iradio_square-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/core/admin/assets/lib/icheck/jquery.icheck.min.js b/core/admin/assets/lib/icheck/jquery.icheck.min.js new file mode 100644 index 0000000000..a3af264055 --- /dev/null +++ b/core/admin/assets/lib/icheck/jquery.icheck.min.js @@ -0,0 +1,11 @@ +/*! + * iCheck v0.8.5 jQuery plugin, http://git.io/uhUPMA + */ +(function(f,m,z,u,k,r,l,n,D,t,v,s){function A(a,c,j){var d=a[0],b=/ble/.test(j)?r:k;active="update"==j?{checked:d[k],disabled:d[r]}:d[b];if(/^ch|di/.test(j)&&!active)w(a,b);else if(/^un|en/.test(j)&&active)x(a,b);else if("update"==j)for(var b in active)active[b]?w(a,b,!0):x(a,b,!0);else if(!c||"toggle"==j)c||a.trigger("ifClicked"),active?d[l]!==u&&x(a,b):w(a,b)}function w(a,c,j){var d=a[0],b=a.parent(),E=c==r?"enabled":"un"+k,n=e(a,E+g(d[l])),h=e(a,c+g(d[l]));if(!0!==d[c]&&!j&&(d[c]=!0,a.trigger("ifChanged").trigger("if"+ + g(c)),c==k&&d[l]==u&&d.name)){j=a.closest("form");var p='input[name="'+d.name+'"]',p=j.length?j.find(p):f(p);p.each(function(){this!==d&&f(this).data(m)&&x(f(this),c)})}d[r]&&e(a,s,!0)&&b.find("."+m+"-helper").css(s,"default");b[t](h||e(a,c));b[v](n||e(a,E)||"")}function x(a,c,j){var d=a[0],b=a.parent(),f=c==r?"enabled":"un"+k,n=e(a,f+g(d[l])),h=e(a,c+g(d[l]));!1!==d[c]&&!j&&(d[c]=!1,a.trigger("ifChanged").trigger("if"+g(f)));!d[r]&&e(a,s,!0)&&b.find("."+m+"-helper").css(s,"pointer");b[v](h||e(a, + c)||"");b[t](n||e(a,f))}function F(a,c){a.data(m)&&(a.parent().html(a.attr("style",a.data(m).s||"").trigger(c||"")),a.off(".i").unwrap(),f('label[for="'+a[0].id+'"]').add(a.closest("label")).off(".i"))}function e(a,c,f){if(a.data(m))return a.data(m).o[c+(f?"":"Class")]}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}f.fn[m]=function(a,c){var j=navigator.userAgent,d=/ipad|iphone|ipod/i.test(j),b=":"+z+", :"+u,e=f(),g=function(a){a.each(function(){var a=f(this);e=a.is(b)?e.add(a):e.add(a.find(b))})}; + if(/^(check|uncheck|toggle|disable|enable|update|destroy)$/.test(a))return g(this),e.each(function(){var d=f(this);"destroy"==a?F(d,"ifDestroyed"):A(d,!0,a);f.isFunction(c)&&c()});if("object"==typeof a||!a){var h=f.extend({checkedClass:k,disabledClass:r,labelHover:!0},a),p=h.handle,s=h.hoverClass||"hover",I=h.focusClass||"focus",G=h.activeClass||"active",H=!!h.labelHover,C=h.labelHoverClass||"hover",y=(""+h.increaseArea).replace("%","")|0;if(p==z||p==u)b=":"+p;-50>y&&(y=-50);g(this);return e.each(function(){var a= + f(this);F(a);var c=this,b=c.id,e=-y+"%",g=100+2*y+"%",g={position:"absolute",top:e,left:e,display:"block",width:g,height:g,margin:0,padding:0,background:"#fff",border:0,opacity:0},e=d||/android|blackberry|windows phone|opera mini/i.test(j)?{position:"absolute",visibility:"hidden"}:y?g:{position:"absolute",opacity:0},p=c[l]==z?h.checkboxClass||"i"+z:h.radioClass||"i"+u,B=f('label[for="'+b+'"]').add(a.closest("label")),q=a.wrap('
').trigger("ifCreated").parent().append(h.insert), + g=f('').css(g).appendTo(q);a.data(m,{o:h,s:a.attr("style")}).css(e);h.inheritClass&&q[t](c.className);h.inheritID&&b&&q.attr("id",m+"-"+b);"static"==q.css("position")&&q.css("position","relative");A(a,!0,"update");if(B.length)B.on(n+".i mouseenter.i mouseleave.i "+D,function(b){var e=b[l],g=f(this);if(!c[r])if(e==n?A(a,!1,!0):H&&(/ve|nd/.test(e)?(q[v](s),g[v](C)):(q[t](s),g[t](C))),d)b.stopPropagation();else return!1});a.on(n+".i focus.i blur.i keyup.i keydown.i keypress.i", + function(b){var d=b[l];b=b.keyCode;if(d==n)return!1;if("keydown"==d&&32==b)return c[l]==u&&c[k]||(c[k]?x(a,k):w(a,k)),!1;if("keyup"==d&&c[l]==u)!c[k]&&w(a,k);else if(/us|ur/.test(d))q["blur"==d?v:t](I)});g.on(n+" mousedown mouseup mouseover mouseout "+D,function(b){var e=b[l],f=/wn|up/.test(e)?G:s;if(!c[r]){if(e==n)A(a,!1,!0);else{if(/wn|er|in/.test(e))q[t](f);else q[v](f+" "+G);if(B.length&&H&&f==s)B[/ut|nd/.test(e)?v:t](C)}if(d)b.stopPropagation();else return!1}})})}return this}})(jQuery,"iCheck", + "checkbox","radio","checked","disabled","type","click","touchbegin.i touchend.i","addClass","removeClass","cursor"); \ No newline at end of file diff --git a/core/admin/views/default.hbs b/core/admin/views/default.hbs index c30c791654..23c133b076 100644 --- a/core/admin/views/default.hbs +++ b/core/admin/views/default.hbs @@ -24,11 +24,13 @@ + + {{> navbar}}