Move oc_config to the bundle

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/15293/head
Christoph Wurst 6 years ago
parent ac700506bd
commit 9b79aa664d
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 42
      core/js/dist/main.js
  2. 2
      core/js/dist/main.js.map
  3. 3
      core/js/js.js
  4. 2
      core/js/tests/specHelper.js
  5. 24
      core/src/OC/config.js
  6. 2
      core/src/OC/index.js
  7. 9
      core/src/globals.js
  8. 2
      lib/private/Template/JSConfigHelper.php

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -6,8 +6,6 @@ var oc_webroot;
var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('data-user');
var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken');
window.oc_config = window.oc_config || {};
if (typeof oc_webroot === "undefined") {
oc_webroot = location.pathname;
var pos = oc_webroot.indexOf('/index.php/');
@ -61,7 +59,6 @@ Object.assign(window.OC, {
* @deprecated use {@link OC.getCurrentUser} instead
*/
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
config: window.oc_config,
appConfig: window.oc_appconfig || {},
theme: window.oc_defaults || {},
coreApps:['', 'admin','log','core/search','settings','core','3rdparty'],

@ -93,7 +93,7 @@ window.oc_appswebroots = {
"files": window.oc_webroot + '/apps/files/',
"files_sharing": window.oc_webroot + '/apps/files_sharing/'
};
window.oc_config = {
OC.config = {
session_lifetime: 600 * 1000,
session_keepalive: false,
blacklist_files_regex: '\.(part|filepart)$',

@ -0,0 +1,24 @@
/*
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const config = window._oc_config || {}
export default config

@ -22,6 +22,7 @@
import Apps from './apps'
import AppConfig from './appconfig'
import Backbone from './backbone'
import Config from './config'
import ContactsMenu from './contactsmenu'
import Dialogs from './dialogs'
import EventSource from './eventsource'
@ -40,6 +41,7 @@ export default {
AppConfig,
Backbone,
ContactsMenu,
config: Config,
dialogs: Dialogs,
EventSource,
L10N,

@ -34,7 +34,10 @@ const deprecate = (func, funcName) => {
return newFunc
}
const setDeprecatedProp = (global, val, msg) =>
const setDeprecatedProp = (global, val, msg) => {
if (window[global] !== undefined) {
delete window[global]
}
Object.defineProperty(window, global, {
get: () => {
if (msg) {
@ -45,6 +48,7 @@ const setDeprecatedProp = (global, val, msg) =>
return val
}
})
}
import _ from 'underscore'
import $ from 'jquery'
@ -103,7 +107,8 @@ window['md5'] = md5
window['moment'] = moment
window['OC'] = OC
setDeprecatedProp('OCDialogs', OC.dialogs, 'use OC.dialogs')
setDeprecatedProp('oc_config', OC.config, 'use OC.config instead')
setDeprecatedProp('OCDialogs', OC.dialogs, 'use OC.dialogs instead')
window['OCP'] = OCP
window['OCA'] = OCA
window['escapeHTML'] = deprecate(escapeHTML, 'escapeHTML')

@ -231,7 +231,7 @@ class JSConfigHelper {
(string)$this->l->t('Dec.')
]),
"firstDay" => json_encode($this->l->l('firstday', null)) ,
"oc_config" => json_encode([
"_oc_config" => json_encode([
'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')),
'session_keepalive' => $this->config->getSystemValue('session_keepalive', true),
'version' => implode('.', \OCP\Util::getVersion()),

Loading…
Cancel
Save