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

added new device profiles

This commit is contained in:
Luke Pulverenti 2014-07-16 23:17:14 -04:00
parent b9ac022c81
commit 433cee5164
17 changed files with 296 additions and 313 deletions

View file

@ -22,8 +22,6 @@
<label for="radioClassic">${PluginTabMediaBrowserClassic}</label> <label for="radioClassic">${PluginTabMediaBrowserClassic}</label>
<input type="radio" name="radioPackageTypes" class="radioPackageTypes" id="radopTheater" value="MBTheater" data-mini="true"> <input type="radio" name="radioPackageTypes" class="radioPackageTypes" id="radopTheater" value="MBTheater" data-mini="true">
<label for="radopTheater">${PluginTabMediaBrowserTheater}</label> <label for="radopTheater">${PluginTabMediaBrowserTheater}</label>
<input type="radio" name="radioPackageTypes" class="radioPackageTypes" id="radioOthers" value="Apps" data-mini="true">
<label for="radioOthers">${TabOtherPlugins}</label>
</fieldset> </fieldset>
<p style="display: none;"> <p style="display: none;">

View file

@ -77,7 +77,7 @@
html += "<div>"; html += "<div>";
html += "<span class='storeItemReviewText'>"; html += "<span class='storeItemReviewText'>";
html += new Date(review.timestamp).toDateString(); html += new Date(review.timestamp).toDateString();
html += " " + Dashboard.getStoreRatingHtml(review.rating, review.id, review.name, true); html += " " + RatingHelpers.getStoreRatingHtml(review.rating, review.id, review.name, true);
html += " " + review.title; html += " " + review.title;
html += "</span>"; html += "</span>";
if (review.review) { if (review.review) {
@ -110,7 +110,7 @@
html += "<div>"; html += "<div>";
html += "<span class='storeItemReviewText'>"; html += "<span class='storeItemReviewText'>";
html += new Date(review.timestamp).toDateString(); html += new Date(review.timestamp).toDateString();
html += " " + Dashboard.getStoreRatingHtml(review.rating, review.id, review.name, true); html += " " + RatingHelpers.getStoreRatingHtml(review.rating, review.id, review.name, true);
html += " " + review.title; html += " " + review.title;
html += "</span>"; html += "</span>";
if (review.review) { if (review.review) {
@ -241,7 +241,7 @@
} }
//Ratings and Reviews //Ratings and Reviews
var ratingHtml = "<strong>Overall </strong>" + Dashboard.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name); var ratingHtml = "<strong>Overall </strong>" + RatingHelpers.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name);
ratingHtml += "<span class='storeReviewCount'>"; ratingHtml += "<span class='storeReviewCount'>";
ratingHtml += " " + pkg.totalRatings + " Reviews"; ratingHtml += " " + pkg.totalRatings + " Reviews";
ratingHtml += "</span>"; ratingHtml += "</span>";

View file

@ -5,6 +5,8 @@
var currentSubProfile; var currentSubProfile;
var isSubProfileNew; var isSubProfileNew;
var allText = Globalize.translate('LabelAll');
function loadProfile(page) { function loadProfile(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
@ -144,13 +146,15 @@
html += '<li>'; html += '<li>';
html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">'; html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">';
html += '<p>Container: ' + (profile.Container || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '</p>';
if (profile.Type == 'Video') { if (profile.Type == 'Video') {
html += '<p>Video Codec: ' + (profile.VideoCodec || 'All') + '</p>';
html += '<p>Audio Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '</p>';
html += '<p>' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} else if (profile.Type == 'Audio') { } else if (profile.Type == 'Audio') {
html += '<p>Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} }
html += '</a>'; html += '</a>';
@ -224,13 +228,13 @@
html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">'; html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">';
html += '<p>Protocol: ' + (profile.Protocol || 'Http') + '</p>'; html += '<p>Protocol: ' + (profile.Protocol || 'Http') + '</p>';
html += '<p>Container: ' + (profile.Container || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '</p>';
if (profile.Type == 'Video') { if (profile.Type == 'Video') {
html += '<p>Video Codec: ' + (profile.VideoCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '</p>';
html += '<p>Audio Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} else if (profile.Type == 'Audio') { } else if (profile.Type == 'Audio') {
html += '<p>Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} }
html += '</a>'; html += '</a>';
@ -334,14 +338,16 @@
html += '<li>'; html += '<li>';
html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">'; html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">';
html += '<p>Container: ' + (profile.Container || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '</p>';
if (profile.Conditions && profile.Conditions.length) { if (profile.Conditions && profile.Conditions.length) {
html += '<p>Conditions: '; html += '<p>';
html += profile.Conditions.map(function (c) {
html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) {
return c.Property; return c.Property;
}).join(', '); }).join(', '));
html += '</p>'; html += '</p>';
} }
@ -434,14 +440,16 @@
html += '<li>'; html += '<li>';
html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">'; html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">';
html += '<p>Codec: ' + (profile.Codec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueCodec').replace('{0}', (profile.Codec || allText)) + '</p>';
if (profile.Conditions && profile.Conditions.length) { if (profile.Conditions && profile.Conditions.length) {
html += '<p>Conditions: '; html += '<p>';
html += profile.Conditions.map(function (c) {
html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) {
return c.Property; return c.Property;
}).join(', '); }).join(', '));
html += '</p>'; html += '</p>';
} }
@ -532,21 +540,23 @@
html += '<li>'; html += '<li>';
html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">'; html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" href="#">';
html += '<p>Container: ' + (profile.Container || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '</p>';
if (profile.Type == 'Video') { if (profile.Type == 'Video') {
html += '<p>Video Codec: ' + (profile.VideoCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '</p>';
html += '<p>Audio Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} else if (profile.Type == 'Audio') { } else if (profile.Type == 'Audio') {
html += '<p>Codec: ' + (profile.AudioCodec || 'All') + '</p>'; html += '<p>' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '</p>';
} }
if (profile.Conditions && profile.Conditions.length) { if (profile.Conditions && profile.Conditions.length) {
html += '<p>Conditions: '; html += '<p>';
html += profile.Conditions.map(function (c) {
html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) {
return c.Property; return c.Property;
}).join(', '); }).join(', '));
html += '</p>'; html += '</p>';
} }

View file

@ -75,7 +75,7 @@
return '<option value="' + p + '">' + p + '</option>'; return '<option value="' + p + '">' + p + '</option>';
}); });
$('#selectImageProvider', page).html('<option value="">All</option>' + providersHtml).val(provider).selectmenu('refresh'); $('#selectImageProvider', page).html('<option value="">' + Globalize.translate('LabelAll') + '</option>' + providersHtml).val(provider).selectmenu('refresh');
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
@ -215,7 +215,7 @@
html += '</div>'; html += '</div>';
} }
html += '<div><button class="btnDownloadRemoteImage" data-imageprovider="' + image.ProviderName + '" data-imageurl="' + image.Url + '" data-imagetype="' + image.Type + '" type="button" data-icon="arrow-d" data-mini="true">Download</button></div>'; html += '<div><button class="btnDownloadRemoteImage" data-imageprovider="' + image.ProviderName + '" data-imageurl="' + image.Url + '" data-imagetype="' + image.Type + '" type="button" data-icon="arrow-d" data-mini="true">' + Globalize.translate('ButtonDownload') + '</button></div>';
html += '</div>'; html += '</div>';
@ -242,9 +242,9 @@
if (showControls) { if (showControls) {
html += '<div data-role="controlgroup" data-type="horizontal" style="display:inline-block;">'; html += '<div data-role="controlgroup" data-type="horizontal" style="display:inline-block;">';
html += '<button data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (startIndex ? '' : 'disabled') + '>Previous Page</button>'; html += '<button data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (startIndex ? '' : 'disabled') + '>' + Globalize.translate('ButtonPreviousPage') + '</button>';
html += '<button data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (startIndex + limit > totalRecordCount ? 'disabled' : '') + '>Next Page</button>'; html += '<button data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (startIndex + limit > totalRecordCount ? 'disabled' : '') + '>' + Globalize.translate('ButtonNextPage') + '</button>';
html += '</div>'; html += '</div>';
} }
@ -275,7 +275,7 @@
$('#btnEditCollectionTitles', page).hide(); $('#btnEditCollectionTitles', page).hide();
} }
if (item.MediaType == "Video" && item.LocationType == "FileSystem") { if (item.MediaType == "Video" && item.LocationType == "FileSystem" && item.Type !== 'TvChannel') {
$('#btnEditSubtitles', page).show(); $('#btnEditSubtitles', page).show();
} else { } else {
$('#btnEditSubtitles', page).hide(); $('#btnEditSubtitles', page).hide();
@ -325,22 +325,22 @@
if (image.ImageType == "Backdrop" || image.ImageType == "Screenshot") { if (image.ImageType == "Backdrop" || image.ImageType == "Screenshot") {
if (i > 0) { if (i > 0) {
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i - 1) + ');" style="margin-bottom:0;">Move left</button>'; html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i - 1) + ');" style="margin-bottom:0;">' + Globalize.translate('ButtonMoveLeft') + '</button>';
} else { } else {
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>Move left</button>'; html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>' + Globalize.translate('ButtonMoveLeft') + '</button>';
} }
if (i < length - 1) { if (i < length - 1) {
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i + 1) + ');" style="margin-bottom:0;">Move right</button>'; html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i + 1) + ');" style="margin-bottom:0;">' + Globalize.translate('ButtonMoveRight') + '</button>';
} else { } else {
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>Move right</button>'; html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>' + Globalize.translate('ButtonMoveRight') + '</button>';
} }
} }
html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');" style="margin-bottom:0;">Delete</button>'; html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');" style="margin-bottom:0;">' + Globalize.translate('Delete') + '</button>';
if (imageProviders.length) { if (imageProviders.length) {
html += '<button type="button" data-icon="cloud" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');" style="margin-bottom:0;">Browse Online Images</button>'; html += '<button type="button" data-icon="cloud" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');" style="margin-bottom:0;">' + Globalize.translate('ButtonBrowseOnlineImages') + '</button>';
} }
html += '</p>'; html += '</p>';
@ -407,15 +407,13 @@
switch (evt.target.error.code) { switch (evt.target.error.code) {
case evt.target.error.NOT_FOUND_ERR: case evt.target.error.NOT_FOUND_ERR:
Dashboard.showError('File Not Found!'); Dashboard.showError(Globalize.translate('MessageFileNotFound'));
break;
case evt.target.error.NOT_READABLE_ERR:
Dashboard.showError('File is not readable');
break; break;
case evt.target.error.ABORT_ERR: case evt.target.error.ABORT_ERR:
break; // noop break; // noop
default: default:
Dashboard.showError('An error occurred reading this file.'); Dashboard.showError(Globalize.translate('MessageFileReadError'));
break;
}; };
} }
@ -440,7 +438,7 @@
}; };
reader.onabort = function () { reader.onabort = function () {
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
Dashboard.showError('File read cancelled'); console.log('File read cancelled');
}; };
// Closure to capture the file information. // Closure to capture the file information.
@ -501,7 +499,7 @@
var page = $.mobile.activePage; var page = $.mobile.activePage;
Dashboard.confirm("Are you sure you wish to delete this image?", "Delete " + type + " Image", function (result) { Dashboard.confirm(Globalize.translate('DeleteImageConfirmation'), Globalize.translate('HeaderDeleteImage'), function (result) {
if (result) { if (result) {
ApiClient.deleteItemImage(currentItem.Id, type, index).done(function () { ApiClient.deleteItemImage(currentItem.Id, type, index).done(function () {

View file

@ -70,7 +70,7 @@
$('#btnEditCollectionTitles', page).hide(); $('#btnEditCollectionTitles', page).hide();
} }
if (item.MediaType == "Video" && item.LocationType == "FileSystem") { if (item.MediaType == "Video" && item.LocationType == "FileSystem" && item.Type !== 'TvChannel') {
$('#btnEditSubtitles', page).show(); $('#btnEditSubtitles', page).show();
} else { } else {
$('#btnEditSubtitles', page).hide(); $('#btnEditSubtitles', page).hide();
@ -462,7 +462,7 @@
$('#txtName', page).val(item.Name || ""); $('#txtName', page).val(item.Name || "");
$('#txtOverview', page).val(item.Overview || ""); $('#txtOverview', page).val(item.Overview || "");
$('#txtShortOverview', page).val(item.ShortOverview || ""); $('#txtShortOverview', page).val(item.ShortOverview || "");
$('#txtTagline', page).val((item.Taglines.length ? item.Taglines[0] : '')); $('#txtTagline', page).val((item.Taglines && item.Taglines.length ? item.Taglines[0] : ''));
$('#txtSortName', page).val(item.ForcedSortName || ""); $('#txtSortName', page).val(item.ForcedSortName || "");
$('#txtDisplayMediaType', page).val(item.DisplayMediaType || ""); $('#txtDisplayMediaType', page).val(item.DisplayMediaType || "");
$('#txtCommunityRating', page).val(item.CommunityRating || ""); $('#txtCommunityRating', page).val(item.CommunityRating || "");
@ -536,7 +536,7 @@
} }
$('#txtProductionYear', page).val(item.ProductionYear || ""); $('#txtProductionYear', page).val(item.ProductionYear || "");
$('#txtAirTime', page).val(convertTo24HourFormat(item.AirTime || "")); $('#txtAirTime', page).val(item.AirTime || "");
var placeofBirth = item.ProductionLocations && item.ProductionLocations.length ? item.ProductionLocations[0] : ''; var placeofBirth = item.ProductionLocations && item.ProductionLocations.length ? item.ProductionLocations[0] : '';
$('#txtPlaceOfBirth', page).val(placeofBirth); $('#txtPlaceOfBirth', page).val(placeofBirth);
@ -576,14 +576,14 @@
html += '<li><a class="btnEditPerson" href="#" data-index="' + i + '">'; html += '<li><a class="btnEditPerson" href="#" data-index="' + i + '">';
html += '<h3>' + (person.Name || 'Unknown name') + '</h3>'; html += '<h3>' + (person.Name || '') + '</h3>';
if (person.Role && person.Role != lastType) { if (person.Role && person.Role != lastType) {
html += '<p>' + (person.Role) + '</p>'; html += '<p>' + (person.Role) + '</p>';
} }
html += '</a>'; html += '</a>';
html += '<a class="btnDeletePerson" href="#" data-icon="delete" data-index="' + i + '">Delete</a>'; html += '<a class="btnDeletePerson" href="#" data-icon="delete" data-index="' + i + '">' + Globalize.translate('Delete') + '</a>';
html += '</li>'; html += '</li>';
} }
@ -652,46 +652,6 @@
populatePeople(page, currentItem.People); populatePeople(page, currentItem.People);
} }
function convertTo24HourFormat(time) {
if (time == "")
return time;
var match = time.match(/^(\d+):(\d+)(.*)$/);
if (match) {
var hours = Number(match[1]);
var minutes = Number(match[2]);
var ampm = $.trim(match[3]);
ampm = ampm.toUpperCase();
if (ampm == "PM" && hours < 12) hours = hours + 12;
if (ampm == "AM" && hours == 12) hours = 0;
var sHours = hours.toString();
var sMinutes = minutes.toString();
if (hours < 10) sHours = "0" + sHours;
if (minutes < 10) sMinutes = "0" + sMinutes;
return sHours + ":" + sMinutes;
} else {
return time;
}
}
function convertTo12HourFormat(time) {
if (time == "")
return time;
var hours = Number(time.match(/^(\d+)/)[1]);
var minutes = Number(time.match(/:(\d+)/)[1]);
var ampm = "AM";
if (hours >= 12) {
ampm = "PM";
hours = hours - 12;
hours = hours == 0 ? 12 : hours;
}
hours = hours == 0 ? 12 : hours;
var sHours = hours.toString();
var sMinutes = minutes.toString();
if (hours < 10) sHours = "0" + sHours;
if (minutes < 10) sMinutes = "0" + sMinutes;
return sHours + ":" + sMinutes + " " + ampm;
}
function populateRatings(allParentalRatings, select) { function populateRatings(allParentalRatings, select) {
var html = ""; var html = "";
@ -722,8 +682,8 @@
var html = ""; var html = "";
html += "<option value=''></option>"; html += "<option value=''></option>";
html += "<option value='Continuing'>Continuing</option>"; html += "<option value='Continuing'>" + Globalize.translate('OptionContinuing') + "</option>";
html += "<option value='Ended'>Ended</option>"; html += "<option value='Ended'>" + Globalize.translate('OptionEnded') + "</option>";
select.html(html).selectmenu("refresh"); select.html(html).selectmenu("refresh");
} }
@ -752,12 +712,11 @@
var field = fields[i]; var field = fields[i];
var name = field.name; var name = field.name;
var value = field.value || field.name; var value = field.value || field.name;
var fieldTitle = $.trim(name.replace(/([A-Z])/g, ' $1'));
html += '<div data-role="fieldcontain">'; html += '<div data-role="fieldcontain">';
html += '<label for="lock' + value + '">' + fieldTitle + ':</label>'; html += '<label for="lock' + value + '">' + name + '</label>';
html += '<select class="selectLockedField" id="lock' + value + '" data-role="slider" data-mini="true">'; html += '<select class="selectLockedField" id="lock' + value + '" data-role="slider" data-mini="true">';
html += '<option value="' + value + '">Off</option>'; html += '<option value="' + value + '">' + Globalize.translate('OptionOff') + '</option>';
html += '<option value="" selected="selected">On</option>'; html += '<option value="" selected="selected">' + Globalize.translate('OptionOn') + '</option>';
html += '</select>'; html += '</select>';
html += '</div>'; html += '</div>';
} }
@ -769,37 +728,37 @@
lockedFields = lockedFields || new Array(); lockedFields = lockedFields || new Array();
var metadatafields = [ var metadatafields = [
{ name: "Name" }, { name: Globalize.translate('OptionName'), value: "Name" },
{ name: "Overview" }, { name: Globalize.translate('OptionOverview'), value: "Overview" },
{ name: "Genres" }, { name: Globalize.translate('OptionGenres'), value: "Genres" },
{ name: "Parental Rating", value: "OfficialRating" }, { name: Globalize.translate('OptionParentalRating'), value: "OfficialRating" },
{ name: "People", value: "Cast" } { name: Globalize.translate('OptionPeople'), value: "Cast" }
]; ];
if (item.Type == "Person") { if (item.Type == "Person") {
metadatafields.push({ name: "Birth location", value: "ProductionLocations" }); metadatafields.push({ name: Globalize.translate('OptionBirthLocation'), value: "ProductionLocations" });
} else { } else {
metadatafields.push({ name: "Production Locations", value: "ProductionLocations" }); metadatafields.push({ name: Globalize.translate('OptionProductionLocations'), value: "ProductionLocations" });
} }
if (item.Type == "Series") { if (item.Type == "Series") {
metadatafields.push({ name: "Runtime" }); metadatafields.push({ name: Globalize.translate('OptionRuntime'), value: "Runtime" });
} }
metadatafields.push({ name: "Studios" }); metadatafields.push({ name: Globalize.translate('OptionStudios'), value: "Studios" });
metadatafields.push({ name: "Tags" }); metadatafields.push({ name: Globalize.translate('OptionTags'), value: "Tags" });
metadatafields.push({ name: "Keywords" }); metadatafields.push({ name: Globalize.translate('OptionKeywords'), value: "Keywords" });
metadatafields.push({ name: "Images" }); metadatafields.push({ name: Globalize.translate('OptionImages'), value: "Images" });
metadatafields.push({ name: "Backdrops" }); metadatafields.push({ name: Globalize.translate('OptionBackdrops'), value: "Backdrops" });
if (item.Type == "Game") { if (item.Type == "Game") {
metadatafields.push({ name: "Screenshots" }); metadatafields.push({ name: Globalize.translate('OptionScreenshots'), value: "Screenshots" });
} }
var html = ''; var html = '';
html += "<h1>Fields</h1>"; html += "<h1>" + Globalize.translate('HeaderFields') + "</h1>";
html += "<p>Slide a field to 'off' to lock it and prevent it's data from being changed.</p>"; html += "<p>" + Globalize.translate('HeaderFieldsHelp') + "</p>";
html += generateSliders(metadatafields, 'Fields'); html += generateSliders(metadatafields, 'Fields');
container.html(html).trigger('create'); container.html(html).trigger('create');
for (var fieldIndex = 0; fieldIndex < lockedFields.length; fieldIndex++) { for (var fieldIndex = 0; fieldIndex < lockedFields.length; fieldIndex++) {
@ -873,7 +832,7 @@
ShortOverview: $('#txtShortOverview', form).val(), ShortOverview: $('#txtShortOverview', form).val(),
Status: $('#selectStatus', form).val(), Status: $('#selectStatus', form).val(),
AirDays: getSelectedAirDays(form), AirDays: getSelectedAirDays(form),
AirTime: convertTo12HourFormat($('#txtAirTime', form).val()), AirTime: $('#txtAirTime', form).val(),
Genres: editableListViewValues($("#listGenres", form)), Genres: editableListViewValues($("#listGenres", form)),
ProductionLocations: editableListViewValues($("#listCountries", form)), ProductionLocations: editableListViewValues($("#listCountries", form)),
Tags: editableListViewValues($("#listTags", form)), Tags: editableListViewValues($("#listTags", form)),
@ -928,7 +887,7 @@
ApiClient.updateItem(item).done(function () { ApiClient.updateItem(item).done(function () {
Dashboard.alert('Item saved.'); Dashboard.alert(Globalize.translate('MessageItemSaved'));
MetadataEditor.getItemPromise().done(function (i) { MetadataEditor.getItemPromise().done(function (i) {
$(form).parents('.page').trigger('itemsaved', [i]); $(form).parents('.page').trigger('itemsaved', [i]);
@ -969,7 +928,7 @@
var page = $(this).parents('.page'); var page = $(this).parents('.page');
if ($('#fldChallengeValue', page).val() != $('#txtDeleteTest', page).val()) { if ($('#fldChallengeValue', page).val() != $('#txtDeleteTest', page).val()) {
Dashboard.alert('The value entered is not correct. Please try again.'); Dashboard.alert(Globalize.translate('MessageValueNotCorrect'));
} else { } else {
performDelete(page); performDelete(page);
} }
@ -1090,7 +1049,7 @@
}); });
if (!hasId && !lookupInfo.Name) { if (!hasId && !lookupInfo.Name) {
Dashboard.alert('Please enter a name or an external Id.'); Dashboard.alert(Globalize.translate('MessagePleaseEnterNameOrId'));
return; return;
} }
@ -1296,9 +1255,9 @@
} else { } else {
var msg = "<p>Are you sure you wish to delete this item from your library?</p>"; var msg = "<p>" + Globalize.translate('ConfirmDeleteItem') + "</p>";
Dashboard.confirm(msg, "Confirm Deletion", function (result) { Dashboard.confirm(msg, Globalize.translate('HeaderDeleteItem'), function (result) {
if (result) { if (result) {

View file

@ -38,22 +38,22 @@
htmlName += name; htmlName += name;
if (!item.LocalTrailerCount && item.Type == "Movie") { if (!item.LocalTrailerCount && item.Type == "Movie") {
htmlName += '<img src="css/images/editor/missingtrailer.png" title="Missing local trailer." />'; htmlName += '<img src="css/images/editor/missingtrailer.png" title="' + Globalize.translate('MissingLocalTrailer') + '" />';
} }
if (!item.ImageTags || !item.ImageTags.Primary) { if (!item.ImageTags || !item.ImageTags.Primary) {
htmlName += '<img src="css/images/editor/missingprimaryimage.png" title="Missing primary image." />'; htmlName += '<img src="css/images/editor/missingprimaryimage.png" title="' + Globalize.translate('MissingPrimaryImage') + '" />';
} }
if (!item.BackdropImageTags || !item.BackdropImageTags.length) { if (!item.BackdropImageTags || !item.BackdropImageTags.length) {
if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "TvChannel" && item.Type !== "MusicAlbum") { if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "TvChannel" && item.Type !== "MusicAlbum") {
htmlName += '<img src="css/images/editor/missingbackdrop.png" title="Missing backdrop image." />'; htmlName += '<img src="css/images/editor/missingbackdrop.png" title="' + Globalize.translate('MissingBackdropImage') + '" />';
} }
} }
if (!item.ImageTags || !item.ImageTags.Logo) { if (!item.ImageTags || !item.ImageTags.Logo) {
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "MusicArtist" || item.Type == "BoxSet") { if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "MusicArtist" || item.Type == "BoxSet") {
htmlName += '<img src="css/images/editor/missinglogo.png" title="Missing logo image." />'; htmlName += '<img src="css/images/editor/missinglogo.png" title="' + Globalize.translate('MissingLogoImage') + '" />';
} }
} }
@ -61,7 +61,7 @@
try { try {
if (item.PremiereDate && (new Date().getTime() >= parseISO8601Date(item.PremiereDate, { toLocal: true }).getTime())) { if (item.PremiereDate && (new Date().getTime() >= parseISO8601Date(item.PremiereDate, { toLocal: true }).getTime())) {
htmlName += '<img src="css/images/editor/missing.png" title="Missing episode." />'; htmlName += '<img src="css/images/editor/missing.png" title="' + Globalize.translate('MissingEpisode') + '" />';
} }
} catch (err) { } catch (err) {
@ -84,10 +84,10 @@
var nodes = []; var nodes = [];
nodes.push({ attr: { id: 'MediaFolders', rel: 'folder', itemtype: 'mediafolders' }, data: 'Media Folders', state: 'open' }); nodes.push({ attr: { id: 'MediaFolders', rel: 'folder', itemtype: 'mediafolders' }, data: Globalize.translate('HeaderMediaFolders'), state: 'open' });
if (result.TotalRecordCount) { if (result.TotalRecordCount) {
nodes.push({ attr: { id: 'livetv', rel: 'folder', itemtype: 'livetv' }, data: 'Live TV', state: 'closed' }); nodes.push({ attr: { id: 'livetv', rel: 'folder', itemtype: 'livetv' }, data: Globalize.translate('HeaderLiveTV'), state: 'closed' });
} }
callback(nodes); callback(nodes);

View file

@ -354,7 +354,7 @@
$('.playFlyout').popup("close").remove(); $('.playFlyout').popup("close").remove();
}, },
getHref: function (item, context) { getHref: function (item, context, topParentId) {
var href = LibraryBrowser.getHrefInternal(item); var href = LibraryBrowser.getHrefInternal(item);
@ -363,6 +363,15 @@
href += context; href += context;
} }
if (topParentId == null) {
topParentId = LibraryMenu.getTopParentId();
}
if (topParentId) {
href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId=";
href += topParentId;
}
return href; return href;
}, },

View file

@ -164,6 +164,28 @@
window.LiveTvHelpers = { window.LiveTvHelpers = {
getDaysOfWeek: function () {
var days = [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
];
return days.map(function (d) {
return {
name: d,
value: d
};
});
},
getDisplayTime: function (date) { getDisplayTime: function (date) {
if ((typeof date).toString().toLowerCase() === 'string') { if ((typeof date).toString().toLowerCase() === 'string') {

View file

@ -76,15 +76,9 @@
function getDaysOfWeek() { function getDaysOfWeek() {
// Do not localize. These are used as values, not text. // Do not localize. These are used as values, not text.
return [ return LiveTvHelpers.getDaysOfWeek().map(function (d) {
'Sunday', return d.value;
'Monday', });
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
];
} }
function getDays(page) { function getDays(page) {

View file

@ -37,27 +37,39 @@
$('#chkAnyTime', page).checked(item.RecordAnyTime).checkboxradio('refresh'); $('#chkAnyTime', page).checked(item.RecordAnyTime).checkboxradio('refresh');
var channelHtml = ''; var channelHtml = '';
if (item.RecordAnyChannel) {
if (item.RecurrenceType == 'NewProgramEventsAllChannels' || item.RecurrenceType == 'AllProgramEventsAllChannels') { channelHtml += Globalize.translate('LabelAllChannels');
channelHtml += 'All Channels';
} }
else if (item.ChannelId) { else if (item.ChannelId) {
channelHtml += '<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>'; channelHtml += '<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>';
} }
$('.channel', page).html('Channel:&nbsp;&nbsp;&nbsp;' + channelHtml).trigger('create'); $('.channel', page).html(channelHtml).trigger('create');
selectDays(page, item.Days); selectDays(page, item.Days);
if (item.RecordAnyTime) {
$('.time', page).html('Time:&nbsp;&nbsp;&nbsp;' + LiveTvHelpers.getDisplayTime(item.StartDate)); $('.time', page).html(Globalize.translate('LabelAnytime')).trigger('create');
}
else if (item.ChannelId) {
$('.time', page).html(LiveTvHelpers.getDisplayTime(item.StartDate)).trigger('create');
}
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function getDaysOfWeek() {
// Do not localize. These are used as values, not text.
return LiveTvHelpers.getDaysOfWeek().map(function (d) {
return d.value;
});
}
function selectDays(page, days) { function selectDays(page, days) {
var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var daysOfWeek = getDaysOfWeek();
for (var i = 0, length = daysOfWeek.length; i < length; i++) { for (var i = 0, length = daysOfWeek.length; i < length; i++) {
@ -71,7 +83,7 @@
function getDays(page) { function getDays(page) {
var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var daysOfWeek = getDaysOfWeek();
var days = []; var days = [];
@ -82,7 +94,6 @@
if ($('#chk' + day, page).checked()) { if ($('#chk' + day, page).checked()) {
days.push(day); days.push(day);
} }
} }
return days; return days;
@ -180,13 +191,13 @@
html += '<p>'; html += '<p>';
if (program.IsLive) { if (program.IsLive) {
html += '<span class="liveTvProgram">LIVE&nbsp;&nbsp;</span>'; html += '<span class="liveTvProgram">' + Globalize.translate('LabelLiveProgram') + '&nbsp;&nbsp;</span>';
} }
else if (program.IsPremiere) { else if (program.IsPremiere) {
html += '<span class="premiereTvProgram">PREMIERE&nbsp;&nbsp;</span>'; html += '<span class="premiereTvProgram">' + Globalize.translate('LabelPremiereProgram') + '&nbsp;&nbsp;</span>';
} }
else if (program.IsSeries && !program.IsRepeat) { else if (program.IsSeries && !program.IsRepeat) {
html += '<span class="newTvProgram">NEW&nbsp;&nbsp;</span>'; html += '<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + '&nbsp;&nbsp;</span>';
} }
html += LiveTvHelpers.getDisplayTime(timer.StartDate); html += LiveTvHelpers.getDisplayTime(timer.StartDate);

View file

@ -17,7 +17,6 @@
}); });
$('#divMediaLibrary', page).show(); $('#divMediaLibrary', page).show();
Dashboard.setPageTitle("Media Library");
}, },
shouldRefreshLibraryAfterChanges: function () { shouldRefreshLibraryAfterChanges: function () {
@ -55,8 +54,8 @@
changeCollectionType: function () { changeCollectionType: function () {
Dashboard.alert({ Dashboard.alert({
message: "To change the folder type, please remove and rebuild the collection with the new type.", message: Globalize.translate('HeaderChangeFolderTypeHelp'),
title: "Change Folder Type" title: Globalize.translate('HeaderChangeFolderType')
}); });
}, },
@ -380,13 +379,13 @@ var WizardLibraryPage = {
var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : '';
if (lastResult == "Failed") { if (lastResult == "Failed") {
$('.lastRefreshResult', page).html('<span style="color:#FF0000;">(failed)</span>'); $('.lastRefreshResult', page).html('<span style="color:#FF0000;">' + Globalize.translate('LabelFailed') + '</span>');
} }
else if (lastResult == "Cancelled") { else if (lastResult == "Cancelled") {
$('.lastRefreshResult', page).html('<span style="color:#0026FF;">(cancelled)</span>'); $('.lastRefreshResult', page).html('<span style="color:#0026FF;">' + Globalize.translate('LabelCancelled') + '</span>');
} }
else if (lastResult == "Aborted") { else if (lastResult == "Aborted") {
$('.lastRefreshResult', page).html('<span style="color:#FF0000;">(Aborted by server shutdown)</span>'); $('.lastRefreshResult', page).html('<span style="color:#FF0000;">' + Globalize.translate('LabelAbortedByServerShutdown') + '</span>');
} else { } else {
$('.lastRefreshResult', page).html(lastResult); $('.lastRefreshResult', page).html(lastResult);
} }

View file

@ -1003,7 +1003,8 @@
self.startTimeTicksOffset = isStatic ? 0 : startPosition || 0; self.startTimeTicksOffset = isStatic ? 0 : startPosition || 0;
var seekParam = startPosition ? '#t=' + (startPosition / 10000000) : ''; var startPositionInSeekParam = startPosition ? (startPosition / 10000000) : 0;
var seekParam = startPositionInSeekParam ? '#t=' + startPositionInSeekParam : '';
var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, { var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, {
Static: isStatic, Static: isStatic,
@ -1158,7 +1159,14 @@
volumeSlider.val(initialVolume).slider('refresh'); volumeSlider.val(initialVolume).slider('refresh');
updateVolumeButtons(initialVolume); updateVolumeButtons(initialVolume);
video.on("volumechange.mediaplayerevent", function (e) { video.one("loadedmetadata.mediaplayerevent", function (e) {
// Appending #t=xxx to the query string doesn't seem to work with HLS
if (startPositionInSeekParam && this.currentSrc && this.currentSrc.toLowerCase().indexOf('.m3u8') != -1) {
this.currentTime = startPositionInSeekParam;
}
}).on("volumechange.mediaplayerevent", function (e) {
var vol = this.volume; var vol = this.volume;
@ -1234,7 +1242,7 @@
}).on("ended.playbackstopped", function () { }).on("ended.playbackstopped", function () {
currentTimeElement.empty(); currentTimeElement.html('--:--');
self.onPlaybackStopped.call(this); self.onPlaybackStopped.call(this);

View file

@ -6,39 +6,11 @@
IsAdult: false IsAdult: false
}; };
function getApps() {
var apps = [];
apps.push({
type: "UserInstalled",
name: "MBKinect",
category: "Voice Control",
isApp: true,
tileColor: "#050810",
thumbImage: "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/images/mbkinect/thumb.png",
externalUrl: "http://mediabrowser.tv/community/index.php?/topic/850-media-browser-kinect-sensor-plug-in-support/",
isPremium: false,
isExternal: true
});
return apps;
}
function getAppsPromise() {
var deferred = $.Deferred();
deferred.resolveWith(null, [[getApps()]]);
return deferred.promise();
}
function reloadList(page) { function reloadList(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var promise1 = query.TargetSystems == "Apps" ? getAppsPromise() : ApiClient.getAvailablePlugins(query); var promise1 = ApiClient.getAvailablePlugins(query);
var promise2 = ApiClient.getInstalledPlugins(); var promise2 = ApiClient.getInstalledPlugins();
@ -113,7 +85,7 @@
if (!plugin.isExternal) { if (!plugin.isExternal) {
html += "<div class='posterItemText packageReviewText' style='color:#000;'>"; html += "<div class='posterItemText packageReviewText' style='color:#000;'>";
html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : Globalize.translate('LabelFree'); html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : Globalize.translate('LabelFree');
html += Dashboard.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name); html += RatingHelpers.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name);
html += "<span class='storeReviewCount'>"; html += "<span class='storeReviewCount'>";
html += " " + Globalize.translate('LabelNumberReviews').replace("{0}", plugin.totalRatings); html += " " + Globalize.translate('LabelNumberReviews').replace("{0}", plugin.totalRatings);

View file

@ -95,4 +95,55 @@
}; };
}; };
window.RatingHelpers = {
ratePackage: function (link) {
var id = link.getAttribute('data-id');
var name = link.getAttribute('data-name');
var rating = link.getAttribute('data-rating');
var dialog = new RatingDialog($.mobile.activePage);
dialog.show({
header: "Rate and review " + name,
id: id,
rating: rating,
callback: function (review) {
console.log(review);
dialog.close();
ApiClient.createPackageReview(review).done(function () {
Dashboard.alert({
message: "Thank you for your review",
title: "Thank You"
});
});
}
});
},
getStoreRatingHtml: function (rating, id, name, noLinks) {
var html = "<div style='margin-left: 5px; margin-right: 5px; display: inline-block; vertical-align:middle;'>";
if (!rating) rating = 0;
for (var i = 1; i <= 5; i++) {
var title = noLinks ? rating + " stars" : "Rate " + i + (i > 1 ? " stars" : " star");
html += noLinks ? "" : "<span data-id=" + id + " data-name='" + name + "' data-rating=" + i + " onclick='RatingHelpers.ratePackage(this);return false;' >";
if (rating <= i - 1) {
html += "<div class='storeStarRating emptyStarRating' title='" + title + "'></div>";
} else if (rating < i) {
html += "<div class='storeStarRating halfStarRating' title='" + title + "'></div>";
} else {
html += "<div class='storeStarRating' title='" + title + "'></div>";
}
html += noLinks ? "" : "</span>";
}
html += "</div>";
return html;
}
};
})(window, document, jQuery); })(window, document, jQuery);

View file

@ -70,7 +70,7 @@
var html = ''; var html = '';
html += '<a class="searchHint" href="' + LibraryBrowser.getHref(hint) + '">'; html += '<a class="searchHint" href="' + LibraryBrowser.getHref(hint, null, '') + '">';
var imgUrl; var imgUrl;

View file

@ -169,7 +169,7 @@ var Dashboard = {
return; return;
} }
Dashboard.confirmInternal(options.message, options.title || 'Alert', false, options.callback); Dashboard.confirmInternal(options.message, options.title || Globalize.translate('HeaderAlert'), false, options.callback);
}, },
updateSystemInfo: function (info) { updateSystemInfo: function (info) {
@ -258,10 +258,10 @@ var Dashboard = {
showServerRestartWarning: function (systemInfo) { showServerRestartWarning: function (systemInfo) {
var html = '<span style="margin-right: 1em;">Please restart to finish updating.</span>'; var html = '<span style="margin-right: 1em;">' + Globalize.translate('MessagePleaseRestart') + '</span>';
if (systemInfo.CanSelfRestart) { if (systemInfo.CanSelfRestart) {
html += '<button type="button" data-icon="refresh" onclick="$(this).buttonEnabled(false);Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">Restart</button>'; html += '<button type="button" data-icon="refresh" onclick="$(this).buttonEnabled(false);Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">' + Globalize.translate('ButtonRestart') + '</button>';
} }
Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false }); Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
@ -274,9 +274,9 @@ var Dashboard = {
showDashboardVersionWarning: function () { showDashboardVersionWarning: function () {
var html = '<span style="margin-right: 1em;">Please refresh this page to receive new updates from the server.</span>'; var html = '<span style="margin-right: 1em;">' + Globalize.translate('MessagePleaseRefreshPage') + '</span>';
html += '<button type="button" data-icon="refresh" onclick="$(this).buttonEnabled(false);Dashboard.reloadPage();" data-theme="b" data-inline="true" data-mini="true">Refresh</button>'; html += '<button type="button" data-icon="refresh" onclick="$(this).buttonEnabled(false);Dashboard.reloadPage();" data-theme="b" data-inline="true" data-mini="true">' + Globalize.translate('ButtonRefresh') + '</button>';
Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false }); Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false });
}, },
@ -318,7 +318,7 @@ var Dashboard = {
var onclick = removeOnHide ? "$(\"#" + options.id + "\").trigger(\"notification.remove\").remove();" : "$(\"#" + options.id + "\").trigger(\"notification.hide\").hide();"; var onclick = removeOnHide ? "$(\"#" + options.id + "\").trigger(\"notification.remove\").remove();" : "$(\"#" + options.id + "\").trigger(\"notification.hide\").hide();";
if (options.allowHide !== false) { if (options.allowHide !== false) {
options.html += "<span style='margin-left: 1em;'><button type='button' onclick='" + onclick + "' data-icon='delete' data-iconpos='notext' data-mini='true' data-inline='true' data-theme='b'>Hide</button></span>"; options.html += "<span style='margin-left: 1em;'><button type='button' onclick='" + onclick + "' data-icon='delete' data-iconpos='notext' data-mini='true' data-inline='true' data-theme='b'>" + Globalize.translate('ButtonHide') + "</button></span>";
} }
if (options.forceShow) { if (options.forceShow) {
@ -387,7 +387,7 @@ var Dashboard = {
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
Dashboard.alert("Settings saved."); Dashboard.alert(Globalize.translate('MessageSettingsSaved'));
}, },
confirmInternal: function (message, title, showCancel, callback) { confirmInternal: function (message, title, showCancel, callback) {
@ -406,10 +406,10 @@ var Dashboard = {
html += message; html += message;
html += '</div>'; html += '</div>';
html += '<p><button type="button" data-icon="check" onclick="$(\'.confirmFlyout\')[0].confirm=true;$(\'.confirmFlyout\').popup(\'close\');" data-theme="b">Ok</button></p>'; html += '<p><button type="button" data-icon="check" onclick="$(\'.confirmFlyout\')[0].confirm=true;$(\'.confirmFlyout\').popup(\'close\');" data-theme="b">' + Globalize.translate('ButtonOk') + '</button></p>';
if (showCancel) { if (showCancel) {
html += '<p><button type="button" data-icon="delete" onclick="$(\'.confirmFlyout\').popup(\'close\');" data-theme="a">Cancel</button></p>'; html += '<p><button type="button" data-icon="delete" onclick="$(\'.confirmFlyout\').popup(\'close\');" data-theme="a">' + Globalize.translate('ButtonCancel') + '</button></p>';
} }
html += '</div>'; html += '</div>';
@ -514,9 +514,9 @@ var Dashboard = {
html += '<form>'; html += '<form>';
html += '<p><a data-mini="true" data-role="button" href="mypreferencesdisplay.html?userId=' + user.Id + '" data-icon="gear">My Preferences</button></a>'; html += '<p><a data-mini="true" data-role="button" href="mypreferencesdisplay.html?userId=' + user.Id + '" data-icon="gear">' + Globalize.translate('ButtonMyPreferences') + '</button></a>';
html += '<p><a data-mini="true" data-role="button" href="useredit.html?userId=' + user.Id + '" data-icon="user">My Profile</button></a>'; html += '<p><a data-mini="true" data-role="button" href="useredit.html?userId=' + user.Id + '" data-icon="user">' + Globalize.translate('ButtonMyProfile') + '</button></a>';
html += '<p><button data-mini="true" type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>'; html += '<p><button data-mini="true" type="button" onclick="Dashboard.logout();" data-icon="lock">' + Globalize.translate('ButtonSignOut') + '</button></p>';
html += '</form>'; html += '</form>';
html += '</div>'; html += '</div>';
@ -604,7 +604,6 @@ var Dashboard = {
var html = '<div class="content-secondary ui-bar-a toolsSidebar">'; var html = '<div class="content-secondary ui-bar-a toolsSidebar">';
//html += '<p class="libraryPanelHeader" style="margin: 25px 0 20px 20px;"><a href="index.html" class="imageLink"><img src="css/images/mblogoicon.png" style="height:28px;" /><span>MEDIA</span><span class="mediaBrowserAccent">BROWSER</span></a></p>';
html += '<br/>'; html += '<br/>';
html += '<div class="sidebarLinks">'; html += '<div class="sidebarLinks">';
@ -680,49 +679,49 @@ var Dashboard = {
var pageElem = page[0]; var pageElem = page[0];
return [{ return [{
name: "Server", name: Globalize.translate('TabServer'),
href: "dashboard.html", href: "dashboard.html",
selected: page.hasClass("dashboardHomePage") selected: page.hasClass("dashboardHomePage")
}, { }, {
name: "Users", name: Globalize.translate('TabUsers'),
href: "userprofiles.html", href: "userprofiles.html",
selected: page.hasClass("userProfilesConfigurationPage") || (pageElem.id == "mediaLibraryPage" && getParameterByName('userId')) selected: page.hasClass("userProfilesConfigurationPage") || (pageElem.id == "mediaLibraryPage" && getParameterByName('userId'))
}, { }, {
name: "Library", name: Globalize.translate('TabLibrary'),
divider: true, divider: true,
href: "library.html", href: "library.html",
selected: page.hasClass("mediaLibraryPage") selected: page.hasClass("mediaLibraryPage")
}, { }, {
name: "Metadata", name: Globalize.translate('TabMetadata'),
href: "metadata.html", href: "metadata.html",
selected: page.hasClass('metadataConfigurationPage') selected: page.hasClass('metadataConfigurationPage')
}, { }, {
name: "Auto-Organize", name: Globalize.translate('TabAutoOrganize'),
href: "autoorganizelog.html", href: "autoorganizelog.html",
selected: page.hasClass("organizePage") selected: page.hasClass("organizePage")
}, { }, {
name: "DLNA", name: Globalize.translate('TabDLNA'),
href: "dlnasettings.html", href: "dlnasettings.html",
selected: page.hasClass("dlnaPage") selected: page.hasClass("dlnaPage")
}, { }, {
name: "Live TV", name: Globalize.translate('TabLiveTV'),
href: "livetvstatus.html", href: "livetvstatus.html",
selected: page.hasClass("liveTvSettingsPage") selected: page.hasClass("liveTvSettingsPage")
}, { }, {
name: "Plugins", name: Globalize.translate('TabPlugins'),
href: "plugins.html", href: "plugins.html",
selected: page.hasClass("pluginConfigurationPage") selected: page.hasClass("pluginConfigurationPage")
}, { }, {
name: "Advanced", name: Globalize.translate('TabAdvanced'),
divider: true, divider: true,
href: "advanced.html", href: "advanced.html",
selected: page.hasClass("advancedConfigurationPage") selected: page.hasClass("advancedConfigurationPage")
}, { }, {
name: "Scheduled Tasks", name: Globalize.translate('TabScheduledTasks'),
href: "scheduledtasks.html", href: "scheduledtasks.html",
selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage" selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage"
}, { }, {
name: "Help", name: Globalize.translate('TabHelp'),
href: "support.html", href: "support.html",
selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage" || pageElem.id == "aboutPage" selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage" || pageElem.id == "aboutPage"
}]; }];
@ -802,7 +801,7 @@ var Dashboard = {
WebNotifications.show(notification); WebNotifications.show(notification);
} }
else { else {
Dashboard.showFooterNotification({ html: "<b>" + args.Header + ":&nbsp;&nbsp;&nbsp;</b>" + args.Text, timeout: args.TimeoutMs }); Dashboard.showFooterNotification({ html: "<div><b>" + args.Header + "</b></div>" + args.Text, timeout: args.TimeoutMs });
} }
break; break;
@ -931,7 +930,7 @@ var Dashboard = {
ApiClient.getItem(Dashboard.getCurrentUserId(), cmd.ItemId).done(function (item) { ApiClient.getItem(Dashboard.getCurrentUserId(), cmd.ItemId).done(function (item) {
Dashboard.navigate(LibraryBrowser.getHref(item)); Dashboard.navigate(LibraryBrowser.getHref(item, null, ''));
}); });
@ -957,16 +956,16 @@ var Dashboard = {
html += '<span style="margin-right: 1em;">'; html += '<span style="margin-right: 1em;">';
if (status == 'completed') { if (status == 'completed') {
html += installation.Name + ' ' + installation.Version + ' installation completed'; html += Globalize.translate('LabelPackageInstallCompleted').replace('{0}', installation.Name + ' ' + installation.Version);
} }
else if (status == 'cancelled') { else if (status == 'cancelled') {
html += installation.Name + ' ' + installation.Version + ' installation was cancelled'; html += Globalize.translate('LabelPackageInstallCancelled').replace('{0}', installation.Name + ' ' + installation.Version);
} }
else if (status == 'failed') { else if (status == 'failed') {
html += installation.Name + ' ' + installation.Version + ' installation failed'; html += Globalize.translate('LabelPackageInstallFailed').replace('{0}', installation.Name + ' ' + installation.Version);
} }
else if (status == 'progress') { else if (status == 'progress') {
html += 'Installing ' + installation.Name + ' ' + installation.Version; html += Globalize.translate('LabelInstallingPackage').replace('{0}', installation.Name + ' ' + installation.Version);
} }
html += '</span>'; html += '</span>';
@ -981,7 +980,7 @@ var Dashboard = {
if (percentComplete < 100) { if (percentComplete < 100) {
var btnId = "btnCancel" + installation.Id; var btnId = "btnCancel" + installation.Id;
html += '<button id="' + btnId + '" type="button" data-icon="delete" onclick="$(\'' + btnId + '\').buttonEnabled(false);Dashboard.cancelInstallation(\'' + installation.Id + '\');" data-theme="b" data-inline="true" data-mini="true">Cancel</button>'; html += '<button id="' + btnId + '" type="button" data-icon="delete" onclick="$(\'' + btnId + '\').buttonEnabled(false);Dashboard.cancelInstallation(\'' + installation.Id + '\');" data-theme="b" data-inline="true" data-mini="true">' + Globalize.translate('ButtonCancel') + '</button>';
} }
} }
@ -1111,54 +1110,6 @@ var Dashboard = {
return parts.join(':'); return parts.join(':');
}, },
ratePackage: function (link) {
var id = link.getAttribute('data-id');
var name = link.getAttribute('data-name');
var rating = link.getAttribute('data-rating');
var dialog = new RatingDialog($.mobile.activePage);
dialog.show({
header: "Rate and review " + name,
id: id,
rating: rating,
callback: function (review) {
console.log(review);
dialog.close();
ApiClient.createPackageReview(review).done(function () {
Dashboard.alert({
message: "Thank you for your review",
title: "Thank You"
});
});
}
});
},
getStoreRatingHtml: function (rating, id, name, noLinks) {
var html = "<div style='margin-left: 5px; margin-right: 5px; display: inline-block; vertical-align:middle;'>";
if (!rating) rating = 0;
for (var i = 1; i <= 5; i++) {
var title = noLinks ? rating + " stars" : "Rate " + i + (i > 1 ? " stars" : " star");
html += noLinks ? "" : "<span data-id=" + id + " data-name='" + name + "' data-rating=" + i + " onclick='Dashboard.ratePackage(this);return false;' >";
if (rating <= i - 1) {
html += "<div class='storeStarRating emptyStarRating' title='" + title + "'></div>";
} else if (rating < i) {
html += "<div class='storeStarRating halfStarRating' title='" + title + "'></div>";
} else {
html += "<div class='storeStarRating' title='" + title + "'></div>";
}
html += noLinks ? "" : "</span>";
}
html += "</div>";
return html;
},
populateLanguages: function (select, languages) { populateLanguages: function (select, languages) {
var html = ""; var html = "";
@ -1218,7 +1169,7 @@ var Dashboard = {
if (!window.WebSocket) { if (!window.WebSocket) {
alert("This browser does not support web sockets. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera."); alert(Globalize.translate('MessageBrowserDoesNotSupportWebSockets'));
} }
window.ApiClient = MediaBrowser.ApiClient.create("Dashboard", window.dashboardVersion); window.ApiClient = MediaBrowser.ApiClient.create("Dashboard", window.dashboardVersion);
@ -1247,19 +1198,19 @@ $(function () {
videoPlayerHtml += '<div class="videoTopControlsLogo"></div>'; videoPlayerHtml += '<div class="videoTopControlsLogo"></div>';
videoPlayerHtml += '<div class="videoAdvancedControls">'; videoPlayerHtml += '<div class="videoAdvancedControls">';
videoPlayerHtml += '<button class="imageButton mediaButton videoAudioButton" title="Audio tracks" type="button" data-icon="audiocd" data-iconpos="notext" data-inline="true">Audio Tracks</button>'; videoPlayerHtml += '<button class="imageButton mediaButton videoAudioButton" title="Audio tracks" type="button" data-icon="audiocd" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonAudioTracks') + '</button>';
videoPlayerHtml += '<div data-role="popup" class="videoAudioPopup videoPlayerPopup" data-history="false" data-theme="b"></div>'; videoPlayerHtml += '<div data-role="popup" class="videoAudioPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
videoPlayerHtml += '<button class="imageButton mediaButton videoSubtitleButton" title="Subtitles" type="button" data-icon="subtitles" data-iconpos="notext" data-inline="true">Subtitles</button>'; videoPlayerHtml += '<button class="imageButton mediaButton videoSubtitleButton" title="Subtitles" type="button" data-icon="subtitles" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonFullscreen') + '</button>';
videoPlayerHtml += '<div data-role="popup" class="videoSubtitlePopup videoPlayerPopup" data-history="false" data-theme="b"></div>'; videoPlayerHtml += '<div data-role="popup" class="videoSubtitlePopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
videoPlayerHtml += '<button class="mediaButton videoChaptersButton" title="Scenes" type="button" data-icon="video" data-iconpos="notext" data-inline="true">Scenes</button>'; videoPlayerHtml += '<button class="mediaButton videoChaptersButton" title="Scenes" type="button" data-icon="video" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonScenes') + '</button>';
videoPlayerHtml += '<div data-role="popup" class="videoChaptersPopup videoPlayerPopup" data-history="false" data-theme="b"></div>'; videoPlayerHtml += '<div data-role="popup" class="videoChaptersPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
videoPlayerHtml += '<button class="mediaButton videoQualityButton" title="Quality" type="button" data-icon="gear" data-iconpos="notext" data-inline="true">Quality</button>'; videoPlayerHtml += '<button class="mediaButton videoQualityButton" title="Quality" type="button" data-icon="gear" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonQuality') + '</button>';
videoPlayerHtml += '<div data-role="popup" class="videoQualityPopup videoPlayerPopup" data-history="false" data-theme="b"></div>'; videoPlayerHtml += '<div data-role="popup" class="videoQualityPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
videoPlayerHtml += '<button class="mediaButton" title="Stop" type="button" onclick="MediaPlayer.stop();" data-icon="delete" data-iconpos="notext" data-inline="true">Stop</button>'; videoPlayerHtml += '<button class="mediaButton" title="Stop" type="button" onclick="MediaPlayer.stop();" data-icon="delete" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonStop') + '</button>';
videoPlayerHtml += '</div>'; // videoAdvancedControls videoPlayerHtml += '</div>'; // videoAdvancedControls
videoPlayerHtml += '</div>'; // videoTopControls videoPlayerHtml += '</div>'; // videoTopControls
@ -1267,30 +1218,30 @@ $(function () {
// Create controls // Create controls
videoPlayerHtml += '<div class="videoControls hiddenOnIdle">'; videoPlayerHtml += '<div class="videoControls hiddenOnIdle">';
videoPlayerHtml += '<button id="video-previousTrackButton" class="mediaButton previousTrackButton" title="Previous Track" type="button" onclick="MediaPlayer.previousTrack();" data-icon="previous-track" data-iconpos="notext" data-inline="true">Previous Track</button>'; videoPlayerHtml += '<button id="video-previousTrackButton" class="mediaButton previousTrackButton" title="Previous Track" type="button" onclick="MediaPlayer.previousTrack();" data-icon="previous-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPreviousTrack') + '</button>';
videoPlayerHtml += '<button id="video-playButton" class="mediaButton" title="Play" type="button" onclick="MediaPlayer.unpause();" data-icon="play" data-iconpos="notext" data-inline="true">Play</button>'; videoPlayerHtml += '<button id="video-playButton" class="mediaButton" title="Play" type="button" onclick="MediaPlayer.unpause();" data-icon="play" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPlay') + '</button>';
videoPlayerHtml += '<button id="video-pauseButton" class="mediaButton" title="Pause" type="button" onclick="MediaPlayer.pause();" data-icon="pause" data-iconpos="notext" data-inline="true">Pause</button>'; videoPlayerHtml += '<button id="video-pauseButton" class="mediaButton" title="Pause" type="button" onclick="MediaPlayer.pause();" data-icon="pause" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPause') + '</button>';
videoPlayerHtml += '<button id="video-nextTrackButton" class="mediaButton nextTrackButton" title="Next Track" type="button" onclick="MediaPlayer.nextTrack();" data-icon="next-track" data-iconpos="notext" data-inline="true">Next Track</button>'; videoPlayerHtml += '<button id="video-nextTrackButton" class="mediaButton nextTrackButton" title="Next Track" type="button" onclick="MediaPlayer.nextTrack();" data-icon="next-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonNextTrack') + '</button>';
videoPlayerHtml += '<div class="positionSliderContainer sliderContainer">'; videoPlayerHtml += '<div class="positionSliderContainer sliderContainer">';
videoPlayerHtml += '<input type="range" class="mediaSlider positionSlider slider" step=".001" min="0" max="100" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />'; videoPlayerHtml += '<input type="range" class="mediaSlider positionSlider slider" step=".001" min="0" max="100" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
videoPlayerHtml += '</div>'; videoPlayerHtml += '</div>';
videoPlayerHtml += '<div class="currentTime"></div>'; videoPlayerHtml += '<div class="currentTime">--:--</div>';
videoPlayerHtml += '<div class="nowPlayingInfo hiddenOnIdle">'; videoPlayerHtml += '<div class="nowPlayingInfo hiddenOnIdle">';
videoPlayerHtml += '<div class="nowPlayingImage"></div>'; videoPlayerHtml += '<div class="nowPlayingImage"></div>';
videoPlayerHtml += '<div class="nowPlayingText"></div>'; videoPlayerHtml += '<div class="nowPlayingText"></div>';
videoPlayerHtml += '</div>'; // nowPlayingInfo videoPlayerHtml += '</div>'; // nowPlayingInfo
videoPlayerHtml += '<button id="video-muteButton" class="mediaButton muteButton" title="Mute" type="button" onclick="MediaPlayer.mute();" data-icon="audio" data-iconpos="notext" data-inline="true">Mute</button>'; videoPlayerHtml += '<button id="video-muteButton" class="mediaButton muteButton" title="Mute" type="button" onclick="MediaPlayer.mute();" data-icon="audio" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonMute') + '</button>';
videoPlayerHtml += '<button id="video-unmuteButton" class="mediaButton unmuteButton" title="Unmute" type="button" onclick="MediaPlayer.unMute();" data-icon="volume-off" data-iconpos="notext" data-inline="true">Unmute</button>'; videoPlayerHtml += '<button id="video-unmuteButton" class="mediaButton unmuteButton" title="Unmute" type="button" onclick="MediaPlayer.unMute();" data-icon="volume-off" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonUnmute') + '</button>';
videoPlayerHtml += '<div class="volumeSliderContainer sliderContainer">'; videoPlayerHtml += '<div class="volumeSliderContainer sliderContainer">';
videoPlayerHtml += '<input type="range" class="mediaSlider volumeSlider slider" step=".05" min="0" max="1" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />'; videoPlayerHtml += '<input type="range" class="mediaSlider volumeSlider slider" step=".05" min="0" max="1" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
videoPlayerHtml += '</div>'; videoPlayerHtml += '</div>';
videoPlayerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton" class="mediaButton fullscreenButton" title="Fullscreen" type="button" data-icon="expand" data-iconpos="notext" data-inline="true">Fullscreen</button>'; videoPlayerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton" class="mediaButton fullscreenButton" title="Fullscreen" type="button" data-icon="expand" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonFullscreen') + '</button>';
videoPlayerHtml += '</div>'; // videoControls videoPlayerHtml += '</div>'; // videoControls

View file

@ -43,10 +43,11 @@
<input type="hidden" name="notify_url" value="http://mb3admin.com/admin/service/services/ppipn.php"> <input type="hidden" name="notify_url" value="http://mb3admin.com/admin/service/services/ppipn.php">
<input type="hidden" name="return" id="paypalReturnUrl" value="#"> <input type="hidden" name="return" id="paypalReturnUrl" value="#">
<a data-role="button" data-icon="arrow-r" data-iconpos="right" onclick="$(this).parents('form')[0].submit();"> <a data-role="button" data-icon="arrow-r" data-iconpos="right" onclick="$(this).parents('form')[0].submit();">
<img src="css/images/supporter/donatepaypal.png" /></a> <img src="css/images/supporter/donatepaypal.png" />
</a>
</form> </form>
<p>${DonationNextStep}</p> <p>${DonationNextStep}</p>
<p><a href="supporterkey.html">Enter supporter key</a></p> <p><a href="supporterkey.html">${ButtonEnterSupporterKey}</a></p>
</div> </div>
</div> </div>
</div> </div>