zurb-foundation 2.1.0 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/build.rb CHANGED
@@ -13,25 +13,33 @@ ASSET_PATH = Pathname.new(File.dirname(__FILE__)).join("vendor", "assets")
13
13
  FileUtils.remove_dir ASSET_PATH, :force => true
14
14
 
15
15
  # Recreate vendor/assets
16
- FileUtils.mkdir_p ASSET_PATH.join("stylesheets")
17
- FileUtils.mkdir_p ASSET_PATH.join("javascripts")
16
+ FileUtils.mkdir_p ASSET_PATH.join("stylesheets", "foundation")
17
+ FileUtils.mkdir_p ASSET_PATH.join("javascripts", "foundation")
18
18
  FileUtils.mkdir_p ASSET_PATH.join("images", "foundation")
19
19
 
20
20
  # Create SCSS file, so we can usage image-url() helper
21
- File.open(ASSET_PATH.join("stylesheets", "foundation.scss"), "w") do |file|
21
+ File.open(ASSET_PATH.join("stylesheets", "foundation", "index.css"), "w") do |file|
22
+ file << "/*\n"
22
23
  FOUNDATION_CSS.each do |filename|
24
+ file << "*= require 'foundation/#{filename.gsub('.css','')}'\n"
23
25
  css_file = File.open(FOUNDATION_REPO_PATH.join("stylesheets", filename))
24
- file << css_file.read.gsub(/url\('?\.\.\/images\/([^\)']+)'?\)/, 'image-url("foundation/\1")')
25
- file << "\n\n"
26
+ File.open(ASSET_PATH.join("stylesheets", "foundation", "#{filename}.scss"), "w") do |include_file|
27
+ include_file << css_file.read.gsub(/url\('?\.\.\/images\/([^\)']+)'?\)/, 'image-url("foundation/\1")')
28
+ include_file << "\n\n"
29
+ end
26
30
  end
31
+ file << "*/"
27
32
  end
28
33
 
29
34
  # Create JS file
30
- File.open(ASSET_PATH.join("javascripts", "foundation.js"), "w") do |file|
35
+ File.open(ASSET_PATH.join("javascripts", "foundation", "index.js"), "w") do |file|
31
36
  FOUNDATION_JS.each do |filename|
37
+ file << "//= require 'foundation/#{File.basename(filename.gsub('.js',''))}'\n"
32
38
  js_file = File.open(FOUNDATION_REPO_PATH.join("javascripts", filename))
33
- file << js_file.read
34
- file << "\n\n"
39
+ File.open(ASSET_PATH.join("javascripts", "foundation", filename), "w") do |include_file|
40
+ include_file << js_file.read
41
+ include_file << "\n\n"
42
+ end
35
43
  end
36
44
  end
37
45
 
@@ -27,5 +27,5 @@
27
27
  <div class="container">
28
28
  <%%= yield %>
29
29
  </div>
30
- <body>
30
+ </body>
31
31
  </html>
@@ -1,4 +1,4 @@
1
1
  module Foundation
2
- COMMIT = "d2303eb1aacce4bdd18ee12c710dad78398b869c"
3
- VERSION = "2.1.0"
2
+ COMMIT = "e24518ce9b5ae1904cae0755650c3233af5a4f2e"
3
+ VERSION = "2.1.2"
4
4
  end
@@ -0,0 +1,78 @@
1
+ $(document).ready(function () {
2
+
3
+ /* Use this js doc for all application specific JS */
4
+
5
+ /* TABS --------------------------------- */
6
+ /* Remove if you don't need :) */
7
+
8
+ function activateTab($tab) {
9
+ var $activeTab = $tab.closest('dl').find('a.active'),
10
+ contentLocation = $tab.attr("href") + 'Tab';
11
+
12
+ //Make Tab Active
13
+ $activeTab.removeClass('active');
14
+ $tab.addClass('active');
15
+
16
+ //Show Tab Content
17
+ $(contentLocation).closest('.tabs-content').find('li').hide();
18
+ $(contentLocation).show();
19
+ }
20
+
21
+ $('dl.tabs').each(function () {
22
+ //Get all tabs
23
+ var tabs = $(this).children('dd').children('a');
24
+ tabs.click(function (e) {
25
+ activateTab($(this));
26
+ });
27
+ });
28
+
29
+ if (window.location.hash) {
30
+ activateTab($('a[href="' + window.location.hash + '"]'));
31
+ }
32
+
33
+
34
+ /* PLACEHOLDER FOR FORMS ------------- */
35
+ /* Remove this and jquery.placeholder.min.js if you don't need :) */
36
+
37
+ $('input, textarea').placeholder();
38
+
39
+ /* DROPDOWN NAV ------------- */
40
+ $('.nav-bar li a, .nav-bar li a:after').each(function() {
41
+ $(this).data('clicks', 0);
42
+ });
43
+ $('.nav-bar li a, .nav-bar li a:after').bind('touchend click', function(e){
44
+ e.stopPropagation();
45
+ e.preventDefault();
46
+ var f = $(this).siblings('.flyout');
47
+ $(this).data('clicks', ($(this).data('clicks') + 1));
48
+ if (!f.is(':visible') && f.length > 0) {
49
+ $('.nav-bar li .flyout').hide();
50
+ f.show();
51
+ }
52
+ });
53
+ $('.nav-bar li a, .nav-bar li a:after').bind(' touchend click', function(e) {
54
+ e.stopPropagation();
55
+ e.preventDefault();
56
+ if ($(this).data('clicks') > 1) {
57
+ window.location = $(this).attr('href');
58
+ }
59
+ });
60
+ $('.nav-bar').bind('touchend click', function(e) {
61
+ e.stopPropagation();
62
+ if (!$(e.target).parents('.nav-bar li .flyout') || $(e.target) != $('.nav-bar li .flyout')) {
63
+ e.preventDefault();
64
+ }
65
+ });
66
+ $('body').bind('touchend', function(e) {
67
+ if (!$(e.target).parents('.nav-bar li .flyout') || $(e.target) != $('.nav-bar li .flyout')) {
68
+ $('.nav-bar li .flyout').hide();
69
+ }
70
+ });
71
+
72
+ /* DISABLED BUTTONS ------------- */
73
+ /* Gives elements with a class of 'disabled' a return: false; */
74
+
75
+
76
+ });
77
+
78
+
@@ -0,0 +1,59 @@
1
+ /**
2
+ * jQuery.placeholder - Placeholder plugin for input fields
3
+ * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
4
+ * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
5
+ * Date: 2008/10/14
6
+ *
7
+ * @author Blair Mitchelmore
8
+ * @version 1.0.1
9
+ *
10
+ **/
11
+ new function($) {
12
+ $.fn.placeholder = function(settings) {
13
+ settings = settings || {};
14
+ var key = settings.dataKey || "placeholderValue";
15
+ var attr = settings.attr || "placeholder";
16
+ var className = settings.className || "placeholder";
17
+ var values = settings.values || [];
18
+ var block = settings.blockSubmit || false;
19
+ var blank = settings.blankSubmit || false;
20
+ var submit = settings.onSubmit || false;
21
+ var value = settings.value || "";
22
+ var position = settings.cursor_position || 0;
23
+
24
+
25
+ return this.filter(":input").each(function(index) {
26
+ $.data(this, key, values[index] || $(this).attr(attr));
27
+ }).each(function() {
28
+ if ($.trim($(this).val()) === "")
29
+ $(this).addClass(className).val($.data(this, key));
30
+ }).focus(function() {
31
+ if ($.trim($(this).val()) === $.data(this, key))
32
+ $(this).removeClass(className).val(value)
33
+ if ($.fn.setCursorPosition) {
34
+ $(this).setCursorPosition(position);
35
+ }
36
+ }).blur(function() {
37
+ if ($.trim($(this).val()) === value)
38
+ $(this).addClass(className).val($.data(this, key));
39
+ }).each(function(index, elem) {
40
+ if (block)
41
+ new function(e) {
42
+ $(e.form).submit(function() {
43
+ return $.trim($(e).val()) != $.data(e, key)
44
+ });
45
+ }(elem);
46
+ else if (blank)
47
+ new function(e) {
48
+ $(e.form).submit(function() {
49
+ if ($.trim($(e).val()) == $.data(e, key))
50
+ $(e).removeClass(className).val("");
51
+ return true;
52
+ });
53
+ }(elem);
54
+ else if (submit)
55
+ new function(e) { $(e.form).submit(submit); }(elem);
56
+ });
57
+ };
58
+ }(jQuery);
59
+
@@ -0,0 +1,6 @@
1
+ //= require 'foundation/jquery.reveal'
2
+ //= require 'foundation/jquery.orbit-1.3.0'
3
+ //= require 'foundation/forms.jquery'
4
+ //= require 'foundation/jquery.customforms'
5
+ //= require 'foundation/jquery.placeholder.min'
6
+ //= require 'foundation/app'
@@ -0,0 +1,169 @@
1
+ /*
2
+ * jQuery Custom Forms Plugin 1.0
3
+ * www.ZURB.com
4
+ * Copyright 2010, ZURB
5
+ * Free to use under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ */
8
+
9
+ jQuery(document).ready(function ($) {
10
+
11
+ function appendCustomMarkup(type) {
12
+ $('form.custom input:' + type).each(function () {
13
+ var $span = $('<span class="custom ' + type + '"></span>');
14
+ if ($(this).next('span.custom.' + type).length === 0) {
15
+ if (this.checked) {
16
+ $span.addClass('checked');
17
+ }
18
+ $(this)
19
+ .hide()
20
+ .after($span);
21
+ }
22
+ });
23
+ }
24
+ appendCustomMarkup('checkbox');
25
+ appendCustomMarkup('radio');
26
+
27
+ $('form.custom select').each(function () {
28
+ var $this = $(this),
29
+ $customSelect = $this.next('div.custom.dropdown'),
30
+ $options = $this.find('option'),
31
+ maxWidth = 0,
32
+ $li;
33
+
34
+ if ($customSelect.length === 0) {
35
+ $customSelect = $('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');
36
+ $options.each(function () {
37
+ $li = $('<li>' + $(this).html() + '</li>');
38
+ $customSelect.find('ul').append($li);
39
+ });
40
+ $customSelect.prepend('<a href="#" class="current">' + $options.first().html() + '</a>');
41
+
42
+ $this.after($customSelect);
43
+ $this.hide();
44
+ }
45
+
46
+ $options.each(function (index) {
47
+ if (this.selected) {
48
+ $customSelect.find('li').eq(index).addClass('selected');
49
+ $customSelect.find('.current').html($(this).html());
50
+ }
51
+ });
52
+
53
+ $customSelect.find('li').each(function () {
54
+ $customSelect.addClass('open');
55
+ if ($(this).outerWidth() > maxWidth) {
56
+ maxWidth = $(this).outerWidth();
57
+ }
58
+ $customSelect.removeClass('open');
59
+ });
60
+ $customSelect.css('width', maxWidth + 18 + 'px');
61
+ $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
62
+ });
63
+ });
64
+
65
+ (function ($) {
66
+
67
+ function toggleCheckbox($element) {
68
+ var $input = $element.prev(),
69
+ input = $input[0];
70
+
71
+ input.checked = ((input.checked) ? false : true);
72
+ $element.toggleClass('checked');
73
+
74
+ $input.trigger('change');
75
+ }
76
+
77
+ function toggleRadio($element) {
78
+ var $input = $element.prev(),
79
+ input = $input[0];
80
+
81
+ $('input:radio[name="' + $input.attr('name') + '"]').each(function () {
82
+ $(this).next().removeClass('checked');
83
+ });
84
+ input.checked = ((input.checked) ? false : true);
85
+ $element.toggleClass('checked');
86
+
87
+ $input.trigger('change');
88
+ }
89
+
90
+ $(document).on('click', 'form.custom span.custom.checkbox', function (event) {
91
+ event.preventDefault();
92
+ event.stopPropagation();
93
+
94
+ toggleCheckbox($(this));
95
+ });
96
+
97
+ $(document).on('click', 'form.custom span.custom.radio', function (event) {
98
+ event.preventDefault();
99
+ event.stopPropagation();
100
+
101
+ toggleRadio($(this));
102
+ });
103
+
104
+ $(document).on('click', 'form.custom label', function (event) {
105
+ var $associatedElement = $('#' + $(this).attr('for')),
106
+ $customCheckbox,
107
+ $customRadio;
108
+ if ($associatedElement.length !== 0) {
109
+ if ($associatedElement.attr('type') === 'checkbox') {
110
+ event.preventDefault();
111
+ $customCheckbox = $(this).find('span.custom.checkbox');
112
+ toggleCheckbox($customCheckbox);
113
+ } else if ($associatedElement.attr('type') === 'radio') {
114
+ event.preventDefault();
115
+ $customRadio = $(this).find('span.custom.radio');
116
+ toggleRadio($customRadio);
117
+ }
118
+ }
119
+ });
120
+
121
+ $(document).on('click', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (event) {
122
+ var $this = $(this),
123
+ $dropdown = $this.closest('div.custom.dropdown');
124
+
125
+ event.preventDefault();
126
+ $dropdown.toggleClass('open');
127
+
128
+ if ($dropdown.hasClass('open')) {
129
+ $(document).bind('click.customdropdown', function (event) {
130
+ $dropdown.removeClass('open');
131
+ $(document).unbind('.customdropdown');
132
+ });
133
+ } else {
134
+ $(document).unbind('.customdropdown');
135
+ }
136
+ });
137
+
138
+ $(document).on('click', 'form.custom div.custom.dropdown li', function (event) {
139
+ var $this = $(this),
140
+ $customDropdown = $this.closest('div.custom.dropdown'),
141
+ $select = $customDropdown.prev(),
142
+ selectedIndex = 0;
143
+
144
+ event.preventDefault();
145
+ event.stopPropagation();
146
+
147
+ $this
148
+ .closest('ul')
149
+ .find('li')
150
+ .removeClass('selected');
151
+ $this.addClass('selected');
152
+
153
+ $customDropdown
154
+ .removeClass('open')
155
+ .find('a.current')
156
+ .html($this.html());
157
+
158
+ $this.closest('ul').find('li').each(function (index) {
159
+ if ($this[0] == this) {
160
+ selectedIndex = index;
161
+ }
162
+
163
+ });
164
+ $select[0].selectedIndex = selectedIndex;
165
+
166
+ $select.trigger('change');
167
+ });
168
+ })(jQuery);
169
+
@@ -1,130 +1,3 @@
1
- /*
2
- * jQuery Reveal Plugin 1.0
3
- * www.ZURB.com
4
- * Copyright 2010, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
-
9
-
10
- (function ($) {
11
- $('a[data-reveal-id]').live('click', function (event) {
12
- event.preventDefault();
13
- var modalLocation = $(this).attr('data-reveal-id');
14
- $('#' + modalLocation).reveal($(this).data());
15
- });
16
-
17
- $.fn.reveal = function (options) {
18
- var defaults = {
19
- animation: 'fadeAndPop', // fade, fadeAndPop, none
20
- animationSpeed: 300, // how fast animtions are
21
- closeOnBackgroundClick: true, // if you click background will modal close?
22
- dismissModalClass: 'close-reveal-modal' // the class of a button or element that will close an open modal
23
- };
24
- var options = $.extend({}, defaults, options);
25
-
26
- return this.each(function () {
27
- var modal = $(this),
28
- topMeasure = parseInt(modal.css('top')),
29
- topOffset = modal.height() + topMeasure,
30
- locked = false,
31
- modalBg = $('.reveal-modal-bg');
32
-
33
- if (modalBg.length == 0) {
34
- modalBg = $('<div class="reveal-modal-bg" />').insertAfter(modal);
35
- modalBg.fadeTo('fast', 0.8);
36
- }
37
-
38
- function openAnimation() {
39
- modalBg.unbind('click.modalEvent');
40
- $('.' + options.dismissModalClass).unbind('click.modalEvent');
41
- if (!locked) {
42
- lockModal();
43
- if (options.animation == "fadeAndPop") {
44
- modal.css({'top': $(document).scrollTop() - topOffset, 'opacity': 0, 'visibility': 'visible'});
45
- modalBg.fadeIn(options.animationSpeed / 2);
46
- modal.delay(options.animationSpeed / 2).animate({
47
- "top": $(document).scrollTop() + topMeasure + 'px',
48
- "opacity": 1
49
- }, options.animationSpeed, unlockModal);
50
- }
51
- if (options.animation == "fade") {
52
- modal.css({'opacity': 0, 'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure});
53
- modalBg.fadeIn(options.animationSpeed / 2);
54
- modal.delay(options.animationSpeed / 2).animate({
55
- "opacity": 1
56
- }, options.animationSpeed, unlockModal);
57
- }
58
- if (options.animation == "none") {
59
- modal.css({'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure});
60
- modalBg.css({"display": "block"});
61
- unlockModal();
62
- }
63
- }
64
- modal.unbind('reveal:open', openAnimation);
65
- }
66
- modal.bind('reveal:open', openAnimation);
67
-
68
- function closeAnimation() {
69
- if (!locked) {
70
- lockModal();
71
- if (options.animation == "fadeAndPop") {
72
- modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed);
73
- modal.animate({
74
- "top": $(document).scrollTop() - topOffset + 'px',
75
- "opacity": 0
76
- }, options.animationSpeed / 2, function () {
77
- modal.css({'top': topMeasure, 'opacity': 1, 'visibility': 'hidden'});
78
- unlockModal();
79
- });
80
- }
81
- if (options.animation == "fade") {
82
- modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed);
83
- modal.animate({
84
- "opacity" : 0
85
- }, options.animationSpeed, function () {
86
- modal.css({'opacity': 1, 'visibility': 'hidden', 'top': topMeasure});
87
- unlockModal();
88
- });
89
- }
90
- if (options.animation == "none") {
91
- modal.css({'visibility': 'hidden', 'top': topMeasure});
92
- modalBg.css({'display': 'none'});
93
- }
94
- }
95
- modal.unbind('reveal:close', closeAnimation);
96
- }
97
- modal.bind('reveal:close', closeAnimation);
98
- modal.trigger('reveal:open');
99
-
100
- var closeButton = $('.' + options.dismissModalClass).bind('click.modalEvent', function () {
101
- modal.trigger('reveal:close');
102
- });
103
-
104
- if (options.closeOnBackgroundClick) {
105
- modalBg.css({"cursor": "pointer"});
106
- modalBg.bind('click.modalEvent', function () {
107
- modal.trigger('reveal:close');
108
- });
109
- }
110
-
111
- $('body').keyup(function (event) {
112
- if (event.which === 27) { // 27 is the keycode for the Escape key
113
- modal.trigger('reveal:close');
114
- }
115
- });
116
-
117
- function unlockModal() {
118
- locked = false;
119
- }
120
-
121
- function lockModal() {
122
- locked = true;
123
- }
124
- });
125
- };
126
- })(jQuery);
127
-
128
1
  /*
129
2
  * jQuery Orbit Plugin 1.3.0
130
3
  * www.ZURB.com/playground
@@ -723,283 +596,3 @@
723
596
 
724
597
  }(jQuery));
725
598
 
726
- /**
727
- * jQuery.placeholder - Placeholder plugin for input fields
728
- * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
729
- * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
730
- * Date: 2008/10/14
731
- *
732
- * @author Blair Mitchelmore
733
- * @version 1.0.1
734
- *
735
- **/
736
- new function($) {
737
- $.fn.placeholder = function(settings) {
738
- settings = settings || {};
739
- var key = settings.dataKey || "placeholderValue";
740
- var attr = settings.attr || "placeholder";
741
- var className = settings.className || "placeholder";
742
- var values = settings.values || [];
743
- var block = settings.blockSubmit || false;
744
- var blank = settings.blankSubmit || false;
745
- var submit = settings.onSubmit || false;
746
- var value = settings.value || "";
747
- var position = settings.cursor_position || 0;
748
-
749
-
750
- return this.filter(":input").each(function(index) {
751
- $.data(this, key, values[index] || $(this).attr(attr));
752
- }).each(function() {
753
- if ($.trim($(this).val()) === "")
754
- $(this).addClass(className).val($.data(this, key));
755
- }).focus(function() {
756
- if ($.trim($(this).val()) === $.data(this, key))
757
- $(this).removeClass(className).val(value)
758
- if ($.fn.setCursorPosition) {
759
- $(this).setCursorPosition(position);
760
- }
761
- }).blur(function() {
762
- if ($.trim($(this).val()) === value)
763
- $(this).addClass(className).val($.data(this, key));
764
- }).each(function(index, elem) {
765
- if (block)
766
- new function(e) {
767
- $(e.form).submit(function() {
768
- return $.trim($(e).val()) != $.data(e, key)
769
- });
770
- }(elem);
771
- else if (blank)
772
- new function(e) {
773
- $(e.form).submit(function() {
774
- if ($.trim($(e).val()) == $.data(e, key))
775
- $(e).removeClass(className).val("");
776
- return true;
777
- });
778
- }(elem);
779
- else if (submit)
780
- new function(e) { $(e.form).submit(submit); }(elem);
781
- });
782
- };
783
- }(jQuery);
784
-
785
- /*
786
- * jQuery Custom Forms Plugin 1.0
787
- * www.ZURB.com
788
- * Copyright 2010, ZURB
789
- * Free to use under the MIT license.
790
- * http://www.opensource.org/licenses/mit-license.php
791
- */
792
-
793
- jQuery(document).ready(function ($) {
794
-
795
- function appendCustomMarkup(type) {
796
- $('form.custom input:' + type).each(function () {
797
- var $span = $('<span class="custom ' + type + '"></span>');
798
- if ($(this).next('span.custom.' + type).length === 0) {
799
- if (this.checked) {
800
- $span.addClass('checked');
801
- }
802
- $(this)
803
- .hide()
804
- .after($span);
805
- }
806
- });
807
- }
808
- appendCustomMarkup('checkbox');
809
- appendCustomMarkup('radio');
810
-
811
- $('form.custom select').each(function () {
812
- var $this = $(this),
813
- $customSelect = $this.next('div.custom.dropdown'),
814
- $options = $this.find('option'),
815
- maxWidth = 0,
816
- $li;
817
-
818
- if ($customSelect.length === 0) {
819
- $customSelect = $('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');
820
- $options.each(function () {
821
- $li = $('<li>' + $(this).html() + '</li>');
822
- $customSelect.find('ul').append($li);
823
- });
824
- $customSelect.prepend('<a href="#" class="current">' + $options.first().html() + '</a>');
825
-
826
- $this.after($customSelect);
827
- $this.hide();
828
- }
829
-
830
- $options.each(function (index) {
831
- if (this.selected) {
832
- $customSelect.find('li').eq(index).addClass('selected');
833
- $customSelect.find('.current').html($(this).html());
834
- }
835
- });
836
-
837
- $customSelect.find('li').each(function () {
838
- $customSelect.addClass('open');
839
- if ($(this).outerWidth() > maxWidth) {
840
- maxWidth = $(this).outerWidth();
841
- }
842
- $customSelect.removeClass('open');
843
- });
844
- $customSelect.css('width', maxWidth + 18 + 'px');
845
- $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
846
- });
847
- });
848
-
849
- (function ($) {
850
-
851
- function toggleCheckbox($element) {
852
- var $input = $element.prev(),
853
- input = $input[0];
854
-
855
- input.checked = ((input.checked) ? false : true);
856
- $element.toggleClass('checked');
857
-
858
- $input.trigger('change');
859
- }
860
-
861
- function toggleRadio($element) {
862
- var $input = $element.prev(),
863
- input = $input[0];
864
-
865
- $('input:radio[name=' + $input.attr('name') + ']').each(function () {
866
- $(this).next().removeClass('checked');
867
- });
868
- input.checked = ((input.checked) ? false : true);
869
- $element.toggleClass('checked');
870
-
871
- $input.trigger('change');
872
- }
873
-
874
- $('form.custom span.custom.checkbox').live('click', function (event) {
875
- event.preventDefault();
876
- event.stopPropagation();
877
-
878
- toggleCheckbox($(this));
879
- });
880
-
881
- $('form.custom span.custom.radio').live('click', function (event) {
882
- event.preventDefault();
883
- event.stopPropagation();
884
-
885
- toggleRadio($(this));
886
- });
887
-
888
- $('form.custom label').live('click', function (event) {
889
- var $associatedElement = $('#' + $(this).attr('for')),
890
- $customCheckbox,
891
- $customRadio;
892
- if ($associatedElement.length !== 0) {
893
- if ($associatedElement.attr('type') === 'checkbox') {
894
- event.preventDefault();
895
- $customCheckbox = $(this).find('span.custom.checkbox');
896
- toggleCheckbox($customCheckbox);
897
- } else if ($associatedElement.attr('type') === 'radio') {
898
- event.preventDefault();
899
- $customRadio = $(this).find('span.custom.radio');
900
- toggleRadio($customRadio);
901
- }
902
- }
903
- });
904
-
905
- $('form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector').live('click', function (event) {
906
- var $this = $(this),
907
- $dropdown = $this.closest('div.custom.dropdown');
908
-
909
- event.preventDefault();
910
- $dropdown.toggleClass('open');
911
-
912
- if ($dropdown.hasClass('open')) {
913
- $(document).bind('click.customdropdown', function (event) {
914
- $dropdown.removeClass('open');
915
- $(document).unbind('.customdropdown');
916
- });
917
- } else {
918
- $(document).unbind('.customdropdown');
919
- }
920
- });
921
-
922
- $('form.custom div.custom.dropdown li').live('click', function (event) {
923
- var $this = $(this),
924
- $customDropdown = $this.closest('div.custom.dropdown'),
925
- $select = $customDropdown.prev(),
926
- selectedIndex = 0;
927
-
928
- event.preventDefault();
929
- event.stopPropagation();
930
-
931
- $this
932
- .closest('ul')
933
- .find('li')
934
- .removeClass('selected');
935
- $this.addClass('selected');
936
-
937
- $customDropdown
938
- .removeClass('open')
939
- .find('a.current')
940
- .html($this.html());
941
-
942
- $this.closest('ul').find('li').each(function (index) {
943
- if ($this[0] == this) {
944
- selectedIndex = index;
945
- }
946
-
947
- });
948
- $select[0].selectedIndex = selectedIndex;
949
-
950
- $select.trigger('change');
951
- });
952
- })(jQuery);
953
-
954
- /*! http://mths.be/placeholder v1.8.5 by @mathias */
955
- (function(g,a,$){var f='placeholder' in a.createElement('input'),b='placeholder' in a.createElement('textarea');if(f&&b){$.fn.placeholder=function(){return this};$.fn.placeholder.input=$.fn.placeholder.textarea=true}else{$.fn.placeholder=function(){return this.filter((f?'textarea':':input')+'[placeholder]').bind('focus.placeholder',c).bind('blur.placeholder',e).trigger('blur.placeholder').end()};$.fn.placeholder.input=f;$.fn.placeholder.textarea=b;$(function(){$('form').bind('submit.placeholder',function(){var h=$('.placeholder',this).each(c);setTimeout(function(){h.each(e)},10)})});$(g).bind('unload.placeholder',function(){$('.placeholder').val('')})}function d(i){var h={},j=/^jQuery\d+$/;$.each(i.attributes,function(l,k){if(k.specified&&!j.test(k.name)){h[k.name]=k.value}});return h}function c(){var h=$(this);if(h.val()===h.attr('placeholder')&&h.hasClass('placeholder')){if(h.data('placeholder-password')){h.hide().next().show().focus().attr('id',h.removeAttr('id').data('placeholder-id'))}else{h.val('').removeClass('placeholder')}}}function e(){var l,k=$(this),h=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=$('<input>').attr($.extend(d(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',c);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}}(this,document,jQuery));
956
-
957
- $(document).ready(function() {
958
-
959
- /* Use this js doc for all application specific JS */
960
-
961
- /* TABS --------------------------------- */
962
- /* Remove if you don't need :) */
963
-
964
- var tabs = $('dl.tabs');
965
- tabsContent = $('ul.tabs-content')
966
-
967
- tabs.each(function(i) {
968
- //Get all tabs
969
- var tab = $(this).children('dd').children('a');
970
- tab.click(function(e) {
971
-
972
- //Get Location of tab's content
973
- var contentLocation = $(this).attr("href")
974
- contentLocation = contentLocation + "Tab";
975
-
976
- //Let go if not a hashed one
977
- if(contentLocation.charAt(0)=="#") {
978
-
979
- e.preventDefault();
980
-
981
- //Make Tab Active
982
- tab.removeClass('active');
983
- $(this).addClass('active');
984
-
985
- //Show Tab Content
986
- $(contentLocation).parent('.tabs-content').children('li').css({"display":"none"});
987
- $(contentLocation).css({"display":"block"});
988
-
989
- }
990
- });
991
- });
992
-
993
-
994
- /* PLACEHOLDER FOR FORMS ------------- */
995
- /* Remove this and jquery.placeholder.min.js if you don't need :) */
996
-
997
- $('input, textarea').placeholder();
998
-
999
-
1000
- /* DISABLED BUTTONS ------------- */
1001
- /* Gives elements with a class of 'disabled' a return: false; */
1002
-
1003
-
1004
- });
1005
-