From 94da855782e3f2d76c20763ef92131ea5f8766f9 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Fri, 20 Jan 2012 20:25:39 +0000 Subject: [PATCH] Remove erroneously copied javascript code from previous project --- public/scripts/main.js | 80 +++--------------------------------------- 1 file changed, 4 insertions(+), 76 deletions(-) diff --git a/public/scripts/main.js b/public/scripts/main.js index 23c3a78..7e65543 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -1,88 +1,16 @@ /** - * StatusBoard main script file + * Homepage main script file * * */ -var sb = { +var hp = { init: function() { - // Properly format any alert boxes - $('.alert-data').alert(); - - // Properly format any tab widgets - $('.tabs').tabs(); - - // Display popovers on all configured items - $("a[rel=popover]").popover({ - offset: 10, - html: true, - }); + }, - - admin: { - - init: function() { - $('#confirm_delete').modal({ - backdrop: true, - keyboard: true - }); - $('#confirm_delete_cancel').click(function() { - $('#confirm_delete').modal('hide'); - }); - }, - deleteItem: function(url) { - $('#confirm_delete_do').click(function() { - sb.request.post(url); - }); - - $('#confirm_delete').modal('show'); - }, - - }, - - usercp: { - - init: function() { - $('#usercp_newpassword,#usercp_confirmpassword').bind('keyup', sb.usercp.checkPassword); - - }, - - checkPassword: function() { - password = $('#usercp_newpassword'); - confirm = $('#usercp_confirmpassword'); - - confirm_container = confirm.parent().parent(); - - if (password.val() == confirm.val()) { - console.log("passwords match"); - confirm_container.removeClass('error').addClass('success'); - $('#usercp_confirmpassword_help').hide(); - } else { - console.log("passwords do not match"); - confirm_container.addClass('error').removeClass('success'); - $('#usercp_confirmpassword_help').show(); - } - } - - }, - - request: { - - post: function(url, data) { - console.log('Posting'); - var form = $('
').attr('method', 'post').attr('action', url); - for (var key in data) { - form.appendChild($('').attr('name', key).val(data[key])); - } - - form.submit(); - } - - } - }; -$('document').ready(sb.init); +$('document').ready(hp.init);