From e9475633eda64f12ecc934361a2717942acf2186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Mon, 18 Dec 2017 22:25:16 +0100 Subject: [PATCH] Reorganize the source location --- Gulpfile.js | 43 ++++++++++------ README.md | 2 +- socialcalc.css => css/socialcalc.css | 0 SocialCalc.js => dist/SocialCalc.js | 0 dist/socialcalc.css | 50 +++++++++++++++++++ formatnumber2.js => js/formatnumber2.js | 0 formula1.js => js/formula1.js | 0 .../module-wrapper-bottom.js | 0 .../module-wrapper-top.js | 0 socialcalc-3.js => js/socialcalc-3.js | 0 .../socialcalcconstants.js | 0 socialcalcpopup.js => js/socialcalcpopup.js | 0 .../socialcalcspreadsheetcontrol.js | 0 .../socialcalctableeditor.js | 0 socialcalcviewer.js => js/socialcalcviewer.js | 0 15 files changed, 79 insertions(+), 16 deletions(-) rename socialcalc.css => css/socialcalc.css (100%) rename SocialCalc.js => dist/SocialCalc.js (100%) create mode 100644 dist/socialcalc.css rename formatnumber2.js => js/formatnumber2.js (100%) rename formula1.js => js/formula1.js (100%) rename module-wrapper-bottom.js => js/module-wrapper-bottom.js (100%) rename module-wrapper-top.js => js/module-wrapper-top.js (100%) rename socialcalc-3.js => js/socialcalc-3.js (100%) rename socialcalcconstants.js => js/socialcalcconstants.js (100%) rename socialcalcpopup.js => js/socialcalcpopup.js (100%) rename socialcalcspreadsheetcontrol.js => js/socialcalcspreadsheetcontrol.js (100%) rename socialcalctableeditor.js => js/socialcalctableeditor.js (100%) rename socialcalcviewer.js => js/socialcalcviewer.js (100%) diff --git a/Gulpfile.js b/Gulpfile.js index 6950ce5..df3a1e6 100755 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -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 () { @@ -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 () {}); diff --git a/README.md b/README.md index 864d9e5..1447497 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/socialcalc.css b/css/socialcalc.css similarity index 100% rename from socialcalc.css rename to css/socialcalc.css diff --git a/SocialCalc.js b/dist/SocialCalc.js similarity index 100% rename from SocialCalc.js rename to dist/SocialCalc.js diff --git a/dist/socialcalc.css b/dist/socialcalc.css new file mode 100644 index 0000000..90615a3 --- /dev/null +++ b/dist/socialcalc.css @@ -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; +} + diff --git a/formatnumber2.js b/js/formatnumber2.js similarity index 100% rename from formatnumber2.js rename to js/formatnumber2.js diff --git a/formula1.js b/js/formula1.js similarity index 100% rename from formula1.js rename to js/formula1.js diff --git a/module-wrapper-bottom.js b/js/module-wrapper-bottom.js similarity index 100% rename from module-wrapper-bottom.js rename to js/module-wrapper-bottom.js diff --git a/module-wrapper-top.js b/js/module-wrapper-top.js similarity index 100% rename from module-wrapper-top.js rename to js/module-wrapper-top.js diff --git a/socialcalc-3.js b/js/socialcalc-3.js similarity index 100% rename from socialcalc-3.js rename to js/socialcalc-3.js diff --git a/socialcalcconstants.js b/js/socialcalcconstants.js similarity index 100% rename from socialcalcconstants.js rename to js/socialcalcconstants.js diff --git a/socialcalcpopup.js b/js/socialcalcpopup.js similarity index 100% rename from socialcalcpopup.js rename to js/socialcalcpopup.js diff --git a/socialcalcspreadsheetcontrol.js b/js/socialcalcspreadsheetcontrol.js similarity index 100% rename from socialcalcspreadsheetcontrol.js rename to js/socialcalcspreadsheetcontrol.js diff --git a/socialcalctableeditor.js b/js/socialcalctableeditor.js similarity index 100% rename from socialcalctableeditor.js rename to js/socialcalctableeditor.js diff --git a/socialcalcviewer.js b/js/socialcalcviewer.js similarity index 100% rename from socialcalcviewer.js rename to js/socialcalcviewer.js