From: Michael J. Rubinsky Date: Wed, 28 Jul 2010 21:15:57 +0000 (-0400) Subject: Use a 2 row textarea, and add a characters remaining countdown X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dcab6177d9bc43f2957f1ebfc2abc9bacf044b3c;p=horde.git Use a 2 row textarea, and add a characters remaining countdown --- diff --git a/horde/js/twitterclient.js b/horde/js/twitterclient.js index 75cfef316..20ff458eb 100644 --- a/horde/js/twitterclient.js +++ b/horde/js/twitterclient.js @@ -16,6 +16,7 @@ var Horde_Twitter = Class.create({ * Const'r * * opts.input The domid of the input form element. + * opts.counter The domid of the node to display chars remaining. * opts.spinner The domid of the spinner element. * opts.content The main content area, where the tweets are placed. * opts.endpoint The url endpoint for horde/servcies/twitter.php @@ -37,6 +38,10 @@ var Horde_Twitter = Class.create({ } }.bind(this)); + $(this.opts.input).observe('keyup', function() { + $(this.opts.counter).update(140 - $F(this.opts.input).length); + }.bind(this)); + /* Get the first page */ this.getNewEntries(); }, diff --git a/horde/lib/Block/twitter_timeline.php b/horde/lib/Block/twitter_timeline.php index 7524d1dce..56d4f858a 100644 --- a/horde/lib/Block/twitter_timeline.php +++ b/horde/lib/Block/twitter_timeline.php @@ -149,6 +149,7 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block endpoint: '{$endpoint}', inreplyto: '{$inReplyToNode}', refreshrate: {$refresh}, + counter: '{$instance}_counter', strings: { inreplyto: '{$inReplyToText}', defaultText: '{$defaultText}', justnow: '{$justNowText}' } }); EOT; @@ -159,8 +160,8 @@ EOT; /* Build the UI */ $html = '
' - . '
' - . '' . _("Update") . '' + . '
' + . '' . _("Update") . '140 ' . Horde::img('loading.gif', '', array('id' => $instance . '_loading', 'style' => 'display:none;')); $html .= '
' . _("Latest") . ' ' . $latestStatus . ' - ' . Horde_Date_Utils::relativeDateTime(strtotime($this->_profile->status->created_at), $GLOBALS['prefs']->getValue('date_format'), ($GLOBALS['prefs']->getValue('twentyFour') ? "%H:%M" : "%I:%M %P")) . '
'; $html .= '
';