mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add path help messages
This commit is contained in:
parent
2f69a6f07e
commit
aa2e4f3f67
8 changed files with 188 additions and 116 deletions
|
@ -25,14 +25,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-meta",
|
||||
"homepage": "https://github.com/polymerelements/iron-meta",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.3",
|
||||
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-meta.git",
|
||||
"_source": "git://github.com/polymerelements/iron-meta.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-meta"
|
||||
"_originalSource": "polymerelements/iron-meta"
|
||||
}
|
|
@ -21,6 +21,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="itemTabs homeTabs" style="display: none;">
|
||||
<div class="libraryViewNav scopedLibraryViewNav">
|
||||
<a href="index.html" class="lnkHomeHome"><iron-icon icon="home"></iron-icon>${TabHome}</a>
|
||||
<a href="index.html?tab=1" class="lnkHomeNextUp"><iron-icon icon="navigate-next"></iron-icon>${TabNextUp}</a>
|
||||
<a href="index.html?tab=2" class="lnkHomeFavorites"><iron-icon icon="favorite"></iron-icon>${TabFavorites}</a>
|
||||
<a href="index.html?tab=3" class="lnkHomeUpcoming"><iron-icon icon="schedule"></iron-icon>${TabUpcoming}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="movieTabs" class="itemTabs" style="display: none;">
|
||||
<div class="libraryViewNav scopedLibraryViewNav">
|
||||
<a href="moviesrecommended.html"><iron-icon icon="info"></iron-icon>${TabSuggestions}</a>
|
||||
|
|
|
@ -70,119 +70,152 @@
|
|||
});
|
||||
}
|
||||
|
||||
var systemInfo;
|
||||
function getSystemInfo() {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
|
||||
if (systemInfo) {
|
||||
deferred.resolveWith(null, [systemInfo]);
|
||||
} else {
|
||||
ApiClient.getSystemInfo().done(function (info) {
|
||||
systemInfo = info;
|
||||
deferred.resolveWith(null, [systemInfo]);
|
||||
});
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
function show(directoryBrowser, page, options, systemInfo) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
var fileOptions = {
|
||||
includeDirectories: true
|
||||
};
|
||||
|
||||
if (options.includeDirectories != null) {
|
||||
fileOptions.includeDirectories = options.includeDirectories;
|
||||
}
|
||||
|
||||
if (options.includeFiles != null) {
|
||||
fileOptions.includeFiles = options.includeFiles;
|
||||
}
|
||||
|
||||
options.header = options.header || Globalize.translate('HeaderSelectPath');
|
||||
options.instruction = options.instruction || "";
|
||||
|
||||
var html = '<div data-role="popup" id="popupDirectoryPicker" class="popup" style="min-width:65%;">';
|
||||
|
||||
html += '<div class="ui-bar-a" style="text-align: center; padding: 0 20px;">';
|
||||
html += '<h3>' + options.header + '</h3>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div data-role="content" class="ui-content">';
|
||||
html += '<form>';
|
||||
|
||||
var instruction = options.instruction ? options.instruction + '<br/><br/>' : '';
|
||||
|
||||
html += '<p class="directoryPickerHeadline">';
|
||||
html += instruction;
|
||||
html += Globalize.translate('MessageDirectoryPickerInstruction')
|
||||
.replace('{0}', '<b>\\\\server</b>')
|
||||
.replace('{1}', '<b>\\\\192.168.1.101</b>');
|
||||
|
||||
if (systemInfo.OperatingSystem.toLowerCase() == 'bsd') {
|
||||
|
||||
html += '<br/>';
|
||||
html += '<br/>';
|
||||
html += Globalize.translate('MessageDirectoryPickerBSDInstruction');
|
||||
html += '<br/>';
|
||||
html += '<a href="http://doc.freenas.org/9.3/freenas_jails.html#add-storage" target="_blank">' + Globalize.translate('ButtonMoreInformation') + '</a>';
|
||||
}
|
||||
|
||||
html += '</p>';
|
||||
|
||||
html += '<div style="margin:20px 0 0;">';
|
||||
html += '<label for="txtDirectoryPickerPath" class="lblDirectoryPickerPath">' + Globalize.translate('LabelCurrentPath') + '</label>';
|
||||
html += '<div style="width:82%;display:inline-block;"><input id="txtDirectoryPickerPath" name="txtDirectoryPickerPath" type="text" required="required" style="font-weight:bold;" /></div>';
|
||||
html += '<button class="btnRefreshDirectories" type="button" data-icon="refresh" data-inline="true" data-mini="true" data-iconpos="notext">' + Globalize.translate('ButtonRefresh') + '</button>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="height: 180px; overflow-y: auto;">';
|
||||
html += '<ul id="ulDirectoryPickerList" data-role="listview" data-inset="true" data-auto-enhanced="false"></ul>';
|
||||
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-theme="b" data-icon="check" data-mini="true">' + Globalize.translate('ButtonOk') + '</button>';
|
||||
html += '<button type="button" data-icon="delete" onclick="$(this).parents(\'.popup\').popup(\'close\');" data-mini="true">' + Globalize.translate('ButtonCancel') + '</button>';
|
||||
html += '</p>';
|
||||
html += '</form>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$(page).append(html);
|
||||
|
||||
var popup = $('#popupDirectoryPicker').popup().trigger('create').on("popupafteropen", function () {
|
||||
|
||||
$('#popupDirectoryPicker input:first', this).focus();
|
||||
|
||||
}).popup("open").on("popupafterclose", function () {
|
||||
|
||||
$('form', this).off("submit");
|
||||
|
||||
$(this).off("click").off("change").off("popupafterclose").remove();
|
||||
|
||||
}).on("click", ".lnkPath", function () {
|
||||
|
||||
var path = this.getAttribute('data-path');
|
||||
|
||||
if ($(this).hasClass('lnkFile')) {
|
||||
$('#txtDirectoryPickerPath', page).val(path);
|
||||
} else {
|
||||
refreshDirectoryBrowser(page, path, fileOptions);
|
||||
}
|
||||
|
||||
|
||||
}).on("click", ".btnRefreshDirectories", function () {
|
||||
|
||||
var path = $('#txtDirectoryPickerPath', page).val();
|
||||
|
||||
refreshDirectoryBrowser(page, path, fileOptions);
|
||||
|
||||
}).on("change", "#txtDirectoryPickerPath", function () {
|
||||
|
||||
refreshDirectoryBrowser(page, this.value, fileOptions);
|
||||
});
|
||||
|
||||
var txtCurrentPath = $('#txtDirectoryPickerPath', popup);
|
||||
|
||||
if (options.path) {
|
||||
txtCurrentPath.val(options.path);
|
||||
}
|
||||
|
||||
$('form', popup).on('submit', function () {
|
||||
|
||||
if (options.callback) {
|
||||
options.callback($('#txtDirectoryPickerPath', this).val());
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
refreshDirectoryBrowser(page, txtCurrentPath.val());
|
||||
}
|
||||
|
||||
window.DirectoryBrowser = function (page) {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.show = function (options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
var fileOptions = {
|
||||
includeDirectories: true
|
||||
};
|
||||
|
||||
if (options.includeDirectories != null) {
|
||||
fileOptions.includeDirectories = options.includeDirectories;
|
||||
}
|
||||
|
||||
if (options.includeFiles != null) {
|
||||
fileOptions.includeFiles = options.includeFiles;
|
||||
}
|
||||
|
||||
options.header = options.header || Globalize.translate('HeaderSelectPath');
|
||||
options.instruction = options.instruction || "";
|
||||
|
||||
var html = '<div data-role="popup" id="popupDirectoryPicker" class="popup" style="min-width:65%;">';
|
||||
|
||||
html += '<div class="ui-bar-a" style="text-align: center; padding: 0 20px;">';
|
||||
html += '<h3>' + options.header + '</h3>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div data-role="content" class="ui-content">';
|
||||
html += '<form>';
|
||||
|
||||
var instruction = options.instruction ? options.instruction + '<br/><br/>' : '';
|
||||
|
||||
html += '<p class="directoryPickerHeadline">';
|
||||
html += instruction;
|
||||
html += Globalize.translate('MessageDirectoryPickerInstruction')
|
||||
.replace('{0}', '<b>\\\\server</b>')
|
||||
.replace('{1}', '<b>\\\\192.168.1.101</b>');
|
||||
html += '</p>';
|
||||
|
||||
html += '<div style="margin:20px 0 0;">';
|
||||
html += '<label for="txtDirectoryPickerPath" class="lblDirectoryPickerPath">' + Globalize.translate('LabelCurrentPath') + '</label>';
|
||||
html += '<div style="width:82%;display:inline-block;"><input id="txtDirectoryPickerPath" name="txtDirectoryPickerPath" type="text" required="required" style="font-weight:bold;" /></div>';
|
||||
html += '<button class="btnRefreshDirectories" type="button" data-icon="refresh" data-inline="true" data-mini="true" data-iconpos="notext">' + Globalize.translate('ButtonRefresh') + '</button>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="height: 180px; overflow-y: auto;">';
|
||||
html += '<ul id="ulDirectoryPickerList" data-role="listview" data-inset="true" data-auto-enhanced="false"></ul>';
|
||||
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-theme="b" data-icon="check" data-mini="true">' + Globalize.translate('ButtonOk') + '</button>';
|
||||
html += '<button type="button" data-icon="delete" onclick="$(this).parents(\'.popup\').popup(\'close\');" data-mini="true">' + Globalize.translate('ButtonCancel') + '</button>';
|
||||
html += '</p>';
|
||||
html += '</form>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$(page).append(html);
|
||||
|
||||
var popup = $('#popupDirectoryPicker').popup().trigger('create').on("popupafteropen", function () {
|
||||
|
||||
$('#popupDirectoryPicker input:first', this).focus();
|
||||
|
||||
}).popup("open").on("popupafterclose", function () {
|
||||
|
||||
$('form', this).off("submit");
|
||||
|
||||
$(this).off("click").off("change").off("popupafterclose").remove();
|
||||
|
||||
}).on("click", ".lnkPath", function () {
|
||||
|
||||
var path = this.getAttribute('data-path');
|
||||
|
||||
if ($(this).hasClass('lnkFile')) {
|
||||
$('#txtDirectoryPickerPath', page).val(path);
|
||||
} else {
|
||||
refreshDirectoryBrowser(page, path, fileOptions);
|
||||
}
|
||||
|
||||
|
||||
}).on("click", ".btnRefreshDirectories", function () {
|
||||
|
||||
var path = $('#txtDirectoryPickerPath', page).val();
|
||||
|
||||
refreshDirectoryBrowser(page, path, fileOptions);
|
||||
|
||||
}).on("change", "#txtDirectoryPickerPath", function () {
|
||||
|
||||
refreshDirectoryBrowser(page, this.value, fileOptions);
|
||||
getSystemInfo().done(function (systemInfo) {
|
||||
show(self, page, options, systemInfo);
|
||||
});
|
||||
|
||||
var txtCurrentPath = $('#txtDirectoryPickerPath', popup);
|
||||
|
||||
if (options.path) {
|
||||
txtCurrentPath.val(options.path);
|
||||
}
|
||||
|
||||
$('form', popup).on('submit', function () {
|
||||
|
||||
if (options.callback) {
|
||||
options.callback($('#txtDirectoryPickerPath', this).val());
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
refreshDirectoryBrowser(page, txtCurrentPath.val());
|
||||
|
||||
};
|
||||
|
||||
self.close = function () {
|
||||
|
|
|
@ -81,7 +81,8 @@
|
|||
lazy: true,
|
||||
showDetailsMenu: true,
|
||||
centerText: section.centerText,
|
||||
overlayPlayButton: section.overlayPlayButton
|
||||
overlayPlayButton: section.overlayPlayButton,
|
||||
context: 'home-favorites'
|
||||
});
|
||||
|
||||
html += '</div>';
|
||||
|
|
|
@ -48,7 +48,8 @@
|
|||
showParentTitle: true,
|
||||
lazy: true,
|
||||
cardLayout: true,
|
||||
showDetailsMenu: true
|
||||
showDetailsMenu: true,
|
||||
context: 'home-nextup'
|
||||
});
|
||||
|
||||
} else if (view == 'Thumb') {
|
||||
|
@ -63,7 +64,8 @@
|
|||
preferThumb: true,
|
||||
showDetailsMenu: true,
|
||||
centerText: true,
|
||||
overlayPlayButton: AppInfo.enableAppLayouts
|
||||
overlayPlayButton: AppInfo.enableAppLayouts,
|
||||
context: 'home-nextup'
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,8 @@
|
|||
preferThumb: true,
|
||||
lazy: true,
|
||||
showDetailsMenu: true,
|
||||
centerText: true
|
||||
centerText: true,
|
||||
context: 'home-upcoming'
|
||||
|
||||
});
|
||||
html += '</div>';
|
||||
|
|
|
@ -197,7 +197,31 @@
|
|||
LibraryMenu.setBackButtonVisible(true);
|
||||
LibraryMenu.setMenuButtonVisible(false);
|
||||
}
|
||||
if (context == 'photos' || context == 'photos-photos') {
|
||||
else if (context == 'home') {
|
||||
elem = $('.homeTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
$('.lnkHomeHome', page).addClass('ui-btn-active');
|
||||
}
|
||||
else if (context == 'home-nextup') {
|
||||
elem = $('.homeTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
$('.lnkHomeNextUp', page).addClass('ui-btn-active');
|
||||
}
|
||||
else if (context == 'home-favorites') {
|
||||
elem = $('.homeTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
$('.lnkHomeFavorites', page).addClass('ui-btn-active');
|
||||
}
|
||||
else if (context == 'home-upcoming') {
|
||||
elem = $('.homeTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
$('.lnkHomeUpcoming', page).addClass('ui-btn-active');
|
||||
}
|
||||
else if (context == 'home-latest') {
|
||||
elem = $('.homeTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
}
|
||||
else if (context == 'photos' || context == 'photos-photos') {
|
||||
elem = $('.photoTabs', page).show();
|
||||
$('a', elem).removeClass('ui-btn-active');
|
||||
|
||||
|
|
|
@ -167,7 +167,8 @@
|
|||
cardLayout: cardLayout,
|
||||
showTitle: cardLayout,
|
||||
showYear: cardLayout,
|
||||
showDetailsMenu: true
|
||||
showDetailsMenu: true,
|
||||
context: 'home'
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
@ -310,7 +311,8 @@
|
|||
lazy: true,
|
||||
cardLayout: cardLayout,
|
||||
showDetailsMenu: true,
|
||||
overlayPlayButton: true
|
||||
overlayPlayButton: true,
|
||||
context: 'home'
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue