Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links for most of the old documentation #265

Merged
merged 4 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/addplugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle pluginName"></h1>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/administrator-docs/plugins/">${Help}</a>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/plugins/">${Help}</a>
</div>

<p id="tagline" style="font-style: italic;"></p>
Expand Down
11 changes: 1 addition & 10 deletions src/components/directorybrowser/directorybrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,11 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper-
html += '<div class="infoBanner" style="margin-bottom:1.5em;">';
html += instruction;
html += Globalize.translate("MessageDirectoryPickerInstruction").replace("{0}", "<b>\\\\server</b>").replace("{1}", "<b>\\\\192.168.1.101</b>");
if ("synology" === (systemInfo.PackageName || "").toLowerCase()) {
html += "<br/>";
html += "<br/>";
html += '<a is="emby-linkbutton" class="button-link" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Synology-:-Setting-Up-Your-Media-Library-Share" target="_blank">';
html += Globalize.translate("LearnHowToCreateSynologyShares");
html += "</a>";
} else if ("bsd" === systemInfo.OperatingSystem.toLowerCase()) {
if ("bsd" === systemInfo.OperatingSystem.toLowerCase()) {
html += "<br/>";
html += "<br/>";
html += Globalize.translate("MessageDirectoryPickerBSDInstruction");
html += "<br/>";
html += '<a is="emby-linkbutton" class="button-link" href="http://doc.freenas.org/9.3/freenas_jails.html#add-storage" target="_blank">';
html += Globalize.translate("ButtonMoreInformation");
html += "</a>";
} else if ("linux" === systemInfo.OperatingSystem.toLowerCase()) {
html += "<br/>";
html += "<br/>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon">&#xE5C4;</i></button>
<h3 class="formDialogHeaderTitle">${Subtitles}</h3>

<a is="emby-linkbutton" data-autohide="true" class="button-link btnHelp flex align-items-center" href="https://web.archive.org/web/20181216115510/https://github.com/MediaBrowser/Wiki/wiki/Subtitles" target="_blank" style="margin-left:auto;margin-right:.5em;padding:.25em;" title="${Help}"><i class="md-icon">&#xE88E;</i><span style="margin-left:.25em;">${Help}</span></a>
<a is="emby-linkbutton" data-autohide="true" class="button-link btnHelp flex align-items-center" href="https://jellyfin.readthedocs.io/en/latest/media/subtitles/" target="_blank" style="margin-left:auto;margin-right:.5em;padding:.25em;" title="${Help}"><i class="md-icon">&#xE88E;</i><span style="margin-left:.25em;">${Help}</span></a>

</div>
<div class="formDialogContent smoothScrollY">
Expand Down
2 changes: 1 addition & 1 deletion src/components/tvproviders/schedulesdirect.template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle">Schedules Direct</h1>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Live-TV">${Help}</a>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/live-tv/">${Help}</a>
</div>
<p class="createAccountHelp"></p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tvproviders/xmltv.template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle">Xml TV</h1>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Live-TV">${Help}</a>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/live-tv/">${Help}</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/notificationsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-button"],
itemHtml += "</h2>";
if (showHelp) {
showHelp = false;
itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications">';
itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/notifications/">';
itemHtml += globalize.translate("Help");
itemHtml += "</a>";
}
Expand Down
143 changes: 115 additions & 28 deletions src/controllers/scheduledtaskspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,63 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma

function reloadList(page) {
ApiClient.getScheduledTasks({
isHidden: !1
isHidden: false
}).then(function(tasks) {
populateList(page, tasks), loading.hide()
populateList(page, tasks);
loading.hide();
})
}

function populateList(page, tasks) {
tasks = tasks.sort(function(a, b) {
return a = a.Category + " " + a.Name, b = b.Category + " " + b.Name, a == b ? 0 : a < b ? -1 : 1
a = a.Category + " " + a.Name;
b = b.Category + " " + b.Name;
return a == b ? 0 : a < b ? -1 : 1;
});
for (var currentCategory, html = "", i = 0, length = tasks.length; i < length; i++) {

var currentCategory;
var html = "";
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
task.Category != currentCategory && (currentCategory = task.Category, currentCategory && (html += "</div>", html += "</div>"), html += '<div class="verticalSection verticalSection-extrabottompadding">', html += '<div class="sectionTitleContainer" style="margin-bottom:1em;">', html += '<h2 class="sectionTitle">', html += currentCategory, html += "</h2>", 0 === i && (html += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Scheduled-tasks">' + globalize.translate("Help") + "</a>"), html += "</div>", html += '<div class="paperList">'), html += '<div class="listItem listItem-border scheduledTaskPaperIconItem" data-status="' + task.State + '">', html += "<a is='emby-linkbutton' style='margin:0;padding:0;' class='clearLink listItemIconContainer' href='scheduledtask.html?id=" + task.Id + "'>", html += '<i class="md-icon listItemIcon">schedule</i>', html += "</a>", html += '<div class="listItemBody two-line">', html += "<a class='clearLink' style='margin:0;padding:0;display:block;text-align:left;' is='emby-linkbutton' href='scheduledtask.html?id=" + task.Id + "'>", html += "<h3 class='listItemBodyText'>" + task.Name + "</h3>", html += "<div class='secondary listItemBodyText' id='taskProgress" + task.Id + "'>" + getTaskProgressHtml(task) + "</div>", html += "</a>", html += "</div>", "Idle" == task.State ? html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStartTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStart") + '"><i class="md-icon">play_arrow</i></button>' : "Running" == task.State ? html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStopTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStop") + '"><i class="md-icon">stop</i></button>' : html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStartTask hide" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStart") + '"><i class="md-icon">play_arrow</i></button>', html += "</div>"
if (task.Category != currentCategory) {
currentCategory = task.Category;
if (currentCategory) {
html += "</div>";
html += "</div>";
}
html += '<div class="verticalSection verticalSection-extrabottompadding">';
html += '<div class="sectionTitleContainer" style="margin-bottom:1em;">';
html += '<h2 class="sectionTitle">';
html += currentCategory;
html += "</h2>";
if (i === 0) {
html += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/tasks/">' + globalize.translate("Help") + "</a>";
}
html += "</div>";
html += '<div class="paperList">';
}
html += '<div class="listItem listItem-border scheduledTaskPaperIconItem" data-status="' + task.State + '">';
html += "<a is='emby-linkbutton' style='margin:0;padding:0;' class='clearLink listItemIconContainer' href='scheduledtask.html?id=" + task.Id + "'>";
html += '<i class="md-icon listItemIcon">schedule</i>';
html += "</a>";
html += '<div class="listItemBody two-line">';
html += "<a class='clearLink' style='margin:0;padding:0;display:block;text-align:left;' is='emby-linkbutton' href='scheduledtask.html?id=" + task.Id + "'>";
html += "<h3 class='listItemBodyText'>" + task.Name + "</h3>";
html += "<div class='secondary listItemBodyText' id='taskProgress" + task.Id + "'>" + getTaskProgressHtml(task) + "</div>";
html += "</a>";
html += "</div>";
if (task.State === "Running") {
html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStopTask" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStop") + '"><i class="md-icon">stop</i></button>';
} else {
html += '<button type="button" is="paper-icon-button-light" id="btnTask' + task.Id + '" class="btnStartTask hide" data-taskid="' + task.Id + '" title="' + globalize.translate("ButtonStart") + '"><i class="md-icon">play_arrow</i></button>';
}
html += "</div>";
}
tasks.length && (html += "</div>", html += "</div>"), page.querySelector(".divScheduledTasks").innerHTML = html
if (tasks.length) {
html += "</div>";
html += "</div>";
}
page.querySelector(".divScheduledTasks").innerHTML = html;
}

function humane_elapsed(firstDateStr, secondDateStr) {
Expand All @@ -34,8 +76,18 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma

function getTaskProgressHtml(task) {
var html = "";
if ("Idle" == task.State) task.LastExecutionResult && (html += globalize.translate("LabelScheduledTaskLastRan").replace("{0}", humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}", humane_elapsed(task.LastExecutionResult.StartTimeUtc, task.LastExecutionResult.EndTimeUtc)), "Failed" == task.LastExecutionResult.Status ? html += " <span style='color:#FF0000;'>(" + globalize.translate("LabelFailed") + ")</span>" : "Cancelled" == task.LastExecutionResult.Status ? html += " <span style='color:#0026FF;'>(" + globalize.translate("LabelCancelled") + ")</span>" : "Aborted" == task.LastExecutionResult.Status && (html += " <span style='color:#FF0000;'>" + globalize.translate("LabelAbortedByServerShutdown") + "</span>"));
else if ("Running" == task.State) {
if (task.State === "Idle") {
if (task.LastExecutionResult) {
html += globalize.translate("LabelScheduledTaskLastRan").replace("{0}", humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}", humane_elapsed(task.LastExecutionResult.StartTimeUtc, task.LastExecutionResult.EndTimeUtc));
if (task.LastExecutionResult.Status === "Failed") {
html += " <span style='color:#FF0000;'>(" + globalize.translate("LabelFailed") + ")</span>";
} else if (task.LastExecutionResult.Status === "Cancelled") {
html += " <span style='color:#0026FF;'>(" + globalize.translate("LabelCancelled") + ")</span>";
} else if (task.LastExecutionResult.Status === "Aborted") {
html += " <span style='color:#FF0000;'>" + globalize.translate("LabelAbortedByServerShutdown") + "</span>";
}
}
} else if (task.State === "Running") {
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
html += '<div style="display:flex;align-items:center;">';
html += '<div class="taskProgressOuter" title="' + progress + '%" style="flex-grow:1;">';
Expand All @@ -47,53 +99,88 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma
} else {
html += "<span style='color:#FF0000;'>" + globalize.translate("LabelStopping") + "</span>";
}
return html
return html;
}

function updateTaskButton(elem, state) {
"Idle" == state ? (elem.classList.add("btnStartTask"), elem.classList.remove("btnStopTask"), elem.classList.remove("hide"), elem.querySelector("i").innerHTML = "play_arrow", elem.title = globalize.translate("ButtonStart")) : "Running" == state ? (elem.classList.remove("btnStartTask"), elem.classList.add("btnStopTask"), elem.classList.remove("hide"), elem.querySelector("i").innerHTML = "stop", elem.title = globalize.translate("ButtonStop")) : (elem.classList.add("btnStartTask"), elem.classList.remove("btnStopTask"), elem.classList.add("hide"), elem.querySelector("i").innerHTML = "play_arrow", elem.title = globalize.translate("ButtonStart")), $(elem).parents(".listItem")[0].setAttribute("data-status", state)
if (state === "Running") {
elem.classList.remove("btnStartTask");
elem.classList.add("btnStopTask");
elem.classList.remove("hide");
elem.querySelector("i").innerHTML = "stop";
elem.title = globalize.translate("ButtonStop");
} else {
elem.classList.add("btnStartTask");
elem.classList.remove("btnStopTask");
elem.classList.add("hide");
elem.querySelector("i").innerHTML = "play_arrow";
elem.title = globalize.translate("ButtonStart");
}
$(elem).parents(".listItem")[0].setAttribute("data-status", state);
}

return function(view, params) {
function updateTasks(tasks) {
for (var i = 0, length = tasks.length; i < length; i++) {
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
view.querySelector("#taskProgress" + task.Id).innerHTML = getTaskProgressHtml(task);
updateTaskButton(view.querySelector("#btnTask" + task.Id), task.State)
updateTaskButton(view.querySelector("#btnTask" + task.Id), task.State);
}
}

function onPollIntervalFired() {
ApiClient.isMessageChannelOpen() || reloadList(view)
if (!ApiClient.isMessageChannelOpen()) {
reloadList(view);
}
}

function onScheduledTasksUpdate(e, apiClient, info) {
apiClient.serverId() === serverId && updateTasks(info)
if (apiClient.serverId() === serverId) {
updateTasks(info);
}
}

function startInterval() {
ApiClient.sendMessage("ScheduledTasksInfoStart", "1000,1000"), pollInterval && clearInterval(pollInterval), pollInterval = setInterval(onPollIntervalFired, 1e4)
ApiClient.sendMessage("ScheduledTasksInfoStart", "1000,1000");
pollInterval && clearInterval(pollInterval);
pollInterval = setInterval(onPollIntervalFired, 1e4);
}

function stopInterval() {
ApiClient.sendMessage("ScheduledTasksInfoStop"), pollInterval && clearInterval(pollInterval)
ApiClient.sendMessage("ScheduledTasksInfoStop");
pollInterval && clearInterval(pollInterval);
}

var pollInterval, serverId = ApiClient.serverId();

$(".divScheduledTasks", view).on("click", ".btnStartTask", function() {
var button = this,
id = button.getAttribute("data-taskid");
var button = this;
var id = button.getAttribute("data-taskid");
ApiClient.startScheduledTask(id).then(function() {
updateTaskButton(button, "Running"), reloadList(view)
updateTaskButton(button, "Running");
reloadList(view);
})
}).on("click", ".btnStopTask", function() {
var button = this,
id = button.getAttribute("data-taskid");
});

$(".divScheduledTasks", view).on("click", ".btnStopTask", function() {
var button = this;
var id = button.getAttribute("data-taskid");
ApiClient.stopScheduledTask(id).then(function() {
updateTaskButton(button, ""), reloadList(view)
updateTaskButton(button, "");
reloadList(view);
})
}), view.addEventListener("viewbeforehide", function() {
events.off(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate), stopInterval()
}), view.addEventListener("viewshow", function() {
loading.show(), startInterval(), reloadList(view), events.on(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate)
})
});

view.addEventListener("viewbeforehide", function() {
events.off(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate);
stopInterval();
});

view.addEventListener("viewshow", function() {
loading.show();
startInterval();
reloadList(view);
events.on(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate);
});
}
});
2 changes: 1 addition & 1 deletion src/dashboardgeneral.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabSettings}</h2>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Server-Settings">${Help}</a>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/settings/">${Help}</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/device.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="verticalSection verticalSection-extrabottompadding">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle reportedName"></h2>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Devices">${Help}</a>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/server/devices/">${Help}</a>
</div>

<div class="inputContainer">
Expand Down