Move oc_appconfig/OC.appConfig to the main bundle (#15354)

Move oc_appconfig/OC.appConfig to the main bundle
This commit is contained in:
John Molakvoæ 2019-05-06 17:48:53 +02:00 committed by GitHub
commit e0c62352b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 107 deletions

148
core/js/dist/main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -55,7 +55,6 @@ Object.assign(window.OC, {
* @deprecated use {@link OC.getCurrentUser} instead
*/
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
appConfig: window.oc_appconfig || {},
theme: window.oc_defaults || {},
coreApps:['', 'admin','log','core/search','settings','core','3rdparty'],
requestToken: oc_requesttoken,

View File

@ -8,7 +8,7 @@
*
*/
/* global moment, oc_appconfig */
/* global moment, OC */
(function() {
if (!OC.Share) {
@ -21,16 +21,16 @@
var ShareConfigModel = OC.Backbone.Model.extend({
defaults: {
publicUploadEnabled: false,
enforcePasswordForPublicLink: oc_appconfig.core.enforcePasswordForPublicLink,
enableLinkPasswordByDefault: oc_appconfig.core.enableLinkPasswordByDefault,
isDefaultExpireDateEnforced: oc_appconfig.core.defaultExpireDateEnforced === true,
isDefaultExpireDateEnabled: oc_appconfig.core.defaultExpireDateEnabled === true,
isRemoteShareAllowed: oc_appconfig.core.remoteShareAllowed,
isMailShareAllowed: oc_appconfig.shareByMailEnabled !== undefined,
defaultExpireDate: oc_appconfig.core.defaultExpireDate,
isResharingAllowed: oc_appconfig.core.resharingAllowed,
isPasswordForMailSharesRequired: (oc_appconfig.shareByMail === undefined) ? false : oc_appconfig.shareByMail.enforcePasswordProtection,
allowGroupSharing: oc_appconfig.core.allowGroupSharing
enforcePasswordForPublicLink: OC.appConfig.core.enforcePasswordForPublicLink,
enableLinkPasswordByDefault: OC.appConfig.core.enableLinkPasswordByDefault,
isDefaultExpireDateEnforced: OC.appConfig.core.defaultExpireDateEnforced === true,
isDefaultExpireDateEnabled: OC.appConfig.core.defaultExpireDateEnabled === true,
isRemoteShareAllowed: OC.appConfig.core.remoteShareAllowed,
isMailShareAllowed: OC.appConfig.shareByMailEnabled !== undefined,
defaultExpireDate: OC.appConfig.core.defaultExpireDate,
isResharingAllowed: OC.appConfig.core.resharingAllowed,
isPasswordForMailSharesRequired: (OC.appConfig.shareByMail === undefined) ? false : OC.appConfig.shareByMail.enforcePasswordProtection,
allowGroupSharing: OC.appConfig.core.allowGroupSharing
},
/**
@ -52,7 +52,7 @@
* @returns {string}
*/
getFederatedShareDocLink: function() {
return oc_appconfig.core.federatedCloudShareDoc;
return OC.appConfig.core.federatedCloudShareDoc;
},
getDefaultExpirationDateString: function () {

View File

@ -97,7 +97,7 @@ OC.config = {
session_keepalive: false,
blacklist_files_regex: '\.(part|filepart)$',
};
window.oc_appconfig = {
OC.appConfig = {
core: {}
};
window.oc_defaults = {

View File

@ -19,7 +19,6 @@
*
*/
/* global oc_appconfig */
describe('OC.Share tests', function() {
describe('markFileAsShared', function() {
var $file;

View File

@ -19,7 +19,6 @@
*
*/
/* global oc_appconfig */
describe('OC.Share.ShareDialogShareeListView', function () {
var oldCurrentUser;
@ -31,8 +30,8 @@ describe('OC.Share.ShareDialogShareeListView', function () {
beforeEach(function () {
/* jshint camelcase:false */
oldAppConfig = _.extend({}, oc_appconfig.core);
oc_appconfig.core.enforcePasswordForPublicLink = false;
oldAppConfig = _.extend({}, OC.appConfig.core);
OC.appConfig.core.enforcePasswordForPublicLink = false;
fileInfoModel = new OCA.Files.FileInfoModel({
id: 123,
@ -84,7 +83,7 @@ describe('OC.Share.ShareDialogShareeListView', function () {
afterEach(function () {
OC.currentUser = oldCurrentUser;
/* jshint camelcase:false */
oc_appconfig.core = oldAppConfig;
OC.appConfig.core = oldAppConfig;
listView.remove();
updateShareStub.restore();
});

View File

@ -19,7 +19,7 @@
*
*/
/* global oc_appconfig, sinon */
/* global sinon, OC */
describe('OC.Share.ShareDialogView', function() {
var $container;
var oldConfig;
@ -44,8 +44,8 @@ describe('OC.Share.ShareDialogView', function() {
oldConfig = OC.config;
OC.config['sharing.maxAutocompleteResults'] = 0;
/* jshint camelcase:false */
oldAppConfig = _.extend({}, oc_appconfig.core);
oc_appconfig.core.enforcePasswordForPublicLink = false;
oldAppConfig = _.extend({}, OC.appConfig.core);
OC.appConfig.core.enforcePasswordForPublicLink = false;
fetchStub = sinon.stub(OC.Share.ShareItemModel.prototype, 'fetch');
saveLinkShareStub = sinon.stub(OC.Share.ShareItemModel.prototype, 'saveLinkShare');
@ -113,7 +113,7 @@ describe('OC.Share.ShareDialogView', function() {
OC.currentUser = oldCurrentUser;
OC.config = oldConfig;
/* jshint camelcase:false */
oc_appconfig.core = oldAppConfig;
OC.appConfig.core = oldAppConfig;
dialog.remove();
fetchStub.restore();

View File

@ -19,7 +19,8 @@
*
*/
/* global oc_appconfig */
/* global OC */
describe('OC.Share.ShareItemModel', function() {
var fetchSharesStub, fetchReshareStub;
var fetchSharesDeferred, fetchReshareDeferred;
@ -492,7 +493,7 @@ describe('OC.Share.ShareItemModel', function() {
describe('share permissions', function() {
beforeEach(function() {
oc_appconfig.core.resharingAllowed = true;
OC.appConfig.core.resharingAllowed = true;
});
/**

View File

@ -18,10 +18,10 @@
*
*/
import OCP from '../OCP/index';
import {getValue, setValue, getApps, getKeys, deleteKey} from '../OCP/appconfig'
export const appConfig = window.oc_appconfig || {}
/**
* @namespace
* @deprecated 16.0.0 Use OCP.AppConfig instead

View File

@ -20,7 +20,7 @@
*/
import Apps from './apps'
import AppConfig from './appconfig'
import {AppConfig, appConfig} from './appconfig'
import Backbone from './backbone'
import Config from './config'
import ContactsMenu from './contactsmenu'
@ -49,6 +49,7 @@ import {redirect, reload} from './navigation'
export default {
Apps,
AppConfig,
appConfig,
Backbone,
ContactsMenu,
config: Config,

View File

@ -248,7 +248,7 @@ $(document).ready(function(){
// run setup checks then gather error messages
$.when(
OC.SetupChecks.checkWebDAV(),
OC.SetupChecks.checkWellKnownUrl('/.well-known/webfinger', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true && !!oc_appconfig.core.public_webfinger, [200, 501]),
OC.SetupChecks.checkWellKnownUrl('/.well-known/webfinger', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true && !!OC.appConfig.core.public_webfinger, [200, 501]),
OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkWellKnownUrl('/.well-known/carddav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocm-provider/', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),