Skip to content

Commit

Permalink
Merge pull request #40 from tintou/source-reorganisation
Browse files Browse the repository at this point in the history
Source reorganisation
  • Loading branch information
eddyparkinson authored Jan 12, 2018
2 parents a737e3d + e947563 commit e4794d2
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 16 deletions.
43 changes: 28 additions & 15 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@ var uglify = require('gulp-uglify');
var filesExist = require('files-exist');
var jshint = require('gulp-jshint');

js_top_file = 'module-wrapper-top.js';
js_bottom_file = 'module-wrapper-bottom.js';

js_files = [
'socialcalcconstants.js',
'socialcalc-3.js',
'socialcalctableeditor.js',
'formatnumber2.js',
'formula1.js',
'socialcalcpopup.js',
'socialcalcspreadsheetcontrol.js',
'socialcalcviewer.js'
var js_folder = './js/';
var css_folder = './css/';
var dist_folder = './dist/';

var js_top_file = js_folder + 'module-wrapper-top.js';
var js_bottom_file = js_folder + 'module-wrapper-bottom.js';

var js_files = [
js_folder + 'socialcalcconstants.js',
js_folder + 'socialcalc-3.js',
js_folder + 'socialcalctableeditor.js',
js_folder + 'formatnumber2.js',
js_folder + 'formula1.js',
js_folder + 'socialcalcpopup.js',
js_folder + 'socialcalcspreadsheetcontrol.js',
js_folder + 'socialcalcviewer.js'
];

var css_files = [
css_folder + 'socialcalc.css'
];

gulp.task('validate-js', function () {
Expand All @@ -33,13 +41,18 @@ gulp.task('validate-js', function () {
.pipe(jshint.reporter('jshint-stylish'));
});


gulp.task('js', ['validate-js'], function () {
var files = filesExist([].concat(js_top_file, js_files, js_bottom_file));
return gulp.src(files)
.pipe(concat('SocialCalc.js'))
.pipe(gulp.dest('.'));
.pipe(gulp.dest(dist_folder));
});

gulp.task('default', ['js'], function () {});
gulp.task('css', function () {
var files = filesExist(css_files);
return gulp.src(files)
.pipe(concat('socialcalc.css'))
.pipe(gulp.dest(dist_folder));
});

gulp.task('default', ['js', 'css'], function () {});
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See it in action at [ethercalc.net](http://ethercalc.net)!
* jQuery (only on the client-side)

## Usage
You can `require('socialcalc')` or include `node_modules/socialcalc/SocialCalc.js` on your web page using a script tag.
You can `require('socialcalc')` or include `node_modules/socialcalc/dist/SocialCalc.js` on your web page using a script tag.

In order to create an editor instance use:
```js
Expand Down
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions dist/socialcalc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
// The optional default CSS style sheet for the SocialCalc package.
// SocialCalc can run without a style sheet (the default) or with one.
//
// (c) Copyright 2008 Socialtext, Inc.
// All Rights Reserved.
//
// The contents of this file are subject to the Artistic License 2.0; you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at http://socialcalc.org/licenses/al-20/.
//
// Some of the other files in the SocialCalc package are licensed under
// different licenses. Please note the licenses of the modules you use.
//
// Code History:
//
// Initially coded by Dan Bricklin of Software Garden, Inc., for Socialtext, Inc.
*/

.defaultComment {background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-commentbg.gif);}
.defaultCommentNoGridStyle {}
.defaultHighlightTypeCursor {color:#FFF;background-color:#A6A6A6;}
.defaultHighlightTypeRange {color:#000;background-color:#E5E5E5;}
.defaultColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#808080;cursor:e-resize;}
.defaultSelectedColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#404040;cursor:e-resize;}
.defaultRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#808080;}
.defaultSelectedRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#404040;}
.defaultUpperLeft {font-size:small;}
.defaultSkippedCell {font-size:small;background-color:#CCC;}
.defaultPaneDivider {font-size:small;background-color:#ECECEC;padding:0px;}
.cteGriddiv {}
.defaultInputEcho {background-color:#FFD;border:1px solid #884;
font-size:small;padding:2px 10px 1px 2px;cursor:default;}
.TCmain {background-color:#EEE;}
.TCendcap {background-color:#FFF;}
.TCpaneslider {background-color:#CCC;}
.TClessbutton {background-color:#AAA;}
.TCmorebutton {background-color:#AAA;}
.TCscrollarea {background-color:#DDD;}
.TCthumb {background-color:#CCC;}
.TCPStrackingline {overflow:hidden;position:absolute;z-index:100;}
.TCTDFSthumbstatus {height:20px;width:auto;border:1px solid black;padding:2px;
background-color:#FFF;font-size:small;position:absolute;z-index:100;}
.TDpopupElement {border:1px solid black;padding:1px 2px 2px 2px;text-align:center;background-color:#FFF;
font-size:7pt;font-family:Verdana,Arial,Helvetica,sans-serif;
position:absolute;width:auto;z-index:110;}
#searchbar {
float:right;
}

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e4794d2

Please sign in to comment.