mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:49:06 +01:00
Fix favourites (& probably some more inherited stuff) broken by TypeScript conversion
Note that any properties declared in a sub-class aren't generally available until after the super() call is done, i.e. in the super constructor they're undefined.
This commit is contained in:
parent
7631eb83aa
commit
34ec346821
@ -43,11 +43,8 @@ var AddressbookApp = /** @class */ (function (_super) {
|
||||
* @memberOf app.addressbook
|
||||
*/
|
||||
function AddressbookApp() {
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this) || this;
|
||||
_this.appname = 'addressbook';
|
||||
return _this;
|
||||
return _super.call(this, 'addressbook') || this;
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
|
@ -17,7 +17,7 @@ import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
|
||||
/**
|
||||
* UI for Addressbook
|
||||
@ -26,8 +26,6 @@ import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
*/
|
||||
class AddressbookApp extends EgwApp
|
||||
{
|
||||
readonly appname = 'addressbook';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -36,7 +34,7 @@ class AddressbookApp extends EgwApp
|
||||
constructor()
|
||||
{
|
||||
// call parent
|
||||
super();
|
||||
super('addressbook');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,10 +43,9 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* @memberOf app.classes.admin
|
||||
*/
|
||||
function AdminApp() {
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this) || this;
|
||||
_this.appname = 'admin';
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this, 'admin') || this;
|
||||
/**
|
||||
* reference to iframe
|
||||
*
|
||||
|
@ -17,7 +17,7 @@ import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
|
||||
/**
|
||||
* UI for Admin
|
||||
@ -29,7 +29,6 @@ class AdminApp extends EgwApp
|
||||
* @lends app.classes.admin
|
||||
*/
|
||||
{
|
||||
readonly appname = 'admin';
|
||||
|
||||
/**
|
||||
* reference to iframe
|
||||
@ -67,7 +66,7 @@ class AdminApp extends EgwApp
|
||||
constructor()
|
||||
{
|
||||
// call parent
|
||||
super();
|
||||
super('admin');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,11 +50,12 @@ var EgwApp = /** @class */ (function () {
|
||||
* Initialization and setup goes here, but the etemplate2 object
|
||||
* is not yet ready.
|
||||
*/
|
||||
function EgwApp() {
|
||||
function EgwApp(appname) {
|
||||
/**
|
||||
* Mailvelope "egroupware" Keyring
|
||||
*/
|
||||
this.mailvelope_keyring = undefined;
|
||||
this.appname = appname;
|
||||
this.egw = egw(this.appname, window);
|
||||
// Initialize sidebox for non-popups.
|
||||
// ID set server side
|
||||
|
@ -124,15 +124,16 @@ export abstract class EgwApp
|
||||
* Initialization and setup goes here, but the etemplate2 object
|
||||
* is not yet ready.
|
||||
*/
|
||||
constructor()
|
||||
constructor(appname: string)
|
||||
{
|
||||
this.appname = appname;
|
||||
this.egw = egw(this.appname, window);
|
||||
|
||||
// Initialize sidebox for non-popups.
|
||||
// ID set server side
|
||||
if(!this.egw.is_popup())
|
||||
{
|
||||
var sidebox = jQuery('#favorite_sidebox_'+this.appname);
|
||||
var sidebox = jQuery('#favorite_sidebox_' + this.appname);
|
||||
if(sidebox.length == 0 && egw_getFramework() != null)
|
||||
{
|
||||
var egw_fw = egw_getFramework();
|
||||
|
@ -95,12 +95,8 @@ var CalendarApp = /** @class */ (function (_super) {
|
||||
);
|
||||
}
|
||||
*/
|
||||
// call parent
|
||||
_super.call(this) || this;
|
||||
/**
|
||||
* application name
|
||||
*/
|
||||
_this.appname = 'calendar';
|
||||
// call parent
|
||||
_super.call(this, 'calendar') || this;
|
||||
/**
|
||||
* Needed for JSON callback
|
||||
*/
|
||||
|
@ -55,10 +55,6 @@ import {et2_calendar_event} from "./et2_widget_event";
|
||||
*/
|
||||
class CalendarApp extends EgwApp
|
||||
{
|
||||
/**
|
||||
* application name
|
||||
*/
|
||||
public readonly appname = 'calendar';
|
||||
|
||||
/**
|
||||
* Needed for JSON callback
|
||||
@ -161,14 +157,14 @@ class CalendarApp extends EgwApp
|
||||
}
|
||||
*/
|
||||
// call parent
|
||||
super();
|
||||
super('calendar');
|
||||
|
||||
// Scroll
|
||||
jQuery(jQuery.proxy(this._scroll,this));
|
||||
jQuery.extend(this.state, this.egw.preference('saved_states','calendar'));
|
||||
jQuery(jQuery.proxy(this._scroll, this));
|
||||
jQuery.extend(this.state, this.egw.preference('saved_states', 'calendar'));
|
||||
|
||||
// Set custom color for events without category
|
||||
if(this.egw.preference('no_category_custom_color','calendar'))
|
||||
if(this.egw.preference('no_category_custom_color', 'calendar'))
|
||||
{
|
||||
this.egw.css(
|
||||
'.calendar_calEvent:not([class*="cat_"])',
|
||||
|
@ -37,9 +37,9 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
* @memberOf app.filemanager
|
||||
*/
|
||||
function filemanagerAPP() {
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this) || this;
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this, 'filemanager') || this;
|
||||
/**
|
||||
* path widget, by template
|
||||
*/
|
||||
@ -302,7 +302,7 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
*/
|
||||
filemanagerAPP.prototype._upload_callback = function (_data) {
|
||||
if (_data.msg || _data.uploaded)
|
||||
window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
window.egw_refresh(_data.msg, this.appname);
|
||||
var that = this;
|
||||
for (var file in _data.uploaded) {
|
||||
if (_data.uploaded[file].confirm && !_data.uploaded[file].confirmed) {
|
||||
@ -513,7 +513,7 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
* @param _data
|
||||
*/
|
||||
filemanagerAPP.prototype._do_action_callback = function (_data) {
|
||||
window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
window.egw_refresh(_data.msg, this.appname);
|
||||
};
|
||||
/**
|
||||
* Force download of a file by appending '?download' to it's download url
|
||||
@ -724,8 +724,8 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
(dir && dir.data && dir.data.class && dir.data.class.indexOf('noEdit') === -1 || !dir)
|
||||
});
|
||||
// Last 10 folders
|
||||
var previous_dsts = jQuery.extend([], egw.preference('drop_history', filemanagerAPP.appname));
|
||||
var action_index = 0;
|
||||
var previous_dsts = jQuery.extend([], egw.preference('drop_history', this.appname));
|
||||
var action_index = 0;
|
||||
for (var i = 0; i < 10; i++) {
|
||||
var path = i < previous_dsts.length ? previous_dsts[i] : '';
|
||||
actions.push({
|
||||
@ -806,10 +806,10 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
}
|
||||
}
|
||||
// Remember the target for next time
|
||||
var previous_dsts = jQuery.extend([], egw.preference('drop_history', filemanagerAPP.appname));
|
||||
var previous_dsts = jQuery.extend([], egw.preference('drop_history', this.appname));
|
||||
previous_dsts.unshift(dst);
|
||||
previous_dsts = Array.from(new Set(previous_dsts)).slice(0, 9);
|
||||
egw.set_preference(filemanagerAPP.appname, 'drop_history', previous_dsts);
|
||||
previous_dsts = Array.from(new Set(previous_dsts)).slice(0, 9);
|
||||
egw.set_preference(this.appname, 'drop_history', previous_dsts);
|
||||
// Actual action id will be something like file_drop_{move|copy|link}[_other_id],
|
||||
// but we need to send move, copy or link
|
||||
var action_id = _action.id.replace("file_drop_", '').split('_', 1)[0];
|
||||
@ -976,7 +976,7 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
*/
|
||||
filemanagerAPP.prototype._share_link_callback = function (_data) {
|
||||
if (_data.msg || _data.share_link)
|
||||
window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
window.egw_refresh(_data.msg, this.appname);
|
||||
console.log("_data", _data);
|
||||
var app = this;
|
||||
var copy_link_to_clipboard = function (evt) {
|
||||
@ -1101,7 +1101,6 @@ var filemanagerAPP = /** @class */ (function (_super) {
|
||||
}
|
||||
return true;
|
||||
};
|
||||
filemanagerAPP.appname = 'filemanager';
|
||||
return filemanagerAPP;
|
||||
}(egw_app_1.EgwApp));
|
||||
exports.filemanagerAPP = filemanagerAPP;
|
||||
|
@ -19,7 +19,6 @@ import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
|
||||
*/
|
||||
export class filemanagerAPP extends EgwApp
|
||||
{
|
||||
static readonly appname = 'filemanager';
|
||||
/**
|
||||
* path widget, by template
|
||||
*/
|
||||
@ -44,12 +43,12 @@ export class filemanagerAPP extends EgwApp
|
||||
constructor()
|
||||
{
|
||||
// call parent
|
||||
super();
|
||||
super('filemanager');
|
||||
|
||||
// Loading filemanager in its tab and home causes us problems with
|
||||
// unwanted destruction, so we check for already existing path widgets
|
||||
let lists = etemplate2.getByApplication('home');
|
||||
for(let i = 0; i < lists.length; i++)
|
||||
for (let i = 0; i < lists.length; i++)
|
||||
{
|
||||
if(lists[i].app == 'filemanager' && lists[i].widgetContainer.getWidgetById('path'))
|
||||
{
|
||||
@ -356,7 +355,7 @@ export class filemanagerAPP extends EgwApp
|
||||
*/
|
||||
_upload_callback(_data)
|
||||
{
|
||||
if(_data.msg || _data.uploaded) window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
if(_data.msg || _data.uploaded) window.egw_refresh(_data.msg, this.appname);
|
||||
|
||||
let that = this;
|
||||
for (let file in _data.uploaded)
|
||||
@ -364,7 +363,13 @@ export class filemanagerAPP extends EgwApp
|
||||
if(_data.uploaded[file].confirm && !_data.uploaded[file].confirmed)
|
||||
{
|
||||
let buttons = [
|
||||
{text: this.egw.lang("Yes"), id: "overwrite", class: "ui-priority-primary", "default": true, image: 'check'},
|
||||
{
|
||||
text: this.egw.lang("Yes"),
|
||||
id: "overwrite",
|
||||
class: "ui-priority-primary",
|
||||
"default": true,
|
||||
image: 'check'
|
||||
},
|
||||
{text: this.egw.lang("Rename"), id: "rename", image: 'edit'},
|
||||
{text: this.egw.lang("Cancel"), id: "cancel"}
|
||||
];
|
||||
@ -615,7 +620,7 @@ export class filemanagerAPP extends EgwApp
|
||||
*/
|
||||
_do_action_callback(_data)
|
||||
{
|
||||
window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
window.egw_refresh(_data.msg, this.appname);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -877,7 +882,7 @@ export class filemanagerAPP extends EgwApp
|
||||
});
|
||||
|
||||
// Last 10 folders
|
||||
let previous_dsts = jQuery.extend([], <any><unknown>egw.preference('drop_history', filemanagerAPP.appname));
|
||||
let previous_dsts = jQuery.extend([], <any><unknown>egw.preference('drop_history', this.appname));
|
||||
let action_index = 0;
|
||||
for (let i = 0; i < 10; i++)
|
||||
{
|
||||
@ -977,10 +982,10 @@ export class filemanagerAPP extends EgwApp
|
||||
}
|
||||
|
||||
// Remember the target for next time
|
||||
let previous_dsts = jQuery.extend([], egw.preference('drop_history', filemanagerAPP.appname));
|
||||
let previous_dsts = jQuery.extend([], egw.preference('drop_history', this.appname));
|
||||
previous_dsts.unshift(dst);
|
||||
previous_dsts = Array.from(new Set(previous_dsts)).slice(0, 9);
|
||||
egw.set_preference(filemanagerAPP.appname, 'drop_history', previous_dsts);
|
||||
egw.set_preference(this.appname, 'drop_history', previous_dsts);
|
||||
|
||||
// Actual action id will be something like file_drop_{move|copy|link}[_other_id],
|
||||
// but we need to send move, copy or link
|
||||
@ -1183,7 +1188,7 @@ export class filemanagerAPP extends EgwApp
|
||||
*/
|
||||
_share_link_callback(_data)
|
||||
{
|
||||
if(_data.msg || _data.share_link) window.egw_refresh(_data.msg, filemanagerAPP.appname);
|
||||
if(_data.msg || _data.share_link) window.egw_refresh(_data.msg, this.appname);
|
||||
console.log("_data", _data);
|
||||
let app = this;
|
||||
|
||||
|
@ -43,11 +43,8 @@ var InfologApp = /** @class */ (function (_super) {
|
||||
* @memberOf app.infolog
|
||||
*/
|
||||
function InfologApp() {
|
||||
var _this =
|
||||
// call parent
|
||||
_super.call(this) || this;
|
||||
_this.appname = 'infolog';
|
||||
return _this;
|
||||
return _super.call(this, 'infolog') || this;
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
|
@ -17,7 +17,7 @@ import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
|
||||
/**
|
||||
* UI for Infolog
|
||||
@ -26,7 +26,6 @@ import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
*/
|
||||
class InfologApp extends EgwApp
|
||||
{
|
||||
readonly appname = 'infolog';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -36,7 +35,7 @@ class InfologApp extends EgwApp
|
||||
constructor()
|
||||
{
|
||||
// call parent
|
||||
super();
|
||||
super('infolog');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,7 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
* Constructor
|
||||
*/
|
||||
function resourcesApp() {
|
||||
return _super.call(this) || this;
|
||||
return _super.call(this, 'resources') || this;
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
@ -137,7 +137,6 @@ var resourcesApp = /** @class */ (function (_super) {
|
||||
rBtn.set_value('own_src');
|
||||
}
|
||||
};
|
||||
resourcesApp.appname = 'resources';
|
||||
return resourcesApp;
|
||||
}(egw_app_1.EgwApp));
|
||||
app.classes.resources = resourcesApp;
|
||||
|
@ -16,14 +16,13 @@ import {EgwApp} from "../../api/js/jsapi/egw_app";
|
||||
*/
|
||||
class resourcesApp extends EgwApp
|
||||
{
|
||||
static readonly appname: string = 'resources';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
super('resources');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,9 +38,7 @@ var egw_app_1 = require("../../api/js/jsapi/egw_app");
|
||||
var TimesheetApp = /** @class */ (function (_super) {
|
||||
__extends(TimesheetApp, _super);
|
||||
function TimesheetApp() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.appname = 'timesheet';
|
||||
return _this;
|
||||
return _super.call(this, 'timesheet') || this;
|
||||
}
|
||||
/**
|
||||
* This function is called when the etemplate2 object is loaded
|
||||
|
@ -17,7 +17,7 @@ import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
|
||||
import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
|
||||
/**
|
||||
* UI for timesheet
|
||||
@ -26,7 +26,11 @@ import { EgwApp } from '../../api/js/jsapi/egw_app';
|
||||
*/
|
||||
class TimesheetApp extends EgwApp
|
||||
{
|
||||
readonly appname = 'timesheet';
|
||||
|
||||
constructor()
|
||||
{
|
||||
super('timesheet');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called when the etemplate2 object is loaded
|
||||
@ -36,7 +40,7 @@ class TimesheetApp extends EgwApp
|
||||
* @param et2 etemplate2 Newly ready object
|
||||
* @param string name
|
||||
*/
|
||||
et2_ready(et2, name : string)
|
||||
et2_ready(et2, name: string)
|
||||
{
|
||||
// call parent
|
||||
super.et2_ready(et2, name);
|
||||
|
Loading…
Reference in New Issue
Block a user