Ticket #24042: 24042.diff
| File 24042.diff, 2.8 KB (added by , 12 years ago) |
|---|
-
wp-admin/js/common.js
1 var showNotice, adminMenu, columns, validateForm, screenMeta ;1 var showNotice, adminMenu, columns, validateForm, screenMeta, inputPlaceholder; 2 2 (function($){ 3 3 // Removed in 3.3. 4 4 // (perhaps) needed for back-compat … … 430 430 return true; 431 431 }); 432 432 433 inputPlaceholder = function(id) { 434 435 if ( '' === id ) 436 return; 437 438 var input = $( '#' + id ), placeholderText = $( '#' + id + '-prompt-text' ); 439 440 placeholderText.click( function () { 441 input.focus(); 442 }); 443 444 input.blur( function () { 445 hidePlaceholder(); 446 }).keyup( _.throttle( function () { 447 placeholderText.addClass('screen-reader-text'); 448 hidePlaceholder(); 449 }, 300 )); 450 451 function hidePlaceholder () { 452 if ( '' === input.val() ) 453 placeholderText.removeClass('screen-reader-text'); 454 } 455 456 hidePlaceholder(); 457 } 458 433 459 })(jQuery); -
wp-admin/js/dashboard.js
88 88 $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } ); 89 89 90 90 $('#title, #tags-input').each( function() { 91 var input = $(this), prompt = $('#' + this.id + '-prompt-text'); 92 93 if ( '' === this.value ) 94 prompt.removeClass('screen-reader-text'); 95 96 prompt.click( function() { 97 $(this).addClass('screen-reader-text'); 98 input.focus(); 99 }); 100 101 input.blur( function() { 102 if ( '' === this.value ) 103 prompt.removeClass('screen-reader-text'); 104 }); 105 106 input.focus( function() { 107 prompt.addClass('screen-reader-text'); 108 }); 91 inputPlaceholder(this.id); 109 92 }); 110 93 111 94 $('#quick-press').on( 'click focusin', function() { -
wp-admin/js/post.js
769 769 }); 770 770 } 771 771 772 wptitlehint = function(id) { 773 id = id || 'title'; 772 inputPlaceholder('title'); 774 773 775 var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');776 777 if ( title.val() == '' )778 titleprompt.removeClass('screen-reader-text');779 780 titleprompt.click(function(){781 $(this).addClass('screen-reader-text');782 title.focus();783 });784 785 title.blur(function(){786 if ( this.value == '' )787 titleprompt.removeClass('screen-reader-text');788 }).focus(function(){789 titleprompt.addClass('screen-reader-text');790 }).keydown(function(e){791 titleprompt.addClass('screen-reader-text');792 $(this).unbind(e);793 });794 }795 796 wptitlehint();797 798 774 // resizable textarea#content 799 775 (function() { 800 776 var textarea = $('textarea#content'), offset = null, el;