From 7d5e6076940380a7fb2b39840d1a89eb51f498af Mon Sep 17 00:00:00 2001 From: riccio82 Date: Tue, 8 May 2018 19:17:09 +0200 Subject: [PATCH] Segments Filter: in revise default enabled --- Gruntfile.js | 69 +++++++++++++++++++ .../Microsoft/Decorator/CatDecorator.php | 23 +++++++ lib/Features/Microsoft/Utils/Routes.php | 23 +++++++ package.json | 26 +++++++ static/src/css/sass/microsoft-core.scss | 19 +++++ .../js/cat_source/microsoft-core.extension.js | 56 +++++++++++++++ static/src/js/cat_source/microsoft-core.js | 7 ++ 7 files changed, 223 insertions(+) create mode 100644 Gruntfile.js create mode 100644 lib/Features/Microsoft/Decorator/CatDecorator.php create mode 100755 lib/Features/Microsoft/Utils/Routes.php create mode 100644 package.json create mode 100644 static/src/css/sass/microsoft-core.scss create mode 100644 static/src/js/cat_source/microsoft-core.extension.js create mode 100644 static/src/js/cat_source/microsoft-core.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..6ef44a4 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,69 @@ +module.exports = function(grunt) { + + var es2015Preset = require('babel-preset-es2015'); + var reactPreset = require('babel-preset-react'); + + grunt.initConfig( { + browserify: { + core: { + options: { + transform: [ + [ 'babelify', { presets: [ es2015Preset, reactPreset ] } ] + ], + browserifyOptions: { + paths: [ __dirname + '/node_modules' ] + } + }, + src: [ + 'static/src/js/cat_source/microsoft-core.js', + 'static/src/js/cat_source/microsoft-core.*.js' + ], + dest: 'static/build/microsoft-core-build.js' + }, + }, + sass: { + dist: { + options: { + sourceMap: false, + includePaths: ['static/src/css/sass/'] + }, + src: [ + 'static/src/css/sass/microsoft-core.scss' + ], + dest: 'static/build/microsoft-build.css' + } + }, + replace: { + css: { + src: [ + 'static/build/*' + ], + dest: 'static/build/', + replacements: [ + { + from: 'url(../img', + to: 'url(../src/css/img' + } + ] + } + } + + }); + + grunt.loadNpmTasks('grunt-browserify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-sass'); + grunt.loadNpmTasks('grunt-text-replace'); + + // Define your tasks here + grunt.registerTask('default', ['bundle:js']); + + grunt.registerTask('bundle:js', [ + 'browserify:core', + 'sass', + 'replace' + ]); + + + +}; diff --git a/lib/Features/Microsoft/Decorator/CatDecorator.php b/lib/Features/Microsoft/Decorator/CatDecorator.php new file mode 100644 index 0000000..9197c37 --- /dev/null +++ b/lib/Features/Microsoft/Decorator/CatDecorator.php @@ -0,0 +1,23 @@ +template->append( 'footer_js', Routes::staticBuild( '/microsoft-core-build.js' ) ); + $this->template->append( 'css_resources', Routes::staticBuild( '/microsoft-build.css' ) ); + + $this->template->segment_filter_size = '50' ; + $this->template->segment_filter_type = 'regular_intervals' ; + } + +} \ No newline at end of file diff --git a/lib/Features/Microsoft/Utils/Routes.php b/lib/Features/Microsoft/Utils/Routes.php new file mode 100755 index 0000000..d0f8ead --- /dev/null +++ b/lib/Features/Microsoft/Utils/Routes.php @@ -0,0 +1,23 @@ +