1 module.exports = function(grunt) {
5 // List required source files that will be built into wysihtml5x.js
9 "node_modules/rangy/lib/rangy-core.js",
10 "node_modules/rangy/lib/rangy-selectionsaverestore.js",
14 "src/lang/dispatcher.js",
17 "src/dom/auto_link.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",
32 "src/dom/insert_css.js",
33 "src/dom/line_breaks.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",
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",
51 "src/dom/compare_document_position.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",
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",
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",
108 // List of optional source files that will be built to wysihtml5x-toolbar.js
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"
118 // Project configuration.
120 pkg: grunt.file.readJSON('package.json'),
124 process: function(src, filepath) {
125 return src.replace(/@VERSION/g, grunt.config.get('pkg.version'));
130 dest: 'dist/<%= pkg.name %>.js'
133 src: base.concat(toolbar),
134 dest: 'dist/<%= pkg.name %>-toolbar.js'
139 banner: '/*! <%= pkg.name %> - v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) */\n',
144 'dist/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.js',
145 'dist/<%= pkg.name %>-toolbar.min.js': 'dist/<%= pkg.name %>-toolbar.js'
151 grunt.loadNpmTasks('grunt-contrib-concat');
152 grunt.loadNpmTasks('grunt-contrib-uglify');
154 grunt.registerTask('default', ['concat', 'uglify']);