> On Thu, Apr 22, 2010 at 5:18 AM, Craig Andrews > <[email protected]> wrote: >> I just committed ClientSideShortenPlugin to 0.9.x. >> >> http://gitorious.org/statusnet/mainline/commit/65796ba03ba4cd0470a1e9790d2234c8b42d6cba >> >> From the README: >> ClientSideShorten causes the web interface's notice form to >> automatically >> shorten urls as they entered, and before the notice is submitted. >> >> A few people at work asked for this functionality, so I just whipped it >> up. I'd like to have some feedback on both the idea and the >> implementation, and any suggestions on how to improve it. Installation >> is >> very easy - Add "addPlugin('ClientSideShorten');" to the bottom of your >> config.php >> >> Thanks, >> ~Craig > > I think it might be a too aggressive. The user could pause in the > middle of typing and have their partial URL shortened. Also, it > doesn't look like it will recognize URLs that are already shortened > (or URLs that it itself shortened) and not attempt to shorten them > again.
The client side shorter "debounces" the keypress event, waiting 1 second after the last keypress to do the shortening. I *think* that's enough to avoid shortening partially-typed URLs. I'm not sure how to recognize that a user has paused mid-URL, I'm looking for ideas. The client side shorter also uses the same code as the rest of StatusNet, so the same shortening rules apply: if the short URL is the same length or longer than the original URL, no shortening is done. > > Instead of on keypress, perhaps this could be triggered by a clicking > a button next to the text field (like the attach file button)? I really wanted this functionality to be seamless, and not add any complexity to the GUI. I'm trying to replicate the auto url shortening in Twitterific, mostly. > > Jeff > _______________________________________________ StatusNet-dev mailing list [email protected] http://lists.status.net/mailman/listinfo/statusnet-dev
