ui_alchemy-rails 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +6 -0
  3. data/Rakefile +21 -0
  4. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.eot +0 -0
  5. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.svg +154 -0
  6. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.ttf +0 -0
  7. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.woff +0 -0
  8. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.eot +0 -0
  9. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.svg +154 -0
  10. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.ttf +0 -0
  11. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.woff +0 -0
  12. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.eot +0 -0
  13. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.svg +154 -0
  14. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.ttf +0 -0
  15. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.woff +0 -0
  16. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.eot +0 -0
  17. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.svg +154 -0
  18. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.ttf +0 -0
  19. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.woff +0 -0
  20. data/app/assets/fonts/alchemy/Red Hat Liberation License.txt +78 -0
  21. data/app/assets/fonts/alchemy/overpass_bold-web.eot +0 -0
  22. data/app/assets/fonts/alchemy/overpass_bold-web.svg +470 -0
  23. data/app/assets/fonts/alchemy/overpass_bold-web.ttf +0 -0
  24. data/app/assets/fonts/alchemy/overpass_bold-web.woff +0 -0
  25. data/app/assets/fonts/alchemy/overpass_regular-web.eot +0 -0
  26. data/app/assets/fonts/alchemy/overpass_regular-web.svg +470 -0
  27. data/app/assets/fonts/alchemy/overpass_regular-web.ttf +0 -0
  28. data/app/assets/fonts/alchemy/overpass_regular-web.woff +0 -0
  29. data/app/assets/images/alchemy/icons/action-icons.png +0 -0
  30. data/app/assets/images/alchemy/icons/arrow_icon.png +0 -0
  31. data/app/assets/images/alchemy/icons/chosen-sprite.png +0 -0
  32. data/app/assets/images/alchemy/icons/error_icon.png +0 -0
  33. data/app/assets/images/alchemy/icons/objects.png +0 -0
  34. data/app/assets/images/alchemy/icons/spinner.gif +0 -0
  35. data/app/assets/images/alchemy/icons/spinner_head.gif +0 -0
  36. data/app/assets/images/alchemy/icons/success_icon.png +0 -0
  37. data/app/assets/images/alchemy/icons/warning_icon.png +0 -0
  38. data/app/assets/javascripts/alchemy/flash_messages.js +12 -0
  39. data/app/assets/javascripts/alchemy/forms.js +25 -0
  40. data/app/assets/javascripts/alchemy/i18n.js +36 -0
  41. data/app/assets/javascripts/alchemy/login.js +130 -0
  42. data/app/assets/javascripts/alchemy/password.js +99 -0
  43. data/app/assets/stylesheets/alchemy/components/_chosen.scss +423 -0
  44. data/app/assets/stylesheets/alchemy/components/_content.scss +58 -0
  45. data/app/assets/stylesheets/alchemy/components/_helpers.scss +38 -0
  46. data/app/assets/stylesheets/alchemy/components/_media.scss +49 -0
  47. data/app/assets/stylesheets/alchemy/components/_media_object.scss +22 -0
  48. data/app/assets/stylesheets/alchemy/components/_normalize.scss +396 -0
  49. data/app/assets/stylesheets/alchemy/components/_shared.scss +18 -0
  50. data/app/assets/stylesheets/alchemy/components/buttons/_buttons.scss +278 -0
  51. data/app/assets/stylesheets/alchemy/components/buttons/_buttons_vars.scss +11 -0
  52. data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages.scss +93 -0
  53. data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages_vars.scss +3 -0
  54. data/app/assets/stylesheets/alchemy/components/fonts/_liberation.scss +44 -0
  55. data/app/assets/stylesheets/alchemy/components/fonts/_overpass.scss +24 -0
  56. data/app/assets/stylesheets/alchemy/components/footer/_footer.scss +53 -0
  57. data/app/assets/stylesheets/alchemy/components/footer/_footer_vars.scss +4 -0
  58. data/app/assets/stylesheets/alchemy/components/forms/_forms.scss +552 -0
  59. data/app/assets/stylesheets/alchemy/components/forms/_forms_ie.scss +45 -0
  60. data/app/assets/stylesheets/alchemy/components/forms/_forms_mixins.scss +18 -0
  61. data/app/assets/stylesheets/alchemy/components/forms/_forms_responsive.scss +167 -0
  62. data/app/assets/stylesheets/alchemy/components/forms/_forms_vars.scss +25 -0
  63. data/app/assets/stylesheets/alchemy/components/header/_header.scss +216 -0
  64. data/app/assets/stylesheets/alchemy/components/header/_header_vars.scss +11 -0
  65. data/app/assets/stylesheets/alchemy/components/login/_login.scss +173 -0
  66. data/app/assets/stylesheets/alchemy/components/login/_login_mixins.scss +7 -0
  67. data/app/assets/stylesheets/alchemy/components/login/_login_vars.scss +19 -0
  68. data/app/assets/stylesheets/alchemy/components/sprites/_sprites.scss +110 -0
  69. data/app/assets/stylesheets/alchemy/components/sprites/_sprites_mixins.scss +9 -0
  70. data/app/assets/stylesheets/alchemy/components/text/_text.scss +30 -0
  71. data/app/assets/stylesheets/alchemy/components/text/_text_vars.scss +1 -0
  72. data/app/assets/stylesheets/alchemy/composites/content_elements.scss +6 -0
  73. data/app/assets/stylesheets/alchemy/composites/login.scss +9 -0
  74. data/app/assets/stylesheets/alchemy/composites/shell.scss +4 -0
  75. data/app/assets/stylesheets/alchemy/partials/_base.scss +8 -0
  76. data/app/assets/stylesheets/alchemy/partials/_colors.scss +99 -0
  77. data/app/assets/stylesheets/alchemy/partials/_mixins.scss +24 -0
  78. data/app/assets/stylesheets/alchemy/partials/_vars.scss +31 -0
  79. data/app/helpers/ui_alchemy/gettext_translations.rb +28 -0
  80. data/app/helpers/ui_alchemy/layout_helper.rb +35 -0
  81. data/app/helpers/ui_alchemy/rails_translations.rb +21 -0
  82. data/app/helpers/ui_alchemy/translation_helper.rb +19 -0
  83. data/app/views/alchemy/layouts/_change_password_layout.html.haml +20 -0
  84. data/app/views/alchemy/layouts/_common_i18n.haml +4 -0
  85. data/app/views/alchemy/layouts/_header_layout.haml +13 -0
  86. data/app/views/alchemy/layouts/_login_layout.html.haml +58 -0
  87. data/app/views/alchemy/layouts/_user_session_layout.haml +17 -0
  88. data/app/views/alchemy/layouts/base.html.haml +20 -0
  89. data/app/views/alchemy/layouts/shell_layout.haml +10 -0
  90. data/lib/ui_alchemy/rails/engine.rb +6 -0
  91. data/lib/ui_alchemy/rails/version.rb +5 -0
  92. data/lib/ui_alchemy-rails.rb +2 -0
  93. data/vendor/assets/javascripts/alchemy/handlebars.js +2201 -0
  94. data/vendor/assets/javascripts/alchemy/html5shiv.js +298 -0
  95. data/vendor/assets/javascripts/alchemy/jquery/jquery-1.6.2.js +8981 -0
  96. data/vendor/assets/javascripts/alchemy/jquery/plugins/chosen.jquery.js +1003 -0
  97. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.js +1427 -0
  98. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.min.js +1 -0
  99. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.js +179 -0
  100. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.min.js +1 -0
  101. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.js +167 -0
  102. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.min.js +1 -0
  103. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.js +183 -0
  104. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.min.js +1 -0
  105. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.js +238 -0
  106. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.min.js +1 -0
  107. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.js +2599 -0
  108. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.min.js +6 -0
  109. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.js +336 -0
  110. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.min.js +1 -0
  111. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.js +750 -0
  112. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.min.js +1 -0
  113. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.js +60 -0
  114. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.min.js +1 -0
  115. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.js +344 -0
  116. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.min.js +1 -0
  117. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.js +184 -0
  118. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.min.js +1 -0
  119. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.js +70 -0
  120. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.min.js +1 -0
  121. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.js +103 -0
  122. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.min.js +1 -0
  123. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/blank.svg +3 -0
  124. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/custom_test.js +67 -0
  125. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.css +9 -0
  126. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.js +1101 -0
  127. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.min.js +7 -0
  128. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.pack.js +7 -0
  129. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.js +396 -0
  130. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.min.js +7 -0
  131. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.pack.js +7 -0
  132. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.js +1337 -0
  133. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.min.js +7 -0
  134. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.pack.js +7 -0
  135. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/lion.svg +161 -0
  136. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/test.js +714 -0
  137. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ajaxfileupload.js +205 -0
  138. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-bbq.js +1137 -0
  139. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-resize.js +246 -0
  140. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.cookie.js +92 -0
  141. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.easing.1.3.js +205 -0
  142. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.fancyqueries.js +106 -0
  143. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.flash.js +288 -0
  144. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.form.js +964 -0
  145. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.hoverIntent.js +106 -0
  146. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.ajaxupload.js +62 -0
  147. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.js +556 -0
  148. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jnotify.js +210 -0
  149. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.js +1390 -0
  150. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.min.js +11 -0
  151. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.linkHover.js +89 -0
  152. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.loadmask.min.js +10 -0
  153. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.mousewheel.js +78 -0
  154. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.filter.js +176 -0
  155. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.js +668 -0
  156. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.pack.js +11 -0
  157. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.periodicalupdater.js +175 -0
  158. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sortElements.js +75 -0
  159. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sparkline.min.js +94 -0
  160. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.text-overflow.js +60 -0
  161. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timepickr.js +214 -0
  162. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timers.js +142 -0
  163. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.tipsy.js +358 -0
  164. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.treeTable.js +226 -0
  165. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.trunk8.js +203 -0
  166. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.multiselect.js +338 -0
  167. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.totop.js +58 -0
  168. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.uitablefilter.js +95 -0
  169. data/vendor/assets/javascripts/alchemy/jquery/plugins/ui.spinner.js +683 -0
  170. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  171. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  172. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_dadada_1x100.png +0 -0
  173. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_e6e6e6_1x100.png +0 -0
  174. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_95_ffffff_1x100.png +0 -0
  175. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-soft_80_e0e0e0_1x100.png +0 -0
  176. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-hard_65_ffffff_1x100.png +0 -0
  177. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
  178. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_8f8f8f_256x240.png +0 -0
  179. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_97baed_256x240.png +0 -0
  180. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  181. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/jquery-ui-1.8.11.custom.css +573 -0
  182. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-1.5.1.min.js +16 -0
  183. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-ui-1.8.11.custom.min.js +783 -0
  184. data/vendor/assets/javascripts/alchemy/rails.js +331 -0
  185. data/vendor/assets/javascripts/alchemy/underscore-1.3.1.js +999 -0
  186. metadata +252 -0
@@ -0,0 +1,12 @@
1
+ var CUI = CUI ? CUI : {};
2
+
3
+ CUI.closeFlashMessage = function() {
4
+ $('.flash_hud .control').click(function(){
5
+ $(this).closest($('.flash_hud')).slideUp(100).fadeOut(100);
6
+ });
7
+ };
8
+
9
+ $(document).ready(function() {
10
+ CUI.closeFlashMessage();
11
+ });
12
+
@@ -0,0 +1,25 @@
1
+ var CUI = CUI ? CUI : {};
2
+
3
+
4
+ CUI.toggleInput = function() {
5
+ var inputValue = "";
6
+
7
+ $('.control_group.checkbox.inline .control input[type="checkbox"]').click(function(){
8
+ var checkbox = $(this);
9
+ var input = $('.control_group.checkbox.inline .input > input');
10
+ var isDisabled = checkbox.prop('checked');
11
+
12
+ input.attr('disabled', isDisabled);
13
+
14
+ if(isDisabled) {
15
+ inputValue = input.val();
16
+ input.val('');
17
+ } else {
18
+ input.val(inputValue);
19
+ }
20
+ });
21
+ };
22
+
23
+ $(document).ready(function() {
24
+ CUI.toggleInput();
25
+ });
@@ -0,0 +1,36 @@
1
+ /**
2
+ Copyright 2012 Red Hat, Inc.
3
+
4
+ This software is licensed to you under the GNU General Public
5
+ License as published by the Free Software Foundation; either version
6
+ 2 of the License (GPLv2) or (at your option) any later version.
7
+ There is NO WARRANTY for this software, express or implied,
8
+ including the implied warranties of MERCHANTABILITY,
9
+ NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
10
+ have received a copy of GPLv2 along with this software; if not, see
11
+ http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
12
+ */
13
+ var CUI = CUI || {};
14
+
15
+ CUI.i18n = (function(){
16
+ var strings = {},
17
+
18
+ localize = function(data){
19
+ var key;
20
+
21
+ for (key in data) {
22
+ if( data.hasOwnProperty(key) ){
23
+ strings[key] = data[key];
24
+ }
25
+ }
26
+ },
27
+ get_string = function(string) {
28
+ return strings[string];
29
+ };
30
+
31
+ return {
32
+ localize : localize,
33
+ get_string : get_string
34
+ }
35
+
36
+ })();
@@ -0,0 +1,130 @@
1
+ /**
2
+ Copyright 2011 Red Hat, Inc.
3
+
4
+ This software is licensed to you under the GNU General Public
5
+ License as published by the Free Software Foundation; either version
6
+ 2 of the License (GPLv2) or (at your option) any later version.
7
+ There is NO WARRANTY for this software, express or implied,
8
+ including the implied warranties of MERCHANTABILITY,
9
+ NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
10
+ have received a copy of GPLv2 along with this software; if not, see
11
+ http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
12
+ */
13
+ var CUI = CUI ? CUI : {};
14
+ CUI.Login = {};
15
+
16
+ $(document).ready(function() {
17
+
18
+ CUI.Login.Events.register();
19
+
20
+ $('#password_link').click(function(e){
21
+ e.preventDefault();
22
+ $('.card#password_reset').animate({ 'left' : '0px' }, 'slow').css('z-index', 1);
23
+ });
24
+ $('#username_link').click(function(e){
25
+ e.preventDefault();
26
+ $('.card#username_recovery').animate({ 'left' : '0px' }, 'slow').css('z-index', 1);
27
+ });
28
+ $('#password_reset_return_link').click(function(e){
29
+ e.preventDefault();
30
+ $('.card#password_reset').animate({ 'left' : '-360px' }, 'slow', function(){
31
+ $(this).css('z-index', -1);
32
+ });
33
+ });
34
+ $('#username_recovery_return_link').click(function(e){
35
+ e.preventDefault();
36
+ $('.card#username_recovery').animate({ 'left' : '-360px' }, 'slow', function(){
37
+ $(this).css('z-index', -1);
38
+ });
39
+ });
40
+ $('#login_btn').click(function(){
41
+ CUI.Login.Actions.toggleSpinner();
42
+ });
43
+ $(document).bind("ajax:complete",
44
+ function(evt, data, status, xhr){
45
+ if(status == "success") {
46
+ $('form .spinner').fadeOut('fast');
47
+ }
48
+ }
49
+ );
50
+ $('#username').focus();
51
+ });
52
+
53
+ CUI.Login.Actions = (function($){
54
+ var show_password = function(input_field, input_reveal_field, show){
55
+ var password;
56
+
57
+ if( show ){
58
+ password = input_field.val();
59
+ input_field.hide();
60
+ input_reveal_field.val(password).show();
61
+ } else {
62
+ password = input_reveal_field.val();
63
+ input_reveal_field.hide();
64
+ input_field.val(password).show();
65
+ }
66
+ },
67
+ add_hash_input = function(parent){
68
+ if (window.location.hash != "") {
69
+ $('<input>').attr({
70
+ type: 'hidden',
71
+ id: 'hash_anchor',
72
+ name: 'hash_anchor',
73
+ value: window.location.hash
74
+ }).appendTo(parent);
75
+ }
76
+ },
77
+ interstitial_switcher_animation = function(num_orgs, redir_path){
78
+ if(parseInt(num_orgs, 10) > 1){
79
+ $('#interstitial').trigger({type:'login'});
80
+ } else if(redir_path){
81
+ CUI.Login.Actions.toggleSpinner();
82
+ window.location.href = redir_path;
83
+ } else {
84
+ window.location.reload();
85
+ }
86
+ },
87
+ toggleSpinner = function(){
88
+ $('#login_form .spinner').fadeToggle('fast');
89
+ },
90
+ redirecter = function(url){
91
+ if ($.browser.msie){
92
+ window.location = url;
93
+ } else {
94
+ window.location.href = url;
95
+ }
96
+ };
97
+
98
+ return {
99
+ show_password : show_password,
100
+ add_hash_input : add_hash_input,
101
+ interstitial_switcher_animation : interstitial_switcher_animation,
102
+ redirecter : redirecter,
103
+ toggleSpinner : toggleSpinner
104
+ };
105
+
106
+ })(jQuery);
107
+
108
+ CUI.Login.Events = (function($, actions){
109
+ var register = function(){
110
+ $('#reveal').change(function(){
111
+ actions.show_password($('#password-input'), $('#password-input-reveal'), $(this).is(':checked'));
112
+ });
113
+ $('#login_form').live('submit', function(e) {
114
+ actions.add_hash_input(this);
115
+ });
116
+ //if you have an #interstitial container for an interstitial, this will function. otherwise it won't.
117
+ // this is for alchemy
118
+ var interstitial = $('#interstitial');
119
+ if (interstitial.length){
120
+ $('#interstitial').bind('login', function(event){
121
+ CUI.Login.Actions.toggleSpinner();
122
+ interstitial.animate({ 'left' : '0px' }, 'slow').css('z-index', 1);
123
+ });
124
+ }
125
+ };
126
+ return {
127
+ register : register
128
+ }
129
+
130
+ })(jQuery, CUI.Login.Actions);
@@ -0,0 +1,99 @@
1
+ /**
2
+ Copyright 2011 Red Hat, Inc.
3
+
4
+ This software is licensed to you under the GNU General Public
5
+ License as published by the Free Software Foundation; either version
6
+ 2 of the License (GPLv2) or (at your option) any later version.
7
+ There is NO WARRANTY for this software, express or implied,
8
+ including the implied warranties of MERCHANTABILITY,
9
+ NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
10
+ have received a copy of GPLv2 along with this software; if not, see
11
+ http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
12
+ */
13
+ var CUI = CUI ? CUI : {};
14
+ CUI.Password = {};
15
+
16
+ $(document).ready(function() {
17
+ var actions = CUI.Password.Actions($('#save_password'));
18
+ CUI.Password.Events.register(actions);
19
+ });
20
+
21
+ CUI.Password.Events = (function($){
22
+ var register = function(actions) {
23
+ $('#password_field').live('keyup', function(){
24
+ var password = $('#password_field').val(),
25
+ confirm = $('#confirm_field').val(),
26
+ conflict_tag = $('#password_conflict');
27
+
28
+ actions.verifyPassword(password, confirm, conflict_tag);
29
+ });
30
+ $('#confirm_field').live('keyup', function(){
31
+ var password = $('#password_field').val(),
32
+ confirm = $('#confirm_field').val(),
33
+ conflict_tag = $('#password_conflict');
34
+
35
+ actions.verifyPassword(password, confirm, conflict_tag);
36
+ });
37
+ $('#save_password').live('click', function(){
38
+ var password = $('#password_field').val();
39
+
40
+ actions.changePassword(password);
41
+ });
42
+ };
43
+
44
+ return {
45
+ register : register
46
+ }
47
+
48
+ })(jQuery);
49
+
50
+
51
+ CUI.Password.Actions = function(save_button){
52
+ var resetPassword = false,
53
+
54
+ verifyPassword = function(password, confirm, conflict_tag) {
55
+ if( password !== confirm ){
56
+ conflict_tag.removeClass('invisible');
57
+ save_button.addClass("disabled");
58
+ }
59
+ else {
60
+ conflict_tag.addClass('invisible');
61
+ save_button.removeClass("disabled");
62
+ }
63
+ },
64
+ changePassword = function(password) {
65
+ var button = save_button,
66
+ url = button.attr("data-url");
67
+
68
+ if( !button.hasClass("disabled") ){
69
+ button.addClass("disabled");
70
+
71
+ $.ajax({
72
+ type: "PUT",
73
+ url: url,
74
+ data: { "user":{"password":password}},
75
+ cache: false,
76
+ success: function(data, textStatus, xhr) {
77
+ button.removeClass("disabled");
78
+ if (resetPassword && xhr.status < 400) {
79
+ // this is a password reset, so we'll redirect the user to the login page
80
+ window.location.replace(KT.routes.root_path());
81
+ }
82
+ },
83
+ error: function(e) {
84
+ button.removeClass('disabled');
85
+ }
86
+ });
87
+ }
88
+ },
89
+ resettingPassword = function(resetValue) {
90
+ resetPassword = resetValue;
91
+ };
92
+
93
+ return {
94
+ verifyPassword: verifyPassword,
95
+ changePassword: changePassword,
96
+ resettingPassword: resettingPassword
97
+ };
98
+
99
+ };