diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 00000000..ccfb6928 --- /dev/null +++ b/HISTORY.md @@ -0,0 +1,12 @@ +vis.js history +http://visjs.org + +## + +- Css is now packaged in the javascript file, and automatically loaded. + + +## 2012-04-16, version 0.0.5 + +- First working version of the Timeline +- Website created. diff --git a/Jakefile.js b/Jakefile.js index 25f329ff..1e412574 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -22,7 +22,18 @@ desc('Build the visualization library vis.js'); task('vis', function () { var VIS = './vis.js'; var VIS_MIN = './vis.min.js'; - var VIS_CSS = './vis.css'; + + // concatenate and stringify css files + var result = concat({ + src: [ + './src/component/css/panel.css', + './src/component/css/item.css', + './src/component/css/timeaxis.css' + ], + header: '/* vis.js stylesheet */', + separator: '\n' + }); + var cssText = JSON.stringify(result.code); // concatenate the script files concat({ @@ -36,6 +47,7 @@ task('vis', function () { './src/stack.js', './src/range.js', './src/controller.js', + './src/module.js', './src/component/component.js', './src/component/panel.js', @@ -48,18 +60,11 @@ task('vis', function () { './lib/moment.js' ], - separator: '\n' - }); + separator: '\n', - // concatenate the css files - concat({ - dest: VIS_CSS, - src: [ - './src/component/css/panel.css', - './src/component/css/item.css', - './src/component/css/timeaxis.css' - ], - separator: '\n' + // Note: we insert the css as a string in the javascript code here + // the css will be injected on load of the javascript library + footer: 'loadCss(' + cssText + ');' }); // minify javascript diff --git a/README.md b/README.md index 59bb785c..65ceee62 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,10 @@ Or download the library from the github project: ## Load -To use a component, include the javascript and css file of vis in your webpage. +To use a component, include the javascript file of vis in your webpage. ```html - ``` A timeline can be instantiated as: @@ -53,7 +52,6 @@ of the project. Timeline basic demo -