1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix merge conflicts

This commit is contained in:
Luke Pulverenti 2016-10-12 15:39:01 -04:00
parent e623e5c20b
commit 202e2f553a

View file

@ -1,4 +1,4 @@
define(['jQuery', 'listViewStyle', 'paper-icon-button-light'], function ($) { define(['jQuery', 'datetime', 'listViewStyle', 'paper-icon-button-light'], function ($, datetime) {
function populateRatings(allParentalRatings, page) { function populateRatings(allParentalRatings, page) {
@ -55,9 +55,9 @@
var html = ''; var html = '';
html += '<p class="paperListLabel">' + Globalize.translate('HeaderBlockItemsWithNoRating') + '</p>'; html += '<h3 class="checkboxListLabel">' + Globalize.translate('HeaderBlockItemsWithNoRating') + '</h3>';
html += '<div class="paperCheckboxList">'; html += '<div class="checkboxList paperList checkboxList-paperList">';
for (var i = 0, length = items.length; i < length; i++) { for (var i = 0, length = items.length; i < length; i++) {
@ -65,7 +65,7 @@
var checkedAttribute = user.Policy.BlockUnratedItems.indexOf(item.value) != -1 ? ' checked="checked"' : ''; var checkedAttribute = user.Policy.BlockUnratedItems.indexOf(item.value) != -1 ? ' checked="checked"' : '';
html += '<paper-checkbox class="chkUnratedItem" data-itemtype="' + item.value + '" type="checkbox"' + checkedAttribute + '>' + item.name + '</paper-checkbox>'; html += '<label><input type="checkbox" is="emby-checkbox" class="chkUnratedItem" data-itemtype="' + item.value + '" type="checkbox"' + checkedAttribute + '><span>' + item.name + '</span></label>';
} }
html += '</div>'; html += '</div>';
@ -116,7 +116,7 @@
var li = '<div class="listItem">'; var li = '<div class="listItem">';
li += '<div class="listItemBody">'; li += '<div class="listItemBody">';
li += '<h3 class="listItemBodyTest">'; li += '<h3 class="listItemBodyText">';
li += h; li += h;
li += '</h3>'; li += '</h3>';
li += '</div>'; li += '</div>';
@ -156,24 +156,25 @@
function renderAccessSchedule(page, schedules) { function renderAccessSchedule(page, schedules) {
var html = '<ul data-role="listview" data-inset="true" data-split-icon="minus">'; var html = '';
var index = 0; var index = 0;
html += schedules.map(function (a) { html += schedules.map(function (a) {
var itemHtml = ''; var itemHtml = '';
itemHtml += '<li class="liSchedule" data-day="' + a.DayOfWeek + '" data-start="' + a.StartHour + '" data-end="' + a.EndHour + '">'; itemHtml += '<div class="liSchedule listItem" data-day="' + a.DayOfWeek + '" data-start="' + a.StartHour + '" data-end="' + a.EndHour + '">';
itemHtml += '<a href="#">'; itemHtml += '<div class="listItemBody two-line">';
itemHtml += '<h3>' + Globalize.translate('Option' + a.DayOfWeek) + '</h3>'; itemHtml += '<h3 class="listItemBodyText">';
itemHtml += '<p>' + getDisplayTime(a.StartHour) + ' - ' + getDisplayTime(a.EndHour) + '</p>'; itemHtml += Globalize.translate('Option' + a.DayOfWeek);
itemHtml += '</a>'; itemHtml += '</h3>';
itemHtml += '<div class="listItemBodyText secondary">' + getDisplayTime(a.StartHour) + ' - ' + getDisplayTime(a.EndHour) + '</div>';
itemHtml += '</div>';
itemHtml += '<a href="#" data-icon="delete" class="btnDelete" data-index="' + index + '">'; itemHtml += '<button type="button" is="paper-icon-button-light" class="btnDelete listItemButton" data-index="' + index + '"><i class="md-icon">delete</i></button>';
itemHtml += '</a>';
itemHtml += '</li>'; itemHtml += '</div>';
index++; index++;
@ -181,11 +182,10 @@
}).join(''); }).join('');
html += '</ul>'; var accessScheduleList = page.querySelector('.accessScheduleList');
accessScheduleList.innerHTML = html;
var elem = $('.accessScheduleList', page).html(html).trigger('create'); $('.btnDelete', accessScheduleList).on('click', function () {
$('.btnDelete', elem).on('click', function () {
deleteAccessSchedule(page, schedules, parseInt(this.getAttribute('data-index'))); deleteAccessSchedule(page, schedules, parseInt(this.getAttribute('data-index')));
}); });
@ -204,7 +204,7 @@
user.Policy.MaxParentalRating = $('#selectMaxParentalRating', page).val() || null; user.Policy.MaxParentalRating = $('#selectMaxParentalRating', page).val() || null;
user.Policy.BlockUnratedItems = $('.chkUnratedItem', page).get().filter(function(i) { user.Policy.BlockUnratedItems = $('.chkUnratedItem', page).get().filter(function (i) {
return i.checked; return i.checked;
@ -237,16 +237,6 @@
saveUser(result, page); saveUser(result, page);
}); });
// Disable default form submission
return false;
},
onScheduleFormSubmit: function () {
var page = $(this).parents('.page');
saveSchedule(page);
// Disable default form submission // Disable default form submission
return false; return false;
} }
@ -262,65 +252,29 @@
minutes = parseInt(pct * 60); minutes = parseInt(pct * 60);
} }
return new Date(2000, 1, 1, hours, minutes, 0, 0).toLocaleTimeString(); return datetime.getDisplayTime(new Date(2000, 1, 1, hours, minutes, 0, 0));
}
function populateHours(page) {
var html = '';
for (var i = 0; i < 24; i++) {
html += '<option value="' + i + '">' + getDisplayTime(i) + '</option>';
}
html += '<option value="24">' + getDisplayTime(0) + '</option>';
$('#selectStart', page).html(html);
$('#selectEnd', page).html(html);
} }
function showSchedulePopup(page, schedule, index) { function showSchedulePopup(page, schedule, index) {
schedule = schedule || {}; schedule = schedule || {};
$('#popupSchedule', page).popup('open'); require(['components/accessschedule/accessschedule'], function (accessschedule) {
accessschedule.show({
$('#fldScheduleIndex', page).val(index); schedule: schedule
}).then(function (updatedSchedule) {
$('#selectDay', page).val(schedule.DayOfWeek || 'Sunday');
$('#selectStart', page).val(schedule.StartHour || 0);
$('#selectEnd', page).val(schedule.EndHour || 0);
}
function saveSchedule(page) {
var schedule = {
DayOfWeek: $('#selectDay', page).val(),
StartHour: $('#selectStart', page).val(),
EndHour: $('#selectEnd', page).val()
};
if (parseFloat(schedule.StartHour) >= parseFloat(schedule.EndHour)) {
alert(Globalize.translate('ErrorMessageStartHourGreaterThanEnd'));
return;
}
var schedules = getSchedulesFromPage(page); var schedules = getSchedulesFromPage(page);
var index = parseInt($('#fldScheduleIndex', page).val());
if (index == -1) { if (index == -1) {
index = schedules.length; index = schedules.length;
} }
schedules[index] = schedule; schedules[index] = updatedSchedule;
renderAccessSchedule(page, schedules); renderAccessSchedule(page, schedules);
});
$('#popupSchedule', page).popup('close'); });
} }
function getSchedulesFromPage(page) { function getSchedulesFromPage(page) {
@ -379,9 +333,6 @@
showBlockedTagPopup(page); showBlockedTagPopup(page);
}); });
populateHours(page);
$('.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);
}).on('pageshow', "#userParentalControlPage", function () { }).on('pageshow', "#userParentalControlPage", function () {