-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
75 lines (69 loc) · 2.57 KB
/
main.js
File metadata and controls
75 lines (69 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @license
* Copyright (c) 2014, 2019, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
'use strict';
/**
* Example of Require.js boostrap javascript
*/
requirejs.config(
{
baseUrl: 'js',
// Path mappings for the logical module names
// Update the main-release-paths.json for release mode when updating the mappings
paths:
//injector:mainReleasePaths
{
'knockout': 'libs/knockout/knockout-3.5.0.debug',
'jquery': 'libs/jquery/jquery-3.4.1',
'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.12.1',
'promise': 'libs/es6-promise/es6-promise',
'hammerjs': 'libs/hammer/hammer-2.0.8',
'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0',
'ojs': 'libs/oj/v7.0.1/debug',
'ojL10n': 'libs/oj/v7.0.1/ojL10n',
'ojtranslations': 'libs/oj/v7.0.1/resources',
'text': 'libs/require/text',
'signals': 'libs/js-signals/signals',
'customElements': 'libs/webcomponents/custom-elements.min',
'proj4': 'libs/proj4js/dist/proj4-src',
'css': 'libs/require-css/css',
'touchr': 'libs/touchr/touchr'
}
//endinjector
}
);
/**
* A top-level require call executed by the Application.
* Although 'knockout' would be loaded in any case (it is specified as a dependency
* by some modules), we are listing it explicitly to get the reference to the 'ko'
* object in the callback
*/
require(['ojs/ojbootstrap', 'knockout', 'appController', 'ojs/ojlogger', 'ojs/ojrouter', 'ojs/ojknockout',
'ojs/ojmodule', 'ojs/ojnavigationlist', 'ojs/ojbutton', 'ojs/ojtoolbar'],
function (Bootstrap, ko, app, Logger, Router) { // this callback gets executed when all required modules are loaded
Bootstrap.whenDocumentReady().then(
function() {
function init() {
Router.sync().then(
function () {
app.loadModule();
// Bind your ViewModel for the content of the whole page body.
ko.applyBindings(app, document.getElementById('globalBody'));
},
function (error) {
Logger.error('Error in root start: ' + error.message);
}
);
}
// If running in a hybrid (e.g. Cordova) environment, we need to wait for the deviceready
// event before executing any code that might interact with Cordova APIs or plugins.
if (document.body.classList.contains('oj-hybrid')) {
document.addEventListener("deviceready", init);
} else {
init();
}
});
}
);