<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luci/modules/luci-base/htdocs/luci-static/resources/form.js, branch es6</title>
<subtitle>LuCI - OpenWrt Configuration Interface</subtitle>
<id>http://x-nagi.com/cgit/luci/atom?h=es6</id>
<link rel='self' href='http://x-nagi.com/cgit/luci/atom?h=es6'/>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/'/>
<updated>2023-09-26T07:36:25Z</updated>
<entry>
<title>luci-base: convert JavaScript code to ES6 style</title>
<updated>2023-09-26T07:36:25Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2023-08-31T15:03:49Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=4c7a3925b83d45e61cb7610614cb8b04705d1ec5'/>
<id>urn:sha1:4c7a3925b83d45e61cb7610614cb8b04705d1ec5</id>
<content type='text'>
Convert existing JavaScript code in LuCI base to utilize ES6 standard
features such as spread arguments, arrow functions, object method
declarations etc.

This makes the code somewhat easier to follow and slightly smaller.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-base: Fix typos in JsDocs</title>
<updated>2023-09-23T07:39:34Z</updated>
<author>
<name>Sergey Ponomarev</name>
<email>stokito@gmail.com</email>
</author>
<published>2023-09-23T07:39:34Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=7744ad0075bda689346a3868f36a57c8b53b23c8'/>
<id>urn:sha1:7744ad0075bda689346a3868f36a57c8b53b23c8</id>
<content type='text'>
In some places argument name was renamed but in the JsDoc it's remain old.

Added more typing for string enum fields like:

 @param {string} [type=text]

replaced with:

 @param {"blob"|"text"|"blob"} [type=text]

Signed-off-by: Sergey Ponomarev &lt;stokito@gmail.com&gt;
</content>
</entry>
<entry>
<title>luci-base: "an URL" replace with "a URL"</title>
<updated>2023-09-23T07:16:49Z</updated>
<author>
<name>Sergey Ponomarev</name>
<email>stokito@gmail.com</email>
</author>
<published>2023-09-23T07:16:49Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=f423025927c73947db0a280219d61cd872cebee6'/>
<id>urn:sha1:f423025927c73947db0a280219d61cd872cebee6</id>
<content type='text'>
This is a correct form

Signed-off-by: Sergey Ponomarev &lt;stokito@gmail.com&gt;
</content>
</entry>
<entry>
<title>luci-base: form.js: reuse JSONMap data provider in GridSection modals</title>
<updated>2023-02-04T21:22:53Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2023-02-04T21:15:42Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=dd47f3f6742a6d80221b75aa7b6ea27eca2bb535'/>
<id>urn:sha1:dd47f3f6742a6d80221b75aa7b6ea27eca2bb535</id>
<content type='text'>
Reuse the same data provider as the parent JSONMap instance in order
to avoid inadvertently mangling the form data when saving the modal
edit dialog.

Fixes: bb9ede238a ("luci-base: form.js: reuse JSONMap data provider in GridSection modals")
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-base: form.js: fix GridSection modals in JSONMap instances</title>
<updated>2023-02-04T20:03:51Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2023-02-04T20:03:51Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=6fe34990265a02dac20f7b352e4039a90fed45ca'/>
<id>urn:sha1:6fe34990265a02dac20f7b352e4039a90fed45ca</id>
<content type='text'>
Since grid section edit modals construct a new Map instance internally,
we must take care of using the correct map constructor type for the
internal copy in order to end up with the correct data provider.

Ensure that the extended option modal of GridSection instances uses a
JSONMap when the grid section's owner map is a JSONMap to avoid stray
uci related errors.

Ref: https://forum.openwrt.org/t/luci-save-apply/149658/5
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-base: help-text spell fix</title>
<updated>2023-01-17T20:24:44Z</updated>
<author>
<name>Paul Dee</name>
<email>itsascambutmailmeanyway@gmail.com</email>
</author>
<published>2023-01-17T20:24:44Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=3c2b35cf903378fc7dfa54fa4bc6c7a64b3bb471'/>
<id>urn:sha1:3c2b35cf903378fc7dfa54fa4bc6c7a64b3bb471</id>
<content type='text'>
Signed-off-by: Paul Dee &lt;itsascambutmailmeanyway@gmail.com&gt;
</content>
</entry>
<entry>
<title>luci-base: fix button handling for named sections</title>
<updated>2022-12-13T12:32:50Z</updated>
<author>
<name>Florian Eckert</name>
<email>fe@dev.tdt.de</email>
</author>
<published>2022-12-12T13:58:38Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=440a2e79a762b4152ccb7e41c90a2826d9fb3538'/>
<id>urn:sha1:440a2e79a762b4152ccb7e41c90a2826d9fb3538</id>
<content type='text'>
If more than one named section is added to the page, it is currently the
case, that the first button is always switched on or off during input
validation of the uci section name. This is because the usage of the
'document.querySelector' function is to imprecise. Changing the search
start to the element to be created, fixes this.

Signed-off-by: Florian Eckert &lt;fe@dev.tdt.de&gt;
</content>
</entry>
<entry>
<title>luci-base: revise array sorting</title>
<updated>2022-07-27T15:32:58Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2022-07-27T15:19:08Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=37422e891a47f15659356ce75b6f6cce831e0041'/>
<id>urn:sha1:37422e891a47f15659356ce75b6f6cce831e0041</id>
<content type='text'>
Refactor various sort operations throughout luci-base to use the new
L.naturalCompare() comparator function.

This primarily ensures that embedded numbers are sorted numerically and
not in a lexicographical way.

It also simplifies some code as a side effect.

Ref: #5899
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-base: form.js: fix removing just created named GridSection</title>
<updated>2022-07-22T21:41:05Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2022-07-22T21:41:05Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=2771360108cb3e2011c7c9cb4921a9047ea70910'/>
<id>urn:sha1:2771360108cb3e2011c7c9cb4921a9047ea70910</id>
<content type='text'>
Since the `handleModalSave()` handler of the GridSection class invokes
`handleModalCancel()` after saving the data but before removing the
`addedSection` property, the `handleModalCancel` handler incorrectly
removed the uci section that has just been created.

This bug didn't affect anonymous GridSections because after saving the
id of the created section changes, causing the remove command to fail,
but for named ones with stable section IDs, the bug manifested.

Solve the issue by passing a flag to `handleModalCancel()` indicating
whether the method was called from a safe operation and use it do
decide whether to delete the new staged uci section or not.

Fixes: #5760
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-base: form.js: minor tweaks for mobile styling</title>
<updated>2022-05-17T13:07:48Z</updated>
<author>
<name>Jo-Philipp Wich</name>
<email>jo@mein.io</email>
</author>
<published>2022-05-17T13:07:48Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/luci/commit/?id=9c136c9beaa7639aecc351c5725de33cfe4d2e5c'/>
<id>urn:sha1:9c136c9beaa7639aecc351c5725de33cfe4d2e5c</id>
<content type='text'>
 - Annotate gridsection textvalue cells as CBI.DummyValue widgets
 - Replace `&lt;br&gt;` elements with newlines in `stripTags()`

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
</feed>
