Skip to content

Commit

Permalink
[close #488] Restructure static files
Browse files Browse the repository at this point in the history
- remove static/ from version control
- remove ddionrails-visualization from dependencies
- add d3.js to dependencies
- move static assets from static/src/ to assets/ directory
- update webpack.config.js
- build multiple webpack bundles
  • Loading branch information
afuetterer committed May 29, 2019
1 parent d660a3a commit 30bfc7a
Show file tree
Hide file tree
Showing 18 changed files with 2,119 additions and 1,778 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -136,8 +136,8 @@ nohup.out
node_modules/

# Static files
/ddionrails/static/background.png
/ddionrails/static/dist/*
static/*
!static/.gitkeep

webpack-stats.json

Expand Down
6 changes: 3 additions & 3 deletions static/src/js/main.js → assets/js/basket_button.js
@@ -1,6 +1,6 @@
/*!
* ddionrails - main.js
* Copyright 2015-2018
* ddionrails - basket_button.js
* Copyright 2015-2019
* Licensed under AGPL (https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md)
*/

Expand Down Expand Up @@ -54,4 +54,4 @@ $(function() {
$(".datatable").DataTable();
});

export { basketButton };
export { basketButton };
19 changes: 19 additions & 0 deletions assets/js/index.js
@@ -0,0 +1,19 @@
/*!
* ddionrails - index.js
* Copyright 2018-2019
* Licensed under AGPL (https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md)
*/

require("../scss/index.scss");

import "bootstrap";
import "datatables.net";
import "datatables.net-bs";
import "datatables.net-responsive";
import "datatables.net-responsive-bs";

// Credit to https://stackoverflow.com/q/44484469
window["jQuery"] = window["$"] = require("jquery");

import { basketButton } from "./basket_button.js";
window.basketButton = basketButton;
27 changes: 26 additions & 1 deletion static/src/js/topic_list.js → assets/js/topics.js
@@ -1,14 +1,31 @@
/***
/*!
* ddionrails - topics.js
* Copyright 2018-2019
* Licensed under AGPL (https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md)
*
* Topic List
*
* This script visualizes a tree structure of topics and their concepts, questions and variables using the fancytree library.
* Make sure you set study and language variable in template, else api calls will not work.
*
* @author cstolpe
*
*
*/


import "bootstrap";
import "datatables.net";
import "datatables.net-bs";
import "datatables.net-responsive";
import "datatables.net-responsive-bs";

// Credit to https://github.com/mar10/fancytree/issues/793
import "jquery.fancytree";
import "jquery.fancytree/dist/modules/jquery.fancytree.filter";
import "jquery.fancytree/dist/modules/jquery.fancytree.glyph";


$.ui.fancytree.debugLevel = 0; // set debug level; 0:quiet, 1:info, 2:debug

// Get current URL to read 'open' Parameter for opening specified node
Expand Down Expand Up @@ -253,3 +270,11 @@ function copy_url_to_clipboard(el) {
$(el).attr('title', 'Copy URL').tooltip('fixTitle');
}, 1000)
}


window.filter = filter;
window.removeAsyncLoadedData = removeAsyncLoadedData;
window.removeAllChildren = removeAllChildren;
window.addToBasket = addToBasket;
window.addToBasketRequest = addToBasketRequest;
window.copy_url_to_clipboard = copy_url_to_clipboard;

0 comments on commit 30bfc7a

Please sign in to comment.