Commit graph

3598 commits

Author SHA1 Message Date
Timo Tijhof fb007eb4f5 ve.dm.example: Use jQuery#toArray instead of jQuery#get
Better for performance (lower level, #get calls #toArray when
called without arguments) and more semantically correct.

Change-Id: I8e615674e51fd148367fd397bd169fa203a240ad
2013-06-21 18:03:59 -07:00
jenkins-bot 22f4c6454a Merge "RelocatableNode for Inline and Block Images" 2013-06-21 21:54:49 +00:00
Christian Williams e71655304e RelocatableNode for Inline and Block Images
HTML5's drag and drop has a ton of benefits and a couple of
limitations. To achieve a native drag marker, an image tag helper
is used to indicate the size of the relocatable node. Chrome
shades the marker gray natively, Firefox is styled to match.

Change-Id: I755b698a3d968cc7e6ff125109d68ac83fd8a8a2
2013-06-21 14:53:10 -07:00
jenkins-bot e10ba45a81 Merge "mw.ViewPageTarget: Use native .focus() rather than jQuery's .focus()" 2013-06-21 21:28:03 +00:00
jenkins-bot dcb0d04cc8 Merge "Don't build the CE tree and DOM for the internal list" 2013-06-21 21:25:58 +00:00
Roan Kattouw 3a5ec39ab5 mw.ViewPageTarget: Use native .focus() rather than jQuery's .focus()
jQuery's implementation does some sort of traversal, so on large pages
it took 300-400ms just to focus the document node.

Change-Id: I0de95d8800a1aedeb19b27d204dfd8fd08cec533
2013-06-21 21:25:44 +00:00
Roan Kattouw 921a95de78 Don't build the CE tree and DOM for the internal list
This is a waste of time, because we hide it anyway. This took
quite a bit of time for long articles.

Change-Id: I1bcfd5b908c89dc2e08d5520e8870b145177ca10
2013-06-21 14:19:55 -07:00
jenkins-bot 3a3270486a Merge "Match data inserted from MWMediaInsertDialog with MWBlockImageNode" 2013-06-21 21:01:09 +00:00
jenkins-bot 5cfd21754a Merge changes If3d01346,I4e5317f1
* changes:
  Fix incorrectly written CSS that was affecting all table cells on the page instead of cells in mwMetaDialog only
  Fix for rendering block images
2013-06-21 21:00:33 +00:00
jenkins-bot 014b6ed33a Merge changes I379bc2b3,I99acbd16
* changes:
  Straighten out variances in parent method invocation
  ve.ui.MWReferenceDialog: Clean up
2013-06-21 20:53:25 +00:00
jenkins-bot 2bc37bfc29 Merge "Fix logic in link input widget" 2013-06-21 20:14:49 +00:00
jenkins-bot a344396b47 Merge "Remove format tools from mw reference dialog" 2013-06-21 20:13:33 +00:00
jenkins-bot c32378b571 Merge "Delete default sort key if set to empty string" 2013-06-21 20:10:12 +00:00
jenkins-bot b9c386e49c Merge "Fix splitClusters usage in ve.ce.Surface#onContentChange" 2013-06-21 19:50:23 +00:00
jenkins-bot ecbb941038 Merge "Allow UI context to update when selection is from 0" 2013-06-21 19:39:57 +00:00
Inez Korczyński 50ec8c507a Match data inserted from MWMediaInsertDialog with MWBlockImageNode
Change-Id: I145beba19a8f69f6fd8c29302350c399b4c51c55
2013-06-21 12:36:14 -07:00
Inez Korczyński 25d8d2895d Fix incorrectly written CSS that was affecting all table cells on the page instead of cells in mwMetaDialog only
Change-Id: If3d01346d7267aec444d573ac83516083a3689bc
2013-06-21 12:33:38 -07:00
Timo Tijhof 2fb1a11a1a Straighten out variances in parent method invocation
Follows-up I99acbd1699:
* "Parent method" comment
* Remove redundant slice() call to convert arguments to array,
  native JavaScript methods that take array-like arguments such
  as Function#apply and Array#slice are both compatible with
  the Arguments objects, no need to convert it. Most invocations
  already did this right but a few were recently introduced again.
* Removed silly "Document dialog." descriptions.
* Removed a few redundant "@method" tags in the near vicinity
  of code I changed.
* Fixed function invocation to be either on one line or
  one parameter per line. Having all arguments on one line
  but the name + "(" looks confusing as it suggest there
  is only 1 parameter. Same as object literals:
  so:
  { foo: 1, bar }
  or:
  {
    foo: 1,
    bar: 2,
  }
  not:
  {
    foo: 1, bar: 2
  }

Change-Id: I379bc2b32603bcf90aba9b4cd0112e7f027d070e
2013-06-21 19:20:37 +00:00
Inez Korczyński 659bb8e6d0 Fix for rendering block images
Change-Id: I4e5317f128f2b3f6742e7ed280c96fde37f52bb4
2013-06-21 12:19:38 -07:00
jenkins-bot 4d73aaa737 Merge "Change nested annotation test to test recursiveness" 2013-06-21 18:53:48 +00:00
Ed Sanders bf621b3454 Change nested annotation test to test recursiveness
Change-Id: I16f39bd0f6e2b6719ff26f69a561145bb4ca0c2b
2013-06-21 19:47:10 +01:00
Timo Tijhof 0c2e35593e ve.ui.MWReferenceDialog: Clean up
* Optimise initialisation by building the tree from the bottom up
  and applying the class last.
* Actually document the dialog. Documenting it as "Document dialog"
  is useless and confusing. If there is no documentation yet, leave it
  empty so it is included in jsduck's optional "no_doc" warning list.
* Remove the redundant "Call" prefix in the parent method description,
  we don't do this else where either.

Change-Id: I99acbd1699b2c99a2c9b58f34dc1e07bea58203d
2013-06-21 11:36:44 -07:00
jenkins-bot f16e641ab4 Merge "Handle nested empty annotations" 2013-06-21 18:23:22 +00:00
jenkins-bot a03601683f Merge "mw.ViewPageTarget: Move non-annotation buttons to a new tool group" 2013-06-21 18:19:34 +00:00
jenkins-bot 722b9560a1 Merge "Workaround for adjacent annotations bug" 2013-06-21 18:15:06 +00:00
jenkins-bot 096dcced1b Merge "There is no need to apply CSS changes (width and height) to an image inside ve.ce.MWBlockImageNode because it is already handled in ve.ce.ResizableNode" 2013-06-21 18:12:39 +00:00
Inez Korczyński e91fee2ca7 There is no need to apply CSS changes (width and height) to an image inside ve.ce.MWBlockImageNode because it is already handled in ve.ce.ResizableNode
Change-Id: I416008688b967cbbbe3e585abb3be9924ca47dc6
2013-06-21 10:38:07 -07:00
Trevor Parscal 469cb4aa99 Add reference icon
Objectives:

* Introduce new icon for a reference
* Repurpose existing reference icon for references block

Change-Id: I1bfcdbeda3b9730d62d6b264ef72921e93623f7e
2013-06-21 10:31:43 -07:00
Ed Sanders 8bfbef1c5e Handle nested empty annotations
At the moment we create an alien meta item if an annotation
wraps contents of zero length, however we also need to handle
nested empty annotations, i.e. where the contents is other
empty annotations (i.e. alien meta items).

As alien meta items simply preserve DOM elements we don't
mind what type of alien meta items they are, so this also fixes
the case of an annotation wrapping another alien meta
e.g. a comment or <meta> tag.

Bug: 48605

Change-Id: I98d88b341efcd6384ee1fda5d6d7e1e1acb107aa
2013-06-21 17:20:06 +01:00
jenkins-bot 210019de59 Merge "ve.dm.MWTransclusionModel: Don't create undefined normalisation target" 2013-06-21 16:18:20 +00:00
Ed Sanders 51be472159 Fix logic in link input widget
Previously pageExists thought matchingPages was an indexed object when
in fact it was an array. This didn't manifest as a bug as we subsequently
check the normalised URL in the correct manner (using indexOf), but it
did remove the optimisation of not running mw.Title if there was an exact match.

Change-Id: Ic616cbfa0d7ed5447e032dd1f772779db2dc19e5
2013-06-21 16:42:54 +01:00
Ed Sanders 4116742bcb Remove format tools from mw reference dialog
Because you can't put a heading in a reference.

Bug: 49715
Change-Id: Ic823a90398dafca1caf8fa4142d98133ab661d7c
2013-06-21 16:23:29 +01:00
Ed Sanders 746763a2e7 Workaround for adjacent annotations bug
Until this is fixed by Parsoid, this is a dirty hack that compares
HTML attributes on annotations, excluding data-parsoid. Obviously
we shouldn't have any parsoid specific code so this should be removed
as soon as it is fixed properly.

Bug: 48194
Change-Id: Ibb18b4f653c664e8ab7876498dc8395d878f7aaa
2013-06-21 12:31:36 +01:00
Ed Sanders 7b1df21aeb Delete default sort key if set to empty string
Bug: 49724
Change-Id: Ie3caaf4811f87911444462f83d511c0cc46c0716
2013-06-21 11:48:20 +01:00
Timo Tijhof 03dbf56f76 mw.ViewPageTarget: Move non-annotation buttons to a new tool group
Change-Id: I04784357d3590c43af90c60da4b5a67bbf10ac70
2013-06-20 19:55:55 -07:00
Timo Tijhof 1ea9016cf8 doc: Clean up documentation related to ES5 in ve.js
Also removed redundant ve#filterArray.

Change-Id: I80a2e7fdfdb8f26510196995044124afeda4e682
2013-06-20 17:43:24 -07:00
Ed Sanders 3a44ae9be3 Fix splitClusters usage in ve.ce.Surface#onContentChange
Was previously doing the text slicing before the cluster split
using substring, instead of after using splice.

Bug: 49233
Change-Id: If9c0860e2fe7b01eb0b27aae67c671062799a0fa
2013-06-21 00:28:56 +01:00
jenkins-bot 93686139f5 Merge "mw.ViewPageTarget: Move save dialog out of toolbar tree" 2013-06-20 22:14:50 +00:00
James D. Forrester eb35b92f8f Update initialisation scripts for demo, test
Apparently we should be keeping these up-to-date by
running makeStaticLoader :-)

Change-Id: I06f5cdad64b67bb10b6c6a470c818fc9c688560f
2013-06-20 22:10:57 +00:00
Timo Tijhof 8f9093ea07 ve.dm.MWTransclusionModel: Don't create undefined normalisation target
The API gives us normalisation information about all titles,
including titles of which it couldn't provide any template data.

Spec storage should only have properties with valid values
(has property means to have a valid value, like database). The
absence of this check was causing it to turn this:

{
  pages: {
    'Template:Unsigned': { params: { .. } }
  },
  normalised: [
    { from: 'foo bar', to: 'Foo_bar' },
    { from: 'template: unsigned', to: 'Template:Unsigned' }
  ]
}

into:

{
  pages: {
    'foo bar': undefined
  },
  normalised: [
    { from: 'foo bar', to: 'Foo_bar' }
  ]
}

Bug: 49493
Change-Id: I0b661744d0388345561897c9631f15e691737031
2013-06-20 15:09:42 -07:00
Timo Tijhof 85c4ebf373 mw.ViewPageTarget: Move save dialog out of toolbar tree
Bug: 49275
Bug: 49361
Change-Id: I2fbc4c8af943f1b096b8912191924961405d5c47
2013-06-20 14:16:50 -07:00
Ed Sanders 8730a913dc Allow UI context to update when selection is from 0
Previous condition was put in as part of I9ed6f9fb as a
temporary fix for bug 42842. However this code was causing
the popup widget to not appear for items at the start of
the document. It appears the bug it was put in to fix
has since been fixed elsewhere.

Bug: 49421
Change-Id: I8bcdea0f7a6951216bf8368865d23ef6246880ea
2013-06-20 19:33:44 +01:00
Ed Sanders 2c421258f8 Delete/don't insert transclusion if object is empty
The transclusion dialog lets you completely delete all templates
within it. If this happens we should delete the node completely, or
not insert it if it's a new instance.

Bug: 49831
Change-Id: Ic5d4fbf73f3d1be9cf877bc8b98096de9e98991a
2013-06-20 17:23:29 +01:00
jenkins-bot ed1c06ee6b Merge "Match MediaWiki's rendering of non-thumb/-frame block images" 2013-06-20 03:49:09 +00:00
Inez Korczyński bed2c1d00d Match MediaWiki's rendering of non-thumb/-frame block images
Change-Id: I43ad72ef2d6b650692e1a0fd4460e4dec70fde7f
2013-06-19 17:44:55 -07:00
jenkins-bot 43af678ad4 Merge "ve.ui.PanelLayout: Set default to span accross available space" 2013-06-20 00:29:42 +00:00
jenkins-bot 58c7db50e3 Merge "Always float toolbar to top of page, not last branch node" 2013-06-20 00:27:06 +00:00
Timo Tijhof 82997d73e8 ve.ui.PanelLayout: Set default to span accross available space
Without these properties set, the layout is collapsed into a 0x0px square due to the
parent having overflow-x: auto; and no width/height set.

Change-Id: I77aef8afa3327b11f453196badcdfad3f51f7c3d
2013-06-19 16:20:10 -07:00
jenkins-bot 38d6c6ba73 Merge "Add resource attribute to newly created images" 2013-06-19 22:31:20 +00:00
jenkins-bot 5cc6faaa1f Merge "(bug 49837) Handle correctly figure tags with typeof="mw:Image"" 2013-06-19 21:56:16 +00:00