Commit graph

66 commits

Author SHA1 Message Date
Amir E. Aharoni 84629d1b6c Clarify a comment and correct its spelling
Change-Id: Idd1334d60822a1bfaae2354bca6cb277016f81f7
2014-12-28 00:51:52 +02:00
Timo Tijhof 2b7ae8c175 Remove use of bind() for inline functions
Follows-up b0e8900, 447e8de, d3f26e65.

Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.

Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
  without additional overhead and without confusion association
  with "html" which isn't used (it doesn't serialise and re-parse
  or clone, it just appends when given one or more nodes).

Change-Id: I797a3667c67d52568150be9be5d043d149f22077
2014-12-16 23:27:53 +00:00
Alex Monk 0d0172d43b Set 's' accesskey on save button inside save dialog
Can be done much nicer than I expected last time I looked at this task

Bug: T76161
Change-Id: I9541cd9dac69330ed8a802f301617619221bc263
2014-12-15 21:07:54 +00:00
James D. Forrester 57a68d082b Mark primary buttons as progressive as well
Also make save button primary.

In anticipation of Iee91d2c6 in OOjs UI

Change-Id: I123044bfaba631866ad32a35643f23686a17a16f
2014-12-11 22:55:16 +00:00
jenkins-bot a7dc4af551 Merge "Catch pagedeleted errors and give the ability to re-create the page" 2014-11-25 19:42:58 +00:00
Alex Monk 9bb766c5bb Catch pagedeleted errors and give the ability to re-create the page
Bug: 52073
Change-Id: I86a6e1510ccb5e59e94a5262dd3ccd91fdf05a70
2014-11-21 21:44:15 +00:00
Alex Monk ba81c45da9 Restore selection after closing save dialog
Also simplify some weird focus code in MWSaveDialog

Bug: 72911
Change-Id: Ifb8fd9be96a199f86412247211e3920a35dd22bf
2014-11-11 23:55:39 +00:00
Alex Monk 3628fc0ffc Disable review button while save dialog is pending
Bug: 65310
Change-Id: I7cfb5d84b91b4a20282e126b8c863c15519b5a9d
2014-11-05 23:36:33 +00:00
suchetag 7d82d173c6 Replacing title attribute with mixin TitledElement
The title attribute for byte counter in MWSaveDialog is replaced with the mixin TitledElement from label widget in OOUI

Change-Id: Ic4b37fac9e16b6db9091a16376e06d55bbb3d649
2014-10-09 22:57:04 +00:00
suchetag 36f95e4b21 Bringing back the edit summary byte counter in the save dialog
Bug: 71837
Change-Id: I14b1c8a8f0b8501e5ea5a3041f6aa99ae2529b2f
2014-10-10 02:56:01 +05:30
Roan Kattouw 77ba5c62c1 Followup 78e3a91: can't assign getValue() to $textarea, oops
Well spotted, Ed.

Change-Id: Ic3ce07591130d59fb2da5df2e410f39f672c71e1
2014-10-08 22:55:27 +02:00
suchetag 78e3a91455 Replacing $input in save dialog
Bug: 56647
Change-Id: I4703d0625767efd1b15bbc00848c77b322b43e53
2014-10-09 01:51:48 +05:30
James D. Forrester b46159eeed Relabel the cancel button in the save dialog to "Resume editing"
Bug: 69116
Change-Id: I35289ff02681c3bf46a7bb491c017c500f30c7a6
2014-09-11 11:52:21 -07:00
Roan Kattouw 6fce4c6359 Make the Resolve conflict button actually appear
If you got an edit conflict, the save dialog would
dead-end: there was no way for you to actually get to
the edit conflict resolution page because we were
hiding the resolve button.

Bug: 69150
Change-Id: Iaccb7d0ec25d8f15398e437d614184433c33e6eb
2014-08-27 01:06:54 +00:00
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
James D. Forrester 67f304a414 Update VE core submodule to master (c4ce5ee)
New changes:
c4ce5ee Update OOjs UI to v0.1.0-pre (466a8762ac)

Update changes:
* Remove manager arugment from window constructors
* Use this.$content instead of this.frame.$content
* Use this.getDir() instead of this.frame.getDir()
* this.loading is now a promise, not a boolean

Change-Id: Ia83449a60078dd24ea4f976221c0859e5a121279
2014-08-20 18:42:52 -07:00
Roan Kattouw c9e04f2211 Don't send API requests to preview empty (or whitespace-only) edit summaries
Change-Id: I1b75a012eebececa5fd53d5ceedb9221648182fb
2014-08-02 19:12:25 -07:00
Ed Sanders c23cebd5f6 Comment used messages
Change-Id: I22594b11f06f349c43162d52646a5c647c6ad0a3
2014-07-28 13:08:39 +01:00
Roan Kattouw 7cc31d0c34 Actually show the corruption warning in the save dialog
It was being set, then immediately cleared again.

Also remove the unused dirtymsg div.

Change-Id: I22e5fbe814d14684626a7502d2401f414838709b
2014-07-25 11:39:03 -07:00
Ed Sanders 24c322a124 Use native focus
It's faster.

Change-Id: I0a8a2452aa987e2b93c5c8ba3c6efa2bcafbaa86
2014-07-22 19:05:14 -07:00
James D. Forrester c2f37a0450 test: Move mw into the global list of globals for VE-MW
Silly to have 38 MW-specific files needing to declare that they're using mw.

Change-Id: I97891ed922fe0c37d8c96425a4d23bd15098438b
2014-07-19 17:42:45 +00:00
James D. Forrester fbdff76263 Update VE core submodule to master (f2277ea)
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
2014-07-14 23:24:45 +00:00
Krenair 143c21999e Port MWSaveDialog to use ActionDialog
Relies on Id17d150d

Change-Id: I80dd89fa7ad55daa3ae7e9c01c4a78f6e54105ca
2014-06-18 20:43:45 +00:00
Trevor Parscal 06f00d73ae [BREAKING CHANGE] Update VE core submodule to master (43a48cb) for window process cleanup
* 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
2014-06-12 00:42:13 +00:00
Ed Sanders a425ab4812 Move save panel init to getReadyProcess
Bug: 66168
Change-Id: I903d2892b56e531fa8d4d44873a3889b637e0f09
2014-06-06 11:51:27 -07:00
Trevor Parscal f58861b6c3 Cleanup save dialog counter label
This label is not needed, never visible, not internationalized and doesn't make sense.

KILL IT WITH FIRE!

Change-Id: Ia0b3eda5971598714644b9d0c4fec1fd44b6c440
2014-06-02 09:57:24 -07:00
Trevor Parscal f65c3c6ef1 [BREAKING CHANGE] Update VE core submodule to master (88fe25f)
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
2014-05-30 22:03:45 -07:00
Ed Sanders ddf88a5633 Fix styling on save dialog
Apply styles directly to textarea instead of wrapper div

Change-Id: Id2340cb81dd343266b8a57ae91057fa3015a47e0
2014-05-19 18:41:06 +01:00
Ed Sanders bd3b5ffc4f Initialise save panel on 'ready' so focus works
Bug: 65222
Change-Id: I18a0191a3013332621e44455ea59d5f8d683117e
2014-05-19 17:23:38 +01:00
Timo Tijhof 25d00cc777 build: Update jscs and jshint
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
2014-05-15 16:52:34 +00:00
Roan Kattouw dfbb7815e9 Make reference list dialog small again
Also remove now-useless size setting in save dialog

Bug: 64670
Change-Id: I1abc760a27ce2b107a92413ff3d5da7d95915dc2
2014-04-30 18:05:41 -07:00
Krenair 7645b9805b Call clearAllMessages in setup instead of swapPanel on the save dialog
Was clearing things like captchas when swapping panels. It still makes
sense to clear these when opening up the dialog though.

Bug: 62766
Change-Id: I37ceeebc672e2866b805631b189108d8363bdc9f
2014-04-25 22:44:39 +01:00
Roan Kattouw ba455643fc [BREAKING CHANGE] Update VE core to master (cb2e61b)
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
2014-04-21 15:32:59 -07:00
Krenair b6f1793bf8 Use new OOUI pending feature rather than loading bar thing on save dialog
See I5c45cc6 for the oojs-ui change and I2fa71a1d for a similar commit

Change-Id: I77e3274a196bc13ae19a9520197f4a8b624fd528
2014-04-18 21:57:14 +01:00
Ed Sanders 0e51180709 Update VE core submodule to master (55a5cdc): use new ve.ui.Dialogs and ve.ui.Inspectors
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
2014-04-09 20:28:30 -07:00
Trevor Parscal 9e38cafc9f Remove constructive flag from return to save form button
It doesn't create anything, so it shouldn't be constructive.

Change-Id: I97d6fc3c5f992033e55ee6cde48245b1e96ddc16
2014-03-31 15:31:43 -07:00
Trevor Parscal be199c0bf2 Ultra-mega-hyper-citation editing on crack
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
2014-03-24 19:24:38 +00:00
Roan Kattouw aae2fb09de Actually make the save dialog grow when showing a diff
There was code doing it, but its effects were undone by a switch-case fall-through.

Change-Id: I59abc1bbbf086eb29bda86f15bfac3acec3b0950
2014-03-12 17:31:02 -07:00
Trevor Parscal 2a08584e8c Update constructors of inspectors and dialogs as per changes in I345d6e6
This is harmless since the values were being passed through anyway.

Change-Id: Ie81afa6b5929047b624b4376f7d70db7a7d675a4
2014-03-05 17:07:20 -08:00
Trevor Parscal 27cda86183 Update VE core submodule to master (ab70193)
Also update for dialog size changes on oojs-ui, and make the
save dialog grow from 'medium' to 'large' when viewing a diff.

New changes:
ae195ac Update OOjs UI to v0.1.0-pre (e4f6ce0156)
ab70193 Pass surface set into ve.ui.Dialog and ve.ui.Inspector

Bug: 60494
Change-Id: Ib3065e228459aa00f18c309d234f3324fdb34059
2014-03-05 16:34:14 -08:00
Alex Monk 1e8be87f43 Don't show edit summary preview if it's blank
Bug: 61716
Change-Id: I6cd7ee0ad947dcac24a50b6df61316fde74edb43
2014-02-22 00:55:43 +00:00
jenkins-bot 01570025d3 Merge "Show preview of edit summary in review screen" 2014-02-19 23:07:19 +00:00
Krenair 675d91b7e8 Show preview of edit summary in review screen
Bug: 42139
Change-Id: I0bbfd0dd993da67295dea47129ca9f398f318b64
2014-02-19 15:03:04 -08:00
Roan Kattouw 03dc2927ca Disable save button (and Alt+S) on conflict
In the conflict pane, we hide the save button, so disabling it doesn't
make a visual difference, but it also disables the Alt+S access key.

Change-Id: I8c0d92a40a02d525ec10932656ebf38a74a97cd4
2014-02-19 13:46:43 -08:00
Krenair ec8234f183 Use accesskey=s on the save buttons
Bug: 50897
Change-Id: I31d6b9ea065b3be85ed07fba7437bed71010512b
2014-02-19 19:34:13 +00:00
Trevor Parscal 7a3267467a Update VE core submodule to master (64650c6)
Switch to using FieldLayout for laying out forms.

New changes:
64650c6 Update OOjs UI to v0.1.0-pre (424b40373e)

Change-Id: I757aecf3485673f54aa9e7f38e88c079dda4451d
2014-02-15 01:55:55 +00:00
jenkins-bot 912fda938d Merge "Explain what the number on the edit summary screen means" 2014-02-13 01:09:33 +00:00
Trevor Parscal eca0a08ad9 (Stand back again) Even moar label manias! (label refactoring) + VE core update
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
2014-02-12 14:05:23 -08:00
Krenair c4903ac684 Explain what the number on the edit summary screen means
Bug: 50902
Change-Id: Ic548e624c1e7375b3151cc9d2f051a5bc665c759
2014-02-09 03:14:09 +00:00
Trevor Parscal f4156bd09f Update VE core submodule to master (e7e2833)
New changes:
* e7e2833 - Update uses of Push/IconButtonWidget to ButtonWidget
* d9d9eb5 - Update OOjs UI to v0.1.0-pre (d9bab13)
  * d9bab13 - The Great Button Refactor of 2014
* 22b93ef - Update OOjs UI build (88b2871)
  * 88b2871 - Fix png transparency on required.png
  * 670c468 - Add i18n

Also:
* Update uses of Push/IconButtonWidget to ButtonWidget as there
  is a breaking change in new OOjs UI version.
  This was separated from commit I325a4dcc316d0.

Change-Id: I82220d15221c52be03feafcfc85c2bd6c12ba462
2014-01-17 16:29:36 +01:00