mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
extract scripts
This commit is contained in:
parent
d84e09e501
commit
6c97b11f21
41 changed files with 8363 additions and 204 deletions
|
@ -169,7 +169,11 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshowready', "#addPluginPage", function () {
|
||||
$(document).on('pageinitdepends', "#addPluginPage", function () {
|
||||
|
||||
$('.addPluginForm').off('submit', AddPluginPage.onSubmit).on('submit', AddPluginPage.onSubmit);
|
||||
|
||||
}).on('pageshowready', "#addPluginPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -188,7 +192,6 @@
|
|||
|
||||
});
|
||||
|
||||
|
||||
}).on('pagebeforeshow pageinit pageshow', "#addPluginPage", function () {
|
||||
|
||||
// This needs both events for the helpurl to get done at the right time
|
||||
|
|
|
@ -37,36 +37,39 @@
|
|||
|
||||
function renderInstalled(page, availablePlugins, installedPlugins) {
|
||||
|
||||
var category = getCategories()[0];
|
||||
requirejs(['scripts/pluginspage'], function() {
|
||||
var category = getCategories()[0];
|
||||
|
||||
installedPlugins = installedPlugins.filter(function (i) {
|
||||
installedPlugins = installedPlugins.filter(function (i) {
|
||||
|
||||
var catalogEntry = availablePlugins.filter(function (a) {
|
||||
return a.guid == i.Id;
|
||||
})[0];
|
||||
var catalogEntry = availablePlugins.filter(function (a) {
|
||||
return a.guid == i.Id;
|
||||
})[0];
|
||||
|
||||
return catalogEntry && catalogEntry.category == category;
|
||||
return catalogEntry && catalogEntry.category == category;
|
||||
|
||||
});
|
||||
|
||||
PluginsPage.renderPlugins(page, installedPlugins);
|
||||
});
|
||||
|
||||
PluginsPage.renderPlugins(page, installedPlugins);
|
||||
}
|
||||
|
||||
function renderCatalog(page, availablePlugins, installedPlugins) {
|
||||
|
||||
var categories = getCategories();
|
||||
requirejs(['scripts/plugincatalogpage'], function () {
|
||||
var categories = getCategories();
|
||||
|
||||
PluginCatalog.renderCatalog({
|
||||
PluginCatalog.renderCatalog({
|
||||
|
||||
catalogElement: $('.catalog', page),
|
||||
availablePlugins: availablePlugins,
|
||||
installedPlugins: installedPlugins,
|
||||
categories: categories,
|
||||
showCategory: false,
|
||||
context: getParameterByName('context'),
|
||||
targetSystem: 'Server'
|
||||
catalogElement: $('.catalog', page),
|
||||
availablePlugins: availablePlugins,
|
||||
installedPlugins: installedPlugins,
|
||||
categories: categories,
|
||||
showCategory: false,
|
||||
context: getParameterByName('context'),
|
||||
targetSystem: 'Server'
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow pageinit pageshow', "#appServicesPage", function () {
|
||||
|
@ -93,7 +96,7 @@
|
|||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
|
||||
}
|
||||
|
||||
}).on('pageshow', "#appServicesPage", function () {
|
||||
}).on('pageshowready', "#appServicesPage", function () {
|
||||
|
||||
// This needs both events for the helpurl to get done at the right time
|
||||
|
||||
|
|
|
@ -55,6 +55,14 @@
|
|||
}
|
||||
|
||||
return store.getItem('enableFullScreen') == 'true';
|
||||
},
|
||||
syncPath: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('syncPath', val.toString());
|
||||
}
|
||||
|
||||
return store.getItem('syncPath');
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
shape: "backdrop",
|
||||
context: 'channels',
|
||||
showTitle: true,
|
||||
lazy: true,
|
||||
centerText: true,
|
||||
preferThumb: true
|
||||
});
|
||||
|
|
|
@ -523,7 +523,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if (target.parents('a').length || target.parents('button').length) {
|
||||
var buttonParents = target.parents('a:not(.card,.cardContent),button:not(.card,.cardContent)');
|
||||
if (buttonParents.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@
|
|||
|
||||
if (mediaSource.SupportsDirectPlay && mediaSource.Protocol == 'File') {
|
||||
|
||||
return FileSystem.fileExists(mediaSource.Path);
|
||||
return FileSystemBridge.fileExists(mediaSource.Path);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
$('#chkEnableChromecastAc3', page).checked(AppSettings.enableChromecastAc3()).checkboxradio("refresh");
|
||||
|
||||
$('#txtSyncPath', page).val(AppSettings.syncPath());
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
@ -59,6 +61,8 @@
|
|||
|
||||
AppSettings.enableChromecastAc3($('#chkEnableChromecastAc3', page).checked());
|
||||
|
||||
AppSettings.syncPath($('#txtSyncPath', page).val());
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
||||
|
@ -77,6 +81,15 @@
|
|||
|
||||
$('.webClientPreferencesForm', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
$('.btnSelectSyncPath', page).on('click', function () {
|
||||
|
||||
require(['nativedirectorychooser'], function () {
|
||||
NativeDirectoryChooser.chooseDirectory().done(function (path) {
|
||||
$('#txtSyncPath', page).val(path);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#webClientPreferencesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -112,6 +125,12 @@
|
|||
} else {
|
||||
$('.fldFullscreen', page).hide();
|
||||
}
|
||||
|
||||
if (AppInfo.supportsSyncPathSetting) {
|
||||
$('.fldSyncPath', page).show();
|
||||
} else {
|
||||
$('.fldSyncPath', page).hide();
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery, window, document);
|
|
@ -186,7 +186,7 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#pluginCatalogPage", function () {
|
||||
$(document).on('pageinitdepends', "#pluginCatalogPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -214,7 +214,7 @@
|
|||
reloadList(page);
|
||||
});
|
||||
|
||||
}).on('pageshow', "#pluginCatalogPage", function () {
|
||||
}).on('pageshowready', "#pluginCatalogPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#pluginsPage", function () {
|
||||
$(document).on('pageshowready', "#pluginsPage", function () {
|
||||
|
||||
reloadList(this);
|
||||
});
|
||||
|
|
|
@ -1586,6 +1586,7 @@ var AppInfo = {};
|
|||
|
||||
AppInfo.enableBackButton = (isIOS && window.navigator.standalone) || (isCordova && isIOS);
|
||||
AppInfo.supportsFullScreen = isCordova && isAndroid;
|
||||
AppInfo.supportsSyncPathSetting = isCordova && isAndroid;
|
||||
}
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
@ -1893,6 +1894,10 @@ var AppInfo = {};
|
|||
define("filesystem", ["thirdparty/filesystem"]);
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova() && $.browser.android) {
|
||||
define("nativedirectorychooser", ["thirdparty/cordova/android/nativedirectorychooser"]);
|
||||
}
|
||||
|
||||
define("connectservice", ["thirdparty/apiclient/connectservice"]);
|
||||
|
||||
//requirejs(['http://viblast.com/player/free-version/qy2fdwajo1/viblast.js']);
|
||||
|
@ -2019,6 +2024,8 @@ $(document).on('pagecreate', ".page", function () {
|
|||
var page = this;
|
||||
var require = this.getAttribute('data-require');
|
||||
|
||||
Dashboard.ensurePageTitle($(page));
|
||||
|
||||
if (require) {
|
||||
requirejs(require.split(','), function () {
|
||||
|
||||
|
@ -2088,7 +2095,6 @@ $(document).on('pagecreate', ".page", function () {
|
|||
Dashboard.firePageEvent(page, 'pageshowready');
|
||||
|
||||
Dashboard.ensureHeader(page);
|
||||
Dashboard.ensurePageTitle(page);
|
||||
|
||||
if (apiClient && !apiClient.isWebSocketOpen()) {
|
||||
Dashboard.refreshSystemInfoFromServer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue