Merge pull request #15420 from nextcloud/refactor/oc-constants-bundle-II
Move rest of contant-like OC props to the bundle
This commit is contained in:
commit
049b92b078
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
|
@ -24,9 +24,7 @@ Object.assign(window.OC, {
|
||||||
*/
|
*/
|
||||||
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
|
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
|
||||||
theme: window.oc_defaults || {},
|
theme: window.oc_defaults || {},
|
||||||
coreApps:['', 'admin','log','core/search','settings','core','3rdparty'],
|
|
||||||
requestToken: oc_requesttoken,
|
requestToken: oc_requesttoken,
|
||||||
menuSpeed: 50,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a user file is allowed to be handled.
|
* Check if a user file is allowed to be handled.
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
* along with this program. If not see <http://www.gnu.org/licenses/>.
|
* along with this program. If not see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export const coreApps = ['', 'admin','log','core/search','settings','core','3rdparty']
|
||||||
|
export const menuSpeed = 50
|
||||||
export const PERMISSION_NONE = 0
|
export const PERMISSION_NONE = 0
|
||||||
export const PERMISSION_CREATE = 4
|
export const PERMISSION_CREATE = 4
|
||||||
export const PERMISSION_READ = 1
|
export const PERMISSION_READ = 1
|
||||||
|
|
|
@ -25,6 +25,8 @@ import appswebroots from './appswebroots'
|
||||||
import Backbone from './backbone'
|
import Backbone from './backbone'
|
||||||
import Config from './config'
|
import Config from './config'
|
||||||
import {
|
import {
|
||||||
|
coreApps,
|
||||||
|
menuSpeed,
|
||||||
PERMISSION_ALL,
|
PERMISSION_ALL,
|
||||||
PERMISSION_CREATE,
|
PERMISSION_CREATE,
|
||||||
PERMISSION_DELETE,
|
PERMISSION_DELETE,
|
||||||
|
@ -64,6 +66,8 @@ export default {
|
||||||
/*
|
/*
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
|
coreApps,
|
||||||
|
menuSpeed,
|
||||||
PERMISSION_ALL,
|
PERMISSION_ALL,
|
||||||
PERMISSION_CREATE,
|
PERMISSION_CREATE,
|
||||||
PERMISSION_DELETE,
|
PERMISSION_DELETE,
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
import _ from 'underscore'
|
import _ from 'underscore'
|
||||||
|
|
||||||
import OC from './index'
|
import OC from './index'
|
||||||
|
import {coreApps} from './constants'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an absolute url to a file in an app
|
* Get an absolute url to a file in an app
|
||||||
|
@ -105,7 +106,7 @@ export const generateUrl = (url, params, options) => {
|
||||||
* @return {string} Absolute URL for a file in an app
|
* @return {string} Absolute URL for a file in an app
|
||||||
*/
|
*/
|
||||||
export const filePath = (app, type, file) => {
|
export const filePath = (app, type, file) => {
|
||||||
const isCore = OC.coreApps.indexOf(app) !== -1
|
const isCore = coreApps.indexOf(app) !== -1
|
||||||
let link = getRootPath()
|
let link = getRootPath()
|
||||||
if (file.substring(file.length - 3) === 'php' && !isCore) {
|
if (file.substring(file.length - 3) === 'php' && !isCore) {
|
||||||
link += '/index.php/apps/' + app;
|
link += '/index.php/apps/' + app;
|
||||||
|
|
Loading…
Reference in New Issue