self-closing xml should not be used in custom tag scheme

This commit is contained in:
lxsang 2021-03-15 13:18:12 +01:00
parent 9a12e9176f
commit d067fa4f21
24 changed files with 158 additions and 159 deletions

View File

@ -339,7 +339,7 @@ namespace OS {
return this.quit(); return this.quit();
}; };
$input.keyup((e) => { $input.on("keyup",(e) => {
if (e.which !== 13) { if (e.which !== 13) {
return; return;
} }
@ -349,7 +349,7 @@ namespace OS {
return this.quit(); return this.quit();
}); });
$input.focus(); $input.trigger("focus");
} }
} }
/** /**
@ -359,19 +359,19 @@ namespace OS {
<afx-app-window width='200' height='150' apptitle = "Prompt"> <afx-app-window width='200' height='150' apptitle = "Prompt">
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-label data-id = "lbl" /> <afx-label data-id = "lbl" ></afx-label>
<input type = "text" data-id= "txtInput" /> <input type = "text" data-id= "txtInput" ></input>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -438,18 +438,18 @@ namespace OS {
<afx-app-window data-id = "TextDialog" width='400' height='300'> <afx-app-window data-id = "TextDialog" width='400' height='300'>
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<textarea data-id= "txtInput" /> <textarea data-id= "txtInput" ></textarea>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -518,19 +518,19 @@ namespace OS {
<afx-app-window width='300' height='230' apptitle = "Calendar" > <afx-app-window width='300' height='230' apptitle = "Calendar" >
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-calendar-view data-id = "cal" /> <afx-calendar-view data-id = "cal" ></afx-calendar-view>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
<div data-height="10" /> <div data-height="10" ></div>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -597,19 +597,19 @@ namespace OS {
<afx-app-window width='320' height='250' apptitle = "Color picker" > <afx-app-window width='320' height='250' apptitle = "Color picker" >
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-color-picker data-id = "cpicker" /> <afx-color-picker data-id = "cpicker" ></afx-color-picker>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
<div data-height="10" /> <div data-height="10" ></div>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -677,18 +677,18 @@ namespace OS {
<afx-app-window width='250' height='300' apptitle = "Info" > <afx-app-window width='250' height='300' apptitle = "Info" >
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-grid-view data-id = "grid" /> <afx-grid-view data-id = "grid" ></afx-grid-view>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
<div data-height="10" /> <div data-height="10" ></div>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -758,18 +758,18 @@ namespace OS {
<afx-app-window width='200' height='150' apptitle = "Prompt"> <afx-app-window width='200' height='150' apptitle = "Prompt">
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-label data-id = "lbl" /> <afx-label data-id = "lbl" ></afx-label>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnYes" text = "__(Yes)" data-width = "40" /> <afx-button data-id = "btnYes" text = "__(Yes)" data-width = "40" ></afx-button>
<afx-button data-id = "btnNo" text = "__(No)" data-width = "40" /> <afx-button data-id = "btnNo" text = "__(No)" data-width = "40" ></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -844,18 +844,18 @@ namespace OS {
<afx-app-window width='250' height='300' apptitle = "Selection"> <afx-app-window width='250' height='300' apptitle = "Selection">
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-list-view data-id = "list" /> <afx-list-view data-id = "list" ></afx-list-view>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
@ -938,10 +938,10 @@ namespace OS {
</afx-hbox> </afx-hbox>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "60" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "60" ></afx-button>
</afx-hbox> </afx-hbox>
<div data-height = "10"/> <div data-height = "10"></div>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\
`; `;
@ -1146,7 +1146,7 @@ namespace OS {
<afx-list-view data-id = "location" dropdown = "false" data-width = "120"></afx-list-view> <afx-list-view data-id = "location" dropdown = "false" data-width = "120"></afx-list-view>
<afx-vbox> <afx-vbox>
<afx-file-view data-id = "fileview" view="tree" status = "false"></afx-file-view> <afx-file-view data-id = "fileview" view="tree" status = "false"></afx-file-view>
<input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" /> <input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" ></input>
<afx-hbox data-height = '30'> <afx-hbox data-height = '30'>
<div style=' text-align:right;'> <div style=' text-align:right;'>
<afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button> <afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button>
@ -1243,9 +1243,9 @@ namespace OS {
const model = this.data.model; const model = this.data.model;
for (const key in model) { for (const key in model) {
html += `\ html += `\
<afx-label data-height="25" text="{0}" /> <afx-label data-height="25" text="{0}" ></afx-label>
<input data-height="25" type="text" name="{1}" /> <input data-height="25" type="text" name="{1}" ></input>
<div data-height="10" /> <div data-height="10" ></div>
`.format(model[key], key); `.format(model[key], key);
height += 60; height += 60;
} }
@ -1291,18 +1291,18 @@ namespace OS {
MultiInputDialog.scheme = `\ MultiInputDialog.scheme = `\
<afx-app-window width='350' height='{0}'> <afx-app-window width='350' height='{0}'>
<afx-hbox> <afx-hbox>
<div data-width="10" /> <div data-width="10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="5" /> <div data-height="5" ></div>
{1} {1}
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
<div data-height="5" /> <div data-height="5" ></div>
</afx-vbox> </afx-vbox>
<div data-width="10" /> <div data-width="10" ></div>
</afx-hbox> </afx-hbox>
</afx-app-window>`; </afx-app-window>`;
} }

View File

@ -1211,7 +1211,7 @@ namespace OS {
const o = $("<input>") const o = $("<input>")
.attr("type", "file") .attr("type", "file")
.css("display", "none"); .css("display", "none");
o.change(function() { o.on("change",function() {
API.loading(q, p); API.loading(q, p);
const formd = new FormData(); const formd = new FormData();
formd.append("path", d); formd.append("path", d);
@ -1236,7 +1236,7 @@ namespace OS {
return o.remove(); return o.remove();
}); });
}); });
return o.click(); return o.trigger("click");
}); });
} }

View File

@ -120,7 +120,6 @@ namespace OS {
parent: Element | string parent: Element | string
): void { ): void {
const scheme = $.parseHTML(html); const scheme = $.parseHTML(html);
if (app.scheme) { if (app.scheme) {
$(app.scheme).remove(); $(app.scheme).remove();
} }
@ -945,9 +944,9 @@ namespace OS {
$("#systooltip")[0].uify(undefined); $("#systooltip")[0].uify(undefined);
$("#contextmenu")[0].uify(undefined); $("#contextmenu")[0].uify(undefined);
$("#workspace").contextmenu((e) => bindContextMenu(e)); $("#workspace").on("contextmenu",(e) => bindContextMenu(e));
// tooltip // tooltip
$(document).mouseover(function (e) { $(document).on("mouseover", function (e) {
const el: any = $(e.target).closest("[tooltip]"); const el: any = $(e.target).closest("[tooltip]");
if (!(el.length > 0)) { if (!(el.length > 0)) {
return; return;
@ -1088,7 +1087,7 @@ namespace OS {
export function login(): void { export function login(): void {
const scheme = $.parseHTML(schemes.login); const scheme = $.parseHTML(schemes.login);
$("#wrapper").append(scheme); $("#wrapper").append(scheme);
$("#btlogin").click(async function () { $("#btlogin").on("click", async function () {
const data: API.UserLoginType = { const data: API.UserLoginType = {
username: $("#txtuser").val() as string, username: $("#txtuser").val() as string,
password: $("#txtpass").val() as string, password: $("#txtpass").val() as string,
@ -1103,14 +1102,14 @@ namespace OS {
return $("#login_error").html("Login: server error"); return $("#login_error").html("Login: server error");
} }
}); });
$("#txtpass").keyup(function (e) { $("#txtpass").on("keyup", function (e) {
if (e.which === 13) { if (e.which === 13) {
return $("#btlogin").click(); return $("#btlogin").trigger("click");
} }
}); });
$("#txtuser").keyup(function (e) { $("#txtuser").keyup(function (e) {
if (e.which === 13) { if (e.which === 13) {
return $("#btlogin").click(); return $("#btlogin").trigger("click");
} }
}); });
} }
@ -1223,8 +1222,8 @@ namespace OS {
schemes.login = `\ schemes.login = `\
<div id = "login_form"> <div id = "login_form">
<p>Welcome to AntOS, please login</p> <p>Welcome to AntOS, please login</p>
<input id = "txtuser" type = "text" value = "demo" /> <input id = "txtuser" type = "text" value = "demo" ></input>
<input id = "txtpass" type = "password" value = "demo" /> <input id = "txtpass" type = "password" value = "demo" ></input>
<button id = "btlogin">Login</button> <button id = "btlogin">Login</button>
<div id = "login_error"></div> <div id = "login_error"></div>
</div>\ </div>\

View File

@ -133,7 +133,7 @@ namespace OS {
* @memberof ButtonTag * @memberof ButtonTag
*/ */
protected mount() { protected mount() {
$(this.refs.button).click((e) => { $(this.refs.button).on("click", (e) => {
if (this.toggle) { if (this.toggle) {
this.selected = !this.selected; this.selected = !this.selected;
} }

View File

@ -113,8 +113,8 @@ namespace OS {
* @memberof CalendarTag * @memberof CalendarTag
*/ */
protected mount(): void { protected mount(): void {
$(this.refs.prev).click((e) => this.prevmonth()); $(this.refs.prev).on("click",(e) => this.prevmonth());
$(this.refs.next).click((e) => this.nextmonth()); $(this.refs.next).on("click",(e) => this.nextmonth());
const grid = this.refs.grid as GridViewTag; const grid = this.refs.grid as GridViewTag;
grid.header = [ grid.header = [
{ text: "__(Sun)" }, { text: "__(Sun)" },

View File

@ -259,15 +259,15 @@ namespace OS {
); );
}; };
$(this.refs.palette).mouseenter((e) => { $(this.refs.palette).on("mouseenter",(e) => {
return $(this.refs.palette).on( return $(this.refs.palette).on(
"mousemove", "mousemove",
mouse_move_h mouse_move_h
); );
}); });
$(this.refs.palette).mouseout((e) => { $(this.refs.palette).on("mouseout", (e) => {
$(this.refs.palette).unbind("mousemove", mouse_move_h); $(this.refs.palette).off("mousemove", mouse_move_h);
if (this.selectedColor) { if (this.selectedColor) {
return $(this.refs.colorval).css( return $(this.refs.colorval).css(
"background-color", "background-color",

View File

@ -184,8 +184,8 @@ namespace OS {
}; };
var mouse_up = function (e: JQuery.MouseEventBase) { var mouse_up = function (e: JQuery.MouseEventBase) {
$(window).unbind("mousemove", mouse_move); $(window).off("mousemove", mouse_move);
return $(window).unbind("mouseup", mouse_up); return $(window).off("mouseup", mouse_up);
}; };
$(window).on("mousemove", mouse_move); $(window).on("mousemove", mouse_move);
return $(window).on("mouseup", mouse_up); return $(window).on("mouseup", mouse_up);

View File

@ -237,11 +237,11 @@ namespace OS {
): void => {}; ): void => {};
this.selected = false; this.selected = false;
$(this).css("display", "block"); $(this).css("display", "block");
$(this).click((e) => { $(this).on("click",(e) => {
let evt = { id: this.aid, data: this }; let evt = { id: this.aid, data: this };
return this.cellselect(evt, false); return this.cellselect(evt, false);
}); });
$(this).dblclick((e) => { $(this).on("dblclick", (e) => {
let evt = { id: this.aid, data: this }; let evt = { id: this.aid, data: this };
return this.cellselect(evt, true); return this.cellselect(evt, true);
}); });

View File

@ -173,18 +173,18 @@ namespace OS {
*/ */
protected mount(): void { protected mount(): void {
$(this.refs.item).attr("dataref", "afx-list-item"); $(this.refs.item).attr("dataref", "afx-list-item");
$(this.refs.item).contextmenu((e) => { $(this.refs.item).on("contextmenu", (e) => {
this._onctxmenu({ id: this.aid, data: this }); this._onctxmenu({ id: this.aid, data: this });
}); });
$(this.refs.item).click((e) => { $(this.refs.item).on("click",(e) => {
this._onclick({ id: this.aid, data: this }); this._onclick({ id: this.aid, data: this });
}); });
$(this.refs.item).dblclick((e) => { $(this.refs.item).on("dblclick",(e) => {
this._ondbclick({ id: this.aid, data: this }); this._ondbclick({ id: this.aid, data: this });
}); });
$(this.refs.btcl).click((e) => { $(this.refs.btcl).on("click",(e) => {
this._onclose({ id: this.aid, data: this }); this._onclose({ id: this.aid, data: this });
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@ -788,7 +788,7 @@ namespace OS {
* @returns {ListViewItemTag} the added list item element * @returns {ListViewItemTag} the added list item element
* @memberof ListViewTag * @memberof ListViewTag
*/ */
unshift(item: GenericObject<any>) { unshift(item: GenericObject<any>): ListViewItemTag {
return this.push(item, true); return this.push(item, true);
} }

View File

@ -191,7 +191,7 @@ namespace OS {
// ensure that the data is in sync // ensure that the data is in sync
this._data.nodes = v; this._data.nodes = v;
if (this.is_root()) { if (this.is_root()) {
$(this.refs.container).mouseleave((e) => { $(this.refs.container).on("mouseleave",(e) => {
return $(this.refs.submenu).attr("style", ""); return $(this.refs.submenu).attr("style", "");
}); });
} }
@ -209,7 +209,7 @@ namespace OS {
* @memberof MenuEntryTag * @memberof MenuEntryTag
*/ */
protected mount(): void { protected mount(): void {
$(this.refs.entry).click((e) => this.select(e)); $(this.refs.entry).on("click",(e) => this.select(e));
} }
/** /**
@ -730,7 +730,7 @@ namespace OS {
if (!this.context) { if (!this.context) {
return; return;
} }
$(this.refs.wrapper).mouseleave((e) => { $(this.refs.wrapper).on("mouseleave",(e) => {
if (!this.is_root()) { if (!this.is_root()) {
return; return;
} }

View File

@ -81,11 +81,11 @@ namespace OS {
*/ */
protected mount(): void { protected mount(): void {
$(this.refs.holder).attr("type", "text"); $(this.refs.holder).attr("type", "text");
$(this.refs.incr).click((e) => { $(this.refs.incr).on("click",(e) => {
this.value = this.value + this.step; this.value = this.value + this.step;
}); });
$(this.refs.decr).click((e) => { $(this.refs.decr).on("click",(e) => {
this.value = this.value - this.step; this.value = this.value - this.step;
}); });
@ -93,7 +93,7 @@ namespace OS {
this.observable.on("resize", () => this.calibrate()); this.observable.on("resize", () => this.calibrate());
$(this.refs.holder).on("keyup", (e) => { $(this.refs.holder).on("keyup", (e) => {
if (e.keyCode === 13) { if (e.which === 13) {
let val = parseInt( let val = parseInt(
(this.refs.holder as HTMLInputElement).value (this.refs.holder as HTMLInputElement).value
); );

View File

@ -104,7 +104,7 @@ namespace OS {
set dir(v: string) { set dir(v: string) {
let att: string; let att: string;
$(this).attr("dir", v); $(this).attr("dir", v);
$(this).unbind("mousedown", null); $(this).off("mousedown", null);
if (v === "hz") { if (v === "hz") {
$(this).css("cursor", "col-resize"); $(this).css("cursor", "col-resize");
$(this).addClass("horizontal"); $(this).addClass("horizontal");
@ -222,10 +222,10 @@ namespace OS {
}); });
return $(window).on("mouseup", function (evt) { return $(window).on("mouseup", function (evt) {
$(window).unbind("mousemove", null); $(window).off("mousemove", null);
$(window).unbind("mouseup", null); $(window).off("mouseup", null);
return $(window).unbind("mouseup", null); return $(window).off("mouseup", null);
}); });
}); });
} }

View File

@ -110,15 +110,15 @@ namespace OS {
this.attsw(v, "enable"); this.attsw(v, "enable");
if (v) { if (v) {
$(this) $(this)
.mouseover(() => { .on("mouseover",() => {
return $(this.refs.point).show(); return $(this.refs.point).show();
}) })
.mouseout(() => { .on("mouseout",() => {
return $(this.refs.point).hide(); return $(this.refs.point).hide();
}); });
} else { } else {
$(this.refs.point).hide(); $(this.refs.point).hide();
$(this).unbind("mouseover").unbind("mouseout"); $(this).off("mouseover").off("mouseout");
} }
} }
get enable(): boolean { get enable(): boolean {
@ -168,7 +168,7 @@ namespace OS {
this.observable.on("resize", (e) => { this.observable.on("resize", (e) => {
return this.calibrate(); return this.calibrate();
}); });
$(this.refs.container).click((e) => { $(this.refs.container).on("click",(e) => {
const offset = $(this.refs.container).offset(); const offset = $(this.refs.container).offset();
const left = e.clientX - offset.left; const left = e.clientX - offset.left;
const maxw = $(this.refs.container).width(); const maxw = $(this.refs.container).width();
@ -241,8 +241,8 @@ namespace OS {
id: this.aid, id: this.aid,
data: this.value, data: this.value,
}); });
$(window).unbind("mousemove", null); $(window).off("mousemove", null);
return $(window).unbind("mouseup", null); return $(window).off("mouseup", null);
}); });
}); });
} }

View File

@ -66,7 +66,7 @@ namespace OS {
* @memberof SwitchTag * @memberof SwitchTag
*/ */
protected mount(): void { protected mount(): void {
$(this.refs.switch).click((e) => { $(this.refs.switch).on("click",(e) => {
return this.makechange(e); return this.makechange(e);
}); });
} }

View File

@ -292,10 +292,10 @@ namespace OS {
this.calibrate(); this.calibrate();
$(document).on("click", this._cb); $(document).on("click", this._cb);
(this.refs.search as HTMLInputElement).value = ""; (this.refs.search as HTMLInputElement).value = "";
$(this.refs.search).focus(); $(this.refs.search).trigger("focus");
} else { } else {
$(this.refs.overlay).hide(); $(this.refs.overlay).hide();
$(document).unbind("click", this._cb); $(document).off("click", this._cb);
} }
} }
@ -325,7 +325,7 @@ namespace OS {
) { ) {
return this.toggle(false); return this.toggle(false);
} else { } else {
return $(this.refs.search).focus(); return $(this.refs.search).trigger("focus");
} }
}; };
$(this.refs.appmenu).css("z-index", 1000000); $(this.refs.appmenu).css("z-index", 1000000);
@ -358,11 +358,11 @@ namespace OS {
return this.toggle(true); return this.toggle(true);
}; };
$(this.refs.search).keyup((e) => { $(this.refs.search).on("keyup",(e) => {
return this.search(e); return this.search(e);
}); });
$(this.refs.applist).click((e) => { $(this.refs.applist).on("click",(e) => {
return this.open(); return this.open();
}); });
Ant.OS.GUI.bindKey("CTRL- ", (e) => { Ant.OS.GUI.bindKey("CTRL- ", (e) => {

View File

@ -377,10 +377,10 @@ namespace OS {
.css("margin", 0) .css("margin", 0)
.css("white-space", "nowrap"); .css("white-space", "nowrap");
$(this.refs.itemholder).css("display", "inline-block"); $(this.refs.itemholder).css("display", "inline-block");
$(this.refs.wrapper).click((e) => { $(this.refs.wrapper).on("click",(e) => {
this.selected = true; this.selected = true;
}); });
$(this.refs.wrapper).dblclick((e) => { $(this.refs.wrapper).on("dblclick", (e) => {
this._evt.data.dblclick = true; this._evt.data.dblclick = true;
this.selected = true; this.selected = true;
}); });
@ -389,7 +389,7 @@ namespace OS {
.css("display", "inline-block") .css("display", "inline-block")
.css("width", "15px") .css("width", "15px")
.addClass("afx-tree-view-item") .addClass("afx-tree-view-item")
.click((e) => { .on("click",(e) => {
this.open = !this.open; this.open = !this.open;
e.preventDefault(); e.preventDefault();
return e.stopPropagation(); return e.stopPropagation();

View File

@ -241,17 +241,17 @@ namespace OS {
*/ */
protected mount(): void { protected mount(): void {
this.contextmenuHandle = function (e) {}; this.contextmenuHandle = function (e) {};
$(this.refs["minbt"]).click((e) => { $(this.refs["minbt"]).on("click",(e) => {
return this.observable.trigger("hide", { return this.observable.trigger("hide", {
id: this.aid, id: this.aid,
}); });
}); });
$(this.refs["maxbt"]).click((e) => { $(this.refs["maxbt"]).on("click",(e) => {
return this.toggle_window(); return this.toggle_window();
}); });
$(this.refs["closebt"]).click((e) => { $(this.refs["closebt"]).on("click",(e) => {
return this.observable.trigger("exit", { return this.observable.trigger("exit", {
id: this.aid, id: this.aid,
}); });
@ -272,7 +272,7 @@ namespace OS {
}); });
}); });
$(this.refs["dragger"]).dblclick((e) => { $(this.refs["dragger"]).on("dblclick",(e) => {
return this.toggle_window(); return this.toggle_window();
}); });
@ -381,8 +381,8 @@ namespace OS {
.css("left", `${left}px`); .css("left", `${left}px`);
}); });
return $(window).on("mouseup", function (e) { return $(window).on("mouseup", function (e) {
$(window).unbind("mousemove", null); $(window).off("mousemove", null);
return $(window).unbind("mouseup", null); return $(window).off("mouseup", null);
}); });
}); });
} }
@ -420,8 +420,8 @@ namespace OS {
}); });
$(window).on("mouseup", function (e) { $(window).on("mouseup", function (e) {
$(window).unbind("mousemove", null); $(window).off("mousemove", null);
return $(window).unbind("mouseup", null); return $(window).off("mouseup", null);
}); });
}); });
} }

View File

@ -25,10 +25,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="resources/themes/system/system.css" rel="stylesheet"> <link href="resources/themes/system/system.css" rel="stylesheet">
<link id="ostheme" rel="stylesheet" href=""> <link id="ostheme" rel="stylesheet" href="">
<script src="scripts/jquery-3.2.1.min.js"></script> <script src="scripts/jquery-3.4.1.min.js"></script>
<script src="scripts/antos.js"></script> <script src="scripts/antos.js"></script>
</head> </head>
<body> <body>
<div id="wrapper" /> <div id="wrapper" ></div>
</body> </body>
</html> </html>

2
src/libs/jquery-3.4.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1557,7 +1557,7 @@ namespace OS {
apptitle="" minimizable="false" apptitle="" minimizable="false"
resizable = "false" width="200" height="200"> resizable = "false" width="200" height="200">
<afx-vbox> <afx-vbox>
<input data-height="25" type = "text" data-id="searchbox"/> <input data-height="25" type = "text" data-id="searchbox"></input>
<afx-list-view data-id="container"></afx-list-view> <afx-list-view data-id="container"></afx-list-view>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\

View File

@ -3,7 +3,7 @@
<afx-vbox data-width = "200" data-id = "sidebar" min-width="150"> <afx-vbox data-width = "200" data-id = "sidebar" min-width="150">
<afx-hbox data-height= "23" data-id="search-container"> <afx-hbox data-height= "23" data-id="search-container">
<div data-width="17" data-id="searchicon"></div> <div data-width="17" data-id="searchicon"></div>
<input data-id = "searchbox" /> <input data-id = "searchbox" ></afx-hbox></input>
</afx-hbox> </afx-hbox>
<afx-list-view data-id = "applist" dropdown = "false" width = "150"></afx-list-view> <afx-list-view data-id = "applist" dropdown = "false" width = "150"></afx-list-view>
</afx-vbox> </afx-vbox>

View File

@ -99,22 +99,22 @@ namespace OS {
<afx-app-window width='250' height='180' apptitle = "__(Mount Points)"> <afx-app-window width='250' height='180' apptitle = "__(Mount Points)">
<afx-vbox> <afx-vbox>
<afx-hbox> <afx-hbox>
<div data-width = "10" /> <div data-width = "10" ></div>
<afx-vbox> <afx-vbox>
<div data-height="10" /> <div data-height="10" ></div>
<afx-label data-height="30" text = "__(Name)" /> <afx-label data-height="30" text = "__(Name)" ></afx-label>
<input type = "text" data-id= "txtName" /> <input type = "text" data-id= "txtName" ></input>
<div data-height="3" /> <div data-height="3" ></div>
<afx-label data-height="30" text = "__(Path)" /> <afx-label data-height="30" text = "__(Path)" ></afx-label>
<input type = "text" data-id= "txtPath" /> <input type = "text" data-id= "txtPath" ></input>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox data-height="30"> <afx-hbox data-height="30">
<div /> <div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" /> <afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" /> <afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
<div data-width = "10" /> <div data-width = "10" ></div>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window>\ </afx-app-window>\

View File

@ -1,21 +1,21 @@
<afx-app-window data-id="Syslog" width='500' height='350' apptitle = "__(System error log)" > <afx-app-window data-id="Syslog" width='500' height='350' apptitle = "__(System error log)" >
<afx-hbox> <afx-hbox>
<afx-list-view data-id = "loglist" data-width="200"> </afx-list-view> <afx-list-view data-id = "loglist" data-width="200"> </afx-list-view>
<afx-resizer data-width = "2" /> <afx-resizer data-width = "2" ></afx-resizer>
<afx-vbox> <afx-vbox>
<div data-id = "container"> <div data-id = "container">
<pre><code data-id="logdetail"></code></pre> <pre><code data-id="logdetail"></code></pre>
</div> </div>
<div data-height="10" /> <div data-height="10" ></div>
<afx-hbox style="text-align:right;" data-height = "27"> <afx-hbox style="text-align:right;" data-height = "27">
<afx-button data-width ="20" <afx-button data-width ="20"
tooltip = "ct:__(Clear all logs)" iconclass = "fa fa-trash-o" data-id = "btclean" /> tooltip = "ct:__(Clear all logs)" iconclass = "fa fa-trash-o" data-id = "btclean" ></afx-button>
<input type = "text" data-id = "txturi" /> <input type = "text" data-id = "txturi" ></input>
<afx-button data-width ="80" text = "__(Report)" <afx-button data-width ="80" text = "__(Report)"
iconclass = "fa fa-bug" data-id = "btnreport" /> iconclass = "fa fa-bug" data-id = "btnreport" ></afx-button>
<div data-width="10" /> <div data-width="10" ></div>
</afx-hbox> </afx-hbox>
<div data-height="10" /> <div data-height="10" ></div>
</afx-vbox> </afx-vbox>
</afx-hbox> </afx-hbox>
</afx-app-window> </afx-app-window>