Skip to content

Commit

Permalink
Cells that are scrolled to that do not yet exist, now are created
Browse files Browse the repository at this point in the history
Highlighting (dragging over a range of cells) nearly working
  • Loading branch information
robertleeplummerjr committed Feb 6, 2016
1 parent 5c068c4 commit de297ed
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions build.js
@@ -0,0 +1,81 @@
var fs = require('fs')
, execSync = require('child_process').execSync


//compile parsers
//cd parser/formula
//node ../../../jison/ports/php/php.js formula.jison
//cd ../../

//directories of the JS files
, inDir = './Sheet'
, outDir = '.'

//these are the paths to the final combined files that you want to have in the end
, temp = ''
, result = ''
, wrapper = inDir + '/wrapper.js'
, combinedFile = outDir + '/jquery.sheet.js'
, combinedFileMin = outDir + '/jquery.sheet.min.js'

, files = [
//namespace first
'Base.js',

//non-constructors next
'fn.js',
'sheet.js',
'thread.js',
'utilities.js',

//children namespaces next
'Loader/HTML.js',
'Loader/JSON.js',
'Loader/XML.js',

//constructors next
'ActionUI.js',
'Cell.js',
'CellHandler.js',
'CellTypeHandlers.js',
'CellRange.js',
'Highlighter.js',
'SpreadsheetUI.js',
'Theme.js',

//environment correction last
'environmentCorrection.js'
]
, parserFiles = [
'parser/formula/formula.js',
'parser/tsv/tsv.js'
]
;

//run through the JS files
files.forEach(function(file) {
temp += fs.readFileSync('Sheet/' + file, 'utf8').toString();
});

result = fs.readFileSync(wrapper, 'utf8').toString().replace('CODE_HERE', function() { return temp; });

//run through the parser files
parserFiles.forEach(function(file) {
result += fs.readFileSync(file, 'utf8').toString();
});

fs.writeFileSync(combinedFile, result);

//compress it

//add the file to the git base
execSync('git add ' + combinedFile);

try {
execSync('yui-compressor -o ' + combinedFileMin + ' ' + combinedFile);
execSync('git add ' + combinedFileMin);
} catch (e) {
console.log('WARNING: attempted to use yui-compressor, but it is not installed correctly');
}

process.exit(0);

0 comments on commit de297ed

Please sign in to comment.