30 lines
585 B
JavaScript
30 lines
585 B
JavaScript
|
load('ansitex/load/funcs.js');
|
||
|
load('ansitex/load/page.js');
|
||
|
|
||
|
/* parse command arguments */
|
||
|
if (argv.length !== 1) {
|
||
|
writeln('! ERROR: Need 1 arguments only');
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
var file = argv.shift();
|
||
|
|
||
|
var ext = file_getext(file).substr(1).toLowerCase();
|
||
|
|
||
|
// Type of frame to load
|
||
|
switch (ext) {
|
||
|
case 'tex':
|
||
|
require('ansitex/load/session/ansitex.js','SESSION_ANSITEX');
|
||
|
break;
|
||
|
|
||
|
case 'vtx':
|
||
|
require('ansitex/load/session/viewdata.js','SESSION_VIEWDATA');
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
var page = new Page(false);
|
||
|
page.import(file);
|
||
|
//page.build();
|
||
|
//page.get(new PageObject(980,'a'));
|
||
|
page.save();
|