From c2245364728eff44438b6d3bcf079195dd2572c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 21 Sep 2017 22:25:15 -0500 Subject: [PATCH] Fix indents --- public/assets/js/glass-core.js | 172 +++++++++++++++++---------------- 1 file changed, 87 insertions(+), 85 deletions(-) diff --git a/public/assets/js/glass-core.js b/public/assets/js/glass-core.js index ff08ded..7708d28 100644 --- a/public/assets/js/glass-core.js +++ b/public/assets/js/glass-core.js @@ -13,23 +13,23 @@ var loader_html = '
\
\ '; -$( document ).ready(function() { - remove_init_form(); +$(document).ready(function () { + remove_init_form(); }); /* * When a sidebar item is clicked in mobile - let's make sure we push the sidebar back in */ -$(document).on('on_pjax_complete',function(){ - if($('.ls-closed').length > 0){ - $('body').removeClass('overlay-open'); - $('.overlay').css("display", "none"); - } +$(document).on('on_pjax_complete', function () { + if ($('.ls-closed').length > 0) { + $('body').removeClass('overlay-open'); + $('.overlay').css("display", "none"); + } - /* - * Form input focus event - */ + /* + * Form input focus event + */ $('.form-control').focus(function () { $(this).parent().addClass('focused'); }); @@ -38,7 +38,9 @@ $(document).on('on_pjax_complete',function(){ $('.form-control').focusout(function () { var $this = $(this); if ($this.parents('.form-group').hasClass('form-float')) { - if ($this.val() == '') { $this.parents('.form-line').removeClass('focused'); } + if ($this.val() == '') { + $this.parents('.form-line').removeClass('focused'); + } } else { $this.parents('.form-line').removeClass('focused'); @@ -62,113 +64,113 @@ $(document).on('on_pjax_complete',function(){ remove_init_form(); }); -function remove_init_form(){ - setTimeout(function(){ +function remove_init_form() { + setTimeout(function () { $('.form-line').removeClass("focused"); }, 10); } -function modal (title, content, buttons) { - $('#modal-buttons').html(''); - $('#modal-title').html(title); - $('#modal-body').html(content); +function modal(title, content, buttons) { + $('#modal-buttons').html(''); + $('#modal-title').html(title); + $('#modal-body').html(content); - // - if(buttons != '') { - $('#modal-buttons').html(buttons); - } - $('#mdModal').modal('show'); + // + if (buttons != '') { + $('#modal-buttons').html(buttons); + } + $('#mdModal').modal('show'); } -function get_form_query_string(form_id){ - query_string = ""; - $('#' + form_id).find('input, select, textarea').each(function (key) { - val = $(this).val(); - if (val == 'undefined') { - val = ''; - } - if($(this).attr('type') == "checkbox"){ - if (!$(this).is(':checked')) { - val = 0; - } - } - query_string = query_string + "&" + $(this).attr('id') + "=" + encodeURIComponent(val); - }); - return query_string; +function get_form_query_string(form_id) { + query_string = ""; + $('#' + form_id).find('input, select, textarea').each(function (key) { + val = $(this).val(); + if (val == 'undefined') { + val = ''; + } + if ($(this).attr('type') == "checkbox") { + if (!$(this).is(':checked')) { + val = 0; + } + } + query_string = query_string + "&" + $(this).attr('id') + "=" + encodeURIComponent(val); + }); + return query_string; } function save_config() { - glass_settings = get_form_query_string("glass-settings-form"); + glass_settings = get_form_query_string("glass-settings-form"); - $.post( "/glass_settings_save", glass_settings, function( data ) { - $( "#glass_settings_result" ).html( data ); - }); + $.post("/glass_settings_save", glass_settings, function (data) { + $("#glass_settings_result").html(data); + }); } -function notification(text){ - colorName = 'bg-black'; - animateEnter = 'animated fadeInDown'; - animateExit = 'animated fadeOutUp'; - var allowDismiss = true; +function notification(text) { + colorName = 'bg-black'; + animateEnter = 'animated fadeInDown'; + animateExit = 'animated fadeOutUp'; + var allowDismiss = true; - $.notify({ - message: text - }, - { - type: colorName, - allow_dismiss: allowDismiss, - newest_on_top: true, - timer: 1000, - animate: { - enter: animateEnter, - exit: animateExit - }, - template: '' - }); + $.notify({ + message: text + }, + { + type: colorName, + allow_dismiss: allowDismiss, + newest_on_top: true, + timer: 1000, + animate: { + enter: animateEnter, + exit: animateExit + }, + template: '' + }); } function change_favicon(img) { - var favicon = document.querySelector('link[rel="shortcut icon"]'); + var favicon = document.querySelector('link[rel="shortcut icon"]'); - if (!favicon) { - favicon = document.createElement('link'); - favicon.setAttribute('rel', 'shortcut icon'); - var head = document.querySelector('head'); - head.appendChild(favicon); - } + if (!favicon) { + favicon = document.createElement('link'); + favicon.setAttribute('rel', 'shortcut icon'); + var head = document.querySelector('head'); + head.appendChild(favicon); + } - favicon.setAttribute('type', 'image/png'); - favicon.setAttribute('href', img); + favicon.setAttribute('type', 'image/png'); + favicon.setAttribute('href', img); } -$(document).on("click",".option_data",function() { +$(document).on("click", ".option_data", function () { var lease = $(this).attr("lease"); - if ( $("#" + lease).is(":visible") ) { + if ($("#" + lease).is(":visible")) { $("#" + lease).hide(); $(this).text('Show'); - } else if ( $("#" + lease).is(":hidden") ) { + } else if ($("#" + lease).is(":hidden")) { $("#" + lease).show(); $(this).text('Hide'); } }); -$(document).on("keypress","#lease_search_criteria", function(e) { +$(document).on("keypress", "#lease_search_criteria", function (e) { if (e.which == 13) { $('#search_result').html(loader_html); - $.post("/dhcp_lease_search", { search: $("#lease_search_criteria").val() }, function(result) { + $.post("/dhcp_lease_search", {search: $("#lease_search_criteria").val()}, function (result) { $("#search_result").html(result); - if(typeof display_leases !== "undefined") - display_leases.destroy(); + if (typeof display_leases !== "undefined") + display_leases.destroy(); display_leases = $('#display-leases').DataTable({ dom: 'tip',