-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mehmet Baker <[email protected]>
- Loading branch information
Showing
7 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const path = require('path'); | ||
const concat = require('./lib/concat'); | ||
|
||
concat([ | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix5.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js'), | ||
path.join(__dirname, 'node_modules/webix/webix.js') | ||
], | ||
path.join(__dirname, 'node_modules/vendors.js')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const {promisify} = require('util'); | ||
const readFile = promisify(fs.readFile); | ||
const appendFile = promisify(fs.appendFile); | ||
|
||
function spaces(str, maxLength) { | ||
let ret = str; | ||
|
||
for (let i = str.length; i < maxLength; ++i) { | ||
ret += " "; | ||
} | ||
|
||
return ret; | ||
} | ||
|
||
async function concat(sources, target, dirname = path.join(__dirname, '../')) { | ||
const maxLength = sources.reduce((max, cur) => { | ||
if (cur.replace(dirname, '').length > max) return cur.replace(dirname, '').length; | ||
|
||
return max; | ||
}, 0); | ||
|
||
console.log('Maxlength is', maxLength); | ||
|
||
for (let i = 0; i < sources.length; ++i) { | ||
console.log(`${spaces(sources[i].replace(dirname, ''), maxLength)} >> ${target.replace(dirname, '')}`); | ||
|
||
const file = await readFile(sources[i]); | ||
await appendFile(target, file); | ||
} | ||
} | ||
|
||
module.exports = (sources, target) => { | ||
concat(sources, target).catch((err) => { | ||
console.trace(err); | ||
process.exit(1); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
}, | ||
"dependencies": { | ||
"css": "^2.2.1", | ||
"vlq": "^1.0.0" | ||
"vlq": "^1.0.0", | ||
"webix": "^5.2.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import './webix/webix.js'; | ||
|
||
export default class Datatable { | ||
constructor() { | ||
this.init(); | ||
} | ||
|
||
init() { | ||
const div = document.createElement('div'); | ||
|
||
div.id = 'testA'; | ||
div.style.width = '500px'; | ||
div.style.height = '500px'; | ||
|
||
document.body.appendChild(div); | ||
webix.ready(() => { | ||
const grid = webix.ui({ | ||
container:"testA", | ||
view:"datatable", | ||
columns:[ | ||
{ id:"rank", header:"", css:"rank", width:50}, | ||
{ id:"title", header:"Film title",width:200}, | ||
{ id:"year", header:"Released" , width:80}, | ||
{ id:"votes", header:"Votes", width:100} | ||
], | ||
select:"row", | ||
autoheight:true, | ||
autowidth:true, | ||
multiselect:true, | ||
|
||
on:{ | ||
onSelectChange:function(){ | ||
var text = "Selected: "+grid.getSelectedId(true).join(); | ||
document.getElementById('testB').innerHTML = text; | ||
} | ||
}, | ||
|
||
data:[ | ||
{ id:1, title:"The Shawshank Redemption", year:1994, votes:678790, rating:9.2, rank:1, category:"Thriller"}, | ||
{ id:2, title:"The Godfather", year:1972, votes:511495, rating:9.2, rank:2, category:"Crime"}, | ||
{ id:3, title:"The Godfather: Part II", year:1974, votes:319352, rating:9.0, rank:3, category:"Crime"}, | ||
{ id:4, title:"The Good, the Bad and the Ugly", year:1966, votes:213030, rating:8.9, rank:4, category:"Western"}, | ||
{ id:5, title:"Pulp fiction", year:1994, votes:533848, rating:8.9, rank:5, category:"Crime"}, | ||
{ id:6, title:"12 Angry Men", year:1957, votes:164558, rating:8.9, rank:6, category:"Western"} | ||
] | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters