summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
AgeCommit message (Collapse)Author
2018-11-05luci-base, themes: add tooltip helpers & stylesJo-Philipp Wich
Add the required JS and CSS infrastructure to support rich hover/focus tooltips for element. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05luci-base: cbi.js: switch to client side translationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05luci-base: cbi.js: add client side translation infrastructureJo-Philipp Wich
Implement the string hash algorithm used by LuCI's translation system in JavaScript and provide a `_()` translation wrapper function to lookup messages in the global string table. Once client side translation loading is activated in a later commit, JavaScript code can use the same string translation mechanism as server side Lua code, e.g. `_("Static Routes")` would yield "Statische Routen" when the German translation is loaded. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-28Add missing variable declarations in JavaScript codeStefan Weil
This fixes errors reported by LGTM. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-17luci-base: fix cbi dropdown quirks with MS EdgeJo-Philipp Wich
On MS Edge, the behaviour of "value" attributes on "li" elements is unreliable, so use the "data-" prefix to circumvent the problem. Ref: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/19320991/ Fixes: #2224 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-11luci-base: cbi.js: remove dead codeJo-Philipp Wich
Remove some superfluous code which was added with a previous commit. Fixes: 8270f10f1 ("luci-base: cbi.js: code cleanups") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-11luci-base: cbi.js: code cleanupsJo-Philipp Wich
- unify code style - add matchesElem() helper - replace nodeName checks with selector tests - replace className manipulations with classList operations Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10luci-base: cbi.js: recognize invalid input in dropdown create fieldJo-Philipp Wich
This is required to allow for validating the create field values in later commits. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-27luci-base: xhr.js: decode JSON for POST requests as wellJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23luci-base: cbi.js: fade to-be-deleted section when hovering delete buttonJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23luci-base: cbi.js: use adjacent button dynlist add/remove buttonsJo-Philipp Wich
Change the cbi.js code to create a div based button element instead of an image button. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18luci-base: cbi.js: add cbi_submit() helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-17luci-base: remove unused iconsJo-Philipp Wich
- The wifi_big.png / wifi_big_disabled.png icons were used on the wireless overview page which now uses badges with normal sized icons - The encryption.png / encryption_disabled.png icons were never used at all Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13luci-base: xhr: increase poll request timeoutJo-Philipp Wich
Some status requests can take quite some time to finish, the LuCI DSL status information in particular. Since the polling loop code already takes care of not relaunching requests which are already running, increase the per iteration timeout to up to five times the poll interval. This should be sufficient to let most operations complete. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12luci-base: add icons for alias interfacesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12luci-base: xhr.js: use JSON.parse() and pass request duration to callbacksJo-Philipp Wich
JSON.parse() is supported on all modern browsers and a far better solution than the hakish and potentially dangerous eval(). Also calculate the duration of request and pass it as 3rd argument to the callback function, this makes it easier to calculate request delays or poll intervals in code using XHR. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-09luci-base: cbi.js: avoid setting empty cell title attributesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-09luci-base: cbi.js: add NodeList.forEach() polyfill for IE 11Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-22luci-base: cbi.js: add tooltip handling and responsive table helper codeJo-Philipp Wich
- make findParent() globally available - add code for initializing rich cbi tooltips - introduce cbi_update_table() helper to auto-assign responsive attributes to table markup Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-22luci-base: xhr.js: defer starting poll queueJo-Philipp Wich
Defer the start of the queue poll loop until the document has been loaded. This allows all XHR.poll() invocations on the page to register their handlers before the first batch of requests is made. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08luci-base: add markup, JS and CSS for new dropdownJo-Philipp Wich
This commit introduces the required code for a new, markup based dropdown widget which can be used as a styleable alternative to select boxes or radio/checkbox button groups. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30luci-base: cbi.js: remove unused serialize functionsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30luci-base: cbi.js: fix cbi_row_swap() after recent table markup changesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-28luci-base: add element creation helper to cbi.jsJo-Philipp Wich
Add a new helper function `E()` to cbi.js which can be used to conveniently build HTML markup. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05luci-base: xhr.js: fix timeout setting with IE 11Jo-Philipp Wich
Internet Explorer 11 requires the timeout to be applied after the open() call, otherwise an invlaid state exception will be raised Fixes aa6c97154 ("luci-base: extend xhr.js") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26luci-base: extend xhr.jsJo-Philipp Wich
Add timeout options to get() and post() and introduce XHR.stop() to support stopping a poll operation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-04luci-base: add a strict flag to the hostname validatorJo-Philipp Wich
Some applications, e.g. dnsmasq, do not allow hostnames starting with an underscore, therefor extend the existing hostname datatype validator with a `strict` which disallows a leading underscore. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-02-16luci-base: rework client side IP validation types and support "hostid" typeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-10-25luci-base: fix client side "host" datatype validatorJo-Philipp Wich
Fixes #1413. Reported-by: Wojciech Jowsa <wojciech.jowsa@gmail.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-08-22luci-base: datatypes: add cidr, ipnet validator typeYousong Zhou
- Rewrite ipmask to use these subtypes - Add ip{4,6}prefix validators to cbi.js Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2017-08-02Merge pull request #1245 from danweller18/feature_js_headersJo-Philipp Wich
luci-base: Remove request headers that are set automatically by browser
2017-07-28luci-base: cbi.js: fix handling of inverse-depends, combobox validationJo-Philipp Wich
- Properly handle logic for evaluating inverted dependencies means when depending on another field *not* having a given value - Perform datatype validation *after* populating combobox choices to avoid triggering a false-positive when validating an .rmempty = false combobox during form instantiation Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-07-22remove request headers that are set automatically by browserDaniel W
2017-07-21luci-base: fix loading fold.gif for filebrowserYousong Zhou
cbi_init() needs to be called at the end of the page to initialize cbi_strings with "[data-strings]" while cbi_browser_init() happened before that. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2017-01-23luci-base: ipmask, ipmask4 and ipmask6 validatorsJo-Philipp Wich
These validators accept IP address specifications in the form - address - address/bits - address/netmask Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-03luci-base:adjust the code orderJian Chang
The `cbi_validate_field` should be after data initialized. Signed-off-by: Jian Chang <aa65535@live.com>
2016-08-04luci-base: cbi.js: handle undefined arguments in formattingJo-Philipp Wich
Fix the JavaScript String.format() to not trigger an exception if the argument for an escaped format like %h or %q is undefined. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-02-19luci-base: cbi: fix button handling for dynamic listsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-17luci-base: cbi.js: properly round down numbers for %u and %d patternsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-15luci-base: cbi.js: string formatting fixesJo-Philipp Wich
* Fix left and right justify/padding in formats * Do not emit decimal numbers for small values in %m format Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-10luci-base: cbi: properly handle dependant elements without parentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-10luci-base: cbi: only spawn dynlist sub-comboboxes if choices are availableJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-10luci-base: cbi: further refactoringJo-Philipp Wich
Eliminate more inline scripts in favor to global initialization, use a global object for sharing fixed strings instead of passing them to each invocation. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-02-09luci-base: fix dependency handling of optionals (#645)Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-19luci-base: cbi: optimize tab hide logicJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-19luci-base: cbi: fix event binding jsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-18luci-base: cbi: prevent unintended focus on combobox initJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-18luci-base: cbi: refactor event handling jsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-18luci-base: cbi: fix reverse field order after dependency changeJo-Philipp Wich
When fields got removed and readded due to unsatisfied dependencies, they got inserted in reverse order into the dom. Fix this issue by properly passing the element index. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-18luci-base: refactor cbi dependency handling codeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>