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

fixes #519 - Add third wizard page

This commit is contained in:
Luke Pulverenti 2013-09-05 13:05:39 -04:00
parent 0a849490b6
commit 3e69d637c4
7 changed files with 142 additions and 18 deletions

View file

@ -55,6 +55,11 @@
}
},
shouldRefreshLibraryAfterChanges: function () {
return $($.mobile.activePage).is('#mediaLibraryPage');
},
reloadVirtualFolders: function (page, virtualFolders) {
if (virtualFolders) {
@ -86,7 +91,7 @@
html += '<h3>' + virtualFolder.Name + '</h3>';
var typeName = MediaLibraryPage.getCollectionTypeOptions().filter(function(t) {
var typeName = MediaLibraryPage.getCollectionTypeOptions().filter(function (t) {
return t.value == virtualFolder.CollectionType;
@ -151,7 +156,9 @@
MediaLibraryPage.lastVirtualFolderName = name;
ApiClient.addVirtualFolder(name, type, userId).done(MediaLibraryPage.processOperationResult);
var refreshAfterChange = MediaLibraryPage.shouldRefreshLibraryAfterChanges();
ApiClient.addVirtualFolder(name, type, userId, refreshAfterChange).done(MediaLibraryPage.processOperationResult);
});
},
@ -168,7 +175,9 @@
var userId = getParameterByName("userId");
ApiClient.addMediaPath(virtualFolder.Name, path, userId).done(MediaLibraryPage.processOperationResult);
var refreshAfterChange = MediaLibraryPage.shouldRefreshLibraryAfterChanges();
ApiClient.addMediaPath(virtualFolder.Name, path, userId, refreshAfterChange).done(MediaLibraryPage.processOperationResult);
}
});
@ -269,7 +278,9 @@
var userId = getParameterByName("userId");
ApiClient.renameVirtualFolder(virtualFolder.Name, newName, userId).done(MediaLibraryPage.processOperationResult);
var refreshAfterChange = MediaLibraryPage.shouldRefreshLibraryAfterChanges();
ApiClient.renameVirtualFolder(virtualFolder.Name, newName, userId, refreshAfterChange).done(MediaLibraryPage.processOperationResult);
}
});
},
@ -300,7 +311,9 @@
var userId = getParameterByName("userId");
ApiClient.removeVirtualFolder(virtualFolder.Name, userId).done(MediaLibraryPage.processOperationResult);
var refreshAfterChange = MediaLibraryPage.shouldRefreshLibraryAfterChanges();
ApiClient.removeVirtualFolder(virtualFolder.Name, userId, refreshAfterChange).done(MediaLibraryPage.processOperationResult);
}
});
@ -323,7 +336,9 @@
var userId = getParameterByName("userId");
ApiClient.removeMediaPath(virtualFolder.Name, location, userId).done(MediaLibraryPage.processOperationResult);
var refreshAfterChange = MediaLibraryPage.shouldRefreshLibraryAfterChanges();
ApiClient.removeMediaPath(virtualFolder.Name, location, userId, refreshAfterChange).done(MediaLibraryPage.processOperationResult);
}
});
},

View file

@ -22,7 +22,7 @@
html += "<li>";
html += "<a onclick='Dashboard.navigate(\"edituser.html?userId=" + user.Id + "\");' href='#'>";
html += "<a href='edituser.html?userId=" + user.Id + "'>";
if (user.PrimaryImageTag) {

View file

@ -0,0 +1,56 @@
(function ($, document) {
function save(page) {
Dashboard.showLoadingMsg();
ApiClient.getScheduledTasks().done(function (tasks) {
var chapterTask = tasks.filter(function (t) {
return t.Name.toLowerCase() == 'chapter image extraction';
})[0];
if (!chapterTask) {
throw new Error('Cannot find chapter scheduled task');
}
// First update the chapters scheduled task
var triggers = $('#chkChapters', page).checked() ? [{
"Type": "DailyTrigger",
"TimeOfDayTicks": 144000000000
}] : [];
ApiClient.updateScheduledTaskTriggers(chapterTask.Id, triggers).done(function () {
// After saving chapter task, now save server config
ApiClient.getServerConfiguration().done(function (config) {
config.SaveLocalMeta = $('#chkSaveLocalMetadata', page).checked();
ApiClient.updateServerConfiguration(config).done(function(result) {
Dashboard.processServerConfigurationUpdateResult(result);
Dashboard.navigate('wizardfinish.html');
});
});
});
});
}
$(document).on('pageinit', "#wizardSettingsPage", function () {
var page = this;
$('#btnNextPage', page).on('click', function () {
save(page);
});
});
})(jQuery, document, window);

View file

@ -65,7 +65,7 @@
<div class="wizardNavigation">
<button type="button" data-iconpos="left" data-icon="arrow-left" data-inline="true" onclick="history.back();">Previous</button>
<button type="button" data-iconpos="right" data-icon="arrow-right" data-inline="true" onclick="Dashboard.navigate('wizardfinish.html');">Next</button>
<button type="button" data-iconpos="right" data-icon="arrow-right" data-inline="true" onclick="Dashboard.navigate('wizardsettings.html');">Next</button>
</div>
</div>

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Media Browser</title>
</head>
<body>
<div id="wizardSettingsPage" data-role="page" class="page standalonePage wizardPage mediaLibraryPage">
<div data-role="content">
<div class="ui-corner-all ui-shadow wizardContent">
<h2>
<img src="css/images/mblogoicon.png" />Configure settings</h2>
<br />
<div style="margin: 1em 0;">
<label for="chkSaveLocalMetadata">Save metadata into media folders</label>
<input id="chkSaveLocalMetadata" name="chkSaveLocalMetadata" type="checkbox" checked="checked" />
<div class="fieldDescription">Saving artwork and metadata directly into media folders will put them in a place where they can be easily edited and help reduce the size of the server's data folder.</div>
</div>
<div style="margin: 2em 0;">
<label for="chkChapters">Enable video chapter image extraction</label>
<input id="chkChapters" name="chkChapters" type="checkbox" checked="checked" />
<div class="fieldDescription">Extracting chapter images will allow clients to display graphical scene selection menus. The process can be cpu-intensive and on average will require 1-2GB of space. It runs as a nightly scheduled task at 4am, although this is configurable in the scheduled tasks area of the Dashboard once the wizard is completed.</div>
</div>
<div class="wizardNavigation">
<button type="button" data-iconpos="left" data-icon="arrow-left" data-inline="true" onclick="history.back();">Previous</button>
<button id="btnNextPage" type="button" data-iconpos="right" data-icon="arrow-right" data-inline="true">Next</button>
</div>
</div>
</div>
</div>
</body>
</html>