mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
move user image into profile settings
This commit is contained in:
parent
c2ea67d056
commit
53cd8b0eb8
36 changed files with 376 additions and 372 deletions
|
@ -9,6 +9,7 @@
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="ui-btn-active lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="ui-btn-active lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
|
<a href="#" class="lnkMyProfile">${TabProfile}</a>
|
||||||
<a href="#" class="lnkWebClientPreferences">${TabWebClient}</a>
|
<a href="#" class="lnkWebClientPreferences">${TabWebClient}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="ui-btn-active lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="ui-btn-active lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
|
<a href="#" class="lnkMyProfile">${TabProfile}</a>
|
||||||
<a href="#" class="lnkWebClientPreferences">${TabWebClient}</a>
|
<a href="#" class="lnkWebClientPreferences">${TabWebClient}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
|
<a href="#" class="lnkMyProfile">${TabProfile}</a>
|
||||||
<a href="#" class="ui-btn-active lnkWebClientPreferences">${TabWebClient}</a>
|
<a href="#" class="ui-btn-active lnkWebClientPreferences">${TabWebClient}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
56
dashboard-ui/myprofile.html
Normal file
56
dashboard-ui/myprofile.html
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>${TitleMediaBrowser}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="userImagePage" data-role="page" class="page libraryPage userPreferencesPage" data-theme="b" data-contextname="${HeaderPreferences}">
|
||||||
|
|
||||||
|
<div class="libraryViewNav">
|
||||||
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
|
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
|
<a href="#" class="ui-btn-active lnkMyProfile">${TabProfile}</a>
|
||||||
|
<a href="#" class="lnkWebClientPreferences">${TabWebClient}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div class="readOnlyContent" style="margin: 0 auto; padding: 0 1em;">
|
||||||
|
<div id="fldImage" style="display:inline-block;"></div>
|
||||||
|
|
||||||
|
<div style="vertical-align:top;margin: .5em 0 0 1em;display:inline-block;">
|
||||||
|
<h2 class="username" style="margin: 0;"></h2>
|
||||||
|
<button id="btnDeleteImage" type="button" data-icon="delete" style="display: none;margin-top:1em;">
|
||||||
|
${ButtonDeleteImage}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="newImageForm" style="display:none;margin: 1em auto 0;">
|
||||||
|
|
||||||
|
<div data-role="collapsible">
|
||||||
|
<h2 id="headerUploadNewImage" style="display: none;">${HeaderUploadNewImage}</h2>
|
||||||
|
<div>
|
||||||
|
<div id="fldNewImage">
|
||||||
|
<p>${ImageUploadAspectRatioHelp}</p>
|
||||||
|
<input type="file" accept="image/*" id="uploadUserImage" name="uploadUserImage" onchange="MyProfilePage.onFileUploadChange(this);" />
|
||||||
|
|
||||||
|
<div id="userImageDropZone" class="imageDropZone">
|
||||||
|
<h3>${LabelDropImageHere}</h3>
|
||||||
|
<output id="userImageOutput"></output>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="fldNewImagePreview"></div>
|
||||||
|
<div id="fldUpload" style="display: none;">
|
||||||
|
<button type="submit" data-icon="check">${ButtonUpload}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('.newImageForm').off('submit', MyProfilePage.onImageSubmit).on('submit', MyProfilePage.onImageSubmit);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,10 +1,10 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
$(document).on('pageshow', "#aboutPage", function () {
|
$(document).on('pageshow', "#aboutPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
apiClient.getSystemInfo().done(function (info) {
|
ApiClient.getSystemInfo().done(function (info) {
|
||||||
|
|
||||||
var elem = $('#appVersionNumber', page);
|
var elem = $('#appVersionNumber', page);
|
||||||
|
|
||||||
|
@ -12,4 +12,4 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -34,7 +34,7 @@
|
||||||
var options = {
|
var options = {
|
||||||
|
|
||||||
SortBy: "IsFavoriteOrLiked,Random",
|
SortBy: "IsFavoriteOrLiked,Random",
|
||||||
Limit: 50,
|
Limit: 20,
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
IncludeItemTypes: types,
|
IncludeItemTypes: types,
|
||||||
ImageTypes: "Backdrop",
|
ImageTypes: "Backdrop",
|
||||||
|
@ -61,7 +61,9 @@
|
||||||
|
|
||||||
function showBackdrop(type) {
|
function showBackdrop(type) {
|
||||||
|
|
||||||
getBackdropItemIds(Dashboard.getCurrentUserId(), type, LibraryMenu.getTopParentId()).done(function (images) {
|
getBackdropItemIds(Dashboard.getCurrentUserId(),
|
||||||
|
type,
|
||||||
|
LibraryMenu.getTopParentId()).done(function (images) {
|
||||||
|
|
||||||
if (images.length) {
|
if (images.length) {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function getSections() {
|
function getSections() {
|
||||||
|
|
||||||
|
@ -112,4 +112,4 @@
|
||||||
loadSections(page, userId);
|
loadSections(page, userId);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function loadSections(page, userId) {
|
function loadSections(page, userId) {
|
||||||
|
|
||||||
|
@ -34,4 +34,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function getUserViews(userId) {
|
function getUserViews(userId) {
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document, ApiClient);
|
||||||
|
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function getDefaultSection(index) {
|
function getDefaultSection(index) {
|
||||||
|
|
||||||
|
@ -595,4 +595,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -272,8 +272,6 @@
|
||||||
'' :
|
'' :
|
||||||
getTopParentId() || '';
|
getTopParentId() || '';
|
||||||
|
|
||||||
sessionStore.setItem('topParentId', id);
|
|
||||||
|
|
||||||
$('.lnkMediaFolder').each(function () {
|
$('.lnkMediaFolder').each(function () {
|
||||||
|
|
||||||
var itemId = this.getAttribute('data-itemid');
|
var itemId = this.getAttribute('data-itemid');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
var programs;
|
var programs;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var query = {
|
var query = {
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
|
|
||||||
showLoadingMessage(page);
|
showLoadingMessage(page);
|
||||||
|
|
||||||
apiClient.getLiveTvChannels(query).done(function (result) {
|
ApiClient.getLiveTvChannels(query).done(function (result) {
|
||||||
|
|
||||||
renderChannels(page, result);
|
renderChannels(page, result);
|
||||||
|
|
||||||
|
@ -134,4 +134,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
// 30 mins
|
// 30 mins
|
||||||
var cellCurationMinutes = 30;
|
var cellCurationMinutes = 30;
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
channelQuery.userId = Dashboard.getCurrentUserId();
|
channelQuery.userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
channelsPromise = channelsPromise || apiClient.getLiveTvChannels(channelQuery);
|
channelsPromise = channelsPromise || ApiClient.getLiveTvChannels(channelQuery);
|
||||||
|
|
||||||
var date = currentDate;
|
var date = currentDate;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
console.log(nextDay);
|
console.log(nextDay);
|
||||||
channelsPromise.done(function (channelsResult) {
|
channelsPromise.done(function (channelsResult) {
|
||||||
|
|
||||||
apiClient.getLiveTvPrograms({
|
ApiClient.getLiveTvPrograms({
|
||||||
UserId: Dashboard.getCurrentUserId(),
|
UserId: Dashboard.getCurrentUserId(),
|
||||||
MaxStartDate: nextDay.toISOString(),
|
MaxStartDate: nextDay.toISOString(),
|
||||||
MinEndDate: date.toISOString(),
|
MinEndDate: date.toISOString(),
|
||||||
|
@ -451,13 +451,13 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
apiClient.getLiveTvGuideInfo().done(function (guideInfo) {
|
ApiClient.getLiveTvGuideInfo().done(function (guideInfo) {
|
||||||
|
|
||||||
setDateRange(page, guideInfo);
|
setDateRange(page, guideInfo);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
||||||
|
|
||||||
(function ($, document, window) {
|
(function ($, document, window) {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var currentProgram;
|
var currentProgram;
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
var programId = getParameterByName('programid');
|
var programId = getParameterByName('programid');
|
||||||
|
|
||||||
var promise1 = apiClient.getNewLiveTvTimerDefaults({ programId: programId });
|
var promise1 = ApiClient.getNewLiveTvTimerDefaults({ programId: programId });
|
||||||
var promise2 = apiClient.getLiveTvProgram(programId, Dashboard.getCurrentUserId());
|
var promise2 = ApiClient.getLiveTvProgram(programId, Dashboard.getCurrentUserId());
|
||||||
|
|
||||||
$.when(promise1, promise2).done(function (response1, response2) {
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
|
|
||||||
var programId = getParameterByName('programid');
|
var programId = getParameterByName('programid');
|
||||||
|
|
||||||
apiClient.getNewLiveTvTimerDefaults({ programId: programId }).done(function (item) {
|
ApiClient.getNewLiveTvTimerDefaults({ programId: programId }).done(function (item) {
|
||||||
|
|
||||||
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
||||||
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
if ($('#chkRecordSeries', form).checked()) {
|
if ($('#chkRecordSeries', form).checked()) {
|
||||||
|
|
||||||
apiClient.createLiveTvSeriesTimer(item).done(function () {
|
ApiClient.createLiveTvSeriesTimer(item).done(function () {
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
Dashboard.navigate('livetvseriestimers.html');
|
Dashboard.navigate('livetvseriestimers.html');
|
||||||
|
@ -131,7 +131,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
apiClient.createLiveTvTimer(item).done(function () {
|
ApiClient.createLiveTvTimer(item).done(function () {
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
Dashboard.navigate('livetvtimers.html');
|
Dashboard.navigate('livetvtimers.html');
|
||||||
|
@ -185,4 +185,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
|
||||||
|
@ -132,4 +132,4 @@
|
||||||
currentItem = null;
|
currentItem = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
var id = getParameterByName('id');
|
var id = getParameterByName('id');
|
||||||
|
|
||||||
apiClient.getLiveTvRecording(id, Dashboard.getCurrentUserId()).done(function (result) {
|
ApiClient.getLiveTvRecording(id, Dashboard.getCurrentUserId()).done(function (result) {
|
||||||
|
|
||||||
renderRecording(page, result);
|
renderRecording(page, result);
|
||||||
|
|
||||||
|
@ -115,4 +115,4 @@
|
||||||
currentItem = null;
|
currentItem = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function getRecordingGroupHtml(group) {
|
function getRecordingGroupHtml(group) {
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
apiClient.getLiveTvRecordings({
|
ApiClient.getLiveTvRecordings({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsInProgress: true
|
IsInProgress: true
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
apiClient.getLiveTvRecordings({
|
ApiClient.getLiveTvRecordings({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
limit: 12,
|
limit: 12,
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
apiClient.getLiveTvRecordingGroups({
|
ApiClient.getLiveTvRecordingGroups({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId()
|
userId: Dashboard.getCurrentUserId()
|
||||||
|
|
||||||
|
@ -109,4 +109,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function (window, $, document, apiClient) {
|
(function (window, $, document) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
|
|
||||||
var form = this;
|
var form = this;
|
||||||
|
|
||||||
apiClient.getLiveTvSeriesTimer(currentItem.Id).done(function (item) {
|
ApiClient.getLiveTvSeriesTimer(currentItem.Id).done(function (item) {
|
||||||
|
|
||||||
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
||||||
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
||||||
|
@ -235,13 +235,13 @@
|
||||||
|
|
||||||
var id = getParameterByName('id');
|
var id = getParameterByName('id');
|
||||||
|
|
||||||
apiClient.getLiveTvSeriesTimer(id).done(function (result) {
|
ApiClient.getLiveTvSeriesTimer(id).done(function (result) {
|
||||||
|
|
||||||
renderTimer(page, result);
|
renderTimer(page, result);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
apiClient.getLiveTvRecordings({
|
ApiClient.getLiveTvRecordings({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
seriesTimerId: id
|
seriesTimerId: id
|
||||||
|
@ -252,7 +252,7 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
apiClient.getLiveTvTimers({
|
ApiClient.getLiveTvTimers({
|
||||||
|
|
||||||
seriesTimerId: id
|
seriesTimerId: id
|
||||||
|
|
||||||
|
@ -297,4 +297,4 @@
|
||||||
|
|
||||||
window.LiveTvSeriesTimerPage = new liveTvSeriesTimerPage();
|
window.LiveTvSeriesTimerPage = new liveTvSeriesTimerPage();
|
||||||
|
|
||||||
})(window, jQuery, document, ApiClient);
|
})(window, jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
var query = {
|
var query = {
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
apiClient.getLiveTvSeriesTimers(query).done(function (result) {
|
ApiClient.getLiveTvSeriesTimers(query).done(function (result) {
|
||||||
|
|
||||||
renderTimers(page, result.Items);
|
renderTimers(page, result.Items);
|
||||||
|
|
||||||
|
@ -143,4 +143,4 @@
|
||||||
updateFilterControls(this);
|
updateFilterControls(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,10 +1,10 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function reload(page) {
|
function reload(page) {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
apiClient.getLiveTvRecommendedPrograms({
|
ApiClient.getLiveTvRecommendedPrograms({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: true,
|
IsAiring: true,
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
$('.activeProgramItems', page).html(html).createCardMenus();
|
$('.activeProgramItems', page).html(html).createCardMenus();
|
||||||
});
|
});
|
||||||
|
|
||||||
apiClient.getLiveTvRecommendedPrograms({
|
ApiClient.getLiveTvRecommendedPrograms({
|
||||||
|
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
IsAiring: false,
|
IsAiring: false,
|
||||||
|
@ -58,4 +58,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function (window, $, document, apiClient) {
|
(function (window, $, document) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
var form = this;
|
var form = this;
|
||||||
|
|
||||||
apiClient.getLiveTvTimer(currentItem.Id).done(function (item) {
|
ApiClient.getLiveTvTimer(currentItem.Id).done(function (item) {
|
||||||
|
|
||||||
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
item.PrePaddingSeconds = $('#txtPrePaddingSeconds', form).val() * 60;
|
||||||
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
item.PostPaddingSeconds = $('#txtPostPaddingSeconds', form).val() * 60;
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
var id = getParameterByName('id');
|
var id = getParameterByName('id');
|
||||||
|
|
||||||
apiClient.getLiveTvTimer(id).done(function (result) {
|
ApiClient.getLiveTvTimer(id).done(function (result) {
|
||||||
|
|
||||||
renderTimer(page, result);
|
renderTimer(page, result);
|
||||||
|
|
||||||
|
@ -133,4 +133,4 @@
|
||||||
|
|
||||||
window.LiveTvTimerPage = new liveTvTimerPage();
|
window.LiveTvTimerPage = new liveTvTimerPage();
|
||||||
|
|
||||||
})(window, jQuery, document, ApiClient);
|
})(window, jQuery, document);
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function deleteTimer(page, id) {
|
function deleteTimer(page, id) {
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
apiClient.getLiveTvTimers().done(function (result) {
|
ApiClient.getLiveTvTimers().done(function (result) {
|
||||||
|
|
||||||
renderTimers(page, result.Items);
|
renderTimers(page, result.Items);
|
||||||
|
|
||||||
|
@ -114,4 +114,4 @@
|
||||||
reload(page);
|
reload(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -237,6 +237,7 @@
|
||||||
$('.lnkDisplayPreferences', page).attr('href', 'mypreferencesdisplay.html?userId=' + userId);
|
$('.lnkDisplayPreferences', page).attr('href', 'mypreferencesdisplay.html?userId=' + userId);
|
||||||
$('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId);
|
$('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId);
|
||||||
$('.lnkWebClientPreferences', page).attr('href', 'mypreferenceswebclient.html?userId=' + userId);
|
$('.lnkWebClientPreferences', page).attr('href', 'mypreferenceswebclient.html?userId=' + userId);
|
||||||
|
$('.lnkMyProfile', page).attr('href', 'myprofile.html?userId=' + userId);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.DisplayPreferencesPage = {
|
window.DisplayPreferencesPage = {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
ApiClient.getUser(userId).done(function (user) {
|
ApiClient.getUser(userId).done(function (user) {
|
||||||
|
|
||||||
|
$('.username', page).html(user.Name);
|
||||||
$('#uploadUserImage', page).val('').trigger('change');
|
$('#uploadUserImage', page).val('').trigger('change');
|
||||||
|
|
||||||
Dashboard.setPageTitle(user.Name);
|
Dashboard.setPageTitle(user.Name);
|
||||||
|
@ -22,24 +23,24 @@
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#fldImage', page).show().html('').html("<img height='200px' src='" + imageUrl + "' />");
|
$('#fldImage', page).show().html('').html("<img width='140px' src='" + imageUrl + "' />");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.ConnectLinkType == 'Guest') {
|
if (user.ConnectLinkType == 'Guest') {
|
||||||
|
|
||||||
$('.newImageSection', page).hide();
|
$('.newImageForm', page).hide();
|
||||||
$('#fldDeleteImage', page).hide();
|
$('#btnDeleteImage', page).hide();
|
||||||
}
|
}
|
||||||
else if (user.PrimaryImageTag) {
|
else if (user.PrimaryImageTag) {
|
||||||
|
|
||||||
$('#fldDeleteImage', page).show();
|
$('#btnDeleteImage', page).show();
|
||||||
$('#headerUploadNewImage', page).show();
|
$('#headerUploadNewImage', page).show();
|
||||||
$('.newImageSection', page).show();
|
$('.newImageForm', page).show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('.newImageSection', page).show();
|
$('.newImageSection', page).show();
|
||||||
$('#fldImage', page).hide().html('');
|
$('#fldImage', page).hide().html('');
|
||||||
$('#fldDeleteImage', page).hide();
|
$('#btnDeleteImage', page).hide();
|
||||||
$('#headerUploadNewImage', page).hide();
|
$('#headerUploadNewImage', page).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,11 +140,11 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function userImagePage() {
|
function myProfilePage() {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.onSubmit = function () {
|
self.onImageSubmit = function () {
|
||||||
|
|
||||||
var file = currentFile;
|
var file = currentFile;
|
||||||
|
|
||||||
|
@ -164,29 +165,13 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.deleteImage = function () {
|
|
||||||
|
|
||||||
Dashboard.confirm(Globalize.translate('DeleteImageConfirmation'), Globalize.translate('DeleteImage'), function (result) {
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
|
||||||
|
|
||||||
var userId = getParameterByName("userId");
|
|
||||||
|
|
||||||
ApiClient.deleteUserImage(userId, "primary").done(processImageChangeResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
self.onFileUploadChange = function (fileUpload) {
|
self.onFileUploadChange = function (fileUpload) {
|
||||||
|
|
||||||
setFiles($.mobile.activePage, fileUpload.files);
|
setFiles($.mobile.activePage, fileUpload.files);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
window.UserImagePage = new userImagePage();
|
window.MyProfilePage = new myProfilePage();
|
||||||
|
|
||||||
$(document).on('pagebeforeshow', "#userImagePage", function () {
|
$(document).on('pagebeforeshow', "#userImagePage", function () {
|
||||||
|
|
||||||
|
@ -201,7 +186,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#userImagePage", function () {
|
}).on('pageinit', "#userImagePage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -209,11 +194,21 @@
|
||||||
|
|
||||||
$("#userImageDropZone", page).on('dragover', onImageDragOver).on('drop', onImageDrop);
|
$("#userImageDropZone", page).on('dragover', onImageDragOver).on('drop', onImageDrop);
|
||||||
|
|
||||||
}).on('pagehide', "#userImagePage", function () {
|
$('#btnDeleteImage', page).on('click', function () {
|
||||||
|
|
||||||
var page = this;
|
Dashboard.confirm(Globalize.translate('DeleteImageConfirmation'), Globalize.translate('DeleteImage'), function (result) {
|
||||||
|
|
||||||
$("#userImageDropZone", page).off('dragover', onImageDragOver).off('drop', onImageDrop);
|
if (result) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var userId = getParameterByName("userId");
|
||||||
|
|
||||||
|
ApiClient.deleteUserImage(userId, "primary").done(processImageChangeResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, apiClient) {
|
(function ($, document) {
|
||||||
|
|
||||||
function revoke(page, key) {
|
function revoke(page, key) {
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
type: "DELETE",
|
type: "DELETE",
|
||||||
url: apiClient.getUrl('Auth/Keys/' + key)
|
url: ApiClient.getUrl('Auth/Keys/' + key)
|
||||||
|
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
|
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: apiClient.getUrl('Auth/Keys/', {
|
url: ApiClient.getUrl('Auth/Keys/', {
|
||||||
|
|
||||||
App: $('#txtAppName', form).val()
|
App: $('#txtAppName', form).val()
|
||||||
|
|
||||||
|
@ -142,4 +142,4 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery, document, ApiClient);
|
})(jQuery, document);
|
|
@ -97,6 +97,32 @@ var Dashboard = {
|
||||||
return store.getItem('token');
|
return store.getItem('token');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
serverAddress: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
store.setItem('serverAddress', val);
|
||||||
|
}
|
||||||
|
|
||||||
|
var address = store.getItem('serverAddress');
|
||||||
|
|
||||||
|
if (!address) {
|
||||||
|
var loc = window.location;
|
||||||
|
|
||||||
|
address = loc.protocol + '//' + loc.hostname;
|
||||||
|
|
||||||
|
if (loc.port) {
|
||||||
|
address += ':' + loc.port;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return address;
|
||||||
|
},
|
||||||
|
|
||||||
|
changeServer: function () {
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
getCurrentUserId: function () {
|
getCurrentUserId: function () {
|
||||||
|
|
||||||
var autoLoginUserId = getParameterByName('u');
|
var autoLoginUserId = getParameterByName('u');
|
||||||
|
@ -1165,7 +1191,7 @@ var Dashboard = {
|
||||||
alert(Globalize.translate('MessageBrowserDoesNotSupportWebSockets'));
|
alert(Globalize.translate('MessageBrowserDoesNotSupportWebSockets'));
|
||||||
}
|
}
|
||||||
|
|
||||||
window.ApiClient = MediaBrowser.ApiClient.create("Dashboard", window.dashboardVersion, MediaBrowser.ApiClient.generateDeviceName(), MediaBrowser.ApiClient.generateDeviceId());
|
window.ApiClient = new MediaBrowser.ApiClient(Dashboard.serverAddress(), "Dashboard", window.dashboardVersion, MediaBrowser.ApiClient.generateDeviceName(), MediaBrowser.ApiClient.generateDeviceId());
|
||||||
|
|
||||||
$(ApiClient).on("websocketopen", Dashboard.onWebSocketOpened)
|
$(ApiClient).on("websocketopen", Dashboard.onWebSocketOpened)
|
||||||
.on("websocketmessage", Dashboard.onWebSocketMessageReceived);
|
.on("websocketmessage", Dashboard.onWebSocketMessageReceived);
|
||||||
|
|
|
@ -260,6 +260,7 @@
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
loadData(page);
|
loadData(page);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, window, document);
|
})(jQuery, window, document);
|
|
@ -58,6 +58,8 @@
|
||||||
|
|
||||||
function loadUser(page, user, loggedInUser, mediaFolders, channels) {
|
function loadUser(page, user, loggedInUser, mediaFolders, channels) {
|
||||||
|
|
||||||
|
$(page).trigger('userloaded', [user]);
|
||||||
|
|
||||||
Dashboard.setPageTitle(user.Name);
|
Dashboard.setPageTitle(user.Name);
|
||||||
|
|
||||||
loadChannels(page, user, channels);
|
loadChannels(page, user, channels);
|
||||||
|
|
20
dashboard-ui/thirdparty/apiclient/connectionmanager.js
vendored
Normal file
20
dashboard-ui/thirdparty/apiclient/connectionmanager.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
if (!window.MediaBrowser) {
|
||||||
|
window.MediaBrowser = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
MediaBrowser.ConnectionManager = function () {
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
self.getServers = function (currentApiClient) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
self.changeServer = function (currentApiClient, server) {
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}();
|
|
@ -2279,7 +2279,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
var url = self.getUrl("Users/authenticatebyname");
|
var url = self.getUrl("Users/authenticatebyname");
|
||||||
|
|
||||||
var postData = {
|
var postData = {
|
||||||
password: MediaBrowser.SHA1(password || ""),
|
password: sha1(password || ""),
|
||||||
Username: name
|
Username: name
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2292,32 +2292,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Authenticates a user
|
|
||||||
* @param {String} userId
|
|
||||||
* @param {String} password
|
|
||||||
*/
|
|
||||||
self.authenticateUser = function (userId, password) {
|
|
||||||
|
|
||||||
if (!userId) {
|
|
||||||
throw new Error("null userId");
|
|
||||||
}
|
|
||||||
|
|
||||||
var url = self.getUrl("Users/" + userId + "/authenticate");
|
|
||||||
|
|
||||||
var postData = {
|
|
||||||
password: MediaBrowser.SHA1(password || "")
|
|
||||||
};
|
|
||||||
|
|
||||||
return self.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: url,
|
|
||||||
data: JSON.stringify(postData),
|
|
||||||
dataType: "json",
|
|
||||||
contentType: "application/json"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a user's password
|
* Updates a user's password
|
||||||
* @param {String} userId
|
* @param {String} userId
|
||||||
|
@ -2336,7 +2310,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
postData.currentPassword = MediaBrowser.SHA1(currentPassword);
|
postData.currentPassword = sha1(currentPassword);
|
||||||
|
|
||||||
if (newPassword) {
|
if (newPassword) {
|
||||||
postData.newPassword = newPassword;
|
postData.newPassword = newPassword;
|
||||||
|
@ -3237,7 +3211,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
}
|
}
|
||||||
|
|
||||||
keys.push(randomId);
|
keys.push(randomId);
|
||||||
return MediaBrowser.SHA1(keys.join('|'));
|
return sha1(keys.join('|'));
|
||||||
};
|
};
|
||||||
|
|
||||||
MediaBrowser.ApiClient.generateDeviceName = function () {
|
MediaBrowser.ApiClient.generateDeviceName = function () {
|
||||||
|
@ -3274,194 +3248,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
|
|
||||||
})(window.store);
|
})(window.store);
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides a friendly way to create an api client instance using information from the browser's current url
|
|
||||||
*/
|
|
||||||
MediaBrowser.ApiClient.create = function (clientName, applicationVersion, deviceName, deviceId) {
|
|
||||||
|
|
||||||
var loc = window.location;
|
|
||||||
|
|
||||||
var address = loc.protocol + '//' + loc.hostname;
|
|
||||||
|
|
||||||
if (loc.port) {
|
|
||||||
address += ':' + loc.port;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new MediaBrowser.ApiClient(address, clientName, applicationVersion, deviceName, deviceId);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Secure Hash Algorithm (SHA1)
|
|
||||||
* http://www.webtoolkit.info/
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
MediaBrowser.SHA1 = function (msg) {
|
|
||||||
|
|
||||||
function rotate_left(n, s) {
|
|
||||||
var t4 = (n << s) | (n >>> (32 - s));
|
|
||||||
return t4;
|
|
||||||
}
|
|
||||||
|
|
||||||
function lsb_hex(val) {
|
|
||||||
var str = "";
|
|
||||||
var i;
|
|
||||||
var vh;
|
|
||||||
var vl;
|
|
||||||
|
|
||||||
for (i = 0; i <= 6; i += 2) {
|
|
||||||
vh = (val >>> (i * 4 + 4)) & 0x0f;
|
|
||||||
vl = (val >>> (i * 4)) & 0x0f;
|
|
||||||
str += vh.toString(16) + vl.toString(16);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
function cvt_hex(val) {
|
|
||||||
var str = "";
|
|
||||||
var i;
|
|
||||||
var v;
|
|
||||||
|
|
||||||
for (i = 7; i >= 0; i--) {
|
|
||||||
v = (val >>> (i * 4)) & 0x0f;
|
|
||||||
str += v.toString(16);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Utf8Encode(string) {
|
|
||||||
string = string.replace(/\r\n/g, "\n");
|
|
||||||
var utftext = "";
|
|
||||||
|
|
||||||
for (var n = 0; n < string.length; n++) {
|
|
||||||
|
|
||||||
var c = string.charCodeAt(n);
|
|
||||||
|
|
||||||
if (c < 128) {
|
|
||||||
utftext += String.fromCharCode(c);
|
|
||||||
}
|
|
||||||
else if ((c > 127) && (c < 2048)) {
|
|
||||||
utftext += String.fromCharCode((c >> 6) | 192);
|
|
||||||
utftext += String.fromCharCode((c & 63) | 128);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
utftext += String.fromCharCode((c >> 12) | 224);
|
|
||||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
|
||||||
utftext += String.fromCharCode((c & 63) | 128);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return utftext;
|
|
||||||
}
|
|
||||||
|
|
||||||
var blockstart;
|
|
||||||
var i, j;
|
|
||||||
var W = new Array(80);
|
|
||||||
var H0 = 0x67452301;
|
|
||||||
var H1 = 0xEFCDAB89;
|
|
||||||
var H2 = 0x98BADCFE;
|
|
||||||
var H3 = 0x10325476;
|
|
||||||
var H4 = 0xC3D2E1F0;
|
|
||||||
var A, B, C, D, E;
|
|
||||||
var temp;
|
|
||||||
|
|
||||||
msg = Utf8Encode(msg);
|
|
||||||
|
|
||||||
var msg_len = msg.length;
|
|
||||||
|
|
||||||
var word_array = new Array();
|
|
||||||
for (i = 0; i < msg_len - 3; i += 4) {
|
|
||||||
j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 |
|
|
||||||
msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3);
|
|
||||||
word_array.push(j);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (msg_len % 4) {
|
|
||||||
case 0:
|
|
||||||
i = 0x080000000;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
i = msg.charCodeAt(msg_len - 1) << 24 | 0x0800000;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
i = msg.charCodeAt(msg_len - 2) << 24 | msg.charCodeAt(msg_len - 1) << 16 | 0x08000;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
i = msg.charCodeAt(msg_len - 3) << 24 | msg.charCodeAt(msg_len - 2) << 16 | msg.charCodeAt(msg_len - 1) << 8 | 0x80;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
word_array.push(i);
|
|
||||||
|
|
||||||
while ((word_array.length % 16) != 14) word_array.push(0);
|
|
||||||
|
|
||||||
word_array.push(msg_len >>> 29);
|
|
||||||
word_array.push((msg_len << 3) & 0x0ffffffff);
|
|
||||||
|
|
||||||
|
|
||||||
for (blockstart = 0; blockstart < word_array.length; blockstart += 16) {
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) W[i] = word_array[blockstart + i];
|
|
||||||
for (i = 16; i <= 79; i++) W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
|
|
||||||
|
|
||||||
A = H0;
|
|
||||||
B = H1;
|
|
||||||
C = H2;
|
|
||||||
D = H3;
|
|
||||||
E = H4;
|
|
||||||
|
|
||||||
for (i = 0; i <= 19; i++) {
|
|
||||||
temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;
|
|
||||||
E = D;
|
|
||||||
D = C;
|
|
||||||
C = rotate_left(B, 30);
|
|
||||||
B = A;
|
|
||||||
A = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 20; i <= 39; i++) {
|
|
||||||
temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
||||||
E = D;
|
|
||||||
D = C;
|
|
||||||
C = rotate_left(B, 30);
|
|
||||||
B = A;
|
|
||||||
A = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 40; i <= 59; i++) {
|
|
||||||
temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
||||||
E = D;
|
|
||||||
D = C;
|
|
||||||
C = rotate_left(B, 30);
|
|
||||||
B = A;
|
|
||||||
A = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 60; i <= 79; i++) {
|
|
||||||
temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;
|
|
||||||
E = D;
|
|
||||||
D = C;
|
|
||||||
C = rotate_left(B, 30);
|
|
||||||
B = A;
|
|
||||||
A = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
H0 = (H0 + A) & 0x0ffffffff;
|
|
||||||
H1 = (H1 + B) & 0x0ffffffff;
|
|
||||||
H2 = (H2 + C) & 0x0ffffffff;
|
|
||||||
H3 = (H3 + D) & 0x0ffffffff;
|
|
||||||
H4 = (H4 + E) & 0x0ffffffff;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
|
|
||||||
|
|
||||||
return temp.toLowerCase();
|
|
||||||
};
|
|
||||||
|
|
||||||
(function (jQuery, window, undefined) {
|
(function (jQuery, window, undefined) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
171
dashboard-ui/thirdparty/apiclient/sha1.js
vendored
Normal file
171
dashboard-ui/thirdparty/apiclient/sha1.js
vendored
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Secure Hash Algorithm (SHA1)
|
||||||
|
* http://www.webtoolkit.info/
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
var sha1 = function (msg) {
|
||||||
|
|
||||||
|
function rotate_left(n, s) {
|
||||||
|
var t4 = (n << s) | (n >>> (32 - s));
|
||||||
|
return t4;
|
||||||
|
}
|
||||||
|
|
||||||
|
function lsb_hex(val) {
|
||||||
|
var str = "";
|
||||||
|
var i;
|
||||||
|
var vh;
|
||||||
|
var vl;
|
||||||
|
|
||||||
|
for (i = 0; i <= 6; i += 2) {
|
||||||
|
vh = (val >>> (i * 4 + 4)) & 0x0f;
|
||||||
|
vl = (val >>> (i * 4)) & 0x0f;
|
||||||
|
str += vh.toString(16) + vl.toString(16);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cvt_hex(val) {
|
||||||
|
var str = "";
|
||||||
|
var i;
|
||||||
|
var v;
|
||||||
|
|
||||||
|
for (i = 7; i >= 0; i--) {
|
||||||
|
v = (val >>> (i * 4)) & 0x0f;
|
||||||
|
str += v.toString(16);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Utf8Encode(string) {
|
||||||
|
string = string.replace(/\r\n/g, "\n");
|
||||||
|
var utftext = "";
|
||||||
|
|
||||||
|
for (var n = 0; n < string.length; n++) {
|
||||||
|
|
||||||
|
var c = string.charCodeAt(n);
|
||||||
|
|
||||||
|
if (c < 128) {
|
||||||
|
utftext += String.fromCharCode(c);
|
||||||
|
}
|
||||||
|
else if ((c > 127) && (c < 2048)) {
|
||||||
|
utftext += String.fromCharCode((c >> 6) | 192);
|
||||||
|
utftext += String.fromCharCode((c & 63) | 128);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
utftext += String.fromCharCode((c >> 12) | 224);
|
||||||
|
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||||
|
utftext += String.fromCharCode((c & 63) | 128);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return utftext;
|
||||||
|
}
|
||||||
|
|
||||||
|
var blockstart;
|
||||||
|
var i, j;
|
||||||
|
var W = new Array(80);
|
||||||
|
var H0 = 0x67452301;
|
||||||
|
var H1 = 0xEFCDAB89;
|
||||||
|
var H2 = 0x98BADCFE;
|
||||||
|
var H3 = 0x10325476;
|
||||||
|
var H4 = 0xC3D2E1F0;
|
||||||
|
var A, B, C, D, E;
|
||||||
|
var temp;
|
||||||
|
|
||||||
|
msg = Utf8Encode(msg);
|
||||||
|
|
||||||
|
var msg_len = msg.length;
|
||||||
|
|
||||||
|
var word_array = new Array();
|
||||||
|
for (i = 0; i < msg_len - 3; i += 4) {
|
||||||
|
j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 |
|
||||||
|
msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3);
|
||||||
|
word_array.push(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (msg_len % 4) {
|
||||||
|
case 0:
|
||||||
|
i = 0x080000000;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
i = msg.charCodeAt(msg_len - 1) << 24 | 0x0800000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
i = msg.charCodeAt(msg_len - 2) << 24 | msg.charCodeAt(msg_len - 1) << 16 | 0x08000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
i = msg.charCodeAt(msg_len - 3) << 24 | msg.charCodeAt(msg_len - 2) << 16 | msg.charCodeAt(msg_len - 1) << 8 | 0x80;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
word_array.push(i);
|
||||||
|
|
||||||
|
while ((word_array.length % 16) != 14) word_array.push(0);
|
||||||
|
|
||||||
|
word_array.push(msg_len >>> 29);
|
||||||
|
word_array.push((msg_len << 3) & 0x0ffffffff);
|
||||||
|
|
||||||
|
|
||||||
|
for (blockstart = 0; blockstart < word_array.length; blockstart += 16) {
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++) W[i] = word_array[blockstart + i];
|
||||||
|
for (i = 16; i <= 79; i++) W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
|
||||||
|
|
||||||
|
A = H0;
|
||||||
|
B = H1;
|
||||||
|
C = H2;
|
||||||
|
D = H3;
|
||||||
|
E = H4;
|
||||||
|
|
||||||
|
for (i = 0; i <= 19; i++) {
|
||||||
|
temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;
|
||||||
|
E = D;
|
||||||
|
D = C;
|
||||||
|
C = rotate_left(B, 30);
|
||||||
|
B = A;
|
||||||
|
A = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 20; i <= 39; i++) {
|
||||||
|
temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;
|
||||||
|
E = D;
|
||||||
|
D = C;
|
||||||
|
C = rotate_left(B, 30);
|
||||||
|
B = A;
|
||||||
|
A = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 40; i <= 59; i++) {
|
||||||
|
temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;
|
||||||
|
E = D;
|
||||||
|
D = C;
|
||||||
|
C = rotate_left(B, 30);
|
||||||
|
B = A;
|
||||||
|
A = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 60; i <= 79; i++) {
|
||||||
|
temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;
|
||||||
|
E = D;
|
||||||
|
D = C;
|
||||||
|
C = rotate_left(B, 30);
|
||||||
|
B = A;
|
||||||
|
A = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
H0 = (H0 + A) & 0x0ffffffff;
|
||||||
|
H1 = (H1 + B) & 0x0ffffffff;
|
||||||
|
H2 = (H2 + C) & 0x0ffffffff;
|
||||||
|
H3 = (H3 + D) & 0x0ffffffff;
|
||||||
|
H4 = (H4 + E) & 0x0ffffffff;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
|
||||||
|
|
||||||
|
return temp.toLowerCase();
|
||||||
|
};
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" id="userProfileNavigation" style="display: none;" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" id="userProfileNavigation" style="display: none;" data-mini="true">
|
||||||
<a href="#" data-role="button" class="ui-btn-active">${TabProfile}</a>
|
<a href="#" data-role="button" class="ui-btn-active">${TabProfile}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">${TabImage}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="userImagePage" data-role="page" class="page type-interior userProfilesPage publicUserPage">
|
|
||||||
|
|
||||||
<div data-role="content">
|
|
||||||
<div class="content-primary">
|
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
|
||||||
<a href="#" onclick="Dashboard.navigate('useredit.html', true);" data-role="button">${TabProfile}</a>
|
|
||||||
<a href="#" data-role="button" class="ui-btn-active">${TabImage}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
|
||||||
</div>
|
|
||||||
<div class="readOnlyContent">
|
|
||||||
<p id="fldImage"></p>
|
|
||||||
<p id="fldDeleteImage" style="display: none;">
|
|
||||||
<button id="btnDeleteImage" type="button" data-icon="delete" onclick="UserImagePage.deleteImage();">
|
|
||||||
${ButtonDeleteImage}
|
|
||||||
</button>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="newImageSection" style="display:none;">
|
|
||||||
<h2 id="headerUploadNewImage" style="display: none;">${HeaderUploadNewImage}</h2>
|
|
||||||
<form id="uploadUserImageForm">
|
|
||||||
<ul data-role="listview" class="ulForm">
|
|
||||||
<li id="fldNewImage">
|
|
||||||
<p>${ImageUploadAspectRatioHelp}</p>
|
|
||||||
<input type="file" accept="image/*" id="uploadUserImage" name="uploadUserImage" onchange="UserImagePage.onFileUploadChange(this);" />
|
|
||||||
|
|
||||||
<div id="userImageDropZone" class="imageDropZone">
|
|
||||||
<h3>${LabelDropImageHere}</h3>
|
|
||||||
<output id="userImageOutput"></output>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li id="fldNewImagePreview"></li>
|
|
||||||
<li id="fldUpload" style="display: none;">
|
|
||||||
<button type="submit" data-icon="picture">${ButtonUpload}</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$('#uploadUserImageForm').on('submit', UserImagePage.onSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -10,7 +10,6 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">${TabImage}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" class="ui-btn-active">${TabLibraryAccess}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" class="ui-btn-active">${TabLibraryAccess}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">${TabImage}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);">${TabLibraryAccess}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);">${TabLibraryAccess}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);" class="ui-btn-active">${TabParentalControl}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);" class="ui-btn-active">${TabParentalControl}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
|
||||||
|
@ -79,7 +78,10 @@
|
||||||
<option value="Thursday">${OptionThursday}</option>
|
<option value="Thursday">${OptionThursday}</option>
|
||||||
<option value="Friday">${OptionFriday}</option>
|
<option value="Friday">${OptionFriday}</option>
|
||||||
<option value="Saturday">${OptionSaturday}</option>
|
<option value="Saturday">${OptionSaturday}</option>
|
||||||
</select>
|
<option value="Everyday">${OptionEveryday}</option>
|
||||||
|
<option value="Weekday">${OptionWeekdays}</option>
|
||||||
|
<option value="Weekend">${OptionWeekends}</option>
|
||||||
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="selectStart">${LabelAccessStart}</label>
|
<label for="selectStart">${LabelAccessStart}</label>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" onclick="Dashboard.navigate('useredit.html', true);" data-role="button">${TabProfile}</a>
|
<a href="#" onclick="Dashboard.navigate('useredit.html', true);" data-role="button">${TabProfile}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">${TabImage}</a>
|
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">${TabPassword}</a>
|
<a href="#" data-role="button" class="ui-btn-active">${TabPassword}</a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue