Commit graph

4443 commits

Author SHA1 Message Date
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 8e70a2439e Merge "Move notification messages to correct module" 2013-06-18 20:53:22 +00:00
jenkins-bot 68c9dcc693 Merge "Use the latest revision's timestamp for basetimestamp" 2013-06-18 20:47:32 +00:00
Translation updater bot bb5400ddce Localisation updates from http://translatewiki.net.
Change-Id: I9d1c9d12981d693909a4413018aefa3ae7c90903
2013-06-18 20:28:04 +00: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
Roan Kattouw f33d9864dc Move notification messages to correct module
They're called from ViewPageTarget, so that's where they should be
registered.

Change-Id: I294aad1b43021bdadae24319b99f93cd960fe908
2013-06-18 12:19:06 -07:00
Roan Kattouw 6503849777 Use the latest revision's timestamp for basetimestamp
Bug: 49390
Change-Id: Icacaa5101386e52309278c8d9871ca1193aa86a9
2013-06-18 12:17:44 -07: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
Mark Holmquist 9b320f73fa Fix fatal error on user registration due to hook fail
Hooks need to return true if they succeed. Fatal errors in production.

Change-Id: Ie5ec5881a8d158bd675dbb6db4540f02fd33290d
2013-06-17 20:14:46 -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
jenkins-bot 2693891c17 Merge "Split test: instrument edit events for standard editor interface" 2013-06-17 21:38:10 +00:00
Translation updater bot 33d4addc68 Localisation updates from http://translatewiki.net.
Change-Id: I2fdd442caa83b2bce4af36980f76623dff39d4a5
2013-06-17 21:32:21 +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 7445b4931f Merge "Add ability to run a 50% split user test with VisualEditor as default" 2013-06-17 18:12:12 +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
Siebrand Mazeland 2ab3b9be0e Fix grammatical error
Change-Id: Iff809c799199a10f7895e4896c4baadaa189b270
2013-06-17 13:28:21 +02:00
Siebrand Mazeland 4ba540a4f3 article -> page
Change-Id: I843f1f559bdab9c36797812b39e081ae43c9c9b2
2013-06-17 13:27:41 +02:00