Changeset - cc2c473abc5f
[Not reviewed]
default
4 7 0
Mads Kiilerich (mads) - 7 years ago 2018-12-10 22:47:01
mads@kiilerich.com
front-end: Use DataTables from node_modules and stop bundling it

There is no minimized version in the npm package. For now, we just use the raw
one. We can minimize later.
11 files changed with 16 insertions and 993 deletions:
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
@@ -30,6 +30,8 @@ syntax: regexp
 
^kallithea/public/css/style\.css$
 
^kallithea/public/css/style\.css\.map$
 
^kallithea/public/js/bootstrap\.js$
 
^kallithea/public/js/dataTables\.bootstrap\.js$
 
^kallithea/public/js/jquery\.dataTables\.js$
 
^kallithea/public/js/jquery\.flot\.js$
 
^kallithea/public/js/jquery\.flot\.selection\.js$
 
^kallithea/public/js/jquery\.flot\.time\.js$
LICENSE.md
Show inline comments
 
@@ -87,15 +87,15 @@ using the ''kallithea-cli front-end-buil
 
DataTables
 
----------
 

	
 
Kallithea incorporates the Javascript system called
 
[DataTables](http://www.datatables.net/)
 
which can be found together with their Corresponding Source in
 
https://github.com/DataTables/DataTables at tag 1.10.13 (mirrored at
 
https://kallithea-scm.org/repos/mirror/DataTables/files/1.10.13/ ).
 
Kallithea uses the Javascript system called
 
[DataTables](http://www.datatables.net/).
 

	
 
It is Copyright 2008-2015 SpryMedia Ltd. and is under an
 
[MIT-permissive license](MIT-Permissive-License.txt).
 

	
 
It is not distributed with Kallithea, but will be downloaded
 
using the ''kallithea-cli front-end-build'' command.
 

	
 

	
 

	
 
Mergely
kallithea/bin/kallithea_cli_front_end.py
Show inline comments
 
@@ -72,6 +72,10 @@ def front_end_build(install_deps, genera
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.selection.js'), os.path.join(public_dir, 'js', 'jquery.flot.selection.js'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.time.js'), os.path.join(public_dir, 'js', 'jquery.flot.time.js'))
 

	
 
        click.echo("Preparing DataTables JS")
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net', 'js', 'jquery.dataTables.js'), os.path.join(public_dir, 'js', 'jquery.dataTables.js'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net-bs', 'js', 'dataTables.bootstrap.js'), os.path.join(public_dir, 'js', 'dataTables.bootstrap.js'))
 

	
 
        click.echo("Preparing Select2 JS")
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.js'), os.path.join(public_dir, 'js', 'select2.js'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.png'), os.path.join(public_dir, 'css', 'select2.png'))
kallithea/front-end/package.json
Show inline comments
 
@@ -3,6 +3,8 @@
 
  "private": true,
 
  "dependencies": {
 
    "bootstrap": "3.3.7",
 
    "datatables.net": "1.10.13",
 
    "datatables.net-bs": "1.10.13",
 
    "jquery": "1.12.3",
 
    "jquery.flot": "0.8.3",
 
    "select2": "3.5.1",
kallithea/public/css/jquery.dataTables.css
Show inline comments
 
deleted file
kallithea/public/js/dataTables.bootstrap.js
Show inline comments
 
deleted file
kallithea/public/js/jquery.dataTables.min.js
Show inline comments
 
deleted file
kallithea/public/less/3rd-party/dataTables.bootstrap.css
Show inline comments
 
deleted file
kallithea/public/less/main.less
Show inline comments
 
@@ -10,7 +10,7 @@
 

	
 
/* 3rd party styles */
 
@import "node_modules/bootstrap/less/bootstrap.less";
 
@import (inline) "3rd-party/dataTables.bootstrap.css";
 
@import (inline) "node_modules/datatables.net-bs/css/dataTables.bootstrap.css";
 
@import (less) "node_modules/select2/select2.css";
 
@import (less) "node_modules/select2-bootstrap-css/select2-bootstrap.css";
 
@import (less) "tmp/pygments.css";
kallithea/templates/base/root.html
Show inline comments
 
@@ -69,7 +69,7 @@
 
        </script>
 
        <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/jquery.min.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/jquery.dataTables.min.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/jquery.dataTables.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/dataTables.bootstrap.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/bootstrap.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript" src="${h.url('/js/select2.js', ver=c.kallithea_version)}"></script>
scripts/whitespacecleanup.sh
Show inline comments
 
@@ -2,7 +2,7 @@
 

	
 
# Enforce some consistency in whitespace - just to avoid spurious whitespaces changes
 

	
 
files=`hg mani | egrep -v '/codemirror/|/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9|jquery.dataTables)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 
files=`hg mani | egrep -v '/codemirror/|/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 

	
 
sed -i "s/`printf '\r'`//g" $files
 
sed -i -e "s,`printf '\t'`,    ,g" $files
0 comments (0 inline, 0 general)