Move OC.appswebroots to the bundle and deprecate oc_appswebroots
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
22f3306fd0
commit
acf0ca1541
|
@ -152,7 +152,7 @@ OCA.Sharing.PublicApp = {
|
||||||
img.attr('src', $('#downloadURL').val());
|
img.attr('src', $('#downloadURL').val());
|
||||||
imgcontainer.appendTo('#imgframe');
|
imgcontainer.appendTo('#imgframe');
|
||||||
} else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text' && window.btoa) {
|
} else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text' && window.btoa) {
|
||||||
if (oc_appswebroots['files_texteditor'] !== undefined) {
|
if (OC.appswebroots['files_texteditor'] !== undefined) {
|
||||||
// the text editor handles the previewing
|
// the text editor handles the previewing
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
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,7 +24,6 @@ Object.assign(window.OC, {
|
||||||
*/
|
*/
|
||||||
_capabilities: window.oc_capabilities || null,
|
_capabilities: window.oc_capabilities || null,
|
||||||
|
|
||||||
appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false,
|
|
||||||
/**
|
/**
|
||||||
* Currently logged in user or null if none
|
* Currently logged in user or null if none
|
||||||
*
|
*
|
||||||
|
|
|
@ -878,7 +878,7 @@
|
||||||
expireDate = moment(share.expiration, 'YYYY-MM-DD').format('DD-MM-YYYY');
|
expireDate = moment(share.expiration, 'YYYY-MM-DD').format('DD-MM-YYYY');
|
||||||
}
|
}
|
||||||
|
|
||||||
var isTalkEnabled = oc_appswebroots['spreed'] !== undefined;
|
var isTalkEnabled = OC.appswebroots['spreed'] !== undefined;
|
||||||
var sendPasswordByTalk = share.sendPasswordByTalk;
|
var sendPasswordByTalk = share.sendPasswordByTalk;
|
||||||
|
|
||||||
var hideDownload = share.hideDownload;
|
var hideDownload = share.hideDownload;
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
isFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder(),
|
isFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder(),
|
||||||
isPasswordSet: hasPassword && !sendPasswordByTalk,
|
isPasswordSet: hasPassword && !sendPasswordByTalk,
|
||||||
isPasswordByTalkSet: hasPassword && sendPasswordByTalk,
|
isPasswordByTalkSet: hasPassword && sendPasswordByTalk,
|
||||||
isTalkEnabled: oc_appswebroots['spreed'] !== undefined,
|
isTalkEnabled: OC.appswebroots['spreed'] !== undefined,
|
||||||
secureDropMode: !this.model.hasReadPermission(shareIndex),
|
secureDropMode: !this.model.hasReadPermission(shareIndex),
|
||||||
hasExpireDate: this.model.getExpireDate(shareIndex) !== null,
|
hasExpireDate: this.model.getExpireDate(shareIndex) !== null,
|
||||||
shareNote: shareNote,
|
shareNote: shareNote,
|
||||||
|
|
|
@ -88,7 +88,7 @@ window.firstDay = 0;
|
||||||
window.oc_debug = true;
|
window.oc_debug = true;
|
||||||
// FIXME: OC.webroot is supposed to be only the path!!!
|
// FIXME: OC.webroot is supposed to be only the path!!!
|
||||||
OC.webroot = location.href + '/';
|
OC.webroot = location.href + '/';
|
||||||
window.oc_appswebroots = {
|
OC.appswebroots = {
|
||||||
"files": window.webroot + '/apps/files/',
|
"files": window.webroot + '/apps/files/',
|
||||||
"files_sharing": window.webroot + '/apps/files_sharing/'
|
"files_sharing": window.webroot + '/apps/files_sharing/'
|
||||||
};
|
};
|
||||||
|
|
|
@ -243,7 +243,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () {
|
||||||
configModel.isShareWithLinkAllowed.returns(true);
|
configModel.isShareWithLinkAllowed.returns(true);
|
||||||
|
|
||||||
// "Enable" Talk
|
// "Enable" Talk
|
||||||
window.oc_appswebroots['spreed'] = OC.getRootPath() + '/apps/files/';
|
OC.appswebroots['spreed'] = OC.getRootPath() + '/apps/files/';
|
||||||
|
|
||||||
shareModel.set({
|
shareModel.set({
|
||||||
linkShares: [{
|
linkShares: [{
|
||||||
|
@ -284,7 +284,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () {
|
||||||
|
|
||||||
it('is not shown if there is a password set but Talk is not enabled', function() {
|
it('is not shown if there is a password set but Talk is not enabled', function() {
|
||||||
// "Disable" Talk
|
// "Disable" Talk
|
||||||
delete window.oc_appswebroots['spreed'];
|
delete OC.appswebroots['spreed'];
|
||||||
|
|
||||||
view.render();
|
view.render();
|
||||||
|
|
||||||
|
|
|
@ -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 appswebroots = (window._oc_appswebroots !== undefined) ? window._oc_appswebroots : false
|
||||||
|
|
||||||
|
export default appswebroots
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
import Apps from './apps'
|
import Apps from './apps'
|
||||||
import {AppConfig, appConfig} from './appconfig'
|
import {AppConfig, appConfig} from './appconfig'
|
||||||
|
import appswebroots from './appswebroots'
|
||||||
import Backbone from './backbone'
|
import Backbone from './backbone'
|
||||||
import Config from './config'
|
import Config from './config'
|
||||||
import ContactsMenu from './contactsmenu'
|
import ContactsMenu from './contactsmenu'
|
||||||
|
@ -53,6 +54,7 @@ export default {
|
||||||
Apps,
|
Apps,
|
||||||
AppConfig,
|
AppConfig,
|
||||||
appConfig,
|
appConfig,
|
||||||
|
appswebroots,
|
||||||
Backbone,
|
Backbone,
|
||||||
ContactsMenu,
|
ContactsMenu,
|
||||||
config: Config,
|
config: Config,
|
||||||
|
|
|
@ -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/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import appswebroots from "./OC/appswebroots";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Function} func the library to deprecate
|
* @param {Function} func the library to deprecate
|
||||||
|
@ -107,6 +109,7 @@ window['md5'] = md5
|
||||||
window['moment'] = moment
|
window['moment'] = moment
|
||||||
|
|
||||||
window['OC'] = OC
|
window['OC'] = OC
|
||||||
|
setDeprecatedProp('oc_appswebroots', OC.appswebroots, 'use OC.appswebroots instead')
|
||||||
setDeprecatedProp('oc_config', OC.config, 'use OC.config instead')
|
setDeprecatedProp('oc_config', OC.config, 'use OC.config instead')
|
||||||
setDeprecatedProp('oc_debug', OC.debug, 'use OC.debug instead')
|
setDeprecatedProp('oc_debug', OC.debug, 'use OC.debug instead')
|
||||||
setDeprecatedProp('oc_isadmin', OC.isUserAdmin(), 'use OC.isUserAdmin() instead')
|
setDeprecatedProp('oc_isadmin', OC.isUserAdmin(), 'use OC.isUserAdmin() instead')
|
||||||
|
|
|
@ -171,7 +171,7 @@ class JSConfigHelper {
|
||||||
"backendAllowsPasswordConfirmation" => $userBackendAllowsPasswordConfirmation ? 'true' : 'false',
|
"backendAllowsPasswordConfirmation" => $userBackendAllowsPasswordConfirmation ? 'true' : 'false',
|
||||||
"oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
|
"oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
|
||||||
"_oc_webroot" => "\"".\OC::$WEBROOT."\"",
|
"_oc_webroot" => "\"".\OC::$WEBROOT."\"",
|
||||||
"oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
|
"_oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
|
||||||
"datepickerFormatDate" => json_encode($this->l->l('jsdate', null)),
|
"datepickerFormatDate" => json_encode($this->l->l('jsdate', null)),
|
||||||
'nc_lastLogin' => $lastConfirmTimestamp,
|
'nc_lastLogin' => $lastConfirmTimestamp,
|
||||||
'nc_pageLoad' => time(),
|
'nc_pageLoad' => time(),
|
||||||
|
|
Loading…
Reference in New Issue