Commit graph

3598 commits

Author SHA1 Message Date
Inez Korczyński 0f380f1fc5 (bug 49837) Handle correctly figure tags with typeof="mw:Image"
Change-Id: I6bc74973671e7046130278b9658bb8f6f62904a1
2013-06-19 21:15:30 +00:00
Ed Sanders 8d2ba6effe Add resource attribute to newly created images
Bug: 49596
Change-Id: Ifbde0f5a4c8eb01df7b429abbb8ab0d4431c1c6f
2013-06-19 20:47:14 +00:00
jenkins-bot 3d98a73cba Merge "One method onAttributeChange in ve.ce.MWBlockImageNode is plenty" 2013-06-19 18:47:05 +00:00
jenkins-bot cd2d6d1663 Merge "Fix inconsistencies and errors with Dialog onOpen/Close" 2013-06-19 18:46:02 +00:00
Ed Sanders 0072e66183 Always float toolbar to top of page, not last branch node
The check for the toolbar not overlapping the last branch node
'fixes' an edge case where the user has scrolled too far, and
the viewport is shorter than the last branch. A more common
problem caused by this is that if the last branch is very tall
the toolbar disappears whenever you scroll past it.

Bug: 48662
Change-Id: I1c7662f2b6f1ced6f80dec16c6ed69a8cc0c06c8
2013-06-19 18:44:38 +00:00
Ed Sanders 1469575082 Fix inconsistencies and errors with Dialog onOpen/Close
Removed inherited (and often wrong) documentation, replaced direct
usage of onApplyButtonClick with more standard onClose handling,
and one case of calling the wrong parent method.

Change-Id: I86ed16860e996b42c141a6499eefb9084d759a72
2013-06-19 18:35:45 +00:00
Inez Korczyński c632bfc65b Ignore shortcut keys inside key press handler
Bug: 49732
Bug: 49760
Bug: 49816
Change-Id: I8f814a0f369c470038896041f157b3dbd0d7f1a7
2013-06-19 17:31:45 +00:00
Inez Korczyński 44c174734b One method onAttributeChange in ve.ce.MWBlockImageNode is plenty
Change-Id: Ibcf93047c93e411c6c7167720e5d92a311d647f1
2013-06-18 19:31:01 -07:00
jenkins-bot ebddcf9239 Merge "Transclusion editor template naming goodness" 2013-06-19 01:37:07 +00:00
Trevor Parscal ece74379de Transclusion editor template naming goodness
"Template" parts should be labeled with a normalized version of what you would actually write inside a set of curly brackets.

Change-Id: I4b9c541a01da86cb078d38012e5a9fead2fa233c
2013-06-18 18:33:58 -07:00
jenkins-bot 7289df9674 Merge "Make media insertion queries less horrible" 2013-06-19 01:19:43 +00:00
Trevor Parscal bf268e82a5 Make media insertion queries less horrible
Objectives:

* Clear this.titles when resetting, otherwise results are shown once and
  then blacklisted forever.
* Attach done() before always(), so done() gets called first and not
  after always() has dereferenced the request object.
* Remove use of imaginary variables like this.loading, which were never
  set, and were referencing even more imaginary methods on other imaginary
  objects like this.request.abort()...

Change-Id: Ifbe74346f68b6a91f425b56a2696fd1e46b61e02
2013-06-18 18:17:05 -07:00
Inez Korczyński a886952563 Support for editing captions of block images
Bug: 38129
Change-Id: I02207e78f5c28eaccd9bc97a48baa78280192255
2013-06-18 17:57:10 -07:00
jenkins-bot fedcf454a0 Merge "Added ve.ce.FocusableNode mixin to ve.ce.MWReferenceListNode" 2013-06-19 00:53:56 +00:00
jenkins-bot 89cc6f21fb Merge "Add templates from toolbar" 2013-06-19 00:27:08 +00:00
jenkins-bot 3d5c6f8b0f Merge "Fix transclusion button message" 2013-06-19 00:26:29 +00:00
Trevor Parscal 4a7503ac10 Add templates from toolbar
Change-Id: I0aa21bed13d1dbc693c1db03eab903af55a1517a
2013-06-19 00:23:23 +00:00
jenkins-bot a60e469b03 Merge "Handle media select widget empty queries properly" 2013-06-19 00:18:23 +00:00
Trevor Parscal 2044a5796b Fix transclusion button message
Change-Id: I90cdb600ffb6e7d80cf6042b50ef0bf8a22c6cbd
2013-06-19 00:17:46 +00:00
Trevor Parscal a8fcfb4a14 Handle media select widget empty queries properly
If the query is cleared, we should still clear all items and abort any
loading that may be going on. We should still not try and load results
for an empty query though.

Change-Id: If23c6e0469247b1c1c47ab85b9a5a010e8a4fe26
2013-06-18 17:11:38 -07:00
Roan Kattouw c027b43d04 Improve template title normalization logic
Only remove the namespace prefix if it's in the template namespace,
and prepend a colon for main namespace titles.

Change-Id: Ie910bae172274e36c7c9a675a631a0876ff13ed1
2013-06-18 17:09:46 -07:00
Trevor Parscal 1ee10790e9 Don't show Template: in the outline for template items
1. It's redundant and ugly.
2. We already have an icon.
3. It's unnatural for anyone used to working with templates.

Change-Id: I821e124158a14679e411324620dc9d7c40252383
2013-06-18 23:49:14 +00:00
Trevor Parscal 23b2da91fd Template and content adding
Objectives:

* Allow adding content or templates within a transclusion
* Add template placeholder to model and view which resolves to nothing
  when saving (thus disappearing if not resolved)

Changes:

*.php
* Add links to new messages and files

ve.ui.OutlineControlsWidget.js
* Organize controls into "adders" and "movers"

ve.ui.Widget.css
* Add styles for adders/movers sections of outline controls
* Make adders appear on hover to reduce clutter

ve.ui.Icons-*.css
* Add icon for "add item"

ve.ui.Dialog.css
* Add styles for add template fieldsets
* Make placeholder items in the outline italic

ve.ui.PagedDialog.js
* Pass adders config to outline controls

ve.ui.MWTransclusionDialog.js
* Add support for adding content and templates

ve.dm.MWTransclusionModel.js
* Add addPlaceholder method

ve.dm.MWTemplatePlaceholderModel.js
* New class, pretty much an empty part
* Using this makes the UI much easier to work with - no need to special
  case the outline control for new items
* Because it's not supported specifically in
  ve.dm.MWTransclusionModel.getPlainObject, it produces nothing and goes
  away naturally on apply

Change-Id: I3478560fb53ba2ccd3fb26bafb6a61e6415565eb
2013-06-18 23:37:44 +00:00
Roan Kattouw dfbd870e16 Fix copyDomElement issues
* Fix bug in MWTransclusionNode sometimes passing a NodeList rather
  than an array (caused an error because NodeLists can't be .map()ped)
* Use copyDomElements in ce.AlienNode as well

Change-Id: I11c6483d3c062047be80f75a3fac03f13bff9662
2013-06-18 23:37:09 +00:00
jenkins-bot 60da007ab9 Merge "Copy DOM elements properly, into the correct document" 2013-06-18 22:52:14 +00:00
Roan Kattouw dc798befcf Copy DOM elements properly, into the correct document
* Provide a utility for copying an array of DOM elements into a
  different document
* Copy the DOM elements returned in toDomElements(), otherwise weird
  issues arise when the same data is converted to DOM twice

Change-Id: Ie927420624f0d4af0692e18d1bc6f952c8013d61
2013-06-18 15:40:33 -07:00
Trevor Parscal c4791ceeae Make MWTransclusionModel#addTemplate take target object instead string
Change-Id: I6067e9de7d6029c36938b2758dffe4afdb0bf2ad
2013-06-18 15:19:10 -07:00
Trevor Parscal 0410b936e4 MWTransclusionModel: Make #getPartById support a param model id
Change-Id: Ia2829ef2c24f63ce46e05790aa089fca563bc563
2013-06-18 15:08:44 -07:00
Trevor Parscal 7c171ae0a5 Whitespace cleanup
Change-Id: I49417b95a6c4c2538715e09b74ed3607f6741c3a
2013-06-18 21:53:03 +00:00
Trevor Parscal e8d8308d9a dialog: Remove background color body
This was causing strange rendering problems, and it's really not even
needed.

Change-Id: I130e9e5c5f2c5ab99b5245de6c0243e9be9cf558
2013-06-18 21:52:43 +00:00
jenkins-bot 9ba2bab2de Merge "ve.ui.IconButtonWidget: Extend css transition from 100ms to 200ms" 2013-06-18 21:48:41 +00:00
jenkins-bot 61879a93ed Merge "ve.ui.LookupInputWidget: Hide lookup input widget menu when empty" 2013-06-18 21:46:39 +00:00
Trevor Parscal 00d5c41e02 ve.ui.IconButtonWidget: Extend css transition from 100ms to 200ms
Makes make it look nicer.

Change-Id: Ib7c1021a31f607b6e697f16fe797358c0167acee
2013-06-18 21:45:33 +00:00
Trevor Parscal db48513465 ve.ui.LookupInputWidget: Hide lookup input widget menu when empty
Change-Id: Iac397c2ddcb7ea54c751485bdd922f7b19494d1e
2013-06-18 21:42:41 +00:00
Timo Tijhof 01f9e560b4 mw.ViewPageTarget: Use ES5 methods instead of strict mode as test
In aaa5ad2 we introduced a feature test. However though we do require
ES5, we don't (yet) use strict mode. It is an easy and solid one to
feature test, but it the unfortunate reality is that IE9 does not fully
support ES5. Strict mode is among the features it didn't (correctly)
implement. As a result commit aaa5ad2 locked out IE9 completely.

Replacing it with a more explicit (and harder to maintain) test that
does pass in IE9. We now need to be very careful about using ES5
features in our code. It has to be in this list here to avoid breaking
in a browser that doesn't support it.

Change-Id: I77b623e15a0791bfaa2cd835e43107cefb3c25f5
2013-06-18 14:22:29 -07:00
jenkins-bot 8e4177c960 Merge "Only undo on MWMetaDialog close if small stack is non-empty" 2013-06-18 19:34:15 +00:00
jenkins-bot 4fdebb5679 Merge "doc: Tag ve.ui.Window static properties as inheritable" 2013-06-18 19:33:12 +00:00
Trevor Parscal 42f0321b84 Element fixes
Objectives:

* Make get$$ work with empty jQuery selections
* Reset the $items selection when clearing a group

Changes:

ve.Element.js
* Add existing context property to possible solutions

ve.GroupElement.js
* Reset this.$items after detaching them

Change-Id: I73b46649d7ecd5045941086c4e1bb3241c8f4ef3
2013-06-18 11:35:07 -07:00
jenkins-bot cea0c2e0b6 Merge "Store originalIndex instead of mwOriginal in Transclusions" 2013-06-18 18:24:14 +00:00
Timo Tijhof 48dd042068 doc: Tag ve.ui.Window static properties as inheritable
Also updated outdated reference to dialog in demo.

Change-Id: I6c9997d4b4059348b400f592d6ae95cd9f43996c
2013-06-18 11:22:27 -07:00
jenkins-bot 388faa8d58 Merge "Correctly distinguish between Deferred and Promise" 2013-06-18 18:01:38 +00:00
Roan Kattouw d5365d2b5a Correctly distinguish between Deferred and Promise
Deferred is read-write, Promise is read-only. Document and return
the correct types.

Change-Id: Icfd6efb07b222c73d49b97ddbfe6565b8542ad00
2013-06-18 10:56:56 -07:00
Ed Sanders 84fbd1db2c Only undo on MWMetaDialog close if small stack is non-empty
Added return boolean to ve.dm.Surface#breakpoint to indicate if
and transactions were pushed to the big stack. Use this value in
MWMetaDialog to see if we need to undo on close.

Added tests for ve.dm.Surface#breakpoint.

Bug: 49630
Change-Id: Ieb2e9e361afe057af93c4d374acc85df58bfb4c3
2013-06-18 16:55:03 +01:00
Ed Sanders 81bdb7cf3e Store originalIndex instead of mwOriginal in Transclusions
Slightly more efficient way of seeing if the template has changed,
and results in a cleaner set of data element attributes.

Change-Id: I1507520005bfb8a88bfa6038dac5c3b15506425d
2013-06-18 15:23:37 +01:00
jenkins-bot 2d4101168b Merge "Actually normalize page titles correctly in MWLinkTargetInputWidget" 2013-06-18 08:41:36 +00:00
Roan Kattouw 9c19bc385e Actually normalize page titles correctly in MWLinkTargetInputWidget
matchingPages contains titles with spaces, but .toString() returns titles
with underscores, so normalizing with .toString() is incorrect. Use
.getPrefixedText() instead.

This caused a bug in the link dialog where, if the link was an internal
link pointing to an existing page with a space in its name, the "New page"
section would be displayed but would be empty, and the link's target would
be displayed in the "Existing page" section but colored red.

Change-Id: I59d8b87b996d80da1b25124b942bd2b72ef50845
2013-06-18 00:37:17 -07:00
jenkins-bot 720fa978f9 Merge "Address Krinkle's review comments from I51c441d61" 2013-06-18 02:05:59 +00:00
Ori Livneh f11b9e8c79 Address Krinkle's review comments from I51c441d61
See <https://gerrit.wikimedia.org/r/#/c/69161/1/modules/ve/init/mw/ve.init.mw.splitTest.js>.

Change-Id: I14442070c0998d724d67ec41cca813ef5bce2c19
2013-06-17 19:04:27 -07:00
Roan Kattouw 177159b388 Test case for 95733390dc
Change-Id: I8c2e239e945466f3e46c92efab03f7e615bc6887
2013-06-17 17:13:45 -07:00
Roan Kattouw 95733390dc Use indexes in .children, not .childNodes, for attribute preservation
The difference is that .children excludes non-element nodes (text nodes
and comment nodes). These can't have attributes anyway, so there's
nothing lost by skipping them, and this way we avoid bugs where a
text node split causes the indexes to be off.

(Text node splits are probably due to an interaction between whitespace
preservation and paragraph unwrapping, and aren't necessarily bad. We
just shouldn't rely on indexes into .childNodes)

Change-Id: I905a50e1c299ebafcbd4eaa0f938b06a1b5849ff
2013-06-17 15:41:22 -07:00
Inez Korczyński b6fc9d9217 Added ve.ce.FocusableNode mixin to ve.ce.MWReferenceListNode
So its selection looks better after a user clicks on it

Change-Id: I4343a67d7b488c42e40270d25b9b4104a07872fb
2013-06-17 21:22:34 +00:00
Ori Livneh ccfb14b99d Split test: instrument edit events for standard editor interface
This change adds 'page-edit-impression', 'page-save-(attempt/success)',
and '(section-)edit-link-click' events to the standard (non-VE) editor
interface, mirroring the events we added to VE. This makes the event data
usable for split-test analysis.

Change-Id: I51c441d61daa18d58ca7f62a9e5f07902a099050
2013-06-17 14:14:57 -07:00
Roan Kattouw d32abe903e Fix selectNodes() bug with empty non-content branch nodes
These kinds of empty nodes shouldn't occur since the converter fills
them with empty paragraphs, but selectNodes() should still behave
correctly for them.

Change-Id: Ia37f3db1c2a84b842e2311cf70642fa66af04d91
2013-06-17 19:09:12 +00:00
Roan Kattouw df97f759b1 Refactor selectNodes tests
* Move them from ve.example.js to ve.dm.example.js
** Also move lookupNode() and createDomElement() there
** Delete ve.example.js because there's nothing left in it
* Make main example document implicit, but allow override
* Specify nodes as arrays and do the lookup later
* Specify range and mode separately rather than calling selectNodes()
  during construction
* Construct statically rather than in a function
* Use expect( cases.length );

Change-Id: I620e949c5e612b32eaa57c5d9b60cc91f9ddbf02
2013-06-17 20:08:08 +01:00
jenkins-bot 8b414bf426 Merge "grunt: Also delete QUnit temp files when test fails" 2013-06-17 18:29:21 +00:00
Ed Sanders 4986576cc4 grunt: Also delete QUnit temp files when test fails
Move post-qunit task to qunit.done event which fires both on
success and failure.

Define pre-qunit + qunit as a group test 'unit', so they can
be run from the command line (previously 'grunt qunit' would
fail) as 'grunt unit'.

Also add override comment to css file using non-standard
property so csslint passes again (follows-up b2fbe35).

Bug: 49431
Change-Id: I5079d00a63d43276a12dd78c306bb3819470631d
2013-06-17 11:27:52 -07:00
jenkins-bot 59bf9966b4 Merge "Fix logical conflicts from the transclusion merge." 2013-06-17 18:14:29 +00:00
jenkins-bot 4cad5463d4 Merge "Code style fix: @return -> @returns" 2013-06-17 17:53:54 +00:00
jenkins-bot e02d9445b2 Merge "Build the internalList linmod even if it's empty" 2013-06-17 14:09:39 +00:00
Roan Kattouw 393925a868 Build the internalList linmod even if it's empty
Otherwise fun exceptions occur when you have a <references /> tag
with no <ref>s, for instance.

Also disregard the internalList in the data->DOM conversion, to prevent
a nasty interaction where the whitespace information on the last element
is considered invalid because it doesn't match the internalList's.

Plus test updates from hell because this touches ve.dm.example.data

Change-Id: I62881d9fc27fa081123856d1b35a6021af469271
2013-06-17 13:23:20 +01:00
Ed Sanders dcbea2328c Code style fix: @return -> @returns
Change-Id: I26daca6313bf09055af8f980ba0065782257fd54
2013-06-17 11:50:24 +01:00
Ed Sanders 642a84483e Fix logical conflicts from the transclusion merge.
Change-Id: Ic9d708cdba74c908d14839def5050c8825134c56
2013-06-17 10:36:47 +01:00
jenkins-bot 409afcbce9 Merge "Remove handling of old 'editsection' class" 2013-06-17 01:12:51 +00:00
David Chan a1eb56c14f splitClusters uses Grapheme Cluster Boundary rules
unicodejs.graphemebreak.js
* New file: singleton class with splitClusters method
* On load, builds graphemeBreakRegexp from unicodejs.graphemebreakproperties.js

unicodejs.js
* Remove old splitClusters method (was just a placeholder)
* Change "conjunction" -> "disjunction", for consistency and correctness

unicodejs.textstring.js
* Use new splitClusters method

modules/ve/ve.js
* Use new splitClusters method

unicodejs.wordbreak.text.js
* Add new splitClusters test
* Refactor charRangeArrayRegexp test to use splitClusters

PHP files
* add unicodejs.graphemebreak.js, unicodejs.graphemebreakproperties.js

.docs/categories.json
* add unicodeJS.wordbreak class

Change-Id: I8f512e2fc2c46eb4b5f00994a8dac88f3c8f7dd2
2013-06-16 21:46:02 +01:00
MatmaRex 704440eb56 Remove handling of old 'editsection' class
It's been replaced with 'mw-editsection' and all cached renders on
Wikimedia wikis have expired by now. All backwards-compatibility
occurences have been removed from MediaWiki core already.

Change-Id: Id3731222445b588de8aec0e86892879ac4472636
2013-06-15 20:02:48 +02:00
jenkins-bot df4e191020 Merge "Handle deletion programmatically always" 2013-06-15 00:12:21 +00:00
Inez Korczyński ec92614906 Handle deletion programmatically always
Change-Id: Ic68f80d92d32169ff60258b81a438e342b136128
2013-06-14 17:05:28 -07:00
Trevor Parscal fc8c46dd74 Reference name and group editing
Objective:

* Allow editing reference groups and names in the reference dialog

Bonus:

* Modify attribute transaction builder to support multiple attribute
  changes in a single transaction

Changes:

ve.ui.MWReferenceDialog.js
* Load ref name and group from model
* Save ref name and group, if changed, to model

ve.ui.ListAction.js, ve.ui.Transaction.test.js, ve.ce.ResizableNode.js
* Update use of newFromAttributeChange to newFromAttributeChanges

ve.dm.SurfaceFragment.test.js
* Add test for new changeAttributes method

ve.dm.InternalList.js
* Missing new line at end of file

ve.dm.Transaction.js
* Change newFromAttributeChange to accept an list of attribute changes and
  produce a single transaction that applies one or more attribute changes
  at once

ve.dm.SurfaceFragment.js
* Fix bug in getCoveredNodes where the wrong mode name was being used
* Add changeAttributes method, which applies attributes to all covered
  nodes and allows filtering of which types of nodes the attributes are
  applied to

ve.dm.MWReferenceNode.js
* Actually write key and group back to DOM
* Separate onRoot functionality into addToInternalList so it can be called
  separately (similarly onUnroot/removeFromInternalList)

ve.ce.MWReferenceListNode.js
* Clone internal item CE node before appending to avoid rendering bug.

*.php
* Add links to messages and sort them

Change-Id: Ic4121e4fcfc09265d5863af6f078cdeb77926c8e
2013-06-14 15:29:56 -07:00
jenkins-bot 3e1e544e48 Merge "Add group field to reference dialog" 2013-06-14 22:24:38 +00:00
jenkins-bot 86406d5e48 Merge "Outline controls" 2013-06-14 21:47:36 +00:00
Trevor Parscal ac26f5fc69 Outline controls
Objectives:

* Allow reordering items in outline widgets using an outline control
  widget
* Use an outline control widget to reorder transclusion parts

Changes:

ve.ui.SelectWidget.js
* Emit add and remove events

ve.ui.OutlineItemWidget.js
* Add movable config options
* Add isMovable method

ve.ui.OutlineControlsWidget.js
* New class
* Displays move up/down buttons which are synchronized with an outline
  widget
* Doesn't actually move items (since an outline widget is probably
  data-driven) just emits events

ve.ui.Widget.css
* Add disabled style for icon button widgets
* Add styles for outline controls widget

ve.ui.Icons*.css
* Add missing icon styles

ve.ui.Dialog.css
* Add styles for outline and controls in editable paged dialogs

ve.ui.GroupElement.js
* Fix bug where items are insertions are in the wrong place when "moving"
  them

ve.ui.PagedDialog.js
* Add editable config option which shows outline controls under the
  outline
* Pass through movable config option when creating pages

ve.ui.MWTranclusionDialog.js
* Configure paged dialog outline as editable
* Add initialize method to connect outline controls widget events
* Make addPart method automatically add parameters when templates are
  added
* Add handler for outline controls move event which re-orders parts
* Make parts movable (params are automatically ordered, so they aren't
  movable)

ve.dm.MWTransclusionModel.js
* Add addPart method and use it within the addContent and addTemplate
  methods
* Fix documentation lies
* Add getPartFromId method

*.php
* Add links to new files and messages

Change-Id: I919d4c3e9b85d07a97a99c0b2e8739a859bdf2b1
2013-06-14 11:56:30 -07:00
Ori Livneh fe54db5141 Log user ID; 'pageViewSessionId' to alphanum string
By default, EventLogging uses INT columns for integers, which pageViewSessionId
overflows. I changed it to a STRING type in the schema and am now generating it
using 'mw.user.generateRandomSessionId()'. I also introduced a 'userId'
property, per bug 49585.

Bug: 49585
Bug: 49586
Change-Id: Iddb9eb9c64b55b25445ddf9e474d312b685978a6
2013-06-14 11:19:24 -07:00
Trevor Parscal acea97263b Add group field to reference dialog
Change-Id: Icf9ea348cd97bdb09ddf18769f53c01ea5a8b7ef
2013-06-14 10:30:03 -07:00
Ed Sanders beaf7a588c Pass selection to ve.dm.Surface.change when pasting over text
Bug: 49551
Change-Id: I7497b5195961e46718c7382409a66b7eec1162a9
2013-06-14 11:50:08 +01:00
Roan Kattouw 0c16066eb3 Kill attribute order preservation
Per the bug report, it's useless because Firefox does not preserve order
in the .attributes array (but sorts it alphabetically instead), and so we
actually get the same exact behavior regardless of whether we use ordering
cleverness or just a straight-up plain object: order is preserved in Chrome,
and alphabetized in Firefox.

Bug: 48980
Change-Id: I1463d06db4900083dd4c565292bbabef09194b43
2013-06-13 23:17:08 -07:00
jenkins-bot bb59895d92 Merge "(bug 48335) Use more generic approach to filter out non-character key presses." 2013-06-14 03:34:44 +00:00
jenkins-bot 6144976c1e Merge "(bug 43082) Fix problem by calling surfaceObserver.stop( true ) first - before calling handleEnter." 2013-06-14 00:16:51 +00:00
jenkins-bot f814842108 Merge "Update 'wgCurRevisionId' after successful save" 2013-06-13 22:12:06 +00:00
Roan Kattouw 3674c8937b Send section edit links to VE by default
Add a preference to disable this behavior. Requires rewording by James.

Bug: 49260
Change-Id: I5ce7ea8c1e47e8243b619fc61aa957f767d22b48
2013-06-13 15:04:02 -07:00
Ori Livneh 1780b4e39c Update 'wgCurRevisionId' after successful save
Also updates the EventLogging code to use a computed property for
'wgCurRevisionId'.

Change-Id: Ida648c77f56c0e455d6fb49a779a831734f6776b
2013-06-13 13:30:14 -07:00
jenkins-bot 0bffa7b119 Merge "Improve category widget styling" 2013-06-13 19:27:57 +00:00
Trevor Parscal 6fba13b453 Improve category widget styling
Objectives:

* Get rid of the border and ensure pixel-perfect positioning of the input.
* Always render the arrow on the top right of the category item
* Make the popup positioning based on the arrow div's position and size

Bug 49420
Change-Id: I3ad4ff1c41e6108161b5b7c8718c676eb850de68
2013-06-13 19:26:29 +00:00
jenkins-bot dc4ceb9f56 Merge "Add ability to log analytic events using EventLogging" 2013-06-13 17:20:21 +00:00
Ori Livneh efba2cf8da Add ability to log analytic events using EventLogging
This change adds a '$wgVisualEditorEnableEventLogging' configuration
variable, accessible client-side as
'wgVisualEditorConfig.enableEventLogging'.

When true, the 'schema.Edit' ResourceLoader module will be loaded on the
page, and calls to ViewPageTarget.logEvent will forward to
mw.eventLog#logEvent.

When false, the module is not loaded, and ViewPageTarget.logEvent is a
no-op.

The change also adds a few calls to ViewPageTarget.logEvent to log certain
editor actions, documented in https://meta.wikimedia.org/wiki/Schema:Edit.

Change-Id: Iccd171d7cde15b0302d1b4c292bcbcc2a4b337ef
2013-06-13 10:14:53 -07:00
jenkins-bot 03127491b2 Merge changes Ic189011e,I7617a35b
* changes:
  Make references dialog scroll
  Make fieldset layout icons optional
2013-06-13 17:04:19 +00:00
jenkins-bot 628fd18930 Merge "Category popup fixes" 2013-06-13 15:30:07 +00:00
Inez Korczyński 44f57135f0 (bug 43082) Fix problem by calling surfaceObserver.stop( true ) first - before calling handleEnter.
Change-Id: I35c892581943057acbf9ddd638576e998cc82c1a
2013-06-12 17:14:57 -07:00
Trevor Parscal e2b7504b8e Category popup fixes
Objectives:

* Make category popup show "Category" rather than missing message -
this is more similar to other popups like inspectors, which identify
what that thing is that you are working on
* Fix alignment of icon and label in category popup

Changes:

ve.ui.Widget.css
* Make popup title align properly with the remove button

ve.ui.MWCategoryPopupWidget.js
* Update message key

*.php
* Add new message

Change-Id: Ia8051125bbc9bde47ceb931e1ebf42b2955481ff
2013-06-12 16:44:10 -07:00
Trevor Parscal d3a2fab2c4 Transclusion editing
Objectives:

* Rename just about every use of "template" to "transclusion"
* Make a proper data structure for transclusions
* Abstract away template data
* Use more template data in the user interface
* Allow adding parameters
* Allow removing templates, parameters and content

Changes:

ve.ui.Dialog.css
* Add rule to place add param controls on a single line

ve.ui.MWTemplateDialogs.js
* Move template spec loading into transclusion class
* Add remove button for parts and parameters
* Add parameter adding form
* Use template data for labels and descriptions

ve.dm.*
* Add new transclusion data structures

*.php
* Add links to new files

*.*
* Rename all things "template" to "transclusion"

Bug: 39598
Bug: 49403
Change-Id: I3bcf924a3e179cb65f19e833277a39dfd3dad8bd
2013-06-12 16:39:13 -07:00
Trevor Parscal caa16737d5 Make references dialog scroll
If the content in the sub-editor gets big enough, this can be a problem.

Change-Id: Ic189011e64090186d87a397b2b047057a97f2a3d
2013-06-12 16:24:38 -07:00
Trevor Parscal 91d615e684 Make fieldset layout icons optional
Change-Id: I7617a35bd9e8322d0b9f8e225885ccbe5fa230ee
2013-06-12 16:23:48 -07:00
Inez Korczyński 4e377629e3 (bug 48335) Use more generic approach to filter out non-character key presses.
Change-Id: Ie00becf1162f145134f006b0b4514ba874de9c43
2013-06-12 15:03:40 -07:00
James D. Forrester 9d40239e06 Media display and insertion no longer an experimental feature
Media item dialog for settings; drag-and-drop placement; caption
editing still to come.

Bug: 37870
Change-Id: I547e06dcdb92e19f0159660314187c4f1a62f3ed
2013-06-12 12:39:35 -07:00
jenkins-bot 5f30bd9ed6 Merge "References dialog cleanup" 2013-06-12 19:25:59 +00:00
jenkins-bot ed2018e58c Merge "Store empty annotations as alienMeta nodes" 2013-06-12 18:55:50 +00:00
jenkins-bot ddd88043fa Merge "Store alien meta items' dom nodes only" 2013-06-12 18:54:00 +00:00
Trevor Parscal 8f9d2a607e Cleanup unused dialogs
Objectives:
* Remove unused dialogs

Changes:

*.js
* Remove unused stuff
*.php
* Cleanup links to files and messages

Change-Id: Ie670afa3aef1757151e385bf922464b85f662a7d
2013-06-12 11:49:44 -07:00
Ed Sanders da51566d56 Store empty annotations as alienMeta nodes
Not a perfect solution, but better than deleting them completely.

Bug: 48605
Change-Id: I0f3a194f629b054f193a61af105733a555775d79
2013-06-12 19:46:41 +01:00
Trevor Parscal 2d044518bd References dialog cleanup
Objectives:

* Remove the whole toolbar subset thing, it's up to the creator of the
  subsurface to know what is and is now allowed, and the commands were
  still passing through unfiltered
* Correctly separate initialization from opening - fix issue where opening
  the reference dialog multiple times will keep adding more and more
  controls

Changes:

ve.init.Target.js
* Remove getToolbarSubset method

ve.ui.MWReferenceDialog.js
* Add toolbar tools and surface commands configs to reference dialog,
  including the things that are safe to use in references
* Move creation of field sets and reused controls to initialize method
  to prevent re-creation each time the dialog is opened
* Move static initialization stuff to the top near the other static stuff

Change-Id: I1c8577d17c506bac76e61b2b036655c59ef5a218
2013-06-12 11:27:49 -07:00
jenkins-bot 2bccb3da85 Merge "Replace alpha notice with beta label hiding the feedback link" 2013-06-12 17:16:42 +00:00