##// END OF EJS Templates
front-end: Use the existing bootstrap.js from node_modules and stop bundling Bootstrap
Mads Kiilerich -
r7382:585dee5e default
parent child Browse files
Show More
@@ -1,37 +1,38 b''
1 1 syntax: glob
2 2 *.pyc
3 3 *.swp
4 4 *.sqlite
5 5 *.tox
6 6 *.egg-info
7 7 *.egg
8 8 *.mo
9 9 .eggs/
10 10 tarballcache/
11 11
12 12 syntax: regexp
13 13 ^rcextensions
14 14 ^build
15 15 ^dist/
16 16 ^docs/build/
17 17 ^docs/_build/
18 18 ^data$
19 19 ^sql_dumps/
20 20 ^\.settings$
21 21 ^\.project$
22 22 ^\.pydevproject$
23 23 ^\.coverage$
24 24 ^kallithea/front-end/node_modules$
25 25 ^kallithea/front-end/package-lock\.json$
26 26 ^kallithea/front-end/tmp$
27 27 ^kallithea/public/css/style\.css(\.map)?$
28 ^kallithea/public/js/bootstrap\.js$
28 29 ^theme\.less$
29 30 ^kallithea\.db$
30 31 ^test\.db$
31 32 ^Kallithea\.egg-info$
32 33 ^my\.ini$
33 34 ^fabfile.py
34 35 ^\.idea$
35 36 ^\.cache$
36 37 ^\.pytest_cache$
37 38 /__pycache__$
@@ -1,302 +1,302 b''
1 1 Kallithea License
2 2 =================
3 3
4 4 Kallithea as a whole is copyrighted by various authors and is licensed under
5 5 the terms of the GNU General Public License, version 3 (GPLv3), which is a
6 6 license published by the Free Software Foundation,
7 7 Inc. [A copy of GPLv3](/COPYING) is included herein.
8 8
9 9 Some individual files have copyright notices and those who offer changes to
10 10 those files should update the copyright notices in those specific files if
11 11 they so chose.
12 12
13 13 However, the definitive list of copyright holders for this project is kept in
14 14 [the about page template](kallithea/templates/about.html) so that it is
15 15 displayed appropriately when Kallithea is installed. This is the most
16 16 important place to update copyright notices.
17 17
18 18 Third-Party Code Incorporated in Kallithea
19 19 ==========================================
20 20
21 21 Various third-party code under GPLv3-compatible licenses is included as part
22 22 of Kallithea.
23 23
24 24
25 25 Alembic
26 26 -------
27 27
28 28 Kallithea incorporates an [Alembic](http://alembic.zzzcomputing.com/en/latest/)
29 29 "migration environment" in `kallithea/alembic`, portions of which is:
30 30
31 31 Copyright © 2009-2016 by Michael Bayer.
32 32 Alembic is a trademark of Michael Bayer.
33 33
34 34 and licensed under the MIT-permissive license, which is
35 35 [included in this distribution](MIT-Permissive-License.txt).
36 36
37 37
38 38 Bootstrap
39 39 ---------
40 40
41 Kallithea incorporates the web framework called
41 Kallithea uses the web framework called
42 42 [Bootstrap](http://getbootstrap.com/), which is:
43 43
44 44 Copyright © 2011-2016 Twitter, Inc.
45 45
46 46 and licensed under the MIT-permissive license, which is
47 [included in this distribution](MIT-Permissive-License.txt),
48 which can be found together with its Corresponding Source in
49 https://github.com/twbs/bootstrap at tag v3.3.7 (mirrored at
50 https://kallithea-scm.org/repos/mirror/bootstrap/ ).
47 [included in this distribution](MIT-Permissive-License.txt).
48
49 It is not distributed with Kallithea, but will be downloaded
50 using the ''kallithea-cli front-end-build'' command.
51 51
52 52
53 53
54 54 Codemirror
55 55 ----------
56 56
57 57 Kallithea incorporates parts of the Javascript system called
58 58 [Codemirror](http://codemirror.net/), version 4.7.0, which is primarily:
59 59
60 60 Copyright &copy; 2013-2014 by Marijn Haverbeke <marijnh@gmail.com>
61 61
62 62 and licensed under the MIT-permissive license, which is
63 63 [included in this distribution](MIT-Permissive-License.txt).
64 64
65 65 Additional files from upstream Codemirror are copyrighted by various authors
66 66 and licensed under other permissive licenses. The sub-directories under
67 67 [.../public/codemirror](kallithea/public/codemirror) include the copyright and
68 68 license notice and information as they appeared in Codemirror's upstream
69 69 release.
70 70
71 71
72 72
73 73 jQuery
74 74 ------
75 75
76 76 Kallithea incorporates the Javascript system called
77 77 [jQuery](http://jquery.org/), [herein](kallithea/public/js/jquery.min.js),
78 78 which can be found together with its Corresponding Source in
79 79 https://github.com/jquery/jquery at tag 1.12.3 (mirrored at
80 80 https://kallithea-scm.org/repos/mirror/jquery/files/1.12.3/ ).
81 81
82 82 It is Copyright 2013 jQuery Foundation and other contributors http://jquery.com/ and is under an
83 83 [MIT-permissive license](MIT-Permissive-License.txt).
84 84
85 85
86 86
87 87 DataTables
88 88 ----------
89 89
90 90 Kallithea incorporates the Javascript system called
91 91 [DataTables](http://www.datatables.net/)
92 92 which can be found together with their Corresponding Source in
93 93 https://github.com/DataTables/DataTables at tag 1.10.13 (mirrored at
94 94 https://kallithea-scm.org/repos/mirror/DataTables/files/1.10.13/ ).
95 95
96 96 It is Copyright 2008-2015 SpryMedia Ltd. and is under an
97 97 [MIT-permissive license](MIT-Permissive-License.txt).
98 98
99 99
100 100
101 101 Mergely
102 102 -------
103 103
104 104 Kallithea incorporates some code from the Javascript system called
105 105 [Mergely](http://www.mergely.com/), version 3.3.9.
106 106 [Mergely's license](http://www.mergely.com/license.php), a
107 107 [copy of which is included in this repository](LICENSE-MERGELY.html),
108 108 is (GPL|LGPL|MPL). Kallithea as GPLv3'd project chooses the GPL arm of that
109 109 tri-license.
110 110
111 111
112 112
113 113 Select2
114 114 -------
115 115
116 116 Kallithea incorporates parts of the Javascript system called
117 117 [Select2](http://ivaynberg.github.io/select2/), which is:
118 118
119 119 Copyright 2012 Igor Vaynberg (and probably others)
120 120
121 121 and is licensed [under the following license](https://github.com/ivaynberg/select2/blob/master/LICENSE):
122 122
123 123 > This software is licensed under the Apache License, Version 2.0 (the
124 124 > "Apache License") or the GNU General Public License version 2 (the "GPL
125 125 > License"). You may choose either license to govern your use of this
126 126 > software only upon the condition that you accept all of the terms of either
127 127 > the Apache License or the GPL License.
128 128
129 129 A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
130 130 in this distribution.
131 131
132 132 Kallithea will take the Apache license fork of the dual license, since
133 133 Kallithea is GPLv3'd.
134 134
135 135
136 136
137 137 Select2-Bootstrap-CSS
138 138 ---------------------
139 139
140 140 Kallithea incorporates some CSS from a system called
141 141 [Select2-bootstrap-css](https://github.com/t0m/select2-bootstrap-css), which
142 142 is:
143 143
144 144 Copyright &copy; 2013 Tom Terrace (and likely others)
145 145
146 146 and licensed under the MIT-permissive license, which is
147 147 [included in this distribution](MIT-Permissive-License.txt).
148 148
149 149
150 150
151 151 History.js
152 152 ----------
153 153
154 154 Kallithea incorporates some CSS from a system called History.js, which is
155 155
156 156 Copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
157 157
158 158 Redistribution and use in source and binary forms, with or without
159 159 modification, are permitted provided that the following conditions are met:
160 160
161 161 1. Redistributions of source code must retain the above copyright notice,
162 162 this list of conditions and the following disclaimer.
163 163
164 164 2. Redistributions in binary form must reproduce the above copyright notice,
165 165 this list of conditions and the following disclaimer in the documentation
166 166 and/or other materials provided with the distribution.
167 167
168 168 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
169 169 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
170 170 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
171 171 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
172 172 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
173 173 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
174 174 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
175 175 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
176 176 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
177 177 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
178 178 POSSIBILITY OF SUCH DAMAGE.
179 179
180 180
181 181
182 182 YUI
183 183 ---
184 184
185 185 Kallithea incorporates parts of the Javascript system called
186 186 [YUI 2 — Yahoo! User Interface Library](http://yui.github.io/yui2/docs/yui_2.9.0_full/),
187 187 which is made available under the [BSD License](http://yuilibrary.com/license/):
188 188
189 189 Copyright &copy; 2013 Yahoo! Inc. All rights reserved.
190 190
191 191 Redistribution and use of this software in source and binary forms, with or
192 192 without modification, are permitted provided that the following conditions are
193 193 met:
194 194
195 195 * Redistributions of source code must retain the above copyright notice, this
196 196 list of conditions and the following disclaimer.
197 197
198 198 * Redistributions in binary form must reproduce the above copyright notice,
199 199 this list of conditions and the following disclaimer in the documentation
200 200 and/or other materials provided with the distribution.
201 201
202 202 * Neither the name of Yahoo! Inc. nor the names of YUI's contributors may be
203 203 used to endorse or promote products derived from this software without
204 204 specific prior written permission of Yahoo! Inc.
205 205
206 206 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
207 207 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
208 208 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
209 209 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
210 210 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
211 211 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
212 212 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
213 213 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
214 214 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
215 215 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
216 216
217 217
218 218 Kallithea includes a minified version of YUI 2.9. To build yui.2.9.js:
219 219
220 220 git clone https://github.com/yui/builder
221 221 git clone https://github.com/yui/yui2
222 222 cd yui2/
223 223 git checkout hudson-yui2-2800
224 224 ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
225 225 rm -f tmp.js
226 226 for m in yahoo event dom animation datasource autocomplete event-delegate; do
227 227 rm -f build/$m/$m.js
228 228 ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
229 229 done
230 230 java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js
231 231
232 232 In compliance with GPLv3 the Corresponding Source for this Object Code is made
233 233 available on
234 234 [https://kallithea-scm.org/repos/mirror](https://kallithea-scm.org/repos/mirror).
235 235
236 236
237 237
238 238 YUI Flot
239 239 --------
240 240
241 241 Kallithea incorporates some CSS from a system called
242 242 [Flot](http://code.google.com/p/flot/), which is:
243 243
244 244 Copyright 2006 Google Inc.
245 245
246 246 Licensed under the Apache License, Version 2.0 (the "License");
247 247 you may not use this file except in compliance with the License.
248 248
249 249 A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
250 250 in this distribution.
251 251
252 252
253 253
254 254 Flot
255 255 ----
256 256
257 257 Kallithea incorporates some parts of a Javascript system called
258 258 [Flot](http://www.flotcharts.org/), which is:
259 259
260 260 Copyright (c) 2007-2014 IOLA and Ole Laursen
261 261
262 262 Permission is hereby granted, free of charge, to any person
263 263 obtaining a copy of this software and associated documentation
264 264 files (the "Software"), to deal in the Software without
265 265 restriction, including without limitation the rights to use,
266 266 copy, modify, merge, publish, distribute, sublicense, and/or sell
267 267 copies of the Software, and to permit persons to whom the
268 268 Software is furnished to do so, subject to the following
269 269 conditions:
270 270
271 271 The above copyright notice and this permission notice shall be
272 272 included in all copies or substantial portions of the Software.
273 273
274 274 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
275 275 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
276 276 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
277 277 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
278 278 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
279 279 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
280 280 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
281 281 OTHER DEALINGS IN THE SOFTWARE.
282 282
283 283
284 284
285 285 Icon fonts
286 286 ----------
287 287
288 288 Kallithea incorporates subsets of both
289 289 [Font Awesome](http://fontawesome.io) and
290 290 [GitHub Octicons](https://octicons.github.com) for icons. Font Awesome is:
291 291
292 292 Copyright (c) 2016, Dave Gandy
293 293
294 294 Octicons is:
295 295
296 296 Copyright (c) 2012-2014 GitHub
297 297
298 298 These two sets are distributed under [SIL OFL 1.1](http://scripts.sil.org/OFL)
299 299 and have been combined into one font called "kallithea."
300 300
301 301
302 302 EOF
@@ -1,83 +1,87 b''
1 1 # -*- coding: utf-8 -*-
2 2 # This program is free software: you can redistribute it and/or modify
3 3 # it under the terms of the GNU General Public License as published by
4 4 # the Free Software Foundation, either version 3 of the License, or
5 5 # (at your option) any later version.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14
15 15 import click
16 16 import kallithea.bin.kallithea_cli_base as cli_base
17 17
18 18 import os
19 import shutil
19 20 import subprocess
20 21 import json
21 22
22 23 import kallithea
23 24
24 25 @cli_base.register_command()
25 26 @click.option('--install-deps/--no-install-deps', default=True,
26 27 help='Skip installation of dependencies, via "npm".')
27 28 @click.option('--generate/--no-generate', default=True,
28 29 help='Skip generation of front-end files.')
29 30 def front_end_build(install_deps, generate):
30 31 """Build the front-end.
31 32
32 33 Install required dependencies for the front-end and generate the necessary
33 34 files. This step is complementary to any 'pip install' step which only
34 35 covers Python dependencies.
35 36
36 37 The installation of front-end dependencies happens via the tool 'npm' which
37 38 is expected to be installed already.
38 39 """
39 40 front_end_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'front-end'))
40 41 public_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'public'))
41 42
42 43 if install_deps:
43 44 click.echo("Running 'npm install' to install front-end dependencies from package.json")
44 45 subprocess.check_call(['npm', 'install'], cwd=front_end_dir)
45 46
46 47 if generate:
47 48 tmp_dir = os.path.join(front_end_dir, 'tmp')
48 49 if not os.path.isdir(tmp_dir):
49 50 os.mkdir(tmp_dir)
50 51
51 click.echo("Generating CSS")
52 click.echo("Building CSS styling based on Bootstrap")
52 53 with open(os.path.join(tmp_dir, 'pygments.css'), 'w') as f:
53 54 subprocess.check_call(['pygmentize',
54 55 '-S', 'default',
55 56 '-f', 'html',
56 57 '-a', '.code-highlight'],
57 58 stdout=f)
58 59 lesscpath = os.path.join(front_end_dir, 'node_modules', '.bin', 'lessc')
59 60 lesspath = os.path.join(public_dir, 'less', 'main.less')
60 61 csspath = os.path.join(public_dir, 'css', 'style.css')
61 62 subprocess.check_call([lesscpath, '--relative-urls', '--source-map',
62 63 '--source-map-less-inline', lesspath, csspath],
63 64 cwd=front_end_dir)
64 65
66 click.echo("Preparing Bootstrap JS")
67 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'bootstrap', 'dist', 'js', 'bootstrap.js'), os.path.join(public_dir, 'js', 'bootstrap.js'))
68
65 69 click.echo("Generating LICENSES.txt")
66 70 check_licensing_json_path = os.path.join(tmp_dir, 'licensing.json')
67 71 licensing_txt_path = os.path.join(public_dir, 'LICENSES.txt')
68 72 subprocess.check_call([
69 73 os.path.join(front_end_dir, 'node_modules', '.bin', 'license-checker'),
70 74 '--json',
71 75 '--out', check_licensing_json_path,
72 76 ], cwd=front_end_dir)
73 77 with open(check_licensing_json_path) as jsonfile:
74 78 rows = json.loads(jsonfile.read())
75 79 with open(licensing_txt_path, 'w') as out:
76 80 out.write("The Kallithea front-end was built using the following Node modules:\n\n")
77 81 for name_version, values in sorted(rows.items()):
78 82 name, version = name_version.rsplit('@', 1)
79 83 line = "%s from https://www.npmjs.com/package/%s/v/%s\n License: %s\n Repository: %s\n" % (
80 84 name_version, name, version, values['licenses'], values.get('repository', '-'))
81 85 if values.get('copyright'):
82 86 line += " Copyright: %s\n" % (values['copyright'])
83 87 out.write(line + '\n')
1 NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (6757 lines changed) Show them Hide them
1 NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (2377 lines changed) Show them Hide them
General Comments 0
You need to be logged in to leave comments. Login now