Revize 997a4fe3
Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)
sources/src/main/webapp/js/showGraphApp.js | ||
---|---|---|
2 | 2 |
* Main class of the application. |
3 | 3 |
* @constructor |
4 | 4 |
*/ |
5 |
function ShowGraphApp() { |
|
5 |
function ShowGraphApp(appName, appHomeUrl) {
|
|
6 | 6 |
/** @prop {Constants} constants */ |
7 | 7 |
this.constants = new Constants; |
8 | 8 |
/** @prop {GraphLoader} graphLoader */ |
... | ... | |
17 | 17 |
this.markSymbol = new MarkSymbol; |
18 | 18 |
|
19 | 19 |
/** @prop {string} NAME Application name. */ |
20 |
this.NAME = document.title;
|
|
20 |
this.NAME = appName;
|
|
21 | 21 |
/** @prop {string} HOME_URL Application home URL. */ |
22 |
this.HOME_URL = null;
|
|
22 |
this.HOME_URL = appHomeUrl;
|
|
23 | 23 |
|
24 | 24 |
/** @prop {float} headerHeight Current height of the application header. */ |
25 | 25 |
this.headerHeight = getHeaderHeight(); |
sources/src/main/webapp/showGraph.jsp | ||
---|---|---|
183 | 183 |
</div> |
184 | 184 |
|
185 | 185 |
<script> |
186 |
var app = new ShowGraphApp; |
|
187 |
app.HOME_URL = '${HOME_URL}'; |
|
186 |
const app = new ShowGraphApp('${APP_NAME}', '${APP_HOME_URL}'); |
|
188 | 187 |
|
189 |
document.addEventListener('DOMContentLoaded', function() {
|
|
188 |
document.addEventListener('DOMContentLoaded', () => {
|
|
190 | 189 |
var loaderFn = app.diagramLoader('${param.diagramId}'); |
191 | 190 |
|
192 | 191 |
app.run(loaderFn); |
Také k dispozici: Unified diff
app parameters are passed as constructor arguments to ShowGraphApp JS class