Bug fix + improvement:

- About dialog now can display package README file
- Fix: double click handling on grid view
- add README to packages
- support source map in release version
This commit is contained in:
DanyLE 2022-07-19 20:57:12 +02:00
parent 6cbb463f6f
commit 2fd4bb5c96
19 changed files with 88 additions and 27 deletions

View File

@ -185,7 +185,12 @@ pkgar:
uglify:
# sudo npm install $(UGLIFYJS) -g
#
$(UGLIFYJS) $(BUILDDIR)/scripts/antos.js --compress --mangle --output $(BUILDDIR)/scripts/antos.js
mv $(BUILDDIR)/scripts/antos.js $(BUILDDIR)/scripts/antos_src.js
cp $(BUILDDIR)/scripts/antos_src.js ./
$(UGLIFYJS) antos_src.js --compress --mangle --output antos.js --source-map "url='antos.js.map'"
mv antos.js* $(BUILDDIR)/scripts/
rm antos_src.js
# uglify tags
# npm install $(UGLIFYCSS) -g
# uglify the css
@ -196,7 +201,9 @@ uglify:
for d in $(packages); do\
echo "Uglifying $$d";\
test -f $(BUILDDIR)/packages/$$d/main.js && $(UGLIFYJS) $(BUILDDIR)/packages/$$d/main.js --compress --mangle --output $(BUILDDIR)/packages/$$d/main.js;\
test -f $(BUILDDIR)/packages/$$d/main.js && \
$(UGLIFYJS) $(BUILDDIR)/packages/$$d/main.js \
--compress --mangle --output $(BUILDDIR)/packages/$$d/main.js;\
test -f $(BUILDDIR)/packages/$$d/main.css && $(UGLIFYCSS) --output $(BUILDDIR)/packages/$$d/main.css $(BUILDDIR)/packages/$$d/main.css;\
done

Binary file not shown.

View File

@ -17,6 +17,7 @@
//along with this program. If not, see https://www.gnu.org/licenses/.
namespace OS {
export namespace GUI {
declare var showdown: any;
/**
* the SubWindow class is the abstract prototype of all
* modal windows or dialogs definition in AntOS
@ -957,14 +958,25 @@ namespace OS {
if (!mt.info) {
return;
}
const rows = [];
for (let k in mt.info) {
const v = mt.info[k];
rows.push([{ text: k }, { text: v }]);
}
const rows = [
[{ text: __("Author") }, { text: mt.info.author }],
[{ text: __("Email") }, { text: mt.info.email }]
];
const grid = this.find("mygrid") as tag.GridViewTag;
grid.header = [{ text: "", width: 100 }, { text: "" }];
grid.rows = rows;
`pkg://${mt.pkgname?mt.pkgname:mt.app}/README.md`
.asFileHandle()
.read()
.then(async (data) => {
let _ = await API.requires("os://scripts/showdown.min.js");
const converter = new showdown.Converter();
const html = converter.makeHtml(data);
const el = this.find("read-me");
$(el).html(html);
$("img", el).css("width", "100%");
})
.catch(e => {});
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
_e
): void => {
@ -976,7 +988,7 @@ namespace OS {
* Scheme definition
*/
AboutDialog.scheme = `\
<afx-app-window data-id = 'about-window' width='300' height='200'>
<afx-app-window data-id = 'about-window' width='450' height='400'>
<afx-vbox>
<div style="text-align:center; margin-top:10px;" data-height="50">
<h3 style = "margin:0;padding:0;">
@ -984,11 +996,12 @@ namespace OS {
</h3>
<i><p style = "margin:0; padding:0" data-id = 'mydesc'></p></i>
</div>
<afx-hbox>
<afx-hbox data-height="60">
<div data-width="10"></div>
<afx-grid-view data-id = 'mygrid'></afx-grid-view>
</afx-hbox>
<div data-id="read-me" style="overflow-x: hidden; overflow-y: auto;"></div>
<div data-height="10"></div>
<afx-hbox data-height="30">
<div ></div>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "60" ></afx-button>

View File

@ -259,7 +259,7 @@ namespace OS {
};
Ant.__e = function (e: Error): Error {
const reason = new Error(e.toString());
const reason = new Error(e.toString().replace(/^Error: /g, ""));
reason.stack += "\nCaused By:\n" + e.stack;
return reason;
};

View File

@ -507,14 +507,16 @@ namespace OS {
if (v.filename[0] === "." && !this.showhidden) {
return;
}
if(!v.text)
v.text = v.filename;
v.iconclass = v.iconclass ? v.iconclass : v.type;
if(v.icon)
v.iconclass = undefined;
const row = [
v,
{
text: v.filename,
icon: v.icon,
iconclass: v.iconclass,
data: v
},
{
text: v.mtime,
data: v,
@ -720,7 +722,7 @@ namespace OS {
($(e.data.item).children()[0] as GridCellPrototype)
.data as API.FileInfoType
);
this._selectedFiles = e.data.items.map( x => ($(x).children()[0] as GridCellPrototype).data as API.FileInfoType);
this._selectedFiles = e.data.items.map( x => ($(x).children()[0] as GridCellPrototype).data.data as API.FileInfoType);
};
tree.ontreeselect = (e) => {
this.fileselect(e.data.item.data as API.FileInfoType);
@ -731,7 +733,7 @@ namespace OS {
this.filedbclick(e.data.item.data as API.FileInfoType);
};
grid.oncelldbclick = (e) => {
this.filedbclick(e.data.item.data as API.FileInfoType);
this.filedbclick(e.data.item.data.data as API.FileInfoType);
};
tree.ontreedbclick = (e) => {
this.filedbclick(e.data.item.data as API.FileInfoType);

View File

@ -4,7 +4,7 @@ libfiles =
cssfiles = main.css
copyfiles = scheme.html package.json
copyfiles = scheme.html package.json README.md
PKG_NAME=Files

View File

@ -0,0 +1,9 @@
# Files
Base AntOS file explorer application.
This application is included in the AntOS delivery as system application and
cannot be removed/uinstalled by regular user
## Change logs
- v0.1.7-b: fix - file grid view double click event hanling on diffent cells of a row

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.6-b",
"version":"0.1.7-b",
"category":"System",
"iconclass":"fa fa-hdd-o",
"mimes":["dir"],

View File

@ -4,7 +4,7 @@ libfiles =
cssfiles = main.css
copyfiles = scheme.html package.json
copyfiles = scheme.html package.json README.md
PKG_NAME=MarketPlace

View File

@ -0,0 +1,8 @@
# Market Place
AntOS original application store.
This application is icluded in the AntOS delivery
and cannot be removed/uinstalled by regular user
## Change logs
- v0.2.5-b: add README.md

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.2.4-a",
"version":"0.2.5-a",
"category":"System",
"iconclass":"fa fa-shopping-bag",
"mimes":["none"],

View File

@ -4,3 +4,6 @@ Defaut text editor which is included in each AntOS release.
It has very barebone features: open/edit/save text file.
Text/Code editor with fancy features can be optionally installed via the Market Place
## Change logs
-v0.1.1-b: update README

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE",
"email": "mrsang@iohub.dev"
},
"version": "0.1.0-b",
"version": "0.1.1-b",
"category": "Utility",
"iconclass": "bi bi-pen",
"mimes": [

View File

@ -4,7 +4,7 @@ libfiles =
cssfiles = main.css
copyfiles = scheme.html package.json
copyfiles = scheme.html package.json README.md
PKG_NAME=Setting

View File

@ -0,0 +1,13 @@
# Setting: AntOS system setting and configuration
GUI based system setting application for AntOS.
In-depth system settings can be found and modified in .settings.json file stored in HOME directory
of current user.
CAUTION:without using the Setting application, users can modify .settings.json with their own risk.
In case of system anormaly after the modification, the system settings can be reset to default
by simply removing the setting file
## Change logs
-v0.1.2-b: add README

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.1-a",
"version":"0.1.2-b",
"category":"System",
"iconclass":"fa fa-wrench",
"mimes":["none"]

View File

@ -4,7 +4,7 @@ libfiles =
cssfiles = main.css
copyfiles = package.json scheme.html
copyfiles = package.json scheme.html README.md
PKG_NAME=Syslog

View File

@ -0,0 +1,6 @@
# Syslog: System notification management and service
Provide system wise notification service (Push Notification)
## Change logs
-v0.1.2-b: add README

View File

@ -13,7 +13,7 @@
"credit": "dedicated to some one here",
"licences": "GPLv3"
},
"version": "0.1.1-a",
"version": "0.1.2-b",
"category": "System",
"iconclass": "fa fa-bug",
"mimes": []