Skip to content

Commit

Permalink
feat(package): bundle Trumbowyg WYSIWYG JavaScript editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Kristian Flaatten committed Apr 29, 2016
1 parent e4e5dd0 commit e5b26ca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.env
coverage
static/css
static/js/semantic-ui.js
static/js/bundle.js
static/images/icons.svg
33 changes: 26 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ module.exports = function(grunt) {
},
},

copy: {
dist: {
files: [{
src: 'node_modules/trumbowyg/dist/ui/icons.svg',
dest: 'static/images/icons.svg',
flatten: true,
filter: 'isFile',
}],
},
},

less: {
development: {
dist: {
options: {
paths: ['node_modules/semantic-ui-less'],
},
Expand All @@ -31,21 +42,29 @@ module.exports = function(grunt) {
options: {
separator: ';',
},
dist: {
js: {
src: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/clipboard/dist/clipboard.min.js',
'node_modules/jquery/dist/jquery.slim.min.js',
'node_modules/trumbowyg/dist/trumbowyg.min.js',
'node_modules/semantic-ui-less/definitions/**/*.js',
],
dest: 'static/js/semantic-ui.js',
dest: 'static/js/bundle.js',
},
css: {
src: [
'node_modules/trumbowyg/dist/ui/trumbowyg.min.css',
],
dest: 'static/css/bundle.css',
},
},

});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['concat', 'less']);
grunt.registerTask('default', ['less', 'copy', 'concat']);
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-less": "^1.3.0",
"ioredis": "^1.15.1",
"jquery": "^2.2.3",
"moment": "^2.13.0",
"mongoose": "^4.4.13",
"nunjucks": "^2.4.2",
"oauth": "^0.9.14",
"semantic-ui-less": "^2.1.8"
"semantic-ui-less": "^2.1.8",
"trumbowyg": "^2.0.5"
},
"engines": {
"node": "^4.0.0"
Expand Down
3 changes: 2 additions & 1 deletion views/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="author" content="">

<link rel="icon" href="/static/images/logo.png">
<link href="/static/css/bundle.css" rel="stylesheet" type="text/css">
<link href="/static/css/app.css" rel="stylesheet" type="text/css">

<title>{% block title %}Nasjonal Turbase Developer{% endblock %}</title>
Expand All @@ -25,7 +26,7 @@

{% include "footer.html" %}

<script src="/static/js/semantic-ui.js"></script>
<script src="/static/js/bundle.js"></script>
<script src="/static/js/app.js"></script>

{% block footer %}{% endblock %}
Expand Down

0 comments on commit e5b26ca

Please sign in to comment.