diff --git a/admin/js/app.js b/admin/js/app.js index a754091529..08b2b49379 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -10,11 +10,10 @@ /*egw:uses /api/js/jsapi/egw_app.js */ -import 'jquery'; -import 'jqueryui'; -import '../jsapi/egw_global'; -import '../etemplate/et2_types'; import { EgwApp } from '../../api/js/jsapi/egw_app'; +import { etemplate2 } from "../../api/js/etemplate/etemplate2"; +import { et2_dialog } from "../../api/js/etemplate/et2_widget_dialog"; +import { et2_createWidget } from "../../api/js/etemplate/et2_core_widget"; /** * UI for Admin * @@ -851,7 +850,7 @@ class AdminApp extends EgwApp { if (_button == et2_dialog.YES_BUTTON) { submit(); } - }, this.egw.lang('Submit displayed information?'), '', {}, et2_dialog.BUTTON_YES_NO, et2_dialog.QUESTION_MESSAGE, undefined, egw); + }, this.egw.lang('Submit displayed information?'), '', {}, et2_dialog.BUTTONS_YES_NO, et2_dialog.QUESTION_MESSAGE, undefined, egw); } return false; } @@ -942,7 +941,7 @@ class AdminApp extends EgwApp { } }; // confirmation dialog - et2_dialog.show_dialog(callbackDialog, egw.lang('Are you sure you want to %1 mail for selected accounts?', egw.lang(_action.id)), egw.lang('Active Mail Accounts'), {}, et2_dialog.BUTTON_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw); + et2_dialog.show_dialog(callbackDialog, egw.lang('Are you sure you want to %1 mail for selected accounts?', egw.lang(_action.id)), egw.lang('Active Mail Accounts'), {}, et2_dialog.BUTTONS_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw); } /** * Resize window methode diff --git a/admin/js/app.ts b/admin/js/app.ts index 4e069d2ec7..b61dc01c32 100644 --- a/admin/js/app.ts +++ b/admin/js/app.ts @@ -12,12 +12,10 @@ /api/js/jsapi/egw_app.js */ -import 'jquery'; -import 'jqueryui'; -import '../jsapi/egw_global'; -import '../etemplate/et2_types'; - import {EgwApp, PushData} from '../../api/js/jsapi/egw_app'; +import {etemplate2} from "../../api/js/etemplate/etemplate2"; +import {et2_dialog} from "../../api/js/etemplate/et2_widget_dialog"; +import {et2_createWidget} from "../../api/js/etemplate/et2_core_widget"; /** * UI for Admin @@ -1021,7 +1019,7 @@ class AdminApp extends EgwApp submit(); } }, this.egw.lang('Submit displayed information?'), '', {}, - et2_dialog.BUTTON_YES_NO, et2_dialog.QUESTION_MESSAGE, undefined, egw); + et2_dialog.BUTTONS_YES_NO, et2_dialog.QUESTION_MESSAGE, undefined, egw); } return false; } @@ -1141,7 +1139,7 @@ class AdminApp extends EgwApp }; // confirmation dialog et2_dialog.show_dialog(callbackDialog, egw.lang('Are you sure you want to %1 mail for selected accounts?', egw.lang(_action.id)), egw.lang('Active Mail Accounts'), {}, - et2_dialog.BUTTON_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw); + et2_dialog.BUTTONS_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw); } /** diff --git a/api/js/etemplate/et2_widget_date.js b/api/js/etemplate/et2_widget_date.js index fd397cf3fa..723fafe454 100644 --- a/api/js/etemplate/et2_widget_date.js +++ b/api/js/etemplate/et2_widget_date.js @@ -22,6 +22,7 @@ import { et2_valueWidget } from './et2_core_valueWidget'; import { et2_inputWidget } from './et2_core_inputWidget'; import { et2_DOMWidget } from "./et2_core_DOMWidget"; import { egw } from "../jsapi/egw_global"; +import { date } from "./lib/date.js"; // all calls to jQueryUI.datetimepicker as jQuery.datepicker give errors which are currently suppressed with @ts-ignore // adding npm package @types/jquery.ui.datetimepicker did NOT help :( /** diff --git a/api/js/etemplate/et2_widget_date.ts b/api/js/etemplate/et2_widget_date.ts index 878bd7d25d..8e3e7a9596 100644 --- a/api/js/etemplate/et2_widget_date.ts +++ b/api/js/etemplate/et2_widget_date.ts @@ -28,9 +28,6 @@ import {et2_IDetachedDOM} from "./et2_core_interfaces"; import {egw} from "../jsapi/egw_global"; import {date} from "./lib/date.js"; -// lib/date.js: -declare function date (format : string, timestamp? : string | number | Date); - // all calls to jQueryUI.datetimepicker as jQuery.datepicker give errors which are currently suppressed with @ts-ignore // adding npm package @types/jquery.ui.datetimepicker did NOT help :( diff --git a/api/js/etemplate/et2_widget_tree.js b/api/js/etemplate/et2_widget_tree.js index 0b8917a836..c8fdd0e24a 100644 --- a/api/js/etemplate/et2_widget_tree.js +++ b/api/js/etemplate/et2_widget_tree.js @@ -24,10 +24,15 @@ import { et2_inputWidget } from "./et2_core_inputWidget"; import { ClassWithAttributes } from "./et2_core_inheritance"; import { et2_no_init } from "./et2_core_common"; import { egw, framework } from "../jsapi/egw_global"; +/* no module, but egw:uses is ignored, so adding it here commented out +import '../../../api/js/dhtmlxtree/sources/dhtmlxtree.js'; +import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js'; +import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_start.js'; + */ /** * Tree widget * - * For syntax of nodes supplied via sel_optons or autoloading refer to Etemplate\Widget\Tree class. + * For syntax of nodes supplied via sel_options or autoloading refer to Etemplate\Widget\Tree class. * * @augments et2_inputWidget */ diff --git a/api/js/etemplate/et2_widget_tree.ts b/api/js/etemplate/et2_widget_tree.ts index cf440a9f63..276a368217 100644 --- a/api/js/etemplate/et2_widget_tree.ts +++ b/api/js/etemplate/et2_widget_tree.ts @@ -27,10 +27,16 @@ import {ClassWithAttributes} from "./et2_core_inheritance"; import {et2_no_init} from "./et2_core_common"; import {egw, framework} from "../jsapi/egw_global"; +/* no module, but egw:uses is ignored, so adding it here commented out +import '../../../api/js/dhtmlxtree/sources/dhtmlxtree.js'; +import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js'; +import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_start.js'; + */ + /** * Tree widget * - * For syntax of nodes supplied via sel_optons or autoloading refer to Etemplate\Widget\Tree class. + * For syntax of nodes supplied via sel_options or autoloading refer to Etemplate\Widget\Tree class. * * @augments et2_inputWidget */ diff --git a/api/js/etemplate/lib/date.d.ts b/api/js/etemplate/lib/date.d.ts new file mode 100644 index 0000000000..24dd9c1999 --- /dev/null +++ b/api/js/etemplate/lib/date.d.ts @@ -0,0 +1 @@ +declare function date (format : string, timestamp? : string | number | Date); diff --git a/api/js/etemplate/lib/date.js b/api/js/etemplate/lib/date.js index f8ae1db966..31d65e833d 100644 --- a/api/js/etemplate/lib/date.js +++ b/api/js/etemplate/lib/date.js @@ -249,7 +249,7 @@ export function date (format, timestamp) { return jsdate.getTime() / 1000 | 0; } }; - this.date = function (format, timestamp) { + window.date = function (format, timestamp) { that = this; jsdate = ((typeof timestamp === 'undefined' ||isNaN(timestamp.valueOf())) ? new Date() : // Not provided (timestamp instanceof Date) ? new Date(timestamp) : // JS Date() @@ -257,5 +257,5 @@ export function date (format, timestamp) { ); return format.replace(formatChr, formatChrCb); }; - return this.date(format, timestamp); + return window.date(format, timestamp); }