Commit graph

29 commits

Author SHA1 Message Date
Bartosz Dziewoński b475eca1b9 Don't process references defined inside template-generated reflists
As a result, the references are now treated like any other
template-generated reference, e.g. they can't be edited.

Previously they could be edited as if they weren't template-generated,
causing trouble. Editing them had no effect (changes would not be
saved), and copy-pasting them into another page resulted in
"substituted" content (template metadata was lost).

Bug: T209493
Change-Id: I4e75ccd57cd752a726653c725d8c29a09306e83b
2020-01-04 15:53:21 +01:00
Ed Sanders e534585b18 RefList: Avoid changing 'responsive' value if meaning hasn't changed
Bug: T212340
Change-Id: I57ebe0fbf374c1ee7a7538a938d7b9fd904e80db
2019-03-28 16:40:39 +00:00
jenkins-bot ecb9c147f9 Merge "Avoid jQuery in ve.dm.Model.static.describeChange(s)" 2018-09-28 16:19:26 +00:00
Ed Sanders 817bfbfa54 Avoid jQuery in ve.dm.Model.static.describeChange(s)
Change-Id: If30d12289eff66470044931ea5b38d2b81d04075
2018-09-28 10:55:45 +01:00
Ed Sanders eb7bed046b Template reflist: Re-render when converting for preview (e.g. visual diff)
Bug: T202324
Change-Id: I33dfb26a8f033f5ee5a89b2c1ad9aa081d3a55d1
2018-09-13 21:04:47 +01:00
Ed Sanders 3b53f6906b Use getHtmlMessage for DiffElement
Bug: T195243
Depends-On: Ib4ad16858e4241d33d018830dbcfded63ff703af
Depends-On: Ib5fa39e4f2f529948354b03a141542e23d169fe0
Change-Id: I4b01904d48a9520c8bb1451e0978aaa404ca858c
2018-06-20 15:31:46 +00:00
Ed Sanders 2ae4cfe0ab Use ve.ce.nodeFactory.createFromModel
Also use ve.dm.nodeFactory.createFromElement

Depends-On: I259face33154b795143c8820abdfb6b4a495f141
Depends-On: I7fc539f75a1c9d672efc139b7884ecdfdff5f301
Change-Id: I032182616c409e65138b16fe7b238e7f7b3a8710
2018-05-11 17:08:12 +00:00
Ed Sanders 1c9653df9d Force re-rendering of ref list for clipboard
Change-Id: I9c2323a402fad60c0c81b8d21057049f94fdca83
2018-03-24 16:42:13 +00:00
Thiemo Mättig bbc1f2c91d Use standard form for @license tags
See https://spdx.org/licenses/

Change-Id: Ic091ebc3844abcd6de90b3241382fb4732200a6d
2018-03-20 03:18:37 +00:00
David Chan 21e1fc5742 Follow-through rename of originalDomElementsIndex->originalDomElementsHash
Bug: T188900
Change-Id: If2b908acc634253c35b220f267bcca648f45310b
Depends-On: If60d0c637fe92f0e7afe916c064fafb17980d063
2018-03-06 21:00:35 +08:00
jenkins-bot fd0c0af947 Merge "Ensure the DOM returned by toDomElements doesn't change" 2018-03-05 17:14:10 +00:00
Ed Sanders 3590446c2c Fix detection of template-generated ref lists
Bug: T188898
Change-Id: I77333323d8e6a324b1655c10c94ae397aad241b3
2018-03-05 16:11:03 +00:00
Ed Sanders 1a3566b203 Ensure the DOM returned by toDomElements doesn't change
By leaving the viewNode around, it would update itself later
(due to updateDebounced in the constructor), which would
modify $reflist, even though the caller was expecting
this to be some finalised DOM sub-tree.

Change-Id: Ia89a98556af26986f8362f5b352378cc321b6345
2018-03-03 18:58:33 +00:00
Thalia 900e7d6c8b Define getHashObject for reflist node
This will stop us from showing meaningless diffs (eg
setting responsive to whatever the default already was).

Logically depends on 13a3d0527f.

Change-Id: I0c6a3385d9a493c3854975607cd75d2bf8c1e990
2018-02-24 17:33:19 +00:00
James D. Forrester 43344b56b0 VisualEditor: Describe reflist responsiveness changes too
Bug: T160589
Change-Id: Idb590bf0f3edbe8d056f544a148323da30211467
2018-02-22 16:01:46 -08:00
James D. Forrester be1f7c0b74 VisualEditor: Use reflist diff i18n for reflists and ref ones for refs
Change-Id: Ieb3f1a30c1777f11a7334423156df4c9fdb9d79f
2018-02-22 16:00:36 -08:00
Ed Sanders 495d9420f0 Treat template-generated reference lists as real ones
This will allow them to auto-update, and be used in the
visual diff.

We record a templateGenerated attribute to prevent them
being edited, and to ensure they roundtrip back to
templates.

Bug: T52769
Change-Id: I4460d2c98166581e942e35921b20091990f5f6c7
2018-02-07 10:48:57 +00:00
Ed Sanders f1d1cf38f5 Render ref list from CE node when converterting for clipboard
Bug: T186407
Depends-On: Iee635eaf42e3780da4e46e3c0f12417aa331655b
Depends-On: I1500f42dc0bf761f495e25c2d3d047157292df7d
Change-Id: Ia3b2549eb246fc0af56446a7d6a32ec0f54f4099
2018-02-06 16:47:07 +00:00
James D. Forrester 0999d771b6 doc: Bump copyright year
Also make the overly-terse statement clearer.

Change-Id: I752bb82444bf7cb41480076bace42331dc35a598
2018-01-02 17:05:50 -08:00
David Lynch d54fbf287d MWReferencesList: drop autoGenerated attribute if changed
If the user has moved the reflist away from the end of the document, or
changed any properties on it, it shouldn't be treated as autoGenerated any
more.

Bug: T153754
Change-Id: I348601952dbfcf06bfb564e4db9cac820f3b2776
2017-11-07 11:56:08 -06:00
Ed Sanders a3a4bd945b VE: Support 'responsive' attribute
Bug: T53260
Change-Id: I1e0ae39e8c30653b7ba0f537723a4bcd79ac3162
2017-09-19 17:03:39 +01:00
Thalia 1a5d90b4e3 Visual diff: Show correct reference indices in diff
Bug: T162819
Change-Id: I7eec4ee12a24ff99388cc0c95a24d50f321511f9
2017-06-26 19:19:03 +00:00
James D. Forrester 9a17d9342b Describe group changes for references and references lists
Bug: T160589
Change-Id: Ifccafdf08704f67027dae2703ff2ded809fb6ab7
2017-05-20 14:26:58 +00:00
James D. Forrester 0d20873fa6 doc: Bump copyright year notice, 'team' name
Change-Id: Ia090c417a1aa716b255613199b5e49616bf0517a
2017-04-20 16:50:43 +00:00
Ed Sanders a6460a3025 VisualDiff: Ignore changes to originalMw
This can happen when switching editors.

Change-Id: Iec86efcdf5488918e53d69a0217d1ec4e3bb7f88
2017-04-10 21:18:26 +01:00
Ed Sanders 4c0e837dad Use stricter test for originalDomElementsIndex
Change-Id: I43a0f639fa50fb2bbe9f935dd141d595571d8e24
2016-11-02 12:51:10 +00:00
Ed Sanders f4240f13f9 Use 'super' to call parent methods
Change-Id: Iba051a1e84b2ea805d0b3795933587c735ec0d88
2016-11-02 12:43:14 +00:00
Ed Sanders fc4788d51b Move originalDomElements to IV store and use new hash
Depends-On: I8a71c1a40ec35108d0a9a388da6f75632f8dc53c
Depends-On: I0fbb6324eede94558426178cbdad6b5daf0f8318
Change-Id: I32c9b5f984fcf96e3354841ecfcd444149e8f159
2016-08-24 18:14:47 +00:00
Ed Sanders 18f616b9b8 VisualEditor: Move code for Cite into this repo
This code has been developed over three years now in the repo of MediaWiki's
integration of VisualEditor. It has grown and developed significantly during
that time, but now is pretty stable. A number of hacks inside the MediaWiki-
VisualEditor code base have been used to prevent this code from being loaded
on wikis where the Cite extension is not deployed, but this state of affairs
is and always was meant to be temporary.

This code is under the MIT licence which is a tad messy, but not impossible.
It's clearly labelled as such. The list of authors has been updated to take
into account the influx of new functionality.

Bug: T41621
Bug: T104928
Change-Id: I39936ed83d5a60471a0a75da753f498e80aef234
2016-02-04 08:41:54 -08:00