Commit graph

352 commits

Author SHA1 Message Date
Roan Kattouw 8470e2c272 Update VE core submodule to master (f8f9728)
New changes:
68e20d4 Create AlignableContextItem to quickly adjust AlignableNodes
0150df2 Update OOjs UI to v0.9.3
b333fd3 FragmentInspector: Execute action on enter, rather than closing with data
2d14f7a Fix webkit column hack
be780eb Don't drop whitespace when removing empty slug paragraphs
cc19787 Split handlesOwnChildren and ignoreChildren
7f1c9a7 Localisation updates from https://translatewiki.net.

Local changes:
Add ignoreChildren to handlesOwnChildren nodes

Change-Id: Id3dc7efae8d30b6551b2fc3104ed00bc86339176
2015-03-20 16:04:15 -07:00
jenkins-bot 82dc89dc3e Merge "Remove MWTransclusionMetaNode" 2015-03-12 20:16:42 +00:00
Moriel Schottlender bbb5c84149 Remove MWTransclusionMetaNode
Since all transclusion nodes can be interacted with (including the
'hidden' ones,) there is no need for MWTransclusionMetaNodes.

Change-Id: I23d37e3d82029b7475ec68ebb04883c7e05370cc
2015-03-12 13:12:32 -07:00
Alex Monk 9a0b76ac26 Handle undoing of reference group changes
By removing from and re-inserting into the InternalList when the right
attributes change, rather than trying to hack it into the model's
updateInternalItem (which won't get run on undo).

Bug: T71119
Change-Id: Iaf7a3127576b94666e05691902d2782394d24afb
2015-03-11 19:15:47 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
jenkins-bot ba7db69583 Merge "MWParameterPage: Show the field's example if it exists" 2015-03-09 21:34:27 +00:00
Moriel Schottlender 530f5c05f5 MWParameterPage: Show the field's example if it exists
Also appending both the default value and the example value to the
field description. The input placeholder will show the default
value, the example value, or nothing.

Related to TemplateData change I9e2d66a805e25 but works without.

Bug: T53049
Change-Id: I4e5e57546f6d3c22e778ba061a5344ddee085c17
2015-03-09 14:25:18 -07:00
Timo Tijhof 9fd753e7a7 build: Enforce disallowMixedSpacesAndTabs jscs rule
Also, fix @returns comments (should be @return) and remove unnecessary
@method comments from the documentation.

Change-Id: Icd303626ac745c7ab5bff164f9b8cac276de1523
2015-03-07 16:49:30 +00:00
Roan Kattouw f24dbb3435 Fix transfer of reference contents from removed reference
We unconditionally retrieved originalHtml from itemNode,
even if there was no data-mw.body.id, so as long as
the reference itself wasn't edited, we would never overwrite
data-mw. This meant that if the <ref> with the contents
was deleted, the contents wouldn't be transfered to the
first <ref> tag with that name like they're supposed to be.
The solution is to only look at originalHtml from itemNode
if data-mw.body.id is set.

Change-Id: Ib87491b6fa6a77d62384158f8e8f7dcc2a36c23a
2015-03-02 22:26:05 +01:00
Moriel Schottlender f0f8f52080 Refactor MWMediaResultWidget to resize better
For the masonry view, the result widget resizes itself according to
the rows and other images in the row. Up until now the resize was
a bit buggy, occasionally missing height/width values. This is
mostly due to rounding errors, but also due to a small double
calculation that is now fixed with this code.

Change-Id: If18adc5280e4bdbb9174b7c7e6e4eadf3c1ab26d
2015-02-26 16:42:14 -08:00
Moriel Schottlender b85b81c501 Correctly validate a provider for local api
Make sure that the validation method accounts for local api
vs remote api when checking for valid variables.

Bug: T90795
Change-Id: Ia6877ca6ccc4e65d1db053f107e7702721e2da3c
2015-02-25 15:59:05 -08:00
Alex Monk 8e48f94580 Use mw.Api to run requests rather than our own stuff in ve.init.mw.Target
Bug: T58659
Bug: T89435
Change-Id: I18162f04c50f48606378aed62ee99fccdc3159f6
2015-02-25 01:57:22 +00:00
jenkins-bot bd4289241a Merge "Adjust Queue and Provider to work with generalized parents" 2015-02-24 18:42:40 +00:00
Ed Sanders 65d26891ae Fix transclusion clipboard logic
Run isForClipboard path in MWTransclusion node
even if we have originalDomElements.

Change-Id: Ib5c77888ef41d26e827dbb9a20925e251527a99a
2015-02-22 19:24:41 -08:00
Ori Livneh 4cf393da54 Update VE core submodule to master (032c9a4)
New changes:
dc3b1f8 Replace ve.dm.Model#matchesAttributeSpec

Local changes:
Replace ve.dm.Model#matchesAttributeSpec

Change-Id: I2a107999974309304b59697dad0f7374110b9ab5
2015-02-18 16:32:19 -08:00
Roan Kattouw 3611664663 Update VE core submodule to master (7d2a68e)
New changes:
0ceafd5 Fix V8 deopt for ve.ce.BranchNode#onSplice
01d2d4b [BREAKING CHANGE] Store originalDomElements instead of htmlAttributes
96005a7 Localisation updates from https://translatewiki.net.
42e672e ve.ui.Toolbar: Don't call #updateToolState from #initialize
373562d Localisation updates from https://translatewiki.net.

Local changes:
Update for htmlAttributes going away

Change-Id: I576a1e5d5883b03d1fff6666926f80a5682a280f
2015-02-18 15:35:46 -08:00
Moriel Schottlender 093cf012ea Adjust Queue and Provider to work with generalized parents
Generalize MWResourceQueue and MWResourceProvider so they are
extending the general classes from ve-core. This also allows for
tests in ve-core on the resource queue system.

* Depends on ve-core change I5346081317e *

Change-Id: If34cd99334f4ccb93015c3646f68ae3040b9c5d7
2015-02-17 17:22:21 -08:00
Ed Sanders b9addfc1da ve.dm.MWImageNode: Fix indentation
Change-Id: Ice223d19904f02709a64799cc6b81f8718a92a40
2015-02-17 16:10:33 +00:00
Ed Sanders 7ff516d76c Fix clipboard DM for transclusion nodes starting with invisible tags
<link> and <meta> tags are thrown away by the clipboard so make sure the
data-mw element is converted to a span.

Bug: T86401
Change-Id: Ia2869b9496ea5ce4f474e254bb4125f85152c7cf
2015-02-16 16:52:07 +00:00
Ed Sanders ec4acecf33 Correctly tag clipboard DM from MWTransclusionNodes
Iff in clipboard mode:
* Set data-ve-no-generated-contents on the main element
  regardless of whether we are using orignal DOM elements.
* Set data-ve-ignore on siblings, again, regardless or
  where they came from.

Bug: T89658
Change-Id: I82ad60f0b90e0c6ce88c42737bd36d1a289bcf34
2015-02-16 16:52:04 +00:00
Timo Tijhof 5bf0ac251a Move svgMaxSize and namespacesWithSubpages to site config
These are currently in page-specific mw.config. As these are
not related any page, they should be in the global export.

This is needed to have our tests (and code base) run error-free
without a MediaWiki page.

Bug: T89434
Change-Id: Ic42bcd14028772ff0c06e28c76ffaf156f8b985f
2015-02-13 08:20:26 +00:00
Moriel Schottlender 65d0a9d7e7 Defend against empty file pages in media dialog search
Empty file pages are returned as results in search but have no
useful information, and, more importantly, no 'imageinfo' property.
Make sure these are skipped by the provider.

Bug: T89303
Change-Id: I3374f7373efc1f5751acb16819973594abf56a56
2015-02-11 23:23:38 +00:00
jenkins-bot 0d3bd68431 Merge "Display image uploader and artist correctly in the media dialog" 2015-02-11 21:50:17 +00:00
jenkins-bot 57bffa14c6 Merge "Support specifying reference contents with data-mw.body.id" 2015-02-11 20:18:11 +00:00
Moriel Schottlender a3973145d5 Display image uploader and artist correctly in the media dialog
Add the display for the actual uploader, and change the label
for the artist to "Artist" for differentiating the two roles.

Bug: T88835
Change-Id: Ie939572e7c1240321556f6f81ed9e67d792a339d
2015-02-11 11:14:43 -08:00
jenkins-bot 7ac177c02e Merge "Template dialog: Disable 'Apply changes' until a change is made" 2015-02-10 23:17:01 +00:00
Roan Kattouw 26e5a885bc Support specifying reference contents with data-mw.body.id
If data-mw.body.html is not set, search for the element
whose ID matches data-mw.body.id and use its contents.

.body.html is still used for new content: new references
use .body.html, and if a reference using .body.id is
changed, the changed HTML is output in .body.html.

Bug: T88650
Change-Id: I5d614927256d59a3ab20b0bd6e882b5cb8fcda20
2015-02-09 20:54:50 +00:00
Moriel Schottlender aa9eb95455 Refactor MWMediaSearchWidget to use a queue and providers
Change the media search widget to work with resource queues and
providers. Create providers based on the user's filerepo settings
and aggregate their responses with the media queue. Stop asking
for more results from providers that are depleted.

Also fixes a rather nasty infinite-loop bug where the API returns
only very few images, and the UI keeps asking for more.

Bug: T78161
Bug: T88764
Change-Id: I65aed3446cd1f056476c56e6e04522c70e49e595
2015-02-06 16:45:56 -08:00
James D. Forrester bed038b509 build: Bump devDependencies to latest
Updates:
* grunt-contrib-csslint  0.3.1  ->  0.4.0
* grunt-contrib-jslint   0.10.0 -> 0.11.0
* grunt-jscs             0.8.1  ->  1.2.0

For jscs, leaving requireSpacesInsideArrayBrackets to avoid headaches for now.

Change-Id: I62d34444edbba65c8bd22d2fa5e50e16cabb0042
2015-02-02 14:30:39 -08:00
jenkins-bot d5f7bac940 Merge "Combine imageinfo requests" 2015-02-02 19:32:00 +00:00
Alex Monk dc69b15db1 Template dialog: Disable 'Apply changes' until a change is made
Bug: T76926
Bug: T76927
Change-Id: I5a664f865c11690a19b754fc9877baf37e34edad
2015-01-31 03:19:06 +00:00
Roan Kattouw 2bdb20b3c1 Don't corrupt href="./" in internal links
href="./" was being corrupted to href=""

Change-Id: Ieedd71a991c6b52225f2ac41ebe1a20e7533c19e
2015-01-30 18:44:57 -08:00
Alex Monk 7876cc957a Combine imageinfo requests
By generalising LinkCache into ApiBatchQueue to request them all centrally

Bug: T75822
Change-Id: I097311ec2487bb1ae9f5d927c2c13c274ba716f9
2015-01-30 17:20:04 -08:00
jenkins-bot cc4e8e7ebd Merge "When changing image source, use already-available API info" 2015-01-29 18:34:03 +00:00
jenkins-bot e372b93c4c Merge "Lazy load the media search results" 2015-01-29 18:33:47 +00:00
Moriel Schottlender e454b81f4d When changing image source, use already-available API info
When the user changes an image to another in the media dialog, we
already have API info that includes the original dimensions, media
type and other information that is required for the Scalable object
to compute the new current dimensions. We can use this info if it
exists instead of asking for another API call. Also make sure to
update the filename when we change an image in the dialog.

Bug: T87267
Change-Id: I9d86959b99b3f3dfed92255a9dba9a8fdd352dcb
2015-01-29 01:58:07 +00:00
Moriel Schottlender a44e0d2e5d Lazy load the media search results
* Set the src attribute only when the image is actually
  visible in the search results.
* Display the thumbnail image we have from the search
  results and then update with a larger one from the API.
* Request for more media results on a higher threshhold,
  when the user views 2 rows above the last available
  result.
* Correct the resizeToBoundingBox and simplify it to work
  properly for a non-square bounding box regardless of
  constraints.

Change-Id: If024b0335ce6a5d2d0eafdbfdfe1030dcaac3a75
2015-01-28 17:56:54 -08:00
jenkins-bot a0a6937450 Merge "Use DOM methods instead of jQuery .html() in references DM code" 2015-01-28 23:38:01 +00:00
Roan Kattouw a10fe01f8b Use DOM methods instead of jQuery .html() in references DM code
Bug: T87417
Change-Id: I40df6258cd076911c68351300a488645db1d65d5
2015-01-26 14:06:56 -08:00
Roan Kattouw 711c509f81 dm.MWBlockImageNode: Use DOM methods rather than jQuery
To avoid triggering state thrashing in Sizzle
( https://github.com/jquery/sizzle/issues/311 )

Also account for the fact that missing attributes are returned
as undefined by jQuery but null by .getAttribute().

Bug: T87416
Change-Id: Ib3bc7971920c084568abb6ea0bd822d763b276f2
2015-01-26 09:46:55 -08:00
Moriel Schottlender 061925be87 Add filename to the media dialog
Show the currently used filename at the top of the media dialog so
it can be copied and used in other pages if needed.

Bug: T54459
Change-Id: Ib1844c997189f7ead0656c5a811d3cab70030f89
2015-01-16 17:40:40 +00:00
jenkins-bot 2ebdf34c29 Merge "Transform the search widget to show image details" 2015-01-16 13:26:25 +00:00
Moriel Schottlender 4947420650 Transform the search widget to show image details
Add an info panel to the MediaDialog to show the user information
about the chosen file from the new extmetadata API.

Also, change the way results are viewed:
* Present the search results with their proper ratio.
* Use masonry fit for the search results.
* Change the resizeToBoundingBox method in ve.dm.MWImageNode to accept
  a specific side constraint, either 'width' or 'height'. This is also
  going to be useful for adding and calculating 'scale' considerations
  that affects the image height.
* Add info panel with details from extmetadata including author, license,
  date of upload and creation, etc.
* Get descriptions and data according to wiki language.

Bug: T78161
Bug: T74061
Change-Id: I7b4d019825aa89dd178665bd9492a07af15954ac
2015-01-16 13:22:54 +00:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Bartosz Dziewoński 9e5ec5cefb ve.dm.{MWTransclusionModel,MWTemplateModel}: Remove unused parameters
The 'origin' parameter to the constructors has been removed in 51e096d6.

Change-Id: I885f75c381cea013d32d408c7b26de0fa00629c2
2015-01-11 19:25:17 +01:00
Moriel Schottlender e0894b807f Surfaces should have parent document direction
Make sure all surface widgets have documents that are initialized
with the direction of the parent document, so the alignment is set up
correctly.

Bug: T71969
Change-Id: I6e5f003e18a9c5808d9a4b148eddf0d0f7e29e67
2014-12-10 16:46:16 -05:00
Timo Tijhof ee954cbdd5 Use String#slice instead of discouraged String#substr
Aside from the confusion and differences between substr() and
substring() and IE8 bugs with substr(), substr() was removed from
the spec as of ECMAScript 5. It's been standardised in the
optional Annex B section of ES5.

Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1
2014-12-06 21:26:20 +00:00
jenkins-bot c5ec9cb8d5 Merge "Methods for new "maps" property in TD Root" 2014-11-17 20:56:49 +00:00
jenkins-bot ad92b977d5 Merge "Followup a054a75: don't reintroduce removed template parameters" 2014-11-10 20:44:28 +00:00
Roan Kattouw 5f1e7a651c Followup a054a75: don't reintroduce removed template parameters
Deep-extending originalData is asking for trouble, because there's
no way to delete anything that way.

Bug: 73134
Change-Id: I44d3e582e04942efceae3e0bdbbaa147095b5146
2014-11-10 15:04:42 -05:00
Roan Kattouw 2ba844a372 Followup c232083: use getRelativeTitle for template titles
Otherwise we output stuff like {{Template:Echo|hello}}

Change-Id: Ib6c3996ab40e01a5ddce84b7daffa27a74020ee5
2014-11-10 15:03:10 -05:00
Ed Sanders 5238d06dc7 Support pre's in tables
Bug: 73100
Change-Id: I971420047026c91ed92a19a52d2fd3b6fbeac24a
2014-11-07 15:44:13 +00:00
jenkins-bot 209dbe2449 Merge "Allow headings in table cells" 2014-11-05 23:52:23 +00:00
Ed Sanders 26f567d84f Allow headings in table cells
We possibly want to discourage this somehow but our current
functionality achieves this by doing an isolateAndUnwrap
which for a table is catastrophic.

Bug: 72990
Change-Id: I79f1348da20385dfec014afcac0fb5464580cf2f
2014-11-05 22:34:13 +00:00
Roan Kattouw c23208371a Followup 0165a53: don't store an mw.Title object instead of a string in TemplateModel
0165a53 overlooked the fact that 'name' is also passed to
the MWTemplateModel constructor, and there it really does
always need to be a string, not magically either a string
or an mw.Title object. Oops :(

Bug: 72961
Change-Id: I0b20f0768aae4d9cc9f7af268abd0a704b6adc3a
2014-11-04 10:58:53 -08:00
Roan Kattouw 362d0ebcdf Followup 0165a53: fix typo causing undefined to be passed to mw.Title
Bug: 72948
Change-Id: I1942f153f18c5a182de38a0e067ec5a92abeefd3
2014-11-04 10:53:58 -08:00
jenkins-bot bb96a9083f Merge "Replacing MWTitleInputWidget.getValue() with MWTitleInputWidget.getTitle()" 2014-11-04 01:18:38 +00:00
suchetag 0165a53044 Replacing MWTitleInputWidget.getValue() with MWTitleInputWidget.getTitle()
Now that we have .getTitle() as a method in MWTitleInputWidget, replacing the callers
of MWTitleInputWidget.getValue() with .getTitle(). This fixes a bug in the .getTitle()
method in MWTitleInputWidget which was not taking the namespaces into account before.

Also fixes: the error when entering "Talk:" as a template title. The button to add template
remains disabled when "Talk:" is given as an input to the title here.

Bug: 71998
Change-Id: I1e629a61ec8b035d93a4b7acfecab81934019166
2014-11-03 17:05:51 -08:00
Alex Monk b71bb51171 Remove more references to ve.bind
Seems some of them have crept back in since I1a7fc7f2 (and we missed one somehow)

Bug: 72156
Change-Id: I5631fb7d5963d06aeb238c1daa44344b2060ef1a
2014-10-30 20:55:44 +00:00
jenkins-bot c83961842c Merge "Preserve original data inside parameter objects too" 2014-10-30 20:47:32 +00:00
Roan Kattouw a054a753be Preserve original data inside parameter objects too
Parsoid has added a "key" property to parameter objects,
so now we have to preserve that rather than regenerating
all parameter objects.

Do this by changing the existing use of this.originalData
to a deep extend.

Change-Id: Ib4d31c2e0f7b567da1a148b51c42e688a2590b8e
Bonus: avoid modifying this.originalData
2014-10-30 11:59:42 -07:00
Roan Kattouw 190ba17b74 Also add tableCaption to mwTable parentNodeTypes hack
Change-Id: Ic7e387bdb774699746e6bafb62daf9c843af77b5
2014-10-30 11:38:26 -07:00
jenkins-bot 48e40fe3c2 Merge "MWTransclusionModel: Exclude parts serialising to '' from the plain object" 2014-10-29 23:20:48 +00:00
Roan Kattouw f35d577acb Followup e0981a3: don't pass undefined to getClassAttrFromAttributes()
Change-Id: I987345cd923d1b128573f5669d4d0dd4e82db1c9
2014-10-29 14:50:50 -07:00
Ed Sanders e0981a327f Create mwTables with wikitable attribute by default
Change-Id: I094b1823248e16dd3b9a0a10ba13104f14798621
2014-10-29 12:52:24 -07:00
Ed Sanders cfee8047e4 Use ClassAttributeNode mixin in MWBlockImageNode
This functionality was factored out into core for this purpose.

Depends on I2db6563 in core.

Change-Id: I4fc42e1468a9f0860c7c13e73967204bdf5ad78d
2014-10-29 18:28:33 +00:00
Alex Monk a982d2d3fe MWTransclusionModel: Exclude parts serialising to '' from the plain object
So we get rid of empty content nodes

Bug: 63341
Change-Id: I1d49cc709bf92cc53ba064d148a76650c5143935
2014-10-29 01:08:41 +00:00
jenkins-bot 20b20bc97c Merge "Move autoValue logic from ui.MWParameterPage to dm.MWParameterModel" 2014-10-27 18:15:08 +00:00
Alex Monk 8120dac27b Move autoValue logic from ui.MWParameterPage to dm.MWParameterModel
Also add missing MWParameterModel#getDefaultValue

Bug: 72404
Change-Id: I4bb117d419f3845f44e321f848e95bb246a24e24
2014-10-27 03:31:36 +00:00
Moriel Schottlender b8f96bb512 Make sure initialHash exists before checking its value
(Followup on If17b50cc4a39993)
Make sure initialHash is set before checking and changing its value
in the MWImageModel method. If a user chooses a brand new image to
insert into the document (an insertion rather than update) then the
initial hash is empty, and changing its values will fail with an
error message.

Bug: 72492
Change-Id: I3f9ea74891cc0ab77a07fa5d4e9cbc591f5b93e6
2014-10-24 16:18:06 -04:00
Marielle Volz 2ac7959849 Methods for new "maps" property in TD Root
Methods for new "maps" property in
Template Data JSON root added to
the Template Specification Model

* Added maps property to MWTemplateSpecModel
* Maps filled in extend function
* Added getter function for maps

Depends on I3bf5e002

Change-Id: Ic555093625358d8fc4cb1ca8c68793b5912e8ced
2014-10-24 14:23:46 +01:00
Moriel Schottlender 14e1de1009 Update initialHash after getting defaultDimensions in image model
On initialization, the image model has an initial scalable that has
the given currentDimensions from Parsoid; these are usually correct.
However, in cases where the wiki settings do not fit the user settings
and the images appear smaller or bigger in practice than the values
of the wiki-defaults, the initial hash will store the wrong values.

We will only know what the real values for the comparison will be
after we get them from the API and the calculation; only at that
point we can update the image model initial hash.

This is important so that later the dialog can properly understand
whether to enable the "apply" button if a user changed an image
to custom size and then back to default.

Change-Id: If17b50cc4a39993f98a20a3fec3ddf5d8cb400b3
2014-10-22 00:11:43 +00:00
suchetag e3d185dd90 Replacing push.apply in VE-MW with ve.batchPush from VE core
Bug: 66206
Change-Id: Ifabfd0f28b8133e40ce822ed768442ab6a4d39ad
2014-10-16 23:12:22 +05:30
jenkins-bot 8005868566 Merge "Make MWTransclusionModel and MWTemplateDialog extensible" 2014-10-10 20:40:19 +00:00
Christian Williams 1fc13cce68 Make MWTransclusionModel and MWTemplateDialog extensible
Wikia has done some work on the template user experience, including
automatically showing all available parameters without the use of
TemplateData. In order to make our changes, we had to make some changes
to VE-MW.

ve.dm.MWTransclusionModel.js
* this.specCache is created so subclasses can reference it.
* Promise handlers in the fetch() method have been broken out as class
  methods so they can be overridden in subclasses.

ve.ui.MWTemplateDialog.js
* addPromptedParameters() has been moved to the
  initializeNewTemplateParameters() class method so subclasses can
  overwrite. In Wikia's implementation, we have a method of getting
  all parameters and a dialog that shows all of the parameters, so the
  request to addPromptedParameters is overwritten.
* Added a done() handler to the transclusionModel promise for Wikia
  extensibility.

Change-Id: I073c5850420e7719e82957f879423c2717af674a
2014-10-10 20:38:18 +00:00
jenkins-bot 1d3f875dc4 Merge "Apply link styling logic to transclusion nodes" 2014-10-08 14:30:01 +00:00
Alex Monk 8f7713e796 Apply link styling logic to transclusion nodes
Only template nodes for now. Not sure what we can do about generated content nodes in general...

Bug: 65353
Change-Id: I848f36764b446ed30c74c0e641d0973008f6880b
2014-10-08 15:03:40 +01:00
Ed Sanders 1af18c3c12 Update VE core submodule to master (984b57a)
New changes:
6bbcd6a Localisation updates from https://translatewiki.net.
b8d8a5b [BREAKING CHANGE] The Great Selection Rewrite of 2014

Local changes:
Update to use new selection/range API

Change-Id: I5480d5c77d599c93c2d374fac88bb2fdb68b0024
2014-10-07 21:39:33 +02:00
jenkins-bot 64b2568465 Merge "Use mw.Title#getRelativeText to deal with titles relative to specific namespaces" 2014-09-26 02:50:43 +00:00
Alex Monk ef1cebd111 Use mw.Title#getRelativeText to deal with titles relative to specific namespaces
Added in MW core in Ie554adef, was backported to 1.24.

Change-Id: Iedc0319042529d41d29846d1734b5481850e9552
2014-09-26 02:47:18 +00:00
Ed Sanders 26751dc4a1 Prevent exception throwing in getFilename of MWImageNode
This doesn't happen in real life (as resource is always set) but
it allows us to contruct these nodes from the factory with no data.

Change-Id: Iea146f5dc128ad9d0f36a79b6fe67d622767d46c
2014-09-24 20:43:57 +01:00
Timo Tijhof 66de06b0fa Replace use of ve.isArray with native Array.isArray
Change-Id: Ibc45e0fd80db7da872f6ef934cef915be9366e06
2014-09-23 17:58:09 -07: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
Roan Kattouw cf1a889ac8 Update VE core submodule to master (5f4b740)
New changes:
a047e72 [BREAKING CHANGE] Create ve.dm.Focusable and store focusable flag there

Local changes:
* Add new ve.dm.FocusableNode mixin where required

Change-Id: Ie9ee2de05acfe3c4c62c4864e65bd20397d6a069
2014-09-16 18:45:22 -07:00
jenkins-bot 71875de0c6 Merge "Check for changes in the model" 2014-09-04 21:07:12 +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
Moriel Schottlender a83086c007 Set default dimensions based on original dimensions
Make sure default dimensions are only set if we have the original
dimensions. Also fix a bug where image default dimensions were
calculated according to current width/height rather than those
of the original dimensions.

Bug: 68000
Change-Id: I8c3acc18b317f82c6b88966950e74b956936dda4
2014-09-04 11:29:51 -04: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
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
Ed Sanders 4af79bf3d5 Re-order methods in MWImageNode
So static methods are actally in the section marked 'Static methods',
before non-static methods, per our coding standards.

Change-Id: I17bea17a1409b02f263375c6434be872e4d239ba
2014-08-22 13:33:08 -07:00
jenkins-bot 0af7c2d634 Merge "Correct MWImage* resource regex to find literal .s rather than characters" 2014-08-21 02:07:50 +00:00
jenkins-bot df85006b03 Merge "Refactoring ImageModel constructor" 2014-08-21 01:54:46 +00: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
James D. Forrester 7d3f9797c0 Correct MWImage* resource regex to find literal .s rather than characters
Change-Id: Ie5db0b4b6cdb607985b53228c4ceb26c57af9dfc
2014-08-20 18:16:13 -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
Bartosz Dziewoński 694c454dcd Blacklist annotating link node with more links
Previously one could select over a link node and linkify the
selection, with tremendously funny results.

Change-Id: Ic5a2132b2d18280099a6024bc4ec2b1333eca98f
2014-08-02 12:34:30 +02:00
jenkins-bot 06f29e6895 Merge "Remove redundant setting of title in link nodes" 2014-07-30 17:22:49 +00:00
Ed Sanders c451656d6d Remove redundant setting of title in link nodes
Also cleanup redundant overrides, documentation and
unused messages.

Depends on If22a5197 in core.

Change-Id: I533235f4eb5d703783a8fb45dff5e7be465f4ebb
2014-07-30 10:32:49 +01: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
Roan Kattouw c7fce9b2be Fix corruption bug in sortkeys containing underscores
We normalize underscores to spaces in sortkeys in toDataElement,
but when toDomElements recomputes the normalization to decide
if the sortkey really changed, it doesn't normalize underscores.
This is broken, both code paths need to use the same normalization;
we do this correctly for the category name.

This bug appears to date back to the introduction of category
support in March 2013 :(

Spotted in https://it.wikipedia.org/?diff=67220927

Change-Id: Ie3257fa335f3bd24a36c8654f3f5a24e89d7a9b9
2014-07-26 00:24:01 +00:00