Commit graph

143 commits

Author SHA1 Message Date
jenkins-bot 84fb866ed7 Merge "Set up wiki-default image size" 2014-02-26 20:31:49 +00:00
jenkins-bot 4862818c7f Merge "Rename MWTemplateParameter* classes to MWParameter*" 2014-02-26 17:57:07 +00:00
Trevor Parscal e2f6d798b8 Rename MWTemplateParameter* classes to MWParameter*
* The name was getting super long, and the Template prefix doesn't
  appear to be important.
* Soon we will add a placeholder class, which would have been
  MWTemplateParameterPlaceholder, but now just MWParameterPlaceholder
  which seems a little less ridiculous.

Change-Id: Ie2dfe0d4c7b960cd554f89fa6340173e8786c88a
2014-02-26 10:54:45 +00:00
Moriel Schottlender b54575a797 Set up wiki-default image size
This commit makes several adjustments to make sure default size is being
handled correctly:

* Add wiki's default size configuration parameter to the
  VisualEditor.hooks.php file so it can be called from VE.
* Make sure new images are inserted with default size and are
  marked 'defaultSize = true' for the DM to handle.
* Force default size if 'defaultSize=true' in the DM
* Add a 'default|custom' switch to the media edit dialog for size
  inputs. When 'default' is chosen, the media size widget will be
  emptied, displaying its placeholders (default size)
* When the size widget's values are 0 it will automatically turn to
  default size values. If the value started default and the user
  typed in a size, it will automatically override default and use
  custom size.

Bug: 47804
Change-Id: Ib973ea2afa96090a4ba61b2b55ee63457f1329c1
2014-02-25 16:26:15 -05: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
Moriel Schottlender e2f06d4875 Revamp media edit dialog's position widget
Added checkbox to set position (left/center/right) or none if unchecked.
Also handle 'default' position based on the wiki direction.

Bug: 61155
Change-Id: Iddd78c98929759a13d2dc5a774e72b59cbe28c36
2014-02-20 15:47:23 -08:00
jenkins-bot 37c84dc3bb Merge "Ensure we use our references to certain native or upstream methods" 2014-02-20 23:35:39 +00:00
jenkins-bot 81d8fb9130 Merge "Revert "Set href attribute of newly inserted image to image title"" 2014-02-20 21:37:16 +00:00
Timo Tijhof 58c647e3ac Ensure we use our references to certain native or upstream methods
Checked:
 ve.cloneObject       (oo|OO).cloneObject
 ve.getObjectValues   (oo|OO).getObjectValues
 ve.getObjectKeys     Object.keys
 ve.compare           (oo|OO).compare
 ve.copy              (oo|OO).copy
 ve.isPlainObject     ($|jQuery).isPlainObject
 ve.isEmptyObject     ($|jQuery).isEmptyObject
 ve.isArray           Array.isArray
 ve.bind              ($|jQuery).proxy
 ve.indexOf           ($|jQuery).inArray
 ve.extendObject      ($|jQuery).extend

Fixed:
* ve.dm.MWBlockImageNode.js (added in Iebb2081de)
* ve.dm.MWInlineImageNode.js (aded in I62ec12a6b)
* ve.dm.MWConverter.test.js (added in I90273786a)
* ve.ui.MWMediaInsertDialog.js (added in Ia5ad9a8c0)
* ve.dm.MWTemplateSpecModel.js (added in Ic3eb66538)
* ve.init.mw.MobileViewTarget.js
* ve.init.mw.ViewPageTarget.js
* ve.init.mw.Target.js

Skipped:
* ve.init.mw.ViewPageTarget.init.js
  - Feature test (which is for the very references from ve.js
    being ensured in this commit).
  - Misc code using $.inArray (can't use ve.js yet since that
    isn't loaded yet there).

Change-Id: I73ae005d3692e871fdcaea938641558c0b98ec69
2014-02-20 22:30:29 +01:00
jenkins-bot 78bdbb4c43 Merge "Let users set __NOINDEX__ & __INDEX__ status" 2014-02-20 01:50:29 +00:00
James D. Forrester 051c3498ae Let users set __NOINDEX__ & __INDEX__ status
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
2014-02-19 17:48:03 -08:00
James D. Forrester ffc5880417 Add placeholder to 'group' field in reference dialog too
It's just been added to the reference list dialog, but references have this
(totally confusing) field too.

Bug: 59180
Change-Id: Iab26b2c2c99842d33512b0145d1f91379e1cd412
2014-02-19 17:33:35 -08:00
jenkins-bot 71984326d1 Merge "Show placeholder text in group input box on reference list dialog" 2014-02-20 00:43:57 +00:00
jenkins-bot 3e0a88c03d Merge "Add MW-specific keyboard shortcut help" 2014-02-19 23:57:45 +00:00
Ed Sanders 2ce113f0c7 Add MW-specific keyboard shortcut help
For now just accessKey+S for save.

Change-Id: Idf4fa31b98d1fa9ea62d9a9f2937ae7496a9a201
2014-02-19 23:53:22 +00:00
jenkins-bot 1c2dd6986f Merge "Always pass a document model to the surface widget" 2014-02-19 23:51:16 +00:00
Ed Sanders a789ef64ac Always pass a document model to the surface widget
For consistency, in all other cases newDoc is a document model.

Related to the documentation change in Ie1ee9bd958b3, but not
strictly dependent on it.

Change-Id: I98ade6abd49ebd37d8eb8005e349b89b318d9421
2014-02-19 23:14:55 +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
James D. Forrester e9ae4a94b4 Revert "Set href attribute of newly inserted image to image title"
This reverts commit 537e431466.

Bug: 61560
Change-Id: I60cd1b881dcb44f14925bfcdd013fcd100aa9e06
2014-02-19 22:27:28 +00:00
jenkins-bot d774a642c9 Merge "Disable save button (and Alt+S) on conflict" 2014-02-19 22:02:01 +00: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
jenkins-bot 0d2ea63596 Merge "Use accesskey=s on the save buttons" 2014-02-19 21:42:13 +00:00
Krenair ec8234f183 Use accesskey=s on the save buttons
Bug: 50897
Change-Id: I31d6b9ea065b3be85ed07fba7437bed71010512b
2014-02-19 19:34:13 +00:00
Moriel Schottlender 296cdbd2cb Make alternate text input stretch to full width
Make sure alternate text input box is stretch to the full width of
the MWMediaEditDialog screen.

Bug: 61329
Change-Id: I22f7e4bc6a03e6349e3494291764d3bf531d70de
2014-02-18 21:13:12 +00:00
Krenair 9c40de10b1 Show placeholder text in group input box on reference list dialog
Set to "General references" for now.

Bug: 59180
Change-Id: I39c3692c71674ff656617500aa22ec7191db2e96
2014-02-18 20:56:45 +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
Trevor Parscal 4c2d4c14ea Update VE core submodule to master (8b545f4)
Also update use of OO.ui.PageLayout to work with changes in OOUI.

See: I58a279dd949a867a4698a791103d5a6f2bd4b67f

New changes:
8b545f4 Update OOjs UI to v0.1.0-pre (3a9a4c1da8)

Change-Id: Ib5063db055a63082d08b2858bffb9f854d76c01b
2014-02-14 17:53:59 -08:00
jenkins-bot 912fda938d Merge "Explain what the number on the edit summary screen means" 2014-02-13 01:09:33 +00:00
Roan Kattouw d4e8be5f49 A couple more OO.ui.deferMsg() calls
So as to not show message keys as labels :)

Change-Id: I98951d48449ed26cf35c192e871e4bb56fcd4e8b
2014-02-12 15:04:28 -08:00
Moriel Schottlender 02c072a29e Update image size properly when size is default
When an image with default size has a size change, the defaultSize
attribute in the data model must be set to 'false' so the new size
can be updated in parsoid.

Bug: 61270
Change-Id: I84388aec62674a3e3c6773f29bda7156254b5f4a
2014-02-12 17:23:18 -05:00
jenkins-bot 2f9c71edd3 Merge "(Stand back again) Even moar label manias! (label refactoring) + VE core update" 2014-02-12 22:08:27 +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
Moriel Schottlender 80558f85dc Quick fix: image size property update
This is a bit of a workaround for scalable image nodes to update the
current size rather than only the original one. This is done so the
MediaSizeWidget in the media edit dialog is fed the current dimensions
of the image even without the image being saved.

Ideally, the node's 'currentDimensions' property should be constantly
updated to current dimensions. This workaround fixes the given bug, in
which all images show the original wikitext/default size even after
being resized.

Bug: 61052
Change-Id: I902d1f51b1389f2f9b2b5c871b578ee2244a946f
2014-02-12 16:53:13 -05: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
jenkins-bot 6907654de1 Merge "Add image type change to media edit dialog" 2014-02-08 00:45:49 +00:00
Moriel Schottlender 19c584d166 Add image type change to media edit dialog
Adding a type change to the media edit dialog. Also changing SelectWidgets
to ButtonSelectWidgets for consistency.

Bug: 38129
Change-Id: I9c855e6381d970b5f08460822366f6333af24f82
2014-02-07 16:41:50 -08:00
jenkins-bot fd6fb32db2 Merge "Auto-select first auto-added required param and fix param order" 2014-02-07 23:21:00 +00:00
Ed Sanders cf62801694 Move paste rules to Target
Because ViewPageTarget isn't always loaded.

Bug: 60912
Change-Id: I16bd6a329120b3dd7dcb0de3e76e69e84c18553f
2014-02-06 22:41:51 +00:00
Trevor Parscal d487b44dd0 Auto-select first auto-added required param and fix param order
Symptoms:
* When adding a template with required parameters, the last parameter
  is initially focused
* Parameters and parts appear out of order, and adding/remove/moving
  them shows them in almost random placement

Diagnoses:
* Parameters are auto-focused when added, and parameters are auto-added
  in forward order
* TransclusionModel's process method had a bug in which the code to
  derive an offset from the item being removed would not be reachable
  due to an inverted logic statement

Prognosis:
* Fatal, with a 10% chance of survival

Treatment:
* Set focus on the first parameter after auto-adding required
  parameters to a template
* Invert the logic in TransclusionModel's process method, so that if
  the index IS undefined we will proceed to define it

Change-Id: I299053b63045ec933747831f1b4aa63493760f8b
2014-02-06 13:21:14 -08:00
Moriel Schottlender b522994344 Adding position setting to media edit dialog
This adds an image position/alignment to the media edit dialog.

Bug: 51293
Change-Id: I15fbd1ed0998a9093fa039b76624395d661af05b
2014-02-05 20:56:37 +00:00
Moriel Schottlender e8205a7133 Adding alternate text to media edit dialog
Adding an option to add or edit alt text to images in the media edit
dialog.

Bug: 38129
Change-Id: I6d339781822175c40c66a4689ec6e1a873cb081d
2014-02-05 20:56:30 +00:00
Ed Sanders fb4f7d3e24 The great image scaling rewrite of 2014 (MW)
Implement new logic in ve.Scalable from I5b4f0f91b.

Also update VE core submodule to master (57ed8d3).

New changes:
59a0afe The great image scaling rewrite of 2014

Change-Id: I24a2976036310d3814cc7d1853a68745e0499bd5
2014-02-05 12:55:11 -08:00
Ed Sanders 61d010df2f Move image info API call to media node
As other widgets may be interested in the image info, this should
be part of the DM node, which the media edit dialog then fetches
and uses to populate the MediaSizeWidget.

Other fixes:
* Remove spinner, not really necessary as the orignal size button is
  disabled if the orignal dimensions aren't set.
* Don't wait until image info call to resolve to initialise size
  widget values. These should always be available instantly from the
  attributes.

Depends on I9530ed4257e88b in core.

Change-Id: I394f49941b621059bc08c8a8f79471b2fe16c7d8
2014-02-05 12:48:31 -08:00
Ed Sanders 425d6fee54 Exclude galleries from reference/caption surface tools
Because putting galleries in either would just be silly.

Change-Id: I03013607f3caae0053661c3c47d46b888ab5fde0
2014-02-05 19:45:56 +00:00
Ed Sanders d7e9564d22 Hide structure tools in MWReferences
Technically these are possible to render (although there's currently
a Parsoid bug preventing it) but really references should just contain
one single paragraph.

Change-Id: I405d75a0935d3f4610e10b942b48fa0fa2679a20
2014-02-05 19:39:39 +00:00
Ed Sanders 1e6daf1ee6 Implement surface paste rules for media/ref dialogs
Extend default paste rules to prevent lists/tables/references/headings
as applicable.

Also update submodule to master (76ff210).

New changes:
f1a927f Internal paste rules and type conversions

Bug: 59603
Change-Id: I952f98477219a55d25a2bd817344bde58a4862d4
2014-02-05 11:17:33 -08:00
Ed Sanders f6acb93d5a Store original dimensions results in IV store
* Remove the this.mediaSize custom store object and replace
  with a hash function and the document's IV store.
* Remove this.inputs/this.fieldsets namespaces.
* Calculate this.filename as soon as this.mediaNode is set.
* Rename getMediaSize to getOriginalDimensions

Change-Id: I2030aade5d96555451f6a390d0aa3d44b860841f
2014-01-26 14:26:57 +00:00
Moriel Schottlender 8130acebfd Changing image size in MWMediaEditDialog
Adding the ability to edit image size in the media edit dialog.
The size is now a separate widget.

The following changes were made:
* The dialog was changed to a booklet with 'general settings' and
  'advanced settings', in preparation for other edit features.
* The original image maximum size is fetched from the API and cached.
* Maximum size is limited to the image's original maximum size.
* Aspect ratio is kept when changing height or width, using original
  image size to preserve a sane ratio through the MediaSizeWidget.
* If an error is found in the size, the image will retain its previously
  set dimensions.

Depends on MediaSizeWidget: I3d0f9348a52

Bug: 38129
Change-Id: I2946fb21c46ce05583b219f665ef68928188899e
2014-01-22 18:43:45 -08: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