Commit graph

225 commits

Author SHA1 Message Date
Timo Tijhof
f575721a06 Update all use of $wgVersion to MW_VERSION
Follows-up I04628de4152dd5.

Bug: T212738
Change-Id: I718474ec0d9fd29ac2c05477f0f2493615d8aff5
2020-02-25 02:16:12 +00:00
Fomafix
2a2c7bb7ff Use Mustache template in img_auth.php
Let the template do the output encoding.

Change-Id: I01fc60f10f98c032c5104d3a2f4b44cdfbeee51c
2019-10-05 22:57:30 +02:00
edderso
7df8ebf3ad Fix recent changes and watchlist separator whitespace
Added spaces around 'mw-changeslist-separator' spans in EnhancedChangesListGroup.mustache

Bug: T222903
Change-Id: Ie7e09a39a8f51943fa6c2c244d80435150296a5c
2019-07-30 18:46:47 +01:00
Fomafix
6e0cb5364b ChangesList: Comment out newlines in EnhancedChangesListGroup.mustache
This is a follow-up to 9c5a477395.

This change removes all spaces and newlines inside of the <td> elements
by a Mustache comment. This prevents that the newline get converted to a
<p> element when the recent changes get included by

  {{Special:RecentChanges|enhanced=1}}

Bug: T215737
Change-Id: I179d0b36b122efc3e1b7c193354ad03c3c9cefcf
2019-04-03 06:37:41 +02:00
jdlrobson
5040b3f680 RecentChanges updated to use pseudo elements for presentation
Bug: T219348
Change-Id: I6eeeaa3b58d37adb7fefb4cc6915022229b3b324
2019-04-02 14:52:50 -07:00
Fomafix
2f9a6581b7 EnhancedChangesList: Load style module via addModuleStyles()
This change avoids a flash of missing collapsible toggle icons while
loading.

Change-Id: I090b1622868f2e5a01ca783dfce3be16b7d6b525
2019-02-12 01:29:36 +01:00
Fomafix
9c5a477395 ChangesList: Remove spaces from <td> in EnhancedChangesListGroup.mustache
The special page RecentChanges can included in wiki content via

  {{Special:RecentChanges}}

In this case the generated content is parsed by a wikitext parser. The
wikitext parser converts

  <td>
    <span>Foo</span>
  </td>

to the HTML

  <td><p><span>Foo</span></p></td>

But the wikitext

  <td><span>Foo</span></td>

is converted to the HTML

  <td><span>Foo</span></td>

The module 'jquery.makeCollapsible' supports custom collapsible toggle
buttons but only when they are a direct child of the <td> element. When
the module does not find a custom collapsible toggle button it adds the
default button [Expand].

Because of the additional <p> element when including the recent changes
the module 'jquery.makeCollapsible' adds a default collapsible toggle
button.

This change removes the spaces between <td> and <span> to prevent the
<p> elements when including the recent changes.

Bug: T215737
Change-Id: Ida46956fc7f9ab923c542751ac13411380c02ab0
2019-02-12 00:06:48 +00:00
Fomafix
20261b36c4 NoLocalSettings: Remove style for the html element
There is no need to style the html element. A style of the body element
is enough.

Change-Id: I4ab90824de393de3569ff55cf0138a7aede5770c
2019-02-08 19:45:42 +01:00
Roan Kattouw
39163edd17 RCFilters: Move aggregation of highlight classes to the backend
Construction of the highlight containers was moved to the backend, but
setupHighlightContainers() also aggregates the CSS classes used for
highlights for grouped entries in enhanced mode.

Move that to the backend too, and get rid of setupHighlightContainers().

Also move the namespace classes to getHTMLClassesForFilters() so that
they get picked up too, and pick up classes for tags separately because
the way they're handled is weird.

Bug: T197168
Change-Id: I4c374f82e7d128025f4e2b2f39b0adba14b76ef3
2018-06-26 17:55:50 -07:00
Moriel Schottlender
b44400dad8 Move construction of highlight divs to backend
Create the highlight container div in the backend for
both regular and enhanced result view, so we spare
the load in the frontend.

Bug: T197168
Change-Id: I36bd7b7c4c124d305ac7b07e824dc2a58e152be4
2018-06-26 17:19:47 -07:00
James D. Forrester
de6dab71e3 Remove $wgScriptExtension (deprecated and ignored since 1.25)
* Remove left-over mention of the .php5 entry points in docs.

* Remove dead logic in NoLocalSettings for php5 entry points.

* Remove dead match in WebRequest for php5 entry points (they'd
  redirect since 1.25, and not seen by PHP).

Change-Id: Ia0ee8588591860b8fe34030c8503f38e9bce31f3
2018-04-19 01:11:23 +01:00
Pppery
e60c4ea7a7 Convert includes/Feed.php to Mustache templates
Bug: T182212
Change-Id: Ic198efb6a46ecc2d8b8b49ab594205d69a03efdb
2017-12-13 15:18:20 -05:00
jenkins-bot
72e689e843 Merge "RCFilters: Add marker between old and new changes in enhanced mode" 2017-08-17 05:56:42 +00:00
Geoffrey Mon
700e49dddd Unwatch link for pages in Special:Watchlist
When the 'watchlistunwatchlinks' preference option is enabled, this
adds a '×' link to each entry of the watchlist that unwatches the page
of that entry. When clicked, it changes into a '+' which can be used to
re-watch the page (effectively undoing the earlier unwatch).
When a page is unwatched, its entries and the entries of its associated
talk page (or vice versa) become translucent and are struck through.

Without JS, '×'/'+' link to action=(un)watch for the relevant page.

In addition, ChangesList classes have been modified to allow a prefixer
that adds a prefix to each line (used in this case to put the unwatch
link) and to add HTML data attributes to reliably determine the target
page of each entry. Unit tests have been updated accordingly.

Bug: T2424
Change-Id: I450b2901413d7e75c11de2a446829fdbb22d31e1
2017-08-12 19:36:29 -04:00
Stephane Bisson
d65f49aa78 RCFilters: Add marker between old and new changes in enhanced mode
For both "Live Update" and "View newest changes", add a marker
between old and new groups when changes are grouped by page.

Bug: T163426
Change-Id: I00947d05e9b6022604a2a6b94eec94f6ed747c96
2017-08-07 14:52:42 -04:00
Gergő Tisza
016452cd09 ChangesList: Expose basic properties of lines as data attributes
We have several types of change lists (old RC/watchlist/related
changes, enhanced RC/watchlist, history) with slightly different
HTML, each with their own idiosyncracies. JavaScript code trying
to identify lines by log ID / revision ID has to jump through all
kinds of hoops to work with that.

To simplify the lives of frontend / gadget maintainers and provide
something approaching an API for these pages, we now expose the basic
attributes of each change line (revision ID for edits, log type/action
and ID for log events) as data attributes.

The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
EnhancedChangesListModifyBlockLineData, PageHistoryLine,
ContributionsLineEnding and DeletedContributionsLineEnding hooks
are updated accordingly. New hooks (LogEventsListLineEnding and
NewPagesLineEnding) are added for the change list pages which did
not yet have them.

Change-Id: I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35
2017-06-08 23:19:45 +00:00
Gergő Tisza
854a462dc0 Remove $wgDisableAuthManager
Change-Id: I2b2c9693a275fcc026916bd97f303e7a5c8df341
2016-08-09 23:00:27 +00:00
amir
1c5ea18626 Re-introduce "Templatize Special:Contributions lines"
The original change was 1bce6db10e
It got reverted in I8f63e002e34a9d13e2597a27e3dd918a687d1e7c
Fixed issues raised

Bug: T122537
Change-Id: I047038d6164bd6e32909d25bb37002b43bfd3a92
2016-06-08 20:50:44 +00:00
Gergő Tisza
3617c982c9 Use AuthManager on special pages
Rewrite authentication-related special pages to use AuthManager.
All the changes mentioned below only take effect when
$wgDisableAuthManager is false.

LoginForm is rewritten to use HTMLForm and split into UserLogin
and CreateAccount; ChangePassword and PasswordReset are rewritten;
ChangeEmail and Preferences are updated. Four new special pages
are added to handle the new capabilities of AuthManager (linked
accounts, secondary authentication providers): LinkAccounts,
UnlinkAccounts, ChangeCredentials, RemoveCredentials.

The old form-based hooks (ChangePasswordForm, UserCreateForm,
UserLoginForm) are deprecated. A new, more generic hook is
available to alter the forms (AuthChangeFormFields);
form changes that involve new fields should be done via
$wgAuthManagerConfig.

UserLoginComplete is limited to web-based login; for more
generic functionality UserLoggedIn can be used instead.

Hooks that assume password-based login (PrefsPasswordAudit,
AbortChangePassword) are removed; the first functionality
is replaced by ChangeAuthenticationDataAudit, the second is
handled by AuthManager. LoginPasswordResetMessage is removed,
the functionality can be recreated via authentication providers.

There are several smaller backwards incompatible changes:
* Adding fields to the login/signup forms by manipulating the
  template via the extraInput/extrafields parameters is not
  supported anymore. Depending on the authn configuration the
  login/signup process might be multistep and it would be
  complicated to ensure that extensions can access the data
  at the right moment. Instead, you can create an
  AuthenticationProvider which can define its own fields and
  process them when the authentication is over.
  (There is B/C support for a transitional period that  works with
  the default login form, but might break with configurations that
  require multiple steps or redirects.)
* Removed cookie redirect check. This was added in 2003 in 9ead07fe9
  for the benefit of bots, but with MediaWiki having an API these days
  there is little reason to keep it. Same for the wpSkipCookieCheck
  flag (added in 2008 in 29c73e8265).
* Instead of embedding a password field on sensitive special pages
  such as ChangeEmail, such pages rely on AuthManager for elevated
  security (which typically involves requiring the user to log in again
  unless their last login was more than a few minutes ago).
  Accordingly, wgRequirePasswordforEmailChange is removed.
* Special:ChangePassword requires login now.
* Special:ResetPassword now sends a separate email to each user when called
  with a shared email address.
* the Reason field had a message with 'prefsectiontip' class
  which was sorta broken but used in extensions for formatting.
  HTMLForm does not support that, so this commit turns it into a help message
  which will break formatting. See https://gerrit.wikimedia.org/r/#/c/231884

Bug: T110277
Change-Id: I8b52ec8ddf494f23941807638f149f15b5e46b0c
Depends-On: If4e0dfb6ee6674f0dace80a01850e2d0cbbdb47a
2016-05-16 15:12:13 +00:00
umherirrender
8678e32b8d Change remaining places to use short array syntax
Change-Id: I0785c73a239c11188ad7411c5cd8ed09a2dbc9b3
2016-03-11 18:41:26 +01:00
Volker E
3387e84c76 Minor update on login form on layout and buttons
Changing current `constructive` button to `progressive` as part of the
consolidation task T110555. Also bringing some minor layout improvements,
aligning values to CSS coding guidelines and cleaning up typos and
superflous (initial) style values.

Bug: T89860
Bug: T126307
Change-Id: I2cc642ddc78f1b436e47261568601be592fe1fa4
Depends-on: I095eddfe5ec2f1fbc81939b67ed467484e15092b
2016-03-08 19:07:43 +00:00
Krinkle
ae42161c84 Revert "Templatize Special:Contributions lines"
Breaks RevisionDelete.

This reverts commit 1bce6db10e.

Change-Id: I8f63e002e34a9d13e2597a27e3dd918a687d1e7c
2016-03-04 15:14:58 +00:00
Adam Roses Wight
1bce6db10e Templatize Special:Contributions lines
Bug: T122537
Change-Id: I11aac43de495881e10e393d075a231bd346ea547
2016-03-03 20:11:20 +00:00
Adam Roses Wight
de8f8c8248 Use template to render EnhancedChangesList groups
Rewrite a chunky HTML string concatenation party as Mustache template
rendering.  This decouples the view from the controller.

Bug: T120921
Change-Id: I3217b80168f89e7b91dbc33a7053865ad3408615
2015-12-28 20:09:11 +00:00
jeroendedauw
c0ce94c5ce Remove dead local vars in UsercreateTemplate
Change-Id: I61738d0d1c1355fdd9a192ab0edf73a78ae3546c
2015-09-10 19:28:45 +00:00
Florian
184fbf381a Allow extensions to add a banner to UserLogin and CreateAccount special pages
Some extensions, e.g. MobileFrontend, customize the UserLogin and UserCreate
special pages. This change adds the possibility to add some HTML after the warning
and/or error messages are printed to the output. This will be used in
MobileFrontend to get rid of the own userlogin template.

Bug: T87261
Change-Id: Ia81f7c52f08e8dcc73ac751432560c4077d4bd39
2015-07-16 17:28:00 +02:00
umherirrender
edd418078b Remove unneeded variable assignment in Usercreate.php
Change-Id: I8fe2e6bc3a6c63dacee8d6c8f314d9b4161b7144
2015-03-26 20:13:01 +01:00
umherirrender
89f6293bf2 Escape extra input messages on Special:UserLogin/signup
TitleBlacklist and AntiSpoof can register extra input fields with a own
message, this message would now be escaped to avoid use of raw html.
Messages: 'titleblacklist-override' and 'antispoof-ignore'

The messages are now handled similar to checkbox 'createaccountmail'

Bug: T85864
Change-Id: I14326c3844904560b66eb8e8eb7d36706caa47da
2015-02-26 05:49:22 +00:00
kaldari
13aff8aa7c Adding sample code to TemplateParser::processTemplate() docs
Also reverting punctuation that was accidently changed in
change I28cd13d4d.

Change-Id: I1283fbfbaf8cefbbc951599ee286d923b9dedf65
2015-02-20 16:40:31 -08:00
kaldari
95be8acc30 Fixing links on NoLocalSettings page
This fixes a regression caused by change I28cd13d4d.

Change-Id: Iff30f08688d17da2d690c5e798c43489b1cafc7e
2015-02-20 15:44:03 -08:00
kaldari
2ec0272218 Adding TemplateParser class providing interface to Mustache templates
The TemplateParser class provides a server-side interface to cachable
dynamically-compiled Mustache templates. It currently uses the
lightncandy library to do compilation (which is already included in
the vendor repo).

Also converting NoLocalSettings.php to use it as a proof-of-concept.

Bug: T379
Change-Id: I28cd13d4d1132bd386e2ae2f4f0d1dd88ad9162b
2015-02-19 17:41:45 -08:00
mgooley
6d94435705 Fixed a path issue in NoLocalSettings
Added a break in the else statement, because
the only time it will go to else will be if
it hits a page (.php), in which case we don't
need to continue any further because we have
the full path needed to access resources.
(Image and link location)

Bug: T88168
Change-Id: If948b12bb09260d6ea119c3478b90225537b9786
2015-02-09 20:53:59 +00:00
umherirrender
8446f9c3cb Usercreate: Move label of extraInput to right place
With change Ib585e32463765d7eb7d0be5dae54dc828ddd4ca9 the position of
the label for extraInput (from TitleBlacklist or AntiSpoof) was
misplaced outside of the label. This breaks clicking on the label to
check the box. It is also possible to have line break between check box
and label, which is unneeded there.

Bug: T87385
Follow-Up: Ib585e32463765d7eb7d0be5dae54dc828ddd4ca9
Change-Id: I8384621075c6a73cff7575af0380f90bc75e234d
2015-01-24 10:54:41 +01:00
Sumit Asthana
b9b75d2031 Templates:Captcha position modified,extend functionality added to QuickTemplate
The ConfirmEdit extension presently inserts captcha in the header of Usercreate
and Userlogin templates. The js,if enabled places the captcha before submit
button.  A separate 'extrafields' placeholder for captcha is added just before
submit button in Usercreate.php so that captcha position remains consistent,
even if js is disabled.  An extend method added to QuickTemplate to append any
data to existing field, rather than setting it with fresh data. Particular use
for 'extrafields' in Usercreate and Userlogin.

Bug: T85192
Change-Id: I82c68814e79cbc5aa250a308862c59fcbb6fd527
2015-01-20 19:24:26 +05:30
jdlrobson
d51772b6e0 Stop using mw-ui-big on login form buttons
This is inconsistent with mobile and is one of the blockers from us
using this form rather than our own on a mobile device.

Also mw-ui-big is a terrible class name and we should be deprecating its
usage.

Change-Id: I56e93429431690cf1b9ef043620b36148e3b4a7a
2015-01-16 14:39:00 -08:00
Bartosz Dziewoński
ff1f9e7a53 Userlogin.php: Tweaks and corrections
* Correct nesting of the block generating "Forgot your password?" link
  – it would be mistakenly only generated if the user could create an
  account.
* Use ->escaped() rather than ->parse() for 'userlogin-resetpassword-link',
  as it is used inside a link and allowing wikitext could lead to
  undesirable side-effects.
* Remove unused $extraAttrs variable.
* Remove pointless 'size' => '20' for some fields (they are displayed
  full-width using CSS).
* Remove pointless .mw-ui-block class, as its styles are always used
  for buttons in a VForm.
* Prettify code for hidden fields generation.

Change-Id: If749620bf2eaf58f815cae559383e1a1c842b870
2015-01-15 18:46:01 +00:00
jdlrobson
f6d0456175 Consolidate mobile and desktop designs for login form
* Stop sign up button from being a button
* Move password reset to bottom of form

Bug: T85189
Change-Id: I175e9f515d962f9078845f25f9b96079819444c6
2014-12-23 21:42:56 +00:00
jenkins-bot
30e009794b Merge "If a user logs in while not on https, then the user should be sent back to the non-secure website." 2014-12-03 22:36:23 +00:00
Stephen Liang
7ddada5c0c If a user logs in while not on https, then the user should be sent back to the non-secure website.
Bug: 71716
Change-Id: I7c24b779e5f4b01bd400a1833e12932f7b01f848
2014-11-19 09:18:04 -06:00
Reedy
042c6b6fcc Add 'name' back to wpLoginAttempt
Change-Id: I353ccb74e3572ab2e22a3803d0bc265be2ca2408
2014-10-12 00:57:53 +01:00
Kunal Mehta
89df384c02 Fix session failure errors when trying to create an account
wpCreateaccount was no longer being passed in the POST request,
so the special page thought a login attempt was occurring rather
than an account creation attempt, so it checked against the wrong
token, resulting in session failure errors.

Bug: 71862
Change-Id: I9519cb264be9f587ef4354ba1fd03962a52755a2
2014-10-11 23:44:39 +00:00
jdlrobson
a155ac55ea Hygiene: Make construction of buttons easier
Stop littering MediaWiki with globals, provide a common
api for generating them similar to how we do text input
attributes before things get out of control.

Adds
* submitButton
* linkButton

Change-Id: I61bb3c358f755ed9f2153d94b744c1a9da02c456
2014-09-30 14:54:56 -07:00
Bartosz Dziewoński
a94f11d625 Allow logged-in users to view and use the login form again
The fix for bug 15484 (d0439af8) has introduced the behavior of
automatically redirecting users who view the login form when already
logged in to the requested 'returnto' location. If it was not given,
users were redirected to main page instead.

However, that has annoyed people who often switch between several
accounts and have grown accustomed to the old behavior of being able
to log in while logged in. Given that there are no conflicts between
these two features, let's just restore the old behavior when
Special:UserLogin is visited directly (no 'returnto' location given).

This reverts 5dfc57eb which removed then-dead code for showing login
form to logged-in users and tweaks an if() condition.

Bug: 70855
Change-Id: I7e40c13a6ca566b4d66d943c006af9edb6941ee9
2014-09-22 14:02:00 +00:00
Bartosz Dziewoński
1cf5a6e9d3 Move assets/ to resources/assets/
While it's "semantically" incorrect (these files are not
ResourceLoader resources), putting them in that subdirectory is a lot
less hassle than introducing a new toplevel directory.

Follow-up to 2b4b9a3f. Discussion that resulted in the toplevel
assets/ took place on I6268d663 (now abandoned).

Change-Id: Iedbfd802457fe35803899e3479540177760ec30b
2014-09-17 21:39:03 +02:00
jenkins-bot
3133bd0dd5 Merge "Move mediawiki.png to assets/ directory" 2014-09-07 21:26:50 +00:00
jenkins-bot
2f0563f789 Merge "Remove unneeded spaces inside html in NoLocalSettings.php" 2014-09-05 19:33:17 +00:00
Bartosz Dziewoński
d18888b0d0 Move mediawiki.png to assets/ directory
Bug: 69277
Change-Id: I7936d878de23b1b85d5e0a3a3a9572101681dfdc
2014-09-05 20:03:39 +02:00
umherirrender
e48a712c13 Remove unneeded spaces inside html in NoLocalSettings.php
A <a> should not be followed by a space, because the space is
already before the tag. This gives double spaces when
copy and paste the word and link.

Change-Id: Ia46cafc6ea7359e92a315678020e7815810aac5a
2014-08-27 18:46:32 +00:00
Bartosz Dziewoński
5dfc57eb80 Remove dead code for showing login form to logged-in users
Since d0439af8, trying to view the login form while logged-in just
redirects to the 'returnto' address (or the main page), so this code
is unreachable.

Change-Id: I9ab8ab83172063d8facc491042832513d27f876b
2014-08-25 22:48:58 +02:00
jdlrobson
6ffc4c38ca Make Special:UserLogin form use mw-ui-checkbox
Change-Id: Ib585e32463765d7eb7d0be5dae54dc828ddd4ca9
2014-08-14 18:31:41 +00:00