From 27a097ada088525821429147a525e2ea095b53e8 Mon Sep 17 00:00:00 2001 From: George Shaw Date: Thu, 23 Nov 2017 12:36:04 -0600 Subject: [PATCH] continued development on managing bundles from the server panel --- .../assets/js/panelHandlers/bundles/manage.js | 6 +- .../js/panelHandlers/bundles/specific/back.js | 6 ++ .../js/panelHandlers/bundles/specific/open.js | 9 +++ server/document_root/gPanel.html | 72 +++++++++++++++++++ 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 server/document_root/assets/js/panelHandlers/bundles/specific/back.js create mode 100644 server/document_root/assets/js/panelHandlers/bundles/specific/open.js diff --git a/server/document_root/assets/js/panelHandlers/bundles/manage.js b/server/document_root/assets/js/panelHandlers/bundles/manage.js index 3fd98d4..e736850 100644 --- a/server/document_root/assets/js/panelHandlers/bundles/manage.js +++ b/server/document_root/assets/js/panelHandlers/bundles/manage.js @@ -10,7 +10,11 @@ jQuery('._js_bundles-manage').on('click', function(e){ xhr.onloadend = function() { if(xhr.status == 200) { if(xhr.response != undefined && xhr.response.length != 0) { - manageBundlesModal.find('.modal-body').html(xhr.response) + manageBundlesModal.find('.modal-body').html('
'); + jsonResponse = JSON.parse(xhr.response) + jQuery.each(jsonResponse, function(k, v) { + manageBundlesModal.find('.modal-body .btn-group').append(''); + }); } else { manageBundlesModal.find('.modal-body').html("An error has occurred. Please try again. If problem persists contact server administrator.") diff --git a/server/document_root/assets/js/panelHandlers/bundles/specific/back.js b/server/document_root/assets/js/panelHandlers/bundles/specific/back.js new file mode 100644 index 0000000..d029ff0 --- /dev/null +++ b/server/document_root/assets/js/panelHandlers/bundles/specific/back.js @@ -0,0 +1,6 @@ +jQuery('._js_back-to-bundle-menu').on('click', function(e){ + e.preventDefault(); + + jQuery('.specific-bundle-modal').modal('hide'); + jQuery('.manage-bundles-modal').modal('show'); +}); diff --git a/server/document_root/assets/js/panelHandlers/bundles/specific/open.js b/server/document_root/assets/js/panelHandlers/bundles/specific/open.js new file mode 100644 index 0000000..d197cea --- /dev/null +++ b/server/document_root/assets/js/panelHandlers/bundles/specific/open.js @@ -0,0 +1,9 @@ +jQuery(document).on('click', '._js_specific-bundle', function(e){ + e.preventDefault(); + + var name = jQuery(this).attr('data'); + + jQuery('.manage-bundles-modal').modal('hide'); + jQuery('.specific-bundle-modal').find('.modal-title').html("Bundle \"" + name + "\" Management"); + jQuery('.specific-bundle-modal').modal('show'); +}); diff --git a/server/document_root/gPanel.html b/server/document_root/gPanel.html index 07f82ad..d6a2973 100644 --- a/server/document_root/gPanel.html +++ b/server/document_root/gPanel.html @@ -84,6 +84,75 @@ + + +