define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton"], function(loading, libraryMenu, globalize) { "use strict"; function reload(page) { loading.show(), ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list) { var html = "", lastCategory = "", showHelp = !0; html += list.map(function(i) { var itemHtml = ""; return i.Category != lastCategory && (lastCategory = i.Category, lastCategory && (itemHtml += "", itemHtml += ""), itemHtml += '
', itemHtml += '
', itemHtml += '

', itemHtml += i.Category, itemHtml += "

", showHelp && (showHelp = !1, itemHtml += '' + globalize.translate("Help") + ""), itemHtml += "
", itemHtml += '
'), itemHtml += '', i.Enabled ? itemHtml += 'notifications_active' : itemHtml += 'notifications_off', itemHtml += '
', itemHtml += '
' + i.Name + "
", itemHtml += "
", itemHtml += '', itemHtml += "
" }).join(""), list.length && (html += "
", html += "
"), page.querySelector(".notificationList").innerHTML = html, loading.hide() }) } function getTabs() { return [{ href: "notificationsettings.html", name: globalize.translate("TabNotifications") }, { href: "appservices.html?context=notifications", name: globalize.translate("TabServices") }] } return function(view, params) { view.addEventListener("viewshow", function() { libraryMenu.setTabs("notifications", 0, getTabs), reload(view) }) } });