Commit graph

85 commits

Author SHA1 Message Date
Andrew Garrett
665b54cc1d Remove double-wrapping in trs 2010-07-02 21:40:47 +00:00
Andrew Garrett
351e25c211 Add vertical-label option to HTMLForm, for CommunityHiring 2010-07-02 21:20:54 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/ /\ /g;s/—/―/g;s/•/•/g;s/á/á/g;s/´/´/g;s/à/à/g;s/α/α/g;s/ä/ä/g;s/ç/ç/g;s/©/©/g;s/↓/↓/g;s/°/°/g;s/é/é/g;s/ê/ê/g;s/ë/ë/g;s/è/è/g;s/€/€/g;s/↔//g;s/…/…/g;s/í/í/g;s/ì/ì/g;s/←/←/g;s/“/“/g;s/·/·/g;s/−/−/g;s/–/–/g;s/ó/ó/g;s/ô/ô/g;s/œ/œ/g;s/ò/ò/g;s/õ/õ/g;s/ö/ö/g;s/£/£/g;s/′/′/g;s/″/″/g;s/»/»/g;s/→/→/g;s/”/”/g;s/Σ/Σ/g;s/×/×/g;s/ú/ú/g;s/↑/↑/g;s/ü/ü/g;s/¥/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Siebrand Mazeland
e0a4a54ca1 Ran stylize.php, removed trailing whitespace, updated indentation and code formatting. 2010-05-30 12:44:17 +00:00
Alexandre Emsenhuber
beef1e0d5e removed unused variable 2010-05-24 12:52:26 +00:00
Andrew Garrett
2b2bb7c61c Some weird people are using HTMLForm without a submission callback. 2010-05-05 02:42:03 +00:00
Andrew Garrett
9610b8d444 HTMLForm: Throw exceptions in some circumstances 2010-05-03 09:10:50 +00:00
Alexandre Emsenhuber
b90d647487 Per report on translatewiki: "namespaces to search" user option always displays all fields unchecked 2010-04-18 11:58:39 +00:00
Happy-melon
861d1b81b1 From r64866, more consistent behaviour of hidden field names. May affect r65029. 2010-04-14 21:42:37 +00:00
Happy-melon
2a28ffda5e Follow-up to r64866 - add message, and apply the same validation to TextareaField as well. 2010-04-10 21:10:22 +00:00
Happy-melon
317836768b Improvements and fixes to HTMLForm:
* allow css classes to be specified in form descriptors
* Don't overwrite $field['name'] if it's set
* Allow IDs on hidden fields
* Enforce 'required' validation on Text fields
* Fix type validation on Int fields to correctly handle numbers larger than PHP_MAX_INT or with leading zeroes (eg phone numbers on 32 bit systems)
* Fix weak-typing error in MultiSelect field
* Formatting and doc fixes
2010-04-10 12:03:30 +00:00
Roan Kattouw
f728ddc6d2 (bug 19627) Fix regression from r57867 where HTMLForm would output <element classes="foo bar"> rather than <element class="foo bar"> 2010-03-15 08:11:19 +00:00
Happy-melon
eb002b00c1 HTMLSubmitField is more useful as an inline button than an alias for HTMLForm::addButton(). 2010-03-13 15:33:18 +00:00
Raimond Spekking
18ed54d077 Tweak 'HMTL 5' -> 'HTML5' per suggestion on translatewiki: http://translatewiki.net/wiki/Thread:Support/HTML5
See http://en.wikipedia.org/wiki/HTML5 too.
2009-12-30 07:08:52 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Aryeh Gregor
38331bbce0 Avoid pointless $wgHtml5 checks
Html::rawElement() should strip out any invalid attributes if $wgHtml5
is off.  This commit should introduce no functional change.  Any future
problems with attributes being added incorrectly should be fixed in
Html.php, not callers.

Follow-up to r57096.
2009-11-19 01:24:58 +00:00
Andrew Garrett
45d31742e2 Fix incompatibility with PHP<5.2 2009-11-16 16:21:11 +00:00
Siebrand Mazeland
e8a65f9e25 Update break notation to self enclosed and properly spaced 2009-11-14 20:59:15 +00:00
Bryan Tong Minh
01bf3fccd2 Parse the edittools message so that it actually works (follow up to r57868).
Message is now also customizable.
2009-10-19 19:55:54 +00:00
Bryan Tong Minh
918171cef4 Update HTMLForm for upcoming Special:Upload rewrite.
* Add support for edittools
* Add support for multipart/form-data
* Set id for wpEditToken
* Add support for tooltip and accesskey
* Allow setting a name for the submit button
* Give sections an id
2009-10-18 19:29:35 +00:00
Bryan Tong Minh
92c38323e0 * Add file and textarea support to HTMLForm.
* Move HTML label generation to separate function, because it needs to be overridden for SpecialUpload
2009-10-09 14:22:37 +00:00
Happy-melon
7c63edecce Recommit r56947, partially overwritten in r57024. 2009-09-30 09:46:48 +00:00
Happy-melon
0e436d09c3 Recommit some of the 'backend' stuff from the Login branch, after talking with Brion:
* ExternalUser::getLocalUser() from r56683
* Documentation and style tweaks for HTMLForm from r56682
* HTMLForm::add{HiddenField|(Pre|Post|Header)Text|Button}() functions, from 56782 and r56896.
Frontend stuff will wait until after 1.16 is branched.
2009-09-28 19:04:10 +00:00
Happy-melon
6fce8771f7 Fix bug in HTMLForm where password fields only got the type="password" attribute if $wgHtml5 = true. Prompted by r56937. 2009-09-26 11:20:25 +00:00
Brion Vibber
0d1d984313 Revert broken rewrite of login system; totally broken.
* Login doesn't attach to session properly, so can't stay logged in!
* Password field shown in plaintext!

If it just DOESN'T WORK please keep it on a work branch, don't put it in trunk!

Reverted:
r56682
r56683
r56684
r56686
r56688
r56696
r56699
r56702
r56703
r56704
r56782
r56896
2009-09-26 00:49:32 +00:00
Happy-melon
e5a74e5ff7 Improve HTMLForm's support for adding content in and around the form, to improve versatility. Groundwork for being able to validate, filter and submit the CreateAccount input via HTMLForm::trySubmit(), which will give extensions huge flexibility to play with the form input.
Also change the wrapping on both forms to use a <fieldset>, which is visually more consistent with the other forms we have floating around the site.  Add visualClear to all HTMLForm forms, and remove all the redundant CSS for the login form, quite a bit of which has been dead for a while.
2009-09-24 21:25:33 +00:00
Happy-melon
f4dd596f5c Allow extra buttons and hidden fields to be included in HTMLForm. Accessible either before Form construction (as HTMLFormField subclasses that can be passed in the Descriptor array as for other input) or after (as methods addHiddenField() and addButton(), respectively). 2009-09-22 20:05:28 +00:00
Happy-melon
7732401c9b Document and tidy HTMLForm.php. :P 2009-09-20 18:50:38 +00:00
Alexandre Emsenhuber
b5311badc4 * (bug 20556) Stub threshold's "other" <input> in Special:Preferences now has a correct type="text" parameter
* also fix a bug in the detection if the "other" value is passed in the predefined options, remember: 0 == 'other' returns true (thank you, PHP, really)
2009-09-11 15:53:48 +00:00
Aryeh Gregor
f03c53b8a7 Fix silly <table class=''> 2009-09-07 15:25:22 +00:00
Aryeh Gregor
650e0d72ac Don't output for= that doesn't point anywhere
This fixes an HTML validity issue with HTMLForm.
2009-09-07 01:48:06 +00:00
Aryeh Gregor
da497558a0 Convert HTMLForm to use more Html::* 2009-09-07 01:47:45 +00:00
Aryeh Gregor
a20dd0e6ab Remove unneeded class left by r55879 2009-09-06 15:41:24 +00:00
Aryeh Gregor
1ef5b8c191 Reimplement r55876 properly 2009-09-06 15:07:29 +00:00
Happy-melon
884b94f43b Allow password fields to be served by HTMLForm. 2009-09-06 14:32:03 +00:00
Aryeh Gregor
5e72d3501e Emit CDATA more intelligently
This fixes some possible XML invalidity from r54767: CDATA stuff was
being added only if $wgHtml5 was false, instead of whenever
$wgWellFormedXml is true.  Also, it uses CDATA for script as well as
style, but in both cases only uses it if there's a & or < somewhere.
2009-08-23 21:06:54 +00:00
Niklas Laxström
aa58f44af4 Support script loader 2009-08-09 16:20:14 +00:00
Aryeh Gregor
e0834ecdbf Start using some HTML 5 form features
autofocus attribute added in some places; this looks like it's respected
by both recent Opera and recent WebKit.  Its function is
self-explanatory.  :)  I used this in a few obvious places like
Special:UserLogin and Special:ResetPass to focus the first field in the
form.  Could be used in other places too: Special:Search, etc.

required attribute added in some places.  This is only supported in
recent Opera at the moment.  Also self-explanatory: it won't allow form
submission if the field is empty.

For stuff using HTMLForm (i.e., Special:Preferences), validation will be
done for integers and floats.  Browsers that support this (recent Opera)
will not allow non-integers to be submitted for integer fields, will not
allow non-floating-point values to be submitted for float fields, and
will enforce any min/max values specified.  Opera also gives little up
and down arrows to allow the user to increment/decrement the value in
addition to letting them edit the field as text.

For HTMLForm and account creation, the email input type is used for
e-mails.  This enforces a sane set of values for e-mails (alphanumerics
plus some ASCII punctuation, with an @ in it).  Again, this is supported
only by recent Opera (yay Opera!).  Note that this is actually more
restrictive than what we currently check for on the server side; it
might be sane to tighten up our server-side checks to forbid e-mail
addresses that HTML 5 forbids.

In all cases, the extra features aren't added if $wgHtml5 is false, and
will be ignored by non-supporting browsers.

The major room for further improvement here is use of the pattern
attribute.  We can have the client refuse to submit the form unless it
matches a regex!  The HTML 5 spec says that if a title attribute is
provided, it should be a message that explains what the valid values
are and browsers should provide it to the user if the regex doesn't
match, so it's not a usability problem.  I didn't bother adding that
anywhere at this point because it would require adding new messages, but
it should be easy to do.  Note of course that HTMLForm should be updated
to verify that pattern matches on the server side as well -- this way we
have a clean, unified way of ensuring that our client and server checks
are the same.
2009-08-07 03:32:20 +00:00
Andrew Garrett
20e72c2634 Fix regression in r53316, some more intelligent handling. 2009-07-29 16:20:10 +00:00
Aryeh Gregor
7b66b14738 Add opt-in RSS feed for watchlist
Authentication is via a token entered in preferences, if not blank.  If
you set a token in your preferences, the following sort of link will
generate the RSS feed:

api.php?action=feedwatchlist&list=watchlist&wluser=Simetrical&wltoken=91c1ef18279f9c24ccf67a79e899ae4d2a3201bc

I haven't actually added the <link> tag to Special:Watchlist, since I've
done enough coding for one night.  Someone else can feel free to do
that (otherwise people might get kind of confused :) ).

An auto-generated random token is suggested to the user on the pref page
so that they don't have to be too creative.  Pref help text is rather
underemphasized in the default style, though.

It would be worth considering making this opt-out instead of opt-in,
but that would require some voodoo magic to get the default prefs to
work right (since we'd need a different value for each user).  We might
set the default to some function of user id + secret site-specific value
to avoid having to store the values in the database.

Since the feature is implemented via the API, it only works if the API
is enabled.  Some API people might want to review my code for sanity.

Bug: 471
2009-07-24 01:22:06 +00:00
Brion Vibber
724411c7ca * (bug 19784) date option "ISO 8601" produced illegal id
Now running auto-generated id/names for radio group items through Sanitizer::escapeId().
For good measure, also manually checking the input 'name' and 'id' field values for base fields against validation and throwing an exception if we ain't got em.
2009-07-19 16:49:58 +00:00
Aryeh Gregor
5ed6a1ec3a Allow non-integral days for watchlists and RC
Fixes bug 19296.  This was a regression due to the preferences work.
2009-07-17 22:19:02 +00:00
Andrew Garrett
e8f73d6e9c Force select-or-other type fields to string values, fixing problem where stub threshold was not being properly loaded into preferences window once saved differently to the default 2009-07-15 16:36:04 +00:00
Andrew Garrett
ecdbf0758f Fix bug in HTMLForm system where "Other" option for timezone was shown twice, reported as bug 19321 2009-07-03 14:06:22 +00:00
Jack Phoenix
0350cffc5f coding style tweaks 2009-06-21 18:26:29 +00:00
Andrew Garrett
0386a9427e Fix for string/int inconsistency in value and option for imagesize, resulting in unintended preference reversion. 2009-06-17 19:08:14 +00:00
Andrew Garrett
9505767893 Reimplement Special:MoveThread with the new HTMLForm interface, fixing several bugs in the process:
* Bug 18949 LiquidThreads allows threads to be moved to pages without LiquidThreads enabled.
* You could move a thread to the page it was already on, which would leave strange placeholders that don't make sense.
* Allowing wikitext in some new places where it makes sense.
2009-05-27 16:11:23 +00:00
Andrew Garrett
d4e61f4e83 * Fix silly PHP annoyance where eauth message was shown on all saves.
* Disable email-related checkboxes when email address is not confirmed
2009-04-28 01:00:35 +00:00
Andrew Garrett
f43bcb7b55 Fix regression in r49790, weird spacing for Gadgets and Skin tab. 2009-04-27 14:18:40 +00:00
Niklas Laxström
b98d0b724f * Wrapping inside <p>' creates too much space in search namespace selesction 2009-04-27 11:45:45 +00:00