User talk:מקף/wikilambda editsource.js

From Wikifunctions

New wikilambda editsource script!🔌λ

User:מקף/wikilambda editsource.js

Hi everybody,
I created a script for a source code editor👆.
Hope it will be useful, and I would be even more happy if other JS programmers and interface editors agree to help me improve it, and maybe turn it into a gadget.
For now, you can easily try using it by jumping into Special:mypage/common.js and adding the following line:

mw.loader.load( '//www.wikifunctions.org/w/index.php?title=User:מקף/wikilambda_editsource.js&action=raw&ctype=text/javascript' ); // [[:f:User:מקף/wikilambda_editsource.js]]

Feedback is welcome.
Thank you, · מקף Hyphen · 02:18, 2 April 2024 (UTC)Reply

Can you say a bit more about what it does and in which circumstances you expect it to be most useful? --99of9 (talk) 05:17, 2 April 2024 (UTC)Reply
  • The script retrieves the content of the edited item, represented in JSON format (Wikifunctions:Function_model). It allows the editor to access the raw representation directly, and edit it textually.
  • This feature is especially useful when there is a need or preference to perform operations, which are not easy to perform in the user interface. The interface includes a built-in limitation of repetitive selection and typing (which are also done in an order that cannot be changed or started in the middle/end).
    For exmple:
    1. Typing a long list of strings (such as Hebrew list of strings: Number names (default-female) (Z14617)).
    2. Import content that the user has produced elsewhere.
    3. Copying from one item to another, with some specific changes.
    4. Splitting an item
    5. Changing internal order (such as replacing the order of composition of multiple functions) without retyping everything.
...and maybe other things I haven't thought of.
I also created this script as a possible basic infrastructure for creating future scripts that can accompany and help us edit. For example, tasks suggest translations for fields with common names.
~ · מקף Hyphen · 17:42, 2 April 2024 (UTC)Reply
I have added the script to Wikifunctions:User scripts. --Ameisenigel (talk) 19:51, 2 April 2024 (UTC)Reply
@99of9 it also allows using an edit summary, something that is sorely lacking for the normal editing of connecting/disconnecting implementations and tests --DannyS712 (talk) 01:09, 9 April 2024 (UTC)Reply