Commit graph

520 commits

Author SHA1 Message Date
Krenair 390d8ca793 Fix reference dialog apply button disabling when modifying existing reference
Existing references keep internal records of current saved data, which breaks
the current length check. Instead, use the new function to count all
*non-internal* elements

Relies on I8ecbf387
Related to bug 52182

Change-Id: I4b9bb866babe018d75dc083fab35375b9fb53d3c
2014-06-02 17:12:12 -07:00
jenkins-bot 1baf2f08e7 Merge "Remove link node inspector from insert menu" 2014-06-02 21:07:33 +00:00
Roan Kattouw 172ebb839e Remove link node inspector from insert menu
This inspector isn't designed for insertion mode yet; attempting to use
it in insertion mode causes nasty JS errors.

Bonus:
* Make its tool title "Simple link" rather than "Link", for when
  we do reintroduce it.
* Make double-clicking / pressing enter while selecting a link node
  open the link node inspector rather than the link annotation inspector.
* Make link nodes render with MW's external link arrow icon
* Move the link node inspector's messages to the right RL module

Bug: 66047
Change-Id: Ib94da7ed3a2a88297dbdd1529f20cd8dab7c8421
2014-06-02 21:05:07 +00:00
jrobson fef33d30ec Add use existing reference to toolbar on mobile
Note currently a blank icon appears to the left of this.
This will need to be removed later.

Change-Id: Ia8be1f0e83a2154a48de3c3a47bd8feb0c9a2a2c
2014-06-02 12:12:32 -07:00
jenkins-bot 98f403f237 Merge "Use <visualeditor-toolbar-cite-label> correctly in the Media and Reference toolbars" 2014-06-02 17:38:36 +00: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
Amir E. Aharoni c27d62d19f Use <visualeditor-toolbar-cite-label> correctly in the Media and Reference toolbars
Bug: 66039
Change-Id: Ie9cba04a0f117e1d5fb25a93f81df423787a9d79
2014-06-02 09:49:48 -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
Alex Monk 96bcc2dc55 "Use an existing reference" in the reference dialog should be disabled when there is content
Bug: 65689
Change-Id: I55f7af71957634f5c19996be02a51af0288e9e2f
2014-05-30 21:04:51 +01:00
Alex Monk d43db7f12f Trim description when working out whether or not we should disable the info button
So we don't display just a blank box for a single space.

Bug: 65862
Change-Id: Ie0ab305b8ee3cfe86e8f17adaab45c57b4ec49b7
2014-05-30 18:25:58 +00:00
jenkins-bot 21b4249360 Merge "Switch action=opensearch call to list=prefixsearch where appropriate" 2014-05-29 00:38:20 +00:00
jenkins-bot de0091fec5 Merge "Allow extensions to add extra meta item checkboxes to the page settings dialog" 2014-05-29 00:33:19 +00:00
Krenair d12a0d73d7 Switch action=opensearch call to list=prefixsearch where appropriate
Bug: 63555
Change-Id: If39e6f9c3a8445d506f14797bcec46714fb3e0f9
2014-05-29 01:15:03 +01:00
jenkins-bot 9da25b36fd Merge "Suggest categories that exist but don't necessarily have pages" 2014-05-29 00:06:27 +00:00
Roan Kattouw 27a400ee62 Remove gallery tool from toolbar
It confuses people looking for the media insertion tool. Galleries
that are already on the page will still be inspectable.

Change-Id: I90609ab7f19fb513c17d9253db30e7ddeaa18436
2014-05-28 16:40:12 -07:00
jenkins-bot a7bf8b6a7f Merge "Convert toolbar structure group from bar to list" 2014-05-28 23:06:36 +00:00
jenkins-bot c9a56f17a0 Merge "Another default alignment fix to MWImageModel" 2014-05-28 22:12:01 +00:00
Moriel Schottlender f9df17c052 Another default alignment fix to MWImageModel
This time in the installment: Allow the model to predict the type
and default alignment based on parameters rather than just the
current status. This is important for initializing images, especially
inline images whose 'align' attribute is null or undefined, but must
be examined for default alignment.

Also changed:
* Make sure that model operations change each other, rather than
  let the editor change 'unrelated' model parameters.
* Use selectItem rather than chooseItem to avoid emiting the 'choose'
  event on edit dialog initialization.

Bug: 65564
Change-Id: I8c23fc53e7738d59565294d8b98fe7351bebbc67
2014-05-28 18:05:00 -04:00
Krenair 20a1860f49 Suggest categories that exist but don't necessarily have pages
Instead of suggesting categories that have pages but don't necessarily exist.

Replaces part of If39e6f9c

Bug: 49044
Change-Id: I5c53669776c4c5bbbfe7b753747f3f677a752d91
2014-05-28 17:37:01 +01:00
James D. Forrester e2fab2f1eb Dump raster support (unuseful) and assert SVG works before loading
Depends on Idb26804576 in core.

Change-Id: I17481b2d52ab2c33c26ff935b0fd58deb4aa207b
2014-05-27 15:22:26 -07:00
Kaity Hammerstein 55690fd69e New icons for cite, references
Change-Id: I92761fa5844516323a35711cfae8d9d1852f72e8
2014-05-27 14:14:38 -07:00
Moriel Schottlender 7a6f59920d Fix default alignment in MWImageModel
Make default alignment a computed value, and make sure the GUI listens
to 'choose' instead of 'select' events for SelectWidgets so to prevent
recursive calls and make sure the GUI is updated properly.

Also added a default alignment check on type change so the user can
visually have an indication that the new image will have a different
alignment. The user can then change the value manually.

Bug: 65564
Bug: 65596
Bug: 62852
Bug: 65617

Change-Id: I55e16775d18e0a4bf7f1fa73bbb3aa5e0aa51a79
2014-05-24 03:22:52 +00:00
jenkins-bot a58db4629b Merge "Detect that a category is hidden when following a redirect" 2014-05-23 23:29:27 +00:00
James D. Forrester 47e19a9873 Convert toolbar structure group from bar to list
Aligns with I84a4d948ae in stand-alone.

Change-Id: I533355a20bb329b91d6550bde4afa18180b38f59
2014-05-22 17:47:29 -07:00
Ed Sanders d10f27e80a Make MWGalleryInspector wider
Galleries usually have very long lines of text so make the
inspector big.

Change-Id: I69f294af9603a271b73ac1d39166fe4b492290f0
2014-05-22 18:52:27 +01:00
Krenair 060fcabe3b Detect that a category is hidden when following a redirect
At the moment, if you have a category on a page, and the category redirects
to another category which is hidden, VE does not mark it as hidden when
loading the page.

Change-Id: I9303838d36fbc1e2c0ed16b8bb0020bf52a6c211
2014-05-22 17:44:05 +01:00
Juliusz Gonera 44db741a4b Hide unsupported UI elements in references on mobile
Also tweak styles for the supported ones slightly.

Change-Id: Ia4f0f3627d062698c085cd60f72928ef16532d20
2014-05-21 16:18:08 -07:00
Moriel Schottlender d8040dbffc Don't update image model twice
The image model is updated through events from the edit dialog.
There is no need to update the states of the select/checkboxes
at the end in 'apply'. The only inputs that are not updated
on change are caption and alternate text.

Bug: 65564
Change-Id: I18c009546120e270467418cff677ec491fd109ca
2014-05-21 14:41:33 -04:00
Krenair 12d14b9e26 Allow extensions to add extra meta item checkboxes to the page settings dialog
Like this:

ve.ui.MWSettingsPage.static.addMetaCheckbox(
    'metaItemName', // e.g. 'mwDisambiguation'
    'checkboxLabel' // e.g. 'Disambiguation page'
);

Depending on 'ext.visualEditor.mwmeta'

Bug: 61073
Change-Id: I78dd68ff5aad20c7e66c4ce1528b6f1bbc74892d
2014-05-21 16:07:00 +00:00
jenkins-bot 5798569c73 Merge "Image model and the media edit dialog" 2014-05-20 01:15:31 +00:00
Moriel Schottlender 37b3c07b26 Image model and the media edit dialog
Creating an MWImageModel that handles all image edit operations.
If the new attributes mean a change of image types from inline
to block or vice versa, the model will handle the creation and
insertion of the new node.

Change-Id: Ibe71bc8bd74e4ba5a024ac722432ccf0b8f65e71
2014-05-19 21:11:06 -04:00
Timo Tijhof 37087f1f5f MWTransclusionDialog: Remove setMode() call from teardown()
teardown() runs after the dialog has been hidden (if you need it
to be visible, use close() instead).

However removing it instead of moving because it is obsolete,
this is something that should be done from setup() instead, and
already is.

Bug: 65373
Change-Id: Ib6b4ab49f191d1d339e69934453786a82d97380f
2014-05-19 20:44:38 +02: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
Moriel Schottlender 3a9faa44fc Hide 'no results found' once there's at least one result
Naturally, the 'no results found' should only appear as long as there
are actually no results found.

Bug: 52463
Change-Id: I0116b769b9e4995678975d43a74c54c4d426f672
2014-05-16 18:35:41 -04:00
jenkins-bot 52d562a92a Merge "Remove MWCommandHelpDialogTool" 2014-05-15 20:58:35 +00: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
jenkins-bot fb4b6f0b0d Merge "Move shortcut keys help from "Page options" dropdown to "Help" popup" 2014-05-14 23:16:48 +00:00
Roan Kattouw 29fc9ea1b0 Remove MWCommandHelpDialogTool
Now unused. Also should have been a subclass of the (also unused)
CommandHelpDialogTool in VE core.

Change-Id: I865317aa41dbf93c98620c0f89b6d7ac92499022
2014-05-14 16:16:26 -07:00
jenkins-bot 95828d4ff1 Merge "If no media is found display a message in media insert dialog" 2014-05-14 23:10:23 +00:00
Moriel Schottlender 8f68e9f497 If no media is found display a message in media insert dialog
Add a message indicating to the user that no image results were
found in the media insert dialog in case no results are found.

Bug: 52463
Change-Id: I93aea897d864298bf891a90c2fb147f7d34df06d
2014-05-14 16:08:11 -07:00
Ed Sanders af9cf9b2ff inheritdoc lowercase
Change-Id: Ie7a824a4f145d039b45fe60afbc7fe2a382c5e2d
2014-05-14 16:46:16 +01:00
Moriel Schottlender 2731b1ee48 Make sure originalDimensions are available before use
Before applying default size based on originalDimensions, make sure
these are available through the scalable call. The image will be
marked as default size, but the presentation will depend on whether
or not we have the defaultDimensions from the API.

Bug: 65239
Change-Id: I41b30498713e969bd24ef0ad3e9a074c6ffcdc3b
2014-05-13 15:53:30 -04:00
Bartosz Dziewoński d8de718a5d Move shortcut keys help from "Page options" dropdown to "Help" popup
Obviously it doesn't belong there. I think I'm getting the hang of this. :D

Change-Id: I5933e32bb8a803d004c2e33d55d7900d1b18a44e
2014-05-12 15:28:30 +00:00
jenkins-bot 20b5c4038b Merge "Make citation tools' compatibility check use normalized titles" 2014-05-10 19:13:32 +00:00
Roan Kattouw a15fa5a17c Make citation tools' compatibility check use normalized titles
Greatly enhance the functionality of ve.dm.MWTransclusionNode#isSingleTemplate
and actually use it places.

Use mw.Title to normalize titles, accounting for case differences and
spaces vs underscores. Also allow an array of template names to
be specified.

Use isSingleTemplate() in the transclusion and citation dialog tools,
which were duplicating this logic. Also document the .static.template
properties.

Without this, the citation tool will appear for a reference using
{{Cite news}}, but not for one using {{cite news}} or {{Cite_news}}.

Change-Id: I18d2bb1b22a5ab269694ad0818b1bb326ef8d1fd
2014-05-10 21:10:09 +02:00
jenkins-bot 83480093d3 Merge "ve.ui.MWTemplatePage: Display template name in text form, not dbkey form" 2014-05-10 18:17:55 +00:00
Bartosz Dziewoński a842801557 ve.ui.MWTemplatePage: Display template name in text form, not dbkey form
Change-Id: I66f0ca431616d932da336f3d05d2500d1cd21ff8
2014-05-10 20:02:52 +02:00
James D. Forrester df280e27f9 ve.ui.MWTitleInputWidget: Fix documentation (@cfg not @param)
Change-Id: If76e22754b6e17b6ad98f72d5561929bb42bcab7
2014-05-10 12:02:25 +00:00
Timo Tijhof 9455e1f3ab ve.ui.MWMediaResultWidget: Use .on() instead of .error()
> JQMIGRATE: jQuery.fn.error() is deprecated.

While at it, also avoid using the overloaded .load(). It has
quite a few different signatures (one of them is to load $.ajax
by url and replace the contents of the element, completely
unrelated), and calling .on() directly is quicker as well.

Change-Id: I139b0c603577b5a0102d2ff679bd86b792830e3e
2014-05-07 20:35:19 +02:00