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

update translations

This commit is contained in:
Luke Pulverenti 2014-11-28 21:40:46 -05:00
parent fd256835ca
commit 256aa6655a
4 changed files with 132 additions and 11 deletions

View file

@ -156,6 +156,7 @@ h1 a:hover {
.largePanelModalOpen.ui-panel-dismiss-position-right { .largePanelModalOpen.ui-panel-dismiss-position-right {
right: 250px !important; right: 250px !important;
} }
.largePanelModalOpen.ui-panel-dismiss-position-left { .largePanelModalOpen.ui-panel-dismiss-position-left {
left: 250px !important; left: 250px !important;
} }
@ -407,9 +408,13 @@ h1 .imageLink {
} }
.appLinks a { .appLinks a {
margin: 0 2px; text-decoration: none !important;
} }
.appLinks a + a {
margin-left: 5px;
}
.appLinks img { .appLinks img {
height: 32px; height: 32px;
} }

View file

@ -38,7 +38,7 @@
var url = 'Providers/Subtitles/Subtitles/' + id; var url = 'Providers/Subtitles/Subtitles/' + id;
$.get(ApiClient.getUrl(url)).done(function (result) { ApiClient.get(ApiClient.getUrl(url)).done(function (result) {
$('.subtitleContent', page).html(result); $('.subtitleContent', page).html(result);

View file

@ -76,11 +76,12 @@
$('.blockUnratedItems', page).html(html).trigger('create'); $('.blockUnratedItems', page).html(html).trigger('create');
} }
function loadUser(page, user, loggedInUser, allParentalRatings) { function loadUser(page, user, allParentalRatings) {
Dashboard.setPageTitle(user.Name); Dashboard.setPageTitle(user.Name);
loadUnratedItems(page, user); loadUnratedItems(page, user);
loadTags(page, user.Configuration.BlockedTags);
populateRatings(allParentalRatings, page); populateRatings(allParentalRatings, page);
@ -111,6 +112,40 @@
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function loadTags(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="blockedTag btnDeleteTag" href="#" data-tag="' + h + '"></a>';
li += '</li>';
return li;
}).join('') + '</ul>';
var elem = $('.blockedTags', 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;
});
loadTags(page, newTags);
});
}
function deleteAccessSchedule(page, schedules, index) { function deleteAccessSchedule(page, schedules, index) {
schedules.splice(index, 1); schedules.splice(index, 1);
@ -174,6 +209,8 @@
user.Configuration.AccessSchedules = getSchedulesFromPage(page); user.Configuration.AccessSchedules = getSchedulesFromPage(page);
user.Configuration.BlockedTags = getTagsFromPage(page);
ApiClient.updateUser(user).done(function () { ApiClient.updateUser(user).done(function () {
onSaveComplete(page); onSaveComplete(page);
}); });
@ -203,6 +240,16 @@
saveSchedule(page); saveSchedule(page);
// Disable default form submission
return false;
},
onTagFormSubmit: function() {
var page = $(this).parents('.page');
saveTag(page);
// Disable default form submission // Disable default form submission
return false; return false;
} }
@ -279,6 +326,19 @@
$('#popupSchedule', page).popup('close'); $('#popupSchedule', page).popup('close');
} }
function saveTag(page) {
var tag = $('#txtTag', page).val();
var tags = getTagsFromPage(page);
if (tags.indexOf(tag) == -1) {
tags.push(tag);
loadTags(page, tags);
}
$('#popupTag', page).popup('close');
}
function getSchedulesFromPage(page) { function getSchedulesFromPage(page) {
return $('.liSchedule', page).map(function () { return $('.liSchedule', page).map(function () {
@ -292,6 +352,21 @@
}).get(); }).get();
} }
function getTagsFromPage(page) {
return $('.blockedTag', page).map(function () {
return this.getAttribute('data-tag');
}).get();
}
function showTagPopup(page) {
$('#popupTag', page).popup('open');
$('#txtTag', page).val('').focus();
}
$(document).on('pageinit', "#userParentalControlPage", function () { $(document).on('pageinit', "#userParentalControlPage", function () {
var page = this; var page = this;
@ -302,6 +377,12 @@
showSchedulePopup(page, {}, -1); showSchedulePopup(page, {}, -1);
}); });
$('.btnAddTag', page).on('click', function () {
showTagPopup(page);
});
populateHours(page); populateHours(page);
}).on('pageshow', "#userParentalControlPage", function () { }).on('pageshow', "#userParentalControlPage", function () {
@ -328,13 +409,11 @@
promise1 = ApiClient.getUser(userId); promise1 = ApiClient.getUser(userId);
} }
var promise2 = Dashboard.getCurrentUser(); var promise2 = ApiClient.getParentalRatings();
var promise3 = ApiClient.getParentalRatings(); $.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) { loadUser(page, response1[0] || response1, response2[0]);
loadUser(page, response1[0] || response1, response2[0], response3[0]);
}); });
}); });

View file

@ -30,6 +30,17 @@
</div> </div>
<br /> <br />
<div>
<div>
<div class="ui-controlgroup-label" style="display:inline-block;">${LabelBlockItemsWithTags}</div>
<button type="button" class="btnAddTag" 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="blockedTags" 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>
@ -55,9 +66,33 @@
</form> </form>
<div data-role="popup" id="popupSchedule" data-theme="a"> <div data-role="popup" id="popupTag" class="popup" data-theme="a">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">${ButtonClose}</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="tagForm" style="min-width:210px;">
<ul data-role="listview" class="ulForm" style="margin-bottom:10px!important;">
<li>
<label for="txtTag">${LabelTag}</label>
<input id="txtTag" data-mini="true" type="text" required="required" />
</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 class="ui-bar-a" style="text-align: center; padding: 5px 20px;"> <div class="ui-bar-a" style="text-align: center; padding: 5px 20px;">
<h3 style="margin: .5em;">${HeaderSchedule}</h3> <h3 style="margin: .5em;">${HeaderSchedule}</h3>
@ -93,7 +128,8 @@
</li> </li>
<li> <li>
<input type="hidden" id="fldScheduleIndex" /> <input type="hidden" id="fldScheduleIndex" />
<button type="submit" data-icon="plus">${ButtonAdd}</button> <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> </li>
</ul> </ul>
</form> </form>
@ -104,6 +140,7 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$('.tagForm').off('submit', UserParentalControlPage.onTagFormSubmit).on('submit', UserParentalControlPage.onTagFormSubmit);
$('.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>