mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Migration of alert to ES6 module
This commit is contained in:
parent
1200617639
commit
45df6ef764
12 changed files with 20 additions and 16 deletions
|
@ -128,7 +128,7 @@ import 'listViewStyle';
|
|||
}
|
||||
|
||||
function showItemOverview(item) {
|
||||
require(['alert'], function (alert) {
|
||||
import('alert').then(({default: alert})=> {
|
||||
alert({
|
||||
text: item.Overview
|
||||
});
|
||||
|
@ -137,7 +137,6 @@ import 'listViewStyle';
|
|||
|
||||
class ActivityLog {
|
||||
constructor(options) {
|
||||
console.log(options)
|
||||
this.options = options;
|
||||
var element = options.element;
|
||||
element.classList.add('activityLogListWidget');
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
define(['browser', 'dialog', 'globalize'], function (browser, dialog, globalize) {
|
||||
'use strict';
|
||||
import browser from 'browser';
|
||||
import dialog from 'dialog';
|
||||
import globalize from 'globalize';
|
||||
|
||||
/*eslint-disable indent*/
|
||||
|
||||
function replaceAll(originalString, strReplace, strWith) {
|
||||
var reg = new RegExp(strReplace, 'ig');
|
||||
return originalString.replace(reg, strWith);
|
||||
}
|
||||
|
||||
return function (text, title) {
|
||||
export default function (text, title) {
|
||||
|
||||
var options;
|
||||
if (typeof text === 'string') {
|
||||
|
@ -41,5 +44,6 @@ define(['browser', 'dialog', 'globalize'], function (browser, dialog, globalize)
|
|||
}
|
||||
|
||||
return Promise.resolve();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/*eslint-enable indent*/
|
||||
|
|
|
@ -53,7 +53,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
|||
break;
|
||||
case 'ServerUpdateNeeded':
|
||||
require(['alert'], function (alert) {
|
||||
alert({
|
||||
alert.default({
|
||||
text: globalize.translate('ServerUpdateNeeded', 'https://github.com/jellyfin/jellyfin'),
|
||||
html: globalize.translate('ServerUpdateNeeded', '<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')
|
||||
}).then(function () {
|
||||
|
|
|
@ -338,7 +338,7 @@ define(['browser', 'appStorage', 'apphost', 'loading', 'connectionManager', 'glo
|
|||
if (selection.length < 2) {
|
||||
|
||||
require(['alert'], function (alert) {
|
||||
alert({
|
||||
alert.default({
|
||||
text: globalize.translate('PleaseSelectTwoItems')
|
||||
});
|
||||
});
|
||||
|
|
|
@ -709,7 +709,7 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
|
|||
function showPlaybackInfoErrorMessage(instance, errorCode, playNextTrack) {
|
||||
|
||||
require(['alert'], function (alert) {
|
||||
alert({
|
||||
alert.default({
|
||||
text: globalize.translate('PlaybackError' + errorCode),
|
||||
title: globalize.translate('HeaderPlaybackError')
|
||||
}).then(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue