Commit Graph

237 Commits

Author SHA1 Message Date
jenkins-bot 4f907cd148 Merge "Remove fancy block info popups (move to MobileFrontend)" 2018-07-27 03:41:09 +00:00
jenkins-bot 68d1bc61f6 Merge "Limit editor text area styles to where they are needed" 2018-07-26 23:28:55 +00:00
Bartosz Dziewoński f114f81d42 Remove fancy block info popups (move to MobileFrontend)
We only used them for registered users, but MobileFrontend's
EditorOverlay code can use them for anonymous users as well.

Remove code for looking up block details in wgMinervaUserBlockInfo,
now we only care whether the user is blocked at all to display a
different icon. MobileFrontend looks up the same information via API
already.

Remove unused message 'mobile-frontend-editor-blocked-info-loggedin',
it was only used by non-fancy popups, which were removed in favor of
the new ones in f51cf7db7b.

Bug: T193754
Bug: T198765
Depends-On: I80564c3e6e2d0f4d7eae754f206780fb4054f254
Change-Id: I64be24845b4fee76d6b4a8e481a218f2160fced6
2018-07-26 23:44:28 +02:00
jdlrobson 28b9517dcb Limit page issues truncation to at least 2 lines
In the case of template {{dictdef}} the issue gets limited to one
line making it unreadable on mobile at certain resolutions due to the
learn more link taking up space that's available to the issue itself

As well as enforcing a max-height, enforce a height so that all issues
can have at least 2 lines to play with on all mobile screen resolutions

Bug: T197931
Change-Id: Icebdcf37d0f307dc82493c5ced53b632a6b09aea
2018-07-26 08:14:08 -05:00
Jan Drewniak a10bb49c01 Truncate page-issues to 2 lines of text.
Truncates ambox template styles to only show 2 lines of text.
"Learn more" link is placed on the same line as message text
and a fade is applied so that it doesn't overlap with the message text.

On table & larger layouts, the "learn more" link is placed on its
own line below the page-issue text.

Bug: T197931
Change-Id: Id607dea537c212298c02a0e1639aef2a786eb424
2018-07-26 08:14:08 -05:00
jdlrobson c7cb4ecee0 Limit editor text area styles to where they are needed
Currently we load textarea styles across all pages. However, in practice
textareas only show up in the edit page and inside our JavaScript overlays

To avoid loading these styles as rendering blocking CSS

Additional changes:
* Drop css reset for textarea so that textareas where unstyled
have sensible defaults. Note given the usage of OOUI and MediaWiki UI
this should be minimal/no disruption.
* For consistency intentionally change the padding of the non-js editor
to be consistent with other textareas
* The padding-left/padding-right rules currently override the default rule
so consolidate them into one single rule

Note:
* This will not break non-JavaScript editor mode as the module
mediawiki.action.edit.styles is loaded on that page as a render blocking
style.

Bug: T199000
Depends-On: I1ab170fc4089b0c8129a3e62ee78efad1c6709fa
Change-Id: I91743fdf1942a1b1b750422e973bf98fc4d106db
2018-07-26 10:35:16 +08:00
jdlrobson a3efca1582 Remove unnecessary skins.minerva.base.styles
* truncated-text is only used in MainMenu, last modified bar,
 a few special pages
Making this a mixin and limiting it to mobile.startup skinStyles
and mobile.special.styles thus makes sense
* cloaked-element is only ever added by Skin.js in mobile.startup
* position-fixed is only ever added by Skin.js

Change-Id: Iaf7061e9dda87eb25c963f8a281175af08f358e5
2018-07-26 01:18:00 +00:00
jenkins-bot 8276241e39 Merge "Move overlay-header styles to Overlay" 2018-07-25 14:00:47 +00:00
Stephen Niedzielski 9a7ee86fc1 Update: remove the internal link icons
Bug: T190549
Change-Id: I87c55d26d36eead60c0137e244bdcc09f4239a76
2018-07-25 10:55:39 +08:00
jdlrobson 8351c88c50 Move overlay-header styles to Overlay
.header > form matches no element on the page
all other selectors are linked to the mobile Overlay so should
be shipped along with those styles.

Remove .header-action rule, given that header-action's only appear
inside Overlays (Editor, Category and Talk)

A more generic rule already exists (.overlay .header-action > *)
for overlays that sets the min-height

Change-Id: I114fe80e50bb833e9e6bb0fb6b13c2e929244ddf
2018-07-25 02:45:34 +00:00
jenkins-bot ef63ced9b4 Merge "Match section issues to section number" 2018-07-24 23:03:18 +00:00
jenkins-bot 65728feb27 Merge "Don't ship 2 magnifying glass icons" 2018-07-24 18:14:19 +00:00
jdlrobson 775af007f0 Don't ship 2 magnifying glass icons
We already make use of the images 'name' key inside
skins.minerva.content.styles.images to define the full
CSS selector. We can use this approach to ship a single version of
the magnifying glass icon, rather than having 2 defined in both
skins.minerva.base.styles and skins.minerva.icons.images

Change-Id: Ie5ec06152c418c4aa1b620b3d0a904cc9517e5d0
2018-07-24 11:55:41 -06:00
jdlrobson fcaf244cc4 Hygiene: lazy loading animations do not need to be render blocking
The transition only happens when images are loaded via JavaScript
so limit the styles to a file loaded via JS NOT render blocking
CSS

Change-Id: I56661db13e7fbb400a05b13c369d8598df449297
2018-07-23 13:57:42 -05:00
jenkins-bot 4aba34a5ed Merge "Cleanup: Last modified active color should be loaded via JS" 2018-07-23 16:54:28 +00:00
jdlrobson 54af37c269 Match section issues to section number
The section number relates to the position of the corresponding heading
not the corresponding top level section.

This only changes the URL, not the functionality. sub section issues
will continue to be grouped along with other section issues.

Bug: T197932
Change-Id: I325a3b477f89c9cc24f13ca017f478a6b7e7b68e
2018-07-23 10:09:32 -05:00
Stephen Niedzielski d2f6c38fe7 Update: page issue icons
- Fix a bug where the all issues endpoint would incorrectly collect
  issues from all sections.

- Update the page issue iconography. This increases the size of the
  delivered code and images by 1743 B minified uncompressed according to
  mw.inspect() (from 16.4 KiB to 18.1 KiB).

- Add support for identifying page issue severity based on template CSS
  classes.

- For multiple issues templates, show the highest priority icon.

Bug: T191528
Change-Id: Ie0a4c83ec7cfb856ec581d058797109746e3cb99
2018-07-17 15:54:17 -05:00
jdlrobson 99bc9d8c55 Enforce lowercase jsdoc types
Follow up to I6cbac15940e4501aee7ede8f421b77ffd027170d

Change-Id: I22bcbf1f083451a0f68b692b9a0acc716d11c62c
2018-07-17 08:06:35 -05:00
jenkins-bot 6c981fa4f8 Merge "Section issues overlay has different heading" 2018-07-13 12:46:20 +00:00
jdlrobson dfc29032b5 Section issues overlay has different heading
Per https://phabricator.wikimedia.org/T197932#4417319
Note that given talk/category overlay does not use or
display section issues, to simplify things any section other
than 0 or all will use this heading.

Bug: T197932
Change-Id: I737fb07aaadcea7772d0b08f8b0652dcf2f4623d
2018-07-12 15:07:22 -07:00
Stephen Niedzielski 10024b641e Hygiene: fix DownloadIcon function typing
Change-Id: I421332acae4ace9d0bb7cfcd4b31d9f4581c3e34
2018-07-11 13:39:55 -05:00
jdlrobson 596e405807 Tie issues to sections
Parse all issues inside a page, and load them into the issues overlay.

In group A, given issues inside later sections are hidden, it will not be possible
to navigate to these new overlay screens. In group A, lead section issues will continue
to only show lead section issues.

Changes:
* The /issues route is replaced by the more specific /issues/all and
/issues/{section num}, issues are stored in an "allIssues" module object.
* Begin using constants for namespaces for better readability
* Drop width 100% - this breaks display on tablet devices of issues within
sections
* Improve createBanner documentation to explain different treatments
* Set the issues overlay header inside initPageIssues when setting up
the route.

Bug: T197932
Change-Id: I21470648a61d57cfa4befceec596cf0f6e2110ec
2018-07-11 09:47:46 -07:00
jenkins-bot d5ae991522 Merge "Hygiene: update JSDoc boxed and JQuery types" 2018-07-10 23:00:40 +00:00
jenkins-bot 61bc884204 Merge "Talk page 'issues' are not subject to A/B test" 2018-07-10 22:57:29 +00:00
jdlrobson 70e4e9e85a Cleanup: Last modified active color should be loaded via JS
.active class is added via JS by skins.minerva.scripts
skins.minerva.base.styles is loaded as render blocking
Thus this css rule can be moved safely to a non-render blocking place

Change-Id: Ie8bab826ebc0785e24bb85600de261372c429434
2018-07-10 22:45:24 +00:00
jenkins-bot 80b41c0170 Merge "Hygiene: Document why selectors are needed" 2018-07-09 22:07:08 +00:00
jdlrobson 20e3bbd28f Don't render blank issues
If an extracted issue has no text, do not render it

Bug: T199005
Change-Id: I18047492e891285ed3af113200d2909e178b8224
2018-07-09 21:33:13 +00:00
jdlrobson 34e1a80318 Talk page 'issues' are not subject to A/B test
Bug: T199005
Change-Id: Ib5f60fc5c2157d0b10e39209f5ce4ff56d745eee
2018-07-09 14:24:29 -07:00
jdlrobson 795c0abf06 Hygiene: Document why selectors are needed
This rule has a lot of selectors (note the fix me)
It's not clear what each of them are needed for so make that
clearer in the code.

Change-Id: I80f07118977f465b7d09efad28f94917dd962a3d
2018-07-05 23:54:52 +00:00
jenkins-bot 48e6e4c6ac Merge "Links should not be clickable in mobile page issue element" 2018-07-05 18:26:02 +00:00
jdlrobson a8ed9380ea Do not restrict images to 320px at tablet resolution
Instead max them to the threshold.
Note restricting them is a problem on pages
like en:Ulaanbaatar - in particular the panoramas
inside the "Urga and the Kyakhta trade" section

Change-Id: I28636c62d3545632d3b025b29d154136a81d8218
2018-07-05 18:05:07 +00:00
Stephen Niedzielski 56dabf0af3 Links should not be clickable in mobile page issue element
Bug: T198115
Change-Id: I18c393d5676084e0be3ba12fa267765593368615
2018-07-04 13:43:11 -05:00
Stephen Niedzielski 874d9c9e3b Hygiene: update JSDoc boxed and JQuery types
From TypeScript's do's and don'ts:[0]

  Don’t ever use the types Number, String, Boolean, or Object. These
  types refer to non-primitive boxed objects that are almost never used
  appropriately in JavaScript code.

Although Minerva only uses JSDocs at this time which seemingly doesn't
care about casing[1], we should endeavor to use the proper return types.

This patch lowercases typing to indicate primitive / boxed type as
appropriate.[2] As a special case, function types are uppercased for
compatibility with TypeScript type checking.

Also, JQuery types are of type "JQuery". The global JQuery object's
identifier is "jQuery". This patch uppercases J's where appropriate.

Lastly, replace unsupported type "Integer" with "number" and a comment.

[0] https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#general-types

[1] https://github.com/jsdoc3/jsdoc/issues/1046#issuecomment-126477791

[2] find resources tests -iname \*.js|
    xargs -rd\\n sed -ri '
      s%\{\s*(number|string|boolean|object|null|undefined)%{\L\1%gi;
      s%\{\s*function%{Function%g;
      s%\{\s*jquery%{JQuery%gi;
      s%\{\s*integer\s*\}%{number} An integer.%gi
    '

Change-Id: I6cbac15940e4501aee7ede8f421b77ffd027170d
2018-07-03 11:10:12 -05:00
Jan Drewniak c10c3f011e Increasing specificity of '.center' class
Bug: T193595
Change-Id: Id365952881118bc3587fe8a0c897892e61f41df1
2018-06-28 22:21:05 +02:00
jenkins-bot 6037e61bc9 Merge "Revert "Suppress display of wikitext editor on action=edit"" 2018-06-22 19:23:37 +00:00
Bartosz Dziewoński 645ffa46f8 Revert "Suppress display of wikitext editor on action=edit"
This reverts commit b8c0e4ff30.

Bug: T196915
Bug: T197834
Change-Id: I875854ab65f8b76929285938d2dbaa996caf3546
2018-06-22 19:11:13 +00:00
jenkins-bot f75590a85b Merge "Update: link icons for standard density displays and CSS" 2018-06-21 22:42:47 +00:00
Stephen Niedzielski 5d938aa9e8 Update: link icons for standard density displays and CSS
The previous lot of link icons look great on high DPI displays but not
as nice as they could on standard resolution displays. According to
Volker, this is because the SVG paths must appear on integer coordinates
and scale up instead of down. The new assets have been designed with
this consideration in mind.

Also, workaround redundant CSS by adding commenting out the "unvaried"
black SVG background-image selector, selectorWithoutVariant.

Bug: T190549
Bug: T197909
Change-Id: Id341d383018a436401541e82cc75d826688eaaae
2018-06-21 17:11:46 -05:00
jenkins-bot efa17f210d Merge "Localise "learn more" and warning icon to issues" 2018-06-20 15:52:42 +00:00
jdlrobson f943abd854 Localise "learn more" and warning icon to issues
This is currently showing up on sisterbox templates e.g.
the one on Category:Beekeeping

Bug: T197728
Change-Id: Idaf4aeb4a9efb668e5c06e19ce1eddace121e741
2018-06-20 08:37:00 -07:00
jenkins-bot d5cd6950b0 Merge "Suppress display of wikitext editor on action=edit" 2018-06-20 09:45:57 +00:00
jenkins-bot 041eaadcb5 Merge "Mobile page issues - visual styling changes" 2018-06-19 22:13:31 +00:00
jdlrobson a231525112 Mobile page issues - visual styling changes
Changes:
* Introduce Jan's beautifully documented $wgMinervaABSamplingRate
Set to 1 to A/B test 50% of the population
* Split out ambox template styles into a separate file referenced
by hacks.less
* Update cleanuptemplates setup script to consider two buckets

Test pages:
* Shqiponja_Partizane
* World_War_II_in_Albania
* Liberation_of_Tirana
* French_Consulate
* Abd_ar-Rahman_IV
* M109_howitzer
* Aimoin
* Transport_in_Brazil
* Transport_in_Cape_Verde

Bug: T191303
Change-Id: I8d11e655ccb847b7999e64dda57b225ad8b1c23a
2018-06-19 14:11:19 -07:00
jdlrobson 2e7e7d3259 Only render table of contents on pages with a table of contents
Bug: T193517
Change-Id: I0ed0255280f525d7726d2e09ceab15a76e2d6026
2018-06-19 18:18:03 +00:00
eranroz 8ca00225dd Fixing alignment of infoboxes for RTL/LTR
Explicitly set align to left on LTR wikis, and same for RTL wikis.
(tested in en wiki with ?uselang=he and he wiki with ?uselang=en)

Bug: T161399
Change-Id: Ic70acf2c56b52fe52eaac021581617342e3ae74f
2018-06-17 22:14:11 +03:00
Stephen Niedzielski 3485269be1 Update: add internal and revise external link icons
Bug: T190549
Change-Id: Iad7fdc2f2a730fa8874487c0d83355f21a0bf7ea
2018-06-15 12:31:42 -05:00
jenkins-bot df9551bf12 Merge "Allow editor access to the full page's wikitext" 2018-06-14 18:45:56 +00:00
David Lynch b8c0e4ff30 Suppress display of wikitext editor on action=edit
As I6c7e3443756fd72749964d1eda37e3d123b201b3 gives full-page editing on
action=edit, suppress the display of the original wikitext editor so there's
not a flash of a different editor before the overlay appears. Provide a
fallback so that in cases of no-JS the wikitext editor can still be reached.

Bug: T196915
Change-Id: I7dd3de984ead4d70e977e5607bb07606d341db54
2018-06-14 11:57:18 -05:00
Jan Drewniak 7617174d40 A/B test bucketing wrapper for page issues AB.
Provides a class that initiates AB-test bucketing and registers
as a MF module. Activates the reading depth test for users who are bucketed
in either buckets "A" or "B".

Does not add event-logging or visual style changes for page issues AB test.

Bug: T193584
Change-Id: If8504a35059c6d1b056cef063a595b1c2ffd351a
2018-06-13 15:43:08 -07:00
Stephen Niedzielski 0b043fbaa7 Fix: don't truncate the article title
Header overflow was truncated in MobileFrontend commit 1655d5233 which
added the language switcher button that appears below the title. This no
longer appears to be required even for articles with lengthy titles.
Perhaps because the language switcher button exceeds the page content
margin, it was thought to be necessary.

Bug: T194544
Change-Id: I4e25e7b03df65803cd553b412881eb565ded9b10
2018-06-13 13:51:44 -05:00