Commit graph

200 commits

Author SHA1 Message Date
Translation updater bot 040b967800 Localisation updates from http://translatewiki.net.
Change-Id: I5fb67249e56a43270a571c3ef6c49dfcb6aba116
2013-05-29 08:41:31 +00:00
Translation updater bot cfa4f51c26 Localisation updates from http://translatewiki.net.
Change-Id: I05ffd7e6fe818f0c6acb22ff429c815d6ea5c487
2013-05-24 08:38:17 +00:00
Translation updater bot 0efa7df7a5 Localisation updates from http://translatewiki.net.
Change-Id: I3fb27843c118201eb81e81ef1ebe266863d13e48
2013-05-21 05:58:59 +00:00
Translation updater bot 1adb71a39a Localisation updates from http://translatewiki.net.
Change-Id: Ia95c42eed593700ffce7efb8b24d5a141bdeecbe
2013-05-16 20:18:33 +00:00
Timo Tijhof 70ab71d6a3 phpcs: Resolve style violations
Change-Id: Ie5d4d84b8d7b6bc88e7a5a1559579e504dd1bd20
2013-05-16 15:31:25 +00:00
Timo Tijhof 708bbad12d Implement Sets
Change-Id: I93a0ba7287fec6e5566994d03dff1d8eaeeb8430
2013-05-16 01:35:31 +02:00
Timo Tijhof 1a38b42241 tests: Reformat tests, evaluate status in addition to I/O
Previously we only compared output, we now evaluate
status as well.

For example test {} => {} was misleading since the reason
it roundtripped was because it is *invalid* and we replace
invalid blobs with an empty object in blob storage.

But in the API this'll never get used because getStatus
will have a fatal error in it. Which overrides the data.
The tests were previously looking in the data whilst ignoring
the return status.

Change-Id: I9809f126c1615c9bc9c28ce2d8bb7953058cbf6e
2013-05-16 01:25:09 +02:00
Timo Tijhof 2c89726e6e spec: Update specification for InterfaceText structure
Since we now have an occurance of InterfaceText that isn't
optional (namely Set#label, which must not be null) move the
"null" value type to all other uses of InterfaceText instead
of in InterfaceText itself.

Change-Id: I92786492a37d907aad446655704ea1b52938ab21
2013-05-15 23:38:37 +02:00
Timo Tijhof 0878be5ad9 spec: Update specification for Set structure
* Inside a Set object, label is no longer optional
* The "sets" container (Root.sets) will be an array instead
  of an object. They don't need to have an internal key.
  Contrary to Root.params where the key relates to the
  parameter key in wikitext.

Change-Id: Iede29d25cd6ecbcf43970e1e45e60e5aac206a95
2013-05-15 23:36:39 +02:00
Translation updater bot 6116171d69 Localisation updates from http://translatewiki.net.
Change-Id: I388324d9186a16c6688ba2fe9db28a94e1d2354a
2013-05-15 21:10:06 +00:00
Translation updater bot 53eed0e687 Localisation updates from http://translatewiki.net.
Change-Id: I79bcd30791c285a2510f1026148001e7aefea0cb
2013-05-13 19:52:42 +00:00
Translation updater bot a4ae8d91bb Localisation updates from http://translatewiki.net.
Change-Id: I69eca3c77b4aaceba5ce0d7b474f21a5ad4e6ec3
2013-05-11 19:41:50 +00:00
Translation updater bot 09a84e1d9b Localisation updates from http://translatewiki.net.
Change-Id: Id35816afc9df8471edbf934b16b07be346779770
2013-05-10 19:56:18 +00:00
Timo Tijhof 059c5b18f1 TemplateDataBlob: Improve error handling
For invalid keys, pass property path, not just the latest
child.

Changes error:
 - Invalid value for "typo"
 + Invalid value for "params.date.typo"

Also cleaned up the concatenation logic for the others to
be more readable (PHP dots vs. string dots):
 - 'params.' . $paramName . '.key'
 + "params.{$paramName}.key"

Change-Id: I666e0b22f4b7bacc5b89b0761c74138732f94d73
2013-05-09 07:12:05 +00:00
Timo Tijhof 5e50116d6d TemplateDataBlob: Implement 'type' and 'label'
InterfaceText now defaults to null instead of {en:""} which
was awkward to deal with in the frontend.

As specified:
- label is InterfaceText
- type is a string and must be a one of the recognized types

Updated example for the hypothetical variant of Template:Unsigned
and removed other no longer needed example.

HTML output has been revised per conversation with Trevor,
James and Timo:
- Not sortable.
- Add label to html output.
- Aliases in the main parameter column (one per line),
  but muted in styling.
- Add type to html output.

The css module styles content from the server, not content
generated by javascript. Moved module to position => top to
fix flash of unstyled content.

Change-Id: I16d3f9e460c5513935b9b55fe4cec0092b38e6c2
2013-05-09 02:49:56 +00:00
Translation updater bot e3272a50a7 Localisation updates from http://translatewiki.net.
Change-Id: If380597afc6d026489c13b6ecaf3ea1e155c57e4
2013-05-05 21:10:47 +00:00
Trevor Parscal ff5591db45 Merge "spec: Update 'type' documentation following 2013-04-30 discussion" 2013-05-02 20:56:46 +00:00
Trevor Parscal f1512577b2 Merge "TemplateDataBlob: Don't add class "sortable" to HTML rendering" 2013-05-02 20:56:33 +00:00
Trevor Parscal 34325173cc Merge "TemplateDataBlob: Convert 'clones' to 'inherits'" 2013-05-02 20:56:15 +00:00
Trevor Parscal 86c06c8eaf Merge "TemplateDataBlob: Add comments referencing parts of the spec" 2013-05-02 20:54:17 +00:00
Translation updater bot a714c01ca8 Localisation updates from http://translatewiki.net.
Change-Id: I350558d26464ed12e64c03f5b74ed6a577d8897e
2013-05-02 20:49:35 +00:00
Timo Tijhof 4fcd9b5e3e spec: Update 'type' documentation following 2013-04-30 discussion
* Namespace wiki-specific types under "wiki/"
* wiki/user does not have to be an existing user

Change-Id: I3e0dc99fcede999e3ac83a25573bfe00cacef758
2013-04-30 23:32:25 +00:00
Timo Tijhof 8636d19ca8 TemplateDataBlob: Don't add class "sortable" to HTML rendering
Change-Id: I7268a5a4d1cced7eaf74f8c6000144287bce397e
2013-05-01 00:32:31 +02:00
Timo Tijhof 61ab90278a TemplateDataBlob: Convert 'clones' to 'inherits'
Before

{
  a: {
    ...,
    clones: ['a2', 'a3']
  },
  a2: {
    some: 'thing'
  },
  a3: {
    other: 'thing'
  }
}

After

{
  a: {
    ...
  },
  a2: {
    inherits: 'a',
    some: 'thing'
  },
  a3: {
    inherits: 'a',
    other: 'thing'
  }
}

Change-Id: Ib17d9e299d503c35e3ee817d3cc4ecb56186b84c
2013-05-01 00:32:08 +02:00
Timo Tijhof 93e8f78fec TemplateDataBlob: Add comments referencing parts of the spec
Also moved 'inherit' up to make the code easier to follow.

Change-Id: I0059236924c5b49bff71a745b9895651c4eb6d0b
2013-04-30 23:24:44 +02:00
Translation updater bot 1462a2b568 Localisation updates from http://translatewiki.net.
Change-Id: If5221b93b01db1392ef1bc88c64068f029ae90aa
2013-04-28 23:58:08 +00:00
Timo Tijhof 942c88f749 API: Update/Normalise before outputting
I ran into countless random exceptions and errors locally due to
cache I built up over time that was no longer valid. Though in
approved commits in the repository there is only 1 version as of
now, I'm sure we will make changes in the future that require a
cache invalidation since getHtml needs to be able to make
assumptions about what properties exist.

Also fixed a bug in the parse() method where the 'deprecated'
property is asserted the wrong way around. Added a test for it.

Change-Id: I5f61d6030578a711909435c8b996373e9aaa5178
2013-04-23 23:52:37 +00:00
Timo Tijhof b18ca675bc TemplateDataBlob: Fix getHtml exception
getHtml failed with a PHP exception in Html.php regarding
converting stdClass to string.

Change-Id: I9b703d496684a9d389ec6112895a3d21a0c763b3
2013-04-22 22:07:21 +02:00
jenkins-bot c28968940b Merge "Add unit tests and fix implemention accordingly" 2013-04-22 18:09:49 +00:00
Timo Tijhof ffd8899def Add unit tests and fix implemention accordingly
* Add unit tests for all types of invalid input we check for.
* Add unit tests for all types of input we expand or otherwise
  normalise.

* Implement InterfaceText expansion/normalisation.
* Fix bug that caused a string value in the root description property
  to be considered invalid (it only accepted an object, it should
  accept both).

Change-Id: I5a15080f1f924451a9dde8af96ea2922011981ec
2013-04-22 07:42:49 +00:00
Translation updater bot a5c72eaa4d Localisation updates from http://translatewiki.net.
Change-Id: I89ef79050cdf7128ba5e363330c9369fa4bb6622
2013-04-15 21:03:47 +00:00
Translation updater bot bdcc0db751 Localisation updates from http://translatewiki.net.
Change-Id: I50dc3221373aa19a2f09e17bc986819b600359ac
2013-04-07 20:57:43 +00:00
Translation updater bot fbc799a1e9 Localisation updates from http://translatewiki.net.
Change-Id: I4cd14bdfb754b5c8dada7c1747b750cecba2d8bd
2013-04-04 20:08:11 +00:00
Translation updater bot bb57e205c1 Localisation updates from http://translatewiki.net.
Change-Id: Ie127d6e0d5e5365ef58f2292c367e7338524c0d8
2013-04-03 19:52:55 +00:00
Translation updater bot bdd5cbdded Localisation updates from http://translatewiki.net.
Change-Id: I9c1fedf7eba0af14ad1c4a0fe31846f9cb7b12ff
2013-03-31 18:55:27 +00:00
Translation updater bot 72f5a346bf Localisation updates from http://translatewiki.net.
Change-Id: I5a111357bd35f6ad7ce232c5ca32b92b7337e75f
2013-03-30 18:15:22 +00:00
jenkins-bot e869c92384 Merge "API: Transform into a standalone module instead of a query submodule." 2013-03-30 10:21:45 +00:00
Timo Tijhof 30b4a592c6 API: Transform into a standalone module instead of a query submodule.
Change-Id: Ia858fa43a50ade947e6353d22dc89a519c3da61a
2013-03-30 01:53:39 +01:00
Translation updater bot b61d4e993f Localisation updates from http://translatewiki.net.
Change-Id: I1a78d98f3ee8c752b2e8eb19733464edf106a8a1
2013-03-28 19:15:50 +00:00
Translation updater bot 5d0f0b78fd Localisation updates from http://translatewiki.net.
Change-Id: I2b576cbf378b83458289a361f779815ac1acf9aa
2013-03-27 21:04:31 +00:00
Translation updater bot 5d65a44317 Localisation updates from http://translatewiki.net.
Change-Id: I7059c88d1729678dda479000eb3bbab1a3219d30
2013-03-25 20:13:05 +00:00
Translation updater bot f9b074ed2e Localisation updates from http://translatewiki.net.
Change-Id: I93e649164bc4e180445aa489c18219a5655907e3
2013-03-22 20:21:21 +00:00
Translation updater bot 74314a5761 Localisation updates from http://translatewiki.net.
Change-Id: I0451bbbcc98933abdab702d2004ec11e66ae99f1
2013-03-21 22:43:58 +00:00
Translation updater bot 4affa728c8 Localisation updates from http://translatewiki.net.
Change-Id: I62fa4d8943609e89d51cf6f3f59380fc5efb42b4
2013-03-20 21:02:08 +00:00
Translation updater bot 9cb8d38371 Localisation updates from http://translatewiki.net.
Change-Id: Iaa60f91f5014274616e54f5f8ab218a40097f279
2013-03-19 21:44:46 +00:00
Translation updater bot fe7dd60fb9 Localisation updates from http://translatewiki.net.
Change-Id: Ica51f2858e35ecd81ca8c687ad7b2581c8855814
2013-03-18 21:08:33 +00:00
raymond 5abfff9f0a Consistency tweak in preparation for adding extension to translatewiki.net
* Remove full stop from description message
* Remove TitleCase

Change-Id: Iab58e92e2a3a5c77cfd1cd7eba6f77f01d396aff
2013-03-15 14:41:38 +01:00
Timo Tijhof b7080c5f90 Initial TemplateData commit
Registers a parser tag <templatedata> that should have a JSON
blob as content. The blob is then validated and normalised when
MediaWiki parses the page (e.g. during save and preview).

If there are validation errors, the save is aborted from the
extension hook and an error is displayed.

If all goes well, the normalised blob is stored in the database
(which can be retrieved through the API). And an HTML
representation of the template parameters is returned to the
wikitext parser to show where the <templatedata> was in the page.

The blob format is specified in spec.templatedata.json and
is validated in TemplateDataBlob::parse.

Bug: 44444
Change-Id: Icf305892a9512545a63f5a5280cc0d340c61585f
2013-03-14 19:19:55 +00:00
Reedy e80a4b09ad Add .gitreview and .gitignore
Change-Id: I4ada55a19c029acdbb4cededcfc3ea24ea54ba46
2013-02-14 15:36:56 +00:00
Demon a23d03a739 Initial empty repository 2013-01-29 14:56:40 +00:00