WIP: Note editing, markdown to html
[oweals/karmaworld.git] / karmaworld / apps / wysihtml5 / static / wysihtml5 / wysihtml-0.4.17 / Gruntfile.js
1 module.exports = function(grunt) {
2
3   "use strict";
4   
5   // List required source files that will be built into wysihtml5x.js
6   var base = [
7     "src/polyfills.js",
8     "src/wysihtml5.js",
9     "node_modules/rangy/lib/rangy-core.js",
10     "node_modules/rangy/lib/rangy-selectionsaverestore.js",
11     "lib/base/base.js",
12     "src/browser.js",
13     "src/lang/array.js",
14     "src/lang/dispatcher.js",
15     "src/lang/object.js",
16     "src/lang/string.js",
17     "src/dom/auto_link.js",
18     "src/dom/class.js",
19     "src/dom/contains.js",
20     "src/dom/convert_to_list.js",
21     "src/dom/copy_attributes.js",
22     "src/dom/copy_styles.js",
23     "src/dom/delegate.js",
24     "src/dom/dom_node.js",
25     "src/dom/get_as_dom.js",
26     "src/dom/get_parent_element.js",
27     "src/dom/get_style.js",
28     "src/dom/get_textnodes.js",
29     "src/dom/has_element_with_tag_name.js",
30     "src/dom/has_element_with_class_name.js",
31     "src/dom/insert.js",
32     "src/dom/insert_css.js",
33     "src/dom/line_breaks.js",
34     "src/dom/observe.js",
35     "src/dom/parse.js",
36     "src/dom/remove_empty_text_nodes.js",
37     "src/dom/rename_element.js",
38     "src/dom/replace_with_child_nodes.js",
39     "src/dom/resolve_list.js",
40     "src/dom/sandbox.js",
41     "src/dom/contenteditable_area.js",
42     "src/dom/set_attributes.js",
43     "src/dom/set_styles.js",
44     "src/dom/simulate_placeholder.js",
45     "src/dom/text_content.js",
46     "src/dom/get_attribute.js",
47     "src/dom/get_attributes.js",
48     "src/dom/is_loaded_image.js",
49     "src/dom/table.js",
50     "src/dom/query.js",
51     "src/dom/compare_document_position.js",
52     "src/dom/unwrap.js",
53     "src/dom/get_pasted_html.js",
54     "src/quirks/clean_pasted_html.js",
55     "src/quirks/ensure_proper_clearing.js",
56     "src/quirks/get_correct_inner_html.js",
57     "src/quirks/redraw.js",
58     "src/quirks/table_cells_selection.js",
59     "src/quirks/style_parser.js",
60     "src/selection/selection.js",
61     "src/selection/html_applier.js",
62     "src/commands.js",
63     "src/commands/bold.js",
64     "src/commands/createLink.js",
65     "src/commands/removeLink.js",
66     "src/commands/fontSize.js",
67     "src/commands/fontSizeStyle.js",
68     "src/commands/foreColor.js",
69     "src/commands/foreColorStyle.js",
70     "src/commands/bgColorStyle.js",
71     "src/commands/formatBlock.js",
72     "src/commands/formatCode.js",
73     "src/commands/formatInline.js",
74     "src/commands/insertBlockQuote.js",
75     "src/commands/insertHTML.js",
76     "src/commands/insertImage.js",
77     "src/commands/insertLineBreak.js",
78     "src/commands/insertOrderedList.js",
79     "src/commands/insertUnorderedList.js",
80     "src/commands/insertList.js",
81     "src/commands/italic.js",
82     "src/commands/justifyCenter.js",
83     "src/commands/justifyLeft.js",
84     "src/commands/justifyRight.js",
85     "src/commands/justifyFull.js",
86     "src/commands/alignRightStyle.js",
87     "src/commands/alignLeftStyle.js",
88     "src/commands/alignCenterStyle.js",
89     "src/commands/redo.js",
90     "src/commands/underline.js",
91     "src/commands/undo.js",
92     "src/commands/createTable.js",
93     "src/commands/mergeTableCells.js",
94     "src/commands/addTableCells.js",
95     "src/commands/deleteTableCells.js",
96     "src/commands/indentList.js",
97     "src/commands/outdentList.js",
98     "src/undo_manager.js",
99     "src/views/view.js",
100     "src/views/composer.js",
101     "src/views/composer.style.js",
102     "src/views/composer.observe.js",
103     "src/views/synchronizer.js",
104     "src/views/textarea.js",
105     "src/editor.js"
106   ];
107   
108   // List of optional source files that will be built to wysihtml5x-toolbar.js
109   var toolbar = [
110     "src/toolbar/dialog.js",
111     "src/toolbar/speech.js",
112     "src/toolbar/toolbar.js",
113     "src/toolbar/dialog_createTable.js",
114     "src/toolbar/dialog_foreColorStyle.js",
115     "src/toolbar/dialog_fontSizeStyle.js"
116   ];
117
118   // Project configuration.
119   grunt.initConfig({
120     pkg: grunt.file.readJSON('package.json'),
121     concat: {
122       options: {
123         separator: ';',
124         process: function(src, filepath) {
125           return src.replace(/@VERSION/g, grunt.config.get('pkg.version'));
126         }
127       },
128       dist: {
129         src: base,
130         dest: 'dist/<%= pkg.name %>.js'
131       },
132       toolbar: {
133         src: base.concat(toolbar),
134         dest: 'dist/<%= pkg.name %>-toolbar.js'
135       }
136     },
137     uglify: {
138       options: {
139         banner: '/*! <%= pkg.name %> - v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) */\n',
140         sourceMap: true
141       },
142       build: {
143         files: {
144           'dist/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.js',
145           'dist/<%= pkg.name %>-toolbar.min.js': 'dist/<%= pkg.name %>-toolbar.js'
146         }
147       }
148     }
149   });
150
151   grunt.loadNpmTasks('grunt-contrib-concat');
152   grunt.loadNpmTasks('grunt-contrib-uglify');
153
154   grunt.registerTask('default', ['concat', 'uglify']);
155 };