From 35db8f228af6bf4016b79f610929393a1a43ee52 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 22 Sep 2016 16:19:22 -0400 Subject: [PATCH] adding gulp, sass, rename and sourcemaps and enqueuing glm-grid in member-db --- .gitignore | 1 + controllers/front.php | 11 +++++++++++ css/glm-grid.css | 2 ++ css/glm-grid.css.map | 1 + gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++++++ index.php | 6 +++--- package.json | 21 +++++++++++++++++++++ scss/_glm-grid.scss | 0 scss/_settings.scss | 0 scss/app.scss | 2 ++ 10 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 css/glm-grid.css create mode 100644 css/glm-grid.css.map create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 scss/_glm-grid.scss create mode 100644 scss/_settings.scss create mode 100644 scss/app.scss diff --git a/.gitignore b/.gitignore index 2b59d87e..53f75f14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ misc/smarty/** media/images/** .project +node_modules diff --git a/controllers/front.php b/controllers/front.php index 03b8dc1c..34ba106f 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -168,6 +168,7 @@ class glmMembersFront extends GlmPluginSupport // Register any front.css files in the css directory of any glm members plugin foreach ($this->config['addOns'] as $a) { $cssFile = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.$a['slug'].'/css/front.css'; + $cssGridFile = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.$a['slug'].'/css/glm-grid.css'; if (is_file($cssFile)) { $cssName = $a['slug'].'-front-css'; wp_register_style( @@ -178,6 +179,16 @@ class glmMembersFront extends GlmPluginSupport ); wp_enqueue_style($cssName); } + if (is_file($cssGridFile)) { + $cssGridName = $a['slug'].'-grid-front-css'; + wp_register_style( + $cssGridName, + GLM_MEMBERS_WORDPRESS_PLUGIN_URL.'/'.$a['slug'].'/css/glm-grid.css', + false, + GLM_MEMBERS_PLUGIN_VERSION + ); + wp_enqueue_style($cssGridName); + } } } diff --git a/css/glm-grid.css b/css/glm-grid.css new file mode 100644 index 00000000..7466a853 --- /dev/null +++ b/css/glm-grid.css @@ -0,0 +1,2 @@ + +/*# sourceMappingURL=glm-grid.css.map */ diff --git a/css/glm-grid.css.map b/css/glm-grid.css.map new file mode 100644 index 00000000..2462c35d --- /dev/null +++ b/css/glm-grid.css.map @@ -0,0 +1 @@ +{"version":3,"file":"glm-grid.css","sources":["app.scss","_settings.scss","_glm-grid.scss"],"sourcesContent":["@import 'settings';\n@import 'glm-grid';","",""],"mappings":"","names":[],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..d1ca2606 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,43 @@ +var gulp = require('gulp'); +var rename = require('gulp-rename'); +var sass = require('gulp-sass'); +var maps = require('gulp-sourcemaps'); + +function swallowError (error) { + + // If you want details of the error in the console + console.log(error.toString()) + + this.emit('end') +} + +function swallowError (error) { + + // If you want details of the error in the console + console.log(error.toString()); + + this.emit('end'); +} + +gulp.task('sass', function() { + return gulp.src('scss/app.scss') + .pipe(maps.init()) + .on('error', swallowError) + .pipe(sass({ + outputStyle: 'compressed' + })).on('error', swallowError) + .pipe(rename('glm-grid.css')) + .pipe(maps.write('.')) + .pipe(gulp.dest('css')); +}); + +gulp.task('watch', function () { + gulp.watch('scss/**/*.{scss,sass}', ['sass']); + gulp.watch('gulpfile.js'); +}); + +gulp.task('build', ["sass"]); + +gulp.task('runwatch', ["sass"]); + +gulp.task('default', ["runwatch","watch"]); \ No newline at end of file diff --git a/index.php b/index.php index 0b1c6260..8c184f06 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 2.5.6 + * Version: 2.6.0 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabase * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 2.5.6 + * @version 2.6.0 */ /* @@ -38,7 +38,7 @@ * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.5.6'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.6.0'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.19'); // Check if plugin version is not current in WordPress option and if needed updated it diff --git a/package.json b/package.json new file mode 100644 index 00000000..d2e80abb --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "glm-member-db", + "version": "0.0.0", + "description": "=== Gaslight Media Member Database === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Members Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@cvs2:WP-Plugins/glm-member-db.git" + }, + "author": "", + "license": "ISC", + "dependencies": { + "gulp": "~3.9.1", + "gulp-sass": "~2.3.2", + "gulp-rename": "~1.2.2", + "gulp-sourcemaps": "~1.6.0" + } +} diff --git a/scss/_glm-grid.scss b/scss/_glm-grid.scss new file mode 100644 index 00000000..e69de29b diff --git a/scss/_settings.scss b/scss/_settings.scss new file mode 100644 index 00000000..e69de29b diff --git a/scss/app.scss b/scss/app.scss new file mode 100644 index 00000000..aecb88e1 --- /dev/null +++ b/scss/app.scss @@ -0,0 +1,2 @@ +@import 'settings'; +@import 'glm-grid'; \ No newline at end of file -- 2.17.1