From 747d71e76deeee5195727fd955b71e8daef323c6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 18 Feb 2016 14:15:26 -0500 Subject: [PATCH] removed dead code --- dashboard-ui/scripts/supporterkeypage.js | 178 +---------------------- dashboard-ui/supporterkey.html | 43 ------ 2 files changed, 1 insertion(+), 220 deletions(-) diff --git a/dashboard-ui/scripts/supporterkeypage.js b/dashboard-ui/scripts/supporterkeypage.js index 5ae72bd29e..fda60cecca 100644 --- a/dashboard-ui/scripts/supporterkeypage.js +++ b/dashboard-ui/scripts/supporterkeypage.js @@ -120,180 +120,4 @@ }; -$(document).on('pageshow', "#supporterKeyPage", SupporterKeyPage.onPageShow); - -(function () { - - var connectSupporterInfo; - - function showAddUserForm(page) { - - $('.popupAddUser', page).popup('open'); - - $('#selectUserToAdd', page).html(connectSupporterInfo.EligibleUsers.map(function (u) { - - return ''; - - }).join('')); - } - - function addUser(page, id) { - - Dashboard.showLoadingMsg(); - - ApiClient.ajax({ - type: "POST", - url: ApiClient.getUrl('Connect/Supporters', { - Id: id - }) - - }).then(function () { - - $('.popupAddUser', page).popup('close'); - loadConnectSupporters(page); - }); - } - - function removeUser(page, id) { - - Dashboard.confirm(Globalize.translate('MessageConfirmRemoveConnectSupporter'), Globalize.translate('HeaderConfirmRemoveUser'), function (result) { - - if (result) { - - Dashboard.showLoadingMsg(); - - ApiClient.ajax({ - type: "DELETE", - url: ApiClient.getUrl('Connect/Supporters', { - Id: id - }) - - }).then(function () { - - loadConnectSupporters(page); - }); - } - - }); - } - - function getUserHtml(user) { - - var html = ''; - - html += '
  • '; - html += ''; - var imgUrl = user.ImageUrl || 'css/images/userflyoutdefault.png'; - html += ''; - html += '

    '; - html += (user.DisplayName || user.Name); - html += '

    '; - html += '

    '; - html += user.Email; - html += '

    '; - html += '
    '; - html += ''; - html += ''; - html += '
  • '; - - return html; - } - - function renderUsers(page, result) { - - $('.linkSupporterKeyMessage', page).html(Globalize.translate('MessageLinkYourSupporterKey', result.MaxUsers)); - - var html = ''; - - if (result.Users.length) { - - html += ''; - } - - var elem = $('.supporters', page).html(html).trigger('create'); - - $('.btnRemoveUser', elem).on('click', function () { - - removeUser(page, this.getAttribute('data-id')); - - }); - } - - function loadConnectSupporters(page) { - - Dashboard.showLoadingMsg(); - - Dashboard.suppressAjaxErrors = true; - - ApiClient.ajax({ - type: "GET", - url: ApiClient.getUrl('Connect/Supporters'), - dataType: "json" - - }).then(function (result) { - - connectSupporterInfo = result; - renderUsers(page, result); - - Dashboard.hideLoadingMsg(); - Dashboard.suppressAjaxErrors = false; - - }, function () { - - $('.supporters', page).html('

    ' + Globalize.translate('MessageErrorLoadingSupporterInfo') + '

    '); - Dashboard.suppressAjaxErrors = false; - - }); - } - - function loadUserInfo(page) { - - Dashboard.getPluginSecurityInfo().then(function (info) { - - if (info.IsMBSupporter) { - $('.supporterContainer', page).addClass('hide'); - } else { - $('.supporterContainer', page).removeClass('hide'); - } - }); - } - - $(document).on('pageinit', "#supporterKeyPage", function () { - - var page = this; - $('#btnAddConnectUser', page).on('click', function () { - showAddUserForm(page); - }); - - $('#supporterKeyForm').on('submit', SupporterKeyPage.updateSupporterKey); - $('#lostKeyForm').on('submit', SupporterKeyPage.retrieveSupporterKey); - $('#linkKeysForm').on('submit', SupporterKeyPage.linkSupporterKeys); - $('.popupAddUserForm').on('submit', SupporterKeyPage.onAddConnectUserSubmit).on('submit', SupporterKeyPage.onAddConnectUserSubmit); - - $('.benefits', page).html(Globalize.translate('HeaderSupporterBenefit', '', '')); - - }).on('pageshow', "#supporterKeyPage", function () { - - var page = this; - loadConnectSupporters(page); - loadUserInfo(page); - }); - - window.SupporterKeyPage.onAddConnectUserSubmit = function () { - - var page = $(this).parents('.page'); - - var id = $('#selectUserToAdd', page).val(); - - addUser(page, id); - - return false; - }; - -})(); \ No newline at end of file +$(document).on('pageshow', "#supporterKeyPage", SupporterKeyPage.onPageShow); \ No newline at end of file diff --git a/dashboard-ui/supporterkey.html b/dashboard-ui/supporterkey.html index 5062816025..180f5a1c41 100644 --- a/dashboard-ui/supporterkey.html +++ b/dashboard-ui/supporterkey.html @@ -104,52 +104,9 @@ - -
    -
    -

    ${HeaderSupporterBenefits}

    -

    - - - -
    -
    -
    - -
    - -
    -