From 17b20ab6849bd89624027c8c3a2a0305bd6b6f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Wed, 20 Nov 2013 11:31:23 +0000 Subject: [PATCH] A cuople more fixes && refactoring --- server/src/uds/static/adm/css/uds-admin.css | 7 +- server/src/uds/static/adm/js/api-tools.js | 2 +- .../uds/static/adm/js/dataTables.bootstrap.js | 2 +- server/src/uds/static/adm/js/gui.js | 73 +++++++++++-------- 4 files changed, 50 insertions(+), 34 deletions(-) diff --git a/server/src/uds/static/adm/css/uds-admin.css b/server/src/uds/static/adm/css/uds-admin.css index cb127137e..1014fd69f 100644 --- a/server/src/uds/static/adm/css/uds-admin.css +++ b/server/src/uds/static/adm/css/uds-admin.css @@ -1,8 +1,6 @@ /* Based on 'SB Admin' from http://startbootstrap.com 'SB Admin' HTML Template by Start Bootstrap. - - All Start Bootstrap themes are licensed under Apache 2.0. For more info and more free Bootstrap 3 HTML themes, visit http://startbootstrap.com! */ @@ -48,7 +46,6 @@ body { font-size: 12px; } - /* Nav Announcements */ .announcement-heading { @@ -95,6 +92,10 @@ table.tablesorter thead tr th:hover { .label-tbl-button { display: none; } + +.white { + color: white; +} /* Edit Below to Customize Widths > 768px */ @media (min-width:768px) { diff --git a/server/src/uds/static/adm/js/api-tools.js b/server/src/uds/static/adm/js/api-tools.js index 2d379fc30..809b4b402 100644 --- a/server/src/uds/static/adm/js/api-tools.js +++ b/server/src/uds/static/adm/js/api-tools.js @@ -22,7 +22,7 @@ /* If Mousedown registers a temporal mouseUp event on parent, to lauch button click */ $this.mousedown(function(event){ - $this.parent().mouseup(function(e){ + $('body').mouseup(function(e){ // Remove temporal mouseup handler $(this).unbind('mouseup'); diff --git a/server/src/uds/static/adm/js/dataTables.bootstrap.js b/server/src/uds/static/adm/js/dataTables.bootstrap.js index 382554f4a..32dded492 100644 --- a/server/src/uds/static/adm/js/dataTables.bootstrap.js +++ b/server/src/uds/static/adm/js/dataTables.bootstrap.js @@ -114,7 +114,7 @@ if ($.fn.DataTable.TableTools) { $.extend(true, $.fn.DataTable.TableTools.classes, { "container" : "DTTT btn-group-3d", "buttons" : { - "normal" : "btn btn3d-default", + "normal" : "btn", "disabled" : "disabled" }, "collection" : { diff --git a/server/src/uds/static/adm/js/gui.js b/server/src/uds/static/adm/js/gui.js index 929351dd9..96969c646 100644 --- a/server/src/uds/static/adm/js/gui.js +++ b/server/src/uds/static/adm/js/gui.js @@ -17,28 +17,43 @@ // Several convenience "constants" for tables gui.config.dataTablesLanguage = { - "sLengthMenu" : gettext("_MENU_ records per page"), - "sZeroRecords" : gettext("Empty"), - "sInfo" : gettext("Records _START_ to _END_ of _TOTAL_"), - "sInfoEmpty" : gettext("No records"), - "sInfoFiltered" : gettext("(filtered from _MAX_ total records)"), - "sProcessing" : gettext("Please wait, processing"), - "sSearch" : gettext("Filter"), - "sInfoThousands" : django.formats.THOUSAND_SEPARATOR, - "oPaginate" : { - "sFirst" : gettext("First"), - "sLast" : gettext("Last"), - "sNext" : gettext("Next"), - "sPrevious" : gettext("Previous"), + 'sLengthMenu' : gettext('_MENU_ records per page'), + 'sZeroRecords' : gettext('Empty'), + 'sInfo' : gettext('Records _START_ to _END_ of _TOTAL_'), + 'sInfoEmpty' : gettext('No records'), + 'sInfoFiltered' : gettext('(filtered from _MAX_ total records)'), + 'sProcessing' : gettext('Please wait, processing'), + 'sSearch' : gettext('Filter'), + 'sInfoThousands' : django.formats.THOUSAND_SEPARATOR, + 'oPaginate' : { + 'sFirst' : gettext('First'), + 'sLast' : gettext('Last'), + 'sNext' : gettext('Next'), + 'sPrevious' : gettext('Previous'), } }; - gui.config.dataTableButtonsText = { - 'new': ' ' + gettext('New') + '', - 'edit': ' ' + gettext('Edit') + '', - 'delete': ' ' + gettext('Delete') + '', - 'refresh': ' ' + gettext('Refresh') + '', - 'xls': ' ' + gettext('Xls') + '', + gui.config.dataTableButtons = { + 'new': { + text: ' ' + gettext('New') + '', + css: 'btn3d btn3d-primary btn3d-tables', + }, + 'edit': { + text: ' ' + gettext('Edit') + '', + css: 'disabled btn3d-default btn3d btn3d-tables', + }, + 'delete': { + text: ' ' + gettext('Delete') + '', + css: 'disabled btn3d-default btn3d btn3d-tables', + }, + 'refresh': { + text: ' ' + gettext('Refresh') + '', + css: 'btn3d-primary btn3d btn3d-tables', + }, + 'xls': { + text: ' ' + gettext('Xls') + '', + css: 'btn3d-info btn3d btn3d-tables', + }, }; gui.table = function(title, table_id, options) { @@ -396,42 +411,42 @@ GuiElement.prototype = { case 'new': btn = { "sExtends" : "text", - "sButtonText" : gui.config.dataTableButtonsText['new'], + "sButtonText" : gui.config.dataTableButtons['new'].text, "fnSelect" : deleteSelected, "fnClick" : clickHandlerFor(options.onDelete, 'delete'), - "sButtonClass" : "disabled btn3d btn3d-tables" + "sButtonClass" : gui.config.dataTableButtons['new'].css, }; break; case 'edit': btn = { "sExtends" : "text", - "sButtonText" : gui.config.dataTableButtonsText['edit'], + "sButtonText" : gui.config.dataTableButtons.edit.text, "fnSelect" : editSelected, "fnClick" : clickHandlerFor(options.onEdit, 'edit'), - "sButtonClass" : "disabled btn3d btn3d-tables" + "sButtonClass" : gui.config.dataTableButtons.edit.css, }; break; case 'delete': btn = { "sExtends" : "text", - "sButtonText" : gui.config.dataTableButtonsText['delete'], + "sButtonText" : gui.config.dataTableButtons['delete'].text, "fnSelect" : deleteSelected, "fnClick" : clickHandlerFor(options.onDelete, 'delete'), - "sButtonClass" : "disabled btn3d btn3d-tables" + "sButtonClass" : gui.config.dataTableButtons['delete'].css, }; break; case 'refresh': btn = { "sExtends" : "text", - "sButtonText" : gui.config.dataTableButtonsText['refresh'], + "sButtonText" : gui.config.dataTableButtons.refresh.text, "fnClick" : refreshFnc, - "sButtonClass" : "btn3d-primary btn3d btn3d-tables" + "sButtonClass" : gui.config.dataTableButtons.refresh.css, }; break; case 'xls': btn = { "sExtends" : "text", - "sButtonText" : gui.config.dataTableButtonsText['xls'], + "sButtonText" : gui.config.dataTableButtons.xls.text, "fnClick" : function(){ api.templates.get('spreadsheet', function(tmpl) { var styles = { 'bold': 's21', }; @@ -471,7 +486,7 @@ GuiElement.prototype = { }, 20); }); }, - "sButtonClass" : "btn3d-info btn3d btn3d-tables" + "sButtonClass" : gui.config.dataTableButtons.xls.css, }; }