Rather than inventing its own page token the PageIssues
schema will rely on the standard page token.
In future when I9bb18d47e36d2d99d812e5b47ea9516d3dff3a16 is
merged this will mean that PageIssues and ReadingDepth have
consistent page tokens.
Bug: T201124
Change-Id: I19fea41e04cd792423ea9d41a673563418b69726
The CleanupOverlay is moved to Minerva and renamed the
IssuesOverlay to be consistent with current terminology
The new IssuesOverlay is defined inside the module
skins.minerva.scripts to which it now belongs.
Additional changes:
* various file renames
* overlay-cleanup renames overlay-issues
* cleanuptemplates renamed issues.js
* Add a test stub file to avoid the need to load templates inside
the test environment
After this change, I75f47622d94e504688e04dfb2892540473817053
should be merged to avoid confusion.
Change-Id: I08945a324a6b878abe56efed1e988466085b3018
T196150 disabled the fallback editor when JavaScript is available.
As a result the code for page issues on the editor screen is redundant.
This simplifies our code.
The css rules relating to editor
issues are retained, given they simplify the editor screen for mobile
devices.
Bug: T196150
Change-Id: I76d586414cdd8de533bb891b87d1e0b7efc20a68
When parsing page issues by header, use the MobileFrontend selector
symbol, Page.HEADING_SELECTOR, instead of hardcoding it. This selector
is configurable by the extension.
Bug: T191528
Change-Id: I7c9db38f9102bfef0a98784be32c7e4707d747e5
Refactor the page issues A/B test logging implementation to a distinct
new file that only has the responsibility of tracking.
T191528 is referenced in this commit as I was having difficulty
answering the feedback and bugs reported in the current implementation
without working through and restructuring the flow as I understood it.
This refactor is merely a byproduct artifact of that effort to focus on
the parsing and presentation responsibilities.
Bug: T191528
Change-Id: If547a0a67fbc9a532f834fe374abf668309e73df
Callback usage was removed in I67fb6e448f6ecc97c89c1187e491ee05f7a312ef
so this function may be removed.
Bug: T191532
Change-Id: I88f0d6740c9e9615faba2e3c60772269c705f43e
Uses `mw.trackSubscribe` to create an intermediary data handler
named `wikimedia.PageIssuesAB` which extends event-logging data
before passing it to the eventLogging through `wikimedia.event.PageIssues`.
Event hooks are placed where appropriate and the `CleanupOverlay`
class is extended to capture events from within the page issues
modal.
Additional changes:
* Merge two identical on click event handlers for
.edit-page, .edit-link elements
* change pageIssueParser.maxSeverity to accept an array of severity levels
instead of an array of pageIssues objects
Depends-On: Ic84e4a3286220407863167e0f57cef1b13a72964
Bug: T191532
Change-Id: I67fb6e448f6ecc97c89c1187e491ee05f7a312ef
The page issuer parser works with plain old Elements, not jQuery. Pass
in the expected type.
This addresses problems with the icon display for ambox templates relating
to balance (see https://phabricator.wikimedia.org/T191528#4465069)
Bug: T191528
Change-Id: Ie4a34087f9f1700342cc54a50cd3272fc9ea34ee
Follow up to I96808541d48be7869fed3bc30babb80866e139ec
which incorrectly wired up the page issues feature.
Bug: T200867
Change-Id: I7c3198f95dae1f7c5e0991dca651dd64949b3615
In order to write tests, we'd like to separate code without side
effects from code that executes it as part of setup.
This shuffles dependencies and makes page and overlayManager
parameters to the init function (injected dependencies)
Change-Id: I96808541d48be7869fed3bc30babb80866e139ec
The readability of cleanuptemplates is hurt by having an anonymous
function embedded inside.
This patch wraps initPageIssues with the jquery ready call and removes
the function wrapper and decreases the indent of its contents.
Purely stylistic change.
Change-Id: I44b2371add32780f96160e0075787a9ea7222f39
The hook that enables the Reading depth test should send an
additional paramter that specifies which test bucket the hook
being is calling from.
Bug: T191532
Change-Id: Ifd9f43220c476ece8a0c0cee46b62b58a717c616
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
* 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
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
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
- 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
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
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
.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
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
This is currently showing up on sisterbox templates e.g.
the one on Category:Beekeeping
Bug: T197728
Change-Id: Idaf4aeb4a9efb668e5c06e19ce1eddace121e741
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
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
For event logging purposes we need to be able to listen to reference and
backlink clicks. Clicks on these elements were disabled before this patch.
Although clicking on backlinks was disabled, it wasn't working properly
as the user could click on those links and be taken to the reference.
Thus this piece of code has been removed.
Bug: T191086
Change-Id: Idbaa39523a35f3b649f521be05c83255aa2b1396
Use local imports instead given all relevant files are within the
same repository, and don't vary by configuraion.
Bug: T140807
Depends-On: If3edac9a35b346af0320c12f70c0d978a6346201
Change-Id: Ife3cc345a63aff452e93accbe0a593fbaa358732
In I7abdbac4d2d16b931e2b110fcebf0dfc82146753 I accidentally
removed the active link color (I meant to /move/ it from the
critical path since it requires JavaScript)
Change-Id: Ie86c3c9d03a0ed130a86c50bb548c9b47db6def6
Enables the SearchOverlay to be shown/hidden by the
OverlayManager, instead of managing the routing itself.
A special route is added to hide the search overlay on pageload,
so that the overlay can always be closed with history.back()
Bug: T189212, T102946
Change-Id: I1eaad36fe4ceca2d6f3e3345d987e2b32634446d
More hackery!
This adds some tests and ensures that our own icons are mapped to the
existing template icons.
Bug: T187916
Change-Id: I49073f22995c6730369235d6039939915ba2079c
Given the level of documentation in this repo is extremely
low now seems a good as time as any.
The resulting documentation is a vast improvement on before
grouping functions to an owner and introducing module names.
We can iterate on the documentation over time.
Bug: T138401
Change-Id: I9e787d40931d3d72a7037ce07d3ab0db8e72d825
ReferenceDrawer
Instead of doing this inside the ReferenceDrawer component
itself, we'll do this here.
To be backwards compatible we check the value is truthy.
When I5a7b23f60722eb5017a85c68f38844dd460f8b63 is merged
this can be removed.
For NotificationBadge we pass the onError option which
is now available and allows us to clean up the NotificationBadge
Change-Id: I47db11fa945a05f3b2a9a43c3cf053ca489a38fa
Move window.location manipulation from ImageOverlay view to MinervaNeue.
Also, don't leave a hanging empty URL fragment when closing the overlay.
Bug: T173539
Related: I292c0578716ff56e0e069aa8006f840025d78a88
Change-Id: I56ba9217aa9cd4e0a925c623060022392e3021c7