update image

This commit is contained in:
Luke Pulverenti 2015-02-09 13:29:06 -05:00
parent 7e3d1bd15b
commit b74ec2c441
3 changed files with 0 additions and 119 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

After

Width:  |  Height:  |  Size: 588 KiB

View File

@ -82,7 +82,6 @@
loadUnratedItems(page, user); loadUnratedItems(page, user);
loadBlockedTags(page, user.Policy.BlockedTags); loadBlockedTags(page, user.Policy.BlockedTags);
loadAllowedTags(page, user.Policy.AllowedTags);
populateRatings(allParentalRatings, page); populateRatings(allParentalRatings, page);
@ -147,40 +146,6 @@
}); });
} }
function loadAllowedTags(page, tags) {
var html = '<ul data-role="listview" data-inset="true" data-split-icon="delete">' + tags.map(function (h) {
var li = '<li>';
li += '<a href="#">';
li += '<div style="font-weight:normal;">' + h + '</div>';
li += '</a>';
li += '<a class="allowedTag btnDeleteTag" href="#" data-tag="' + h + '"></a>';
li += '</li>';
return li;
}).join('') + '</ul>';
var elem = $('.allowedTags', page).html(html).trigger('create');
$('.btnDeleteTag', elem).on('click', function () {
var tag = this.getAttribute('data-tag');
var newTags = tags.filter(function (t) {
return t != tag;
});
loadAllowedTags(page, newTags);
});
}
function deleteAccessSchedule(page, schedules, index) { function deleteAccessSchedule(page, schedules, index) {
schedules.splice(index, 1); schedules.splice(index, 1);
@ -245,7 +210,6 @@
user.Policy.AccessSchedules = getSchedulesFromPage(page); user.Policy.AccessSchedules = getSchedulesFromPage(page);
user.Policy.BlockedTags = getBlockedTagsFromPage(page); user.Policy.BlockedTags = getBlockedTagsFromPage(page);
user.Policy.AllowedTags = getAllowedTagsFromPage(page);
ApiClient.updateUserPolicy(user.Id, user.Policy).done(function () { ApiClient.updateUserPolicy(user.Id, user.Policy).done(function () {
onSaveComplete(page); onSaveComplete(page);
@ -286,16 +250,6 @@
saveBlockedTag(page); saveBlockedTag(page);
// Disable default form submission
return false;
},
onAllowedTagFormSubmit: function () {
var page = $(this).parents('.page');
saveAllowedTag(page);
// Disable default form submission // Disable default form submission
return false; return false;
} }
@ -385,19 +339,6 @@
$('#popupBlockedTag', page).popup('close'); $('#popupBlockedTag', page).popup('close');
} }
function saveAllowedTag(page) {
var tag = $('#txtAllowedTag', page).val();
var tags = getAllowedTagsFromPage(page);
if (tags.indexOf(tag) == -1) {
tags.push(tag);
loadAllowedTags(page, tags);
}
$('#popupAllowedTag', page).popup('close');
}
function getSchedulesFromPage(page) { function getSchedulesFromPage(page) {
return $('.liSchedule', page).map(function () { return $('.liSchedule', page).map(function () {
@ -420,27 +361,12 @@
}).get(); }).get();
} }
function getAllowedTagsFromPage(page) {
return $('.allowedTag', page).map(function () {
return this.getAttribute('data-tag');
}).get();
}
function showBlockedTagPopup(page) { function showBlockedTagPopup(page) {
$('#popupBlockedTag', page).popup('open'); $('#popupBlockedTag', page).popup('open');
$('#txtBlockedTag', page).val('').focus(); $('#txtBlockedTag', page).val('').focus();
} }
function showAllowedTagPopup(page) {
$('#popupAllowedTag', page).popup('open');
$('#txtAllowedTag', page).val('').focus();
}
$(document).on('pageinit', "#userParentalControlPage", function () { $(document).on('pageinit', "#userParentalControlPage", function () {
var page = this; var page = this;
@ -456,12 +382,6 @@
showBlockedTagPopup(page); showBlockedTagPopup(page);
}); });
$('.btnAddAllowedTag', page).on('click', function () {
showAllowedTagPopup(page);
});
populateHours(page); populateHours(page);
}).on('pageshow', "#userParentalControlPage", function () { }).on('pageshow', "#userParentalControlPage", function () {

View File

@ -41,17 +41,6 @@
</div> </div>
<br /> <br />
<div>
<div>
<div class="ui-controlgroup-label" style="display:inline-block;">${LabelAllowContentWithTags}</div>
<button type="button" class="btnAddAllowedTag" data-inline="true" data-mini="true" data-iconpos="notext" data-icon="plus" style="vertical-align:middle;margin: -5px 0 0 1em;">${ButtonAdd}</button>
</div>
<div class="allowedTags" style="margin-top:.5em;">
</div>
</div>
<br />
<div class="accessScheduleSection" style="display:none;"> <div class="accessScheduleSection" style="display:none;">
<div data-role="collapsible"> <div data-role="collapsible">
<h2>${HeaderAccessSchedule}</h2> <h2>${HeaderAccessSchedule}</h2>
@ -103,33 +92,6 @@
</div> </div>
<div data-role="popup" id="popupAllowedTag" class="popup" data-theme="a">
<div class="ui-bar-a" style="text-align: center; padding: 5px 20px;">
<h3 style="margin: .5em;">${HeaderAddTag}</h3>
</div>
<div style="padding:10px 5px 0;">
<form class="allowedTagForm" style="min-width:210px;">
<ul data-role="listview" class="ulForm" style="margin-bottom:10px!important;">
<li>
<label for="txtAllowedTag">${LabelTag}</label>
<input id="txtAllowedTag" type="text" required="required" />
<div class="fieldDescription allowModeHelp">${LabelTagFilterAllowModeHelp}</div>
</li>
<li>
<button type="submit" data-icon="plus" data-theme="b" data-mini="true">${ButtonAdd}</button>
<button type="button" data-icon="delete" data-mini="true" onclick="$(this).parents('.popup').popup('close');">${ButtonCancel}</button>
</li>
</ul>
</form>
</div>
</div>
<div data-role="popup" id="popupSchedule" class="popup" data-theme="a"> <div data-role="popup" id="popupSchedule" class="popup" data-theme="a">
<div class="ui-bar-a" style="text-align: center; padding: 5px 20px;"> <div class="ui-bar-a" style="text-align: center; padding: 5px 20px;">
@ -179,7 +141,6 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$('.blockedTagForm').off('submit', UserParentalControlPage.onBlockedTagFormSubmit).on('submit', UserParentalControlPage.onBlockedTagFormSubmit); $('.blockedTagForm').off('submit', UserParentalControlPage.onBlockedTagFormSubmit).on('submit', UserParentalControlPage.onBlockedTagFormSubmit);
$('.allowedTagForm').off('submit', UserParentalControlPage.onAllowedTagFormSubmit).on('submit', UserParentalControlPage.onAllowedTagFormSubmit);
$('.scheduleForm').off('submit', UserParentalControlPage.onScheduleFormSubmit).on('submit', UserParentalControlPage.onScheduleFormSubmit); $('.scheduleForm').off('submit', UserParentalControlPage.onScheduleFormSubmit).on('submit', UserParentalControlPage.onScheduleFormSubmit);
$('.userParentalControlForm').off('submit', UserParentalControlPage.onSubmit).on('submit', UserParentalControlPage.onSubmit); $('.userParentalControlForm').off('submit', UserParentalControlPage.onSubmit).on('submit', UserParentalControlPage.onSubmit);
</script> </script>