diff options
Diffstat (limited to 'mod/thewire/views/default/forms/thewire/add.php')
| -rw-r--r-- | mod/thewire/views/default/forms/thewire/add.php | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/mod/thewire/views/default/forms/thewire/add.php b/mod/thewire/views/default/forms/thewire/add.php index e34a8c0e5..8607b3662 100644 --- a/mod/thewire/views/default/forms/thewire/add.php +++ b/mod/thewire/views/default/forms/thewire/add.php @@ -5,7 +5,9 @@ * @uses $vars['post'] */ -$post = elgg_get_array_value('post', $vars); +elgg_load_js('elgg.thewire'); + +$post = elgg_extract('post', $vars); $text = elgg_echo('post'); if ($post) { @@ -14,51 +16,26 @@ if ($post) { if ($post) { echo elgg_view('input/hidden', array( - 'internalname' => 'parent_guid', + 'name' => 'parent_guid', 'value' => $post->guid, )); } + +echo elgg_view('input/plaintext', array( + 'name' => 'body', + 'class' => 'mtm', + 'id' => 'thewire-textarea', +)); ?> -<textarea id="thewire-textarea" name="body" class="mtm"></textarea> <div id="thewire-characters-remaining"> <span>140</span> <?php echo elgg_echo('thewire:charleft'); ?> </div> +<div class="elgg-foot mts"> <?php echo elgg_view('input/submit', array( 'value' => $text, - 'internalid' => 'thewire-submit-button', + 'id' => 'thewire-submit-button', )); - ?> -<script type="text/javascript"> - -$(document).ready(function() { - $("#thewire-textarea").bind('keydown', function() { - textCounter(this, $("#thewire-characters-remaining span"), 140); - }); - $("#thewire-textarea").bind('keyup', function() { - textCounter(this, $("#thewire-characters-remaining span"), 140); - }); -}); - -function textCounter(textarea, status, limit) { - - var remaining_chars = limit - textarea.value.length; - status.html(remaining_chars); - - if (remaining_chars < 0) { - status.parent().css("color", "#D40D12"); - $("#thewire-submit-button").attr('disabled', 'disabled'); - $("#thewire-submit-button").css('background', '#999999'); - $("#thewire-submit-button").css('border-color', '#999999'); - $("#thewire-submit-button").css('cursor', 'default'); - } else { - status.parent().css("color", ""); - $("#thewire-submit-button").removeAttr('disabled', 'disabled'); - $("#thewire-submit-button").css('background', '#4690d6'); - $("#thewire-submit-button").css('border-color', '#4690d6'); - $("#thewire-submit-button").css('cursor', 'pointer'); - } -} -</script> +</div>
\ No newline at end of file |
