Community Wishlist Survey 2017/Editing/Provide easy interface for replacements in the Visual Editor
Appearance
Provide easy interface for replacements in the Visual Editor
- Problem:
- Various popular scripts in Wikipedia manipulate the underlying data using wikitext for example:
- fawiki - https://fa.wikipedia.org/wiki/%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Gadget-Extra-Editbuttons-persianwikitools.js
- hewiki - https://he.wikipedia.org/wiki/מדיה_ויקי:Gadget-Checkty.js (process_page)
- rowiki - https://ro.wikipedia.org/wiki/MediaWiki:Diacritice.js
- ruwiki - https://ru.wikipedia.org/wiki/MediaWiki:Gadget-wfTypos.js
- (and there are many more...)
- VE currently supports basic manipulations using surface.change( transaction ) or to do replacements similar to FindAndReplace dialog but it has some gaps:
- Not intuitive/no interface for replacements - Some scripts use different tricks for doing replacements (en:User:ערן/veReplace.js, ro:Utilizator:Strainu/ve.js) and a standard and easy method for doing it would make it easier for future maintenance and for supporting those usages.
- Global replacements aren't supported - Going global replacements similar to hewiki/fawiki scripts isn't possible with the current model, and even if it is it would be inefficient (hewiki runs ~850 regex replacements on the whole document)
- Replacement that keep annotations aren't possible
- Various popular scripts in Wikipedia manipulate the underlying data using wikitext for example:
- Who would benefit: At least fawiki, hewiki, rowiki and ruwiki users, presumably many more
- Proposed solution:
- What most of the scripts needs are:
- A utility function for doing replacement (similar to ve.dm.Document.prototype.findText maybe ve.dm.Document.prototype.replaceText)
- The replacement should be able to keep the annotations
- Advance use: sometimes (as you can see in fawiki) replacements are context aware. It may be too far to support such complex replacements within ve itself, but providing documentation how to do it would be great.
- What most of the scripts needs are:
- More comments:
- Moved from Bots and gadgets to Editing as we supposedly would want a general solution rather than a gadget on a few select wikis. Max Semenik (talk) 19:48, 8 November 2017 (UTC)
- Phabricator tickets: phab:T106996 (more specific issues that would be solved by this are described in phab:T115847, phab:T106049, phab:T106641)
- Proposer: Strainu (talk) 07:45, 7 November 2017 (UTC)
- Translations: none yet
Discussion
[edit]- I support this request. I think this is a major blocker for advanced gadgets for VisualEditor, hence blocker for wider adaption of VE for experienced users. eranroz (talk) 10:36, 17 November 2017 (UTC)
Voting
[edit]Support This will greatly ease the maintenance of various scripts in multiple projects. Strainu (talk) 22:20, 27 November 2017 (UTC)
Support Much needed on rowp! Gikü (talk) 23:16, 27 November 2017 (UTC)
Support Macreanu Iulian (talk) 05:42, 28 November 2017 (UTC)
Support Tgr (talk) 07:16, 28 November 2017 (UTC)
Support --Liuxinyu970226 (talk) 13:04, 28 November 2017 (UTC)
Support --Accipiter Q. Gentilis (talk) 20:04, 28 November 2017 (UTC)
Support Braveheart (talk) 21:36, 28 November 2017 (UTC)
Support Thomas Obermair 4 (talk) 21:45, 28 November 2017 (UTC)
Support Miehs (talk) 06:39, 29 November 2017 (UTC)
Support Sebastian Wallroth (talk) 07:24, 29 November 2017 (UTC)
Support Andrei Stroe (talk) 09:02, 29 November 2017 (UTC)
Support eranroz (talk) 09:44, 29 November 2017 (UTC)
Support Turbojet (talk) 15:47, 29 November 2017 (UTC)
Support--Silenzio76 (talk) 18:07, 29 November 2017 (UTC)
Support Bardia90 (talk) 22:04, 29 November 2017 (UTC)
Support - yona B. (D) 06:51, 30 November 2017 (UTC)
Support Dromedar61 (talk) 20:47, 30 November 2017 (UTC)
Support — Andreyyshore T C 17:47, 1 Dec 2017 (UTC)
Support Theklan (talk) 18:41, 1 December 2017 (UTC)
Support Amir (talk) 00:52, 2 December 2017 (UTC)
Support Tacsipacsi (talk) 11:46, 3 December 2017 (UTC)
Support Ciao • Bestoernesto • ✉ 02:50, 4 December 2017 (UTC)
Support Cool. Anthonyhcole (talk) 12:23, 4 December 2017 (UTC)
Support Sîmbotin (talk) 15:00, 7 December 2017 (UTC)
Support --Sfântul (talk) 16:02, 7 December 2017 (UTC)
Support RandomDSdevel (talk) 01:40, 9 December 2017 (UTC)
Support Jack who built the house (talk) 21:43, 10 December 2017 (UTC)
Support Lone Guardian (talk) 22:12, 10 December 2017 (UTC)
Support Jnanaranjan sahu (talk) 06:39, 11 December 2017 (UTC)
Support --Aqetz (talk) 08:02, 11 December 2017 (UTC)
Support Tiputini (talk) 16:13, 11 December 2017 (UTC)