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
|
@ -93,6 +93,7 @@
|
||||||
"src/components/accessSchedule/accessSchedule.js",
|
"src/components/accessSchedule/accessSchedule.js",
|
||||||
"src/components/actionSheet/actionSheet.js",
|
"src/components/actionSheet/actionSheet.js",
|
||||||
"src/components/activitylog.js",
|
"src/components/activitylog.js",
|
||||||
|
"src/components/alert.js",
|
||||||
"src/components/alphaPicker/alphaPicker.js",
|
"src/components/alphaPicker/alphaPicker.js",
|
||||||
"src/components/autoFocuser.js",
|
"src/components/autoFocuser.js",
|
||||||
"src/components/cardbuilder/cardBuilder.js",
|
"src/components/cardbuilder/cardBuilder.js",
|
||||||
|
|
|
@ -128,7 +128,7 @@ import 'listViewStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemOverview(item) {
|
function showItemOverview(item) {
|
||||||
require(['alert'], function (alert) {
|
import('alert').then(({default: alert})=> {
|
||||||
alert({
|
alert({
|
||||||
text: item.Overview
|
text: item.Overview
|
||||||
});
|
});
|
||||||
|
@ -137,7 +137,6 @@ import 'listViewStyle';
|
||||||
|
|
||||||
class ActivityLog {
|
class ActivityLog {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
console.log(options)
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
var element = options.element;
|
var element = options.element;
|
||||||
element.classList.add('activityLogListWidget');
|
element.classList.add('activityLogListWidget');
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
define(['browser', 'dialog', 'globalize'], function (browser, dialog, globalize) {
|
import browser from 'browser';
|
||||||
'use strict';
|
import dialog from 'dialog';
|
||||||
|
import globalize from 'globalize';
|
||||||
|
|
||||||
|
/*eslint-disable indent*/
|
||||||
|
|
||||||
function replaceAll(originalString, strReplace, strWith) {
|
function replaceAll(originalString, strReplace, strWith) {
|
||||||
var reg = new RegExp(strReplace, 'ig');
|
var reg = new RegExp(strReplace, 'ig');
|
||||||
return originalString.replace(reg, strWith);
|
return originalString.replace(reg, strWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (text, title) {
|
export default function (text, title) {
|
||||||
|
|
||||||
var options;
|
var options;
|
||||||
if (typeof text === 'string') {
|
if (typeof text === 'string') {
|
||||||
|
@ -41,5 +44,6 @@ define(['browser', 'dialog', 'globalize'], function (browser, dialog, globalize)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
};
|
}
|
||||||
});
|
|
||||||
|
/*eslint-enable indent*/
|
||||||
|
|
|
@ -53,7 +53,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
break;
|
break;
|
||||||
case 'ServerUpdateNeeded':
|
case 'ServerUpdateNeeded':
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: globalize.translate('ServerUpdateNeeded', 'https://github.com/jellyfin/jellyfin'),
|
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>')
|
html: globalize.translate('ServerUpdateNeeded', '<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
|
|
|
@ -338,7 +338,7 @@ define(['browser', 'appStorage', 'apphost', 'loading', 'connectionManager', 'glo
|
||||||
if (selection.length < 2) {
|
if (selection.length < 2) {
|
||||||
|
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: globalize.translate('PleaseSelectTwoItems')
|
text: globalize.translate('PleaseSelectTwoItems')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -709,7 +709,7 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
|
||||||
function showPlaybackInfoErrorMessage(instance, errorCode, playNextTrack) {
|
function showPlaybackInfoErrorMessage(instance, errorCode, playNextTrack) {
|
||||||
|
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: globalize.translate('PlaybackError' + errorCode),
|
text: globalize.translate('PlaybackError' + errorCode),
|
||||||
title: globalize.translate('HeaderPlaybackError')
|
title: globalize.translate('HeaderPlaybackError')
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
|
|
|
@ -86,7 +86,7 @@ define(['jQuery', 'loading', 'globalize', 'dom', 'libraryMenu'], function ($, lo
|
||||||
|
|
||||||
if ($('#selectVideoDecoder', form).val()) {
|
if ($('#selectVideoDecoder', form).val()) {
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
title: globalize.translate('TitleHardwareAcceleration'),
|
title: globalize.translate('TitleHardwareAcceleration'),
|
||||||
text: globalize.translate('HardwareAccelerationWarning')
|
text: globalize.translate('HardwareAccelerationWarning')
|
||||||
}).then(onDecoderConfirmed);
|
}).then(onDecoderConfirmed);
|
||||||
|
|
|
@ -36,7 +36,7 @@ define(['jQuery', 'loading', 'libraryMenu', 'globalize'], function ($, loading,
|
||||||
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
||||||
|
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: msg.join('<br/><br/>')
|
text: msg.join('<br/><br/>')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1787,7 +1787,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
||||||
imageLoader.lazyChildren(collectionItems);
|
imageLoader.lazyChildren(collectionItems);
|
||||||
collectionItems.querySelector('.btnAddToCollection').addEventListener('click', function () {
|
collectionItems.querySelector('.btnAddToCollection').addEventListener('click', function () {
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: globalize.translate('AddItemToCollectionHelp'),
|
text: globalize.translate('AddItemToCollectionHelp'),
|
||||||
html: globalize.translate('AddItemToCollectionHelp') + '<br/><br/><a is="emby-linkbutton" class="button-link" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Collections">' + globalize.translate('ButtonLearnMore') + '</a>'
|
html: globalize.translate('AddItemToCollectionHelp') + '<br/><br/><a is="emby-linkbutton" class="button-link" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Collections">' + globalize.translate('ButtonLearnMore') + '</a>'
|
||||||
});
|
});
|
||||||
|
|
|
@ -150,7 +150,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
||||||
|
|
||||||
function alertText(text, title) {
|
function alertText(text, title) {
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
text: text,
|
text: text,
|
||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ define(['connectionManager', 'playbackManager', 'syncPlayManager', 'events', 'in
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({ title: args.Header, text: args.Text });
|
alert.default({ title: args.Header, text: args.Text });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ var Dashboard = {
|
||||||
}
|
}
|
||||||
|
|
||||||
require(['alert'], function (alert) {
|
require(['alert'], function (alert) {
|
||||||
alert({
|
alert.default({
|
||||||
title: options.title || Globalize.translate('HeaderAlert'),
|
title: options.title || Globalize.translate('HeaderAlert'),
|
||||||
text: options.message
|
text: options.message
|
||||||
}).then(options.callback || function () {});
|
}).then(options.callback || function () {});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue