[ljcom] r10072: LJINT-409: repeat-revert (tab vs space)
Committer: szhirkov
LJINT-409: repeat-revert (tab vs space)U trunk/htdocs/js/partners/placeholder.js
Modified: trunk/htdocs/js/partners/placeholder.js
===================================================================
--- trunk/htdocs/js/partners/placeholder.js 2011-02-18 05:15:19 UTC (rev 10071)
+++ trunk/htdocs/js/partners/placeholder.js 2011-02-18 05:30:45 UTC (rev 10072)
@@ -1,49 +1,49 @@
(function ($) {
- // "onload" instead of "onready" - hack for Webkit browsers
- $(window).bind('load', function () {
- $('input:text, input:password, input[type=url], textarea').placeholder();
- $('#commenttext').trigger('focus');
- });
-
- $(function () {
- var submitButtons = $(':submit');
-
- $('.i-close').bind('click', function (e) {
- e.preventDefault();
- $(this).closest('.b-auth-error').fadeOut('fast');
- });
- $('form').bind('submit', function () {
- if (this.target != "ljidentityauth") {
- submitButtons.attr('disabled', 'disabled');
- }
- });
+ // "onload" instead of "onready" - hack for Webkit browsers
+ $(window).bind('load', function () {
+ $('input:text, input:password, input[type=url], textarea').placeholder();
+ $('#commenttext').trigger('focus');
+ });
+
+ $(function () {
+ var submitButtons = $(':submit');
+
+ $('.i-close').bind('click', function (e) {
+ e.preventDefault();
+ $(this).closest('.b-auth-error').fadeOut('fast');
+ });
+ $('form').bind('submit', function () {
+ if (this.target != "ljidentityauth") {
+ submitButtons.attr('disabled', 'disabled');
+ }
+ });
- //disable submit controls if comment is empty
- var commentText = $('#commenttext');
- if(commentText.length > 0) {
- commentText.input(function() {
- submitButtons.attr('disabled', this.value.length === 0 );
- }).trigger("input");
- }
- });
-
- $.fn.placeholder = function () {
- return this.each(function () {
- var field = $(this),
- hintLabel = field.prev();
-
- field
- .bind('focus', function () {
- hintLabel.hide();
- })
- .bind('blur', function () {
- if (field.val() === '') {
- hintLabel.show();
- } else {
- hintLabel.hide();
- }
- })
- .trigger('blur');
- });
- };
+ //disable submit controls if comment is empty
+ var commentText = $('#commenttext');
+ if(commentText.length > 0) {
+ commentText.input(function() {
+ submitButtons.attr('disabled', this.value.length === 0 );
+ }).trigger("input");
+ }
+ });
+
+ $.fn.placeholder = function () {
+ return this.each(function () {
+ var field = $(this),
+ hintLabel = field.prev();
+
+ field
+ .bind('focus', function () {
+ hintLabel.hide();
+ })
+ .bind('blur', function () {
+ if (field.val() === '') {
+ hintLabel.show();
+ } else {
+ hintLabel.hide();
+ }
+ })
+ .trigger('blur');
+ });
+ };
})(jQuery);
