Cleanup (#152)
* unused signal * remove isGuest thing This is always false; no point in having conditionals depending on this variable * another unused variable
This commit is contained in:
parent
ad21d5d89b
commit
8bbc30c52d
@ -65,7 +65,4 @@ if ($wopiUrl !== '') {
|
|||||||
$policy = new ContentSecurityPolicy();
|
$policy = new ContentSecurityPolicy();
|
||||||
$policy->addAllowedFrameDomain($wopiUrl);
|
$policy->addAllowedFrameDomain($wopiUrl);
|
||||||
$manager->addDefaultPolicy($policy);
|
$manager->addDefaultPolicy($policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listen to delete file signal
|
|
||||||
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");
|
|
@ -60,8 +60,6 @@ $.widget('oc.documentOverlay', {
|
|||||||
var documentsMain = {
|
var documentsMain = {
|
||||||
isEditorMode : false,
|
isEditorMode : false,
|
||||||
isViewerMode: false,
|
isViewerMode: false,
|
||||||
isGuest : false,
|
|
||||||
esId : false,
|
|
||||||
ready :false,
|
ready :false,
|
||||||
fileName: null,
|
fileName: null,
|
||||||
baseName: null,
|
baseName: null,
|
||||||
@ -280,11 +278,6 @@ var documentsMain = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
showEditor : function(title, fileId, action){
|
showEditor : function(title, fileId, action){
|
||||||
if (documentsMain.isGuest){
|
|
||||||
// !Login page mess wih WebODF toolbars
|
|
||||||
$(document.body).attr('id', 'body-user');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (documentsMain.loadError) {
|
if (documentsMain.loadError) {
|
||||||
documentsMain.onEditorShutdown(documentsMain.loadErrorMessage + '\n' + documentsMain.loadErrorHint);
|
documentsMain.onEditorShutdown(documentsMain.loadErrorMessage + '\n' + documentsMain.loadErrorHint);
|
||||||
return;
|
return;
|
||||||
@ -412,12 +405,6 @@ var documentsMain = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
hideEditor : function(){
|
hideEditor : function(){
|
||||||
if (documentsMain.isGuest){
|
|
||||||
// !Login page mess wih WebODF toolbars
|
|
||||||
$(document.body).attr('id', 'body-login');
|
|
||||||
$('footer,nav').show();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fade out editor
|
// Fade out editor
|
||||||
$('#mainContainer').fadeOut('fast', function() {
|
$('#mainContainer').fadeOut('fast', function() {
|
||||||
$('#mainContainer').remove();
|
$('#mainContainer').remove();
|
||||||
@ -487,8 +474,7 @@ var documentsMain = {
|
|||||||
$('footer,nav').hide();
|
$('footer,nav').hide();
|
||||||
$(documentsMain.toolbar).appendTo('#header');
|
$(documentsMain.toolbar).appendTo('#header');
|
||||||
|
|
||||||
documentsMain.canShare = !documentsMain.isGuest
|
documentsMain.canShare = typeof OC.Share !== 'undefined' && richdocuments_permissions & OC.PERMISSION_SHARE;
|
||||||
&& typeof OC.Share !== 'undefined' && richdocuments_permissions & OC.PERMISSION_SHARE;
|
|
||||||
|
|
||||||
// fade out file list and show the cloudsuite
|
// fade out file list and show the cloudsuite
|
||||||
$('#content-wrapper').fadeOut('fast').promise().done(function() {
|
$('#content-wrapper').fadeOut('fast').promise().done(function() {
|
||||||
@ -499,11 +485,6 @@ var documentsMain = {
|
|||||||
documentsMain.canEdit = Boolean(richdocuments_permissions & OC.PERMISSION_UPDATE);
|
documentsMain.canEdit = Boolean(richdocuments_permissions & OC.PERMISSION_UPDATE);
|
||||||
|
|
||||||
documentsMain.loadDocument(documentsMain.fileName, documentsMain.fileId);
|
documentsMain.loadDocument(documentsMain.fileName, documentsMain.fileId);
|
||||||
|
|
||||||
if (documentsMain.isGuest){
|
|
||||||
$('#odf-close').text(t('richdocuments', 'Save') );
|
|
||||||
$('#odf-close').removeClass('icon-view-close');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -564,9 +545,6 @@ var documentsMain = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show: function(fileId){
|
show: function(fileId){
|
||||||
if (documentsMain.isGuest){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
documentsMain.UI.showProgress(t('richdocuments', 'Loading documents…'));
|
documentsMain.UI.showProgress(t('richdocuments', 'Loading documents…'));
|
||||||
documentsMain.docs.documentGrid('render', fileId);
|
documentsMain.docs.documentGrid('render', fileId);
|
||||||
documentsMain.UI.hideProgress();
|
documentsMain.UI.hideProgress();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user