init.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* vim: set expandtab sw=4 ts=4 sts=4: */
  2. /**
  3. * Initialises the data required to run Designer, then fires it up.
  4. */
  5. var j_tabs;
  6. var h_tabs;
  7. var contr;
  8. var display_field;
  9. var server;
  10. var db;
  11. var selected_page;
  12. var designer_tables_enabled;
  13. AJAX.registerTeardown('designer/init.js', function () {
  14. $('.trigger').off('click');
  15. });
  16. AJAX.registerOnload('designer/init.js', function () {
  17. $('.trigger').click(function () {
  18. $('.panel').toggle('fast');
  19. $(this).toggleClass('active');
  20. $('#ab').accordion('refresh');
  21. return false;
  22. });
  23. j_tabs = designer_config.scriptTables.j_tabs;
  24. h_tabs = designer_config.scriptTables.h_tabs;
  25. contr = designer_config.scriptContr;
  26. display_field = designer_config.scriptDisplayField;
  27. server = designer_config.server;
  28. db = designer_config.db;
  29. selected_page = designer_config.displayPage;
  30. designer_tables_enabled = designer_config.tablesEnabled;
  31. Main();
  32. if (! designer_tables_enabled) {
  33. DesignerOfflineDB.open(function (success) {
  34. if (success) {
  35. Show_tables_in_landing_page(db);
  36. }
  37. });
  38. }
  39. $('#query_Aggregate_Button').click(function () {
  40. document.getElementById('query_Aggregate').style.display = 'none';
  41. });
  42. $('#query_having_button').click(function () {
  43. document.getElementById('query_having').style.display = 'none';
  44. });
  45. $('#query_rename_to_button').click(function () {
  46. document.getElementById('query_rename_to').style.display = 'none';
  47. });
  48. $('#build_query_button').click(function () {
  49. build_query('SQL Query on Database', 0);
  50. });
  51. $('#query_where_button').click(function () {
  52. document.getElementById('query_where').style.display = 'none';
  53. });
  54. });