2 * Initialises the data required to run Designer, then fires it up.
5 /* global DesignerOfflineDB */ // js/designer/database.js
6 /* global DesignerHistory */ // js/designer/history.js
7 /* global DesignerMove */ // js/designer/move.js
8 /* global DesignerPage */ // js/designer/page.js
9 /* global designerConfig */ // templates/database/designer/main.twig
11 /* eslint-disable no-unused-vars */
18 /* eslint-enable no-unused-vars */
21 var designerTablesEnabled;
23 AJAX.registerTeardown('designer/init.js', function () {
24 $('.trigger').off('click');
27 AJAX.registerOnload('designer/init.js', function () {
28 $('.trigger').on('click', function () {
29 $('.panel').toggle('fast');
30 $(this).toggleClass('active');
31 $('#ab').accordion('refresh');
35 jTabs = designerConfig.scriptTables.j_tabs;
36 hTabs = designerConfig.scriptTables.h_tabs;
37 contr = designerConfig.scriptContr;
38 displayField = designerConfig.scriptDisplayField;
40 server = designerConfig.server;
41 db = designerConfig.db;
42 selectedPage = designerConfig.displayPage;
43 designerTablesEnabled = designerConfig.tablesEnabled;
47 if (! designerTablesEnabled) {
48 DesignerOfflineDB.open(function (success) {
50 DesignerPage.showTablesInLandingPage(db);
55 $('#query_Aggregate_Button').on('click', function () {
56 $('#query_Aggregate').style.display = 'none';
59 $('#query_having_button').on('click', function () {
60 $('#query_having').style.display = 'none';
63 $('#query_rename_to_button').on('click', function () {
64 $('#query_rename_to').style.display = 'none';
67 $('#build_query_button').on('click', function () {
68 DesignerHistory.buildQuery('SQL Query on Database', 0);
71 $('#query_where_button').on('click', function () {
72 $('#query_where').style.display = 'none';