From 5c857029ce2e09c076445683bc84ee247bb8a0b3 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 6 Sep 2013 15:03:39 -0400 Subject: [PATCH] Merged the JS from config.js and events.js into main.js --- web/app/webroot/js/config.js | 5 ----- web/app/webroot/js/events.js | 13 ------------- web/app/webroot/js/main.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 18 deletions(-) delete mode 100644 web/app/webroot/js/config.js delete mode 100644 web/app/webroot/js/events.js diff --git a/web/app/webroot/js/config.js b/web/app/webroot/js/config.js deleted file mode 100644 index 3d9768007..000000000 --- a/web/app/webroot/js/config.js +++ /dev/null @@ -1,5 +0,0 @@ -$(document).ready(function() { - $("#tabs").tabs(); - $(document).tooltip({ track:true }); - $('#tabs .row:even').addClass('highlight'); -}); diff --git a/web/app/webroot/js/events.js b/web/app/webroot/js/events.js deleted file mode 100644 index ac3fe32d2..000000000 --- a/web/app/webroot/js/events.js +++ /dev/null @@ -1,13 +0,0 @@ -$(document).ready(function() { - $( "#selectable" ).selectable({ - stop: function() { - $base_url = '/events/index/'; - $( ".ui-selected", this ).each(function() { - var index = $( "#selectable li" ).index( this ); - $monitor_id = $(this).attr('id').split('_'); - $base_url = $base_url + 'MonitorId:'+$monitor_id[1]+'/'; - }); - $('#Events').load($base_url + ' #Events'); - } - }); -}); diff --git a/web/app/webroot/js/main.js b/web/app/webroot/js/main.js index 99ce758fd..fe5eddcce 100644 --- a/web/app/webroot/js/main.js +++ b/web/app/webroot/js/main.js @@ -155,5 +155,40 @@ $(document).ready(function() { $('#loadingDiv').hide(); }); // Global // + + // Monitors // + $(".functions").buttonset(); + $(".status").button() + .click(function() { + if ( $(this).text() == 'Enabled' ) { + $status = 0; + } else { + $status = 1; + } + $mid = $(this).attr('id').split("_")[0]; + $.post("/Monitors/index/", { status: $status, mid: $mid }, function(data) { + console.log(data); + }); + }); + + $("#ConfigIndexForm").submit(function() { + var formData = $(this).serialize(); + var formUrl = $(this).attr('action'); + + $.ajax({ + type: 'POST', + url: formUrl, + data: formData, + success: function(data){ + console.log(data); + }, + error: function(xhr, textStatus, error){ + console.log(textStatus); + } + }); + }); + return false; + + // Monitors // });