mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-07-20 15:59:46 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
23b64bef4a | |||
c15318f31b |
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "Blogger",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee", "dialogs.coffee", "tags.coffee"],
|
||||
"copies": [
|
||||
"scheme.html",
|
||||
"cvsection.html",
|
||||
"api/sendmail.lua",
|
||||
"sendmail.html",
|
||||
"package.json",
|
||||
"README.md"
|
||||
]
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
# DBDecoder
|
||||
This is an example project, generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
Use the CodePad command palette to access to the SDK functionalities:
|
||||
|
||||
1. Create new project
|
||||
2. Init the project from the current folder located in side bar
|
||||
3. Build and run the project
|
||||
4. Release the project in zip package
|
||||
|
||||
## Set up build target
|
||||
|
||||
Open the `project.json` file from the current project tree and add/remove
|
||||
build target entries. Save the file
|
@ -1,5 +0,0 @@
|
||||
<afx-app-window apptitle="DBDecoder" width="500" height="400" data-id="DBDecoder">
|
||||
<afx-hbox >
|
||||
<afx-button data-id="decoder" text="GO"></afx-button>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
@ -1,15 +0,0 @@
|
||||
# DBDecoder
|
||||
This is an example project, generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
Use the CodePad command palette to access to the SDK functionalities:
|
||||
|
||||
1. Create new project
|
||||
2. Init the project from the current folder located in side bar
|
||||
3. Build and run the project
|
||||
4. Release the project in zip package
|
||||
|
||||
## Set up build target
|
||||
|
||||
Open the `project.json` file from the current project tree and add/remove
|
||||
build target entries. Save the file
|
@ -1,54 +0,0 @@
|
||||
(function() {
|
||||
var DBDecoder;
|
||||
|
||||
DBDecoder = class DBDecoder extends this.OS.application.BaseApplication {
|
||||
constructor(args) {
|
||||
super("DBDecoder", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var bt;
|
||||
bt = this.find("decoder");
|
||||
this.db = new this._api.DB("blogs");
|
||||
return bt.onbtclick = (e) => {
|
||||
// decode the database
|
||||
return this.db.find("1=1").then((data) => {
|
||||
var i, len, v;
|
||||
for (i = 0, len = data.length; i < len; i++) {
|
||||
v = data[i];
|
||||
v.content = atob(v.content);
|
||||
v.rendered = atob(v.rendered);
|
||||
}
|
||||
return this.saveDB(data).then(() => {
|
||||
return this.notify("Data base saved");
|
||||
}).catch((e) => {
|
||||
return this.error(e.toString(), e);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
saveDB(list) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var record;
|
||||
if (list.length === 0) {
|
||||
return resolve();
|
||||
}
|
||||
record = list.shift();
|
||||
return this.db.save(record).then(() => {
|
||||
return this.saveDB(list).then(() => {
|
||||
return resolve();
|
||||
}).catch((e) => {
|
||||
return reject(__e(e));
|
||||
});
|
||||
}).catch((e) => {
|
||||
return reject(__e(e));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.OS.register("DBDecoder", DBDecoder);
|
||||
|
||||
}).call(this);
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"app":"DBDecoder",
|
||||
"name":"DBDecoder",
|
||||
"description":"DBDecoder",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"locale": {}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<afx-app-window apptitle="DBDecoder" width="500" height="400" data-id="DBDecoder">
|
||||
<afx-hbox >
|
||||
<afx-button data-id="decoder" text="GO"></afx-button>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
Binary file not shown.
@ -1,29 +0,0 @@
|
||||
class DBDecoder extends this.OS.application.BaseApplication
|
||||
constructor: ( args ) ->
|
||||
super "DBDecoder", args
|
||||
|
||||
main: () ->
|
||||
bt = @find "decoder"
|
||||
@db = new @_api.DB("blogs")
|
||||
bt.onbtclick = (e) =>
|
||||
# decode the database
|
||||
@db.find("1=1").then (data) =>
|
||||
for v in data
|
||||
v.content = atob(v.content)
|
||||
v.rendered = atob(v.rendered)
|
||||
@saveDB(data).then () =>
|
||||
@notify "Data base saved"
|
||||
.catch (e) => @error e.toString(), e
|
||||
|
||||
saveDB: (list) ->
|
||||
new Promise (resolve, reject) =>
|
||||
return resolve() if list.length is 0
|
||||
record = list.shift()
|
||||
@db.save(record).then () =>
|
||||
@saveDB(list)
|
||||
.then () => resolve()
|
||||
.catch (e) => reject __e e
|
||||
.catch (e) => reject __e e
|
||||
|
||||
|
||||
this.OS.register "DBDecoder", DBDecoder
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"app":"DBDecoder",
|
||||
"name":"DBDecoder",
|
||||
"description":"DBDecoder",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"locale": {}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "DBDecoder",
|
||||
"css": [],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
"copies": ["assets/scheme.html", "package.json", "README.md"]
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
afx-app-window[data-id = "Docify"] .header .label-text
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
div[data-id = "preview-container"]
|
||||
{
|
||||
overflow: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
canvas[data-id = "preview-canvas"]
|
||||
{
|
||||
display: block;
|
||||
margin:0 auto;
|
||||
}
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] i.label-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] input[type="radio"] {
|
||||
margin: 0;
|
||||
height: 12px;
|
||||
margin-left: 10px;
|
||||
}
|
@ -202,4 +202,4 @@ if args.action and handle[args.action] then
|
||||
return handle[args.action](args.args)
|
||||
else
|
||||
return error("Invalid action parameter")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user