PluginProbe
seQura / 3.0.0
seQura v3.0.0
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / assets / js / src / core / PageControllerFactory.js

PageControllerFactory.js in seQura 3.0.0, at assets/js/src/core/PageControllerFactory.js

29 lines 764 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 if (!window.SequraFE) {
2 window.SequraFE = {};
3 }
4
5 (function () {
6 function PageControllerFactory() {
7 /**
8 * Instantiates page controller;
9 *
10 * @param {string} controller
11 * @param {Record<string, any>} configuration
12 */
13 this.getInstance = (controller, configuration) => {
14 let parts = controller.split('-');
15 let name = '';
16 for (let part of parts) {
17 part = part.charAt(0).toUpperCase() + part.slice(1);
18 name += part;
19 }
20
21 name += 'Controller';
22
23 return SequraFE[name] ? new SequraFE[name](configuration) : null;
24 };
25 }
26
27 SequraFE.pageControllerFactory = new PageControllerFactory();
28 })();
29