Commit graph

51 commits

Author SHA1 Message Date
jdlrobson 888129478b Generalise search trigger mechanism
Allow content to trigger it.

Bug: T189316
Change-Id: Ie9a66b001b3ea4f79e465747b80b181df948cd34
2018-03-12 20:49:25 +00:00
jdlrobson 196fb20836 Restore Minerva specific userpage styles for all user pages
In T182162 these were removed incorrectly. They should only have
been partially removed.

Bug: T187222
Change-Id: Ia3fb34250714fe4ccb10c32a7027fda167e06a16
2018-02-13 16:14:54 -08:00
jdlrobson 3047f3e0fa Merge remote-tracking branch 'gerrit/master' into specialpages
Change-Id: I1bc48ac546865f515df65e9d7f0c75e7f5c6d684
2018-02-01 11:35:11 -08:00
jenkins-bot af9db025df Merge "Remove horizontal line from popups preview in MinervaNeue skin" 2018-01-30 19:18:58 +00:00
Alangi Derick 3c81e0c717 Remove horizontal line from popups preview in MinervaNeue skin
A horizontal line shows in popup previews in the MinervaNeue skin
just above the setting icon due to a css rule that affect all footer
elements. Removing this effect to apply only for the MN skin.

Bug: T184560
Change-Id: Idb0c40c3fc24e4ec2d32cb2de9520952448da77a
2018-01-30 20:06:42 +01:00
Timo Tijhof 08985b2229 Remove use of QuickTemplate::setRef
Follows-up 2c01147c13be, 429f557cc7f68a46.

The array is already copied by value once returned from getLanguages().
Setting it by reference within the QuickTemplate instance doens't
have any effect, but does logically break the concept of pushing
data in a single direction through the skin.

Remove use of setRef in preparation for restricting skins only
consuming data as given, without the ability to change data
in other parts of the system.

Bug: T140664
Change-Id: I0978dd5c123fda57f45534a8d2e51b7e65e55223
2018-01-27 13:11:37 +00:00
jdlrobson c5d09c0288 Prefix icons in Minerva
Changes:
* MinervaUI will now prefix any icons with `minerva`
* Update definitions in skin.json, retaining selectors for cached
HTML for icons that are rendered via PHP.
* In I9021c53c2c04bdd7ce395eed33d89986acbfea6d watch and watched
and arrow are moved to MobileFrontend so are removed from the RL module
skins.minerva.icons.images.scripts as they are not
used directly in this repo. user and anonymous are no longer used
so also removed.
* Presentation of userpage now belongs to MobileFrontend. Icons
are styles were moved there in depends on. They are retained in
skin.json to support cached HTML as user pages are subject to
cache. They can be removed in a week.
* In code review we noticed the anonymous icon was badly named. We
rename to login. No caching implications.
* Main menu icons are now prefixed with minerva rather than mf to
reflect where they come from.

Depends-On: I9021c53c2c04bdd7ce395eed33d89986acbfea6d
Bug: T182162
Change-Id: I93264024f4915fc910c792b1905b89cdc6b8b546
2018-01-19 15:30:03 -08:00
jdlrobson fe3ac29fe7 Merge branch 'master' into 'specialpages'
Change-Id: I167f03477fd79e5ea0c7fa5cdf5df71bb8da31c2
2018-01-19 11:00:55 -08:00
petarpetkovic 413fcc12f6 Fix seen notifications appearing as unseen on mobile
Important note: Make sure to distinguish unseen from unread

One way to reproduce minerva and non-minerva notification inconsistencies:
- Have all your alerts and notices seen. This is displayed with grayed out
number on vector skin or no number at all, if you have (marked as) read.
- Generate new alert or notice (one is enough) in your preferred way.
- You can check minerva and non-minerva at this step. Both should be in sync.
But don't perform any additional action.
- Open the notification popup in some non-minerva skin (I have tried with
vector and monobook), marking it as seen.
- Check the notification icon in minerva. At this point, you should see
notification displayed as unseen.

The reason bug appeared in the first place is that alert/notice timestamps
were mixed up when seen time is obtained. We get seen time from
EchoSeenTime class, where we get smaller of the two timestamps,
using PHP method `min()`. See I27109ee6a248. Then, we get last unread
notification timestamp (which can be either alert or notice), and compare
that to seen time. That leads to the situation when you have only one of
alerts or notices with unread items, smaller timestamp is used for seen,
and most recent for unread, at which point we compare timestamps for
two separate things.

Previous behavior of getting seen timestamps (using max instead of min) would
probably solve the problem, but some other inconsistencies might arrise.
This should prevent any weird and unpredictable behavior to happen.

Bug: T183076
Change-Id: I20bbd6c590086b1c3eccf82983aad59eb3144a7a
2018-01-18 14:18:56 +01:00
jdlrobson 09a1f98ab3 Merge remote-tracking branch 'origin/master' into HEAD
Change-Id: Ia1a520d983be096e29cfe725f619be0423f9d110
2018-01-08 16:37:44 -08:00
petarpetkovic c8195e37ef Fix notifications always appearing as unseen
After Ie92b223a48 removed $flags parameter from EchoSeenTime::getTime(),
we got 0 as $format passed to the method, which caused mismatch in
timestamp string formats when comparing to $notifLastUnreadTime timestamp,
which caused notifications to appear always as unseen (although that's
unpredictable, because of wrong format used).

Bug: T183076
Change-Id: Ia4ff0bc4c3b7ed80b5a22a9ca0052f1909469180
2018-01-03 18:21:40 +01:00
jdlrobson 6598c1e7c3 Merge branch 'master' into HEAD
Change-Id: I220fbc57ee20d2a6717b39dba809401de2207ce0
2018-01-02 13:21:27 -08:00
David Sn 90f324a5b7 Use preg_replace instead of str_replace for replacing extension
Bug: T166684
Change-Id: I233be410486276f30b08034180eb54cb08e04076
2017-12-07 16:05:48 +00:00
jdlrobson c986db6c0e Always render taglines unconditionally and update styles
Adjust tagline margin per Nirzar:
https://phabricator.wikimedia.org/T180095#3801719

Note, this will  enable the tagline everywhere.

Change-Id: I3bce2a3472ab2e53261965c953572f35cc740eed
Bug: T180095
2017-12-05 00:27:11 +00:00
David Sn 8a19c0cb33 Use png as fallback for svg on non-supported browsers
This will use the srcset attrribute which was introduced with HTML5,
in order to load the svg image on supported browsers.

Should fix the bug after merging change 394820.

Bug: T166684
Change-Id: I2337b750c80e79c816dc817dfe230e063eed0345
2017-12-04 22:13:23 +00:00
jdlrobson eaa4dae5af Disable download button in all namespaces except main
The MinervaDownloadIcon config option is replaced with a
more specific wgMinervaDownloadNamespaces config option.
If the list is empty then the download button will not be
shown.

Since the download icon is enabled everywhere in production now
this is good as it means Minerva reflects the production value.

Bug: T181152
Change-Id: Id78c1de9e8e9013530106bc0d45d3cf0297897b5
2017-11-29 20:29:12 +00:00
jdlrobson ed5e9dd1d5 Hygiene: Refactor Minerva history link generation
* Create several sub functions to manage complexity of the history link
* Clean up MinervaTemplate to use data directly and remove isMainPage
template variable which is no longer being used.

Change-Id: I124aec9637f3635a335c58e559e578b2a56eb4c5
2017-11-27 14:27:11 -08:00
jdlrobson b72c10e06f Show last modified bar without relative time for old revisions
If FlaggedRevisions is being used then older revisions will be
shown as if they are the current revision of the page. This causes
problems as it makes it hard to give a true indication of when
something was last modified - do you show the last time someone
made an edit or the last time someone approved an edit?

The same issue applies on revisions and we attempted to fix this
earlier in T153125 but in doing so caused this problem.

Bug: T180116
Change-Id: I6d47adf272c99791d4af9f97afa02799d495887e
2017-11-22 10:29:51 -08:00
jdlrobson 8eb65b264d If timestamp is null load revision time
Passing null to wfTimestamp will result in the current time.
Protect against that happening

Bug: T180103
Change-Id: I6ef9577bf52609bf387b0146f1d8a4a53be58cd7
2017-11-16 23:23:25 +00:00
jdlrobson e422eb9a81 Do not try to add edit links to the HTML in contexts without a Title
Title may be null when accessed via this->getTitle()
If this is the case we should assume the skin is being used by someone
who is not a reader and in these circumstances, not try to render any
page actions.

Bug: T179833
Change-Id: Ia47fd9b059101bf22b5d31be7df3a332b35d6b24
2017-11-09 21:23:48 +00:00
Kunal Mehta 74b3faf580 Move class_alias out of skin initialization
Use the standard way of doing it by adding an autoloader entry, and putting
the class_alias() call into the same file as the class.

Change-Id: I93e19ebcf3dd7d9815623de5e24861949fd0269a
2017-11-08 00:20:00 +00:00
jdlrobson dfabc67d95 Hygiene: Remove dead call to addModuleStyles
This is adding an empty array and not necessary

Change-Id: I232dd9b0fe7343a6531582ad66a62d3babe275e3
2017-11-01 11:20:17 -07:00
jdlrobson d3318a9f85 Remove MobileFrontend's font changing code from Minerva
Fontchanger code now runs on all skins under the `mobile` target.
All the code will now live in MobileFrontend meaning developers
can operate inside one code base.

Depends-On: I857cfe2d9be9fe49c04c860bc234384c787239b2
Change-Id: I2759455cb6d7ddf13798e94452cb74baf502bafe
2017-10-30 19:11:16 +00:00
jdlrobson 12b49a70ad Notification icon should not show NaN for persian Wikipedia
Bug: T172755
Change-Id: I2884c8daed3fe0e0d05c746ec6319956b7426957
2017-10-26 20:27:12 +00:00
jdlrobson 45a1b3b423 Add feature flagged DownloadIcon
Shortcut for print. Disabled by default and controlled by
wgMinervaDownloadIcon

Note that with lazy images enabled, images will not appear
in the printed article. This can be easily addressed inside
the onClick function in a later patchset with a few modifications
to the Skin class.

Currently the flag when enabled will show on all browsers. There
are some open questions on the ticket about how we want to limit
the feature. This shouldn't block review or merging.

Bug: T177215
Change-Id: I49f1736870c743990b3fb9916247e07a597b2f59
2017-10-23 18:12:20 +00:00
jdlrobson b93b7eda7c Render add discussion button in PHP not JS
The talk page JavaScript progressively enhances an
existing button in the page.

Remove the frontend logic and rely entirely on whether
the button is in the page or not.

Additional change:
* The browser tests incorrectly suggest a user needs
5 edits to be able to use the talk feature. This is not
true. They just need to be logged in. Update that logic.

Bug: T167728
Change-Id: Iacedea30bdd0775b3d785db5b143abafd7a18b39
2017-10-16 22:35:11 +00:00
Umherirrender 8e8c9d0654 Improve some parameter docs
Change-Id: I239d4aa0023978b27bc04a7ff7d55892f3bb7feb
2017-10-05 19:17:38 +02:00
jdlrobson 2e8ea6219f Update SVGs for page actions and restore locked edit icon behavior
The locked edit icon will now show on protected pages.

Additional changes:
* userpage and userNormal was not minified. This has been fixed.

Bug: T174105
Change-Id: I0ef9c4cf3ea6cd1c550023fdf99581b665b459b2
2017-09-29 13:20:39 +00:00
jdlrobson 0dd994edda Prepare to break the server side MobileFrontend dependency on Minerva
Changes:
* Minerva now maintains a MinervaUI - a simplified version of
MobileUI that provides iconClass and buttonClass helpers.
* Minerva now maintains its own ResourceLoaderParserMessageModule

Remaining issues:
* Main menu links to '#'
* Unknown dependency errors are thrown due to the missing
JS libraries e.g. mobile.watchstar
thus JS based UI components are unusable e.g. search autocomplete,
and edit button
* Language button navigates to a missing special page without
MobileFrontend (see T104660)

Bug: T169569
Change-Id: I89e2e15faabab73b0cba91afc2f2c5e785edef29
2017-09-27 21:21:59 +00:00
jdlrobson 606e72ab68 Revision::newFromTitle may return null
Bug: T176882
Change-Id: I9aea25c2db81a12f16414edcb279f3241dc380bc
2017-09-27 19:58:46 +00:00
jenkins-bot 0a3378adcf Merge "Hygiene: Refactor SkinMinerva so it doesn't use MobilePage" 2017-09-08 19:17:58 +00:00
jdlrobson 9909914b30 Hygiene: Refactor SkinMinerva so it doesn't use MobilePage
MobilePage is provided by MobileFrontend and replicates functionality
in core. Let's invest more in those core interfaces. It's a bit of a
maze, so I think there's probably a cleaner way of doing this...

Change-Id: Iea0a3121841c4774eb117168b1cfc8c2e1e24a0c
2017-09-08 14:50:25 -04:00
jdlrobson 69cb08262a Hide last modified bar on old revisions
Bug: T153125
Change-Id: I43f6f1993ebeacead12d7ec6da584c6d1e14da12
2017-09-07 14:17:30 +00:00
libraryupgrader f86c148866 build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
The following sniffs are failing and were disabled:
* MediaWiki.Files.ClassMatchesFilename.NotMatch
* MediaWiki.Files.OneClassPerFile.MultipleFound

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.SpacingAfterParamType
* MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage

Change-Id: I0689ff20133a2a23d6389aa50487349c6ed3797b
2017-09-01 05:01:10 +00:00
jdlrobson c323c6858a Hygiene: Merge skins.minerva.print.styles with skins.minerva.base.styles
We no longer need to keep this as a separate entry point now we do not
feature flag our print styles

Please enter the commit message for your changes. Lines starting

Change-Id: I6bf12980aa929e84f239931beb0a505809231830
2017-08-31 19:09:03 +00:00
jenkins-bot c5139c3536 Merge "Avoid using deprecated Title::canTalk()" 2017-08-30 17:23:07 +00:00
Kunal Mehta ff3f980f70 Avoid using deprecated Title::canTalk()
Change-Id: I9f43710bed8557d192906b49fbc8a8f9e43d3448
2017-08-29 12:37:00 -07:00
jenkins-bot 7c1be417b0 Merge "Remove special page resource module handling" 2017-08-28 16:21:52 +00:00
jdlrobson ac7fcfc9e1 Disable wikitext editor on non-wikitext content models
Do not allow editing via JavaScript on non-wikitext content models
For these pages ?action=edit will be used

Bug: T173800
Change-Id: Ic62a0c1397ab8a6a59e5382c2999b63b3c60a19f
2017-08-22 17:02:58 +00:00
jdlrobson 61ba76efdb Remove special page resource module handling
This is handled by MobileFrontend now, just as it should do.
We rely on skinStyles where possible.

Depends-On: I665f6fe60939475249786fdc951149c38473fda6
Bug: T173597
Change-Id: I0fe9efcf98bbd8e188d91a29d4cfda897d47808d
2017-08-18 19:37:08 +00:00
jdlrobson d5e09c91e9 Check if SpecialMobileWatchlist exist
If MobileFrontend doesn't exist this will throw an error

Bug: T171241
Change-Id: Ie61cfa61b78a53598ac59aea15c8a4e6a261238d
2017-08-17 22:40:54 +00:00
jdlrobson 5146a90590 i18n: Add Minerva specific message key for last modified bar
This is currently defined in MobileFrontend which uses it for
Special:MobileWatchlist.

We shouldn't use two messages for 2 purposes so let's give it
its own dedicated message.

Change-Id: Id5df6aad20815b88b8bd2685514e7eb3237a5b3b
2017-08-16 14:56:00 -05:00
jdlrobson 65670fbce3 Do not assume MobileFrontend special pages exist
If they don't exist attempts to use them will throw errors.
This will only happen if MobileFrontend is not installed

Change-Id: Iee674011bbd59d79914a144d1738b912eceea6b1
2017-08-16 14:34:26 -05:00
jdlrobson e1ee63d4af MobileFrontend should be responsible for adding mobile.site module
Change-Id: I4508762629333c96dc6b11f6c0f63b675b367209
Depends-On: I094a57532a4e7dac47d06f25c56dbd4935ec707c
Bug: T171062
2017-08-11 11:44:49 -05:00
jdlrobson f4ec2330e2 Don't output empty footer items in desktop Minerva
These fields can be false. Make sure we don't output them

Change-Id: If40c27f85e61558d09b14f4f4cfe394f581929b5
2017-08-04 07:51:48 -07:00
Eddie Greiner-Petter b0384c4314 Show title on the page named '0'
The string '0' evals to false in the if( $pageTitle ) condition, hence
the title was not shown for the page named '0'.

Bug: T163084
Change-Id: I27ab379bf67634c484c4cf5e12e391d69702f464
2017-07-30 19:50:34 +02:00
jenkins-bot 78daa06cc1 Merge "Hygiene: Drop MFAllowNonJavaScriptEditing and Special:MobileEditor" 2017-07-26 18:40:09 +00:00
jdlrobson 3ad9c4e3c6 Hygiene: Drop MFAllowNonJavaScriptEditing and Special:MobileEditor
Bug: T125174
Change-Id: Ifc0efcb87605e5cd678343d1ac91a2ce53b33664
2017-07-25 11:07:03 -07:00
Umherirrender 2aacf47c8d build: Updating mediawiki/mediawiki-codesniffer to 0.10.1
Change-Id: Icba559465885af1169a1912f501bed56eea23ad9
2017-07-24 18:53:04 +02:00
jdlrobson 747b712509 Minerva should use mediawiki.hlist
Override provided styles

Bug: T42062
Depends-On: I9305af5d30c8c24b44f4a0c6a466581c45fa3028
Change-Id: I7adda8ef99e5eee3df5bd7dc4da5081c1225f815
2017-07-19 13:52:09 -07:00