mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
include jquery and other legacy js files via script tag
This commit is contained in:
parent
40cac6f964
commit
5298336886
@ -16,6 +16,8 @@ import 'jqueryui';
|
||||
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 { fetchAll } from "../../api/js/etemplate/et2_extension_nextmatch_actions.js";
|
||||
import "./CRM.js";
|
||||
/**
|
||||
* UI for Addressbook
|
||||
*
|
||||
|
@ -20,7 +20,8 @@ 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_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
|
||||
import {fetchALL} from "../../api/js/etemplate/et2_extension_nextmatch_actions.js";
|
||||
import {fetchAll} from "../../api/js/etemplate/et2_extension_nextmatch_actions.js";
|
||||
import "./CRM.js";
|
||||
|
||||
/**
|
||||
* Object to call app.addressbook.openCRMview with
|
||||
|
264
admin/js/app.js
264
admin/js/app.js
@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
/**
|
||||
* EGroupware - Admin - Javascript UI
|
||||
*
|
||||
@ -8,100 +7,83 @@
|
||||
* @copyright (c) 2013-20 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/*egw:uses
|
||||
/api/js/jsapi/egw_app.js
|
||||
*/
|
||||
require("jquery");
|
||||
require("jqueryui");
|
||||
require("../jsapi/egw_global");
|
||||
require("../etemplate/et2_types");
|
||||
var egw_app_1 = require("../../api/js/jsapi/egw_app");
|
||||
import 'jquery';
|
||||
import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
/**
|
||||
* UI for Admin
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
var AdminApp = /** @class */ (function (_super) {
|
||||
__extends(AdminApp, _super);
|
||||
class AdminApp extends EgwApp {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @memberOf app.classes.admin
|
||||
*/
|
||||
function AdminApp() {
|
||||
var _this =
|
||||
constructor() {
|
||||
// call parent
|
||||
_super.call(this, 'admin') || this;
|
||||
super('admin');
|
||||
/**
|
||||
* reference to iframe
|
||||
*
|
||||
* {et2_iframe}
|
||||
*/
|
||||
_this.iframe = null;
|
||||
this.iframe = null;
|
||||
/**
|
||||
* reference to nextmatch
|
||||
*
|
||||
* {et2_extension_nextmatch}
|
||||
*/
|
||||
_this.nm = null;
|
||||
this.nm = null;
|
||||
/**
|
||||
* Reference to div to hold AJAX loadable pages
|
||||
*
|
||||
* {et2_box}
|
||||
*/
|
||||
_this.ajax_target = null;
|
||||
this.ajax_target = null;
|
||||
/**
|
||||
* Reference to ACL edit dialog (not the list)
|
||||
*/
|
||||
_this.acl_dialog = null;
|
||||
_this.tree = null;
|
||||
this.acl_dialog = null;
|
||||
this.tree = null;
|
||||
/**
|
||||
* No SSL
|
||||
*/
|
||||
_this.SSL_NONE = 0;
|
||||
this.SSL_NONE = 0;
|
||||
/**
|
||||
* STARTTLS on regular tcp connection/port
|
||||
*/
|
||||
_this.SSL_STARTTLS = 1;
|
||||
this.SSL_STARTTLS = 1;
|
||||
/**
|
||||
* SSL (inferior to TLS!)
|
||||
*/
|
||||
_this.SSL_SSL = 3;
|
||||
this.SSL_SSL = 3;
|
||||
/**
|
||||
* require TLS version 1+, no SSL version 2 or 3
|
||||
*/
|
||||
_this.SSL_TLS = 2;
|
||||
this.SSL_TLS = 2;
|
||||
/**
|
||||
* if set, verify certifcate (currently not implemented in Horde_Imap_Client!)
|
||||
*/
|
||||
_this.SSL_VERIFY = 8;
|
||||
return _this;
|
||||
this.SSL_VERIFY = 8;
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
AdminApp.prototype.destroy = function (_app) {
|
||||
destroy(_app) {
|
||||
this.iframe = null;
|
||||
this.nm = null;
|
||||
this.acl_dialog = null;
|
||||
this.tree = null;
|
||||
// call parent
|
||||
_super.prototype.destroy.call(this, _app);
|
||||
};
|
||||
super.destroy(_app);
|
||||
}
|
||||
/**
|
||||
* This function is called when the etemplate2 object is loaded
|
||||
* and ready. If you must store a reference to the et2 object,
|
||||
@ -110,9 +92,9 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {etemplate2} _et2
|
||||
* @param {string} _name name of template loaded
|
||||
*/
|
||||
AdminApp.prototype.et2_ready = function (_et2, _name) {
|
||||
et2_ready(_et2, _name) {
|
||||
// call parent
|
||||
_super.prototype.et2_ready.call(this, _et2, _name);
|
||||
super.et2_ready(_et2, _name);
|
||||
switch (_name) {
|
||||
case 'admin.index':
|
||||
var iframe = this.iframe = this.et2.getWidgetById('iframe');
|
||||
@ -154,13 +136,13 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Show given url in (visible) iframe or nextmatch with accounts (!_url)
|
||||
*
|
||||
* @param {string} [_url=] url to show in iframe or nothing for showing
|
||||
*/
|
||||
AdminApp.prototype.load = function (_url) {
|
||||
load(_url) {
|
||||
if (this.iframe && this.iframe.getDOMNode().contentDocument.location.href
|
||||
.match(/menuaction=admin.admin_statistics.submit.+required=true/) && (!_url ||
|
||||
!_url.match(/statistics=(postpone|canceled|submitted)/))) {
|
||||
@ -210,7 +192,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
this.nm.set_disabled(!!_url || ajax);
|
||||
this.groups.set_disabled(true);
|
||||
this.ajax_target.set_disabled(!ajax);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Observer method receives update notifications from all applications
|
||||
*
|
||||
@ -229,7 +211,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {string} _targetapp which app's window should be refreshed, default current
|
||||
* @return {false|*} false to stop regular refresh, thought all observers are run
|
||||
*/
|
||||
AdminApp.prototype.observer = function (_msg, _app, _id, _type, _msg_type, _targetapp) {
|
||||
observer(_msg, _app, _id, _type, _msg_type, _targetapp) {
|
||||
switch (_app) {
|
||||
case 'admin':
|
||||
// if iframe is used --> refresh it
|
||||
@ -295,7 +277,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
return false; // --> no regular refresh needed
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handle a push notification about entry changes from the websocket
|
||||
*
|
||||
@ -314,7 +296,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {object|null} pushData.acl Extra data for determining relevance. eg: owner or responsible to decide if update is necessary
|
||||
* @param {number} pushData.account_id User that caused the notification
|
||||
*/
|
||||
AdminApp.prototype.push = function (pushData) {
|
||||
push(pushData) {
|
||||
// We'll listen to addressbook, but only if it has an account ID
|
||||
if (pushData.app != this.appname)
|
||||
return;
|
||||
@ -324,13 +306,13 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
else if (pushData.id < 0) {
|
||||
this.groups.refresh(pushData.id, pushData.type);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Hide navbar for idots template
|
||||
*
|
||||
* Just a hack for old idots, not neccesary for jdots
|
||||
*/
|
||||
AdminApp.prototype._hide_navbar = function () {
|
||||
_hide_navbar() {
|
||||
var document = this.iframe.getDOMNode().contentDocument;
|
||||
if (!document)
|
||||
return; // nothing we can do ...
|
||||
@ -343,36 +325,36 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
if (elem)
|
||||
elem.style.display = 'none';
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Set location of iframe for given _action and _sender (row)
|
||||
*
|
||||
* @param _action
|
||||
* @param _senders
|
||||
*/
|
||||
AdminApp.prototype.iframe_location = function (_action, _senders) {
|
||||
iframe_location(_action, _senders) {
|
||||
var id = _senders[0].id.split('::');
|
||||
var url = _action.data.url.replace(/(%24|\$)id/, id[1]);
|
||||
this.load(url);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Callback to load an etemplate
|
||||
*
|
||||
* @param {Object[]} _data
|
||||
*/
|
||||
AdminApp.prototype._ajax_load_callback = function (_data) {
|
||||
_ajax_load_callback(_data) {
|
||||
if (!_data || _data.type != undefined)
|
||||
return;
|
||||
// Insert the content, etemplate will load into it
|
||||
jQuery(this.ajax_target.node).append(typeof _data === 'string' ? _data : _data[0]);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Link hander for jDots template to just reload our iframe, instead of reloading whole admin app
|
||||
*
|
||||
* @param _url
|
||||
* @return boolean true, if linkHandler took care of link, false otherwise
|
||||
*/
|
||||
AdminApp.prototype.linkHandler = function (_url) {
|
||||
linkHandler(_url) {
|
||||
var matches = _url.match(/menuaction=admin.admin_ui.index.*&load=([^&]+)/);
|
||||
if (_url != 'about:blank' && (this.iframe != null && !_url.match('menuaction=admin.admin_ui.index') || matches)) {
|
||||
if (matches) {
|
||||
@ -383,14 +365,14 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
// can not load our own index page, has to be done by framework
|
||||
return false;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Run an admin module / onclick callback for tree
|
||||
*
|
||||
* @param {string} _id id of clicked node
|
||||
* @param {et2_tree} _widget reference to tree widget
|
||||
*/
|
||||
AdminApp.prototype.run = function (_id, _widget) {
|
||||
run(_id, _widget) {
|
||||
var link = _widget.getUserData(_id, 'link');
|
||||
this.groups.set_disabled(true);
|
||||
if (_id == '/accounts' || _id.substr(0, 8) == '/groups/') {
|
||||
@ -410,9 +392,9 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
this.load(link);
|
||||
}
|
||||
else if (link.substr(0, 11) == 'javascript:') {
|
||||
var href_regexp = /^javascript:([^\(]+)\((.*)?\);?$/;
|
||||
var matches = link.match(href_regexp);
|
||||
var args = [];
|
||||
const href_regexp = /^javascript:([^\(]+)\((.*)?\);?$/;
|
||||
const matches = link.match(href_regexp);
|
||||
let args = [];
|
||||
if (matches.length > 1 && matches[2] !== undefined) {
|
||||
try {
|
||||
args = JSON.parse('[' + matches[2] + ']');
|
||||
@ -423,21 +405,21 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
egw.applyFunc(matches[1], args);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Show the group list in the main window
|
||||
*/
|
||||
AdminApp.prototype.group_list = function () {
|
||||
group_list() {
|
||||
this.nm.set_disabled(true);
|
||||
this.groups.set_disabled(false);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* View, edit or delete a group callback for tree
|
||||
*
|
||||
* @param {object} _action egwAction
|
||||
* @param {array} _senders egwActionObject _senders[0].id holds id
|
||||
*/
|
||||
AdminApp.prototype.group = function (_action, _senders) {
|
||||
group(_action, _senders) {
|
||||
// Tree IDs look like /groups/ID, nm uses admin::ID
|
||||
var from_nm = _senders[0].id.indexOf('::') > 0;
|
||||
var account_id = _senders[0].id.split(from_nm ? '::' : '/')[from_nm ? 1 : 2];
|
||||
@ -465,14 +447,14 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Modify an ACL entry
|
||||
*
|
||||
* @param {object} _action egwAction
|
||||
* @param {array} _senders egwActionObject _senders[0].id holds the id "admin::app:account:location"
|
||||
*/
|
||||
AdminApp.prototype.acl = function (_action, _senders) {
|
||||
acl(_action, _senders) {
|
||||
var ids = [];
|
||||
for (var i = 0; i < _senders.length; ++i) {
|
||||
ids.push(_senders[i].id.split('::').pop()); // remove "admin::" prefix
|
||||
@ -492,8 +474,8 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
this._acl_dialog(content);
|
||||
break;
|
||||
}
|
||||
};
|
||||
AdminApp.prototype._acl_delete = function (ids) {
|
||||
}
|
||||
_acl_delete(ids) {
|
||||
var app = egw.app_name(); // can be either admin or preferences!
|
||||
if (app != 'admin')
|
||||
app = 'preferences';
|
||||
@ -532,7 +514,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
// Create the dialog
|
||||
this.acl_dialog = et2_createWidget("dialog", dialog_options, et2_dialog._create_parent(app));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Create the ACL edit dialog, including defaults & fetching what can be found
|
||||
*
|
||||
@ -542,7 +524,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {string} app Name of app
|
||||
* @param {function} callback
|
||||
*/
|
||||
AdminApp.prototype._acl_dialog = function (content, sel_options, etemplate, app, callback) {
|
||||
_acl_dialog(content, sel_options, etemplate, app, callback) {
|
||||
if (typeof content == 'undefined')
|
||||
content = {};
|
||||
// Determine which application we're running as
|
||||
@ -585,8 +567,8 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
else {
|
||||
// Restrict application selectbox to only apps that support ACL
|
||||
sel_options.acl_appname = [];
|
||||
for (var app_1 in acl_rights) {
|
||||
sel_options.acl_appname.push({ value: app_1, label: this.egw.lang(this.egw.link_get_registry(app_1, 'entries') || app_1) });
|
||||
for (let app in acl_rights) {
|
||||
sel_options.acl_appname.push({ value: app, label: this.egw.lang(this.egw.link_get_registry(app, 'entries') || app) });
|
||||
}
|
||||
// Sort list
|
||||
sel_options.acl_appname.sort(function (a, b) {
|
||||
@ -603,7 +585,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
content.acl_rights = content.acl_rights ? parseInt(content.acl_rights) : null;
|
||||
jQuery.extend(content, { acl: [], right: [], label: [] });
|
||||
// Use this to make sure we get correct app translations
|
||||
var app_egw = egw(content.acl_appname, window);
|
||||
let app_egw = egw(content.acl_appname, window);
|
||||
for (var right in acl_rights[content.acl_appname]) {
|
||||
// only user himself is allowed to grant private (16) rights
|
||||
if (right == '16' && content['acl_account'] != egw.user('account_id')) {
|
||||
@ -704,7 +686,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
// Create the dialog
|
||||
this.acl_dialog = et2_createWidget("dialog", dialog_options, et2_dialog._create_parent(app));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change handler for ACL edit dialog application selectbox.
|
||||
* Re-creates the dialog with the current values
|
||||
@ -712,7 +694,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param input
|
||||
* @param widget
|
||||
*/
|
||||
AdminApp.prototype.acl_reopen_dialog = function (input, widget) {
|
||||
acl_reopen_dialog(input, widget) {
|
||||
var content = {};
|
||||
if (this.acl_dialog != null) {
|
||||
content = this.acl_dialog.get_value() || {};
|
||||
@ -722,36 +704,36 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
// Re-open the dialog
|
||||
this._acl_dialog(content);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Load the new application's lang files when the app filter is changed
|
||||
*/
|
||||
AdminApp.prototype.acl_app_change = function (event, nm) {
|
||||
var appname = nm.getWidgetById('filter2').getValue() || '';
|
||||
acl_app_change(event, nm) {
|
||||
let appname = nm.getWidgetById('filter2').getValue() || '';
|
||||
if (appname) {
|
||||
var app_egw = egw(appname);
|
||||
let app_egw = egw(appname);
|
||||
app_egw.langRequireApp(window, appname);
|
||||
nm.getRoot().setApiInstance(app_egw);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Callback called on successfull call of serverside ACL handling
|
||||
*
|
||||
* @param {object} _data returned from server
|
||||
*/
|
||||
AdminApp.prototype._acl_callback = function (_data) {
|
||||
_acl_callback(_data) {
|
||||
// Avoid the window / framework / app and just refresh the etemplate
|
||||
// Framework will try to refresh the opener
|
||||
// Get by ID, since this.et2 isn't always the ACL list
|
||||
var et2 = etemplate2.getById('admin-acl').widgetContainer;
|
||||
et2.getInstanceManager().refresh(_data.msg, this.appname, _data.ids, _data.type);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Check to see if admin has taken away access to a category
|
||||
*
|
||||
* @@param {widget} button add/apply pressed button
|
||||
*/
|
||||
AdminApp.prototype.check_owner = function (button) {
|
||||
check_owner(button) {
|
||||
var select_owner = this.et2.getWidgetById('owner');
|
||||
var diff = [];
|
||||
if (typeof select_owner != 'undefined') {
|
||||
@ -794,25 +776,25 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Show icon based on icon-selectbox, hide placeholder (broken image), if no icon selected
|
||||
*
|
||||
* @param {widget} widget select box widget
|
||||
*/
|
||||
AdminApp.prototype.change_icon = function (widget) {
|
||||
change_icon(widget) {
|
||||
var img = widget.getRoot().getWidgetById('icon_url');
|
||||
if (img) {
|
||||
img.set_src(widget.getValue());
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Add / edit an account
|
||||
*
|
||||
* @param {object} _action egwAction
|
||||
* @param {array} _senders egwActionObject _senders[0].id holds account_id
|
||||
*/
|
||||
AdminApp.prototype.account = function (_action, _senders) {
|
||||
account(_action, _senders) {
|
||||
var params = jQuery.extend({}, this.egw.link_get_registry('addressbook', 'edit'));
|
||||
var popup = this.egw.link_get_registry('addressbook', 'edit_popup');
|
||||
switch (_action.id) {
|
||||
@ -828,7 +810,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
break;
|
||||
}
|
||||
this.egw.open_link(this.egw.link('/index.php', params), 'admin', popup, 'admin');
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Submit statistic
|
||||
*
|
||||
@ -840,7 +822,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {string} submit_url
|
||||
* @return {boolean}
|
||||
*/
|
||||
AdminApp.prototype.submit_statistic = function (form, submit_url) {
|
||||
submit_statistic(form, submit_url) {
|
||||
var that = this;
|
||||
var submit = function () {
|
||||
// submit to egroupware.org
|
||||
@ -872,26 +854,26 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}, this.egw.lang('Submit displayed information?'), '', {}, et2_dialog.BUTTON_YES_NO, et2_dialog.QUESTION_MESSAGE, undefined, egw);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change handler for when you change the type of a custom field.
|
||||
* It toggles options / attributes as appropriate.
|
||||
* @param {event object} e
|
||||
* @param {widget object} widget
|
||||
*/
|
||||
AdminApp.prototype.cf_type_change = function (e, widget) {
|
||||
cf_type_change(e, widget) {
|
||||
var root = widget.getRoot();
|
||||
var attributes = widget.getArrayMgr('content').getEntry('attributes[' + widget.getValue() + ']') || {};
|
||||
root.getWidgetById('cf_values').set_statustext(widget.egw().lang(widget.getArrayMgr('content').getEntry('options[' + widget.getValue() + ']') || ''));
|
||||
jQuery(root.getWidgetById('cf_len').getDOMNode()).toggle(attributes.cf_len && true);
|
||||
jQuery(root.getWidgetById('cf_rows').getDOMNode()).toggle(attributes.cf_rows && true);
|
||||
jQuery(root.getWidgetById('cf_values').getParentDOMNode()).toggle(attributes.cf_values && true);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change handler for when you delete a custom app type
|
||||
* If Policy app is available, it asks for documentation
|
||||
*/
|
||||
AdminApp.prototype.cf_type_delete = function (e, widget) {
|
||||
cf_type_delete(e, widget) {
|
||||
var callback = function (button, value) {
|
||||
if (button === et2_dialog.YES_BUTTON) {
|
||||
var values = jQuery.extend({}, this.getInstanceManager().getValues(this.getRoot()), value, { appname: this.getRoot().getArrayMgr('content').getEntry('content_types[appname]') });
|
||||
@ -933,14 +915,14 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
callback(et2_dialog.YES_BUTTON);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Activate none standard SMTP mail accounts for selected users
|
||||
*
|
||||
* @param {egw_action} _action
|
||||
* @param {array} _selected selected users
|
||||
*/
|
||||
AdminApp.prototype.emailadminActiveAccounts = function (_action, _selected) {
|
||||
emailadminActiveAccounts(_action, _selected) {
|
||||
var menuaction = 'admin.admin_mail.ajax_activeAccounts';
|
||||
var accounts = [];
|
||||
var msg1 = egw.lang('%1 accounts being activated', "" + Object.keys(_selected).length);
|
||||
@ -961,13 +943,13 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
};
|
||||
// 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);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Resize window methode
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
AdminApp.prototype.wizard_popup_resize = function () {
|
||||
wizard_popup_resize() {
|
||||
var $main_div = jQuery('#popupMainDiv');
|
||||
var $et2 = jQuery('.et2_container');
|
||||
var w = {
|
||||
@ -981,21 +963,21 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
if (delta_width != 0 || delta_height != 0) {
|
||||
window.resizeTo(egw_getWindowOuterWidth() - delta_width, egw_getWindowOuterHeight() - delta_height);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Switch account wizard to manual entry
|
||||
*/
|
||||
AdminApp.prototype.wizard_manual = function () {
|
||||
wizard_manual() {
|
||||
jQuery('.emailadmin_manual').fadeToggle(); // not sure how to to this et2-isch
|
||||
this.wizard_popup_resize(); // popup needs to be resized after toggling
|
||||
};
|
||||
}
|
||||
/**
|
||||
* onclick for continue button to show progress animation
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.wizard_detect = function (_event, _widget) {
|
||||
wizard_detect(_event, _widget) {
|
||||
// we need to do a manual asynchronious submit to show progress animation
|
||||
// default synchronious submit stops animation!
|
||||
if (this.et2._inst.submit('button[continue]', true)) // true = async submit
|
||||
@ -1007,60 +989,60 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Set default port, if imap ssl-type changes
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.wizard_imap_ssl_onchange = function (_event, _widget) {
|
||||
wizard_imap_ssl_onchange(_event, _widget) {
|
||||
var ssl_type = _widget.get_value();
|
||||
this.et2.getWidgetById('acc_imap_port').set_value(ssl_type == this.SSL_SSL || ssl_type == this.SSL_TLS ? 993 : 143);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Set default port, if imap ssl-type changes
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.wizard_smtp_ssl_onchange = function (_event, _widget) {
|
||||
wizard_smtp_ssl_onchange(_event, _widget) {
|
||||
var ssl_type = _widget.get_value();
|
||||
this.et2.getWidgetById('acc_smtp_port').set_value(ssl_type == 'no' ? 25 : (ssl_type == this.SSL_SSL || ssl_type == this.SSL_TLS ? 465 : 587));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Set default port, if imap ssl-type changes
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.wizard_sieve_ssl_onchange = function (_event, _widget) {
|
||||
wizard_sieve_ssl_onchange(_event, _widget) {
|
||||
var ssl_type = _widget.get_value();
|
||||
this.et2.getWidgetById('acc_sieve_port').set_value(ssl_type == this.SSL_SSL || ssl_type == this.SSL_TLS ? 5190 : 4190);
|
||||
this.wizard_sieve_onchange(_event, _widget);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Enable sieve, if user changes some setting
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.wizard_sieve_onchange = function (_event, _widget) {
|
||||
wizard_sieve_onchange(_event, _widget) {
|
||||
this.et2.getWidgetById('acc_sieve_enabled').set_value(1);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Switch to select multiple accounts
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.edit_multiple = function (_event, _widget) {
|
||||
edit_multiple(_event, _widget) {
|
||||
// hide multiple button
|
||||
_widget.set_disabled(true);
|
||||
// switch account-selection to multiple
|
||||
var account_id = this.et2.getWidgetById('account_id');
|
||||
account_id.set_multiple(true);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Hide not applying fields, used as:
|
||||
* - onchange handler on account_id
|
||||
@ -1069,7 +1051,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.account_hide_not_applying = function (_event, _widget) {
|
||||
account_hide_not_applying(_event, _widget) {
|
||||
var account_id = this.et2.getWidgetById('account_id');
|
||||
var ids = account_id && account_id.get_value ? account_id.get_value() : [];
|
||||
if (typeof ids == 'string')
|
||||
@ -1104,73 +1086,72 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
if (_event && _event.stopPropagation)
|
||||
_event.stopPropagation();
|
||||
return false;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Callback if user changed account selction
|
||||
*
|
||||
* @param {object} _event event-object or information about event
|
||||
* @param {et2_baseWidget} _widget widget causing the event
|
||||
*/
|
||||
AdminApp.prototype.change_account = function (_event, _widget) {
|
||||
change_account(_event, _widget) {
|
||||
// todo check dirty and query user to a) save changes, b) discard changes, c) cancel selection
|
||||
_widget.getInstanceManager().submit();
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Callback if user changes notification folders: unset use-default checkbox
|
||||
*
|
||||
* @param {object} _event
|
||||
* @param {et2_widget} _widget
|
||||
*/
|
||||
AdminApp.prototype.change_folders = function (_event, _widget) {
|
||||
change_folders(_event, _widget) {
|
||||
var use_default = this.et2.getWidgetById('notify_use_default');
|
||||
if (use_default)
|
||||
use_default.set_value(false);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* default onExecute for admin actions
|
||||
*
|
||||
* @param {object} _action
|
||||
* @param {object} _senders
|
||||
*/
|
||||
AdminApp.prototype.account_edit_action = function (_action, _senders) {
|
||||
account_edit_action(_action, _senders) {
|
||||
if (_action.data.url) {
|
||||
this.egw.open_link(_action.data.url, _action.data.target || '_blank', _action.data.popup);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Clear instance cache
|
||||
*
|
||||
* If there is an error on server-side, resend request with an parameter allowing
|
||||
* cache to use different method not requiring eg. so much memory
|
||||
*/
|
||||
AdminApp.prototype.clear_cache = function () {
|
||||
var wait = this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
||||
var success = function () {
|
||||
clear_cache() {
|
||||
let wait = this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
||||
let success = function () {
|
||||
wait.close();
|
||||
egw.message('Done');
|
||||
};
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache', null, success).sendRequest(true, undefined, jQuery.proxy(function (_xmlhttp, _err) {
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1', null, success).sendRequest(true);
|
||||
}, this));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Action handler for clear credentials action
|
||||
*
|
||||
* @param action
|
||||
* @param selected
|
||||
*/
|
||||
AdminApp.prototype.clear_credentials_handler = function (action, selected) {
|
||||
var ids = [];
|
||||
for (var _i = 0, selected_1 = selected; _i < selected_1.length; _i++) {
|
||||
var row = selected_1[_i];
|
||||
clear_credentials_handler(action, selected) {
|
||||
let ids = [];
|
||||
for (let row of selected) {
|
||||
ids.push(row.id.split("::").pop());
|
||||
}
|
||||
this.egw.request("admin.admin_passwordreset.ajax_clear_credentials", [action.id, ids]);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Export content of given field into relevant file
|
||||
*/
|
||||
AdminApp.prototype.smime_exportCert = function () {
|
||||
smime_exportCert() {
|
||||
var $a = jQuery(document.createElement('a')).appendTo('body').hide();
|
||||
var acc_id = this.et2.getArrayMgr("content").getEntry('acc_id');
|
||||
var url = window.egw.webserverUrl + '/index.php?';
|
||||
@ -1180,14 +1161,14 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
$a.prop('download', "");
|
||||
$a[0].click();
|
||||
$a.remove();
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Create certificate generator dialog
|
||||
*/
|
||||
AdminApp.prototype.smime_genCertificate = function () {
|
||||
smime_genCertificate() {
|
||||
var self = this;
|
||||
et2_createWidget("dialog", {
|
||||
callback: function (_button_id, _value) {
|
||||
callback(_button_id, _value) {
|
||||
if (_button_id == 'create' && _value) {
|
||||
var isValid = true;
|
||||
var required = ['countryName', 'emailAddress'];
|
||||
@ -1244,26 +1225,26 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
resizable: false,
|
||||
position: 'left top'
|
||||
}, et2_dialog._create_parent('mail'));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Triggers upload for background image and updates its taglist
|
||||
*
|
||||
* @param {type} node
|
||||
* @param {type} widget
|
||||
*/
|
||||
AdminApp.prototype.login_background_update = function (node, widget) {
|
||||
login_background_update(node, widget) {
|
||||
var taglist = widget._parent._children[0];
|
||||
egw.json('admin.admin_config.ajax_upload_anon_images', [widget.get_value(), taglist.get_value()], function (_data) {
|
||||
taglist.set_value(_data);
|
||||
}).sendRequest();
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Set content of selected row
|
||||
*
|
||||
* @param {array} node
|
||||
* @returns
|
||||
*/
|
||||
AdminApp.prototype.cmds_onselect = function (node) {
|
||||
cmds_onselect(node) {
|
||||
var splitter = this.et2.getWidgetById('splitter');
|
||||
var cmds_preview = this.et2.getWidgetById('cmds_preview');
|
||||
if (node.length != 1) {
|
||||
@ -1288,12 +1269,7 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
policy_preview.set_disabled(true);
|
||||
cmds_preview.set_value({ content: [data.data] });
|
||||
}
|
||||
};
|
||||
return AdminApp;
|
||||
}(egw_app_1.EgwApp
|
||||
/**
|
||||
* @lends app.classes.admin
|
||||
*/
|
||||
));
|
||||
}
|
||||
}
|
||||
app.classes.admin = AdminApp;
|
||||
//# sourceMappingURL=app.js.map
|
@ -18,7 +18,6 @@
|
||||
import {egwAction, egwActionImplementation, egwActionObject} from './egw_action.js';
|
||||
import {egwFnct} from './egw_action_common.js';
|
||||
import {egwMenu, _egw_active_menu} from "./egw_menu.js";
|
||||
import '../jquery/jquery-tap-and-hold/jquery.tapandhold.js';
|
||||
|
||||
if (typeof window._egwActionClasses == "undefined")
|
||||
window._egwActionClasses = {};
|
||||
|
@ -16,7 +16,6 @@
|
||||
import { EGW_AO_SHIFT_STATE_MULTI, EGW_AO_STATE_FOCUSED, EGW_AO_STATE_SELECTED, egwActionObjectInterface } from "../egw_action/egw_action.js";
|
||||
import { egwBitIsSet, egwGetShiftState, egwPreventSelect, egwSetBit, egwUnfocus, egwIsMobile } from "../egw_action/egw_action_common.js";
|
||||
import { _egw_active_menu } from "../egw_action/egw_menu.js";
|
||||
import '../../../vendor/bower-asset/jquery-touchswipe/jquery.touchSwipe.js';
|
||||
/**
|
||||
* Contains the action object interface implementation for the nextmatch widget
|
||||
* row.
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
} from "../egw_action/egw_action.js";
|
||||
import {egwBitIsSet, egwGetShiftState, egwPreventSelect, egwSetBit, egwUnfocus, egwIsMobile} from "../egw_action/egw_action_common.js";
|
||||
import {_egw_active_menu} from "../egw_action/egw_menu.js";
|
||||
import '../../../vendor/bower-asset/jquery-touchswipe/jquery.touchSwipe.js';
|
||||
|
||||
/**
|
||||
* Contains the action object interface implementation for the nextmatch widget
|
||||
|
@ -19,6 +19,8 @@ import { ClassWithAttributes } from "./et2_core_inheritance";
|
||||
import { et2_register_widget, et2_createWidget } from "./et2_core_widget";
|
||||
import { et2_no_init } from "./et2_core_common";
|
||||
import { egw } from "../jsapi/egw_global";
|
||||
import { tinymce } from "../../../vendor/tinymce/tinymce/tinymce.min.js";
|
||||
import { etemplate2 } from "./etemplate2";
|
||||
/**
|
||||
* @augments et2_inputWidget
|
||||
*/
|
||||
|
@ -23,6 +23,8 @@ import {et2_IResizeable} from "./et2_core_interfaces";
|
||||
import {et2_no_init} from "./et2_core_common";
|
||||
import {egw} from "../jsapi/egw_global";
|
||||
import {et2_vfsSelect} from "./et2_widget_vfs";
|
||||
import {tinymce} from "../../../vendor/tinymce/tinymce/tinymce.min.js";
|
||||
import {etemplate2} from "./etemplate2";
|
||||
|
||||
/**
|
||||
* @augments et2_inputWidget
|
||||
|
@ -11,7 +11,6 @@
|
||||
vendor.bower-asset.jquery.dist.jquery;
|
||||
egw_inheritance.js;
|
||||
*/
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../jsapi/egw_inheritance.js';
|
||||
|
||||
window.fw_base = (function(){ "use strict"; return Class.extend(
|
||||
|
@ -12,7 +12,6 @@
|
||||
egw_inheritance.js;
|
||||
*/
|
||||
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../egw_action/egw_action_common.js';
|
||||
import '../jsapi/egw_inheritance.js';
|
||||
import '../etemplate/etemplate2.js'; // otherwise et2_load json-response-handler is not (yet) available
|
||||
|
@ -16,7 +16,6 @@
|
||||
framework.fw_classes;
|
||||
egw_inheritance.js;
|
||||
*/
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import './fw_base.js';
|
||||
import './fw_browser.js';
|
||||
import './fw_ui.js';
|
||||
|
@ -12,9 +12,6 @@
|
||||
/api/js/jquery/mousewheel/mousewheel.js;
|
||||
egw_inheritance.js;
|
||||
*/
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../../../vendor/bower-asset/jquery-ui/jquery-ui.js';
|
||||
import '../jquery/mousewheel/mousewheel.js';
|
||||
import '../jsapi/egw_inheritance.js';
|
||||
|
||||
/**
|
||||
|
@ -5,8 +5,6 @@
|
||||
// Full source at https://github.com/harvesthq/chosen
|
||||
// Copyright (c) 2011 Harvest http://getharvest.com
|
||||
|
||||
import 'jquery';
|
||||
|
||||
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
||||
// This file is generated by `grunt build`, do not edit it by hand.
|
||||
(function() {
|
||||
|
@ -17,7 +17,6 @@
|
||||
* @description Adds a handler for a custom event 'taphold' that handles a
|
||||
* tap and hold on touch interfaces.
|
||||
*/
|
||||
import '../../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
(function($) {
|
||||
var TAP_AND_HOLD_TRIGGER_TIMER = 600;
|
||||
var MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT = 40;
|
||||
|
2
api/js/jquery/jquery-ui-timepicker-addon.js
vendored
2
api/js/jquery/jquery-ui-timepicker-addon.js
vendored
@ -1,8 +1,6 @@
|
||||
/*! jQuery Timepicker Addon - v1.6.1 - 2015-11-14
|
||||
* http://trentrichardson.com/examples/timepicker
|
||||
* Copyright (c) 2015 Trent Richardson; Licensed MIT */
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../../../vendor/bower-asset/jquery-ui/jquery-ui.js';
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', 'jquery-ui'], factory);
|
||||
|
@ -5,13 +5,16 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package api
|
||||
* @subpackage ajax
|
||||
* @author Ralf Becker <rb@stylite.de>
|
||||
* @version $Id$
|
||||
* @author Ralf Becker <rb@egroupware.org>
|
||||
*/
|
||||
|
||||
/*egw:uses
|
||||
/vendor/bower-asset/jquery/dist/jquery.js;
|
||||
/vendor/bower-asset/jquery-ui/jquery-ui.js;
|
||||
/api/js/jquery/chosen/chosen.jquery.js;
|
||||
/api/js/jquery/jquery-tab-and-hold/jquery.tabandhold.js;
|
||||
/api/js/jquery/mousewheel/mousewheel.js;
|
||||
/api/js/jquery/jquery-ui-timepicker-addon.js;
|
||||
/vendor/bower-asset/jquery-touchswipe/jquery.touchSwipe.js;
|
||||
*/
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
|
||||
jQuery.noConflict();
|
@ -63,6 +63,9 @@
|
||||
window.egw_webserverUrl = egw_script.getAttribute('data-url');
|
||||
window.egw_appName = egw_script.getAttribute('data-app');
|
||||
|
||||
// split includes in legacy js and modules
|
||||
const legacy_js_regexp = /\/dhtmlx|jquery/;
|
||||
|
||||
// check if egw object was injected by window open
|
||||
if (typeof window.egw == 'undefined')
|
||||
{
|
||||
@ -95,6 +98,7 @@
|
||||
{
|
||||
window.egw = {
|
||||
prefsOnly: true,
|
||||
legacy_js_regexp: legacy_js_regexp,
|
||||
webserverUrl: egw_webserverUrl
|
||||
};
|
||||
if (debug) console.log('creating new egw object');
|
||||
@ -146,6 +150,7 @@
|
||||
console.log('Security exception accessing window specific egw object --> creating new one', e);
|
||||
window.egw = {
|
||||
prefsOnly: true,
|
||||
legacy_js_regexp: legacy_js_regexp,
|
||||
webserverUrl: egw_webserverUrl
|
||||
};
|
||||
}
|
||||
@ -187,12 +192,10 @@
|
||||
}));
|
||||
}
|
||||
|
||||
// split includes in legacy js and modules
|
||||
const legacy_regexp = /dhtmlx/;
|
||||
// make our promise global, as legacy code calls egw_LAB.wait which we assign to egw_ready.then
|
||||
window.egw_LAB = window.egw_ready = Promise.all(
|
||||
[legacy_js_import(include.filter((src) => src.match(legacy_regexp) !== null), window.egw_webserverUrl)]
|
||||
.concat(include.filter((src) => src.match(legacy_regexp) === null)
|
||||
window.egw_LAB = window.egw_ready =
|
||||
legacy_js_import(include.filter((src) => src.match(legacy_js_regexp) !== null), window.egw_webserverUrl)
|
||||
.then(() => Promise.all(include.filter((src) => src.match(legacy_js_regexp) === null)
|
||||
.map(rel_src => import(window.egw_webserverUrl+'/'+rel_src)
|
||||
.catch((err) => { console.log(rel_src+":\n\n"+err.message)})
|
||||
))).then(() =>
|
||||
|
@ -9,8 +9,6 @@
|
||||
* @author Hadi Nategh <hn@groupware.org>
|
||||
* @author Nathan Gray <ng@groupware.org>
|
||||
*/
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../../../vendor/bower-asset/jquery-ui/jquery-ui.js';
|
||||
import { etemplate2 } from "../etemplate/etemplate2";
|
||||
import { et2_nextmatch } from "../etemplate/et2_extension_nextmatch";
|
||||
import { et2_dialog } from "../etemplate/et2_widget_dialog";
|
||||
|
@ -10,8 +10,6 @@
|
||||
* @author Nathan Gray <ng@groupware.org>
|
||||
*/
|
||||
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../../../vendor/bower-asset/jquery-ui/jquery-ui.js';
|
||||
import {etemplate2} from "../etemplate/etemplate2";
|
||||
import type {et2_container} from "../etemplate/et2_core_baseWidget";
|
||||
import {et2_nextmatch} from "../etemplate/et2_extension_nextmatch";
|
||||
|
@ -19,8 +19,6 @@
|
||||
egw_css;
|
||||
*/
|
||||
import './egw_core.js';
|
||||
import 'jqueryui';
|
||||
import '../jquery/jquery-ui-timepicker-addon.js';
|
||||
|
||||
/**
|
||||
* Date and timepicker
|
||||
|
@ -156,6 +156,8 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
{
|
||||
_jsFiles = [_jsFiles];
|
||||
}
|
||||
// filter out files included by script-tag via egw.js
|
||||
_jsFiles = _jsFiles.filter((src) => src.match(egw.legacy_js_regexp) === null);
|
||||
let promise;
|
||||
if (_jsFiles.length === 1) // running this in below case fails when loading app.js from etemplate.load()
|
||||
{
|
||||
|
@ -4,13 +4,11 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package api
|
||||
* @subpackage jsapi
|
||||
* @link http://www.egroupware.org
|
||||
* @link https://www.egroupware.org
|
||||
* @author Hadi Nategh (as AT stylite.de)
|
||||
* @author Ralf Becker <RalfBecker@outdoor-training.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import './egw_json.js';
|
||||
|
||||
jQuery(function()
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import '../../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
|
||||
/**
|
||||
* Check whether the console object is defined - if not, define one
|
||||
*/
|
||||
|
@ -7,12 +7,10 @@
|
||||
* @link https://www.egroupware.org
|
||||
*/
|
||||
|
||||
import '../../vendor/bower-asset/jquery/dist/jquery.js'; // also ensures egw_LAB.wait exists!
|
||||
|
||||
/* if login page is not in top window, set top windows location to it */
|
||||
if (top !== window) top.location = window.location;
|
||||
|
||||
egw_LAB.wait(function()
|
||||
egw_ready.then(function()
|
||||
{
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
|
@ -1121,6 +1121,11 @@ abstract class Framework extends Framework\Extra
|
||||
return $java_script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Files imported via script tag in egw.js, because they are no modules
|
||||
*/
|
||||
const legacy_js_imports = '/\/dhtmlx|jquery/';
|
||||
|
||||
/**
|
||||
* Add EGroupware URL prefix eg. '/egroupware' to files AND bundles
|
||||
*
|
||||
@ -1141,6 +1146,13 @@ abstract class Framework extends Framework\Extra
|
||||
|
||||
// @todo: add all node_modules as bare imports
|
||||
|
||||
// map all legacy-js to something "not hurting"
|
||||
$imports = array_map(static function($url) use ($prefix)
|
||||
{
|
||||
return !preg_match(self::legacy_js_imports, $url) ? $url :
|
||||
$prefix.'/api/js/jquery/jquery.noconflict.js';
|
||||
}, $imports);
|
||||
|
||||
return ['imports' => $imports];
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
/**
|
||||
* EGroupware - Filemanager - Javascript UI
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @link https://www.egroupware.org
|
||||
* @package filemanager
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2008-19 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2008-21 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
*/
|
||||
|
||||
@ -13,6 +13,13 @@
|
||||
*/
|
||||
import {EgwApp} from "../../api/js/jsapi/egw_app";
|
||||
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
|
||||
import {etemplate2} from "../../api/js/etemplate/etemplate2";
|
||||
import {et2_dialog} from "../../api/js/etemplate/et2_widget_dialog";
|
||||
import {et2_file} from "../../api/js/etemplate/et2_widget_file";
|
||||
import {et2_button} from "../../api/js/etemplate/et2_widget_button";
|
||||
import {et2_nextmatch_controller} from "../../api/js/etemplate/et2_extension_nextmatch_controller";
|
||||
import {egw_get_file_editor_prefered_mimes} from "../../api/js/jsapi/egw_global";
|
||||
import {et2_createWidget} from "../../api/js/etemplate/et2_core_widget";
|
||||
|
||||
/**
|
||||
* UI for filemanager
|
||||
|
@ -10,11 +10,10 @@
|
||||
/*egw:uses
|
||||
/api/js/jsapi/egw_app.js
|
||||
*/
|
||||
import 'jquery';
|
||||
import 'jqueryui';
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
import { etemplate2 } from "../../api/js/etemplate/etemplate2";
|
||||
import { CRMView } from "../../addressbook/js/CRM";
|
||||
import { nm_open_popup } from "../../api/js/etemplate/et2_extension_nextmatch_actions";
|
||||
/**
|
||||
* UI for Infolog
|
||||
*
|
||||
@ -639,8 +638,7 @@ class InfologApp extends EgwApp {
|
||||
var app = this.et2.getInstanceManager().app_obj;
|
||||
if (!app.stylite) {
|
||||
var self = this;
|
||||
// @ToDo: @new-js-loader
|
||||
egw_LAB.script('stylite/js/app.js?' + this.et2.getArrayMgr('content').getEntry('encryption_ts')).wait(function () {
|
||||
egw.includeJS('/stylite/js/app.js?' + this.et2.getArrayMgr('content').getEntry('encryption_ts'), undefined, undefined, egw.webserverUrl).then(() => {
|
||||
app.stylite = new app.classes.stylite;
|
||||
app.stylite.et2 = self.et2;
|
||||
if (callback) {
|
||||
|
@ -12,14 +12,12 @@
|
||||
/api/js/jsapi/egw_app.js
|
||||
*/
|
||||
|
||||
import 'jquery';
|
||||
import 'jqueryui';
|
||||
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
import {etemplate2} from "../../api/js/etemplate/etemplate2";
|
||||
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
|
||||
import {CRMView} from "../../addressbook/js/CRM";
|
||||
import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
|
||||
import {nm_open_popup} from "../../api/js/etemplate/et2_extension_nextmatch_actions";
|
||||
|
||||
/**
|
||||
* UI for Infolog
|
||||
@ -780,8 +778,8 @@ class InfologApp extends EgwApp
|
||||
if (!app.stylite)
|
||||
{
|
||||
var self = this;
|
||||
// @ToDo: @new-js-loader
|
||||
egw_LAB.script('stylite/js/app.js?'+this.et2.getArrayMgr('content').getEntry('encryption_ts')).wait(function()
|
||||
egw.includeJS('/stylite/js/app.js?'+this.et2.getArrayMgr('content').getEntry('encryption_ts'),
|
||||
undefined, undefined, egw.webserverUrl).then(() =>
|
||||
{
|
||||
app.stylite = new app.classes.stylite;
|
||||
app.stylite.et2 = self.et2;
|
||||
|
@ -13,7 +13,6 @@
|
||||
framework.fw_desktop;
|
||||
/pixelegg/js/slider.js;
|
||||
*/
|
||||
import '../../vendor/bower-asset/jquery/dist/jquery.js';
|
||||
import '../../api/js/framework/fw_desktop.js';
|
||||
import './slider.js';
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
* @package pixelegg
|
||||
*/
|
||||
|
||||
import '../../api/js/jquery/chosen/chosen.jquery.js';
|
||||
|
||||
egw_ready.then(function()
|
||||
{
|
||||
/**
|
||||
|
@ -1,55 +1,39 @@
|
||||
"use strict";
|
||||
/**
|
||||
* EGroupware - Resources - Javascript UI
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @link https://www.egroupware.org
|
||||
* @package resources
|
||||
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @author Hadi Nategh <hn-AT-egroupware.org>
|
||||
* @copyright (c) 2008-21 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id: app.js 44390 2013-11-04 20:54:23Z ralfbecker $
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var egw_app_1 = require("../../api/js/jsapi/egw_app");
|
||||
import { EgwApp } from "../../api/js/jsapi/egw_app";
|
||||
import { fetchAll } from "../../api/js/etemplate/et2_extension_nextmatch_actions";
|
||||
/**
|
||||
* UI for resources
|
||||
*/
|
||||
var resourcesApp = /** @class */ (function (_super) {
|
||||
__extends(resourcesApp, _super);
|
||||
class resourcesApp extends EgwApp {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function resourcesApp() {
|
||||
return _super.call(this, 'resources') || this;
|
||||
constructor() {
|
||||
super('resources');
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
resourcesApp.prototype.destroy = function (_app) {
|
||||
destroy(_app) {
|
||||
delete this.et2;
|
||||
_super.prototype.destroy.call(this, _app);
|
||||
};
|
||||
super.destroy(_app);
|
||||
}
|
||||
/**
|
||||
* This function is called when the etemplate2 object is loaded
|
||||
* and ready. If you must store a reference to the et2 object,
|
||||
* make sure to clean it up in destroy().
|
||||
*/
|
||||
resourcesApp.prototype.et2_ready = function (et2, name) {
|
||||
_super.prototype.et2_ready.call(this, et2, name);
|
||||
};
|
||||
et2_ready(et2, name) {
|
||||
super.et2_ready(et2, name);
|
||||
}
|
||||
/**
|
||||
* call calendar planner by selected resources
|
||||
*
|
||||
@ -57,14 +41,14 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
* @param {action} _senders selected action
|
||||
*
|
||||
*/
|
||||
resourcesApp.prototype.view_calendar = function (_action, _senders) {
|
||||
var res_ids = [];
|
||||
var matches = [];
|
||||
var nm = _action.parent.data.nextmatch;
|
||||
var selection = nm.getSelection();
|
||||
var show_calendar = function (res_ids) {
|
||||
view_calendar(_action, _senders) {
|
||||
let res_ids = [];
|
||||
let matches = [];
|
||||
let nm = _action.parent.data.nextmatch;
|
||||
let selection = nm.getSelection();
|
||||
let show_calendar = function (res_ids) {
|
||||
egw(window).message(this.egw.lang('%1 resource(s) View calendar', res_ids.length));
|
||||
var current_owners = (app.calendar ? app.calendar.state.owner || [] : []).join(',');
|
||||
let current_owners = (app.calendar ? app.calendar.state.owner || [] : []).join(',');
|
||||
if (current_owners) {
|
||||
current_owners += ',';
|
||||
}
|
||||
@ -75,7 +59,7 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
fetchAll(res_ids, nm, show_calendar);
|
||||
}
|
||||
else {
|
||||
for (var i = 0; i < _senders.length; i++) {
|
||||
for (let i = 0; i < _senders.length; i++) {
|
||||
res_ids.push(_senders[i].id);
|
||||
matches = res_ids[i].match(/^(?:resources::)?([0-9]+)(:([0-9]+))?$/);
|
||||
if (matches) {
|
||||
@ -84,23 +68,23 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
}
|
||||
show_calendar(res_ids);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Calendar sidebox hook change handler
|
||||
*
|
||||
*/
|
||||
resourcesApp.prototype.sidebox_change = function (ev, widget) {
|
||||
sidebox_change(ev, widget) {
|
||||
if (ev[0] != 'r') {
|
||||
widget.setSubChecked(ev, widget.getValue()[ev].value || false);
|
||||
}
|
||||
var owner = jQuery.extend([], app.calendar.state.owner) || [];
|
||||
for (var i = owner.length - 1; i >= 0; i--) {
|
||||
let owner = jQuery.extend([], app.calendar.state.owner) || [];
|
||||
for (let i = owner.length - 1; i >= 0; i--) {
|
||||
if (owner[i][0] == 'r') {
|
||||
owner.splice(i, 1);
|
||||
}
|
||||
}
|
||||
var value = widget.getValue();
|
||||
for (var key in value) {
|
||||
let value = widget.getValue();
|
||||
for (let key in value) {
|
||||
if (key[0] !== 'r')
|
||||
continue;
|
||||
if (value[key].value && owner.indexOf(key) === -1) {
|
||||
@ -108,16 +92,16 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
}
|
||||
}
|
||||
app.calendar.update_state({ owner: owner });
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Book selected resource for calendar
|
||||
*
|
||||
* @param {action} _action actions
|
||||
* @param {action} _senders selected action
|
||||
*/
|
||||
resourcesApp.prototype.book = function (_action, _senders) {
|
||||
var res_ids = [], matches = [];
|
||||
for (var i = 0; i < _senders.length; i++) {
|
||||
book(_action, _senders) {
|
||||
let res_ids = [], matches = [];
|
||||
for (let i = 0; i < _senders.length; i++) {
|
||||
res_ids.push(_senders[i].id);
|
||||
matches = res_ids[i].match(/^(?:resources::)?([0-9]+)(:([0-9]+))?$/);
|
||||
if (matches) {
|
||||
@ -126,18 +110,17 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
}
|
||||
egw(window).message(this.egw.lang('%1 resource(s) booked', res_ids.length));
|
||||
this.egw.open_link('calendar.calendar_uiforms.edit&participants=r' + res_ids.join(',r'), '_blank', '700x700');
|
||||
};
|
||||
}
|
||||
/**
|
||||
* set the picture_src to own_src by uploding own file
|
||||
*
|
||||
*/
|
||||
resourcesApp.prototype.select_picture_src = function () {
|
||||
var rBtn = this.et2.getWidgetById('picture_src');
|
||||
select_picture_src() {
|
||||
let rBtn = this.et2.getWidgetById('picture_src');
|
||||
if (typeof rBtn != 'undefined') {
|
||||
rBtn.set_value('own_src');
|
||||
}
|
||||
};
|
||||
return resourcesApp;
|
||||
}(egw_app_1.EgwApp));
|
||||
}
|
||||
}
|
||||
app.classes.resources = resourcesApp;
|
||||
//# sourceMappingURL=app.js.map
|
@ -1,15 +1,15 @@
|
||||
/**
|
||||
* EGroupware - Resources - Javascript UI
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @link https://www.egroupware.org
|
||||
* @package resources
|
||||
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @author Hadi Nategh <hn-AT-egroupware.org>
|
||||
* @copyright (c) 2008-21 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id: app.js 44390 2013-11-04 20:54:23Z ralfbecker $
|
||||
*/
|
||||
|
||||
import {EgwApp} from "../../api/js/jsapi/egw_app";
|
||||
import {fetchAll} from "../../api/js/etemplate/et2_extension_nextmatch_actions";
|
||||
|
||||
/**
|
||||
* UI for resources
|
||||
|
Loading…
Reference in New Issue
Block a user