Last modified: 2012-01-02 15:34:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31455, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29455 - Add support for a filter callback function in jQuery byteLimit plugin
Add support for a filter callback function in jQuery byteLimit plugin
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Normal normal (vote)
: 1.19.0 release
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-17 14:54 UTC by Krinkle
Modified: 2012-01-02 15:34 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2011-06-17 14:54:48 UTC
As title says.
Comment 1 Brion Vibber 2011-06-17 16:57:10 UTC
Presumably callback would ping on "too much stuff, ain't gonna add more"; would it just notify or would it try to pass in some kind of specific information?

Last I looked, the byteLimit thing only operates on keypress or some such, so it also may need to be expanded to handle paste and other kinds of operations, which presumably wouldn't have key or character values to pass through in the same way.
Comment 2 Brion Vibber 2011-06-17 17:54:09 UTC
Ok, bug 29454 seems to request some way to filter the input string before the length check...? Would that cover the text before the new change, or after? Some newly added strings would make the string longer, while others might not.
Comment 3 Krinkle 2011-06-21 17:55:14 UTC
The callback would called on the text that byteLength is currently processing. At, say, line 48 [1]

The example use case for bug 29454 would be filtering away a namespace prefix, so that the limit enforces only part of the input and not the entire html input field. That way we are enforcing 255 bytes on page_title to the front-end. Right now this would require moving the namespace to a seperate input field.

--
Krinkle


http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/jquery.byteLimit.js?revision=86982&view=markup#l48


PS: Come to think of it, creating a dropdown menu with namespaces on Special:Move and having only the page title in the input field does sound like a good thing to do...
Comment 4 Krinkle 2012-01-02 15:31:24 UTC
Fixed in r94066.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links