diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js
index d7188a89b..04559af08 100644
--- a/apps/common/main/lib/controller/ReviewChanges.js
+++ b/apps/common/main/lib/controller/ReviewChanges.js
@@ -94,7 +94,7 @@ define([
Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this));
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
- Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
},
setConfig: function (data, api) {
this.setApi(api);
@@ -111,7 +111,7 @@ define([
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.onApiShowChange, this));
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
}
- this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
+ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiServerDisconnect, this));
}
},
@@ -526,6 +526,7 @@ define([
app.getController('RightMenu').SetDisabled(disable, false);
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
app.getController('DocumentHolder').getView().SetDisabled(disable);
+ app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
var leftMenu = app.getController('LeftMenu').leftMenu;
leftMenu.btnComments.setDisabled(disable);
@@ -626,7 +627,7 @@ define([
})).show();
},
- onCoAuthoringDisconnect: function() {
+ onApiServerDisconnect: function() {
this.SetDisabled(true);
},
diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js
index cf1f0967e..1b870e814 100644
--- a/apps/common/main/lib/view/Plugins.js
+++ b/apps/common/main/lib/view/Plugins.js
@@ -74,7 +74,7 @@ define([
_.extend(this, options);
this._locked = false;
this._state = {
- DisabledControls: true
+ DisabledControls: false
};
this.lockedControls = [];
Common.UI.BaseView.prototype.initialize.call(this, arguments);
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 3b231fc6f..d06f3754b 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -331,6 +331,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -910,6 +911,7 @@ define([
me.fillTextArt(me.api.asc_getTextArtPreviews());
Common.NotificationCenter.trigger('document:ready', 'main');
+ me.applyLicense();
}
}, 50);
} else {
@@ -930,9 +932,24 @@ define([
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
+ },
+ onLicenseChanged: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
if (this._state.licenseWarning) {
- value = Common.localStorage.getItem("de-license-warning");
+ this.disableEditing(true);
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
@@ -940,7 +957,7 @@ define([
Common.UI.info({
width: 500,
title: this.textNoLicenseTitle,
- msg : this.warnNoLicense,
+ msg : this._state.licenseWarning,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
@@ -1029,8 +1046,6 @@ define([
this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string');
this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string');
- this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
-
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
@@ -2089,7 +2104,7 @@ define([
txtErrorLoadHistory: 'Loading history failed',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
@@ -2123,8 +2138,8 @@ define([
txtStyle_Intense_Quote: 'Intense Quote',
txtStyle_List_Paragraph: 'List Paragraph',
saveTextText: 'Saving document...',
- saveTitleText: 'Saving Document'
-
+ saveTitleText: 'Saving Document',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), DE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index 41e909e3a..d6dd0b269 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -2761,6 +2761,7 @@ define([
onApiCoAuthoringDisconnect: function(disableDownload) {
this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload});
this.editMode = false;
+ this.DisableToolbar(true, true);
},
DisableToolbar: function(disable, viewMode, reviewmode) {
diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js
index 9b08fbb5a..7862d7f9f 100644
--- a/apps/documenteditor/main/app/view/LeftMenu.js
+++ b/apps/documenteditor/main/app/view/LeftMenu.js
@@ -351,6 +351,7 @@ define([
},
showHistory: function() {
+ this._state.pluginIsRunning = false;
this.panelHistory.show();
this.panelHistory.$el.width((parseInt(Common.localStorage.getItem('de-mainmenu-width')) || MENU_SCALE_PART) - SCALE_MIN);
Common.NotificationCenter.trigger('layout:changed', 'history');
diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js
index 40a3cbb23..386d13f95 100644
--- a/apps/documenteditor/main/app/view/Statusbar.js
+++ b/apps/documenteditor/main/app/view/Statusbar.js
@@ -86,7 +86,7 @@ define([
me.btnZoomDown.updateHint(me.tipZoomOut + Common.Utils.String.platformKey('Ctrl+-'));
me.btnZoomUp.updateHint(me.tipZoomIn + Common.Utils.String.platformKey('Ctrl++'));
- if ( config.isEdit ) {
+ if (me.btnLanguage && me.btnLanguage.cmpEl) {
me.btnLanguage.updateHint(me.tipSetLang);
me.btnLanguage.cmpEl.on({
'show.bs.dropdown': function () {
@@ -325,6 +325,7 @@ define([
if (this.api) {
this.api.asc_registerCallback('asc_onCountPages', _.bind(_onCountPages, this));
this.api.asc_registerCallback('asc_onCurrentPage', _.bind(_onCurrentPage, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
}
return this;
@@ -356,7 +357,7 @@ define([
this.langMenu.doLayout();
if (this.langMenu.items.length>0) {
- this.btnLanguage.setDisabled(false);
+ this.btnLanguage.setDisabled(!!this.mode.isDisconnected);
}
},
@@ -390,6 +391,11 @@ define([
this.btnLanguage.setDisabled(disable || !langs);
},
+ onApiCoAuthoringDisconnect: function() {
+ this.setMode({isDisconnected:true});
+ this.SetDisabled(true);
+ },
+
pageIndexText : 'Page {0} of {1}',
goToPageText : 'Go to Page',
tipFitPage : 'Fit to Page',
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js
index 0cf7d3d98..0dcf9ca21 100644
--- a/apps/documenteditor/main/app/view/Toolbar.js
+++ b/apps/documenteditor/main/app/view/Toolbar.js
@@ -2089,59 +2089,8 @@ define([
button.setDisabled(true);
}
});
- this.btnCopy.setDisabled(true);
- this.btnPaste.setDisabled(true);
- this.btnUndo.setDisabled(true);
- this.btnRedo.setDisabled(true);
- this.btnIncFontSize.setDisabled(true);
- this.btnDecFontSize.setDisabled(true);
- this.btnBold.setDisabled(true);
- this.btnItalic.setDisabled(true);
- this.btnUnderline.setDisabled(true);
- this.btnStrikeout.setDisabled(true);
- this.btnSuperscript.setDisabled(true);
- this.btnSubscript.setDisabled(true);
- this.btnHighlightColor.setDisabled(true);
- this.btnFontColor.setDisabled(true);
- this.btnParagraphColor.setDisabled(true);
- this.btnMarkers.setDisabled(true);
- this.btnNumbers.setDisabled(true);
- this.btnMultilevels.setDisabled(true);
- this.btnAlignLeft.setDisabled(true);
- this.btnAlignCenter.setDisabled(true);
- this.btnAlignRight.setDisabled(true);
- this.btnAlignJust.setDisabled(true);
- this.btnDecLeftOffset.setDisabled(true);
- this.btnIncLeftOffset.setDisabled(true);
- this.btnLineSpace.setDisabled(true);
- this.btnShowHidenChars.setDisabled(true);
- this.btnInsertTable.setDisabled(true);
- this.btnInsertImage.setDisabled(true);
- this.btnInsertChart.setDisabled(true);
- this.btnInsertText.setDisabled(true);
- this.btnInsertTextArt.setDisabled(true);
- this.btnDropCap.setDisabled(true);
- this.btnColumns.setDisabled(true);
- this.btnInsertHyperlink.setDisabled(true);
- this.btnEditHeader.setDisabled(true);
- this.btnInsertShape.setDisabled(true);
- this.btnInsertEquation.setDisabled(true);
- this.btnPageOrient.setDisabled(true);
- this.btnPageMargins.setDisabled(true);
- this.btnPageSize.setDisabled(true);
- this.btnClearStyle.setDisabled(true);
- this.btnCopyStyle.setDisabled(true);
- this.btnColorSchemas.setDisabled(true);
- this.btnMailRecepients.setDisabled(true);
- this.btnHorizontalAlign.setDisabled(true);
- this.cmbFontName.setDisabled(true);
- this.cmbFontSize.setDisabled(true);
- this.listStyles.setDisabled(true);
- this.btnNotes.setDisabled(true);
if (mode.disableDownload)
this.btnPrint.setDisabled(true);
-
- this.btnsPageBreak.disable(true);
}
this.mode = mode;
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index 8242e6bf5..7fc02d70e 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -404,6 +404,7 @@
"DE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"DE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
diff --git a/apps/documenteditor/main/resources/help/en/Contents.json b/apps/documenteditor/main/resources/help/en/Contents.json
index 12879ec72..78f5aa4f5 100644
--- a/apps/documenteditor/main/resources/help/en/Contents.json
+++ b/apps/documenteditor/main/resources/help/en/Contents.json
@@ -29,7 +29,6 @@
{"src": "UsageInstructions/InsertFootnotes.htm", "name": "Insert footnotes" },
{"src": "UsageInstructions/InsertEquation.htm", "name": "Insert equations" },
{"src": "UsageInstructions/InsertTextObjects.htm", "name": "Insert text objects" },
- {"src": "UsageInstructions/InsertRichTextContentControls.htm", "name": "Create forms" },
{"src": "UsageInstructions/UseMailMerge.htm", "name": "Use mail merge"},
{"src": "UsageInstructions/ViewDocInfo.htm", "name": "View document information"},
{"src": "UsageInstructions/SavePrintDownload.htm", "name": "Save/download/print your document"},
diff --git a/apps/documenteditor/main/resources/help/ru/Contents.json b/apps/documenteditor/main/resources/help/ru/Contents.json
index 2f66770fc..0faf411c9 100644
--- a/apps/documenteditor/main/resources/help/ru/Contents.json
+++ b/apps/documenteditor/main/resources/help/ru/Contents.json
@@ -29,7 +29,6 @@
{"src": "UsageInstructions/InsertFootnotes.htm", "name": "Вставка сносок" },
{"src": "UsageInstructions/InsertEquation.htm", "name": "Вставка формул" },
{"src": "UsageInstructions/InsertTextObjects.htm", "name": "Вставка текстовых объектов" },
- {"src": "UsageInstructions/InsertRichTextContentControls.htm", "name": "Создание форм" },
{"src": "UsageInstructions/UseMailMerge.htm", "name": "Использование слияния"},
{"src":"UsageInstructions/ViewDocInfo.htm", "name": "Просмотр сведений о документе"},
{"src":"UsageInstructions/SavePrintDownload.htm", "name": "Сохранение/загрузка/печать документа"},
diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js
index 127777c59..99df18990 100644
--- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js
+++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js
@@ -88,6 +88,7 @@ define([
me.api.asc_registerCallback('asc_onAuthParticipantsChanged',_.bind(me.onApiUsersChanged, me));
me.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(me.onApiUserConnection, me));
me.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(me.onApiDocumentContentReady, me));
+ Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
me.api.asc_coAuthoringGetUsers();
},
@@ -344,7 +345,7 @@ define([
items[indexAfter] = items.splice(indexBefore, 1, items[indexAfter])[0];
};
- if (!objectLocked && _isEdit) {
+ if (!objectLocked && _isEdit && !me.isDisconnected) {
if (canCopy) {
menuItems.push({
caption: me.menuCut,
@@ -399,6 +400,10 @@ define([
return menuItems;
},
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
textGuest: 'Guest',
menuCut: 'Cut',
menuCopy: 'Copy',
diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js
index 3aa2febc6..51bc65ef3 100644
--- a/apps/documenteditor/mobile/app/controller/Main.js
+++ b/apps/documenteditor/mobile/app/controller/Main.js
@@ -237,6 +237,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -551,10 +552,27 @@ define([
me.api.zoomFitToWidth();
}
- DE.getController('Toolbar').activateControls();
+ me.applyLicense();
+ },
+ onLicenseChanged: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady && this._state.licenseWarning)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
+ var me = this;
if (me._state.licenseWarning) {
- value = Common.localStorage.getItem("de-license-warning");
+ DE.getController('Toolbar').activateViewControls();
+ DE.getController('Toolbar').deactivateEditControls();
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
@@ -562,7 +580,7 @@ define([
Common.localStorage.setItem("de-license-warning", now);
uiApp.modal({
title: me.textNoLicenseTitle,
- text : me.warnNoLicense,
+ text : me._state.licenseWarning,
buttons: [
{
text: me.textBuyNow,
@@ -577,10 +595,11 @@ define([
window.open('mailto:sales@onlyoffice.com', "_blank");
}
}
- ],
+ ]
});
}
- }
+ } else
+ DE.getController('Toolbar').activateControls();
},
onOpenDocument: function(progress) {
@@ -638,8 +657,6 @@ define([
me.appOptions.canDownload = me.permissions.download !== false && (!type || typeof type[1] !== 'string');
me.appOptions.canReader = (!type || typeof type[1] !== 'string');
- me._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
-
me.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof me.editorConfig.customization == 'object');
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
@@ -1221,7 +1238,7 @@ define([
textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.',
warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
@@ -1258,7 +1275,8 @@ define([
txtStyle_Subtitle: 'Subtitle',
txtStyle_Quote: 'Quote',
txtStyle_Intense_Quote: 'Intense Quote',
- txtStyle_List_Paragraph: 'List Paragraph'
+ txtStyle_List_Paragraph: 'List Paragraph',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), DE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/app/controller/Toolbar.js b/apps/documenteditor/mobile/app/controller/Toolbar.js
index 2da2aca06..3c124346a 100644
--- a/apps/documenteditor/mobile/app/controller/Toolbar.js
+++ b/apps/documenteditor/mobile/app/controller/Toolbar.js
@@ -79,6 +79,7 @@ define([
this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
setMode: function (mode) {
@@ -138,6 +139,8 @@ define([
// API handlers
onApiCanRevert: function(which, can) {
+ if (this.isDisconnected) return;
+
if (which == 'undo') {
$('#toolbar-undo').toggleClass('disabled', !can);
} else {
@@ -146,6 +149,8 @@ define([
},
onApiFocusObject: function (objects) {
+ if (this.isDisconnected) return;
+
if (objects.length > 0) {
var topObject = _.find(objects.reverse(), function (obj) {
return obj.get_ObjectType() != Asc.c_oAscTypeSelectElement.SpellCheck;
@@ -161,6 +166,18 @@ define([
$('#toolbar-edit, #toolbar-add, #toolbar-settings, #toolbar-search, #document-back').removeClass('disabled');
},
+ activateViewControls: function() {
+ $('#toolbar-search, #document-back').removeClass('disabled');
+ },
+
+ deactivateEditControls: function() {
+ $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
+ },
+
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index 856671908..e335735a9 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -147,6 +147,7 @@
"DE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"DE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Search.textNoTextFound": "Text not Found",
"DE.Controllers.Search.textReplaceAll": "Replace All",
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index 473a01bae..a3e4cd3e1 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -319,6 +319,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -694,6 +695,7 @@ define([
me.api.UpdateInterfaceState();
Common.NotificationCenter.trigger('document:ready', 'main');
+ me.applyLicense();
}
}, 50);
} else {
@@ -713,17 +715,32 @@ define([
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
+ },
+ onLicenseChanged: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
if (this._state.licenseWarning) {
- value = Common.localStorage.getItem("pe-license-warning");
+ this.disableEditing(true);
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("pe-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
- Common.localStorage.setItem("de-license-warning", now);
+ Common.localStorage.setItem("pe-license-warning", now);
Common.UI.info({
width: 500,
title: this.textNoLicenseTitle,
- msg : this.warnNoLicense,
+ msg : this._state.licenseWarning,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
@@ -740,6 +757,15 @@ define([
}
},
+ disableEditing: function(disable) {
+ var app = this.getApplication();
+ if (this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ app.getController('RightMenu').getView('RightMenu').clearSelection();
+ app.getController('Toolbar').DisableToolbar(disable);
+ app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
+ }
+ },
+
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
@@ -787,8 +813,6 @@ define([
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
- this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
-
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
@@ -1881,7 +1905,7 @@ define([
textStrict: 'Strict mode',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
@@ -1912,7 +1936,8 @@ define([
textChangesSaved: 'All changes saved',
saveTitleText: 'Saving Document',
saveTextText: 'Saving document...',
- txtLoading: 'Loading...'
+ txtLoading: 'Loading...',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), PE.Controllers.Main || {}))
});
diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js
index 553c3f7d7..8debdbec3 100644
--- a/apps/presentationeditor/main/app/view/Statusbar.js
+++ b/apps/presentationeditor/main/app/view/Statusbar.js
@@ -303,6 +303,7 @@ define([
this.api.asc_registerCallback('asc_onCountPages', _.bind(_onCountPages, this));
this.api.asc_registerCallback('asc_onCurrentPage', _.bind(_onCurrentPage, this));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
}
return this;
@@ -344,7 +345,7 @@ define([
this.langMenu.doLayout();
if (this.langMenu.items.length>0) {
this.btnLanguage.setDisabled(false || this._state.no_paragraph);
- this.btnDocLanguage.setDisabled(false);
+ this.btnDocLanguage.setDisabled(!!this.mode.isDisconnected);
}
},
@@ -389,6 +390,11 @@ define([
this.btnLanguage.setDisabled(this._state.no_paragraph);
},
+ onApiCoAuthoringDisconnect: function() {
+ this.setMode({isDisconnected:true});
+ this.SetDisabled(true);
+ },
+
pageIndexText : 'Slide {0} of {1}',
goToPageText : 'Go to Slide',
tipFitPage : 'Fit to Slide',
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index 11567d3f5..52142b2dd 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -321,6 +321,7 @@
"PE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"PE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?",
diff --git a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js
index 0bfa294c7..4f34bb20a 100644
--- a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js
+++ b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js
@@ -81,6 +81,7 @@ define([
me.api.asc_registerCallback('asc_onShowPopMenu', _.bind(me.onApiShowPopMenu, me));
me.api.asc_registerCallback('asc_onHidePopMenu', _.bind(me.onApiHidePopMenu, me));
me.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(me.onApiDocumentContentReady, me));
+ Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
},
setMode: function (mode) {
@@ -253,7 +254,7 @@ define([
items[indexAfter] = items.splice(indexBefore, 1, items[indexAfter])[0];
};
- if (!objectLocked && _isEdit) {
+ if (!objectLocked && _isEdit && !me.isDisconnected) {
if (canCopy && isObject) {
menuItems.push({
caption: me.menuCut,
@@ -309,6 +310,10 @@ define([
return menuItems;
},
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
menuCut: 'Cut',
menuCopy: 'Copy',
menuPaste: 'Paste',
diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js
index 121372001..cfbedce4a 100644
--- a/apps/presentationeditor/mobile/app/controller/Main.js
+++ b/apps/presentationeditor/mobile/app/controller/Main.js
@@ -236,6 +236,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -511,18 +512,35 @@ define([
me.api.zoomFitToPage();
}
- PE.getController('Toolbar').activateControls();
+ me.applyLicense();
+ },
+ onLicenseChanged: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady && this._state.licenseWarning)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
+ var me = this;
if (me._state.licenseWarning) {
- value = Common.localStorage.getItem("de-license-warning");
+ PE.getController('Toolbar').activateViewControls();
+ PE.getController('Toolbar').deactivateEditControls();
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("pe-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
- Common.localStorage.setItem("de-license-warning", now);
+ Common.localStorage.setItem("pe-license-warning", now);
uiApp.modal({
title: me.textNoLicenseTitle,
- text : me.warnNoLicense,
+ text : me._state.licenseWarning,
buttons: [
{
text: me.textBuyNow,
@@ -537,10 +555,11 @@ define([
window.open('mailto:sales@onlyoffice.com', "_blank");
}
}
- ],
+ ]
});
}
- }
+ } else
+ PE.getController('Toolbar').activateControls();
},
onOpenDocument: function(progress) {
@@ -597,8 +616,6 @@ define([
me.appOptions.canDownloadOrigin = !me.appOptions.nativeApp && me.permissions.download !== false && (type && typeof type[1] === 'string');
me.appOptions.canDownload = !me.appOptions.nativeApp && me.permissions.download !== false && (!type || typeof type[1] !== 'string');
- me._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
-
me.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof me.editorConfig.customization == 'object');
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
@@ -1227,7 +1244,7 @@ define([
textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
@@ -1259,7 +1276,8 @@ define([
txtImage: 'Image',
txtSlideNumber: 'Slide number',
txtSlideSubtitle: 'Slide subtitle',
- txtSlideTitle: 'Slide title'
+ txtSlideTitle: 'Slide title',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), PE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/presentationeditor/mobile/app/controller/Toolbar.js b/apps/presentationeditor/mobile/app/controller/Toolbar.js
index f9e5c197d..38fe181cc 100644
--- a/apps/presentationeditor/mobile/app/controller/Toolbar.js
+++ b/apps/presentationeditor/mobile/app/controller/Toolbar.js
@@ -79,6 +79,7 @@ define([
this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
setMode: function (mode) {
@@ -138,6 +139,8 @@ define([
// API handlers
onApiCanRevert: function(which, can) {
+ if (this.isDisconnected) return;
+
if (which == 'undo') {
$('#toolbar-undo').toggleClass('disabled', !can);
} else {
@@ -146,6 +149,8 @@ define([
},
onApiFocusObject: function (objects) {
+ if (this.isDisconnected) return;
+
if (objects.length > 0) {
var slide_deleted = false,
slide_lock = false,
@@ -172,6 +177,18 @@ define([
$('#toolbar-preview, #toolbar-settings, #toolbar-search, #document-back').removeClass('disabled');
},
+ activateViewControls: function() {
+ $('#toolbar-preview, #toolbar-search, #document-back').removeClass('disabled');
+ },
+
+ deactivateEditControls: function() {
+ $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
+ },
+
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',
diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json
index f3a5064cc..ef5060bc6 100644
--- a/apps/presentationeditor/mobile/locale/en.json
+++ b/apps/presentationeditor/mobile/locale/en.json
@@ -204,6 +204,7 @@
"PE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"PE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Search.textNoTextFound": "Text not Found",
"PE.Controllers.Settings.notcriticalErrorTitle": "Warning",
diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
index 86453cbff..1199fc3f0 100644
--- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
@@ -1517,6 +1517,9 @@ define([
if (!documentHolder.viewModeMenu)
documentHolder.createDelayedElementsViewer();
+ if (!documentHolder.viewModeMenu)
+ documentHolder.createDelayedElementsViewer();
+
if (!showMenu && !documentHolder.viewModeMenu.isVisible()) return;
if (isimagemenu && this.permissions.canProtect) {
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 3efaae235..fc2ba9bf3 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -355,6 +355,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
},
@@ -706,6 +707,7 @@ define([
toolbarController.onApiCoAuthoringDisconnect();
Common.NotificationCenter.trigger('document:ready', 'main');
+ me.applyLicense();
}
}, 50);
} else {
@@ -739,17 +741,34 @@ define([
if (typeof document.hidden !== 'undefined' && document.hidden) {
document.addEventListener('visibilitychange', checkWarns);
} else checkWarns();
+ },
+ onLicenseChanged: function(params) {
+ if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return;
+
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
if (this._state.licenseWarning) {
- value = Common.localStorage.getItem("de-license-warning");
+ this.disableEditing(true);
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("sse-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
- Common.localStorage.setItem("de-license-warning", now);
+ Common.localStorage.setItem("sse-license-warning", now);
Common.UI.info({
width: 500,
title: this.textNoLicenseTitle,
- msg : this.warnNoLicense,
+ msg : this._state.licenseWarning,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
@@ -766,6 +785,14 @@ define([
}
},
+ disableEditing: function(disable) {
+ var app = this.getApplication();
+ if (this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ app.getController('RightMenu').getView('RightMenu').clearSelection();
+ app.getController('Toolbar').DisableToolbar(disable);
+ }
+ },
+
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
@@ -830,8 +857,6 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
- this._state.licenseWarning = !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
-
this.applyModeCommonElements();
this.applyModeEditorElements();
@@ -2065,7 +2090,7 @@ define([
errorFrmlWrongReferences: 'The function refers to a sheet that does not exist.
Please check the data and try again.',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
confirmPutMergeRange: 'The source data contains merged cells.
They will be unmerged before they are pasted into the table.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.',
@@ -2105,7 +2130,8 @@ define([
txtStyle_Total: 'Total',
txtStyle_Currency: 'Currency',
txtStyle_Percent: 'Percent',
- txtStyle_Comma: 'Comma'
+ txtStyle_Comma: 'Comma',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), SSE.Controllers.Main || {}))
});
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 0a626e334..972ac7729 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -436,6 +436,7 @@
"SSE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"SSE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textWarning": "Warning",
diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js
index 6651aaaf3..0690b9cf9 100644
--- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js
@@ -82,6 +82,7 @@ define([
this.api.asc_registerCallback('asc_onShowPopMenu', _.bind(this.onApiShowPopMenu, this));
this.api.asc_registerCallback('asc_onHidePopMenu', _.bind(this.onApiHidePopMenu, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
setMode: function (mode) {
@@ -180,7 +181,7 @@ define([
},
onApiShowPopMenu: function(posX, posY) {
- if ( !_isEdit ) return;
+ if ( !_isEdit || this.isDisconnected) return;
if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in, .actions-modal').length > 0) {
return;
@@ -334,6 +335,10 @@ define([
return menuItems;
},
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
warnMergeLostData: 'Operation can destroy data in the selected cells.
Continue?',
menuCopy: 'Copy',
menuCut: 'Cut',
diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js
index aeeae8a11..873d242a0 100644
--- a/apps/spreadsheeteditor/mobile/app/controller/Main.js
+++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js
@@ -239,6 +239,7 @@ define([
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
+ this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -534,10 +535,33 @@ define([
mode: me.appOptions.isEdit ? 'edit' : 'view'
});
- SSE.getController('Toolbar').activateControls();
+ me.applyLicense();
+ $('.view-main').on('click', function (e) {
+ uiApp.closeModal('.document-menu.modal-in');
+ })
+ },
+
+ onLicenseChanged: function(params) {
+ if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return;
+
+ var licType = params.asc_getLicenseType();
+ if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
+ }
+
+ if (this._isDocReady && this._state.licenseWarning)
+ this.applyLicense();
+ },
+
+ applyLicense: function() {
+ var me = this;
if (me._state.licenseWarning) {
- value = Common.localStorage.getItem("sse-license-warning");
+ SSE.getController('Toolbar').activateViewControls();
+ SSE.getController('Toolbar').deactivateEditControls();
+ Common.NotificationCenter.trigger('api:disconnect');
+
+ var value = Common.localStorage.getItem("sse-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
@@ -545,7 +569,7 @@ define([
Common.localStorage.setItem("sse-license-warning", now);
uiApp.modal({
title: me.textNoLicenseTitle,
- text : me.warnNoLicense,
+ text : me._state.licenseWarning,
buttons: [
{
text: me.textBuyNow,
@@ -560,14 +584,11 @@ define([
window.open('mailto:sales@onlyoffice.com', "_blank");
}
}
- ],
+ ]
});
}
- }
-
- $('.view-main').on('click', function (e) {
- uiApp.closeModal('.document-menu.modal-in');
- })
+ } else
+ SSE.getController('Toolbar').activateControls();
},
onOpenDocument: function(progress) {
@@ -624,8 +645,6 @@ define([
me.appOptions.canDownload = !me.appOptions.nativeApp && (me.permissions.download !== false);
me.appOptions.canPrint = (me.permissions.print !== false);
- me._state.licenseWarning = !(me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) && (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
-
me.applyModeCommonElements();
me.applyModeEditorElements();
@@ -1365,7 +1384,7 @@ define([
txtErrorLoadHistory: 'Loading history failed',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE open source version',
- warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
+ warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.',
warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
@@ -1417,7 +1436,8 @@ define([
txtStyle_Total: 'Total',
txtStyle_Currency: 'Currency',
txtStyle_Percent: 'Percent',
- txtStyle_Comma: 'Comma'
+ txtStyle_Comma: 'Comma',
+ warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.'
}
})(), SSE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js
index 5ed1c7c18..53479d170 100644
--- a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js
@@ -86,6 +86,7 @@ define([
this.api.asc_registerCallback('asc_onWorkbookLocked', _.bind(this.onApiWorkbookLocked, this));
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onApiWorksheetLocked, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
},
@@ -159,6 +160,8 @@ define([
},
onApiCanRevert: function(which, can) {
+ if (this.isDisconnected) return;
+
if (which == 'undo') {
$('#toolbar-undo').toggleClass('disabled', !can);
} else {
@@ -167,6 +170,8 @@ define([
},
onApiSelectionChanged: function(info) {
+ if (this.isDisconnected) return;
+
if ( !info ) info = this.api.asc_getCellInfo();
var islocked = false;
@@ -195,6 +200,18 @@ define([
$('#toolbar-settings, #toolbar-search, #document-back').removeClass('disabled');
},
+ activateViewControls: function() {
+ $('#toolbar-search, #document-back').removeClass('disabled');
+ },
+
+ deactivateEditControls: function() {
+ $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
+ },
+
+ onCoAuthoringDisconnect: function() {
+ this.isDisconnected = true;
+ },
+
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',
diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json
index a556627fc..9fc71c590 100644
--- a/apps/spreadsheeteditor/mobile/locale/en.json
+++ b/apps/spreadsheeteditor/mobile/locale/en.json
@@ -256,6 +256,7 @@
"SSE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"SSE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
"SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.",
+ "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Search.textNoTextFound": "Text not found",
"SSE.Controllers.Search.textReplaceAll": "Replace All",