- Enable Edit Event into dialog form ... (and save to the db)

- Event: enabled drag and drop (date)
- Q-Select components in every table field external: Where, Operators, etc...
- CMyEditor: Add HTML Editor to the details field !
- Added button Color for change font color to the text.
- Complete insert Events Site
This commit is contained in:
Paolo Arena
2019-10-23 23:47:21 +02:00
parent 570bbf3744
commit 51ca2da45f
8 changed files with 386 additions and 49 deletions

45
plugins/file.js Normal file
View File

@@ -0,0 +1,45 @@
var fs = require('fs');
var FILE = function() {};
FILE.prototype.save = function(base64, file_url, callback) {
var base64Data = base64.split(',')[1];
return fs.writeFile(
file_url,
base64Data,
{
flags: 'wx',
encoding: 'base64'
},
function(err) {
if (err) {
console.error('writeFile', err);
throw err;
}
callback();
}
);
};
FILE.prototype.get = function(path, isVideo) {
var bitmap = fs.readFileSync(path);
if (!isVideo) {
try {
return new Buffer(bitmap).toString('base64');
} catch (e) {
throw e;
}
} else {
var binary = '';
var bytes = new Uint8Array(bitmap);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return new Buffer(binary).toString('base64');
}
};
module.exports = new FILE();