Commit graph

826 commits

Author SHA1 Message Date
Alex Monk 93e4c59e4f Use LinkCache instead of an object in MWCategoryWidget to store hidden status (to be shared with the input widget)
Change-Id: Icb62b9b27ea1d61097d059fa268cc4834d46fc9f
2014-09-23 23:56:27 +01:00
Bartosz Dziewoński 5849e7b8f8 ve.ui.MWLiveExtensionInspector: Fix comment typo
Change-Id: I6e35a5006364ba44de2804e6cd6cd79d6b73c0c3
2014-09-23 23:54:33 +02:00
Moriel Schottlender f4dc6fd240 Add 'autovalue' to TemplateData
Allow for an auto-value for parameters in TemplateData, and make sure
this autovalue is inserted as text when parameter is loaded. This is
mostly useful for referencing date or other dynamic templates inside
parameters.

Bug: 52029
Change-Id: I6203530798ffaa62cb26190c70f7ce391bddf123
2014-09-20 00:52:23 +00:00
jenkins-bot 82e62f8ec6 Merge "Get confirmation when trying to insert/edit template/citation with required parameters missing" 2014-09-17 19:33:48 +00:00
Alex Monk b3ba809ccb Get confirmation when trying to insert/edit template/citation with required parameters missing
Relies on I5d894f8a in MW core. We'll need to update our wfUseMW when that gets merged.

Bug: 50747
Change-Id: I35e55658a3990121afe4d996ef4ee06547d2aa0c
2014-09-17 12:31:23 -07:00
jenkins-bot d59053575e Merge "Refactor a bunch of CategoryInputWidget code, tear out dead/broken redirect handling that should be rewritten" 2014-09-17 02:13:22 +00:00
jenkins-bot bdbc75473b Merge "Validate size widget when activating/deactivating apply button" 2014-09-16 23:54:26 +00:00
jenkins-bot 0f4e85ce11 Merge "Template dialog: Show up to the limit of parameters, not up to the limit + 1" 2014-09-16 23:44:55 +00:00
jenkins-bot d2bcc9dc05 Merge "Show pending state on action button and keep dialog open when switching to source mode" 2014-09-16 23:44:22 +00:00
Moriel Schottlender 20c4fbbc1e Validate size widget when activating/deactivating apply button
In the Media Dialog, make sure the size widget is valid before
applying or disabling the apply/save buttons.

Bug: 70861
Change-Id: I6ec9eb69fe6576f1c668270b12157de9910f0214
2014-09-16 14:48:40 -04:00
jenkins-bot 6ec7789be6 Merge "Add contextual help to all remaining meta dialog controls" 2014-09-16 01:31:12 +00:00
James D. Forrester 712ea472d3 Add contextual help to all remaining meta dialog controls
Bug: 51798
Change-Id: I3f8141485c89e585595dbb853d32e69cbcaebac6
2014-09-15 16:26:12 -07:00
Alex Monk ceafcd5937 Check whether there is a range selected when enabling/disabling re-use citation tool
If there is no range selected, disable regardless of whether there are references in the document or not.

Bug: 70870
Change-Id: I2c281fefe7915345fafb735b3788166ab8118049
2014-09-16 00:18:23 +01:00
Alex Monk 65b232a35b Show pending state on action button and keep dialog open when switching to source mode
Instead of doing a blocking overlay, we're simply keeping the dialog open,
which is necessary for the pending status of the action buttons anyway.

Requires Ib2c8f336 in OOUI

Bug: 65012
Change-Id: I65b5de4a1666a81b157a71f6fec490007689eb44
2014-09-15 20:44:55 +01:00
James D. Forrester 8cde565899 Template dialog: Show up to the limit of parameters, not up to the limit + 1
Bug: 70609
Change-Id: I26dc9c17fe7572d7b864000781fff6583edf9f9b
2014-09-15 12:13:47 -07:00
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
Alex Monk 72a118fc82 Disable re-use citation tool if there are no references in the document
Bug: 70640
Change-Id: I727857281644dffd23605d7792a3f71ee7c5b751
2014-09-11 00:13:10 +01:00
Alex Monk e6c4315d93 Refactor a bunch of CategoryInputWidget code, tear out dead/broken redirect handling that should be rewritten
Category redirect stuff is currently broken because of I5c536697, but no one seems to have noticed.
Fix bug 69886 while we're here

Bug: 69886
Change-Id: I62cf23d0e86bc43d739bb4c4610a5a852146fa3f
2014-09-10 23:21:12 +01:00
jenkins-bot d4f1f6ca7a Merge "Update LinkCache in MWTitleInputWidget" 2014-09-10 19:09:05 +00:00
Alex Monk 674f64dbaf Properly mark reference search index as empty when setting internal list
If it didn't get marked otherwise

Caused by I56909801

Bug: 70611
Change-Id: I81bca8f471c6685e48a7d3768f473a6faf5d8459
2014-09-10 00:13:42 +01:00
Alex Monk 056ef20a96 Update LinkCache in MWTitleInputWidget
Bug: 69886
Change-Id: If7439ea6f60533f8c3166ba4a24656ead0acc6cd
2014-09-09 23:08:14 +01:00
James D. Forrester a8180fe3c7 Provide contextual help for the page settings dialog's controls
Bug: 51798
Change-Id: Ief3c52e504a08d255a8778af6e24785d35154898
2014-09-08 19:22:44 +01:00
Bartosz Dziewoński 8e84d75383 Make it possible to create autonumbered external links from link inspector
Inserting a new external link from the link inspector when nothing is
selected (collapsed selection) will now produce an autonumbered external
link ('link/mwNumberedExternal' node, corresponding to wikitext
"[http://example.com]"). It used to produce annotated link text
('link/mwExternal' annotation, corresponding to wikitext
"[http://example.com http://example.com]" or "http://example.com").

Depends on two commits in VisualEditor/VisualEditor:
* Icc2e368a to insert unannotated content from the inspector.
* I40cd4d5a to insert non-text content from the inspector.

Bug: 51309
Change-Id: Ie4a633ed42907551337a62d96d0abd59e208d49d
2014-09-05 16:48:55 -07:00
jenkins-bot 5f71ecc80f Merge "Abort promises before sending new ones in MediaSearchWidget" 2014-09-05 22:56:18 +00:00
Moriel Schottlender 2e03a8276e Abort promises before sending new ones in MediaSearchWidget
Before sending new searches to the API, abort the previous ones if
they were not resolved. This will assure that the result presented
on the screen is valid to the latest search that was done even if
the user types quickly and sends many async requests simultaneously.

Bug: 67438
Change-Id: If88123019bfa972520e9db7c627a7f4cd8fc2526
2014-09-05 18:51:30 -04:00
Roan Kattouw e92e4912fe Followup cb86c4f: fix call to renamed setChanged() function
setChanged() was renamed to checkChanged(), but one call wasn't
updated. This was causing JS errors in a documentUpdate event
handler, which caused pawn nastiness.

Bug: 70450
Change-Id: I71e576638f9e2fde450f4412229cf980e6ba7e10
2014-09-05 14:50:24 -07:00
Moriel Schottlender ae4511a02b Hide "no results" messaage in media search widget
After resolving the search queries to the API, make sure to display
or hide (!) the "no results" message.

Bug: 67438
Change-Id: I518fbf5ae18bb2265710600516d556c60e2b4924
2014-09-04 19:03:03 -04:00
jenkins-bot 4be972799f Merge "Rename $label to $labelElement in MWParameterPage to avoid naming conflict" 2014-09-04 21:07:41 +00:00
Moriel Schottlender cb86c4f030 Check for changes in the model
Create an image model hash and check for changes to the image every
time the dialog is changed, so we can activate and deactivate the
apply button properly.

Bug: 68058
Change-Id: I94b7e4879c6e752432c6f937a8cf1b9f15d1b56d
2014-09-04 14:05:01 -07:00
Alex Monk 160d99d9f4 Rename $label to $labelElement in MWParameterPage to avoid naming conflict
Causing the label of each parameter to be missing ($label actually gets sent to the outline item
widget, for some reason). Looks like it was caused by I1abecd8a.

Bug: 70406
Change-Id: I598ffe5066d0ae8267324d4125d05514449064d5
2014-09-04 22:02:28 +01:00
James D. Forrester f2e22babaa Update VE core submodule to master (1f82a47)
New changes:
5d063a2 Don't use three different coordinate systems in getSelectionRect()
feeb1ae Only focus the paste target if focusedNode has changed
2c1bb97 Update OOjs UI to v0.1.0-pre (4cef83f702)

Local changes:
* Update references to renamed classes
* Update calling patterns element mixins

Change-Id: I330c0e308807597dec31dad8dbf713eb29fdc290
2014-09-03 17:20:09 -07:00
jenkins-bot bfbe8cbbeb Merge "Shrink height of summary box in save dialog from 80px to 4em" 2014-09-02 20:25:00 +00:00
jenkins-bot 567b0e7d53 Merge "Use combo box widget to suggest existing values for reference group" 2014-09-02 20:21:32 +00:00
James D. Forrester 0637104a17 Shrink height of summary box in save dialog from 80px to 4em
Change-Id: Ifd40bb19c7b57bab15c127d2de16940f9a239235
2014-09-01 12:06:22 -07:00
Alex Monk 802b018133 Use combo box widget to suggest existing values for reference group
Bug: 61574
Change-Id: I2ab47e79a8b90db8631d042c80b0759e9c250523
2014-08-30 02:33:04 +01:00
Alex Monk 14b23d7ba4 Make sure mediawiki.notification is loaded -before- calling ViewPageTarget#checkForWikitextWarning
That function needs to return the result immediately, not wait for module loading (via mw.notify).
This was breaking us being able to keep track of what wikitextWarning object was in use (but only
the first time we used the module), and therefore fail to close the warning when the wikitext
disappeared.

Bug: 70168
Change-Id: I0f1427423a5fe82ec8e70e2f0462a3044ca7ace8
2014-08-29 21:18:24 +01:00
jenkins-bot f79d099490 Merge "In LinkTargetInputWidget, put existence status into LinkCache" 2014-08-28 22:17:03 +00:00
Alex Monk 51d2de4547 In LinkTargetInputWidget, put existence status into LinkCache
Bug: 69886
Change-Id: Ib37ba971c006c0bedc94f3ea9f1185461c9617b5
2014-08-28 23:09:13 +01:00
James D. Forrester adb0593c92 Update VE core submodule to master (be42edf)
New changes:
7a2e989 Update OOjs UI to v0.1.0-pre (43f379c884)

Local changes:
Eliminate all references to Agora, now Minerva

Change-Id: I497e122a35090a909b1fbb00d0a9487d97e09da1
2014-08-28 13:51:10 -07:00
jenkins-bot 1135d066ac Merge "Make the image model persistent" 2014-08-28 16:08:03 +00:00
Moriel Schottlender e34fdae776 Make the image model persistent
Make sure the image model can switch parameters when the image
source is switched, rather than having to instantiate a new
image model.

Also, when the image is changed, retain aspect ratio but make sure
to preserve the width of the previous image (unless the new image
is smaller)

Added 'resizeToBoundingBox' and 'scaleToThumbnailSize' static methods
in MWImageNode that return scaled dimensions based on the image
dimensions and the bounding box detals.

Depends on core change Idbb8b29db8e

Bug: 69450
Bug: 68000
Change-Id: I4327c86a9127f46da5522dc1197411fda757d5a4
2014-08-28 12:04:49 -04:00
jenkins-bot d220e03cf8 Merge "Link target input widget: Make '' an invalid link target" 2014-08-28 00:04:43 +00:00
Alex Monk c71d06f1e0 Toggle trash button (on transclusion dialog) visibility when changing to non-parameter pages
Bug: 70101
Change-Id: Id18f910ea9f96121584ece0270dda3f8529478dd
2014-08-27 21:00:34 +01:00
Alex Monk 5e5cfc19d9 Link target input widget: Make '' an invalid link target
Bug: 70015
Change-Id: Ia984b88009a6373223fb9378b9a10e8313c8b22e
2014-08-27 18:36:08 +01:00
jenkins-bot 323fb9e712 Merge "Remove delete button from required parameters in template dialog" 2014-08-27 10:04:39 +00:00
jenkins-bot 5d482e16af Merge "Make the Resolve conflict button actually appear" 2014-08-27 01:08:44 +00: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
Derk-Jan Hartman a270fc396d Categories: Don't suggest empty or old categories
The categories table holds all categories that exist OR have at one
point existed. This means it also contains a lot of vandalism and
other inappropriate names that happily come up in the suggestions.
This is undesirable. This changes the query to only list categories
with at least 1 entry.

Though technically it can be argued that an empty category with an
existing page might 'exist' and should thus be listed, with this
change they won't be. I don't think that is terribly incorrect to
say that such would be a 'new category', but we could also consider
renaming the label in the suggestion list to say:
'Currently unused category' or something similar.

As far as I can tell there is no way to test for page existance OR
generate a list based on allcategories with one API query.

Bug: 70025
Change-Id: I0e195d3ce26e69d4710d6a505b9da7d1b7678d92
2014-08-26 11:25:54 +02:00
Alex Monk 11fef44a08 Remove delete button from required parameters in template dialog
Bug: 60358
Change-Id: I5d03f466475bfafd4569480431969f5001365eb8
2014-08-26 01:39:51 +01:00
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
Trevor Parscal c446a164b1 Select the correct annotation in MWLinkTargetInputWidget
The solution to this problem was two-fold:
* Initialize the menu selection based on current annotation data
* Don't re-open the LinkTargetInput suggestions menu after choosing

It unfortunately involves assuming that setAnnotation will always synchronously emit 'change' events.

Bug: 65343
Change-Id: Ia92751add5ee59ba581141a31c8433c5e7e521a5
2014-08-22 00:09:53 +00:00
jenkins-bot 30bccf6ce3 Merge "Only build reference search index when it's been changed" 2014-08-21 01:56:06 +00:00
jenkins-bot df85006b03 Merge "Refactoring ImageModel constructor" 2014-08-21 01:54:46 +00: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
James D. Forrester 5148a0836a Rename "reference list" to "references list" internally
That's what we call them in human-speak, and it makes sense to have them align.

Bug: 49923
Change-Id: I8dcfba249fb9ea13c2b4052e98a4d253c302b1ba
2014-08-20 18:26:54 -07:00
Moriel Schottlender 88a0790aab Refactoring ImageModel constructor
This change creates the scalable object that's attached to the image
model through its constructor. Also adds a 'resourceName' variable
to store attributes.resource, which is mostly used for API calls.

Change-Id: I713c59d1cec5f87387a87c98a59e75b3d5c1050e
2014-08-20 18:13:12 -07:00
James D. Forrester 97c0894379 Label 'insert' buttons with just "Insert" instead of varying by content
Depends on VE-core change I23b0772a

Change-Id: Ia8fb88d3501ffa2c26add4419da5463a926f45d1
2014-08-20 14:23:57 -07:00
Roan Kattouw fbd7923741 Make MWMediaDialog not crash on API errors
resp.query won't be set if resp.error is set instead.

Also rename alignButons to alignButtons.

Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
2014-08-16 00:30:16 -07:00
Ed Sanders 03231e5a1c Fix teardown of live extension nodes
* Separate teardown into (insertOrUpdate|remove)Node
* Override insertOrUpdate completely to avoid generating
  extra transactions. Surface#applyStaging creates all the
  transactions we need.
* Override remove to popStaging before calling parent.
* Fix isEmpty check to use getInnerValue (ignoring whitepsace)

Change-Id: I903302af178d6f923de00aff9c58e5330d682813
2014-08-15 17:40:25 +01:00
Bartosz Dziewoński ede9dfcbb1 Rename MWLinkInspector → MWLinkAnnotationInspector to match file name
There is a MWLinkNodeInspector too, renaming the class instead of the
file to avoid name confusion.

Change-Id: Idaa26503ecd9b0fd0903937bb209397672138054
2014-08-13 16:20:15 +00:00
Moriel Schottlender c4c5add175 Fix bad jquery 'append' calls
There are several incorrect usages of jquery .append() method that
uses an array instead of an argument list. This isn't the proper use
of the method and while it does work now, according to Krinkle,
this might stop working in the near future.

Also see I76decb67db086bb387 for the same fix in ve-core.

Change-Id: I78a0d54ad76ab5401bc0532e636a9aaa2c0c0e04
2014-08-12 22:57:11 +00:00
Amir E. Aharoni 268c8677ee Flip direction buttons in media dialog in RTL
Flip the order of the buttons in the alignment widget
so that they display the directions correctly in both
ltr and rtl.

Bug: 69165
Change-Id: I7bd1d6c89aaef09492ae07eadababd68305b245e
2014-08-06 14:09:43 +01:00
Alex Monk e74e32b5af Tear down meta dialog pages when cancelling
Currently it's only being done when applying, caused by Ia74732e6. We
need the teardown event to reach the page so they can do things like
clear categories.

Bug: 68484
Change-Id: I6c31229121c1477a55ce955354770ed7cdde470d
2014-08-05 16:24:26 +00:00
Alex Monk 79d953f6b0 Only build reference search index when it's been changed
Using the same tricks as ve.ce.MWReferenceListNode... Like listening to list
node updates, which will probably catch unrelated changes? I'm not sure about
this.

Bug: 68890
Change-Id: Id9443c9574063933bc8fb35d09ab8b80b69bcd44
2014-08-04 14:05:36 +01: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
palerdot 0e3ccfaf94 MWLinkTargetInputWidget: Add styles for invalid link titles
This color is chosen because it is already present as a warning color in
other mediawiki elements like remove button in Link Inspector. A font
weight of bold is also given to make it more prominent.

Things done for this commit:
* A new CSS file 've.ui.MWLinkTargetInputWidget.css' is added.
* Warning text style is added to the class
  '.ve-ui-mwLinkTargetInputWidget-warning' in this file.
* The CSS file is included in the style resources in the
  file 'VisualEditor.php'.

Tested in latest stable firefox, chrome in Ubuntu 14.04.

Bug: 62761
Change-Id: I89e96e0444f8505123f3c653cf2dd6b74fc83623
2014-07-31 18:45:03 +00:00
jenkins-bot ee56ea0ed9 Merge "Use whitespace preserving text input in extension inspector" 2014-07-31 17:38:37 +00:00
jenkins-bot 06e883f66b Merge "ve.ui.MWMetaDialog: Really *ALWAYS* return to normal tracking behavior" 2014-07-31 07:51:26 +00:00
Bartosz Dziewoński bcd9c56701 ve.ui.MWMetaDialog: Really *ALWAYS* return to normal tracking behavior
This #getActionProcess method is kinda weird… introduced in fbdff762.

Bug: 68901
Change-Id: I5007a379445b286884814557a85c6efea5e5d4cc
2014-07-31 09:30:00 +02:00
Moriel Schottlender e095b773b9 Use $.when() in MediaSearchWidget
Use $.when() to check if there were results to the search. This
also makes sure that the 'results not found' message only appears
when it actually should.

Bug: 65321
Bug: 67438
Change-Id: I437ef639918ace1041bb8c9f7fdd04a4e83885eb
2014-07-30 18:35:01 -07:00
jenkins-bot e8b49ad0b6 Merge "Unselect currently selected item in re-use citation dialog when reopening" 2014-07-31 00:40:39 +00:00
jenkins-bot d449c42058 Merge "Follow-up I569098: Rebuild reference list when reopening as it can change" 2014-07-31 00:39:39 +00:00
Alex Monk 3532497fa2 Follow-up I569098: Rebuild reference list when reopening as it can change
Filed bug 68890 for fixing the performance regression from this.

Bug: 68869
Change-Id: I0564c7a9c61d33cdc8b61b2e69d01733b06de32f
2014-07-31 00:37:33 +00:00
Ed Sanders daf79d9984 Use whitespace preserving text input in extension inspector
Depends on I019b37dc1 in core.

Change-Id: I4e0424b01b10910ad3e05bd9d41776059e1e9653
2014-07-31 00:01:05 +00:00
Alex Monk 1b873a8ed2 Don't clone internal item node element used for references in re-use citation dialog
It won't be ready at this point

Bug: 67342
Change-Id: Ic1bdc3df8f159cef736b00fbefc6f879a7dcd658
2014-07-31 00:54:06 +01:00
Alex Monk 95d0d2c055 Unselect currently selected item in re-use citation dialog when reopening
Bug: 68582
Change-Id: I81cb6fe901cde5a0e4669c741a0a7c317f1c8ed9
2014-07-30 22:42:36 +01:00
jenkins-bot fac659d46c Merge "Reduce bottom margin of reference names" 2014-07-30 19:14:41 +00:00
jenkins-bot 2ab168efe7 Merge "MWMediaSearchWidget: Use json/jsonp for local/foreign api respectively" 2014-07-30 17:13:42 +00:00
James D. Forrester 1fcc9fa035 Update VE core submodule to master (61dea59)
New changes:
76bbf3b [BREAKING CHANGE] Fix camel-casing of countNonInternalElements

Local changes:
Use renamed countNonInternalElements function

Change-Id: Ib5f86ea5cfeb5e577f61349ed4bbb231ea155638
2014-07-29 17:15:35 -07:00
Moriel Schottlender 2411a174e4 MWMediaSearchWidget: Use json/jsonp for local/foreign api respectively
In the media search widget use 'json' for remote searches and
'jsonp' for local searches.

Bug: 64822
Bug: 67749
Change-Id: Iccc9adb1261602f4bc7426f1caf5aed87aad51e5
2014-07-29 23:55:36 +00:00
jenkins-bot 3783d6e328 Merge "Remove unused CSS classes" 2014-07-29 23:30:22 +00:00
Moriel Schottlender 50dae0ab16 Focus the caption surface on initialization
Whenever the edit mode is active, focus the caption surface. This
is also true for cases where the dialog starts in the 'insert' mode
and then switches to 'edit'.

Bug: 68806
Change-Id: I60b862dc5738a65a6bb31eb32184c35cc108b232
2014-07-29 15:34:09 -04:00
Ed Sanders 840c871a97 Remove unused CSS classes
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
2014-07-28 19:43:35 +01:00
Ed Sanders c23cebd5f6 Comment used messages
Change-Id: I22594b11f06f349c43162d52646a5c647c6ad0a3
2014-07-28 13:08:39 +01:00
Ed Sanders b1257d60a8 Reduce bottom margin of reference names
The bottom margin makes refs with name noticeably taller than
others, however a small margin is required to stop the second
line of text wrapping too tightly.

Change-Id: Iae7e1e6ee29d9090e54aa05feda1854828a03d9d
2014-07-27 13:23:06 +01:00
Ed Sanders 61d40bd5ac SVG fixes
* Fix encoding
* Remove unused attributes
* Fix some IDs
* Fix pixel snapping in gallery icons

Change-Id: I084b3d7e3e5ba9b4ec234b94622cac076c7665e1
2014-07-26 18:38:11 -07: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
jenkins-bot 04abfb3e79 Merge "Revert "Provide contextual help for the page settings dialog's controls"" 2014-07-24 02:12:35 +00:00
Jforrester f84c33f074 Revert "Provide contextual help for the page settings dialog's controls"
This reverts commit 9ba9b35b41.

Change-Id: I95dd24ec94f4e0ecc3a32fbcdac689cee4116ed5
2014-07-24 02:09:27 +00:00
jenkins-bot 9774ceed20 Merge "Bump the height of the references list a little" 2014-07-24 00:43:02 +00:00
jenkins-bot 3771aa92c1 Merge "Make the image model work without a node" 2014-07-24 00:32:54 +00:00
Moriel Schottlender 1bc7d074fe Make the image model work without a node
The image model should go by image attributes (whether it comes from
an existing node or a new one) and not a node.

Bug: 68242
Bug: 68000
Change-Id: I4cabd678157619331b3c47d3b44bc16a28fd7bd7
2014-07-23 17:27:30 -07:00
jenkins-bot c7026baf26 Merge "Defer building of MWReferenceSearchWidget index" 2014-07-24 00:27:16 +00:00
James D. Forrester 833baef313 Bump the height of the references list a little
Bug: 68226
Change-Id: Ic3c7b31dcaa6f7f8da3d86efab8c7ab94f4b1e62
2014-07-23 17:24:21 -07:00
Roan Kattouw 71dd2bf852 Actually document .static.nodeModel in MWExtensionInspector
Undocument abstract static properties are bad.

Change-Id: Iae19fb83840fe7edaaaa5e80dff092064dc76361
2014-07-23 13:49:39 -07:00
Ed Sanders d8d3a8c98e Defer building of MWReferenceSearchWidget index
It can be very slow on pages with lots of references and
isn't required until you click 'Use existing reference'.

What is required is knowing if the list will be empty for
greying out the button, but that can be precomputed very cheaply.

Change-Id: I56909801a5685bb04e0c83cfb95463f705b8dfae
2014-07-23 15:12:31 +01:00
jenkins-bot 960922cdb0 Merge "MWReferenceSearchWidget buildIndex optimisations" 2014-07-23 02:23:43 +00:00
jenkins-bot e9f78820c3 Merge "Fix reference dialog focus" 2014-07-23 02:08:32 +00:00
Ed Sanders 24c322a124 Use native focus
It's faster.

Change-Id: I0a8a2452aa987e2b93c5c8ba3c6efa2bcafbaa86
2014-07-22 19:05:14 -07:00
James D. Forrester 27c30322ed Clamp height of MWReferenceDialog to between 300 and 400px to avoid it being too small
Bug: 68232
Change-Id: If32edc5622565b28ae1f6a2423a7c2289965733c
2014-07-22 18:57:39 -07:00
jenkins-bot 08c3f6be04 Merge "Provide contextual help for the page settings dialog's controls" 2014-07-23 01:43:54 +00:00
James D. Forrester 9ba9b35b41 Provide contextual help for the page settings dialog's controls
Change-Id: I5c24d7f41ce33d1145f8bfbfd60bd78d08df39ce
2014-07-22 18:41:17 -07:00
jenkins-bot 55dcb46311 Merge "MWLinkNodeInspector: Actually preserve annotations when converting to link annotation" 2014-07-23 00:44:43 +00:00
jenkins-bot f7c7efbad7 Merge "test: Move mw into the global list of globals for VE-MW" 2014-07-23 00:02:22 +00:00
jenkins-bot 016c93c29b Merge "Auto-open "Add parameter" part of template dialog when tabbed to or opening with no required/suggested params" 2014-07-22 23:37:41 +00:00
James D. Forrester a9356992d8 Put "re-use reference" in the toolbar "Cite" menu, and give it an icon
Bug: 68201
Change-Id: I9fc61e498748fb086c3e506959bee2438b8cbea6
2014-07-22 13:10:06 -07:00
jenkins-bot 107ce12f9d Merge "Fix heights of Reference, ReferenceList and Template dialogs" 2014-07-22 16:11:39 +00:00
Alex Monk 42db347213 Auto-open "Add parameter" part of template dialog when tabbed to or opening with no required/suggested params
Bug: 55925
Change-Id: I8475074e25de3969717a6d4dbb88bbb0000ebb4e
2014-07-21 22:38:05 +01:00
Ed Sanders d4cd816b6f MWReferenceSearchWidget buildIndex optimisations
* Each item builds an MWReferenceModel which creates a document
  slice clone. This is very expensive and we only use the model
  for getting basic attributes, so defer the evaluation of the
  document.
* $.show is expensive and, in this case, unnecessary.

Change-Id: I99abc4c1b17f05559a9cae68b15121a8be6d23fb
2014-07-21 14:44:58 +01:00
Ed Sanders 9bc8d07486 Fix reference dialog focus
Wasn't migrated to processes.

Change-Id: Idb5f614c172378aad5d37bf8f726adad338c3eb1
2014-07-21 13:58:48 +01: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 ed82afc14c Fix heights of Reference, ReferenceList and Template dialogs
Bug: 68226
Bug: 68232
Change-Id: I93916875a6b4b1e7b837efce33a9aa20857f227a
2014-07-18 19:14:30 -07:00
James D. Forrester cc089d6bd3 Scrap the cancel button from the toolbar
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
2014-07-18 16:38:17 -07:00
Moriel Schottlender 2a114815ab Listen to widget changes in MediaDialog
Attach event listener to the alternate text and the media size widget
in the MediaDialog, so that when either of those are changed the
'Apply Changes' button is enabled.

Related to I88c3f3dcc7667b3ffdd2a8a8433cb47b82ba1531

Bug: 67684
Change-Id: I03efbed2f9b2909b055d96b9ae1e27b6d5e2bdbf
2014-07-16 22:46:47 +00:00
Moriel Schottlender e94a185fda Update VE core submodule to master (ad18102)
New changes:
65042de Fix alien test data
83dccbe Add toolbar menu labels to each group for consistency
2e40ef9 Move 'language' tool from the insert to the styling menu, like in VE-MW
6fb21b2 Add toolbar action section to SA demo with keyboard shortcuts tool
f3eb000 ve.ui.Toolbar: Optimise onSurfaceViewKeyUp performance
eb4e9eb Make sure the document is focused when setting a selection
48584d3 Fixes to getRelativeOffset and getRelativeRange		
fcc427f [BREAKING CHANGE] Remove generatedContents argument from afterRender
825e4be Documentation fixes in test utils		
dbbbe0b Unit tests for showSelection		
1ba9234 Don't handle up/down on focusableNodes even if backwards
a667b87 Remove label from 'insert' menu, and instead use a large plus icon
88885b1 Localisation updates from https://translatewiki.net.		
1f3b79f Initialize data first		
18369b1 Add 'clone' and make 'getDimensionsFromValue' static in ve.dm.Scalable		
92e6b7b Switch to 'custom' when MediaSizeWidget updates		
d0cd87e Localisation updates from https://translatewiki.net.		
1ee21ff Remove lies from documentation		
164f07f Safely ignore requests to open unrecognized windows

Local changes:
Work on a cloned scalable when editing images

Make sure the image model handles a cloned copy of the node's
scalable object, which is then shared with the media size widget.

Bug: 67687
Change-Id: Ie3676b715f5bae3d83da03d667cef3a6a847e212
2014-07-16 22:38:09 +00:00
jenkins-bot de9491ea0e Merge "Make a message dialog for cancelling VE" 2014-07-16 20:45:28 +00:00
jenkins-bot 1c099f4184 Merge "Always initialize data before use" 2014-07-16 00:52:09 +00:00
Alex Monk 54a1a85e6e Make a message dialog for cancelling VE
Confirm dialog was replaced in refactor, so until this is merged the 'Cancel'
button is broken.

Bug: 68068
Change-Id: I77d1c82bf0d68013eef361174a134860a197cd44
2014-07-16 00:07:24 +01:00
Bartosz Dziewoński 5ed43c266a MWLinkNodeInspector: Actually preserve annotations when converting to link annotation
This was implemented, but didn't work because the node was removed
before its annotations were copied.

Also fixed:
* Don't do an unnecessary transaction to change attributes of a node
  we're going to remove anyway.
* Apply the same link href fixups when converting as when not
  (previously, changing the href to 'example.com' and clicking "Add
  label" would break the link in interesting ways).
* Do a single transaction from replacement instead of removal+insertion
  when possible.

Bug: 67377
Change-Id: I0318ae62c799300fb7696506a9736b839e2c8578
2014-07-16 00:50:23 +02:00
Trevor Parscal f30336bc2e Always initialize data before use
LinkNodeInspector was broken when you clicked away/pressed escape, because data was not set.

Normalizing on data being initialized at the top of get*Process methods if used.

Change-Id: I89728ac558545a6f2c325014b6f457ec6bef17b8
2014-07-15 15:49:51 -07:00
jenkins-bot a9b757a174 Merge "MWTitleInputWidget: Remove prefixColon option and use relative title instead" 2014-07-15 22:10:42 +00:00
jenkins-bot a5e1cfcf78 Merge "ve.ui.MWExtensionInspector: Prevent from setting impossible content" 2014-07-15 22:09:06 +00:00
Trevor Parscal 8ebea5a75b Close the citation dialog after the apply changes button is clicked
Change-Id: If3976389f0a1574fce993f5b79b9b18067a88878
2014-07-14 17:09:24 -07: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
Alex Monk 3acca7cdf5 Fix cite/template dialogs
I1a7fc7f2 broke cite/template dialog - onDescriptionClick is not defined.
I can't find it anywhere in the VE-MW or OOUI source.
Before my change, it was simply a no-op. But now we try to bind it in a way
that breaks everything. This commit just removes that line since it was
apparently not doing anything.

Bug: 67814
Change-Id: I0b9c3318b3de8530e0ba9e355cd73eb7f70a6b5a
2014-07-10 21:37:07 +01:00
jenkins-bot 6d8e900d57 Merge "Replace ve.bind( fn, ... ) calls with fn.bind( ... )" 2014-07-10 14:11:43 +00:00
Alex Monk 51142e8b11 Replace ve.bind( fn, ... ) calls with fn.bind( ... )
Bug: 62762
Change-Id: I1a7fc7f27fa737d17f5c6b3d084ef4a35e4bebc0
2014-07-10 13:54:07 +00:00
Timo Tijhof fd83cafa4b MWTemplatePage: Account for template.title being null
Example:
* Transclusion with html comment in target
  {{ Unsigned <!-- ignored -->  |Example}}.
* Transclusion with wikitext expression as target
  {{ {{echo|Unsigned}} <!-- ignored -->  |Example}}.

The first case was handled already (Parsoid strips the comment
when it normalises the target title). The second case, however,
is not handled and ends in template.title being null.

This was already documented (MWTemplateModel#getTitle returns
{string|null}), but not used correctly.

The title of the dialog is unaffected as it fallsback to
displaying target.wt instead of target.title.

Bug: 66724
Change-Id: Ib6696ac3538f6cb9e93da2f6f8666f373247eeb4
2014-07-10 13:49:41 +00:00
Moriel Schottlender c2c046620b Apply 'original size' to images and enable apply button in ve-MW
Depends on core change I243cff5a2d56db48882c343a8bb91153edd96a43

Bug: 66863
Change-Id: If7914c254b70f4b2b9e2788f5755550eb020b21c
2014-07-08 13:11:07 -04:00
Alex Monk 2669f12289 MWTitleInputWidget: Remove prefixColon option and use relative title instead
See Ie554adef which implements this as a method on mw.Title instead.

Bug: 67386
Change-Id: I0d768fac338aed04fd2c0e4e8da8d556f94a4287
2014-07-07 21:59:12 +00:00
Bartosz Dziewoński bba6ac20bd ve.ui.MWExtensionInspector: Prevent from setting impossible content
XML-like tags in wikitext are not actually XML and don't expect
their contents to be escaped. This means that (usually) it is not
possible for a tag '<foo>…</foo>' to contain the string '</foo>'
(see bug 57429 comment 4 for details).

Prevent the user from doing that by escaping the first angle bracket
'<' to '&lt;' in such inputs when the inspector closes.

Bug: 57429
Change-Id: Ia566452ae0ffc9caa3ea48a52e5b8032c33fc9c8
2014-07-04 18:09:04 +02:00
jenkins-bot 7228f6b84c Merge "Followup 54458c8: make newly RTFified icons actually work everywhere" 2014-07-03 02:59:15 +00:00
Roan Kattouw 30b245ff64 Followup 54458c8: make newly RTFified icons actually work everywhere
Right now our system is so horrible that we need three separate
CSS rules to make the icons appear in three separate places:

1. Toolbar (with contextual directionality)
2. Context menu
3. Top-left corner of dialogs

Also, the icons in the context menu should use contextual directionality
but are using the document directionality because the context doesn't
compute and set a class for the context directionality. This is only
done by the toolbar. It used to work because the context menu *was*
a toolbar, but that changed recently.

Change-Id: I3ebc1ba7dfcd384a2a62664e55a4a77c8dedd513
2014-07-02 19:54:07 -07:00
jenkins-bot 410f36d2d9 Merge "Try some more to handle template namespace properly" 2014-07-03 01:23:47 +00:00
Alex Monk c6396e019e Try some more to handle template namespace properly
Looks like I messed up in Ia67f9054 and got a setting backwards

Also prefix titles in a couple more places

Bug: 67384
Bug: 66893
Change-Id: Id6d5841ee1645be62a024308da48ddc6769c78b6
2014-07-03 01:20:02 +00:00
jenkins-bot 329b4decd3 Merge "Followup 26fd3777: hide "Go back" in insertion mode" 2014-07-03 01:14:50 +00:00
jenkins-bot c1200d7973 Merge "UX Improvements to the Media Dialog" 2014-07-03 01:14:42 +00:00
Roan Kattouw 1261ad4b3d Followup 26fd3777: hide "Go back" in insertion mode
"Go back" should only be shown if there's something to go back to.
So it should be visible if you came from "Change image", but not
if you came from "Insert media".

If the "Go back" button is hidden, the footer is empty, so hide it
completely in that case. Hiding the footer is tricky due to how
dialogs position things, so I hacked around OO.ui.Dialog's lack
of an API for toggling the visibility of the footer.

Change-Id: Ic97c4a2bf7beaa240e5a4dfda1e605752e1f4189
2014-07-02 18:00:58 -07:00
Moriel Schottlender 26fd3777e2 UX Improvements to the Media Dialog
In this fix:
* Adding 'go back' button to appear in the search panel.
* Hiding/showing the correct buttons within each panel.
* Disable the 'apply' button, and only enable when changes are done.
* Load the search query API and send API requests only when the
  search panel is up.
* Make sure the search query is updated with the page name every
  time the search page is loaded

Bug: 67443
Change-Id: I635986f30579c6358e0cc6fe54fbf97f49c83465
2014-07-03 00:43:02 +00:00
Roan Kattouw 8bd8c6c8f5 Followup 54458c8: take directionality for parameter icons from frame, not toolbar
The parameter icons are not toolbar-contextual, so don't style them that way.
Instead, have them take their directionality from the .oo-ui-{ltr,rtl} classes.

Change-Id: Ic94b1e854b36542f7bcde97ead60eddcd56ccbea
2014-07-02 12:24:00 -07:00
jenkins-bot 538992a24c Merge "Merge Media Edit and Media Insert dialogs" 2014-07-02 02:53:05 +00:00
Moriel Schottlender 6bd9fde5c5 Merge Media Edit and Media Insert dialogs
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
2014-07-01 17:30:51 -07:00
James D. Forrester 54458c8c7a Provide RTL variants of eight icons
Per bug 63593. However, this does somewhat bloat our payload.

Change-Id: Id98d585dfcacf01941808c228800ee2bf2c559fb
2014-07-01 17:03:42 -07:00
James D. Forrester df768be558 Run node-svgo to crush all SVGs whilst retaining readibility
svgo --pretty \
     --disable=removeXMLProcInst \
     --disable=cleanupIDs \
     --disable=collapseGroups \
     -f …

Change-Id: I45757c9667e4a7413bcef7b23808f20a60e592ca
2014-07-01 16:58:05 -07:00
James D. Forrester f9e74d3c62 Move reference tool into Cite menu, and language into styling
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
2014-06-30 19:24:15 -07:00
jenkins-bot 87663c99e0 Merge "Offer to retain changes when switching to the wikitext editor" 2014-06-30 23:40:30 +00:00
jenkins-bot 84650bf774 Merge "Handle transcluding templates outside of the template namespace properly" 2014-06-30 19:39:06 +00:00
jenkins-bot f5c71b4be6 Merge "Set tabindex for template dialog info/remove buttons on parent <div> rather than <a>" 2014-06-30 18:18:06 +00:00
jenkins-bot 4292428021 Merge "Fix colour of new cite icons" 2014-06-28 23:54:55 +00:00
jenkins-bot 3b8f8507f8 Merge "Set XML encoding to utf-8 in SVGs" 2014-06-28 23:53:59 +00:00