Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Created September 24, 2014 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radmiraal/c0cce2db65ee96ee5af0 to your computer and use it in GitHub Desktop.
Save radmiraal/c0cce2db65ee96ee5af0 to your computer and use it in GitHub Desktop.
{
"name": "...",
"dependencies": {
"foundation": "zurb/bower-foundation#5.3.3",
"requirejs": "~2.1.11",
"requirejs-text": "~2.0.12",
"font-awesome": "~4.2.0",
"ckeditor": "*"
}
}
module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-extend-config");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: grunt.file.readJSON('../../../../Build/Grunt/Defaults/compass.json'),
watch: grunt.file.readJSON('../../../../Build/Grunt/Defaults/watch.json'),
requirejs: grunt.file.readJSON('../../../../Build/Grunt/Defaults/requirejs.json'),
concat: grunt.file.readJSON('../../../../Build/Grunt/Defaults/concat.json'),
clean: {
options: {
force: true
},
js: ["../Resources/Public/Scripts/**/*.js", "!../Resources/Public/Scripts/headerIncludes.js", "!../Resources/Public/Scripts/App.js"]
},
copy: {
ckeditor: {
expand: true,
cwd: 'bower_components/',
src: [
'ckeditor/config.js',
'ckeditor/styles.js',
'ckeditor/lang/en.js',
'ckeditor/lang/nl.js',
'ckeditor/contents.css',
'ckeditor/skins/moono/**',
'ckeditor/plugins/clipboard/**',
'ckeditor/plugins/justify/**',
'ckeditor/plugins/link/**',
'ckeditor/plugins/magicline/**',
'ckeditor/plugins/specialchar/**',
'ckeditor/plugins/table/**',
'ckeditor/plugins/tableresize/**'
],
dest: '../Resources/Public/Library/'
}
}
});
grunt.extendConfig({
concat: {
// Libraries
ckeditor: {
src: [
'bower_components/ckeditor/ckeditor.js'
],
dest: '../Resources/Public/Library/ckeditor/ckeditor.js',
options: {
banner: 'define(function() {',
footer: '\nreturn window.CKEDITOR;});'
}
},
jquery: {
src: [
'bower_components/jquery/dist/jquery.js',
'bower_components/foundation/js/foundation/foundation.js',
'bower_components/foundation/js/foundation/foundation.tab.js',
'bower_components/foundation/js/foundation/foundation.topbar.js',
'bower_components/foundation/js/foundation/foundation.reveal.js'
],
dest: '../Resources/Public/Library/jquery.js',
options: {
banner: 'define(function() {',
footer: '\nreturn jQuery;});'
}
},
headerIncludes: {
src: [
'bower_components/modernizr/modernizr.js'
],
dest: '../Resources/Public/Library/headerIncludes.js'
},
mirrorRequirejs: {
expand: true,
flatten: true,
cwd: 'bower_components/',
src: [
'requirejs/require.js',
'requirejs-text/text.js'
],
dest: '../Resources/Public/Library/'
}
}
});
/**
* Load Grunt plugins
*/
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['watch']);
grunt.registerTask('compile-css', ['compass:dist']);
grunt.registerTask('compile-js', ['concat']);
grunt.registerTask('compile', ['compass:dev', 'compile-js', 'copy']);
grunt.registerTask('dist', ['compile-css', 'concat', 'requirejs', 'clean', 'copy']);
};
{
"name": "Techwatch.Ui.Connect",
"description": "Techwatch Ui Connect",
"repository": "none",
"version": "0.0.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-contrib-concat": "*",
"grunt-contrib-compass": "*",
"grunt-contrib-requirejs": "^0.4.4",
"grunt-extend-config": "*",
"matchdep": "^0.3.0",
"grunt-contrib-clean": "*",
"grunt-contrib-copy": "*"
}
}
$('.rte').each(function() {
CKEDITOR.replace(
$(this).attr('id'),
{
plugins: 'a11yhelp,basicstyles,blockquote,clipboard,contextmenu,elementspath,enterkey,entities,floatingspace,format,horizontalrule,htmlwriter,indentlist,justify,link,list,magicline,maximize,pastefromword,pastetext,removeformat,resize,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,toolbar,undo,wsc,wysiwygarea',
toolbarGroups: [
{name: 'clipboard', groups: ['clipboard', 'undo']},
{name: 'editing', groups: ['selection']},
{name: 'links'},
{name: 'insert'},
{name: 'document', groups: ['mode', 'document', 'doctools']},
{name: 'tools'},
'/',
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'align']}
],
removeButtons: 'Underline,Subscript,Superscript,Strike',
format_tags: 'p;h1;h2;h3;pre',
removeDialogTabs: 'image:advanced;link:advanced',
extraPlugins: 'tableresize'
}
);
$(this).parents('form').submit(function(event) {
for (var instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment