diff --git a/api/js/etemplate/et2_widget_countdown.js b/api/js/etemplate/et2_widget_countdown.js index d451073b2f..5b9c1498f8 100644 --- a/api/js/etemplate/et2_widget_countdown.js +++ b/api/js/etemplate/et2_widget_countdown.js @@ -22,6 +22,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +exports.et2_countdown = void 0; /*egw:uses /vendor/bower-asset/jquery/dist/jquery.js; et2_core_baseWidget; @@ -29,9 +30,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); require("./et2_core_common"); var et2_core_inheritance_1 = require("./et2_core_inheritance"); var et2_core_widget_1 = require("./et2_core_widget"); -var et2_core_baseWidget_1 = require("./et2_core_baseWidget"); +var et2_core_valueWidget_1 = require("./et2_core_valueWidget"); /** * Class which implements the "countdown" XET-Tag + * + * Value for countdown is the expiry date of the counter. */ var et2_countdown = /** @class */ (function (_super) { __extends(et2_countdown, _super); @@ -64,7 +67,7 @@ var et2_countdown = /** @class */ (function (_super) { _this.setDOMNode(_this.container[0]); return _this; } - et2_countdown.prototype.set_time = function (_time) { + et2_countdown.prototype.set_value = function (_time) { if (_time == "") return; this.time.set_value(_time); @@ -116,12 +119,6 @@ var et2_countdown = /** @class */ (function (_super) { return this.options.format == 's' ? egw.lang(_v).substr(0, 1) : egw.lang(_v); }; et2_countdown._attributes = { - time: { - name: "time", - type: "any", - default: "", - description: "" - }, format: { name: "display format", type: "string", @@ -154,7 +151,7 @@ var et2_countdown = /** @class */ (function (_super) { } }; return et2_countdown; -}(et2_core_baseWidget_1.et2_baseWidget)); +}(et2_core_valueWidget_1.et2_valueWidget)); exports.et2_countdown = et2_countdown; et2_core_widget_1.et2_register_widget(et2_countdown, ["countdown"]); //# sourceMappingURL=et2_widget_countdown.js.map \ No newline at end of file diff --git a/api/js/etemplate/et2_widget_countdown.ts b/api/js/etemplate/et2_widget_countdown.ts index 34c74f35b3..c04b9595b6 100644 --- a/api/js/etemplate/et2_widget_countdown.ts +++ b/api/js/etemplate/et2_widget_countdown.ts @@ -18,18 +18,15 @@ import {ClassWithAttributes} from "./et2_core_inheritance"; import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_widget"; import {et2_date} from "./et2_widget_date"; import {et2_baseWidget} from "./et2_core_baseWidget"; +import {et2_valueWidget} from "./et2_core_valueWidget"; /** * Class which implements the "countdown" XET-Tag + * + * Value for countdown is the expiry date of the counter. */ -export class et2_countdown extends et2_baseWidget { +export class et2_countdown extends et2_valueWidget { static readonly _attributes: any = { - time: { - name: "time", - type: "any", - default: "", - description: "" - }, format: { name: "display format", type: "string", @@ -95,7 +92,7 @@ export class et2_countdown extends et2_baseWidget { this.setDOMNode(this.container[0]); } - public set_time(_time) + public set_value(_time) { if (_time == "") return; this.time.set_value(_time); @@ -107,7 +104,6 @@ export class et2_countdown extends et2_baseWidget { if (typeof self.onFinish == "function") self.onFinish(); } }, 1000); - } private _updateTimer() diff --git a/api/src/Etemplate/Widget/Date.php b/api/src/Etemplate/Widget/Date.php index f6895765f6..0bca6e1a28 100644 --- a/api/src/Etemplate/Widget/Date.php +++ b/api/src/Etemplate/Widget/Date.php @@ -256,4 +256,4 @@ class Date extends Transformer } } } -\EGroupware\Api\Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Date', array('time_or_date')); \ No newline at end of file +\EGroupware\Api\Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Date', array('time_or_date', 'countdown')); \ No newline at end of file