-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cells that are scrolled to that do not yet exist, now are created
Highlighting (dragging over a range of cells) nearly working
- Loading branch information
1 parent
5c068c4
commit de297ed
Showing
1 changed file
with
81 additions
and
0 deletions.
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,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); |