Changeset 15431 for events/phpframework

Show
Ignore:
Timestamp:
07/08/08 01:47:24 (5 years ago)
Author:
kumatch
Message:

Adjusted a status update counter.

Location:
events/phpframework/piece_framework/trunk/web/frontend
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/web/frontend/htdocs/js/application.js

    r15220 r15431  
    4646    alert('ページをリロードして、もう一度試してください。'); 
    4747} 
     48 
     49 
     50function updateStatusTextCharCounter(value, e) { 
     51    len = value.length; 
     52    jQuery('#js_textcount').html('' + (140-len)); 
     53    if (len > 140) { 
     54        if (jQuery("#commit").attr('disabled') != 'disabled') { 
     55            jQuery('#commit').attr('disabled', 'disabled') 
     56        } 
     57    } else { 
     58        if (jQuery("#commit").attr('disabled') == true) { 
     59            jQuery('#commit').removeAttr('disabled'); 
     60        } 
     61 
     62        if (len > 130) { 
     63            jQuery('#js_textcount').css('color', '#d40d12' ); 
     64        } else if (len > 120) { 
     65            jQuery('#js_textcount').css('color', '#5c0002' ); 
     66        } else { 
     67            jQuery('#js_textcount').css('color', '#cccccc' ); 
     68        } 
     69    } 
     70} 
  • events/phpframework/piece_framework/trunk/web/frontend/webapp/templates/Self/Form.html

    r15424 r15431  
    55        <span class="whatdoing">イマナニシテル?</span> 
    66        <span class="textCount" id="js_textcount">140</span> 
    7         <textarea class="message" name="status"></textarea> 
     7        <textarea 
     8            onkeyup="return updateStatusTextCharCounter(this.value, event);" 
     9            onfocus="return updateStatusTextCharCounter(this.value, event);" 
     10            onblur="return updateStatusTextCharCounter(this.value, event);" 
     11            class="message" name="status" id="status"></textarea> 
    812        <p class="btn btnSpace"> 
    9           <input name="commit" class="formBtn" type="submit" value="つぶやく" p:event="update" /> 
     13          <input name="commit" id="commit" class="formBtn" type="submit" value="つぶやく" p:event="update" /> 
    1014        </p> 
    1115      </div> 
     
    111115      $(this).innerHTML = replace_url_to_link($(this).innerHTML); 
    112116  }); 
     117 
     118  $('status').focus(); 
     119  updateStatusTextCharCounter($('status').value); 
    113120}); 
    114121</script>