...
Info |
---|
Work in progress. Will be implemented in Rogo 7.1 (October/November 2019) |
Warning |
---|
Not yet merged into develop |
In order to modernise Rogo we are modularising our javascript and implementing requirejs.
...
Code Block | ||||
---|---|---|---|---|
| ||||
requirejs(['ui', 'jquery', 'jqueryvalidate', 'jqueryui'], function (UIUi, $) { var ui = new UIUi(); // Validate ldap options, and toggle extra settings. $("#installForm").validate(); $('#useLdap').change(function () { $('#ldapOptions').toggle(); }); $('#uselookupLdap').change(function () { $('#ldaplookupOptions').toggle(); }); $('#config').click(function() { ui.go_config(); }); }); |
...
Code Block | ||||
---|---|---|---|---|
| ||||
requirejs(['jsxls', 'jquery', 'jqueryvalidate'], function (jsxlsJsxls, $) { $('#forgotten_pw').validate({ messages: { email: jsxlsJsxls.lang_string['emailaddressinvalid'], } }); }); |
Coding Standards
- The first letter of variables included via RequireJS should be capitalised, and local variables should be lowercase
Code Block language js title example.js requirejs(['ui', 'jquery'], function (Ui, $) { var ui = new Ui(); $('#config').click(function() { ui.go_config(); }); });