',
'<% _.each(groups, function(group) { %>',
- '
',
- '
',
- '<%= group.caption %>',
- '
',
+ '<% if (group.headername !== undefined) { %>',
+ '',
+ '<% } %>',
+ '
',
+ '<% if (!_.isEmpty(group.caption)) { %>',
+ '
',
+ '<%= group.caption %>',
+ '
',
+ '<% } %>',
'
',
'
',
'
',
@@ -696,39 +703,29 @@ define([
fillIndexesArray: function() {
if (this.dataViewItems.length<=0) return;
- var top, left,
- el = $(this.dataViewItems[0].el),
- itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
- itemH = el.outerHeight() + parseInt(el.css('margin-top')) + parseInt(el.css('margin-bottom')),
- offsetLeft = this.$el.offset().left,
- offsetTop = this.$el.offset().top,
- idxOffset = 0;
-
this._layoutParams = {
itemsIndexes: [],
columns: 0,
rows: 0
};
- if (this.groups && this.groups.length > 0) {
- var group_desc = this.cmpEl.find('.group-description:first');
- if (group_desc.length>0)
- offsetLeft += group_desc.width();
- }
+ var el = $(this.dataViewItems[0].el),
+ itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
+ offsetLeft = this.$el.offset().left,
+ prevtop = -1, topIdx = 0, leftIdx = 0;
+
for (var i=0; i
this._layoutParams.itemsIndexes.length-1) {
+ var top = $(this.dataViewItems[i].el).offset().top;
+ leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
+ if (top>prevtop) {
+ prevtop = top;
this._layoutParams.itemsIndexes.push([]);
+ topIdx = this._layoutParams.itemsIndexes.length-1;
}
- this._layoutParams.itemsIndexes[top][left] = i;
- this.dataViewItems[i].topIdx = top;
- this.dataViewItems[i].leftIdx = left;
- if (this._layoutParams.columns div {
+ &.inline {
display: inline-block;
+ &.margin .group-items-container {
+ margin-right: 20px;
+ }
}
.group-items-container {
overflow: hidden;
+ margin-bottom: 5px;
& > div {
display: inline-block;
float: left;
- margin: 4px;
+ margin: 2px 4px 4px;
cursor: pointer;
.box-shadow(0 0 0 1px @gray);
@@ -53,4 +57,10 @@
}
}
}
+
+ .header-name {
+ padding: 10px 2px 12px 4px;
+ font-weight: bold;
+ cursor: default;
+ }
}
\ No newline at end of file
diff --git a/apps/common/main/resources/less/review-changes.less b/apps/common/main/resources/less/review-changes.less
index 68c96b186..f4f5da96c 100644
--- a/apps/common/main/resources/less/review-changes.less
+++ b/apps/common/main/resources/less/review-changes.less
@@ -5,7 +5,7 @@
background: @gray-light;
border: 1px solid @gray-dark;
height: 35px;
- z-index: 1000;
+ z-index: @zindex-dropdown - 1;
.review-group {
display: inline-block;
diff --git a/apps/common/main/resources/less/tooltip.less b/apps/common/main/resources/less/tooltip.less
index d2ae02886..728459182 100644
--- a/apps/common/main/resources/less/tooltip.less
+++ b/apps/common/main/resources/less/tooltip.less
@@ -50,3 +50,7 @@
word-wrap: break-word;
max-width: 300px;
}
+
+.link-tooltip .tooltip-inner {
+ max-width: 500px;
+}
\ No newline at end of file
diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js
index 40df85e8a..6160cf190 100644
--- a/apps/documenteditor/main/app.js
+++ b/apps/documenteditor/main/app.js
@@ -178,6 +178,7 @@ require([
'documenteditor/main/app/controller/RightMenu',
'documenteditor/main/app/controller/LeftMenu',
'documenteditor/main/app/controller/Main',
+ 'documenteditor/main/app/view/FileMenuPanels',
'documenteditor/main/app/view/ParagraphSettings',
'documenteditor/main/app/view/HeaderFooterSettings',
'documenteditor/main/app/view/ImageSettings',
diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js
index 30626e67f..93b10ee92 100644
--- a/apps/documenteditor/main/app/controller/LeftMenu.js
+++ b/apps/documenteditor/main/app/controller/LeftMenu.js
@@ -283,7 +283,7 @@ define([
this.api.SetTextBoxInputMode(parseInt(value) == 1);
/** coauthoring begin **/
- if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
+ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1);
this.api.asc_SetFastCollaborative(fast_coauth);
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 6fd781d8d..54b76d7a9 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -148,6 +148,7 @@ define([
this.editorConfig = {};
this.appOptions = {};
this.plugins = undefined;
+ this.UICustomizePlugins = [];
Common.Gateway.on('init', _.bind(this.loadConfig, this));
Common.Gateway.on('showmessage', _.bind(this.onExternalMessage, this));
Common.Gateway.on('opendocument', _.bind(this.loadDocument, this));
@@ -822,7 +823,7 @@ define([
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
/** coauthoring begin **/
- if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
+ if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode");
if (value===null && Common.localStorage.getItem("de-settings-autosave")===null &&
me.appOptions.customization && me.appOptions.customization.autosave===false) {
@@ -861,7 +862,7 @@ define([
application.getController('Common.Controllers.ExternalMergeEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
pluginsController.setApi(me.api);
- me.updatePlugins(me.plugins);
+ me.updatePlugins(me.plugins, false);
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
documentHolderController.setApi(me.api);
@@ -906,9 +907,14 @@ define([
toolbarController.onApiCoAuthoringDisconnect();
me.api.UpdateInterfaceState();
me.fillTextArt(me.api.asc_getTextArtPreviews());
+
+ if (me.appOptions.canBrandingExt)
+ Common.NotificationCenter.trigger('document:ready', 'main');
}
}, 50);
- }
+ } else if (me.appOptions.canBrandingExt)
+ Common.NotificationCenter.trigger('document:ready', 'main');
+
if (this.appOptions.canAnalytics && false)
Common.component.Analytics.initialize('UA-12442749-13', 'Document Editor');
@@ -975,7 +981,7 @@ define([
this.permissions.edit = this.permissions.review = false;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
- this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
+ this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
@@ -993,8 +999,8 @@ define([
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isDesktopApp;
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
- 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);
+ this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
+ this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = !!this.permissions.rename;
@@ -1007,14 +1013,16 @@ define([
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
var headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
- this.appOptions.canBranding = (licType!==Asc.c_oLicenseResult.Error) && (typeof this.editorConfig.customization == 'object');
+ this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
headerView.setBranding(this.editorConfig.customization);
params.asc_getTrial() && headerView.setDeveloperMode(true);
this.appOptions.canRename && headerView.setCanRename(true);
- this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
+ this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
+ if (this.appOptions.canBrandingExt)
+ this.updatePlugins(this.plugins, true);
this.applyModeCommonElements();
this.applyModeEditorElements();
@@ -1465,13 +1473,15 @@ define([
},
hidePreloader: function() {
- if (!!this.appOptions.customization && !this.appOptions.customization.done) {
- this.appOptions.customization.done = true;
- if (!this.appOptions.isDesktopApp)
+ if (!this._state.customizationDone) {
+ this._state.customizationDone = true;
+ if (this.appOptions.customization && !this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
- if (this.appOptions.canBrandingExt)
+ if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
+ Common.Utils.applyCustomizationPlugins(this.UICustomizePlugins);
+ }
}
Common.NotificationCenter.trigger('layout:changed', 'main');
@@ -1746,7 +1756,7 @@ define([
},
applySettings: function() {
- if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
+ if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var value = Common.localStorage.getItem("de-settings-coauthmode"),
oldval = this._state.fastCoauth;
this._state.fastCoauth = (value===null || parseInt(value) == 1);
@@ -1804,8 +1814,11 @@ define([
if (url) this.iframePrint.src = url;
},
- updatePlugins: function(plugins) { // plugins from config
- if (!plugins || !plugins.pluginsData || plugins.pluginsData.length<1) return;
+ updatePlugins: function(plugins, uiCustomize) { // plugins from config
+ if (!plugins) return;
+
+ var pluginsData = (uiCustomize) ? plugins.UIpluginsData : plugins.pluginsData;
+ if (!pluginsData || pluginsData.length<1) return;
var _createXMLHTTPObject = function() {
var xmlhttp;
@@ -1843,7 +1856,7 @@ define([
var arr = [],
baseUrl = plugins.url;
- plugins.pluginsData.forEach(function(item){
+ pluginsData.forEach(function(item){
var url = item;
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(item))
url = baseUrl + item;
@@ -1856,14 +1869,14 @@ define([
autoStartGuid: plugins.autoStartGuid,
url: plugins.url,
pluginsData: arr
- });
+ }, !!uiCustomize);
},
- updatePluginsList: function(plugins) {
+ updatePluginsList: function(plugins, uiCustomize) {
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = this.appOptions.isEdit;
- if (pluginStore && plugins) {
- var arr = [];
+ if (plugins) {
+ var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
var variations = item.variations,
variationsArr = [];
@@ -1874,7 +1887,9 @@ define([
isSupported = true; break;
}
}
- if (isSupported && (isEdit || itemVar.isViewer))
+ if (isSupported && (isEdit || itemVar.isViewer)) {
+ var isRelativeUrl = !(/(^https?:\/\/)/i.test(itemVar.url) || /(^www.)/i.test(itemVar.url));
+ item.isUICustomizer ? arrUI.push((isRelativeUrl) ? ((item.baseUrl ? item.baseUrl : plugins.url) + itemVar.url) : itemVar.url) :
variationsArr.push(new Common.Models.PluginVariation({
description: itemVar.description,
index: variationsArr.length,
@@ -1891,10 +1906,11 @@ define([
buttons: itemVar.buttons,
size: itemVar.size,
initOnSelectionChanged: itemVar.initOnSelectionChanged,
- isRelativeUrl: !(/(^https?:\/\/)/i.test(itemVar.url) || /(^www.)/i.test(itemVar.url))
+ isRelativeUrl: isRelativeUrl
}));
+ }
});
- if (variationsArr.length>0)
+ if (variationsArr.length>0 && !item.isUICustomizer)
arr.push(new Common.Models.Plugin({
name : item.name,
guid: item.guid,
@@ -1904,11 +1920,15 @@ define([
}));
});
- pluginStore.reset(arr);
+ if (uiCustomize!==false) // from ui customizer in editor config or desktop event
+ this.UICustomizePlugins = arrUI;
- this.appOptions.pluginsPath = (plugins.url);
- this.appOptions.canPlugins = (arr.length>0);
- } else {
+ if (!uiCustomize) {
+ if (pluginStore) pluginStore.reset(arr);
+ this.appOptions.pluginsPath = (plugins.url);
+ this.appOptions.canPlugins = (arr.length>0);
+ }
+ } else if (!uiCustomize){
this.appOptions.pluginsPath = '';
this.appOptions.canPlugins = false;
}
@@ -1917,7 +1937,7 @@ define([
if (plugins.autoStartGuid)
this.api.asc_pluginRun(plugins.autoStartGuid, 0, '');
}
- this.getApplication().getController('LeftMenu').enablePlugins();
+ if (!uiCustomize) 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.',
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index 8ed872111..554b9e0f5 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -53,7 +53,8 @@ define([
'documenteditor/main/app/view/MailMergeRecepients',
'documenteditor/main/app/view/StyleTitleDialog',
'documenteditor/main/app/view/PageMarginsDialog',
- 'documenteditor/main/app/view/PageSizeDialog'
+ 'documenteditor/main/app/view/PageSizeDialog',
+ 'documenteditor/main/app/view/NoteSettingsDialog'
], function () {
'use strict';
@@ -92,7 +93,8 @@ define([
can_copycut: undefined,
pgmargins: undefined,
fontsize: undefined,
- in_equation: false
+ in_equation: false,
+ in_chart: false
};
this.flg = {};
this.diagramEditor = null;
@@ -264,6 +266,9 @@ define([
toolbar.mnuZoomIn.on('click', _.bind(this.onZoomInClick, this));
toolbar.mnuZoomOut.on('click', _.bind(this.onZoomOutClick, this));
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
+ toolbar.btnNotes.menu.on('item:click', _.bind(this.onNotesClick, this));
+ toolbar.mnuGotoFootPrev.on('click', _.bind(this.onFootnotePrevClick, this));
+ toolbar.mnuGotoFootNext.on('click', _.bind(this.onFootnoteNextClick, this));
$('#id-save-style-plus, #id-save-style-link', toolbar.$el).on('click', this.onMenuSaveStyle.bind(this));
@@ -563,6 +568,7 @@ define([
var pr, sh, i = -1, type,
paragraph_locked = false,
header_locked = false,
+ image_locked = false,
can_add_table = false,
can_add_image = false,
enable_dropcap = undefined,
@@ -590,6 +596,7 @@ define([
in_header = true;
} else if (type === Asc.c_oAscTypeSelectElement.Image) {
in_image = in_header = true;
+ image_locked = pr.get_Locked();
if (pr && pr.get_ChartProperties())
in_chart = true;
} else if (type === Asc.c_oAscTypeSelectElement.Math) {
@@ -670,16 +677,23 @@ define([
}
need_disable = paragraph_locked || header_locked || !can_add_image || in_equation;
- if (need_disable != toolbar.btnInsertChart.isDisabled()) {
- toolbar.btnInsertChart.setDisabled(need_disable);
+ if (need_disable != toolbar.btnInsertImage.isDisabled()) {
toolbar.btnInsertImage.setDisabled(need_disable);
toolbar.btnInsertShape.setDisabled(need_disable);
toolbar.btnInsertText.setDisabled(need_disable);
}
- need_disable = need_disable || in_image;
- if (need_disable != toolbar.mnuInsertTextArt.isDisabled())
- toolbar.mnuInsertTextArt.setDisabled(need_disable);
+ if ((need_disable || in_image) != toolbar.mnuInsertTextArt.isDisabled())
+ toolbar.mnuInsertTextArt.setDisabled(need_disable || in_image);
+
+ if (in_chart !== this._state.in_chart) {
+ toolbar.btnInsertChart.updateHint(in_chart ? toolbar.tipChangeChart : toolbar.tipInsertChart);
+ this._state.in_chart = in_chart;
+ }
+
+ need_disable = in_chart && image_locked || !in_chart && need_disable;
+ if (need_disable != toolbar.btnInsertChart.isDisabled())
+ toolbar.btnInsertChart.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation;
if (need_disable !== toolbar.btnInsertEquation.isDisabled()) toolbar.btnInsertEquation.setDisabled(need_disable);
@@ -1675,20 +1689,43 @@ define([
onSelectChart: function(picker, item, record) {
var me = this,
- type = record.get('type');
+ type = record.get('type'),
+ chart = false;
- if (!this.diagramEditor)
- this.diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
-
- if (this.diagramEditor && me.api) {
- this.diagramEditor.setEditMode(false);
- this.diagramEditor.show();
-
- var chart = me.api.asc_getChartObject(type);
- if (chart) {
- this.diagramEditor.setChartData(new Asc.asc_CChartBinary(chart));
+ var selectedElements = me.api.getSelectedElements();
+ if (selectedElements && _.isArray(selectedElements)) {
+ for (var i = 0; i< selectedElements.length; i++) {
+ if (Asc.c_oAscTypeSelectElement.Image == selectedElements[i].get_ObjectType()) {
+ var elValue = selectedElements[i].get_ObjectValue().get_ChartProperties();
+ if (elValue) {
+ chart = elValue;
+ break;
+ }
+ }
+ }
+ }
+
+ if (chart) {
+ var props = new Asc.asc_CImgProperty();
+ chart.changeType(type);
+ props.put_ChartProperties(chart);
+ this.api.ImgApply(props);
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ } else {
+ if (!this.diagramEditor)
+ this.diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
+
+ if (this.diagramEditor && me.api) {
+ this.diagramEditor.setEditMode(false);
+ this.diagramEditor.show();
+
+ chart = me.api.asc_getChartObject(type);
+ if (chart) {
+ this.diagramEditor.setChartData(new Asc.asc_CChartBinary(chart));
+ }
+ me.toolbar.fireEvent('insertchart', me.toolbar);
}
- me.toolbar.fireEvent('insertchart', me.toolbar);
}
},
@@ -1960,6 +1997,57 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
+ onNotesClick: function(menu, item) {
+ if (this.api) {
+ if (item.value == 'ins_footnote')
+ this.api.asc_AddFootnote();
+ else if (item.value == 'delele')
+ Common.UI.warning({
+ msg: this.confirmDeleteFootnotes,
+ buttons: ['yes', 'no'],
+ primary: 'yes',
+ callback: _.bind(function(btn) {
+ if (btn == 'yes') {
+ this.api.asc_RemoveAllFootnotes();
+ }
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ }, this)
+ });
+ else if (item.value == 'settings') {
+ var me = this;
+ (new DE.Views.NoteSettingsDialog({
+ api: me.api,
+ handler: function(result, settings) {
+ if (settings) {
+ me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
+ if (result == 'insert')
+ me.api.asc_AddFootnote(settings.custom);
+ }
+ Common.NotificationCenter.trigger('edit:complete', me.toolbar);
+ },
+ props : me.api.asc_GetFootnoteProps()
+ })).show();
+ } else
+ return;
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ }
+ },
+
+ onFootnotePrevClick: function(btn) {
+ if (this.api)
+ this.api.asc_GotoFootnote(false);
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ onFootnoteNextClick: function(btn) {
+ if (this.api)
+ this.api.asc_GotoFootnote(true);
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
_clearBullets: function() {
this.toolbar.btnMarkers.toggle(false, true);
this.toolbar.btnNumbers.toggle(false, true);
@@ -2992,7 +3080,8 @@ define([
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 device fonts, the saved font will be used when it is available.
Do you want to continue?',
notcriticalErrorTitle: 'Warning',
txtMarginsW: 'Left and right margins are too high for a given page wight',
- txtMarginsH: 'Top and bottom margins are too high for a given page height'
+ txtMarginsH: 'Top and bottom margins are too high for a given page height',
+ confirmDeleteFootnotes: 'Do you want to delete all footnotes?'
}, DE.Controllers.Toolbar || {}));
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template
index c6d15c865..6a71a0ac4 100644
--- a/apps/documenteditor/main/app/template/Toolbar.template
+++ b/apps/documenteditor/main/app/template/Toolbar.template
@@ -153,6 +153,7 @@
+