diff --git a/Readme.md b/Readme.md index 5375779d9..c99f27c6a 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,9 @@ +[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.0.1-blue.svg?style=flat) + +## web-apps + +The frontend for [ONLYOFFICE Document Server][2]. Builds the program interface and allows the user create, edit, save and export text, spreadsheet and presentation documents using the common interface of a document editor. + ## Project Information Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org") @@ -8,6 +14,11 @@ SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www. ## User Feedback and Support -If you have any problems with or questions about this image, please contact us through a [dev.onlyoffice.org][1]. +If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1]. [1]: http://dev.onlyoffice.org + [2]: https://github.com/ONLYOFFICE/DocumentServer + +## License + +web-apps is released under an GNU AGPL v3.0 license. See the LICENSE file for more information. diff --git a/apps/common/main/lib/controller/Chat.js b/apps/common/main/lib/controller/Chat.js index 767f44742..74d51fcc8 100644 --- a/apps/common/main/lib/controller/Chat.js +++ b/apps/common/main/lib/controller/Chat.js @@ -80,14 +80,17 @@ define([ setMode: function(mode) { this.mode = mode; - if (this.api && this.mode.canCoAuthoring) { - if (this.mode.canChat) + if (this.api) { + if (this.mode.canCoAuthoring && this.mode.canChat) this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this)); - this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this)); - this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this)); - this.api.asc_coAuthoringGetUsers(); - if (this.mode.canChat) + if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge ) { + this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this)); + this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this)); + this.api.asc_coAuthoringGetUsers(); + } + + if (this.mode.canCoAuthoring && this.mode.canChat) this.api.asc_coAuthoringChatGetMessages(); } return this; @@ -100,7 +103,7 @@ define([ }, onUsersChanged: function(users){ - if (!this.mode.canLicense) { + if (!this.mode.canLicense || !this.mode.canCoAuthoring) { var len = 0; for (name in users) { if (undefined !== name) len++; diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index 05a85f7c9..8a2ea25e9 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -55,7 +55,10 @@ define([ initialize: function() { }, - events: { + events: function() { + return { + 'click #id-plugin-close':_.bind(this.onToolClose,this) + }; }, onLaunch: function() { @@ -81,8 +84,9 @@ define([ } }, - onAfterRender: function(historyView) { - historyView.viewPluginsList.on('item:click', _.bind(this.onSelectPlugin, this)); + onAfterRender: function(panelPlugins) { + panelPlugins.viewPluginsList.on('item:click', _.bind(this.onSelectPlugin, this)); + this.bindViewEvents(this.panelPlugins, this.events); }, updatePluginsList: function() { @@ -119,42 +123,114 @@ define([ this.api.asc_pluginsRegister(this.panelPlugins.pluginsPath, arr); }, - onSelectPlugin: function(picker, item, record){ - this.api.asc_pluginRun(record.get('guid'), record.get('currentVariation'), ''); + onSelectPlugin: function(picker, item, record, e){ + var btn = $(e.target); + if (btn && btn.hasClass('plugin-caret')) { + var menu = this.panelPlugins.pluginMenu; + if (menu.isVisible()) { + menu.hide(); + return; + } + + var showPoint, me = this, + currentTarget = $(e.currentTarget), + parent = $(this.panelPlugins.el), + offset = currentTarget.offset(), + offsetParent = parent.offset(); + + showPoint = [offset.left - offsetParent.left + currentTarget.width(), offset.top - offsetParent.top + currentTarget.height()/2]; + + if (record != undefined) { + for (var i = 0; i < menu.items.length; i++) { + menu.removeItem(menu.items[i]); i--; + } + menu.removeAll(); + + var variations = record.get('variations'); + for (var i=0; i0) ? variation.get('description') : me.panelPlugins.textStart, + value : parseInt(variation.get('index')) + }).on('click', function(item, e) { + if (me.api) { + me.api.asc_pluginRun(record.get('guid'), item.value, ''); + } + }); + menu.addItem(mnu); + } + } + + var menuContainer = parent.find('#menu-plugin-container'); + if (!menu.rendered) { + if (menuContainer.length < 1) { + menuContainer = $('', menu.id); + parent.append(menuContainer); + } + menu.render(menuContainer); + menu.cmpEl.attr({tabindex: "-1"}); + + menu.on('show:after', function(cmp) { + if (cmp && cmp.menuAlignEl) + cmp.menuAlignEl.toggleClass('over', true); + }).on('hide:after', function(cmp) { + if (cmp && cmp.menuAlignEl) + cmp.menuAlignEl.toggleClass('over', false); + }); + } + + menuContainer.css({left: showPoint[0], top: showPoint[1]}); + + menu.menuAlignEl = currentTarget; + menu.setOffset(-11, -currentTarget.height()/2 + 2); + menu.show(); + _.delay(function() { + menu.cmpEl.focus(); + }, 10); + e.stopPropagation(); + e.preventDefault(); + } else + this.api.asc_pluginRun(record.get('guid'), 0, ''); }, - onPluginShow: function(plugin) { - var variation = plugin.get_Variations()[0]; + onPluginShow: function(plugin, variationIndex) { + var variation = plugin.get_Variations()[variationIndex]; if (!variation.get_Visual()) return; - var me = this, - arrBtns = variation.get_Buttons(), - newBtns = {}; + if (variation.get_InsideMode()) { + this.panelPlugins.openInsideMode(plugin.get_Name(), ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + variation.get_Url()); + } else { + var me = this, + arrBtns = variation.get_Buttons(), + newBtns = {}; - if (_.isArray(arrBtns)) { - _.each(arrBtns, function(b, index){ - newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')}; + if (_.isArray(arrBtns)) { + _.each(arrBtns, function(b, index){ + newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')}; + }); + } + + var _baseUrl = (plugin.get_BaseUrl().length == 0) ? me.panelPlugins.pluginsPath : plugin.get_BaseUrl(); + me.pluginDlg = new Common.Views.PluginDlg({ + title: plugin.get_Name(), + url: _baseUrl + variation.get_Url(), + buttons: newBtns, + toolcallback: _.bind(this.onToolClose, this) }); + me.pluginDlg.on('render:after', function(obj){ + obj.getChild('.footer .dlg-btn').on('click', _.bind(me.onDlgBtnClick, me)); + }).on('close', function(obj){ + me.pluginDlg = undefined; + }); + me.pluginDlg.show(); } - - var _baseUrl = (plugin.get_BaseUrl().length == 0) ? me.panelPlugins.pluginsPath : plugin.get_BaseUrl(); - me.pluginDlg = new Common.Views.PluginDlg({ - title: plugin.get_Name(), - url: _baseUrl + variation.get_Url(), - buttons: newBtns, - toolcallback: _.bind(this.onToolClose, this) - }); - me.pluginDlg.on('render:after', function(obj){ - obj.getChild('.footer .dlg-btn').on('click', _.bind(me.onDlgBtnClick, me)); - }).on('close', function(obj){ - me.pluginDlg = undefined; - }); - me.pluginDlg.show(); }, onPluginClose: function() { if (this.pluginDlg) this.pluginDlg.close(); + else + this.panelPlugins.closeInsideMode(); }, onDlgBtnClick: function(event) { diff --git a/apps/common/main/lib/view/About.js b/apps/common/main/lib/view/About.js index 32385370a..8e4e59259 100644 --- a/apps/common/main/lib/view/About.js +++ b/apps/common/main/lib/view/About.js @@ -67,7 +67,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -106,7 +106,7 @@ define([ '', '', '', - '', + '', '', '', ' - - + + + - - + + + @@ -42,5 +42,10 @@ + + +
', @@ -235,6 +235,13 @@ define([ this.fireEvent('hide', this ); }, + setMode: function(mode){ + if (mode.isLightVersion) { + $('#id-about-licensor-version-name').text(this.txtEdition + this.txtVersion + this.txtVersionNum); + $('#id-about-licensee-version-name').text(this.txtEdition + this.txtVersion + this.txtVersionNum); + } + }, + txtPoweredBy: 'Powered by', txtVersion: 'Version ', txtLicensor: 'LICENSOR', @@ -242,7 +249,8 @@ define([ txtAddress: 'address: ', txtAscAddress: 'Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021', txtMail: 'email: ', - txtTel: 'tel.: ' + txtTel: 'tel.: ', + txtEdition: 'Integration Edition ' }, Common.Views.About || {})); }); diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index bf5d4b2bd..e97ceb2bb 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -58,31 +58,128 @@ define([ '', '
', '
', - '' + '', + '', + '
- +
+ +
+ +
diff --git a/apps/documenteditor/main/app/template/LeftMenu.template b/apps/documenteditor/main/app/template/LeftMenu.template index 2bf5364f9..72e966931 100644 --- a/apps/documenteditor/main/app/template/LeftMenu.template +++ b/apps/documenteditor/main/app/template/LeftMenu.template @@ -6,9 +6,9 @@ + -
diff --git a/apps/documenteditor/main/app/template/RightMenu.template b/apps/documenteditor/main/app/template/RightMenu.template index 499e30afa..6b30dae46 100644 --- a/apps/documenteditor/main/app/template/RightMenu.template +++ b/apps/documenteditor/main/app/template/RightMenu.template @@ -16,8 +16,6 @@
-
-
diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index f7733ef72..30b232785 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -73,7 +73,8 @@ define([ Width: 0, Height: 0, FromGroup: false, - DisabledControls: false + DisabledControls: false, + isOleObject: false }; this.lockedControls = []; this._locked = false; @@ -133,12 +134,21 @@ define([ }); this.lockedControls.push(this.btnInsertFromUrl); + this.btnEditObject = new Common.UI.Button({ + el: $('#image-button-edit-object') + }); + this.lockedControls.push(this.btnEditObject); + this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnInsertFromFile.on('click', _.bind(function(btn){ if (this.api) this.api.ChangeImageFromFile(); this.fireEvent('editcomplete', this); }, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); + this.btnEditObject.on('click', _.bind(function(btn){ + if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData()); + this.fireEvent('editcomplete', this); + }, this)); $(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this)); }, @@ -149,6 +159,7 @@ define([ })); this.linkAdvanced = $('#image-advanced-link'); + this.lblReplace = $('#image-lbl-replace'); }, setApi: function(api) { @@ -215,6 +226,24 @@ define([ } this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked); + + var pluginGuid = props.asc_getPluginGuid(); + value = (pluginGuid !== null && pluginGuid !== undefined); + if (this._state.isOleObject!==value) { + this.btnInsertFromUrl.setVisible(!value); + this.btnInsertFromFile.setVisible(!value); + this.btnEditObject.setVisible(value); + this.lblReplace.text(value ? this.textEditObject : this.textInsert); + this._state.isOleObject=value; + } + + if (this._state.isOleObject) { + var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid}); + this.btnEditObject.setDisabled(plugin===null || plugin ===undefined); + } else { + this.btnInsertFromUrl.setDisabled(pluginGuid===null); + this.btnInsertFromFile.setDisabled(pluginGuid===null); + } } }, @@ -372,7 +401,7 @@ define([ textWidth: 'Width', textHeight: 'Height', textOriginalSize: 'Default Size', - textInsert: 'Insert Image', + textInsert: 'Replace Image', textFromUrl: 'From URL', textFromFile: 'From File', textAdvanced: 'Show advanced settings', @@ -382,7 +411,9 @@ define([ txtThrough: 'Through', txtTopAndBottom: 'Top and bottom', txtBehind: 'Behind', - txtInFront: 'In front' + txtInFront: 'In front', + textEditObject: 'Edit Object', + textEdit: 'Edit' }, DE.Views.ImageSettings || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 061e5570e..c658b08e0 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -141,6 +141,13 @@ define([ toggleGroup: 'leftMenuGroup' }); + this.btnComments.hide(); + this.btnChat.hide(); + + this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); + /** coauthoring end **/ + this.btnPlugins = new Common.UI.Button({ el: $('#left-btn-plugins'), hint: this.tipPlugins, @@ -148,15 +155,8 @@ define([ disabled: true, toggleGroup: 'leftMenuGroup' }); - - this.btnComments.hide(); - this.btnChat.hide(); this.btnPlugins.hide(); - - this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); - this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this)); - /** coauthoring end **/ this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this)); this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this)); @@ -227,7 +227,7 @@ define([ } } /** coauthoring end **/ - if (this.mode.canPlugins) { + if (this.mode.canPlugins && this.panelPlugins) { if (this.btnPlugins.pressed) { this.panelPlugins.show(); } else @@ -279,12 +279,12 @@ define([ this.panelChat['hide'](); this.btnChat.toggle(false, true); } - if (this.mode.canPlugins) { - this.panelPlugins['hide'](); - this.btnPlugins.toggle(false, true); - } } /** coauthoring end **/ + if (this.mode.canPlugins && this.panelPlugins) { + this.panelPlugins['hide'](); + this.btnPlugins.toggle(false, true); + } }, isOpened: function() { @@ -348,6 +348,7 @@ define([ setMode: function(mode) { this.mode = mode; + this.btnAbout.panel.setMode(mode); return this; }, @@ -365,6 +366,6 @@ define([ tipSupport : 'Feedback & Support', tipFile : 'File', tipSearch : 'Search', - tipPlugins : 'Plugins' + tipPlugins : 'Add-ons' }, DE.Views.LeftMenu || {})); }); diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js index a2f8d25dd..3b60b3216 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettings.js +++ b/apps/documenteditor/main/app/view/ParagraphSettings.js @@ -71,18 +71,18 @@ define([ this._initSettings = true; this._state = { - LineRuleIdx: 1, - LineHeight: 1.5, - LineSpacingBefore: 0, - LineSpacingAfter: 0.35, + LineRuleIdx: null, + LineHeight: null, + LineSpacingBefore: null, + LineSpacingAfter: null, AddInterval: false, BackColor: '#000000', - DisabledControls: false, + DisabledControls: true, HideTextOnlySettings: false }; this.spinners = []; this.lockedControls = []; - this._locked = false; + this._locked = true; this.isChart = false; this.render(); @@ -99,19 +99,21 @@ define([ cls: 'input-group-nr', menuStyle: 'min-width: 85px;', editable: false, - data: this._arrLineRule + data: this._arrLineRule, + disabled: this._locked }); - this.cmbLineRule.setValue(this._arrLineRule[ this._state.LineRuleIdx].value); + this.cmbLineRule.setValue(''); this.lockedControls.push(this.cmbLineRule); this.numLineHeight = new Common.UI.MetricSpinner({ el: $('#paragraph-spin-line-height'), step: .01, width: 85, - value: '1.5', + value: '', defaultUnit : "", maxValue: 132, - minValue: 0.5 + minValue: 0.5, + disabled: this._locked }); this.lockedControls.push(this.numLineHeight); @@ -119,12 +121,13 @@ define([ el: $('#paragraph-spin-spacing-before'), step: .1, width: 85, - value: '0 cm', + value: '', defaultUnit : "cm", maxValue: 55.88, minValue: 0, allowAuto : true, - autoText : this.txtAutoText + autoText : this.txtAutoText, + disabled: this._locked }); this.spinners.push(this.numSpacingBefore); this.lockedControls.push(this.numSpacingBefore); @@ -133,24 +136,27 @@ define([ el: $('#paragraph-spin-spacing-after'), step: .1, width: 85, - value: '0.35 cm', + value: '', defaultUnit : "cm", maxValue: 55.88, minValue: 0, allowAuto : true, - autoText : this.txtAutoText + autoText : this.txtAutoText, + disabled: this._locked }); this.spinners.push(this.numSpacingAfter); this.lockedControls.push(this.numSpacingAfter); this.chAddInterval = new Common.UI.CheckBox({ el: $('#paragraph-checkbox-add-interval'), - labelText: this.strSomeParagraphSpace + labelText: this.strSomeParagraphSpace, + disabled: this._locked }); this.lockedControls.push(this.chAddInterval); this.btnColor = new Common.UI.ColorButton({ style: "width:45px;", + disabled: this._locked, menu : new Common.UI.Menu({ items: [ { template: _.template('
') }, @@ -206,6 +212,7 @@ define([ })); this.linkAdvanced = $('#paragraph-advanced-link'); + this.linkAdvanced.toggleClass('disabled', this._locked); }, setApi: function(api) { diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index 3366d6cfe..0288e6a30 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -197,8 +197,8 @@ define([ } if (open) { - $('#id-empty-settings').parent().css("display", "inline-block" ); - $('#id-empty-settings').addClass("active"); + $('#id-paragraph-settings').parent().css("display", "inline-block" ); + $('#id-paragraph-settings').addClass("active"); } this.trigger('render:after', this); diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index d0eea1170..ce82c50ae 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -380,7 +380,7 @@ define([ setMode: function(mode) { this.mode = mode; this.$el.find('.el-edit')[mode.isEdit?'show':'hide'](); - this.$el.find('.el-review')[mode.canReview?'show':'hide'](); + this.$el.find('.el-review')[(mode.canReview && !mode.isLightVersion)?'show':'hide'](); this.lblChangeRights[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide'](); this.panelUsers[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide'](); }, diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index b72277cd4..414026965 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1237,7 +1237,7 @@ define([ return this; }, - render: function () { + render: function (mode) { var me = this; /** @@ -1247,7 +1247,7 @@ define([ this.trigger('render:before', this); var value = Common.localStorage.getItem("de-compact-toolbar"); - var valueCompact = (value !== null && parseInt(value) == 1); + var valueCompact = (mode.isLightVersion || value !== null && parseInt(value) == 1); value = Common.localStorage.getItem("de-hidden-title"); var valueTitle = (value !== null && parseInt(value) == 1); @@ -1258,6 +1258,7 @@ define([ value = Common.localStorage.getItem("de-hidden-rulers"); var valueRulers = (value !== null && parseInt(value) == 1); + this.mnuitemCompactToolbar.setVisible(!mode.isLightVersion); this.mnuitemCompactToolbar.setChecked(valueCompact, true); this.mnuitemHideTitleBar.setChecked(valueTitle, true); this.mnuitemHideStatusBar.setChecked(valueStatus, true); diff --git a/apps/documenteditor/main/app/view/Viewport.js b/apps/documenteditor/main/app/view/Viewport.js index b116052bc..9ee9740dd 100644 --- a/apps/documenteditor/main/app/view/Viewport.js +++ b/apps/documenteditor/main/app/view/Viewport.js @@ -140,7 +140,7 @@ define([ rightMenuView = DE.getController('RightMenu').getView('RightMenu'), statusBarView = DE.getController('Statusbar').getView('Statusbar'); - me._toolbar = toolbarView.render(); + me._toolbar = toolbarView.render(this.mode); me._rightMenu = rightMenuView.render(this.mode); var value = Common.localStorage.getItem('de-hidden-status'); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index f177f9bad..1fdd9cf28 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -157,6 +157,9 @@ "Common.Views.OpenDialog.okButtonText": "OK", "Common.Views.OpenDialog.txtEncoding": "Encoding ", "Common.Views.OpenDialog.txtTitle": "Choose %1 options", + "Common.Views.Plugins.strPlugins": "Add-ons", + "Common.Views.Plugins.textLoading": "Loading", + "Common.Views.Plugins.textStart": "Start", "Common.Views.ReviewChanges.txtAccept": "Accept", "Common.Views.ReviewChanges.txtAcceptAll": "Accept All Changes", "Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change", @@ -943,6 +946,8 @@ "DE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required", "DE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format", "DE.Views.ImageSettings.textAdvanced": "Show advanced settings", + "DE.Views.ImageSettings.textEdit": "Edit", + "DE.Views.ImageSettings.textEditObject": "Edit Object", "DE.Views.ImageSettings.textFromFile": "From File", "DE.Views.ImageSettings.textFromUrl": "From URL", "DE.Views.ImageSettings.textHeight": "Height", @@ -1026,6 +1031,7 @@ "DE.Views.LeftMenu.tipChat": "Chat", "DE.Views.LeftMenu.tipComments": "Comments", "DE.Views.LeftMenu.tipFile": "File", + "DE.Views.LeftMenu.tipPlugins": "Add-ons", "DE.Views.LeftMenu.tipSearch": "Search", "DE.Views.LeftMenu.tipSupport": "Feedback & Support", "DE.Views.LeftMenu.tipTitles": "Titles", diff --git a/apps/documenteditor/main/locale/es.json b/apps/documenteditor/main/locale/es.json index 559804b39..64c6af1a8 100644 --- a/apps/documenteditor/main/locale/es.json +++ b/apps/documenteditor/main/locale/es.json @@ -233,11 +233,11 @@ "DE.Controllers.Main.splitMaxColsErrorText": "El número de columnas debe ser menos que %1.", "DE.Controllers.Main.splitMaxRowsErrorText": "El número de filas debe ser menos que %1.", "DE.Controllers.Main.textAnonymous": "Anónimo", - "DE.Controllers.Main.textBuyNow": "Visit website", + "DE.Controllers.Main.textBuyNow": "Comprar ahora", "DE.Controllers.Main.textCloseTip": "\nPulse para cerrar el consejo", - "DE.Controllers.Main.textContactUs": "Contact sales", + "DE.Controllers.Main.textContactUs": "Ponga en contacto con nosotros", "DE.Controllers.Main.textLoadingDocument": "Cargando documento", - "DE.Controllers.Main.textNoLicenseTitle": "ONLYOFFICE open source version", + "DE.Controllers.Main.textNoLicenseTitle": "Licencia ha expirado o no ha encontrado", "DE.Controllers.Main.textStrict": "Modo estricto", "DE.Controllers.Main.textTryUndoRedo": "Las funciones Anular/Rehacer se desactivan para el modo co-edición rápido.
Haga Clic en el botón \"modo estricto\" para cambiar al modo de co-edición estricta para editar el archivo sin la interferencia de otros usuarios y enviar sus cambios sólo después de guardarlos. Se puede cambiar entre los modos de co-edición usando los ajustes avanzados de edición.", "DE.Controllers.Main.titleUpdateVersion": "Versión ha cambiado", @@ -267,7 +267,7 @@ "DE.Controllers.Main.uploadImageTitleText": "Subiendo imagen", "DE.Controllers.Main.warnBrowserIE9": "Este aplicación tiene baja capacidad en IE9. Utilice IE10 o superior", "DE.Controllers.Main.warnBrowserZoom": "La configuración actual de zoom de su navegador no está soportada por completo. Por favor restablezca zoom predeterminado pulsando Ctrl+0.", - "DE.Controllers.Main.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.", + "DE.Controllers.Main.warnNoLicense": "La licencia ha expirado o no ha sido encontrada. No puede editar archivos.
Haga clic en el botón 'Comprar ahora' para comprar una licencia Enterprise Edition o ´Contactar con nosotros´ si usa Intergration Edition.", "DE.Controllers.Main.warnProcessRightsChange": "El derecho de edición del archivo es denegado", "DE.Controllers.Statusbar.textHasChanges": "Nuevos cambios han sido encontrado", "DE.Controllers.Statusbar.textTrackChanges": "El documento se abre con el modo de cambio de pista activado", @@ -909,7 +909,7 @@ "DE.Views.FileMenuPanels.Settings.textMinute": "Cada minuto", "DE.Views.FileMenuPanels.Settings.txtAll": "Ver todo", "DE.Views.FileMenuPanels.Settings.txtCm": "Centímetro", - "DE.Views.FileMenuPanels.Settings.txtInch": "Inch", + "DE.Views.FileMenuPanels.Settings.txtInch": "Pulgada", "DE.Views.FileMenuPanels.Settings.txtInput": "Entrada alternativa", "DE.Views.FileMenuPanels.Settings.txtLast": "Ver últimos", "DE.Views.FileMenuPanels.Settings.txtLiveComment": "Demostración de Comentarios", @@ -961,10 +961,10 @@ "DE.Views.ImageSettingsAdvanced.cancelButtonText": "Cancelar", "DE.Views.ImageSettingsAdvanced.okButtonText": "Aceptar", "DE.Views.ImageSettingsAdvanced.strMargins": "Márgenes interiores", - "DE.Views.ImageSettingsAdvanced.textAbsoluteWH": "Absolute", + "DE.Views.ImageSettingsAdvanced.textAbsoluteWH": "Absoluto", "DE.Views.ImageSettingsAdvanced.textAlignment": "Alineación", "DE.Views.ImageSettingsAdvanced.textArrows": "Flechas", - "DE.Views.ImageSettingsAdvanced.textAspectRatio": "Lock aspect ratio", + "DE.Views.ImageSettingsAdvanced.textAspectRatio": "Bloquear relación de aspecto", "DE.Views.ImageSettingsAdvanced.textBeginSize": "Tamaño inicial", "DE.Views.ImageSettingsAdvanced.textBeginStyle": "Estilo inicial", "DE.Views.ImageSettingsAdvanced.textBelow": "abajo", @@ -999,7 +999,7 @@ "DE.Views.ImageSettingsAdvanced.textPosition": "Posición", "DE.Views.ImageSettingsAdvanced.textPositionPc": "Posición Relativa", "DE.Views.ImageSettingsAdvanced.textRelative": "en relación a\n", - "DE.Views.ImageSettingsAdvanced.textRelativeWH": "Relative", + "DE.Views.ImageSettingsAdvanced.textRelativeWH": "Relativo", "DE.Views.ImageSettingsAdvanced.textRight": "Derecho", "DE.Views.ImageSettingsAdvanced.textRightMargin": "Margen derecho", "DE.Views.ImageSettingsAdvanced.textRightOf": "a la derecha de", @@ -1307,7 +1307,7 @@ "DE.Views.TableSettingsAdvanced.okButtonText": "Aceptar", "DE.Views.TableSettingsAdvanced.textAlign": "Alineación", "DE.Views.TableSettingsAdvanced.textAlignment": "Alineación", - "DE.Views.TableSettingsAdvanced.textAllowSpacing": "Permitir espacio entre celdas", + "DE.Views.TableSettingsAdvanced.textAllowSpacing": "Espacio entre celdas", "DE.Views.TableSettingsAdvanced.textAnchorText": "Texto", "DE.Views.TableSettingsAdvanced.textAutofit": "Cambiar tamaño automáticamente para ajustar a contenido", "DE.Views.TableSettingsAdvanced.textBackColor": "Fondo de celda", @@ -1317,13 +1317,13 @@ "DE.Views.TableSettingsAdvanced.textBordersBackgroung": "Bordes y fondo", "DE.Views.TableSettingsAdvanced.textBorderWidth": "Tamaño de borde", "DE.Views.TableSettingsAdvanced.textBottom": "Inferior", - "DE.Views.TableSettingsAdvanced.textCellOptions": "Cell Options", - "DE.Views.TableSettingsAdvanced.textCellProps": "Propiedades de la celda", - "DE.Views.TableSettingsAdvanced.textCellSize": "Cell Size", + "DE.Views.TableSettingsAdvanced.textCellOptions": "Opciones de celda", + "DE.Views.TableSettingsAdvanced.textCellProps": "Celda", + "DE.Views.TableSettingsAdvanced.textCellSize": "Tamaño de Celda", "DE.Views.TableSettingsAdvanced.textCenter": "Al centro", "DE.Views.TableSettingsAdvanced.textCenterTooltip": "Al centro", "DE.Views.TableSettingsAdvanced.textCheckMargins": "Usar márgenes predeterminados", - "DE.Views.TableSettingsAdvanced.textDefaultMargins": "Márgenes predeterminados", + "DE.Views.TableSettingsAdvanced.textDefaultMargins": "Márgenes de celda predeterminados", "DE.Views.TableSettingsAdvanced.textDistance": "Distancia del texto", "DE.Views.TableSettingsAdvanced.textHorizontal": "Horizontal ", "DE.Views.TableSettingsAdvanced.textIndLeft": "Sangría a la izquierda", @@ -1331,7 +1331,7 @@ "DE.Views.TableSettingsAdvanced.textLeftTooltip": "Izquierdo", "DE.Views.TableSettingsAdvanced.textMargin": "Margen", "DE.Views.TableSettingsAdvanced.textMargins": "Márgenes de celda", - "DE.Views.TableSettingsAdvanced.textMeasure": "Measure in", + "DE.Views.TableSettingsAdvanced.textMeasure": "medir en", "DE.Views.TableSettingsAdvanced.textMove": "Desplazar objeto con texto", "DE.Views.TableSettingsAdvanced.textNewColor": "Añadir Color Personalizado Nuevo", "DE.Views.TableSettingsAdvanced.textOnlyCells": "Sólo para celdas seleccionadas", @@ -1339,17 +1339,17 @@ "DE.Views.TableSettingsAdvanced.textOverlap": "Superposición", "DE.Views.TableSettingsAdvanced.textPage": "Página", "DE.Views.TableSettingsAdvanced.textPosition": "Posición", - "DE.Views.TableSettingsAdvanced.textPrefWidth": "Preferred width", + "DE.Views.TableSettingsAdvanced.textPrefWidth": "Anchura Preferida", "DE.Views.TableSettingsAdvanced.textPreview": "Vista previa", "DE.Views.TableSettingsAdvanced.textRelative": "en relación a\n", "DE.Views.TableSettingsAdvanced.textRight": "Derecho", "DE.Views.TableSettingsAdvanced.textRightOf": "a la derecha de", "DE.Views.TableSettingsAdvanced.textRightTooltip": "Derecho", "DE.Views.TableSettingsAdvanced.textStandartColors": "Colores estándar", - "DE.Views.TableSettingsAdvanced.textTable": "Table", + "DE.Views.TableSettingsAdvanced.textTable": "Tabla", "DE.Views.TableSettingsAdvanced.textTableBackColor": "Fondo de tabla", - "DE.Views.TableSettingsAdvanced.textTablePosition": "Table Position", - "DE.Views.TableSettingsAdvanced.textTableSize": "Table Size", + "DE.Views.TableSettingsAdvanced.textTablePosition": "Posición de la tabla", + "DE.Views.TableSettingsAdvanced.textTableSize": "Tamaño de tabla", "DE.Views.TableSettingsAdvanced.textThemeColors": "Colores de tema", "DE.Views.TableSettingsAdvanced.textTitle": "Tabla - Ajustes avanzados", "DE.Views.TableSettingsAdvanced.textTop": "Superior", @@ -1359,8 +1359,8 @@ "DE.Views.TableSettingsAdvanced.textWrap": "Ajuste de texto", "DE.Views.TableSettingsAdvanced.textWrapNoneTooltip": "Tabla en línea", "DE.Views.TableSettingsAdvanced.textWrapParallelTooltip": "Tabla flujo", - "DE.Views.TableSettingsAdvanced.textWrappingStyle": "Wrapping Style", - "DE.Views.TableSettingsAdvanced.textWrapText": "Wrap text", + "DE.Views.TableSettingsAdvanced.textWrappingStyle": "Ajuste de texto", + "DE.Views.TableSettingsAdvanced.textWrapText": "Ajustar texto", "DE.Views.TableSettingsAdvanced.tipAll": "Fijar borde exterior y todas líneas interiores ", "DE.Views.TableSettingsAdvanced.tipCellAll": "Fijar bordes sólo para celdas interiores", "DE.Views.TableSettingsAdvanced.tipCellInner": "Fijar líneas verticales y horizontales sólo para celdas interiores", @@ -1372,7 +1372,7 @@ "DE.Views.TableSettingsAdvanced.tipTableOuterCellInner": "Fijar borde exterior y líneas verticales y horizontales para celdas inferiores", "DE.Views.TableSettingsAdvanced.tipTableOuterCellOuter": "Fijar borde de tabla exterior y bordes exteriores para celdas interiores", "DE.Views.TableSettingsAdvanced.txtCm": "Centímetro", - "DE.Views.TableSettingsAdvanced.txtInch": "Inch", + "DE.Views.TableSettingsAdvanced.txtInch": "Pulgada", "DE.Views.TableSettingsAdvanced.txtNoBorders": "Sin bordes", "DE.Views.TableSettingsAdvanced.txtPercent": "Por ciento", "DE.Views.TableSettingsAdvanced.txtPt": "Punto", diff --git a/apps/documenteditor/main/resources/img/toolbar-menu.png b/apps/documenteditor/main/resources/img/toolbar-menu.png index 9c0be2658..ddd5f5c0f 100644 Binary files a/apps/documenteditor/main/resources/img/toolbar-menu.png and b/apps/documenteditor/main/resources/img/toolbar-menu.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar-menu@2x.png b/apps/documenteditor/main/resources/img/toolbar-menu@2x.png index acfef39b8..fe4f7a030 100644 Binary files a/apps/documenteditor/main/resources/img/toolbar-menu@2x.png and b/apps/documenteditor/main/resources/img/toolbar-menu@2x.png differ diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 15c927455..e5d1f2100 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -155,11 +155,11 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ if ( this.mode.canCoAuthoring ) { - this.leftMenu.btnComments[this.mode.isEdit&&this.mode.canComments ? 'show' : 'hide'](); + this.leftMenu.btnComments[(this.mode.isEdit&&this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); if (this.mode.canComments) this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments')); - this.leftMenu.btnChat[this.mode.canChat ? 'show' : 'hide'](); + this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide'](); if (this.mode.canChat) this.leftMenu.setOptionsPanel('chat', this.getApplication().getController('Common.Controllers.Chat').getView('Common.Views.Chat')); } else { @@ -454,13 +454,13 @@ define([ break; /** coauthoring begin **/ case 'chat': - if (this.mode.canCoAuthoring && this.mode.canChat && (!previewPanel || !previewPanel.isVisible())){ + if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible())){ Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('chat'); } return false; case 'comments': - if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) { + if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 61fe5e98e..38e3ca3fb 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -707,11 +707,12 @@ define([ }, onEditorPermissions: function(params) { - /** coauthoring begin **/ - this.appOptions.canCoAuthoring = true; - /** coauthoring end **/ this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false; + this.appOptions.isLightVersion = params.asc_getIsLight(); + /** coauthoring begin **/ + this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion; + /** coauthoring end **/ this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canEdit = this.permissions.edit !== false && // can edit (this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined diff --git a/apps/presentationeditor/main/app/template/ImageSettings.template b/apps/presentationeditor/main/app/template/ImageSettings.template index 3dc5ee719..709adceca 100644 --- a/apps/presentationeditor/main/app/template/ImageSettings.template +++ b/apps/presentationeditor/main/app/template/ImageSettings.template @@ -24,17 +24,22 @@
- +
+ +
+ +
diff --git a/apps/presentationeditor/main/app/template/RightMenu.template b/apps/presentationeditor/main/app/template/RightMenu.template index d8119b24b..6a34f6b22 100644 --- a/apps/presentationeditor/main/app/template/RightMenu.template +++ b/apps/presentationeditor/main/app/template/RightMenu.template @@ -14,8 +14,6 @@
-
-
diff --git a/apps/presentationeditor/main/app/template/SlideSettings.template b/apps/presentationeditor/main/app/template/SlideSettings.template index 776e9a705..2c4133d77 100644 --- a/apps/presentationeditor/main/app/template/SlideSettings.template +++ b/apps/presentationeditor/main/app/template/SlideSettings.template @@ -11,7 +11,7 @@
-
+
diff --git a/apps/presentationeditor/main/app/view/ImageSettings.js b/apps/presentationeditor/main/app/view/ImageSettings.js index f0eec7850..27e8356a9 100644 --- a/apps/presentationeditor/main/app/view/ImageSettings.js +++ b/apps/presentationeditor/main/app/view/ImageSettings.js @@ -70,7 +70,8 @@ define([ this._state = { Width: 0, Height: 0, - DisabledControls: false + DisabledControls: false, + isOleObject: false }; this.lockedControls = []; this._locked = false; @@ -98,12 +99,21 @@ define([ }); this.lockedControls.push(this.btnInsertFromUrl); + this.btnEditObject = new Common.UI.Button({ + el: $('#image-button-edit-object') + }); + this.lockedControls.push(this.btnEditObject); + this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnInsertFromFile.on('click', _.bind(function(btn){ if (this.api) this.api.ChangeImageFromFile(); this.fireEvent('editcomplete', this); }, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); + this.btnEditObject.on('click', _.bind(function(btn){ +// if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData()); +// this.fireEvent('editcomplete', this); + }, this)); $(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this)); }, @@ -114,6 +124,7 @@ define([ })); this.linkAdvanced = $('#image-advanced-link'); + this.lblReplace = $('#image-lbl-replace'); }, setApi: function(api) { @@ -157,6 +168,25 @@ define([ } this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked); + + var pluginGuid = props.asc_getPluginGuid(); + value = (pluginGuid !== null && pluginGuid !== undefined); + if (this._state.isOleObject!==value) { + this.btnInsertFromUrl.setVisible(!value); + this.btnInsertFromFile.setVisible(!value); + this.btnEditObject.setVisible(value); + this.lblReplace.text(value ? this.textEditObject : this.textInsert); + this._state.isOleObject=value; + } + + if (this._state.isOleObject) { +// var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid}); +// this.btnEditObject.setDisabled(plugin===null || plugin ===undefined); + this.btnEditObject.setDisabled(true); + } else { + this.btnInsertFromUrl.setDisabled(pluginGuid===null); + this.btnInsertFromFile.setDisabled(pluginGuid===null); + } } }, @@ -253,10 +283,12 @@ define([ textWidth: 'Width', textHeight: 'Height', textOriginalSize: 'Default Size', - textInsert: 'Insert Image', + textInsert: 'Replace Image', textFromUrl: 'From URL', textFromFile: 'From File', - textAdvanced: 'Show advanced settings' + textAdvanced: 'Show advanced settings', + textEditObject: 'Edit Object', + textEdit: 'Edit' }, PE.Views.ImageSettings || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index 568d554f1..56e5fb2e3 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -340,6 +340,7 @@ define([ setMode: function(mode) { this.mode = mode; + this.btnAbout.panel.setMode(mode); return this; }, diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index eefa15406..5f78ff9c7 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -181,8 +181,8 @@ define([ } if (open) { - $('#id-empty-settings').parent().css("display", "inline-block" ); - $('#id-empty-settings').addClass("active"); + $('#id-slide-settings').parent().css("display", "inline-block" ); + $('#id-slide-settings').addClass("active"); } this.trigger('render:after', this); diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js index 8043180cf..b2629b0e2 100644 --- a/apps/presentationeditor/main/app/view/SlideSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSettings.js @@ -78,13 +78,13 @@ define([ this.FillItems = []; this._stateDisabled = { - background: false, - effects: false, - timing: false + background: true, + effects: true, + timing: true }; this._state = { - FillType: Asc.c_oAscFill.FILL_TYPE_SOLID, + FillType:undefined, SlideColor: 'ffffff', BlipFillType: Asc.c_oAscFillBlipType.STRETCH, FGColor: '000000', @@ -93,7 +93,7 @@ define([ GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR }; - this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_SOLID; + this.OriginalFillType = undefined; this.SlideColor = {Value: 1, Color: 'ffffff'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.BlipFillType = Asc.c_oAscFillBlipType.STRETCH; this.Effect = Asc.c_oAscSlideTransitionTypes.None; @@ -125,13 +125,15 @@ define([ style: 'width: 100%;', menuStyle: 'min-width: 190px;', editable: false, - data: this._arrFillSrc + data: this._arrFillSrc, + disabled: true }); - this.cmbFillSrc.setValue(this._arrFillSrc[0].value); + this.cmbFillSrc.setValue(''); this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this)); this.btnBackColor = new Common.UI.ColorButton({ style: "width:45px;", + disabled: true, menu : new Common.UI.Menu({ items: [ { template: _.template('
') }, @@ -462,9 +464,10 @@ define([ style: 'width: 100%;', menuStyle: 'min-width: 190px;', editable: false, - data: this._arrEffectName + data: this._arrEffectName, + disabled: true }); - this.cmbEffectName.setValue(this._arrEffectName[0].value); + this.cmbEffectName.setValue(''); this.cmbEffectName.on('selected', _.bind(this.onEffectNameSelect, this)); this._arrEffectType = [ @@ -496,7 +499,8 @@ define([ style: 'width: 100%;', menuStyle: 'min-width: 190px;', editable: false, - data: this._arrEffectType + data: this._arrEffectType, + disabled: true }); this.cmbEffectType.setValue(''); this.cmbEffectType.on('selected', _.bind(this.onEffectTypeSelect, this)); @@ -505,10 +509,11 @@ define([ el: $('#slide-spin-duration'), step: 1, width: 65, - value: '2 s', + value: '', defaultUnit : this.textSec, maxValue: 300, - minValue: 0 + minValue: 0, + disabled: true }); this.numDuration.on('change', _.bind(this.onDurationChange, this)); @@ -516,7 +521,7 @@ define([ el: $('#slide-spin-delay'), step: 1, width: 70, - value: '2 s', + value: '', defaultUnit : this.textSec, maxValue: 300, minValue: 0, @@ -526,18 +531,21 @@ define([ this.chStartOnClick = new Common.UI.CheckBox({ el: $('#slide-checkbox-start-click'), - labelText: this.strStartOnClick + labelText: this.strStartOnClick, + disabled: true }); this.chStartOnClick.on('change', _.bind(this.onStartOnClickChange, this)); this.chDelay = new Common.UI.CheckBox({ el: $('#slide-checkbox-delay'), - labelText: this.strDelay + labelText: this.strDelay, + disabled: true }); this.chDelay.on('change', _.bind(this.onCheckDelayChange, this)); this.btnPreview = new Common.UI.Button({ - el: $('#slide-button-preview') + el: $('#slide-button-preview'), + disabled: true }); this.btnPreview.on('click', _.bind(function(btn){ if (this.api) this.api.SlideTransitionPlay(); @@ -545,7 +553,8 @@ define([ }, this)); this.btnApplyToAll = new Common.UI.Button({ - el: $('#slide-button-apply-all') + el: $('#slide-button-apply-all'), + disabled: true }); this.btnApplyToAll.on('click', _.bind(function(btn){ if (this.api) this.api.SlideTimingApplyToAll(); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index dc60f9e9e..82f71dc91 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -213,7 +213,9 @@ define([ }); me.slideOnlyControls.push(me.btnChangeSlide); me.listenTo(PE.getCollection('SlideLayouts'), 'reset', function() { - me.mnuChangeSlidePicker._needRecalcSlideLayout = me.mnuAddSlidePicker._needRecalcSlideLayout = true; + me.mnuAddSlidePicker._needRecalcSlideLayout = true; + if (me.mnuChangeSlidePicker) + me.mnuChangeSlidePicker._needRecalcSlideLayout = true; }); me.btnPreview = new Common.UI.Button({ @@ -1145,7 +1147,7 @@ define([ }); }, - render: function () { + render: function (mode) { var me = this, el = $(this.el); @@ -1156,7 +1158,7 @@ define([ this.trigger('render:before', this); var value = Common.localStorage.getItem('pe-compact-toolbar'); - var valueCompact = (value!==null && parseInt(value) == 1); + var valueCompact = (mode.isLightVersion || value!==null && parseInt(value) == 1); value = Common.localStorage.getItem('pe-hidden-title'); var valueTitle = (value!==null && parseInt(value) == 1); @@ -1167,6 +1169,7 @@ define([ value = Common.localStorage.getItem("pe-hidden-rulers"); var valueRulers = (value !== null && parseInt(value) == 1); + me.mnuitemCompactToolbar.setVisible(!mode.isLightVersion); me.mnuitemCompactToolbar.setChecked(valueCompact); me.mnuitemHideTitleBar.setChecked(valueTitle); me.mnuitemHideStatusBar.setChecked(valueStatus); diff --git a/apps/presentationeditor/main/app/view/Viewport.js b/apps/presentationeditor/main/app/view/Viewport.js index 155e81817..03ef2a490 100644 --- a/apps/presentationeditor/main/app/view/Viewport.js +++ b/apps/presentationeditor/main/app/view/Viewport.js @@ -131,7 +131,7 @@ define([ rightMenuView = PE.getController('RightMenu').getView('RightMenu'), statusBarView = PE.getController('Statusbar').getView('Statusbar'); - me._toolbar = toolbarView.render(); + me._toolbar = toolbarView.render(this.mode); me._rightMenu = rightMenuView.render(); var value = Common.localStorage.getItem('pe-hidden-status'); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 55f5d10f3..a8677ff2e 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -397,6 +397,8 @@ "PE.Views.HyperlinkSettingsDialog.txtPrev": "Previous Slide", "PE.Views.HyperlinkSettingsDialog.txtSlide": "Slide", "PE.Views.ImageSettings.textAdvanced": "Show advanced settings", + "PE.Views.ImageSettings.textEdit": "Edit", + "PE.Views.ImageSettings.textEditObject": "Edit Object", "PE.Views.ImageSettings.textFromFile": "From File", "PE.Views.ImageSettings.textFromUrl": "From URL", "PE.Views.ImageSettings.textHeight": "Height", diff --git a/apps/presentationeditor/main/locale/es.json b/apps/presentationeditor/main/locale/es.json index ee736cc9b..df287d909 100644 --- a/apps/presentationeditor/main/locale/es.json +++ b/apps/presentationeditor/main/locale/es.json @@ -146,11 +146,11 @@ "PE.Controllers.Main.splitMaxColsErrorText": "El número de columnas debe ser menos que %1.", "PE.Controllers.Main.splitMaxRowsErrorText": "El número de filas debe ser menos que %1.", "PE.Controllers.Main.textAnonymous": "Anónimo", - "PE.Controllers.Main.textBuyNow": "Visit website", - "PE.Controllers.Main.textCloseTip": "\nPulse para cerrar el consejo", - "PE.Controllers.Main.textContactUs": "Contact sales", + "PE.Controllers.Main.textBuyNow": "Comprar ahora", + "PE.Controllers.Main.textCloseTip": "Pulse para cerrar el consejo", + "PE.Controllers.Main.textContactUs": "Ponga en contacto con nosotros", "PE.Controllers.Main.textLoadingDocument": "Cargando presentación", - "PE.Controllers.Main.textNoLicenseTitle": "ONLYOFFICE open source version", + "PE.Controllers.Main.textNoLicenseTitle": "Licencia ha expirado o no ha encontrado", "PE.Controllers.Main.textShape": "Forma", "PE.Controllers.Main.textStrict": "Modo estricto", "PE.Controllers.Main.textTryUndoRedo": "Las funciones Anular/Rehacer se desactivan para el modo co-edición rápido.
Haga Clic en el botón \"modo estricto\" para cambiar al modo de co-edición estricta para editar el archivo sin la interferencia de otros usuarios y enviar sus cambios sólo después de guardarlos. Se puede cambiar entre los modos de co-edición usando los ajustes avanzados de edición.", @@ -215,7 +215,7 @@ "PE.Controllers.Main.uploadImageTitleText": "Subiendo imagen", "PE.Controllers.Main.warnBrowserIE9": "Este aplicación tiene baja capacidad en IE9. Utilice IE10 o superior", "PE.Controllers.Main.warnBrowserZoom": "La configuración actual de zoom de su navegador no está soportada por completo. Por favor restablezca zoom predeterminado pulsando Ctrl+0.", - "PE.Controllers.Main.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.", + "PE.Controllers.Main.warnNoLicense": "La licencia ha expirado o no ha sido encontrada. No puede editar archivos.
Haga clic en el botón 'Comprar ahora' para comprar una licencia Enterprise Edition o ´Contactar con nosotros´ si usa Intergration Edition.", "PE.Controllers.Main.warnProcessRightsChange": "El derecho de edición del archivo es denegado.", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Toolbar.confirmAddFontName": "El tipo de letra que usted va a guardar no está disponible en este dispositivo.
El estilo de letra se mostrará usando uno de los tipos de letra del dispositivo, el tipo de letra guardado va a usarse cuando esté disponible.
¿Desea continuar?", diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index c0a989b12..b1640b119 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -157,7 +157,8 @@ require([ 'Main', 'Common.Controllers.Fonts', 'Common.Controllers.Chat', - 'Common.Controllers.Comments' + 'Common.Controllers.Comments', + 'Common.Controllers.Plugins' ] }); @@ -182,7 +183,8 @@ require([ 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/Comments', - 'common/main/lib/controller/Chat' + 'common/main/lib/controller/Chat', + 'common/main/lib/controller/Plugins' ], function() { app.start(); }); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 9aac71131..684c62ed1 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -163,11 +163,11 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ if ( this.mode.canCoAuthoring ) { - this.leftMenu.btnComments[this.mode.isEdit&&this.mode.canComments ? 'show' : 'hide'](); + this.leftMenu.btnComments[(this.mode.isEdit&&this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); if (this.mode.canComments) this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments')); - this.leftMenu.btnChat[this.mode.canChat ? 'show' : 'hide'](); + this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide'](); if (this.mode.canChat) this.leftMenu.setOptionsPanel('chat', this.getApplication().getController('Common.Controllers.Chat').getView('Common.Views.Chat')); } else { @@ -181,6 +181,14 @@ define([ return this; }, + enablePlugins: function() { + if (this.mode.canPlugins) { + this.leftMenu.btnPlugins.show(); + this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins')); + } else + this.leftMenu.btnPlugins.hide(); + }, + clickMenuFileItem: function(menu, action, isopts) { var close_menu = true; switch (action) { @@ -496,6 +504,7 @@ define([ this.leftMenu.btnComments.setDisabled(true); this.leftMenu.btnChat.setDisabled(true); /** coauthoring end **/ + this.leftMenu.btnPlugins.setDisabled(true); this.leftMenu.getMenu('file').setMode({isDisconnected: true}); if ( this.dlgSearch ) { @@ -605,8 +614,15 @@ define([ $.fn.dropdown.Constructor.prototype.keydown.call(menu_opened[0], e); return false; } + if (this.mode.canPlugins && this.leftMenu.panelPlugins && this.api.isCellEdited!==true) { + menu_opened = this.leftMenu.panelPlugins.$el.find('#menu-plugin-container.open > [data-toggle="dropdown"]'); + if (menu_opened.length) { + $.fn.dropdown.Constructor.prototype.keydown.call(menu_opened[0], e); + return false; + } + } if (this.leftMenu.btnFile.pressed || this.leftMenu.btnAbout.pressed || - $(e.target).parents('#left-menu').length && this.api.isCellEdited!==true) { + ($(e.target).parents('#left-menu').length || this.leftMenu.btnPlugins.pressed) && this.api.isCellEdited!==true) { this.leftMenu.close(); Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); return false; @@ -621,13 +637,13 @@ define([ break; /** coauthoring begin **/ case 'chat': - if (this.mode.canCoAuthoring && this.mode.canChat) { + if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('chat'); } return false; case 'comments': - if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments) { + if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && !this.mode.isLightVersion) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); @@ -643,6 +659,10 @@ define([ this.leftMenu.btnFile.setDisabled(isRangeSelection); this.leftMenu.btnAbout.setDisabled(isRangeSelection); this.leftMenu.btnSearch.setDisabled(isRangeSelection); + if (this.mode.canPlugins && this.leftMenu.panelPlugins) { + this.leftMenu.panelPlugins.setLocked(isRangeSelection); + this.leftMenu.panelPlugins.disableControls(isRangeSelection); + } }, onApiEditCell: function(state) { @@ -652,6 +672,10 @@ define([ this.leftMenu.btnFile.setDisabled(isEditFormula); this.leftMenu.btnAbout.setDisabled(isEditFormula); this.leftMenu.btnSearch.setDisabled(isEditFormula); + if (this.mode.canPlugins && this.leftMenu.panelPlugins) { + this.leftMenu.panelPlugins.setLocked(isEditFormula); + this.leftMenu.panelPlugins.disableControls(isEditFormula); + } }, textNoTextFound : 'Text not found', diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 70dd71153..e77850c53 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -136,6 +136,7 @@ define([ // Initialize api gateway this.editorConfig = {}; + this.plugins = undefined; Common.Gateway.on('init', _.bind(this.loadConfig, this)); Common.Gateway.on('showmessage', _.bind(this.onExternalMessage, this)); Common.Gateway.on('opendocument', _.bind(this.loadDocument, this)); @@ -250,6 +251,8 @@ define([ this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url); this.appOptions.canBack = this.editorConfig.nativeApp !== true && this.appOptions.canBackToFolder === true; + this.appOptions.canPlugins = false; + this.plugins = this.editorConfig.plugins; this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header'); this.headerView.setCanBack(this.appOptions.canBackToFolder === true); @@ -584,10 +587,18 @@ define([ statusbarView = statusbarController.getView('Statusbar'), leftMenuView = leftmenuController.getView('LeftMenu'), documentHolderView = documentHolderController.getView('DocumentHolder'), - chatController = application.getController('Common.Controllers.Chat'); + chatController = application.getController('Common.Controllers.Chat'), + pluginsController = application.getController('Common.Controllers.Plugins'); leftMenuView.getMenu('file').loadDocument({doc:me.appOptions.spreadsheet}); leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api); + + if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) { + pluginsController.setApi(me.api); + me.updatePluginsList(me.plugins); + me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me)); + } + leftMenuView.disableMenu('all',false); if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && me.appOptions.canBranding) { @@ -722,11 +733,12 @@ define([ this.appOptions.canAutosave = true; this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); - /** coauthoring begin **/ - this.appOptions.canCoAuthoring = true; - /** coauthoring end **/ this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false; + this.appOptions.isLightVersion = params.asc_getIsLight(); + /** coauthoring begin **/ + this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion; + /** coauthoring end **/ this.appOptions.canComments = this.appOptions.canLicense && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); @@ -1684,6 +1696,61 @@ define([ if (url) this.iframePrint.src = url; }, + updatePluginsList: function(plugins) { + var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'), + isEdit = this.appOptions.isEdit; + if (pluginStore && plugins) { + var arr = []; + plugins.pluginsData.forEach(function(item){ + var variations = item.variations, + variationsArr = []; + variations.forEach(function(itemVar){ + var isSupported = false; + for (var i=0; i0) + arr.push(new Common.Models.Plugin({ + name : item.name, + guid: item.guid, + baseUrl : item.baseUrl, + variations: variationsArr, + currentVariation: 0 + })); + }); + + pluginStore.reset(arr); + + this.appOptions.pluginsPath = (plugins.url); + this.appOptions.canPlugins = (arr.length>0); + } else { + this.appOptions.pluginsPath = ''; + this.appOptions.canPlugins = false; + } + if (this.appOptions.canPlugins) + this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + this.getApplication().getController('LeftMenu').enablePlugins(); + }, + leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.', criticalErrorTitle: 'Error', notcriticalErrorTitle: 'Warning', diff --git a/apps/spreadsheeteditor/main/app/template/ImageSettings.template b/apps/spreadsheeteditor/main/app/template/ImageSettings.template index 13600d94d..42b438df1 100644 --- a/apps/spreadsheeteditor/main/app/template/ImageSettings.template +++ b/apps/spreadsheeteditor/main/app/template/ImageSettings.template @@ -31,7 +31,7 @@
- +
+ +
\ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/template/LeftMenu.template b/apps/spreadsheeteditor/main/app/template/LeftMenu.template index 039703e46..72e966931 100644 --- a/apps/spreadsheeteditor/main/app/template/LeftMenu.template +++ b/apps/spreadsheeteditor/main/app/template/LeftMenu.template @@ -6,6 +6,7 @@ + @@ -14,5 +15,6 @@