New changes:
20c220a Remove unused CSS classes
9bdcc65 Comment icon positioning
e50e790 [BREAKING CHANGE] Fix ve.ui.Overlay classes
1ac4927 ve.ce.TextNode: Use getChar() helper
29fd0f8 ve.ce.TextNode: Simplify #getAnnotatedHtml logic
18336eb ve.ce.ResizableNode: Run find() once instead of 4x in showHandles()
febf125 Use getDescription for title attribute
ab3cb6c Localisation updates from https://translatewiki.net.
Local changes:
* Rename overlay class rules
Change-Id: Ia90b6afbd4abdf3267f4ccaac0b2a7d4101ccc7b
Otherwise either the focusing of the surface or the resetting
of the selection seems to cause the viewport to scroll back
up on mobile.
Change-Id: Ie3b104e04800d2753f99739f877c76e334965fc1
By searching for CSS classes that don't exist in the code.
In some cases the classes were used but had been renamed.
Change-Id: I76442a632c18d2133cdf78c4555da149c0a7888c
Trevor promised to do this in Iafe64a6f but never did.
This needs styling changes to look right. It also means that
VE mobile standalone doesn't have a context at all right now,
which is horrible, but at least this makes MW mostly work.
Bug: 68546
Change-Id: Id8cc4b07905f777f667f36cbcc65e821847142d5
The window refactor removed the 'teardown' event from windows,
but ViewPageTarget was still listening to this event on the save dialog.
Instead, use the opening promise to be notified when the save dialog
closes and call onSaveDialogClose() at that time.
Change-Id: I31a9a359eb14a56b214a1240db08632bda6bc8b9
Because this breaks other subtitles such as subpage breadcrumbs
Instead, deal with the #redirectsub (added in I780c965) directly.
Bug: 68432
Change-Id: I646868916a4480404f6d466fd89f84798d0e9df5
When I05f11246ca90a1ce3f741fd93194a827528cd597 gets merged, we will need
this to be able to scroll to a section on iOS (where the content will be
scrolled within a div, not as a whole page).
Change-Id: I6e47edfa8c3a3a46fd7a4f11e4a54955f3694b9b
It's unnecessary, big and ugly, way too close to an actually useful button, and
adds oodles of complexity to the mire that is VPT without significant user benefit
whilst taking up an unjustifiably huge amount of the already-over-burdened space.
This means that the minimum browser width for English on default Vector to show
the toolbar correctly is now 945px, down from 1029px.
Bonuses: fix MWCancelConfirmDialog's cancel button to be destructive (it is) and
remove a now-recently-fixed comment asking for the save button to be styled using
a generic class (provided by the constructive flag).
Change-Id: I30dc7020121f0dd6907b61ef674a7cb14eb00652
Closing a dialog with specific data means closing it again with
potentially different data, while the dialog is already closing, means
someone wins and someone looses. Silently failing in this case is bad,
because if the first close call was a cancel, producing no side effects,
but the second close call would have produced some side effect, the side
effect would never occur.
The problem here really was that the save dialog needs to be closed
before we can destroy the surface so we can uphold the assumption that
hold and teardown processes are operating on an attached DOM.
The solution is to automatically close the save dialog on teardown,
rather than on save. Since save triggers teardown, this has and identical
user experience.
Bug: 68048
Change-Id: I669448739f168737d4eddd6496189a819ce894b1
New changes:
8bb3848 Bring back global/local specific CSS classes
Local changes:
Use global overlay class to target the z-index hack for the Vector skin.
Bug: 68066
Change-Id: If1b6ba0c9035ff32b61d34ee779a95554883a2ec
Otherwise you get "Uncaught TypeError: Cannot read property 'messages' of null"
if you press the save button late enough in the saving process. The bug refers
to a different error which I have not been able to reproduce.
Bug: 68073
Change-Id: Ia8fa325f1450329b6e0e4ee9af5302aa4857d637
Confirm dialog was replaced in refactor, so until this is merged the 'Cancel'
button is broken.
Bug: 68068
Change-Id: I77d1c82bf0d68013eef361174a134860a197cd44
New changes:
56de6f5 Localisation updates from https://translatewiki.net.
f8bda64 Widgetise demo menu
6ac48d8 Localisation updates from https://translatewiki.net.
365e131 builderloader: Omit value for boolean "disabled" attribute per HTML5
706e4b3 Prevent double counting of DM nodes in getNodeAndOffset
b141a7d Update OOjs UI to v0.1.0-pre (d2451ac748)
c5b3921 Localisation updates from https://translatewiki.net.
1606983 Update reference to ConfirmationDialog to use MessageDialog
Deletions:
* Styles for ve.ui.MWBetaWelcomeDialog - not needed anymore because
OO.ui.MessageDialog provides them
* Styles for ve.ui.MWGalleryInspector - not needed anymore because
ve.ui.MWExtensionInspector provides part of them and the rest are being
replaced by programatic sizing
Modifications:
* ve.ui.MWLinkTargetInputWidget - Added support for validation and href
getter
* Split message between tool and dialog title for ve.ui.MWEditModeTool
and ve.ui.MWWikitextSwitchConfirmDialog
General changes:
* Updated inheritance.
* Added manager param to constructors of dialogs and inspectors.
* Updated use of show/hide with toggle.
* Added meaningful descriptions of dialog and inspector classes.
* Configured dialog and inspector sizes statically.
* Configured dialog action buttons statically.
* Interfaced with OO.ui.ActionSet to control action buttons.
* Moved applyChanges code into getActionProcess methods.
* Always using .next in setup/ready process getters and .first in
hold/teardown process getters.
Change-Id: Ia74732e6e32c0808eee021f0a26225b9e6c3f971
The stylesheet contains workarounds for highlights on references
being drawn in the wrong place, resize handles appearing on headings,
and highlights being opaque.
Change-Id: I78da4d6a751429cd160b693b4a524fc7ea1ef76f
Also implement isInternetExplorer() in mw.Platform using jquery.client.
New changes:
9b2102f Skip over nested handlesOwnChildren nodes in getRelativeOffset
30a9835 Localisation updates from https://translatewiki.net.
5d142a0 Restrict get relative offset to movements of +/-1
7a2c984 Check that the surface has a selection after focus
851a63d Remove jquery.client
8786e53 Add evil detection functionality for IE
96f19ad Disable triple-click handling in IE
d746d42 Revert "Restrict get relative offset to movements of +/-1"
859d578 Revert "Skip over nested handlesOwnChildren nodes in getRelativeOffset"
Change-Id: Ib2e6568a862336e2516e4c519468218ec2a84834
Merge the media edit and media insert dialogs. Allow editing
of media properties when inserting a new image, and also
allow the user to replace the image on edit.
Bug: 67170
Change-Id: I35bd95503565dbf95090ee8110284db5a8fbba83
Mobile doesn't want the tool+dialog functionality for those yet,
so move them to a separate module and only load the bare bones
for mobile. We did the same with mwimage/mwimage.core.
Change-Id: I9185ce62f458b3de08cbd28f2a41370d2301de9d
This puts reference insertion and editing tools into the same menu (yay) and
applying-annotations-to-text tools into the same menu, too.
As part of this, I'm re-labelling the generic reference tool to "Basic" (now
that it has some context for users).
Change-Id: I8b8196d3c2e40237d61c8491ab30e737b82597d6
This will mean it will be more obvious if making a change to the SD or HD version
that an equivalent adjustment may be needed.
Change-Id: I6129220839ef55017fe69d723524ecdf6cf0234f
1. It's a bad check, it tells you if the device supports mobile
events, not if it's mobile (e.g. a touch screen laptop has such events)
2. It's no longer used
Change-Id: Ic46bc5b8fdc33b7c2b2bd67e75d65a5e564dbeca
Our coding style has been upstreamed and first released
in node-jscs v1.5.0 (grunt-jscs-checker v0.6.0).
Change-Id: Ifc0cfc7177946b9d11407f60e38b0177883724c5
This reverts commit b7401f838b.
Didn't break everything, but we should probably avoid this getting deployed until I can work out wtf is going wrong with it.
Change-Id: I048143239e998b30aba79fa395a0af1cb06c6a9b
This reverts commit 5565ccca54.
I have no idea what is going wrong on deployment-prep to cause
the error in bug 66792. Let's try to find out.
Bug: 50341
Change-Id: I5041de838128bb55c57baddae01cdcb263626537
Causing HTTP 500 errors in ApiVisualEditorEdit.php (calling
getDisplayTitle() on a non-object).
This reverts commit dedc89b5ff.
Bug: 66792
Change-Id: Iaf438660f0623dc05f76294ad847b2fc5e25bed6
Depends on I468d4eb4 in core.
Uses various hacks to trick the test runner into thinking
an MW target is in use, when in fact we still use SA targets.
Change-Id: If4611307d5d7aaee4af84f86ef82faf9078043b6
Use new setupToolbar and setupDebugbar methods in base target.
New changes:
7ff523d Localisation updates from https://translatewiki.net.
3815224 [BREAKING CHANGE] Debug bar refactor
155f4ab Edit HTML mode in demo
Change-Id: I554ce51eae872ab0f741a913bf10394c2a8c3e52
Implement new language platform functions.
Also remove unused MWLanguageSearchDialog and MWLanguageSearchWidget.
New changes:
4d919d2 [BREAKING CHANGE] Move language functions to the platform
Change-Id: I54c0a8e5816a3c81851f95f1d3062a6091a9f4a3
* Update size of save dialog earlier on, and swap back to save panel in
save dialog on setup instead of ready to avoid scaling and sizing
simultaneously
* Update use of closing/closed/opening/open events to use
setup/ready/teardown events instead
New changes:
43a48cb [BREAKING CHANGE] Update OOjs UI to v0.1.0-pre (9f4f250f88) for window process cleanup
Bug: 65705
Bug: 65343
Bug: 60843
Change-Id: Idf6f85ae12f6ca80fde57a400cb5b11270938c1a
Remove ProtectedNode mixins for new FocusableNode.
New changes:
e1b0e33 [BREAKING CHANGE] Merge ProtectedNode into FocusableNode
Change-Id: Ie515704163c24317739fd34d35094b9ada6bfa66
Replace instances of target.$document, which was removed
in VE core.
New changes:
8083623 [BREAKING CHANGE] Remove $document cache from target
9256158 Cleanup target properties
cc0d71f Multi-surface fixes
ba8872e Localisation updates from https://translatewiki.net.
Change-Id: Ibff83cae770c056ed64bcf438ed74b44d929cdc0
The API moans about it in a warning, but it works.
Along with edit page checkboxes, this also fixes edit notices.
Bug: 65455
Change-Id: I7c319d43fd06ab04ab4e4cc099ae49b11c31fabd
Switch to processes for windows (dialogs/inspectors)
This conversion also required the splitting of MWLinkInspector into
MWLinkNodeInspector and MWLinkAnnotationInspector.
New changes:
88fe25f [BREAKING CHANGE] Update OOjs UI to v0.1.0-pre (dd888aba5c)
Change-Id: I662d8985463c9fc881775f70aef87ebeb454a73f
It now only sends a single 'done' event, which we can use .once on
Relies on I4f485d4f in OOjs UI.
New changes:
418cd67 Update OOjs UI to v0.1.0-pre (0f101c6f5d)
Bug: 65571
Change-Id: I19aa65612bf02bed056de292f212d2f5732a8fec
No need to set in mw.Target as it now exists in core Target.
Add config param to MobileViewTarget override.
Depends on I555935d2 in core.
Change-Id: I72be9098bd9d59272ca3d7a9a64dca4271ef3ee5
Instead of overwriting everything else on the page (e.g. 'Pages in category ...')
See also bug 65349 / Ib6c49286 for file pages with a similar issue
Bug: 64239
Change-Id: I59ff9de5d0463f0f1ae8a18d54ebea5844fb1af5
Check that the user is anonymous before looking at their cookie to decide whether
to show beta warning dialog.
With the existing code, we would see that the preference is false and then check
that they have no cookie. But being logged in should make the cookie existence
be disregarded.
Fixes Ica9e5a92
Bug: 65821
Change-Id: I84e31323930c404222388bb74e4b4ca8d303e05c
We weren't unbinding these handlers at all, and so the 'ok' or 'cancel'
handlers could run multiple times for one button click, and even worse,
you could get in a situation where clicking 'ok' in one confirm dialog
would also run the 'ok' handler for the other one. This happens because
the ConfirmDialog instance is recycled by the WindowSet.
The way the unbinding is done is ugly; we should either consolidate the
'ok' and 'cancel' events so we can use .once(), or come up with some other
way to automatically unbind the handlers.
Bug: 65557
Change-Id: Iabf0c0d0229add09cc775358fc5a4e5ae783db04
"Yes, switch" isn't constructive; make it primary instead.
"No, cancel" isn't destructive; make it neutral (no flags) instead.
Change-Id: I841cbed4a81eaed679a8c7da89942c6b030a1217
"Discard edits" isn't constructive, and "Continue editing" isn't destructive.
Instead, mark "Discard edits" as destructive, and make the continue
button neutral (no flags).
Change-Id: I7648555ad47be698e75b5019d7738b0afb8611aa
Per TTO on bug 51655, the implementation of confirm() in most browsers is crappy and we
shouldn't use it.
Change-Id: I755085a253c05958e4b50af57b19dab90f2f0fb6
Follows-up e3be4a6. Object properties default to undefined, no
need to check existance first. Looks like like an "isset()" in
PHP for preventing E_NOTICE.
Change-Id: I594b23e6caf1e17d6d5d37e6a5fd81152e78b3a6
jshint:
* Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0).
* Remove coding style options covered by jscs.
* Enable new option "freeze" (prohibits changing native prototypes).
http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze
* Re-order to match http://www.jshint.com/docs/options/
jscs:
* Update to grunt-jscs-checker v0.4.4 (jscs v1.4.5).
* Format .jscsrc file in a more spacious way and order the
properties less arbitrarily (using the jscs's readme order).
* Enforce more details of our coding style
* Get rid of the unsable "sticky" operator rules which have been
deprecated in favour of using other rules instead that are able
to enforce this more accurately.
- disallowLeftStickedOperators: Remove deprecated rule.
* Ternary covered by requireSpacesInConditionalExpression.
* Rest covered by requireSpace{Before,After}BinaryOperators.
- requireLeftStickedOperators: Remove deprecated rule.
* Comma covered by disallowSpaceBeforeBinaryOperators.
- requireRightStickedOperators: Remove deprecated rule.
* Logical not (!) covered by disallowSpaceAfterPrefixUnaryOperators.
See also If46b94ce1, Ib731f11b1 and I0b0cadbc5 in oojs/core.
Also:
* Update grunt-contrib-watch to latest upstream version.
Change log at https://github.com/gruntjs/grunt-contrib-watch/blob/v0.6.1/CHANGELOG#L1-L17
Change-Id: I6c5a34afea8b05a3dca617897c192594df06ca90
Relies on:
* I292fb34d in OOjs UI to add the confirmation dialog
** I67329820 in MediaWiki core to use the messages added in OOjs UI
** I38f5bb63 in VisualEditor core to register the confirmation dialog
Bug: 50955
Change-Id: I98f9a03d780556b360b57c018c05a27cc1b3862e
Usually we can just send 0. Sending anything else makes PostEdit think we're restoring an old revision.
Bug: 65269
Change-Id: I60454a7a4ea3f6c7cef4c707da3016dd0ec29b88
These changes are to accomodate the design for the mobile/tablet
version of VisualEditor which uses an icon rather than a label
for the drop-down button.
Change-Id: I1086ed4a84ae4061fcc79cc7f587657232c5d5df
Three 'minor' points:
* You have to declare even hidden preferences. Whoops.
* There's no such thing as an "optionsToken", use "editToken".
* You need to POST action=options API calls.
Ahem.
Change-Id: I9c4358107af7bcfca157bd014de49882914e990c
For logged-in users, we can a preference instead of a cookie. This way it is
also preserved between browsers and when cookies are cleared.
Keep using cookies for logged-out users, except if the beta welcome dialog
has been suppressed using the one-off GET parameter 'vehidebetadialog'.
Bug: 55551
Change-Id: Ica9e5a92841fec003ce4a21d740a9bc6ff3da9c7
We don't have a FOUC on the appearing of the 'edit' link. That
one is handled quite intelligently:
* Via the stylesheet that is also loaded in noscript mode, its
(hidden) appearance is already predetermined. So as soon as
those elements are seen by the browser they style correctly
for users without JavaScript (display: none).
* This same stylesheet also hides it for users with JavaScript
but where VE is not available (e.g. due to browser support).
While ve-not-available is added very early on (before
document ready), it could in theory cause a short FOUC, but
that's okay. We simply don't know that VE isn't supported
until then. We optimise for the common case (JavaScript
enabled, VE available), while still ensuring that it is
always hidden in noscript, and is hidden as soon as possible
when VE turns out not to be available.
For some reason, one small detail (the little bit of whitespace
added inside the brackets), was left out of this and was
implemented by adding the class 'mw-editsection-expanded' to them
from a document ready handler.
* First step, get rid of the script that adds this class and
use ve-available instead. That means they're styled
correctly much earlier (we add the class to <html> before
document ready). This can still cause a brief FOUC, though
in most cases they're correct from the start.
* Step two, make brackets expand by default for script users,
and let ve-not-available reset it. This way, like with edit tabs,
a FOUC will never happen for ve-available. And even for
ve-not-available, a FOUC is rare since we add it before
document ready via <html> look-ahead styling.
There was still a brief reflow jump because of negative margins
between two paint events. One was undoing the other at a later
time. These negative margins are a remnant of when we were doing
animations (follows-up I4b9c47fd65a70). They were added to reduce
reflows and content shift, but were now actually causing them.
Removed "padding-right" from mw-editsection, and negative margin
from the brackets.
Also:
* Don't add inline 'style="direction: ltr;"' on every single
editsection throughout the DOM. This was the only operation we
were doing unconditionally. While I doubt the need of it in
general, we can at least allow MediaWiki to do it right, and
only add the override if needed. This saves quite a few DOM
operations.
Change-Id: I7a729edc2cd4a66ebc0ad6935ffd02cb9b948bff
There was a slideDown() call, but this didn't do anything since
toolbars are visible and in the DOM by default.
As a temporary hack, hide it synchronously after creation and
then do the slideDown still.
This could ever so briefly cause a flash, though that didn't
happen in my testing.
This makes the experience smoother when we initialise the surface.
In particular the moment where we swap #bodyContent for our Surface
(which should look visually almost identical), before this change
it was still a bit of a flash since the Surface version has a
toolbar on top, and thus instead of swapping smoothly, we hide
content and show a similar piece of content that has an incompatible
offset from the top.
Bug: 64751
Change-Id: Id94974ba71fd887ce494d7b2b16ec62d43b18575
Update VE core submodule to master (109a3cf):
* 109a3cf ve.ce.Surface: Remove font-size: 1em;
Follows-up I5818dce6265.
* When applied to ve-ui-surface, it applies to both of its children,
namely ve-ce-surface and ve-ui-surface-overlay. The latter
(containing things like context menu and inspectors) should not
inherit styles intended for rendering of wikipage content by
the skin.
* Move mw-content-{ltr,rtl} from an outer parent to a slightly
deeper parent of the actual content. It's now on documentNode.
Still high enough to apply to all content. This was to ensure
it remains a child of mw-body-content, like in MediaWiki core.
* Updated padding/margin hack again. Since now the font-size
applies on the surface, this once again means that now 1em
on the surface != 1em on the documentNode, so we need the
calculation again. Brought it back and this time documented
what it is based on.
Bug: 64599
Change-Id: I9ee4582a6a0ec9e128f5c36a6dbf2adbd0b216a1
Also get rid of checking for NS_MEDIAWIKI explictly and use
MWNamespace::getRestrictionLevels instead
Bug: 50783
Change-Id: I5986ddb9b6f17e4a2aca12dbb551cce4a6cfd663
* font-size and line-height differed between read mode and
edit mode. This makes them match by using the same css class
as MediaWiki core uses for the body content.
Depends on I66c56c57 in MediaWiki core.
* Document padding / margin hack on surface, and sync the values.
In edit mode, the text was being nudged to the right by a few
pixels.
* Bump the wfUseMw call as this is a symptom of how VisualEditor
now depends on MediaWiki 1.23.
Bug: 64599
Change-Id: I5818dce626545c4cbc8bd84fd551dc08baedbe32
Don't unselect article tab when loading VE, do unselect when restoring normal view mode.
Bug: 49407
Change-Id: I4b6e5c898a8af2b404151bba46359dc4bfbd739e
MathCaptcha just extends SimpleCaptcha, so its output is fine to show as
text. Doing that because I'm not sure how to render TeX and this is a
reasonable fallback
Also tidy up the order of some message entries in my last commit.
Bug: 64328
Change-Id: I98312f61471667e7c4dcf715295f85642c31a688
When recovering from a badtoken error, mw.Target called saveDocument(),
but that method only exists in ViewPageTarget. Instead, call .save()
again.
Also pass the HTMLDocument and the save options around to the success
and error handlers, because we need them in order to be able to
call .save().
Bug: 64267
Change-Id: I4743f855dc77f4a9ac427d67d15fb96b7ad770f2
Update dialogs and inspectors for breaking change in VE core
New changes:
a553012 [BREAKING CHANGE] Merge dialog and inspector actions into window actions
f9a0419 Localisation updates from https://translatewiki.net.
cbe81a0 Fix path to spinner in ve.ui.SpecialCharacterInspector.css
Change-Id: Icf90ace6442364283b66b234e3c78fc65212f070
Unfortunately the best way I've come up with to do this so far is
checking the namespace.
Bug: 53477
Change-Id: Ib2dbe91aff516f2d2408e07ff3f73ea861bfcbe2
Use new dm.Surface method for checking undo history state
(hasPastState -> hasBeenModified).
New changes:
38776df [BREAKING CHANGE] Refactor history state methods to better suit uses
3412b41 Localisation updates from https://translatewiki.net.
0c5238c Add system to dm.Surface for staging changes
8f0077c Only hide popups on selection change
4575f82 Fix initial selection when focusing in Firefox
debfd4e Document focus/blur cleanup
Change-Id: Ic66c96a4f64ad82a01a84535ca8cd19332065b37
Previous hack caused unwanted blur events and subsequent range changes.
Depends on I8388318311 in core.
Change-Id: I9163f4d9928887a5eec09f0651ec0a66cc221cd4
These were being used indirectly in the MW*Model's. Use surface
fragments instead.
Fixes I0fae3e5ff2bd.
Change-Id: I1d6aa5e00a9315cf7088f87f9e9d828833feec64
Move various bits of code from initialize to setup as required.
MWDialog is now useless so use ve.ui.Dialog directly.
New changes:
0b2d03f [BREAKING CHANGE] Pass fragments, not surfaces, to windows (reprise)
0101ac4 Update OOjs UI to v0.1.0-pre (ac6848398c)
Change-Id: I0fae3e5ff2bd0da5b74c244af226b07b1f5883bd
These were backwards which was triggering edit conflict detection for all users.
Fortunately for logged in users, if Revision::userWasLastToEdit was given a bad
timestamp (e.g. when we submitted here), it would just return true, suppressing
the conflict. It always showed a conflict for anonymous users however.
Bug: 56835
Change-Id: Ib07f965238ca96e17bf59b34da8a8e789954da61
Also update tools for changes in VE core.
New changes:
e4de14b Make tools use commands
e029817 Make getToolsForNode place primary commands first
Change-Id: I66575ee6d49e6b2f5a5f789978da98bb55e6dc5e
Protocol-relative <base> tags are fine when the iframe trick is used
because the iframe inherits a default base URL from the parent document,
so if the <base> is relative it can be resolved against that. However,
a document created with DOMParser (or document.implementation, oops!)
won't inherit anything, so anything other than a fully absolute <base>
will just break.
To make Parsoid's relative <base> work anyway, resolve it in the
context of the main document, then write the resolved version
back into the <base> tag.
Change-Id: I7261bd5dbe9ec1f4077a4e5a00bd2a03ac237ca0
Objectives:
* Allow users on-wiki to create tools and dialogs for citation templates
of their choosing
* Allow editing of citation templates directly, without having to go
through the reference dialog
* Provide citation template tools within reference editing that use the
same titles and icons as the citation tools do, but don't wrap the
inserted content in a ref tag
Changes:
* Reference list was cloning the DOM element it was inserting into its
view before the generated content node could finish rendering, so it
never ended up showing the finished rendering in the reference list
* Documenting hack about use of reference list node's destroy method,
and how we are depending on destroy not canceling generated content
rendering
* Introduced reference model
* Added saving/updating method to transclusion model
* Added getPartsList method to dm transclusion node, which caches the
result and invalidates the cache on update
* Added citation dialog, which extends transclusion dialog
* Added cite group to toolbars, cite-template in reference dialog toolbar
* Factored out getting the node to edit and saving changes procedures in
transclusion dialog so they could be extended in citation dialog
* Updated uses of autoAdd as per changes in oojs-ui (Ic353f91)
* Renamed MWDialogTool file since there was only one tool in it
* Expanded TransclusionDialogTool file out since there is now more logic
to it
* Switched to using ve.dm.MWReferenceModel instead of plain objects in
reference search widget
Configuration:
If you add to MediaWiki:Visualeditor-cite-tool-definition.json the
following code you will magically be presented with a delightful array
of citation options:
[
{ "name": "web", "icon": "ref-cite-web", "template": "Cite web" },
{ "name": "book", "icon": "ref-cite-book", "template": "Cite book" },
{ "name": "news", "icon": "ref-cite-news", "template": "Cite news" },
{ "name": "journal", "icon": "ref-cite-journal", "template": "Cite journal" }
]
...or...
[
{
"name": "any-name",
"icon": "any-ooui-icon",
"template": "Any template",
"title": "Any title text"
}
]
The title text is derived either from the title property or from the name
property by pre-pending the string 'visualeditor-cite-tool-name-' to
generate a message key. Titles for 'web', 'book', 'news' and 'journal' are
provided. The icon is a normal oo-ui-icon name, and more icons can be
added, as usual, by adding a class called .oo-ui-icon-{icon name} to
MediaWiki:Common.css. 'ref-cite-web', 'ref-cite-book', 'ref-cite-news'
and 'ref-cite-journal' are provided. The template name is simply the name
of the template without its namespace prefix.
Depends on Ic353f91 in oojs-ui
Bug: 50110
Bug: 50768
Change-Id: Id401d973b8d5fe2faec481cc777c17a24fd19dd4
* Add ve.init.mw.LinkCache to track page existence and
transparently query it
* Populate it with initial data from the parser cache
if available, obtained in the VE API module
* Use linkCache data in link annotation rendering
This doesn't yet integrate the LinkCache with other
components like the link inspector. That should be
done so we can deduplicate the existence checks.
Additionally, we should generalize LinkCache and use
it for the category existence/status checks as well.
Bug: 37901
Change-Id: I9fd43e8c3864dd375cf6dadfdeedd05e4fe9cf3b
Also, we warn the user that Here Be Dragons™ when they're editing a Page
Translation /source/ page.
Bug: 50284
Change-Id: I841ccb8461d31358640a16301a6a78750a660d36
TOC Widget is created in the mw target view class.
Adding and removing a heading rebuilds the TOC Widget based
on the the order of the page heading nodes.
TOC Widget considers TOC page settings and displays in the default manor
unless forced or disabled.
TOC Widget still needs to be finalized by being placed in the surface.
This could be a problem until we have a CE node for it to live in or
have some DM work added. Roan and I have discussed how to go forward.
To enable the widget you must add the following to LocalSettings.php:
$wgVisualEditorEnableTocWidget = true;
Change-Id: I488cfbbdb060e50d81f51e0f757e67d0114b8936
New changes:
dd15f23 Split ve.ui.Surface into DesktopSurface and MobileSurface
16283f4 Add OOjs UI's sco.json i18n file
ef94038 Split ve.ui.Context into DesktopContext and MobileContext
Minor adjustments to point to desktop and mobile Surface or Context.
Change-Id: I7cf6f99a5a1216a28a7146afcd4deb68c7eac38e
Follows-up I260059802379 which removed got rid of
the "ve-init-mw-viewPageTarget-toolbar-editNotices-notice" class
from notices and didn't add something generic in its place.
(There is "ve-ui-mwNoticesPopupTool-item" but that's more an
internal class we don't want gadgets and wiki stylesheets to
rely on.)
Bug: 43013
Change-Id: I8e1e383c2cb3199fe78f45f4feaa24a44126cf0b
Store a bit of data with the states we push or replace in the
history so that when the user navigates back to them, we know
for sure this is a state we pushed in the history.
This allows us to filter out popstate events triggered by the
user browsing to states create by other software, as well as
states triggered by the browser that have no state data at all
(Chrome is known to, in contrast with other browsers, trigger a
blank popstate event on load, which we were mistaking for a user
event where the user navigates back to veaction=edit).
Bug: 57901
Change-Id: I142777d0d2ae96d3afee224782f0d2d1522da1eb
The switch to source mode code path was causing onSerializeComplete to
be called, which accesses this.saveDialog because it assumes it's being
called from onSaveDialogReview.
In fact, onSaveDialogReview was calling it twice, once as the callback
it passes to serialize() and once in response to the serializeComplete
event. Cleaned this up by renaming the function and removing the
event binding, so it's now only called once and only for reviewing
changes to new pages, not in the switch to source mode code path.
Bug: 62544
Change-Id: I86eea57806a20408c8dc89a234c39cae1d969bca
This can be overriden in subclasses (such as MobileViewTarget) so that
we can customize the way the surface is created.
Change-Id: Id17695c8c75c7ae6c549f915625667389aad5f2f
The experience should be consistent between mobile and desktop.
We should explore re-styling these buttons to look like
Ib3c94d19231b018a509b78269001223ad0568795 in desktop as well
at a later date.
Change-Id: Ic9e4c5d12c3c75fcb195432c9155ec0a7eecac04
Split tracking out of the base target and from viewPageTarget
Primary reasons for this change:
* Makes it possible to resolve an issue with tracking in mobile
* Lets us reuse the viewPage save workflow tracking
* Support existing and new targets with tracking
* Simplification of target classes
Change-Id: I036e4f2129d929db0a3b9a4baa87c946a4b194a9
There are several conditions to defaultSize behavior of thumbnails and
frameless images and other images when it comes to default size. In the
same principle is 'border' which is not quite a type despite the fact
it 'behaves' as such in wikitext (and has a unique identifier that comes
instead of the other types.
This commit aims to organize this behavior for the user in an
understandable manner.
* Add 'basic' image type for images that have no specified type ('none')
* Handle the difference in 'default' size behavior between basic images
and thumbnails/frameless. The thumb/frameless images have the default
wiki size. Other images' default size is their original dimensions.
* Force wiki-configured default size for thumbnails and frameless images
in the DM. This is done because at the moment Parsoid's output is of
Wikipedia's default size rather than the local wiki's. The size is
adapted if needed, directly in the DM.
* Added 'border' as a pseudo-type checkbox flag that sets css class
'mw-image-border' is for parsoid rendering on save.
* Add 'make full size' to the size widget select and treat it as a faux
default button for basic and frame images.
Bug: 62013
Bug: 62024
Bug: 61155
Bug: 61059
Bug: 61282
Change-Id: I6778705306f0dd6bb96afeb91383089a4ddab7ed
Core retains core functionality, including text styling and architectural
items like dialogs.
The new modules are:
* mwformatting
* mwimage
* mwlink
* mwmeta
* mwreference
* mwtransclusion
The new modules are loaded in ViewPageTarget (for desktop), except for
mwlinks which is included from MWTarget (for desktop and mobile), per the
needs of the Mobile team.
Also, mwgallery was moved to desktop-only loading status.
Some styles which were loaded in mwcore but only used in modules is now
loaded in said modules.
This does not split up ext.visualEditor.core yet, which is left as an
exercise for the fool-hardy.
Bug: 61075
Change-Id: I6374854eaa13af824c11078d2f7004dc8a211a30
Just say "Default" rather than "Like other pages in this namespace" (let's
put that in the help string/tooltip at some point); order the "default"
value between "yes" and "no" (like for TOC); make sure the panel for the
advanced settings is in the same position in the page menu as the meta-
data dialog.
Follow-up to I30d483b5b6c3df7e
Change-Id: I902eb4f8504866b2dcde32333cf365a59716c2ce
Add a trinary option to the page settings pane of the meta dialog that
lets users set the page to have __INDEX__, __NOINDEX__ or neither (and so
have the default behaviour).
Bug: 57167
Change-Id: I30d483b5b6c3df7ee56a52c744bbdc610a01873d
Rules like "right-aligned images get float: right;" should
be in the generic image CSS, they're not skin-specific.
I haven't exactly teased apart what is and it's skin-specific,
this is just a first stab.
Change-Id: Ie374685d2c66e2275f7a98a590e563bf36da7f87
The styling of the image thumbnails should be controlled at the
skin level, not by the generic VE styles. Moving the thumb/figure
styles from ve.ce.Node.css to ViewPageTarget-shared.css. Otherwise
no changes to the styles themselves.
Also adding minerva (the mobile skin) to the list of supported skins.
Bug: 60542
Change-Id: I67ab6d5b91cee7e587f61df26e7dae74c1068788
It can be reused in mw.ViewPageTarget and mw.MobileViewTarget.
Also, check if this.section is undefined instead of not null and update
docs. restoreEditSection() does not accept any arguments.
Change-Id: Ibbcf4cb936a89d3ae77bb61ee97b8ad00a8d8a53
Adds setting and unsetting the #REDIRECT status of the page from the page
settings pane of the meta dialog, and toggle whether this is a static
redirect (i.e., it is not automatically changed when its target is moved).
If the page has a redirect set, the meta dialog will be shown on opening
the page so that users can adjust the redirect more swiftly.
Bug: 47328
Bug: 50878
Bug: 57173
Change-Id: Ibd89cf04486799f292b9fd045dae5bc23fcf6fd4
Update VE core submodule to master (84ced37) and update calling code
for changes in OOUI.
Depends on Ic967b88d55daf48d365487e17f76488b3f02c60f and Ib599b9bd5028e2df084fcc3da657aeb7f1569d2a
New changes:
94f03c3 Undefined variables first in selectNodes
62b5648 Localisation updates from https://translatewiki.net.
10c5a18 Don't descend into handlesOwnChildren nodes in selectNodes
4ed2432 Update jquery.client to MW's master (45192156d7)
d7e24b8 Localisation updates from https://translatewiki.net.
babb9da Localisation updates from https://translatewiki.net.
4639d18 Localisation updates from https://translatewiki.net.
a561537 Localisation updates from https://translatewiki.net.
8f7053a Localisation updates from https://translatewiki.net.
7112cc2 Update OOjs UI to v0.1.0-pre (a290673bbd)
Change-Id: Ie7d58472619509782f23a7dedc1ec27c3dcc7543
Rather than setting the wgPostEdit configuration variable when the
user uses VisualEditor, i.e. communicating via mutable global
state, include whether or not the user edited the page in the
ve.deactivationComplete event.
Bug: 52955
Change-Id: I0f5067550921008f74221d6c92882adfe404b3a5
Changes in MediaWiki core to the padding of div#content in Vector
(see 9d988924a0350228745375e074420a0e1214f7e3 ) made the toolbar in
VisualEditor's ViewPageTarget integration for Vector render incorrectly.
This adjusts the toolbar margins to match the changes in content padding.
Bug: 61224
Change-Id: Ie6b47f5d1929533669118ba51202c1fccda4a0d6
.then() removes the .abort() method from the promise, even though
we had return jqxhr; in the then() callback. So store xhr in
a variable and put the abort method back.
This fixes a JS error upon calling this.loading.abort();
Change-Id: I50460782e58399198bacc02d028984682ddbed56
* Use correct class name for setUpToolbar() in MobileViewTarget
* Move shared setUpToolbar() code into ve.init.mw.Target
* Fix iconModuleStyles documentation, remove leading space
Change-Id: Icf5ed36fd817837c0434db8202bef8a78e6cb898
The selector is too weak and results in the toolbar being placed
in positions it shouldn't be! Whoopsy!
Change-Id: I63540130e4de01f9326fe110d606985fea70b644