-
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.
see #1: refactor folder structure to make JavaScript files using the …
…WordPress patterns
- Loading branch information
Showing
11 changed files
with
303 additions
and
28 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 +1,5 @@ | ||
.idea/ | ||
|
||
/node_modules | ||
/npm-debug.log | ||
/build |
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,25 @@ | ||
{ | ||
"boss": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"es3": true, | ||
"expr": true, | ||
"immed": true, | ||
"noarg": true, | ||
"onevar": true, | ||
"quotmark": "single", | ||
"trailing": true, | ||
"undef": true, | ||
"unused": true, | ||
|
||
"browser": true, | ||
|
||
"globals": { | ||
"_": false, | ||
"Backbone": false, | ||
"jQuery": false, | ||
"JSON": false, | ||
"wp": false | ||
} | ||
} |
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,172 @@ | ||
/* jshint node:true */ | ||
module.exports = function ( grunt ) { | ||
var path = require( 'path' ), | ||
SOURCE_DIR = 'src/', | ||
BUILD_DIR = 'build/', | ||
autoprefixer = require( 'autoprefixer' ), | ||
buildConfig = {}, | ||
builds = [ 'admin' ]; | ||
|
||
// Load tasks. | ||
require( 'matchdep' ).filterDev( [ 'grunt-*', '!grunt-legacy-util' ] ).forEach( grunt.loadNpmTasks ); | ||
|
||
// Load legacy utils | ||
grunt.util = require( 'grunt-legacy-util' ); | ||
|
||
builds.forEach( function ( build ) { | ||
var path = SOURCE_DIR + 'admin/js/'; | ||
buildConfig[ build ] = { files: {} }; | ||
buildConfig[ build ].files[ path + build + '.js' ] = [ path + '/src/' + build + '.manifest.js' ]; | ||
} ); | ||
|
||
// Project configuration. | ||
grunt.initConfig( { | ||
|
||
clean: { | ||
all: [ BUILD_DIR ], | ||
dynamic: { | ||
dot: true, | ||
expand: true, | ||
cwd: BUILD_DIR, | ||
src: [] | ||
} | ||
}, | ||
copy: { | ||
files: { | ||
files: [ | ||
{ | ||
dot: true, | ||
expand: true, | ||
cwd: SOURCE_DIR, | ||
src: [ // Set here the files to include/exclude. | ||
'**', | ||
'!**/.git/**' // Ignore version control directories. | ||
], | ||
dest: BUILD_DIR | ||
} | ||
] | ||
}, | ||
dynamic: { | ||
dot: true, | ||
expand: true, | ||
cwd: SOURCE_DIR, | ||
dest: BUILD_DIR, | ||
src: [] | ||
} | ||
}, | ||
browserify: buildConfig, | ||
jshint: { | ||
options: grunt.file.readJSON( '.jshintrc' ), | ||
grunt: { | ||
src: [ 'Gruntfile.js' ] | ||
}, | ||
admin: { | ||
options: { | ||
browserify: true | ||
}, | ||
src: [ | ||
SOURCE_DIR + 'admin/js/**/*.js' | ||
] | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
ASCIIOnly: true | ||
}, | ||
admin: { | ||
expand: true, | ||
cwd: SOURCE_DIR, | ||
dest: BUILD_DIR, | ||
ext: '.min.js', | ||
src: [ | ||
'admin/js/helixware-mico-admin.js' | ||
] | ||
} | ||
}, | ||
jsvalidate: { | ||
options: { | ||
globals: {}, | ||
esprimaOptions: {}, | ||
verbose: false | ||
}, | ||
build: { | ||
files: { | ||
src: BUILD_DIR + '{admin,public}/js/**/*.js' | ||
} | ||
} | ||
}, | ||
imagemin: { | ||
core: { | ||
expand: true, | ||
cwd: SOURCE_DIR, | ||
src: '{admin,public}/images/**/*.{png,jpg,gif,jpeg}', | ||
dest: SOURCE_DIR | ||
} | ||
}, | ||
_watch: { | ||
all: { | ||
files: [ | ||
SOURCE_DIR + '**', | ||
'!' + SOURCE_DIR + 'admin/js/src/**', | ||
// Ignore version control directories. | ||
'!' + SOURCE_DIR + '**/.git/**' | ||
], | ||
tasks: [ 'clean:dynamic', 'copy:dynamic' ], | ||
options: { | ||
dot: true, | ||
spawn: false, | ||
interval: 2000 | ||
} | ||
}, | ||
config: { | ||
files: 'Gruntfile.js' | ||
} | ||
} | ||
|
||
} ); | ||
|
||
|
||
grunt.renameTask( 'watch', '_watch' ); | ||
|
||
grunt.registerTask( 'watch', function () { | ||
if ( !this.args.length || this.args.indexOf( 'browserify' ) > -1 ) { | ||
grunt.config( 'browserify.options', { | ||
browserifyOptions: { | ||
debug: true | ||
}, | ||
watch: true | ||
} ); | ||
|
||
grunt.task.run( 'browserify' ); | ||
} | ||
|
||
grunt.task.run( '_' + this.nameArgs ); | ||
} ); | ||
|
||
// Default task. | ||
grunt.registerTask('default', ['build']); | ||
|
||
/* | ||
* Automatically updates the `:dynamic` configurations | ||
* so that only the changed files are updated. | ||
*/ | ||
grunt.event.on('watch', function( action, filepath, target ) { | ||
var src; | ||
|
||
if ( [ 'all', 'rtl', 'browserify' ].indexOf( target ) === -1 ) { | ||
return; | ||
} | ||
|
||
src = [ path.relative( SOURCE_DIR, filepath ) ]; | ||
|
||
if ( action === 'deleted' ) { | ||
grunt.config( [ 'clean', 'dynamic', 'src' ], src ); | ||
} else { | ||
grunt.config( [ 'copy', 'dynamic', 'src' ], src ); | ||
|
||
if ( target === 'rtl' ) { | ||
grunt.config( [ 'rtlcss', 'dynamic', 'src' ], src ); | ||
} | ||
} | ||
}); | ||
}; |
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,33 @@ | ||
{ | ||
"name": "helixware-mico", | ||
"version": "1.3.0-dev", | ||
"description": "HelixWare MICO Extensions for WordPress extends the HelixWare plugin with MICO features such as video segmentation, face detection, speech-to-text and more.", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/insideout10/helixware-mico-plugin.git" | ||
}, | ||
"author": "Insideout10", | ||
"license": "GPL-2.0+", | ||
"devDependencies": { | ||
"autoprefixer": "~6.0.3", | ||
"grunt": "~0.4.5", | ||
"grunt-browserify": "~4.0.1", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-compress": "~0.13.0", | ||
"grunt-contrib-concat": "~0.5.1", | ||
"grunt-contrib-copy": "~0.8.0", | ||
"grunt-contrib-cssmin": "~0.12.3", | ||
"grunt-contrib-imagemin": "~0.9.4", | ||
"grunt-contrib-jshint": "~0.11.3", | ||
"grunt-contrib-qunit": "~0.7.0", | ||
"grunt-contrib-uglify": "~0.9.2", | ||
"grunt-contrib-watch": "~0.6.1", | ||
"grunt-includes": "~0.5.1", | ||
"grunt-jsvalidate": "~0.2.2", | ||
"grunt-legacy-util": "^0.2.0", | ||
"grunt-postcss": "~0.6.0", | ||
"grunt-rtlcss": "~1.6.0", | ||
"grunt-sass": "~1.0.0", | ||
"matchdep": "~0.3.0" | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
var $ = jQuery; | ||
|
||
var helixware = window.helixware = window.helixware || {}; | ||
|
||
helixware.controller.Test = require( './controllers/test-controller.js' ); |
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 @@ | ||
var x = 10; |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* @subpackage Helixware_Mico/includes | ||
* @author David Riccitelli <[email protected]> | ||
*/ | ||
class Helixware_Mico_Fragment_Service { | ||
abstract class Helixware_Mico_Fragment_Service { | ||
|
||
const FIND_BY_ASSET_GUID_PATH = '/%s/search/findByAssetGUID?guid=%s'; | ||
|
||
|
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