table.js (1963B)
1 $(document).ready(function() { 2 anchors.options.visible = 'always'; 3 anchors.add('h3'); 4 5 var table = $('#standard_table').DataTable( { 6 lengthChange: false, 7 ordering: false, 8 paging: config.pagination, 9 autoWidth: true, 10 buttons: [ 11 { 12 text: 'Related columns', 13 action: function ( e, dt, node, config ) { 14 $(".relatedKey").toggle(); 15 this.active( !this.active() ); 16 table.columns.adjust().draw(); 17 } 18 }, 19 { 20 text: 'Constraint', 21 action: function ( e, dt, node, config ) { 22 $(".constraint").toggle(); 23 this.active( !this.active() ); 24 table.columns.adjust().draw(); 25 } 26 }, 27 { 28 extend: 'columnsToggle', 29 columns: '.toggle' 30 } 31 ] 32 33 } ); 34 dataTableExportButtons(table); 35 36 if ($('#indexes_table').length) { 37 var indexes = $('#indexes_table').DataTable({ 38 lengthChange: false, 39 paging: config.pagination, 40 ordering: false 41 }); 42 dataTableExportButtons(indexes); 43 } 44 45 if ($('#check_table').length) { 46 var check = $('#check_table').DataTable( { 47 lengthChange: false, 48 paging: config.pagination, 49 ordering: false 50 } ); 51 dataTableExportButtons(check); 52 } 53 } ); 54 55 56 $(function() { 57 var $imgs = $('img.diagram, object.diagram'); 58 $imgs.css("cursor", "move") 59 $imgs.draggable(); 60 }); 61 62 $.fn.digits = function(){ 63 return this.each(function(){ 64 $(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ") ); 65 }) 66 } 67 68 $(function() { 69 $("#recordNumber").digits(); 70 }); 71 72 var codeElement = document.getElementById("sql-script-codemirror"); 73 var editor = null; 74 if (null != codeElement) { 75 editor = CodeMirror.fromTextArea(codeElement, { 76 lineNumbers: true, 77 mode: 'text/x-sql', 78 indentWithTabs: true, 79 smartIndent: true, 80 lineNumbers: true, 81 matchBrackets: true, 82 autofocus: true, 83 readOnly: true 84 }); 85 }