mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-19 03:16:33 +02:00
The results of Guy Bedford's help
Egroupware will load into addressbook & show rows Most base files should be bundled server-side & included rollup.config.js controls the process Still needs work: - consider /dist directory for best-practice - cleanup - other built-in apps - EPL / external apps need Guy's multi-stage work
This commit is contained in:
@@ -12,13 +12,12 @@
|
||||
egw_inheritance;
|
||||
/api/js/es6-promise.min.js;
|
||||
*/
|
||||
import {EgwApp} from "./egw_app";
|
||||
import './egw_inheritance.js';
|
||||
import {et2_createWidget} from "../etemplate/et2_core_widget";
|
||||
import {etemplate2} from "../etemplate/etemplate2";
|
||||
import {et2_dialog} from "../etemplate/et2_widget_dialog";
|
||||
import {et2_nextmatch} from "../etemplate/et2_extension_nextmatch";
|
||||
import {et2_favorites} from "../etemplate/et2_widget_favorites";
|
||||
import {EgwApp} from "./egw_app";
|
||||
|
||||
/**
|
||||
* Common base class for application javascript
|
||||
@@ -2061,4 +2060,4 @@ export const AppJS = (function(){ "use strict"; return Class.extend(
|
||||
});
|
||||
}
|
||||
|
||||
});}).call(this);
|
||||
});}).call(window);
|
||||
|
@@ -78,7 +78,7 @@ window.app = {classes: {}};
|
||||
window.egw_appName = egw_script.getAttribute('data-app');
|
||||
|
||||
// split includes in legacy js and modules
|
||||
const legacy_js_regexp = /\/dhtmlx|jquery|magicsuggest|resumable/;
|
||||
const legacy_js_regexp = /do_not_match_anything/;
|
||||
|
||||
// check if egw object was injected by window open
|
||||
if (typeof window.egw == 'undefined')
|
||||
@@ -190,6 +190,7 @@ window.app = {classes: {}};
|
||||
*/
|
||||
async function legacy_js_import(_src, _baseurl)
|
||||
{
|
||||
console.log("Legacy import: ", _src,_baseurl);
|
||||
if (!Array.isArray(_src)) _src = [].concat(_src);
|
||||
return Promise.all(_src.map(src => {
|
||||
return new Promise(function(_resolve, _reject)
|
||||
@@ -207,9 +208,8 @@ window.app = {classes: {}};
|
||||
}
|
||||
|
||||
const egw_modules = [
|
||||
'egw_core', 'egw_debug', 'egw_preferences', 'egw_lang', 'egw_links', 'egw_open', 'egw_user',
|
||||
'egw_config', 'egw_images', 'egw_jsonq', 'egw_files', 'egw_json', 'egw_store', 'egw_tooltip', 'egw_css',
|
||||
'egw_calendar', 'egw_ready', 'egw_data', 'egw_tail', 'egw_message', 'egw_notification', 'jsapi',
|
||||
// TODO: Dev mode should remove .min or remap it with importmap
|
||||
'egw.min'
|
||||
];
|
||||
// make our promise global, as legacy code calls egw_LAB.wait which we assign to egw_ready.then
|
||||
window.egw_LAB = window.egw_ready =
|
||||
@@ -218,7 +218,7 @@ window.app = {classes: {}};
|
||||
.catch((err) => {console.error(rel_src+": "+err.message)}))))
|
||||
.then(() => Promise.all(include.filter((src) => src.match(legacy_js_regexp) === null) //.reverse()
|
||||
.map(rel_src => import(window.egw_webserverUrl+'/'+rel_src)
|
||||
.catch((err) => {console.error(rel_src+": "+err.message)})
|
||||
.catch((err) => {window.setTimeout(() => {throw err;},0)})
|
||||
))).then(() =>
|
||||
{
|
||||
// We need to override the globalEval to mitigate potential execution of
|
||||
@@ -371,7 +371,7 @@ window.app = {classes: {}};
|
||||
// load etemplate2 template(s)
|
||||
jQuery('form.et2_container[data-etemplate]').each( function(index, node)
|
||||
{
|
||||
import('../etemplate/etemplate2.js').then((module) => {
|
||||
import('../etemplate/etemplate2').then((module) => {
|
||||
const data = JSON.parse(node.getAttribute('data-etemplate')) || {};
|
||||
if (popup || window.opener && !egwIsMobile()) {
|
||||
// Resize popup when et2 load is done
|
||||
|
@@ -18,6 +18,11 @@
|
||||
// egw_jquery;
|
||||
egw_css;
|
||||
*/
|
||||
|
||||
import "../../../vendor/bower-asset/jquery/dist/jquery.min.js";
|
||||
import "../../../vendor/bower-asset/jquery-ui/jquery-ui.js";
|
||||
import "../jquery/jquery.noconflict.js";
|
||||
import "../jquery/jquery-ui-timepicker-addon.js";
|
||||
import './egw_core.js';
|
||||
|
||||
/**
|
||||
|
@@ -10,6 +10,7 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
import "./egw.js";
|
||||
/**
|
||||
* This code setups the egw namespace and adds the "extend" function, which is
|
||||
* used by extension modules to inject their content into the egw object.
|
||||
|
@@ -14,7 +14,7 @@
|
||||
egw_core;
|
||||
egw_debug;
|
||||
*/
|
||||
import './egw_core.js';
|
||||
import './egw.js';
|
||||
import './egw_json.js'; // for egw.registerJSONPlugin
|
||||
|
||||
/**
|
||||
|
2
api/js/jsapi/egw_global.d.ts
vendored
2
api/js/jsapi/egw_global.d.ts
vendored
@@ -13,7 +13,7 @@
|
||||
* @author Andreas Stöckel
|
||||
*/
|
||||
|
||||
import {EgwApp} from "./egw_app";
|
||||
//import {EgwApp} from "./egw_app";
|
||||
|
||||
/**
|
||||
* Global egw object (for now created by the diverse JavaScript files) with a TypeScript interface
|
||||
|
@@ -33,7 +33,7 @@ egw.extend('jquery', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
// Include the jQuery and jQuery UI library.
|
||||
var token = ready.readyWaitFor();
|
||||
files.includeJS([
|
||||
this.webserverUrl + '/vendor/bower-asset/jquery/dist/jquery.js',
|
||||
this.webserverUrl + '/vendor/bower-asset/jquery/dist/jquery.min.js',
|
||||
this.webserverUrl + '/vendor/bower-asset/jquery-ui/jquery-ui.js',
|
||||
this.webserverUrl + '/api/js/jquery/jquery.html5_upload.js'
|
||||
], function () {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
egw_files;
|
||||
egw_debug;
|
||||
*/
|
||||
import './egw_core.js';
|
||||
import './egw.js';
|
||||
import './egw_utils.js';
|
||||
|
||||
/**
|
||||
|
33
api/js/jsapi/egw_modules.js
Normal file
33
api/js/jsapi/egw_modules.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Circular dependancy resolution file
|
||||
* Here we force the order of includes
|
||||
*/
|
||||
|
||||
import "../../../vendor/bower-asset/jquery/dist/jquery.min.js";
|
||||
import "../../../vendor/bower-asset/jquery-ui/jquery-ui.js";
|
||||
import "../jquery/jquery.noconflict.js";
|
||||
|
||||
import "./egw.js";
|
||||
import "./egw_core.js";
|
||||
import "./egw_debug.js";
|
||||
import "./egw_preferences.js";
|
||||
import "./egw_lang.js";
|
||||
import "./egw_links.js";
|
||||
import "./egw_open.js";
|
||||
import "./egw_user.js";
|
||||
import "./egw_config.js";
|
||||
import "./egw_images.js";
|
||||
import "./egw_jsonq.js";
|
||||
import "./egw_files.js";
|
||||
import "./egw_json.js";
|
||||
import "./egw_store.js";
|
||||
import "./egw_tooltip.js";
|
||||
import "./egw_css.js";
|
||||
import "./egw_calendar.js";
|
||||
import "./egw_ready.js";
|
||||
import "./egw_data.js";
|
||||
import "./egw_tail.js";
|
||||
import "./egw_inheritance.js";
|
||||
import "./egw_message.js";
|
||||
import "./egw_notification.js";
|
||||
import "./jsapi.js";
|
Reference in New Issue
Block a user