From 8cb74c5e7a235682d35ab739a7b06ac0bacde8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Fri, 5 Feb 2016 23:27:15 +0100 Subject: [PATCH] Simplified installing of JS and CSS libs. Fixed #1906. --- .travis.yml | 2 -- README.rst | 15 +++++++-------- bower.json | 5 +++++ gulpfile.js | 10 +--------- openslides/core/static/templates/projector.html | 1 - package.json | 4 +++- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 74feb4ac1..a3fda8cee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,6 @@ python: install: - "pip install --upgrade --requirement requirements.txt" - "npm install" - - "node_modules/.bin/bower install" - - "node_modules/.bin/gulp --production" script: - "flake8 openslides tests" - "isort --check-only --recursive openslides tests" diff --git a/README.rst b/README.rst index f71473673..8ef3ccc57 100644 --- a/README.rst +++ b/README.rst @@ -186,30 +186,29 @@ Installation and start of the development version $ pip install -r requirements.txt -5. Install all npm and bower packages +5. Install all npm and bower packages and concat and copy all third party + JavaScript and Cascading Style Sheets libraries For Unix and Mac OS X run:: $ npm install - $ node_modules/.bin/bower install For Windows run:: > npm install - > node_modules\.bin\bower install -6. Concat and copy all third party JavaScript and Cascading Style Sheets - libraries + Later you might want to rerun gulp so that the third party JavaScript + and Cascading Style Sheets libraries are not minified. - For Unix and Mac OS X run:: + To do this for Unix and Mac OS X run:: $ node_modules/.bin/gulp - For Windows run:: + To do this for Windows run:: > node_modules\.bin\gulp -7. Start OpenSlides +6. Start OpenSlides Use the command-line interface:: diff --git a/bower.json b/bower.json index e7186bf71..60f076aae 100644 --- a/bower.json +++ b/bower.json @@ -33,6 +33,11 @@ "roboto-condensed": "~0.3.0", "open-sans-fontface": "https://github.com/OpenSlides/open-sans.git#1.4.2.post1" }, + "overrides": { + "pdfjs-dist": { + "main": "build/pdf.combined.js" + } + }, "resolutions": { "angular": ">=1.4.9 <1.5" } diff --git a/gulpfile.js b/gulpfile.js index ba3a1b0ef..2d683ffd6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -25,7 +25,6 @@ var argv = require('yargs').argv, jshint = require('gulp-jshint'), mainBowerFiles = require('main-bower-files'), path = require('path'), - rename = require('gulp-rename'), through = require('through2'), uglify = require('gulp-uglify'), vsprintf = require('sprintf-js').vsprintf; @@ -74,13 +73,6 @@ gulp.task('ckeditor', function () { .pipe(gulp.dest(path.join(output_directory, 'ckeditor'))); }); -// Extra task only for PDF.js -gulp.task('pdfjs', function () { - return gulp.src(path.join('bower_components', 'pdfjs-dist', 'build', 'pdf.worker.js')) - .pipe(rename(path.join('openslides-libs.worker.js'))) - .pipe(gulp.dest(path.join(output_directory, 'js'))); -}); - // Compiles translation files (*.po) to *.json and saves them in the directory // openslides/static/i18n/. gulp.task('translations', function () { @@ -92,7 +84,7 @@ gulp.task('translations', function () { }); // Gulp default task. Runs all other tasks before. -gulp.task('default', ['js-libs', 'css-libs', 'fonts-libs', 'ckeditor', 'pdfjs', 'translations'], function () {}); +gulp.task('default', ['js-libs', 'css-libs', 'fonts-libs', 'ckeditor', 'translations'], function () {}); /** diff --git a/openslides/core/static/templates/projector.html b/openslides/core/static/templates/projector.html index ab04adea1..089967f66 100644 --- a/openslides/core/static/templates/projector.html +++ b/openslides/core/static/templates/projector.html @@ -7,7 +7,6 @@ -