start using new placeholders on login page

This commit is contained in:
Florian Staudacher 2012-01-18 01:17:20 +01:00
parent 849db2f34b
commit 81ae0c644c
4 changed files with 24 additions and 16 deletions

View file

@ -1,4 +1,4 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is -# Copyright (c) 2010-2012, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
@ -27,12 +27,12 @@
%p %p
= f.label :username , t('username') = f.label :username , t('username')
= f.text_field :username, :tabindex => 1, :value => prefilled_username = f.text_field :username, :tabindex => 1, :value => prefilled_username, :placeholder => t('username')
%br %br
%p %p
= f.label :password , t('password') = f.label :password , t('password')
= f.password_field :password, :tabindex => 2 = f.password_field :password, :tabindex => 2, :placeholder => t('password')
- if display_password_reset_link? - if display_password_reset_link?
= link_to t('devise.shared.links.forgot_your_password'), new_password_path(resource_name), :id => "forgot_password_link", :tabindex => 5 = link_to t('devise.shared.links.forgot_your_password'), new_password_path(resource_name), :id => "forgot_password_link", :tabindex => 5

View file

@ -28,11 +28,11 @@ javascripts:
- public/javascripts/vendor/jquery-ui-1.8.9.custom.min.js - public/javascripts/vendor/jquery-ui-1.8.9.custom.min.js
- public/javascripts/vendor/jquery.charcount.js - public/javascripts/vendor/jquery.charcount.js
- public/javascripts/vendor/jquery.expander.js - public/javascripts/vendor/jquery.expander.js
- public/javascripts/vendor/jquery.placeholder.js
- public/javascripts/vendor/timeago.js - public/javascripts/vendor/timeago.js
- public/javascripts/vendor/facebox.js - public/javascripts/vendor/facebox.js
- public/javascripts/jquery.infinitescroll-custom.js - public/javascripts/jquery.infinitescroll-custom.js
- public/javascripts/jquery.autocomplete-custom.js - public/javascripts/jquery.autocomplete-custom.js
- public/javascripts/jquery.infieldlabel-custom.js
- public/javascripts/keycodes.js - public/javascripts/keycodes.js
- public/javascripts/fileuploader-custom.js - public/javascripts/fileuploader-custom.js

View file

@ -7,11 +7,11 @@ var View = {
/* Buttons */ /* Buttons */
$("input:submit").addClass("button"); $("input:submit").addClass("button");
/* In field labels */ /* label placeholders */
$("label").inFieldLabels(); $("input, textarea").placeholder();
$(document).bind('afterReveal.facebox', function() { if( jQuery.fn.placeholder.input ) {
jQuery("#facebox label").inFieldLabels(); $("input[placeholder], textarea[placeholder]").siblings("label").hide();
}); }
/* "Toggling" the search input */ /* "Toggling" the search input */
$(this.search.selector) $(this.search.selector)

View file

@ -886,14 +886,22 @@ form p.checkbox_select
:top 6px :top 6px
label:not(.bootstrapped) label:not(.bootstrapped)
:font :display none
:weight normal :font-weight normal
@mixin placeholder_styles
:color #999 :color #999
:position absolute :text-shadow 0 1px 1px #eeeeee
:top 3px
:left 0.48em .placeholder
:text @include placeholder_styles
:shadow 0 1px 1px #eee
/* those can't be combined, see: http://stackoverflow.com/questions/2610497 */
*::-webkit-input-placeholder
@include placeholder_styles
*:-moz-placeholder
@include placeholder_styles
#file-upload #file-upload
input input