Skip to content

Commit

Permalink
MapSeries V1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asizer committed Dec 15, 2016
1 parent ebac16b commit 2cb4678
Show file tree
Hide file tree
Showing 183 changed files with 9,136 additions and 4,074 deletions.
11 changes: 7 additions & 4 deletions .jshintrc
Expand Up @@ -2,24 +2,27 @@
"browser": true,
"dojo": true,
"jquery": true,

"globals": {
"console": false,
"alert": false,
"prompt": false,

"esri": false,
"_": false,
"unescape": false,

"commonConfig": true,
"i18n": false,
"app": true,

"FB": false,
"History": false,

"CKEDITOR": false

"CKEDITOR": false,
"CKEDITOR_BASEPATH": true
},

"expr": true,
"laxbreak": true,
"eqnull": true,
Expand Down
126 changes: 69 additions & 57 deletions Gruntfile.js
Expand Up @@ -2,7 +2,7 @@
module.exports = function(grunt) {
var fs = require('fs'),
TPL_NAME = 'tpl';

/*
* Tasks:
* - grunt Create the production build
Expand All @@ -11,16 +11,16 @@
* - grunt watch Run JSHint every time a JS file change
* - grunt jsapioptim Generate the JS API modules list used by the app in deploy/
*/

require('load-grunt-tasks')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

clean: {
deploy: ['deploy/*'],
jsapioptim: [
'deploy/build-api-viewer.tmp',
'deploy/build-api-viewer.tmp',
'deploy/build-api-builder.tmp',
'jsapi-optim-modules-viewer.txt',
'jsapi-optim-modules-builder.txt'
Expand All @@ -32,15 +32,15 @@
'deploy/resources/tpl/viewer/font/README.txt'
]
},

mkdir: {
all: {
options: {
create: ['deploy/app']
},
},
},

requirejs: {
options: {
baseUrl: 'src/app/',
Expand All @@ -52,26 +52,26 @@
'dojox': 'empty:',
'dgrid': 'empty:', // Used by SelectMapWidget
'put-selector': 'empty:', // Used by SelectMapWidget

/* Libraries */
'lib-app': '../lib-app/',

/* Build chain dependencies */
'lib-build': '../lib-build/',

/* Inlining of .html */
'text': '../lib-build/text',
'underscore': '../lib-build/lodash',

/* Localization */
'i18n': '../lib-build/i18n',
},
stubModules: [
'text',
'text',
'lib-build/tpl'
],
exclude: [
'underscore',
// 'underscore',
'lib-build/normalize'
//'i18n'
],
Expand All @@ -87,13 +87,13 @@
name: 'storymaps/' + TPL_NAME + '/BuildConfigBuilder',
out: 'deploy/app/builder-min.js',
onModuleBundleComplete: function (data) {
var modules = data.included.filter(function (value) {
var modules = data.included.filter(function (value) {
return ! value.match(/lib-/);
});

fs.writeFile("deploy/build-api-builder.tmp", modules.join('\n'), function(err) {
if(err) console.log(err);
});
});
}
}
},
Expand All @@ -102,18 +102,18 @@
name: 'storymaps/' + TPL_NAME + '/BuildConfigViewer',
out: 'deploy/app/viewer-min.js',
onModuleBundleComplete: function (data) {
var modules = data.included.filter(function (value) {
var modules = data.included.filter(function (value) {
return ! value.match(/lib-/);
});

fs.writeFile("deploy/build-api-viewer.tmp", modules.join('\n'), function(err) {
if(err) console.log(err);
});
});
}
}
}
},

concat: {
options: {
stripBanners: true,
Expand All @@ -131,7 +131,7 @@
dest: 'deploy/app/builder-min.js',
},
},

execute: {
viewer: {
src: ['src/lib-build/js-api-optimizer.js'],
Expand All @@ -148,7 +148,7 @@
}
}
},

copy: {
html: {
files: [{
Expand Down Expand Up @@ -186,7 +186,7 @@
files: [{
expand: true,
cwd: 'src',
src:['app/main-app.js', 'app/main-config.js'],
src:['app/main-app.js', 'app/main-config.js', 'app/custom-scripts.js'],
dest: 'deploy/'
}]
},
Expand All @@ -204,14 +204,20 @@
src:['**'],
dest: 'deploy/resources/lib/bootstrap/fonts/'
},
{
expand: true,
cwd: 'src/lib-app/font-awesome/fonts/',
src:['**'],
dest: 'deploy/resources/lib/font-awesome/fonts/'
},
{
expand: true,
cwd: 'src/lib-app/ckeditor/',
src:[
'config.js',
'contents.css',
'styles.js',
'lang/**',
'config.js',
'contents.css',
'styles.js',
'lang/**',
'skins/**',
'plugins/autogrow/**',
'plugins/colordialog/**',
Expand Down Expand Up @@ -248,7 +254,7 @@
}]
}
},

'regex-replace': {
css: {
src: ['deploy/app/*.css'],
Expand All @@ -271,6 +277,12 @@
replace: '../resources/lib/bootstrap/fonts/',
flags: 'g'
},
{
name: 'Fontawesome fonts path',
search: '../lib-app/font-awesome/fonts/',
replace: '../resources/lib/font-awesome/fonts/',
flags: 'g'
},
{
name: 'Colorbox images path',
search: '../lib-app/colorbox/images/',
Expand Down Expand Up @@ -322,15 +334,15 @@
]
}
},

jshint: {
common: {
options: {
jshintrc: '.jshintrc'
},
files: {
src: [
'src/app/storymaps/common/**/*.js',
'src/app/storymaps/common/**/*.js',
// Exclude browse-dialog files
'!src/app/storymaps/common/builder/browse-dialog/**/*.js',
// Exclude NLS
Expand Down Expand Up @@ -366,14 +378,14 @@
},
files: {
src: [
'src/app/storymaps/common/_resources/nls/*/*.js',
'src/app/storymaps/common/_resources/nls/*/*.js',
'src/resources/**/nls/*/*.js'
]
}

}
},

connect: {
server: {
options: {
Expand All @@ -383,19 +395,19 @@
}
}
},

watch: {
files: ['src/app/**/*.js'],
tasks: ['jshint']
}
});
/*
* Create a web server on port 8080
* Run 'start grunt server' or 'grunt server &'

/*
* Create a web server on port 8080
* Run 'start grunt server' or 'grunt server &'
*/
grunt.registerTask('server', ['connect']);

/*
* Build production version of the template
*/
Expand All @@ -406,49 +418,49 @@
'jshint:nls-en',
'jshint:nls-all',
// Initialize deploy folder
'clean',
'clean',
'mkdir',

// Minify and compress JS & CSS
'requirejs',
'regex-replace:js',
'regex-replace:css',
'concat',

// Copy html
'copy:html',

// Copy main
'copy:main',
'regex-replace:main',

// Copy resources
'copy:config',
'copy:resources',
'copy:commonResources',

// Copy libs resources and perform replacement
'copy:libsResources',
'regex-replace:csslib',

'copy:readme',
'clean:jsapioptim',
'clean:jsapioptim',
'clean:fontello'
]);

/*
* Generate jso.arcgis.com input
*/
grunt.registerTask('jsapioptim', function() {
grunt.task.run('clean');
grunt.task.run('mkdir');
grunt.task.run('requirejs');
grunt.task.run('execute');
grunt.task.run('clean:deploy');
grunt.task.run('copy:jsapioptim');
grunt.task.run('clean:jsapioptim');
grunt.task.run('clean');
grunt.task.run('mkdir');

grunt.task.run('requirejs');
grunt.task.run('execute');

grunt.task.run('clean:deploy');
grunt.task.run('copy:jsapioptim');
grunt.task.run('clean:jsapioptim');
});
};
})();
})();
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "Storymaps-MapSeries",
"version": "1.5.2",
"version": "1.6.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
Expand Down
12 changes: 12 additions & 0 deletions src/app/custom-scripts.js
@@ -0,0 +1,12 @@
define(["dojo/topic"], function(topic) {
/*
* Custom Javascript to be executed while the application is initializing goes here
*/

// The application is ready
topic.subscribe("tpl-ready", function(){
/*
* Custom Javascript to be executed when the application is ready goes here
*/
});
});

0 comments on commit 2cb4678

Please sign in to comment.