mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
deprecate importCss
This commit is contained in:
parent
7e21fc0658
commit
6f1cdf9329
3 changed files with 5 additions and 46 deletions
|
@ -813,7 +813,7 @@
|
||||||
|
|
||||||
function init(context) {
|
function init(context) {
|
||||||
|
|
||||||
Dashboard.importCss('css/nowplaying.css');
|
require(['css!css/nowplaying.css']);
|
||||||
bindEvents(context);
|
bindEvents(context);
|
||||||
|
|
||||||
context.querySelector('.sendMessageForm').addEventListener('submit', onMessageSubmit);
|
context.querySelector('.sendMessageForm').addEventListener('submit', onMessageSubmit);
|
||||||
|
|
|
@ -394,7 +394,7 @@
|
||||||
|
|
||||||
}).on('pagebeforeshow', ".metadataEditorPage", function () {
|
}).on('pagebeforeshow', ".metadataEditorPage", function () {
|
||||||
|
|
||||||
Dashboard.importCss('css/metadataeditor.css');
|
require(['css!css/metadataeditor.css']);
|
||||||
|
|
||||||
}).on('pagebeforeshow', ".metadataEditorPage", function () {
|
}).on('pagebeforeshow', ".metadataEditorPage", function () {
|
||||||
|
|
||||||
|
|
|
@ -171,41 +171,6 @@ var Dashboard = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
importCss: function (url) {
|
|
||||||
|
|
||||||
var originalUrl = url;
|
|
||||||
url += "?v=" + AppInfo.appVersion;
|
|
||||||
|
|
||||||
if (!Dashboard.importedCss) {
|
|
||||||
Dashboard.importedCss = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Dashboard.importedCss.indexOf(url) != -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Dashboard.importedCss.push(url);
|
|
||||||
|
|
||||||
if (document.createStyleSheet) {
|
|
||||||
document.createStyleSheet(url);
|
|
||||||
} else {
|
|
||||||
var link = document.createElement('link');
|
|
||||||
link.setAttribute('rel', 'stylesheet');
|
|
||||||
link.setAttribute('data-url', originalUrl);
|
|
||||||
link.setAttribute('type', 'text/css');
|
|
||||||
link.setAttribute('href', url);
|
|
||||||
document.head.appendChild(link);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
removeStylesheet: function (url) {
|
|
||||||
|
|
||||||
var elem = document.querySelector('link[data-url=\'' + url + '\']');
|
|
||||||
if (elem) {
|
|
||||||
elem.parentNode.removeChild(elem);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateSystemInfo: function (info) {
|
updateSystemInfo: function (info) {
|
||||||
|
|
||||||
Dashboard.lastSystemInfo = info;
|
Dashboard.lastSystemInfo = info;
|
||||||
|
@ -1500,7 +1465,7 @@ var AppInfo = {};
|
||||||
var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio);
|
var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio);
|
||||||
apiClient.enableAutomaticNetworking = false;
|
apiClient.enableAutomaticNetworking = false;
|
||||||
ConnectionManager.addApiClient(apiClient);
|
ConnectionManager.addApiClient(apiClient);
|
||||||
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
|
require(['css!' + apiClient.getUrl('Branding/Css')]);
|
||||||
window.ApiClient = apiClient;
|
window.ApiClient = apiClient;
|
||||||
localApiClient = apiClient;
|
localApiClient = apiClient;
|
||||||
console.log('loaded ApiClient singleton');
|
console.log('loaded ApiClient singleton');
|
||||||
|
@ -2015,14 +1980,8 @@ var AppInfo = {};
|
||||||
define("localsync", ["scripts/localsync"]);
|
define("localsync", ["scripts/localsync"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
define("livetvcss", [], function () {
|
define("livetvcss", ['css!css/livetv.css']);
|
||||||
Dashboard.importCss('css/livetv.css');
|
define("detailtablecss", ['css!css/detailtable.css']);
|
||||||
return {};
|
|
||||||
});
|
|
||||||
define("detailtablecss", [], function () {
|
|
||||||
Dashboard.importCss('css/detailtable.css');
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
define("tileitemcss", ['css!css/tileitem.css']);
|
define("tileitemcss", ['css!css/tileitem.css']);
|
||||||
|
|
||||||
define("sharingmanager", ["scripts/sharingmanager"]);
|
define("sharingmanager", ["scripts/sharingmanager"]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue