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 @@ +