ZURB-foundation 2.1.3.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,33 +23,41 @@ jQuery(document).ready(function ($) {
23
23
  }
24
24
  appendCustomMarkup('checkbox');
25
25
  appendCustomMarkup('radio');
26
-
27
- $('form.custom select').each(function () {
28
- var $this = $(this),
26
+
27
+ function appendCustomSelect(sel) {
28
+ var $this = $(sel),
29
29
  $customSelect = $this.next('div.custom.dropdown'),
30
30
  $options = $this.find('option'),
31
31
  maxWidth = 0,
32
32
  $li;
33
-
34
- if ($customSelect.length === 0) {
33
+
34
+ if ($customSelect.length === 0) {
35
35
  $customSelect = $('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');
36
36
  $options.each(function () {
37
37
  $li = $('<li>' + $(this).html() + '</li>');
38
38
  $customSelect.find('ul').append($li);
39
39
  });
40
40
  $customSelect.prepend('<a href="#" class="current">' + $options.first().html() + '</a>');
41
-
41
+
42
42
  $this.after($customSelect);
43
43
  $this.hide();
44
+
45
+ } else {
46
+ // refresh the ul with options from the select in case the supplied markup doesn't match
47
+ $customSelect.find('ul').html('');
48
+ $options.each(function () {
49
+ $li = $('<li>' + $(this).html() + '</li>');
50
+ $customSelect.find('ul').append($li);
51
+ });
44
52
  }
45
-
53
+
46
54
  $options.each(function (index) {
47
55
  if (this.selected) {
48
56
  $customSelect.find('li').eq(index).addClass('selected');
49
57
  $customSelect.find('.current').html($(this).html());
50
58
  }
51
59
  });
52
-
60
+
53
61
  $customSelect.find('li').each(function () {
54
62
  $customSelect.addClass('open');
55
63
  if ($(this).outerWidth() > maxWidth) {
@@ -59,11 +67,51 @@ jQuery(document).ready(function ($) {
59
67
  });
60
68
  $customSelect.css('width', maxWidth + 18 + 'px');
61
69
  $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
70
+
71
+ }
72
+
73
+ $('form.custom select').each(function () {
74
+ appendCustomSelect(this);
62
75
  });
76
+
63
77
  });
64
78
 
65
79
  (function ($) {
66
80
 
81
+ function refreshCustomSelect($select) {
82
+ var maxWidth = 0,
83
+ $customSelect = $select.next();
84
+ $options = $select.find('option');
85
+ $customSelect.find('ul').html('');
86
+
87
+ $options.each(function () {
88
+ $li = $('<li>' + $(this).html() + '</li>');
89
+ $customSelect.find('ul').append($li);
90
+ });
91
+
92
+ // re-populate
93
+ $options.each(function (index) {
94
+ if (this.selected) {
95
+ $customSelect.find('li').eq(index).addClass('selected');
96
+ $customSelect.find('.current').html($(this).html());
97
+ }
98
+ });
99
+
100
+ // fix width
101
+ $customSelect.removeAttr('style')
102
+ .find('ul').removeAttr('style');
103
+ $customSelect.find('li').each(function () {
104
+ $customSelect.addClass('open');
105
+ if ($(this).outerWidth() > maxWidth) {
106
+ maxWidth = $(this).outerWidth();
107
+ }
108
+ $customSelect.removeClass('open');
109
+ });
110
+ $customSelect.css('width', maxWidth + 18 + 'px');
111
+ $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
112
+
113
+ }
114
+
67
115
  function toggleCheckbox($element) {
68
116
  var $input = $element.prev(),
69
117
  input = $input[0];
@@ -87,21 +135,25 @@ jQuery(document).ready(function ($) {
87
135
  $input.trigger('change');
88
136
  }
89
137
 
90
- $(document).on('click', 'form.custom span.custom.checkbox', function (event) {
138
+ $('form.custom span.custom.checkbox').live('click', function (event) {
91
139
  event.preventDefault();
92
140
  event.stopPropagation();
93
141
 
94
142
  toggleCheckbox($(this));
95
143
  });
96
144
 
97
- $(document).on('click', 'form.custom span.custom.radio', function (event) {
145
+ $('form.custom span.custom.radio').live('click', function (event) {
98
146
  event.preventDefault();
99
147
  event.stopPropagation();
100
148
 
101
149
  toggleRadio($(this));
102
150
  });
103
151
 
104
- $(document).on('click', 'form.custom label', function (event) {
152
+ $('form.custom select').live('change', function (event) {
153
+ refreshCustomSelect($(this));
154
+ });
155
+
156
+ $('form.custom label').live('click', function (event) {
105
157
  var $associatedElement = $('#' + $(this).attr('for')),
106
158
  $customCheckbox,
107
159
  $customRadio;
@@ -118,7 +170,7 @@ jQuery(document).ready(function ($) {
118
170
  }
119
171
  });
120
172
 
121
- $(document).on('click', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (event) {
173
+ $('form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector').live('click', function (event) {
122
174
  var $this = $(this),
123
175
  $dropdown = $this.closest('div.custom.dropdown');
124
176
 
@@ -135,7 +187,7 @@ jQuery(document).ready(function ($) {
135
187
  }
136
188
  });
137
189
 
138
- $(document).on('click', 'form.custom div.custom.dropdown li', function (event) {
190
+ $('form.custom div.custom.dropdown li').live('click', function (event) {
139
191
  var $this = $(this),
140
192
  $customDropdown = $this.closest('div.custom.dropdown'),
141
193
  $select = $customDropdown.prev(),
@@ -0,0 +1,4 @@
1
+ /* Modernizr 2.0.6 (Custom Build) | MIT & BSD
2
+ * Build: http://www.modernizr.com/download/#-touch-iepp-respond-mq-cssclasses-teststyles-prefixes-load
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function A(a,b){return!!~(""+a).indexOf(b)}function z(a,b){return typeof a===b}function y(a,b){return x(n.join(a+";")+(b||""))}function x(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),o={},p={},q={},r=[],s=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},t=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;s("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},u,v={}.hasOwnProperty,w;!z(v,c)&&!z(v.call,c)?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],c)};var B=function(c,d){var f=c.join(""),g=d.length;s(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9},g,d)}([,["@media (",n.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);o.touch=function(){return e.touch};for(var C in o)w(o,C)&&(u=C.toLowerCase(),e[u]=o[C](),r.push((e[u]?"":"no-")+u));x(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._prefixes=n,e.mq=t,e.testStyles=s,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+r.join(" "):"");return e}(this,this.document),function(a,b){function u(){r(!0)}a.respond={},respond.update=function(){},respond.mediaQueriesSupported=b;if(!b){var c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=j.getElementsByTagName("link"),l=[],m=function(){var b=k,c=b.length,d=0,e,f,g,i;for(;d<c;d++)e=b[d],f=e.href,g=e.media,i=e.rel&&e.rel.toLowerCase()==="stylesheet",!!f&&i&&!h[f]&&(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(f)||f.replace(RegExp.$1,"").split("/")[0]===a.location.host?l.push({href:f,media:g}):h[f]=!0);n()},n=function(){if(l.length){var a=l.shift();s(a.href,function(b){o(b,a.href,a.media),h[a.href]=!0,n()})}},o=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),g=d&&d.length||0,b=b.substring(0,b.lastIndexOf("/")),h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c,j=0,k,l,m,n,o;b.length&&(b+="/"),i&&(g=1);for(;j<g;j++){k=0,i?(l=c,f.push(h(a))):(l=d[j].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),n=l.split(","),o=n.length;for(;k<o;k++)m=n[k],e.push({media:m.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:f.length-1,minw:m.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:m.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}r()},p,q,r=function(a){var b="clientWidth",h=d[b],l=c.compatMode==="CSS1Compat"&&h||c.body[b]||h,m={},n=c.createDocumentFragment(),o=k[k.length-1],s=(new Date).getTime();if(a&&p&&s-p<i)clearTimeout(q),q=setTimeout(r,i);else{p=s;for(var t in e){var u=e[t];if(!u.minw&&!u.maxw||(!u.minw||u.minw&&l>=u.minw)&&(!u.maxw||u.maxw&&l<=u.maxw))m[u.media]||(m[u.media]=[]),m[u.media].push(f[u.rules])}for(var t in g)g[t]&&g[t].parentNode===j&&j.removeChild(g[t]);for(var t in m){var v=c.createElement("style"),w=m[t].join("\n");v.type="text/css",v.media=t,v.styleSheet?v.styleSheet.cssText=w:v.appendChild(c.createTextNode(w)),n.appendChild(v),g.push(v)}j.insertBefore(n,o.nextSibling)}},s=function(a,b){var c=t();if(!!c){c.open("GET",a,!0),c.onreadystatechange=function(){c.readyState==4&&(c.status==200||c.status==304)&&b(c.responseText)};if(c.readyState==4)return;c.send()}},t=function(){var a=!1,b=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest}],c=b.length;while(c--){try{a=b[c]()}catch(d){continue}break}return function(){return a}}();m(),respond.update=m,a.addEventListener?a.addEventListener("resize",u,!1):a.attachEvent&&a.attachEvent("onresize",u)}}(this,Modernizr.mq("only all")),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var e=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,j()):e(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){j()},0)):e(a)}},0)};e(c)}else c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload();m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
@@ -5,13 +5,14 @@ stylesheet 'sass/app.sass', :to => 'app.sass', :media => "screen, projector, pri
5
5
  stylesheet 'sass/ie.sass', :to => 'ie.sass', :condition => "IE lt 9"
6
6
 
7
7
  # Javascrips
8
- javascript 'javascripts/app.js', :to => 'app.js'
8
+ javascript 'javascripts/jquery.min.js', :to => 'jquery.min.js'
9
+ javascript 'javascripts/modernizr.foundation.js', :to => 'modernizr.foundation.js'
9
10
  javascript 'javascripts/forms.jquery.js', :to => 'forms.jquery.js'
10
11
  javascript 'javascripts/jquery.customforms.js', :to => 'jquery.customforms.js'
11
- javascript 'javascripts/jquery.min.js', :to => 'jquery.min.js'
12
12
  javascript 'javascripts/jquery.reveal.js', :to => 'jquery.reveal.js'
13
13
  javascript 'javascripts/jquery.orbit-1.3.0.js', :to => 'jquery.orbit-1.3.0.js'
14
14
  javascript 'javascripts/jquery.placeholder.min.js', :to => 'jquery.placeholder.min.js'
15
+ javascript 'javascripts/app.js', :to => 'app.js'
15
16
 
16
17
  # Make sure you list all the project template files here in the manifest.
17
18
  html 'index.html'
@@ -1,26 +1,14 @@
1
- @import ZURB/foundation
1
+ // ZURB Foundation
2
+ //-----------------------------------------
2
3
 
3
- // --------------------------------------------------
4
- // Table of Contents
5
- // --------------------------------------------------
6
- // :: Shared Styles
7
- // :: Page Name 1
8
- // :: Page Name 2
4
+ // ZURB Foundation settings
9
5
 
6
+ // $grid-max-width: 980px
7
+ // $grid-min-width: 800px
10
8
 
9
+ // ZURB Foundation settings
11
10
 
12
- // -----------------------------------------
13
- // Shared Styles
14
- // -----------------------------------------
11
+ @import ZURB-foundation
15
12
 
16
-
17
-
18
- // -----------------------------------------
19
- // Page Name 1
20
- // -----------------------------------------
21
-
22
-
23
-
24
- // -----------------------------------------
25
- // Page Name 2
26
- //------------------------------------------
13
+ // Project Styles
14
+ //-----------------------------------------
@@ -1,9 +1,9 @@
1
1
  @import ZURB/includes
2
2
 
3
- /* This is for all IE specfific style less than IE9. We hate IE. */
4
-
5
- // `IE styles
6
- //----------------------------------------------------------------------------------------------------
3
+ // IE styles
4
+ //----------------------------------------------
5
+ //
6
+ // IE specific styles less than IE9. We hate IE.
7
7
 
8
8
  div.panel
9
9
  border: 1px solid #ccc
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZURB-foundation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3.3
4
+ version: 2.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-21 00:00:00.000000000Z
12
+ date: 2012-01-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass
16
- requirement: &70119443291500 !ruby/object:Gem::Requirement
16
+ requirement: &70273933999000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.11.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70119443291500
24
+ version_requirements: *70273933999000
25
25
  description: ZURB Foundation ported over to work with the power of Compass.
26
26
  email: foundation@zurb.com
27
27
  executables: []
@@ -30,8 +30,9 @@ extra_rdoc_files: []
30
30
  files:
31
31
  - README.mkdn
32
32
  - lib/ZURB-foundation.rb
33
+ - stylesheets/_ZURB-foundation.sass
34
+ - stylesheets/ZURB/_buttons.sass
33
35
  - stylesheets/ZURB/_forms.sass
34
- - stylesheets/ZURB/_foundation.sass
35
36
  - stylesheets/ZURB/_globals.sass
36
37
  - stylesheets/ZURB/_grid.sass
37
38
  - stylesheets/ZURB/_includes.sass
@@ -66,6 +67,7 @@ files:
66
67
  - templates/project/javascripts/jquery.orbit-1.3.0.js
67
68
  - templates/project/javascripts/jquery.placeholder.min.js
68
69
  - templates/project/javascripts/jquery.reveal.js
70
+ - templates/project/javascripts/modernizr.foundation.js
69
71
  - templates/project/manifest.rb
70
72
  - templates/project/MIT-LICENSE.txt
71
73
  - templates/project/robots.txt
@@ -1,9 +0,0 @@
1
- @import includes
2
- @import globals
3
- @import typography
4
- @import grid
5
- @import ui
6
- @import forms
7
- @import orbit
8
- @import reveal
9
- @import mobile