-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
413 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/vendor/ | ||
composer.lock | ||
/node_modules/ | ||
package-lock.json | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Option helper. | ||
*/ | ||
|
||
/*global hoge: true*/ | ||
|
||
|
||
const $ = jQuery; | ||
|
||
$( document ).ready( () => { | ||
const api_key = $( '#hiden_api_key' ).val(); | ||
const $container = $( '#hiden_api_key_result' ); | ||
if ( ! api_key.length ) { | ||
$container.removeClass( 'loading' ).addClass( 'invalid' ); | ||
return; | ||
} | ||
wp.apiRequest( { | ||
path: '/hiden/v1/validator' | ||
} ).done( response => { | ||
$container.addClass( 'valid' ).find( 'strong' ).text( response.name ); | ||
}).fail( response => { | ||
$container.addClass( 'invalid' ); | ||
}).always( () => { | ||
$container.removeClass( 'loading' ); | ||
} ); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@charset "UTF-8"; | ||
|
||
@import "components/*"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#hiden_api_key_result{ | ||
|
||
transition: opacity .5s linear; | ||
opacity: 1; | ||
min-height: 1em; | ||
&.loading{ | ||
opacity: 0; | ||
} | ||
& > span { | ||
visibility: hidden; | ||
} | ||
&.invalid { | ||
.valid-string{ | ||
display: none; | ||
} | ||
.invalid-string{ | ||
visibility: visible; | ||
} | ||
} | ||
&.valid{ | ||
.valid-string{ | ||
visibility: visible; | ||
} | ||
.invalid-string{ | ||
display: none; | ||
} | ||
} | ||
.dashicons-yes{ | ||
color: #24e668; | ||
} | ||
.dashicons-no{ | ||
color: #e61f16; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
var gulp = require('gulp'), | ||
fs = require('fs'), | ||
$ = require('gulp-load-plugins')(), | ||
pngquant = require('imagemin-pngquant'), | ||
eventStream = require('event-stream'); | ||
|
||
// Include Path for Scss | ||
var includesPaths = [ | ||
'assets/scss' | ||
]; | ||
|
||
// Source directory | ||
var srcDir = { | ||
scss: [ | ||
'assets/scss/**/*.scss' | ||
], | ||
js: [ | ||
'assets/js/**/*.js', | ||
'!assets/js/**/_*.js' | ||
], | ||
jsHint: [ | ||
'assets/js/**/*.js' | ||
], | ||
jshintrc: [ | ||
'.jshintrc' | ||
], | ||
img: [ | ||
'assets/img/**/*' | ||
] | ||
|
||
}; | ||
// Destination directory | ||
var destDir = { | ||
scss: 'dist/css', | ||
js: 'dist/js', | ||
img: 'dist/img' | ||
}; | ||
|
||
// Sass | ||
gulp.task('sass', function () { | ||
|
||
return gulp.src(srcDir.scss) | ||
.pipe($.plumber({ | ||
errorHandler: $.notify.onError('<%= error.message %>') | ||
})) | ||
.pipe($.sassGlob()) | ||
.pipe($.sourcemaps.init()) | ||
.pipe($.sass({ | ||
errLogToConsole: true, | ||
outputStyle : 'compressed', | ||
sourceComments : 'normal', | ||
sourcemap : true, | ||
includePaths : includesPaths | ||
})) | ||
.pipe($.sourcemaps.write('./map')) | ||
.pipe(gulp.dest(destDir.scss)); | ||
}); | ||
|
||
|
||
// Minify All | ||
gulp.task('jsconcat', function () { | ||
return gulp.src(srcDir.js) | ||
.pipe($.plumber({ | ||
errorHandler: $.notify.onError('<%= error.message %>') | ||
})) | ||
.pipe($.sourcemaps.init({ | ||
loadMaps: true | ||
})) | ||
.pipe($.babel({ | ||
"presets": ["es2015"] | ||
})) | ||
.pipe($.uglify({ | ||
output:{ | ||
comments: /^!/ | ||
} | ||
})) | ||
.pipe($.sourcemaps.write('./map')) | ||
.pipe(gulp.dest(destDir.js)); | ||
}); | ||
|
||
|
||
// JS Hint | ||
gulp.task('jshint', function () { | ||
return gulp.src(srcDir.jsHint) | ||
.pipe($.plumber()) | ||
.pipe($.jshint({ | ||
lookup: srcDir.jshintrc | ||
})) | ||
.pipe($.jshint.reporter('jshint-stylish')); | ||
}); | ||
|
||
// JS task | ||
gulp.task('js', gulp.parallel('jshint', 'jsconcat')); | ||
|
||
|
||
// Build Libraries. | ||
gulp.task('copylib', function () { | ||
// pass gulp tasks to event stream. | ||
// return eventStream.merge( | ||
// ); | ||
}); | ||
|
||
// Image min | ||
gulp.task('imagemin', function () { | ||
return gulp.src(srcDir.img) | ||
.pipe($.imagemin({ | ||
progressive: true, | ||
svgoPlugins: [{removeViewBox: false}], | ||
use : [pngquant()] | ||
})) | ||
.pipe(gulp.dest(destDir.img)); | ||
}); | ||
|
||
|
||
// watch | ||
gulp.task('watch', function () { | ||
// Make SASS | ||
gulp.watch(srcDir.scss, gulp.task( 'sass' ) ); | ||
// Uglify all | ||
gulp.watch(srcDir.jsHint, gulp.task( 'js' ) ); | ||
// Minify Image | ||
gulp.watch(srcDir.img, gulp.task( 'imagemin' ) ); | ||
}); | ||
|
||
// Build | ||
gulp.task('build', gulp.parallel( 'js', 'sass', 'imagemin') ); | ||
|
||
// Default Tasks | ||
gulp.task('default', gulp.parallel('watch')); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "hiden", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "gulpfile.js", | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "gulp build", | ||
"package": "gulp build", | ||
"watch": "gulp build && gulp watch", | ||
"gulp": "gulp" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "GPL-3.0-or-later", | ||
"bugs": { | ||
"url": "" | ||
}, | ||
"homepage": "https://kunoichiwp.com", | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"event-stream": "^4.0.1", | ||
"gulp": "^4.0.0", | ||
"gulp-autoprefixer": "^6.0.0", | ||
"gulp-babel": "^7.0.0", | ||
"gulp-imagemin": "^5.0.3", | ||
"gulp-include": "^2.3.1", | ||
"gulp-jshint": "^2.0.4", | ||
"gulp-load-plugins": "^1.4.0", | ||
"gulp-notify": "^3.0.0", | ||
"gulp-plumber": "^1.1.0", | ||
"gulp-sass": "^4.0.2", | ||
"gulp-sass-glob": "^1.0.9", | ||
"gulp-sourcemaps": "^2.4.0", | ||
"gulp-uglify": "^3.0.1", | ||
"imagemin-pngquant": "^7.0.0", | ||
"jshint": "^2.9.4", | ||
"jshint-stylish": "^2.2.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.