compass-foundation 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. data/.gitignore +9 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.mkdn +11 -0
  5. data/README.mkdn +43 -0
  6. data/Rakefile +1 -0
  7. data/compass-foundation.gemspec +26 -0
  8. data/lib/compass-foundation/rails/engine.rb +7 -0
  9. data/lib/compass-foundation/rails.rb +7 -0
  10. data/lib/compass-foundation/version.rb +5 -0
  11. data/lib/compass-foundation.rb +14 -0
  12. data/stylesheets/compass-foundation/_compass_foundation.scss +13 -0
  13. data/stylesheets/compass-foundation/_forms.css.scss +249 -0
  14. data/stylesheets/compass-foundation/_globals.css.scss +176 -0
  15. data/stylesheets/compass-foundation/_grid.css.scss +188 -0
  16. data/stylesheets/compass-foundation/_ie.css.scss +4 -0
  17. data/stylesheets/compass-foundation/_mobile.css.scss +220 -0
  18. data/stylesheets/compass-foundation/_orbit.css.scss +227 -0
  19. data/stylesheets/compass-foundation/_reveal.css.scss +107 -0
  20. data/stylesheets/compass-foundation/_typography.css.scss +169 -0
  21. data/stylesheets/compass-foundation/_ui.css.scss +338 -0
  22. data/vendor/assets/images/misc/button-gloss.png +0 -0
  23. data/vendor/assets/images/misc/button-overlay.png +0 -0
  24. data/vendor/assets/images/misc/custom-form-sprites.png +0 -0
  25. data/vendor/assets/images/misc/input-bg.png +0 -0
  26. data/vendor/assets/images/misc/modal-gloss.png +0 -0
  27. data/vendor/assets/images/misc/table-sorter.png +0 -0
  28. data/vendor/assets/images/orbit/bullets.jpg +0 -0
  29. data/vendor/assets/images/orbit/left-arrow.png +0 -0
  30. data/vendor/assets/images/orbit/loading.gif +0 -0
  31. data/vendor/assets/images/orbit/mask-black.png +0 -0
  32. data/vendor/assets/images/orbit/pause-black.png +0 -0
  33. data/vendor/assets/images/orbit/right-arrow.png +0 -0
  34. data/vendor/assets/images/orbit/rotator-black.png +0 -0
  35. data/vendor/assets/images/orbit/timer-black.png +0 -0
  36. data/vendor/assets/javascripts/app.js +48 -0
  37. data/vendor/assets/javascripts/forms.jquery.js +58 -0
  38. data/vendor/assets/javascripts/jquery.customforms.js +168 -0
  39. data/vendor/assets/javascripts/jquery.orbit.js +597 -0
  40. data/vendor/assets/javascripts/jquery.placeholder.min.js +2 -0
  41. data/vendor/assets/javascripts/jquery.reveal.js +126 -0
  42. data/vendor/assets/stylesheets/compass-foundation/_compass_foundation.scss +13 -0
  43. data/vendor/assets/stylesheets/compass-foundation/_forms.scss +249 -0
  44. data/vendor/assets/stylesheets/compass-foundation/_globals.scss +176 -0
  45. data/vendor/assets/stylesheets/compass-foundation/_grid.scss +188 -0
  46. data/vendor/assets/stylesheets/compass-foundation/_ie.scss +4 -0
  47. data/vendor/assets/stylesheets/compass-foundation/_mobile.scss +220 -0
  48. data/vendor/assets/stylesheets/compass-foundation/_orbit.scss +227 -0
  49. data/vendor/assets/stylesheets/compass-foundation/_reveal.scss +107 -0
  50. data/vendor/assets/stylesheets/compass-foundation/_typography.scss +169 -0
  51. data/vendor/assets/stylesheets/compass-foundation/_ui.scss +338 -0
  52. data/vendor/assets/stylesheets/compass-foundation/compass_foundation.scss +13 -0
  53. data/vendor/assets/stylesheets/compass-foundation/manifest.rb +38 -0
  54. metadata +121 -0
@@ -0,0 +1,58 @@
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);
@@ -0,0 +1,168 @@
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
+ $('form.custom span.custom.checkbox').live('click', function (event) {
91
+ event.preventDefault();
92
+ event.stopPropagation();
93
+
94
+ toggleCheckbox($(this));
95
+ });
96
+
97
+ $('form.custom span.custom.radio').live('click', function (event) {
98
+ event.preventDefault();
99
+ event.stopPropagation();
100
+
101
+ toggleRadio($(this));
102
+ });
103
+
104
+ $('form.custom label').live('click', 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
+ $('form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector').live('click', 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
+ $('form.custom div.custom.dropdown li').live('click', 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);