Commit graph

202 commits

Author SHA1 Message Date
Trevor Parscal 49471fc9b5 Update VE core submodule to master
Also update for indicator changes in Iaf7726150

New changes:
f981943 Fix toolbar indicators in demo
e849941 Update OOjs UI to v0.1.0-pre (11632fcada)

Change-Id: I16c38259ccedbfba8260f8a508b572cee6389517
2014-01-17 18:30:00 -08:00
Trevor Parscal 7994eae8c2 MediaWiki language inspector updates
* Add ULS, which was removed from VE core
* Add experimental mwlanguage module which adds ULS integration
* Hook in ULS to the existing language widget

Also update VE core submodule with changes:
* 1e92abe Generic language inspector

Bug: 47759
Change-Id: I325a4dcc316d0334fadfcaa46ad3acd45c6bf84b
2014-01-18 01:02:23 +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
Timo Tijhof 8e7a864e90 Clean up and doc fixes
Remove odd comment and move node property to list of properties.

Change-Id: Ife3161bbdbf01075e987e65d9bfef41994efa916
2014-01-16 17:41:08 +00:00
Ed Sanders 26392cc1db Fix png transparency on gallery.png
Change-Id: Ia202294e1d27517c5317654e1d2d3410286c1773
2014-01-16 11:45:32 +00:00
jenkins-bot adf8249688 Merge "Ultra-basic gallery editing" 2014-01-15 23:27:06 +00:00
James D. Forrester 842688c51b Ultra-basic gallery editing
'Cos Erik doesn't like things he can't edit.

Change-Id: I1d9fb1215bb16b1245eddd87c977fb5bfdee4da9
2014-01-15 15:13:12 -08:00
jenkins-bot c8a1e16749 Merge "Display indicators for required parameters in template dialog" 2014-01-15 22:23:20 +00:00
Trevor Parscal c8f7845def Display indicators for required parameters in template dialog
Update submodule for changes in OOUI (I1c047b55c7a0d5cf3e0aa0cc3f9a4da7d45c0304)

Change-Id: I8f84a9ae277e5093356f591f7a56e8cebf4a1893
2014-01-15 14:15:21 -08:00
Ed Sanders a703086e61 Keyboard shortcuts MW integration
Also adds a button to the utilities menu.

Depends on I806343b42c5fc63d.

Bug: 52844
Change-Id: Ia488362f4b8c9b99b615c84a7341d97e28bdb295
2014-01-15 14:04:06 -08:00
jenkins-bot 2284cb9aae Merge "Factor out AJAX defaults into ve.init.mw.Target.static.apiRequest()" 2014-01-15 10:37:43 +00:00
Roan Kattouw 244da036fe Add csslint rule for duplicate background images to ve-mw icons CSS too
Change-Id: I8b179f9caf884bf53d9393570e6b786b52d52d79
2014-01-14 19:11:36 -08:00
Trevor Parscal 278bcd9a20 Added indicators to toolbars
The down arrow is no longer default, so it needs to be specified
explicitly.

Updates submodule to include indicator changes
(see I0a1faef11a1e7e6ea3e44275c85f2efafae4dc9a)

Change-Id: I32aef3ea2e66fd823aeb07dac06cfefba9954270
2014-01-13 18:32:01 -08:00
Roan Kattouw 97c4c6c71b Factor out AJAX defaults into ve.init.mw.Target.static.apiRequest()
Change-Id: I90b0858ccd657b7183ae5327903449d17d9f0bef
2014-01-13 11:45:30 -08:00
Ed Sanders 2e62862dc7 Fix comment in header for MWEditModeTool
Change-Id: I63e555c80a42073268ac487d0e0ee330531942ac
2014-01-13 15:18:06 +00:00
Roan Kattouw e711d79e48 Protect against JS error when langlinks API query returns an error
This happens e.g. when opening VE on a redirect page.

Change-Id: I75b77da42013c3d446cbc9c57aebe0907a2b40dc
2014-01-07 11:26:31 +08:00
jenkins-bot 2e44796a94 Merge "Use GET rather than POST in ve.ui.MWLanguagesPage" 2014-01-06 15:38:06 +00:00
jenkins-bot 2016380ac5 Merge "Let users set __NOEDITSECTION__ status" 2014-01-06 09:45:49 +00:00
James D. Forrester 707f7c93a5 Let users set __NOEDITSECTION__ status
Adds a checkbox to the page settings pane of the meta dialog that lets
users set or unset the __NOEDITSECTION__ flag on the page.

Change-Id: If1eca58e28d214021f5f5582856e595d4d0fbc43
2014-01-06 17:42:57 +08:00
James D. Forrester 0ffd654bed Bump copyright like it's 2014
Change-Id: Ic469ebda2c061dc7da0b4c1625f43a7be55da4fa
2014-01-05 20:06:50 +08:00
James D. Forrester 0fadc2bc77 Let users set __NOTOC__ & __FORCETOC__ status
This creates a new panel in the meta dialog, "Page settings", where page-
level settings will be, err, set. For now, this exposes just the
behavioural switches for the presence/absence of the Table Of Contents –
__NOTOC__ and __FORCETOC__.

As part of this change, the meta dialog is renamed to "Options" to be
less confusing, and the icon for the meta dialog is changed to the
generic one for dialogs, which was previously unused. The page settings
pane is provided first in this list, given that the categories pane
(amongst others) is now directly accessible through the toolbar menu.

Bug: 56866
Bug: 56867
Change-Id: I33ce05c19d2e19b249e1cefd26fd0e3697d0085d
2014-01-05 18:56:53 +08:00
Roan Kattouw 28ad21af2e Use GET rather than POST in ve.ui.MWLanguagesPage
Change-Id: Ibf8a3fdd651d8863dca2c4c958da41fc2d80c06a
2014-01-05 13:52:02 +08:00
Moriel Schottlender 580a3f3d8d Use image sources from the fileRepo API
This commit switches from using hard-coded media source urls to utilizing
MediaWiki's API call for meta=filerepoinfo. The API call is done only if
needed when the media insertion dialog is loading, and is done only once
per session.


Bug: 50673
Change-Id: Ia5ad9a8c00cca6cbbbc890359dc529e29e1a6be7
2014-01-04 01:21:24 +00:00
Ed Sanders 8e3f77a9e7 JSCS fixes
Change-Id: I11032f05eaee1e8c895e06ebbc9c329cbc70c8c0
2013-12-14 00:04:12 +00:00
Moriel Schottlender 95d99192b4 Add a getDirectionFromRange Method to ve.ce.Document
getDirectionFromRange returns the direction property of the ce nodes under
that range. That method is mostly useful to recognize the overall block
direction of a selection or fragment.

The method is currently used in the following locations:
* ve.ui.Toolbar onContextChange - as a means to recognize the current context's
  block direction for the icon directionality.
* ve.ui.MWExtensionInspector - if the selection is text and not an existing node
  the input directionality adjusts to the context direction.

Bug: 57421
Change-Id: Ifc01b8e5dc0a2fe39d221e59e452c5cfad709a2d
2013-12-13 12:07:19 -08:00
James D. Forrester 00088bbf05 Use the same new toolbar for media and reference dialogs
With blocks comment out where they're not wanted.

Bonus: Actually make the pasteSpecial command available in these
contexts.

Bug: 58404
Change-Id: Ic77c252ddc9ae54019b2d86ee5f8a6f4febf4292
2013-12-12 19:22:50 +00:00
jenkins-bot 46c708df2f Merge "Make commands aware of their symbolic names" 2013-12-12 18:48:07 +00:00
Kyle Florence 638e4f65b6 Make commands aware of their symbolic names
This introduces a small reorginization of how commands are registered so
that they are associated with their corresponding symbolic names.
This change is mainly to aid with event tracking, but it might be
generally useful for other things as well.

Change-Id: I2ccf4522f786a54c1f5395008b7b0333a1fa6072
2013-12-11 15:34:20 -08:00
jenkins-bot 04c9f79834 Merge "Don't select nodes inserted by a dialog, but drop cursor after" 2013-12-11 20:25:50 +00:00
Roan Kattouw 536df35ed1 Add language code to language dialog
Bonus: give both the language name and page name
lang and dir attributes.

Further bonus: reintroduce message that was deleted
earlier with all of its original translations.

Change-Id: Id137ff9a069799b6c09574b72f450eac6665d144
2013-12-11 02:42:20 +00:00
jenkins-bot 9bf0f5b93e Merge "Show full language names in the MW language dialog" 2013-12-10 17:00:53 +00:00
Roan Kattouw 96000558a2 Don't select nodes inserted by a dialog, but drop cursor after
It used to be that when you closed a dialog, the thing that the dialog
inspected or inserted would be selected. For insertions, the selection
will now be collapsed immediately after the inserted node.
For modifications, the original behavior was kept, as it makes sense to
keep selecting the node that the user had to select in order to access
the dialog. For removals (only possible in the transclusion dialog),
the selection ends up as a collapsed selection at the location where
the removed node used to be; this was already behaving correctly,
as we get this behavior for free with offset translation.

Bug: 54957
Change-Id: Ibd14e8084d67a9ee85e3bac075c3fb50f27b05b2
2013-12-09 18:02:18 -08:00
Trevor Parscal b3281bd87a Spell removable and movable using modern English
Also...

* Update OOjs UI to v0.1.0-pre (5ffe63d088)
* Make template parameter text boxes shorter (3em down from 10em)
* Reorder extendObject calls to not modify incoming config objects
* Allow level option to default to 0, rather than specifically defining it
* Use icon button widgets with remove icons for parameter, placeholder,
  template and content removal buttons

Change-Id: I29db9d814fab5cf4debd0fc7bab6f51475cb0f94
2013-12-06 12:24:36 -08:00
Timo Tijhof cf7f2b141d Set up node-jscs, pass it, and configure in local Gruntfile
Let's experiment with this via our local Gruntfile. If it works
fine we can install it in Jenkins (similar to node-csslint).

Verify through $ npm install && npm test;

Fixed all outstanding violations.

Also:
* Added syntaxhighight to ignore.
* Added imetests (which contain unformatted JSON) to ignore.
* In ve.dm.ModelRegistry#matchTypeRegExps, removed redundant
  !! cast from the [+!!withFunc] statement which was hitting
  a bug in node-jscs. All callers to this local private function
  pass a literal boolean true/false so no need to cast it.
* Removed "/* key .. , value */" from ve.setProp, though this
  wasn't caught by node-jscs, found it when searching for " , ".
* Made npm.devDependencies fixed instead of using tilde-ranges.
  This too often leads to strange bugs or sudden changes. Fixed
  them at the version they were currently ranging to.

Bug: 54218
Change-Id: Ib2630806f3946874c8b01e58cf171df83a28da29
2013-12-06 10:37:27 -08:00
Ed Sanders 1a5bdd5bd2 Show full language names in the MW language dialog
Bug: 54086
Change-Id: I099ac552638d666a447eb3aeaef68329ffacdfce
2013-12-06 13:10:33 +00:00
James D. Forrester d0ba27fd1f Only remove and insert a Category if it's changed
The CategoryPopupWidget's popupClose() method was checking for the
category having changed by comparing its sort key value to the existing
one, but it failed to account that null !== ''.

Change-Id: Idb6a84dc32706d90dea70dceb0b9b3a26ed70110
2013-12-06 01:42:49 +00:00
Trevor Parscal 51e096d6f2 Refactor Transclusion and Meta dialogs to use BookletLayout
Use OOJS-UI's newly-extended paged dialogs (in e08eb2a03b) to refactor
how the Transclusion and Meta dialogs work, splitting out the code for
each of the panels into its own file and simplifying extensibility.

The Meta dialog (ve.ui.MWMetaDialog) now has two self-managing panels:
* ve.ui.MWCategoriesPage for categories and the default sort key
* ve.ui.MWLanguagesPage for language links

The Transclusion dialog (ve.ui.MWTransclusionDialog) now has four:
* ve.ui.MWTemplatePage for a template's primary panel
* ve.ui.MWTemplateParameterPage for each parameter of a template
* ve.ui.MWTemplatePlaceholderPage for a placeholder to insert a template
* ve.ui.MWTransclusionContentPage for non-template transclusion

Additionally, the Transclusion dialog has been slightly cleaned up:
* Replace add/remove events with replace events in transclusion model
* Actually return and resolve a promise (as documented)
* Get rid of "origin" info in template models
* Add method for adding required parts

TODO:

* Decide how and when we will choose between advanced transclusion and
  template dialogs
* Work out design issues with how template descriptions will be visible
  and how adding parameters will work if only showing parameters in
  outline
* Add preview to template dialog
* Consider ways to further improve pages for use in continuous mode

WARNING:

* Right now the template dialog gets overridden by the advanced
  transclusion dialog because they have the same symbolic name and the
  latter is registered later than the former. To test the template
  dialog, just change the symbolic name of the advanced transclusion
  dialog.

Change-Id: I51e74b322aec9a4c3918e6f792bdb3d318060979
2013-12-05 16:26:26 -08:00
jenkins-bot d2c74b18a7 Merge "Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"" 2013-12-05 02:04:59 +00:00
Catrope 2a4ba14862 Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"
Still broken, this time because PagedOutlineLayout / BookletLayout
usage wasn't updated.

This reverts commit c6cfe763bb.

Change-Id: If0d37d396ecf3bb09f026d4432c5d7e30f040085
2013-12-05 02:03:00 +00:00
Timo Tijhof 68cf65844e jscs: "var\t" -> "var "
Only 2 hits.

Change-Id: Ie8c5c39a49f620891bae8582dcc0d2f151e50e21
2013-12-04 21:06:19 +01:00
Timo Tijhof c6cfe763bb Update OOJS UI to v0.1.0-pre (d047752ccc)
Also, as OOjs UI's StackPanelLayout was renamed to StackLayout, and the
showItem() function to setItem(), fix uses in VisualEditor.

Change-Id: If153e5e7c3a7c60e3d62e20aac8fabd4eaaa73c2
2013-12-04 08:53:53 -08:00
Roan Kattouw f8ff2023c3 Fix JS errors when inserting references
ve.ui.MWReferenceDialog.prototype.teardown:
* Pass ranges rather than nodes to transaction builders
* Don't do a removal in insertion mode, we know the removal range
  will be empty

ve.dm.Transaction.newFromDocumentInsertion:
* Correctly splice the edited internalItem into listData in the case
  that newDoc isn't a document slice of doc
* Rename range to spliceItemRange for clarity
* Introduce spliceListNodeRange and set it to either newDoc's
  listNodeRange or doc's depending on whether newDoc is a slice of doc

Bug: 57683
Change-Id: Iae7de7701ae86bed89b707038407243d82249e1a
2013-12-02 11:35:00 -08:00
Roan Kattouw 93b645a453 Make autonumbered external links inspectable
When the target of an autonumbered link is changed to a URL, it's kept
as an autonumbered link and its target is updated. When the target is
changed to a MediaWiki page, the autonumbered link is removed and
replaced with an internal link with the text set to the target.
So for instance, if you inspect [http://www.example.com] and change
its target to "Foo", the result will be [[Foo]].

The core of this commit adds support for inspecting nodes to
ve.ui.LinkInspector. This support should probably move into a
class in between AnnotationInspector and LinkInspector, perhaps
called HybridInspector or something, but I'm deferring that for now.

LinkInspector allows changes to inspected nodes to be reflected either
as attribute changes on the node, or by replacing the node with something
else. MWLinkInspector uses this feature to replace the autonumbered
external link node with an internal link annotation when the target is
set to an external link.

Bug: 53505
Change-Id: Icb404af84c24574438e4de3ef05bbd1993b593f7
2013-11-30 00:14:41 -08:00
jenkins-bot c18534bcad Merge changes If814e178,Id133431e,I38d63e31,I16d575b6
* changes:
  Plain text paste with paste special
  Use rare unicode characters for paste placeholders
  Rich paste
  Add fixUpInsertion to newFromDocumentReplace
2013-11-26 21:07:46 +00:00
Roan Kattouw 620e0e21ef Use InputWidget facilities in byte limit counter
* Don't use setTimeout() within a change event, because change fires
  after the text has already changed
* Don't use .$input.val(), use .getValue() instead
* Don't use .placeholder()
** Reaching into .$input is bad
** Any use of .placeholder() is TextInputWidget's responsibility
** All browsers we support also support placeholder natively
* Remove .editSummaryByteLimit from ViewPageTarget, unused
* Remove ve.bind() wrapping, we already have var saveDialog = this;

Change-Id: I380575fec8d02d1191bfc1f3f235b94c64cd23b6
2013-11-25 17:23:35 +00:00
Roan Kattouw 72b0d2a19c Move setting of minor/watch defaults from MWSaveDialog to Target
It looks like it also came from there originally, because it uses
this.pageExists which doesn't even exist in MWSaveDialog. This caused
all pages, even existing pages, to be watched when 'watchcreations'
was set.

This logic really belongs server-side, though.

Bug: 56206
Change-Id: Idf500383b27a93136dc0cfdd60a2e7b2607af95c
2013-11-25 17:20:29 +00:00
jenkins-bot 10702d9fa0 Merge "Fix crash in MWExtensionNode creation mode" 2013-11-22 15:05:42 +00:00
jenkins-bot ecfa59ae4a Merge "Fix icon opacities" 2013-11-22 13:50:06 +00:00
Ed Sanders 6f984ea98a Fix icon opacities
* parameter.svg had no opacity set
* replace.svg had a document opacity of 80% in addition to the normal 75%
* re-rendered parameter.png (syntaxhighlight doesn't have png's yet)

Change-Id: I9c990fefaf4f5a7536b884b92523408146d7b2c7
2013-11-22 13:47:20 +00:00
Roan Kattouw 1b7fa1cf74 Make save dialog ready for async initialization
initialize() is currently called synchronously, but once the CSS
transplantation code is fixed and it goes back to being async, that'll
cause problems.

* Add this.setupDeferred and use it to defer setupCheckboxes() until
  after initialization
* Move code populating the edit summary from ViewPageTarget into
  MWSaveDialog and use .setValue() rather than manipulating the
  TextInputWidget's DOM. Defer this until after init as well
* Move clearing of the diff from ViewPageTarget into MWSaveDialog,
  and don't connect it to the transact event at startup, only when
  we've actually shown a diff
* Remove swapPanel( 'save' ) from ViewPageTarget, instead do this
  on setup in the dialog itself

Bonus:
* Document events
* Get rid of onFooButtonClick handlers in favor of array syntax

Change-Id: Idcdae5e013340f4519db4387bab507e714d47941
2013-11-22 13:17:53 +00:00