Merge branch 'develop' into feature/placeholders

This commit is contained in:
Julia Radzhabova 2019-11-27 11:17:40 +03:00
commit 79b209bcc3
20 changed files with 402 additions and 324 deletions

View file

@ -109,7 +109,8 @@
goback: { goback: {
url: 'http://...', url: 'http://...',
text: 'Go to London', text: 'Go to London',
blank: true blank: true,
requestClose: false // if true - goback send onRequestClose event instead opening url
}, },
chat: true, chat: true,
comments: true, comments: true,

View file

@ -47,31 +47,6 @@ define([
'use strict'; 'use strict';
Common.UI.DimensionPicker = Common.UI.BaseView.extend((function(){ Common.UI.DimensionPicker = Common.UI.BaseView.extend((function(){
var me,
rootEl,
areaMouseCatcher,
areaUnHighLighted,
areaHighLighted,
areaStatus,
curColumns = 0,
curRows = 0;
var onMouseMove = function(event){
me.setTableSize(
Math.ceil((event.offsetX === undefined ? event.originalEvent.layerX : event.offsetX*Common.Utils.zoom()) / me.itemSize),
Math.ceil((event.offsetY === undefined ? event.originalEvent.layerY : event.offsetY*Common.Utils.zoom()) / me.itemSize),
event
);
};
var onMouseLeave = function(event){
me.setTableSize(0, 0, event);
};
var onHighLightedMouseClick = function(e){
me.trigger('select', me, curColumns, curRows, e);
};
return { return {
options: { options: {
itemSize : 18, itemSize : 18,
@ -95,9 +70,13 @@ define([
initialize : function(options) { initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options); Common.UI.BaseView.prototype.initialize.call(this, options);
me = this; var me = this;
rootEl = me.$el || $(this.el); this.render();
this.cmpEl = me.$el || $(this.el);
var rootEl = this.cmpEl;
me.itemSize = me.options.itemSize; me.itemSize = me.options.itemSize;
me.minRows = me.options.minRows; me.minRows = me.options.minRows;
@ -105,31 +84,48 @@ define([
me.maxRows = me.options.maxRows; me.maxRows = me.options.maxRows;
me.maxColumns = me.options.maxColumns; me.maxColumns = me.options.maxColumns;
this.render(); me.curColumns = 0;
me.curRows = 0;
var onMouseMove = function(event){
me.setTableSize(
Math.ceil((event.offsetX === undefined ? event.originalEvent.layerX : event.offsetX*Common.Utils.zoom()) / me.itemSize),
Math.ceil((event.offsetY === undefined ? event.originalEvent.layerY : event.offsetY*Common.Utils.zoom()) / me.itemSize),
event
);
};
var onMouseLeave = function(event){
me.setTableSize(0, 0, event);
};
var onHighLightedMouseClick = function(e){
me.trigger('select', me, me.curColumns, me.curRows, e);
};
if (rootEl){ if (rootEl){
areaMouseCatcher = rootEl.find('.dimension-picker-mousecatcher'); var areaMouseCatcher = rootEl.find('.dimension-picker-mousecatcher');
areaUnHighLighted = rootEl.find('.dimension-picker-unhighlighted'); me.areaUnHighLighted = rootEl.find('.dimension-picker-unhighlighted');
areaHighLighted = rootEl.find('.dimension-picker-highlighted'); me.areaHighLighted = rootEl.find('.dimension-picker-highlighted');
areaStatus = rootEl.find('.dimension-picker-status'); me.areaStatus = rootEl.find('.dimension-picker-status');
rootEl.css({width: me.minColumns + 'em'}); rootEl.css({width: me.minColumns + 'em'});
areaMouseCatcher.css('z-index', 1); areaMouseCatcher.css('z-index', 1);
areaMouseCatcher.width(me.maxColumns + 'em').height(me.maxRows + 'em'); areaMouseCatcher.width(me.maxColumns + 'em').height(me.maxRows + 'em');
areaUnHighLighted.width(me.minColumns + 'em').height(me.minRows + 'em'); me.areaUnHighLighted.width(me.minColumns + 'em').height(me.minRows + 'em');
areaStatus.html(curColumns + ' x ' + curRows); me.areaStatus.html(me.curColumns + ' x ' + me.curRows);
areaStatus.width(areaUnHighLighted.width()); me.areaStatus.width(me.areaUnHighLighted.width());
}
areaMouseCatcher.on('mousemove', onMouseMove); areaMouseCatcher.on('mousemove', onMouseMove);
areaHighLighted.on('mousemove', onMouseMove); me.areaHighLighted.on('mousemove', onMouseMove);
areaUnHighLighted.on('mousemove', onMouseMove); me.areaUnHighLighted.on('mousemove', onMouseMove);
areaMouseCatcher.on('mouseleave', onMouseLeave); areaMouseCatcher.on('mouseleave', onMouseLeave);
areaHighLighted.on('mouseleave', onMouseLeave); me.areaHighLighted.on('mouseleave', onMouseLeave);
areaUnHighLighted.on('mouseleave', onMouseLeave); me.areaUnHighLighted.on('mouseleave', onMouseLeave);
areaMouseCatcher.on('click', onHighLightedMouseClick); areaMouseCatcher.on('click', onHighLightedMouseClick);
areaHighLighted.on('click', onHighLightedMouseClick); me.areaHighLighted.on('click', onHighLightedMouseClick);
areaUnHighLighted.on('click', onHighLightedMouseClick); me.areaUnHighLighted.on('click', onHighLightedMouseClick);
}
}, },
render: function() { render: function() {
@ -142,38 +138,38 @@ define([
if (columns > this.maxColumns) columns = this.maxColumns; if (columns > this.maxColumns) columns = this.maxColumns;
if (rows > this.maxRows) rows = this.maxRows; if (rows > this.maxRows) rows = this.maxRows;
if (curColumns != columns || curRows != rows){ if (this.curColumns != columns || this.curRows != rows){
curColumns = columns; this.curColumns = columns;
curRows = rows; this.curRows = rows;
areaHighLighted.width(curColumns + 'em').height(curRows + 'em'); this.areaHighLighted.width(this.curColumns + 'em').height(this.curRows + 'em');
areaUnHighLighted.width( this.areaUnHighLighted.width(
((curColumns < me.minColumns) ((this.curColumns < this.minColumns)
? me.minColumns ? this.minColumns
: ((curColumns + 1 > me.maxColumns) : ((this.curColumns + 1 > this.maxColumns)
? me.maxColumns ? this.maxColumns
: curColumns + 1)) + 'em' : this.curColumns + 1)) + 'em'
).height(((curRows < me.minRows) ).height(((this.curRows < this.minRows)
? me.minRows ? this.minRows
: ((curRows + 1 > me.maxRows) : ((this.curRows + 1 > this.maxRows)
? me.maxRows ? this.maxRows
: curRows + 1)) + 'em' : this.curRows + 1)) + 'em'
); );
rootEl.width(areaUnHighLighted.width()); this.cmpEl.width(this.areaUnHighLighted.width());
areaStatus.html(curColumns + ' x ' + curRows); this.areaStatus.html(this.curColumns + ' x ' + this.curRows);
areaStatus.width(areaUnHighLighted.width()); this.areaStatus.width(this.areaUnHighLighted.width());
me.trigger('change', me, curColumns, curRows, event); this.trigger('change', this, this.curColumns, this.curRows, event);
} }
}, },
getColumnsCount: function() { getColumnsCount: function() {
return curColumns; return this.curColumns;
}, },
getRowsCount: function() { getRowsCount: function() {
return curRows; return this.curRows;
} }
} }
})()) })())

View file

@ -110,8 +110,8 @@ define([
onBtnClick: function(event) { onBtnClick: function(event) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, event.currentTarget.attributes['result'].value, { this.options.handler.call(this, event.currentTarget.attributes['result'].value, {
columns : this.udColumns.getValue(), columns : this.udColumns.getNumberValue(),
rows : this.udRows.getValue() rows : this.udRows.getNumberValue()
}); });
} }
@ -121,8 +121,8 @@ define([
onPrimary: function() { onPrimary: function() {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, 'ok', { this.options.handler.call(this, 'ok', {
columns : this.udColumns.getValue(), columns : this.udColumns.getNumberValue(),
rows : this.udRows.getValue() rows : this.udRows.getNumberValue()
}); });
} }

View file

@ -75,7 +75,7 @@ DE.ApplicationController = new(function(){
$('#editor_sdk').addClass('top'); $('#editor_sdk').addClass('top');
} }
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url)) { if (config.canBackToFolder === false || !(config.customization && config.customization.goback && (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose))) {
$('#id-btn-close').hide(); $('#id-btn-close').hide();
// Hide last separator // Hide last separator
@ -266,8 +266,12 @@ DE.ApplicationController = new(function(){
}); });
$('#id-btn-close').on('click', function(){ $('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url) if (config.customization && config.customization.goback) {
window.parent.location.href = config.customization.goback.url; if (config.customization.goback.requestClose && config.canRequestClose)
Common.Gateway.requestClose();
else if (config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
}
}); });
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this)); $('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));

View file

@ -341,9 +341,10 @@ define([
this.appOptions.mergeFolderUrl = this.editorConfig.mergeFolderUrl; this.appOptions.mergeFolderUrl = this.editorConfig.mergeFolderUrl;
this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl;
this.appOptions.canAnalytics = false; this.appOptions.canAnalytics = false;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.customization = this.editorConfig.customization; this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object')
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url); && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose);
this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canBack = this.appOptions.canBackToFolder === true;
this.appOptions.canPlugins = false; this.appOptions.canPlugins = false;
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
@ -648,11 +649,16 @@ define([
goBack: function(current) { goBack: function(current) {
if ( !Common.Controllers.Desktop.process('goback') ) { if ( !Common.Controllers.Desktop.process('goback') ) {
var href = this.appOptions.customization.goback.url; if (this.appOptions.customization.goback.requestClose && this.appOptions.canRequestClose) {
if (!current && this.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank"); // Common.Controllers.Desktop.requestClose();
} else { } else {
parent.location.href = href; var href = this.appOptions.customization.goback.url;
if (!current && this.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
} }
}, },
@ -1155,7 +1161,6 @@ define([
this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false; this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false;
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined (this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true (!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true

View file

@ -105,10 +105,10 @@ define([
updateMetricUnit: function() { updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width); var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height); value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
}, },
createDelayedControls: function() { createDelayedControls: function() {
@ -316,13 +316,13 @@ define([
value = props.get_Width(); value = props.get_Width();
if ( Math.abs(this._state.Width-value)>0.001 ) { if ( Math.abs(this._state.Width-value)>0.001 ) {
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Width = value; this._state.Width = value;
} }
value = props.get_Height(); value = props.get_Height();
if ( Math.abs(this._state.Height-value)>0.001 ) { if ( Math.abs(this._state.Height-value)>0.001 ) {
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Height = value; this._state.Height = value;
} }
@ -396,8 +396,8 @@ define([
var w = imgsize.get_ImageWidth(); var w = imgsize.get_ImageWidth();
var h = imgsize.get_ImageHeight(); var h = imgsize.get_ImageHeight();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty(); var properties = new Asc.asc_CImgProperty();
properties.put_Width(w); properties.put_Width(w);
@ -428,8 +428,8 @@ define([
h = pageh; h = pageh;
} }
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty(); var properties = new Asc.asc_CImgProperty();
properties.put_Width(w); properties.put_Width(w);

View file

@ -210,9 +210,10 @@ define([
me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl; me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl;
me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl; me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl;
me.appOptions.canAnalytics = false; me.appOptions.canAnalytics = false;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.customization = me.editorConfig.customization; me.appOptions.customization = me.editorConfig.customization;
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') && (typeof (me.editorConfig.customization.goback) == 'object')
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url); && (!_.isEmpty(me.editorConfig.customization.goback.url) || me.editorConfig.customization.goback.requestClose && me.appOptions.canRequestClose);
me.appOptions.canBack = me.appOptions.canBackToFolder === true; me.appOptions.canBack = me.appOptions.canBackToFolder === true;
me.appOptions.canPlugins = false; me.appOptions.canPlugins = false;
me.plugins = me.editorConfig.plugins; me.plugins = me.editorConfig.plugins;
@ -335,11 +336,15 @@ define([
}, },
goBack: function(current) { goBack: function(current) {
var href = this.appOptions.customization.goback.url; if (this.appOptions.customization.goback.requestClose && this.appOptions.canRequestClose) {
if (!current && this.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank");
} else { } else {
parent.location.href = href; var href = this.appOptions.customization.goback.url;
if (!current && this.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
}, },
@ -730,7 +735,6 @@ define([
me.appOptions.isOffline = me.api.asc_isOffline(); me.appOptions.isOffline = me.api.asc_isOffline();
me.appOptions.isReviewOnly = (me.permissions.review === true) && (me.permissions.edit === false); me.appOptions.isReviewOnly = (me.permissions.review === true) && (me.permissions.edit === false);
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights; me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.canEdit = (me.permissions.edit !== false || me.permissions.review === true) && // can edit or review me.appOptions.canEdit = (me.permissions.edit !== false || me.permissions.review === true) && // can edit or review
(me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined (me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
(!me.appOptions.isReviewOnly || me.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true (!me.appOptions.isReviewOnly || me.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true

View file

@ -51,8 +51,7 @@ define([
DE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() { DE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private // private
var _backUrl, var stateDisplayMode = false;
stateDisplayMode = false;
return { return {
models: [], models: [],
@ -67,9 +66,7 @@ define([
loadConfig: function (data) { loadConfig: function (data) {
if (data && data.config && data.config.canBackToFolder !== false && if (data && data.config && data.config.canBackToFolder !== false &&
data.config.customization && data.config.customization.goback && data.config.customization.goback.url) { data.config.customization && data.config.customization.goback && (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
_backUrl = data.config.customization.goback.url;
$('#document-back').show().single('click', _.bind(this.onBack, this)); $('#document-back').show().single('click', _.bind(this.onBack, this));
} }
}, },
@ -116,7 +113,7 @@ define([
{ {
text: me.leaveButtonText, text: me.leaveButtonText,
onClick: function() { onClick: function() {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },
{ {
@ -126,7 +123,7 @@ define([
] ]
}); });
} else { } else {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },

View file

@ -76,7 +76,7 @@ PE.ApplicationController = new(function(){
$('#editor_sdk').addClass('top'); $('#editor_sdk').addClass('top');
} }
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url)) { if (config.canBackToFolder === false || !(config.customization && config.customization.goback && (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose))) {
$('#id-btn-close').hide(); $('#id-btn-close').hide();
// Hide last separator // Hide last separator
@ -310,8 +310,12 @@ PE.ApplicationController = new(function(){
}); });
$('#id-btn-close').on('click', function(){ $('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url) if (config.customization && config.customization.goback) {
window.parent.location.href = config.customization.goback.url; if (config.customization.goback.requestClose && config.canRequestClose)
Common.Gateway.requestClose();
else if (config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
}
}); });
$('#btn-left').on('click', function(){ $('#btn-left').on('click', function(){

View file

@ -310,9 +310,10 @@ define([
this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl;
this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl;
this.appOptions.canAnalytics = false; this.appOptions.canAnalytics = false;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.customization = this.editorConfig.customization; this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object')
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url); && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose);
this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canBack = this.appOptions.canBackToFolder === true;
this.appOptions.canPlugins = false; this.appOptions.canPlugins = false;
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
@ -447,11 +448,16 @@ define([
goBack: function(current) { goBack: function(current) {
var me = this; var me = this;
if ( !Common.Controllers.Desktop.process('goback') ) { if ( !Common.Controllers.Desktop.process('goback') ) {
var href = me.appOptions.customization.goback.url; if (me.appOptions.customization.goback.requestClose && me.appOptions.canRequestClose) {
if (!current && me.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank"); // Common.Controllers.Desktop.requestClose();
} else { } else {
parent.location.href = href; var href = me.appOptions.customization.goback.url;
if (!current && me.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
} }
}, },
@ -899,7 +905,6 @@ define([
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion; this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/ /** coauthoring end **/
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view'; this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';

View file

@ -102,10 +102,10 @@ define([
updateMetricUnit: function() { updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width); var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height); value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
}, },
createDelayedControls: function() { createDelayedControls: function() {
@ -249,13 +249,13 @@ define([
var value = props.get_Width(); var value = props.get_Width();
if ( Math.abs(this._state.Width-value)>0.001 ) { if ( Math.abs(this._state.Width-value)>0.001 ) {
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Width = value; this._state.Width = value;
} }
value = props.get_Height(); value = props.get_Height();
if ( Math.abs(this._state.Height-value)>0.001 ) { if ( Math.abs(this._state.Height-value)>0.001 ) {
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Height = value; this._state.Height = value;
} }
@ -291,8 +291,8 @@ define([
var w = imgsize.get_ImageWidth(); var w = imgsize.get_ImageWidth();
var h = imgsize.get_ImageHeight(); var h = imgsize.get_ImageHeight();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty(); var properties = new Asc.asc_CImgProperty();
properties.put_Width(w); properties.put_Width(w);

View file

@ -209,9 +209,10 @@ define([
me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl; me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl;
me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl; me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl;
me.appOptions.canAnalytics = false; me.appOptions.canAnalytics = false;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.customization = me.editorConfig.customization; me.appOptions.customization = me.editorConfig.customization;
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') && (typeof (me.editorConfig.customization.goback) == 'object')
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url); && (!_.isEmpty(me.editorConfig.customization.goback.url) || me.editorConfig.customization.goback.requestClose && me.appOptions.canRequestClose);
me.appOptions.canBack = me.appOptions.canBackToFolder === true; me.appOptions.canBack = me.appOptions.canBackToFolder === true;
me.appOptions.canPlugins = false; me.appOptions.canPlugins = false;
me.plugins = me.editorConfig.plugins; me.plugins = me.editorConfig.plugins;
@ -322,11 +323,15 @@ define([
}, },
goBack: function(current) { goBack: function(current) {
var href = this.appOptions.customization.goback.url; if (this.appOptions.customization.goback.requestClose && this.appOptions.canRequestClose) {
if (!current && this.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank");
} else { } else {
parent.location.href = href; var href = this.appOptions.customization.goback.url;
if (!current && this.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
}, },
@ -662,7 +667,6 @@ define([
me.appOptions.isOffline = me.api.asc_isOffline(); me.appOptions.isOffline = me.api.asc_isOffline();
me.appOptions.isReviewOnly = (me.permissions.review === true) && (me.permissions.edit === false); me.appOptions.isReviewOnly = (me.permissions.review === true) && (me.permissions.edit === false);
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights; me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.canEdit = (me.permissions.edit !== false || me.permissions.review === true) && // can edit or review me.appOptions.canEdit = (me.permissions.edit !== false || me.permissions.review === true) && // can edit or review
(me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined (me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
(!me.appOptions.isReviewOnly || me.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true (!me.appOptions.isReviewOnly || me.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true

View file

@ -51,7 +51,6 @@ define([
PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() { PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private // private
var _backUrl;
return { return {
models: [], models: [],
@ -66,9 +65,7 @@ define([
loadConfig: function (data) { loadConfig: function (data) {
if (data && data.config && data.config.canBackToFolder !== false && if (data && data.config && data.config.canBackToFolder !== false &&
data.config.customization && data.config.customization.goback && data.config.customization.goback.url) { data.config.customization && data.config.customization.goback && (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
_backUrl = data.config.customization.goback.url;
$('#document-back').show().single('click', _.bind(this.onBack, this)); $('#document-back').show().single('click', _.bind(this.onBack, this));
} }
}, },
@ -115,7 +112,7 @@ define([
{ {
text: me.leaveButtonText, text: me.leaveButtonText,
onClick: function() { onClick: function() {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },
{ {
@ -125,7 +122,7 @@ define([
] ]
}); });
} else { } else {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },

View file

@ -68,7 +68,7 @@ SSE.ApplicationController = new(function(){
common.controller.modals.init(embedConfig); common.controller.modals.init(embedConfig);
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url)) if (config.canBackToFolder === false || !(config.customization && config.customization.goback && (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose)))
$('#id-btn-close').hide(); $('#id-btn-close').hide();
// Docked toolbar // Docked toolbar
@ -211,8 +211,12 @@ SSE.ApplicationController = new(function(){
}); });
$('#id-btn-close').on('click', function(){ $('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url) if (config.customization && config.customization.goback) {
window.parent.location.href = config.customization.goback.url; if (config.customization.goback.requestClose && config.canRequestClose)
Common.Gateway.requestClose();
else if (config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
}
}); });
$('#id-btn-zoom-in').on('click', function () { $('#id-btn-zoom-in').on('click', function () {

View file

@ -326,9 +326,10 @@ define([
this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl;
this.appOptions.isEditDiagram = this.editorConfig.mode == 'editdiagram'; this.appOptions.isEditDiagram = this.editorConfig.mode == 'editdiagram';
this.appOptions.isEditMailMerge = this.editorConfig.mode == 'editmerge'; this.appOptions.isEditMailMerge = this.editorConfig.mode == 'editmerge';
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.customization = this.editorConfig.customization; this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object')
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url); && (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose);
this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canBack = this.appOptions.canBackToFolder === true;
this.appOptions.canPlugins = false; this.appOptions.canPlugins = false;
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers; this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
@ -477,11 +478,16 @@ define([
goBack: function(current) { goBack: function(current) {
var me = this; var me = this;
if ( !Common.Controllers.Desktop.process('goback') ) { if ( !Common.Controllers.Desktop.process('goback') ) {
var href = me.appOptions.customization.goback.url; if (me.appOptions.customization.goback.requestClose && me.appOptions.canRequestClose) {
if (!current && me.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank"); // Common.Controllers.Desktop.requestClose();
} else { } else {
parent.location.href = href; var href = me.appOptions.customization.goback.url;
if (!current && me.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
} }
}, },
@ -950,7 +956,6 @@ define([
this.appOptions.canModifyFilter = true; this.appOptions.canModifyFilter = true;
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view'; this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';

View file

@ -29,30 +29,19 @@
<div id="cell-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;"> <div id="cell-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;"> <div style="height:80px;">
<div style="display: inline-block;"> <div style="display: inline-block;">
<label class="input-label" style=""><%= scope.textStyle %></label> <label class="input-label" style=""><%= scope.textAngle %></label>
<div id="cell-combo-grad-type" style="width: 90px;"></div> <div id="cell-spin-gradient-angle" style="width: 90px;"></div>
</div> </div>
<div style="display: inline-block;float: right;"> <div style="display: inline-block;float: right;">
<label class="input-label" style=""><%= scope.textDirection %></label> <label class="input-label" style=""><%= scope.textDirection %></label>
<div id="cell-button-direction" style=""></div> <div id="cell-button-direction" style=""></div>
</div> </div>
</div> </div>
<div style="height: 28px;"> <label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block;"> <div style="display: inline-block; margin-top: 3px;">
<label class="input-label" style="width: 90px; padding-top: 3px;"><%= scope.textBorderColor + " 1" %></label> <div id="cell-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div>
<div style="display: inline-block;float: right;">
<div id="cell-grad-btn-color-1" style=""></div>
</div>
</div>
<div style="height: 28px;">
<div style="display: inline-block;">
<label class="input-label" style="width: 90px; padding-top: 3px;"><%= scope.textBorderColor + " 2" %></label>
</div>
<div style="display: inline-block;float: right;">
<div id="cell-grad-btn-color-2" style=""></div>
</div>
</div> </div>
<div id="cell-gradient-color-btn" style="display: inline-block;float: right;"></div>
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -78,8 +78,7 @@ define([
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID, FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
FGColor: '000000', FGColor: '000000',
BGColor: 'ffffff', BGColor: 'ffffff',
GradColor1: '000000', GradColor: '000000'
GradColor2: 'ffffff'
}; };
this.lockedControls = []; this.lockedControls = [];
this._locked = true; this._locked = true;
@ -88,7 +87,7 @@ define([
this.GradFillType = Asc.c_oAscFillGradType.GRAD_LINEAR; this.GradFillType = Asc.c_oAscFillGradType.GRAD_LINEAR;
this.GradLinearDirectionType = 0; this.GradLinearDirectionType = 0;
this.GradRadialDirectionIdx = 0; this.GradRadialDirectionIdx = 0;
this.GradColors = []; this.GradColor = { values: [0, 100], colors: ['000000', 'ffffff'], currentIdx: 0};
this.fillControls = []; this.fillControls = [];
@ -192,7 +191,21 @@ define([
this.fillControls.push(this.cmbFillSrc); this.fillControls.push(this.cmbFillSrc);
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this)); this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this._arrGradType = [ this.numGradientAngle = new Common.UI.MetricSpinner({
el: $('#cell-spin-gradient-angle'),
step: 1,
width: 90,
defaultUnit : "°",
value: '0 °',
allowDecimal: true,
maxValue: 359.9,
minValue: 0,
disabled: this._locked
});
this.lockedControls.push(this.numGradientAngle);
this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this));
/*this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR}, {displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH} {displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
]; ];
@ -206,7 +219,7 @@ define([
}); });
this.cmbGradType.setValue(this._arrGradType[0].value); this.cmbGradType.setValue(this._arrGradType[0].value);
this.fillControls.push(this.cmbGradType); this.fillControls.push(this.cmbGradType);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this)); this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));*/
this._viewDataLinear = [ this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' }, { offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
@ -219,10 +232,6 @@ define([
{ offsetx: 100, offsety: 100, type:225, subtype:7, iconcls:'gradient-right-bottom'} { offsetx: 100, offsety: 100, type:225, subtype:7, iconcls:'gradient-right-bottom'}
]; ];
this._viewDataRadial = [
{ offsetx: 100, offsety: 150, type:2, subtype:5, iconcls:'gradient-radial-center'}
];
this.btnDirection = new Common.UI.Button({ this.btnDirection = new Common.UI.Button({
cls : 'btn-large-dataview', cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left', iconCls : 'item-gradient gradient-left',
@ -247,6 +256,48 @@ define([
this.fillControls.push(this.btnDirection); this.fillControls.push(this.btnDirection);
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection)); this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#cell-slider-gradient'),
width: 125,
minValue: 0,
maxValue: 100,
values: [0, 100]
});
this.sldrGradient.on('change', _.bind(this.onGradientChange, this));
this.sldrGradient.on('changecomplete', _.bind(this.onGradientChangeComplete, this));
this.sldrGradient.on('thumbclick', function(cmp, index){
me.GradColor.currentIdx = index;
var color = me.GradColor.colors[me.GradColor.currentIdx];
me.btnGradColor.setColor(color);
me.colorsGrad.select(color,false);
});
this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle');
});
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.sldrGradient.on('addthumb', function(cmp, index, nearIndex, color){
me.GradColor.colors[index] = me.GradColor.colors[nearIndex];
me.GradColor.currentIdx = index;
me.sldrGradient.addNewThumb(index, color);
});
this.sldrGradient.on('removethumb', function(cmp, index){
me.sldrGradient.removeThumb(index);
me.GradColor.values.splice(index, 1);
me.sldrGradient.changeGradientStyle();
});
this.fillControls.push(this.sldrGradient);
this.cmbPattern = new Common.UI.ComboDataView({ this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28, itemWidth: 28,
itemHeight: 28, itemHeight: 28,
@ -418,8 +469,13 @@ define([
this.CellColor = {Value: 0, Color: 'transparent'}; this.CellColor = {Value: 0, Color: 'transparent'};
this.FGColor = {Value: 1, Color: {color: '4f81bd', effectId: 24}}; this.FGColor = {Value: 1, Color: {color: '4f81bd', effectId: 24}};
this.BGColor = {Value: 1, Color: 'ffffff'}; this.BGColor = {Value: 1, Color: 'ffffff'};
this.GradColors[0] = {Value: 1, Color: {color: '4f81bd', effectId: 24}, Position: 0}; this.sldrGradient.setThumbs(2);
this.GradColors[1] = {Value: 1, Color: 'ffffff', Position: 1}; this.GradColor.colors.length = 0;
this.GradColor.values.length = 0;
this.GradColor.colors[0] = {color: '4f81bd', effectId: 24};
this.GradColor.colors[1] = 'ffffff';
this.GradColor.values = [0, 100];
this.GradColor.currentIdx = 0;
} else if (this.pattern !== null) { } else if (this.pattern !== null) {
if (this.pattern.asc_getType() === -1) { if (this.pattern.asc_getType() === -1) {
var color = this.pattern.asc_getFgColor(); var color = this.pattern.asc_getFgColor();
@ -437,18 +493,19 @@ define([
Color: Common.Utils.ThemeColor.getHexColor(color.asc_getR(), color.asc_getG(), color.asc_getB()) Color: Common.Utils.ThemeColor.getHexColor(color.asc_getR(), color.asc_getG(), color.asc_getB())
}; };
} }
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
this.FGColor = { this.FGColor = {
Value: 1, Value: 1,
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.CellColor.Color) Color: Common.Utils.ThemeColor.colorValue2EffectId(this.CellColor.Color)
}; };
this.BGColor = {Value: 1, Color: 'ffffff'}; this.BGColor = {Value: 1, Color: 'ffffff'};
this.GradColors[0] = { this.sldrGradient.setThumbs(2);
Value: 1, this.GradColor.colors.length = 0;
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.CellColor.Color), this.GradColor.values.length = 0;
Position: 0 this.GradColor.values = [0, 100];
}; this.GradColor.colors[0] = Common.Utils.ThemeColor.colorValue2EffectId(this.CellColor.Color);
this.GradColors[1] = {Value: 1, Color: 'ffffff', Position: 1}; this.GradColor.colors[1] = 'ffffff';
this.GradColor.currentIdx = 0;
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
} else { } else {
this.PatternFillType = this.pattern.asc_getType(); this.PatternFillType = this.pattern.asc_getType();
if (this._state.PatternFillType !== this.PatternFillType) { if (this._state.PatternFillType !== this.PatternFillType) {
@ -501,19 +558,20 @@ define([
Value: 1, Value: 1,
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color) Color: Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color)
}; };
this.GradColors[0] = { this.sldrGradient.setThumbs(2);
Value: 1, this.GradColor.colors.length = 0;
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color), this.GradColor.values.length = 0;
Position: 0 this.GradColor.values = [0, 100];
}; this.GradColor.colors[0] = Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color);
this.GradColors[1] = {Value: 1, Color: 'ffffff', Position: 1}; this.GradColor.colors[1] = 'ffffff';
this.GradColor.currentIdx = 0;
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_PATT; this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_PATT;
} }
} else if (this.gradient !== null) { } else if (this.gradient !== null) {
var gradFillType = this.gradient.asc_getType(); var gradFillType = this.gradient.asc_getType();
if (this._state.GradFillType !== gradFillType || this.GradFillType !== gradFillType) { if (this._state.GradFillType !== gradFillType || this.GradFillType !== gradFillType) {
this.GradFillType = gradFillType; this.GradFillType = gradFillType;
rec = undefined; /*rec = undefined;
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR || this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR || this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) {
this.cmbGradType.setValue(this.GradFillType); this.cmbGradType.setValue(this.GradFillType);
rec = this.cmbGradType.store.findWhere({value: this.GradFillType}); rec = this.cmbGradType.store.findWhere({value: this.GradFillType});
@ -521,7 +579,7 @@ define([
} else { } else {
this.cmbGradType.setValue(''); this.cmbGradType.setValue('');
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
} }*/
this._state.GradFillType = this.GradFillType; this._state.GradFillType = this.GradFillType;
} }
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
@ -534,45 +592,45 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(value);
} }
} }
var me = this;
var gradientStops; var gradientStops;
this.GradColors.length = 0;
gradientStops = this.gradient.asc_getGradientStops(); gradientStops = this.gradient.asc_getGradientStops();
var length = gradientStops.length;
this.sldrGradient.setThumbs(length);
this.GradColor.colors.length = 0;
this.GradColor.values.length = 0;
gradientStops.forEach(function (color) { gradientStops.forEach(function (color) {
var clr = color.asc_getColor(), var clr = color.asc_getColor(),
position = color.asc_getPosition(), position = color.asc_getPosition();
itemColor; me.GradColor.colors.push( clr.asc_getType() == Asc.c_oAscColor.COLOR_TYPE_SCHEME ?
if (clr.asc_getType() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { {color: Common.Utils.ThemeColor.getHexColor(clr.asc_getR(), clr.asc_getG(), clr.asc_getB()), effectValue: clr.asc_getValue()} :
itemColor = { Common.Utils.ThemeColor.getHexColor(clr.asc_getR(), clr.asc_getG(), clr.asc_getB()));
Value: 1, me.GradColor.values.push(position*100);
Color: {
color: Common.Utils.ThemeColor.getHexColor(clr.asc_getR(), clr.asc_getG(), clr.asc_getB()),
effectValue: clr.asc_getValue()
},
Position: position
};
} else {
itemColor = {
Value: 1,
Color: Common.Utils.ThemeColor.getHexColor(clr.asc_getR(), clr.asc_getG(), clr.asc_getB()),
Position: position
};
}
me.GradColors.push(itemColor);
}); });
this.GradColors = _.sortBy(this.GradColors, 'Position'); for (var index=0; index<length; index++) {
me.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(me.GradColor.colors[index]) == 'object') ? me.GradColor.colors[index].color : me.GradColor.colors[index]), index);
me.sldrGradient.setValue(index, me.GradColor.values[index]);
}
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= me.GradColor.colors.length) {
me.GradColor.currentIdx = 0;
}
me.sldrGradient.setActiveThumb(me.GradColor.currentIdx);
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_GRAD; this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
this.FGColor = { this.FGColor = {
Value: 1, Value: 1,
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.GradColors[0].Color) Color: Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0])
}; };
this.BGColor = {Value: 1, Color: 'ffffff'}; this.BGColor = {Value: 1, Color: 'ffffff'};
this.CellColor = { this.CellColor = {
Value: 1, Value: 1,
Color: Common.Utils.ThemeColor.colorValue2EffectId(this.GradColors[0].Color) Color: Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0])
}; };
} }
@ -657,60 +715,29 @@ define([
} }
// Gradient colors // Gradient colors
var gradColor1 = this.GradColors[0]; var gradColor = this.GradColor.colors[this.GradColor.currentIdx];
if (!gradColor1) { type1 = typeof (gradColor);
gradColor1 = {Value: 1, Color: {color: '4f81bd', effectId: 24}}; type2 = typeof (this._state.GradColor);
}
type1 = typeof (gradColor1.Color);
type2 = typeof (this._state.GradColor1);
if ((type1 !== type2) || (type1 == 'object' && if ((type1 !== type2) || (type1 == 'object' &&
(gradColor1.Color.effectValue !== this._state.GradColor1.effectValue || this._state.GradColor1.color.indexOf(gradColor1.Color.color) < 0)) || (gradColor.effectValue !== this._state.GradColor.effectValue || this._state.GradColor.color.indexOf(gradColor.color) < 0)) ||
(type1 != 'object' && this._state.GradColor1.indexOf(gradColor1.Color) < 0)) { (type1 != 'object' && this._state.GradColor.indexOf(gradColor) < 0)) {
this.btnGradColor1.setColor(gradColor1.Color); this.btnGradColor.setColor(gradColor);
if (typeof (gradColor1.Color) == 'object') { if (typeof (gradColor) == 'object') {
var isselected = false; var isselected = false;
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
if (Common.Utils.ThemeColor.ThemeValues[i] == gradColor1.Color.effectValue) { if (Common.Utils.ThemeColor.ThemeValues[i] == gradColor.effectValue) {
this.colorsGrad1.select(gradColor1.Color, true); this.colorsGrad.select(gradColor, true);
isselected = true; isselected = true;
break; break;
} }
} }
if (!isselected) this.colorsGrad1.clearSelection(); if (!isselected) this.colorsGrad.clearSelection();
} else } else
this.colorsGrad1.select(gradColor1.Color, true); this.colorsGrad.select(gradColor, true);
this._state.GradColor1 = gradColor1.Color; this._state.GradColor = gradColor;
}
var gradColor2 = this.GradColors[1];
if (!gradColor2) {
gradColor2 = {Value: 1, Color: 'ffffff'};
}
type1 = typeof (gradColor2.Color);
type2 = typeof (this._state.GradColor2);
if ((type1 !== type2) || (type1 == 'object' &&
(gradColor2.Color.effectValue !== this._state.GradColor2.effectValue || this._state.GradColor2.color.indexOf(gradColor2.Color.color) < 0)) ||
(type1 != 'object' && this._state.GradColor2.indexOf(gradColor2.Color) < 0)) {
this.btnGradColor2.setColor(gradColor2.Color);
if (typeof (gradColor2.Color) == 'object') {
var isselected = false;
for (var i = 0; i < 10; i++) {
if (Common.Utils.ThemeColor.ThemeValues[i] == gradColor2.Color.effectValue) {
this.colorsGrad2.select(gradColor2.Color, true);
isselected = true;
break;
}
}
if (!isselected) this.colorsGrad2.clearSelection();
} else
this.colorsGrad2.select(gradColor2.Color, true);
this._state.GradColor2 = gradColor2.Color;
} }
this._noApply = false; this._noApply = false;
@ -747,43 +774,24 @@ define([
this.btnBackColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor)); this.btnBackColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.fillControls.push(this.btnBackColor); this.fillControls.push(this.btnBackColor);
this.btnGradColor1 = new Common.UI.ColorButton({ this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;", style: "width:45px;",
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
items: [ items: [
{ template: _.template('<div id="cell-gradient-color1-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') }, { template: _.template('<div id="cell-gradient-color" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="cell-gradient-color1-new" style="padding-left:12px;">' + this.textNewColor + '</a>') } { template: _.template('<a id="cell-gradient-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
] ]
}) })
}); });
this.btnGradColor1.render( $('#cell-grad-btn-color-1')); this.btnGradColor.render( $('#cell-gradient-color-btn'));
this.btnGradColor1.setColor('000000'); this.btnGradColor.setColor('000000');
this.colorsGrad1 = new Common.UI.ThemeColorPalette({ this.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#cell-gradient-color1-menu'), el: $('#cell-gradient-color'),
value: '000000' value: '000000'
}); });
this.colorsGrad1.on('select', _.bind(this.onColorsGradientSelect, this)); this.colorsGrad.on('select', _.bind(this.onColorsGradientSelect, this));
this.btnGradColor1.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsGrad1, this.btnGradColor1)); this.btnGradColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.fillControls.push(this.btnGradColor1); this.fillControls.push(this.btnGradColor);
this.btnGradColor2 = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="cell-gradient-color2-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="cell-gradient-color2-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnGradColor2.render( $('#cell-grad-btn-color-2'));
this.btnGradColor2.setColor('ffffff');
this.colorsGrad2 = new Common.UI.ThemeColorPalette({
el: $('#cell-gradient-color2-menu'),
value: 'ffffff'
});
this.colorsGrad2.on('select', _.bind(this.onColorsGradientSelect, this));
this.btnGradColor2.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsGrad2, this.btnGradColor2));
this.fillControls.push(this.btnGradColor2);
this.btnFGColor = new Common.UI.ColorButton({ this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;", style: "width:45px;",
@ -826,8 +834,7 @@ define([
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.borderColor.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.borderColor.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.btnBorderColor.setColor(this.borderColor.getColor()); this.btnBorderColor.setColor(this.borderColor.getColor());
this.colorsGrad1.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsGrad2.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
}, },
@ -889,21 +896,24 @@ define([
this.gradient.asc_setDegree(this.GradLinearDirectionType); this.gradient.asc_setDegree(this.GradLinearDirectionType);
} }
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) { if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) {
var HexColor0 = Common.Utils.ThemeColor.getRgbColor(this.GradColors[0].Color).get_color().get_hex(), this.GradColor.currentIdx = 0;
HexColor1 = Common.Utils.ThemeColor.getRgbColor(this.GradColors[1].Color).get_color().get_hex(); if (this.GradColor.colors.length === 2) {
var HexColor0 = Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),
if (HexColor0 === 'ffffff' && HexColor1 === 'ffffff') { HexColor1 = Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();
this.GradColors[0].Color = {color: '4f81bd', effectId: 24}; // color accent1 if (HexColor0 === 'ffffff' && HexColor1 === 'ffffff') {
this.GradColors.colors[0] = {color: '4f81bd', effectId: 24}; // color accent1
}
} }
var arrGradStop = []; var arrGradStop = [];
this.GradColors.forEach(function (item) { this.GradColor.colors.forEach(function (item, index) {
var gradientStop = new Asc.asc_CGradientStop(); var gradientStop = new Asc.asc_CGradientStop();
gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(item.Color)); gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(me.GradColor.colors[index]));
gradientStop.asc_setPosition(item.Position); gradientStop.asc_setPosition(me.GradColor.values[index]/100);
arrGradStop.push(gradientStop); arrGradStop.push(gradientStop);
}); });
this.gradient.asc_putGradientStops(arrGradStop); this.gradient.asc_putGradientStops(arrGradStop);
} }
this.fill.asc_setGradientFill(this.gradient); this.fill.asc_setGradientFill(this.gradient);
this.api.asc_setCellFill(this.fill); this.api.asc_setCellFill(this.fill);
} }
@ -946,7 +956,7 @@ define([
this.FillGradientContainer.toggleClass('settings-hidden', value !== Asc.c_oAscFill.FILL_TYPE_GRAD); this.FillGradientContainer.toggleClass('settings-hidden', value !== Asc.c_oAscFill.FILL_TYPE_GRAD);
}, },
onGradTypeSelect: function(combo, record) { /*onGradTypeSelect: function(combo, record) {
this.GradFillType = record.value; this.GradFillType = record.value;
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
@ -994,7 +1004,7 @@ define([
} }
Common.NotificationCenter.trigger('edit:complete', this); Common.NotificationCenter.trigger('edit:complete', this);
}, },*/
onSelectGradient: function(btn, picker, itemView, record) { onSelectGradient: function(btn, picker, itemView, record) {
var me = this; var me = this;
@ -1015,7 +1025,8 @@ define([
} }
this.btnDirection.setIconCls('item-gradient ' + rawData.iconcls); this.btnDirection.setIconCls('item-gradient ' + rawData.iconcls);
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; this.GradLinearDirectionType = rawData.type;
this.numGradientAngle.setValue(rawData.type);
if (this.api) { if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
@ -1023,10 +1034,10 @@ define([
this.gradient = new Asc.asc_CGradientFill(); this.gradient = new Asc.asc_CGradientFill();
this.gradient.asc_setType(this.GradFillType); this.gradient.asc_setType(this.GradFillType);
var arrGradStop = []; var arrGradStop = [];
this.GradColors.forEach(function (item) { this.GradColor.values.forEach(function (item, index) {
var gradientStop = new Asc.asc_CGradientStop(); var gradientStop = new Asc.asc_CGradientStop();
gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(item.Color)); gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(me.GradColor.colors[index]));
gradientStop.asc_setPosition(item.Position); gradientStop.asc_setPosition(me.GradColor.values[index]/100);
arrGradStop.push(gradientStop); arrGradStop.push(gradientStop);
}); });
this.gradient.asc_putGradientStops(arrGradStop); this.gradient.asc_putGradientStops(arrGradStop);
@ -1041,15 +1052,10 @@ define([
}, },
onColorsGradientSelect: function(picker, color) { onColorsGradientSelect: function(picker, color) {
var me = this, var me = this;
pickerId = picker.el.id; this.btnGradColor.setColor(color);
if (pickerId === "cell-gradient-color1-menu") { this.GradColor.colors[this.GradColor.currentIdx] = color;
this.btnGradColor1.setColor(color); this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
this.GradColors[0].Color = color;
} else if (pickerId === "cell-gradient-color2-menu") {
this.btnGradColor2.setColor(color);
this.GradColors[1].Color = color;
}
if (this.api && !this._noApply) { if (this.api && !this._noApply) {
if (this.gradient == null) { if (this.gradient == null) {
@ -1060,10 +1066,10 @@ define([
} }
} }
var arrGradStop = []; var arrGradStop = [];
this.GradColors.forEach(function (item) { this.GradColor.values.forEach(function (item, index) {
var gradientStop = new Asc.asc_CGradientStop(); var gradientStop = new Asc.asc_CGradientStop();
gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(item.Color)); gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(me.GradColor.colors[index]));
gradientStop.asc_setPosition(item.Position); gradientStop.asc_setPosition(me.GradColor.values[index]/100);
arrGradStop.push(gradientStop); arrGradStop.push(gradientStop);
}); });
this.gradient.asc_putGradientStops(arrGradStop); this.gradient.asc_putGradientStops(arrGradStop);
@ -1074,6 +1080,63 @@ define([
Common.NotificationCenter.trigger('edit:complete', this); Common.NotificationCenter.trigger('edit:complete', this);
}, },
onGradientAngleChange: function(field, newValue, oldValue, eOpts) {
if (this.api) {
if (this.gradient == null) {
this.gradient = new Asc.asc_CGradientFill();
this.gradient.asc_setType(this.GradFillType);
}
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
this.gradient.asc_setDegree(field.getNumberValue());
}
this.fill.asc_setGradientFill(this.gradient);
this.api.asc_setCellFill(this.fill);
}
},
onGradientChange: function(slider, newValue, oldValue) {
this.GradColor.values = slider.getValues();
this._sliderChanged = true;
if (this.api && !this._noApply) {
if (this._sendUndoPoint) {
this.api.setStartPointHistory();
this._sendUndoPoint = false;
this.updateslider = setInterval(_.bind(this._gradientApplyFunc, this), 100);
}
}
},
onGradientChangeComplete: function(slider, newValue, oldValue) {
clearInterval(this.updateslider);
this._sliderChanged = true;
if (!this._sendUndoPoint) { // start point was added
this.api.setEndPointHistory();
this._gradientApplyFunc();
}
this._sendUndoPoint = true;
},
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var me = this;
if (this.gradient == null)
this.gradient = new Asc.asc_CGradientFill();
var arrGradStop = [];
this.GradColor.colors.forEach(function (item, index) {
var gradientStop = new Asc.asc_CGradientStop();
gradientStop.asc_setColor(Common.Utils.ThemeColor.getRgbColor(me.GradColor.colors[index]));
gradientStop.asc_setPosition(me.GradColor.values[index]/100);
arrGradStop.push(gradientStop);
});
this.gradient.asc_putGradientStops(arrGradStop);
this.fill.asc_setGradientFill(this.gradient);
this.api.asc_setCellFill(this.fill);
this._sliderChanged = false;
}
},
onPatternSelect: function(combo, record) { onPatternSelect: function(combo, record) {
if (this.api && !this._noApply) { if (this.api && !this._noApply) {
this.PatternFillType = record.get('type'); this.PatternFillType = record.get('type');
@ -1145,13 +1208,13 @@ define([
textGradientFill: 'Gradient Fill', textGradientFill: 'Gradient Fill',
textPatternFill: 'Pattern', textPatternFill: 'Pattern',
textColor: 'Color Fill', textColor: 'Color Fill',
textStyle: 'Style',
textDirection: 'Direction', textDirection: 'Direction',
textLinear: 'Linear', textLinear: 'Linear',
textRadial: 'Radial', textRadial: 'Radial',
textPattern: 'Pattern', textPattern: 'Pattern',
textForeground: 'Foreground color', textForeground: 'Foreground color',
textBackground: 'Background color' textBackground: 'Background color',
textGradient: 'Gradient'
}, SSE.Views.CellSettings || {})); }, SSE.Views.CellSettings || {}));
}); });

View file

@ -1190,7 +1190,6 @@
"SSE.Views.CellSettings.textPatternFill": "Pattern", "SSE.Views.CellSettings.textPatternFill": "Pattern",
"SSE.Views.CellSettings.textRadial": "Radial", "SSE.Views.CellSettings.textRadial": "Radial",
"SSE.Views.CellSettings.textSelectBorders": "Select borders you want to change applying style chosen above", "SSE.Views.CellSettings.textSelectBorders": "Select borders you want to change applying style chosen above",
"SSE.Views.CellSettings.textStyle": "Style",
"SSE.Views.CellSettings.tipAll": "Set outer border and all inner lines", "SSE.Views.CellSettings.tipAll": "Set outer border and all inner lines",
"SSE.Views.CellSettings.tipBottom": "Set outer bottom border only", "SSE.Views.CellSettings.tipBottom": "Set outer bottom border only",
"SSE.Views.CellSettings.tipDiagD": "Set Diagonal Down Border", "SSE.Views.CellSettings.tipDiagD": "Set Diagonal Down Border",

View file

@ -217,9 +217,10 @@ define([
me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl; me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl;
me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl; me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl;
me.appOptions.canAnalytics = false; me.appOptions.canAnalytics = false;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.customization = me.editorConfig.customization; me.appOptions.customization = me.editorConfig.customization;
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object') && (typeof (me.editorConfig.customization.goback) == 'object')
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url); && (!_.isEmpty(me.editorConfig.customization.goback.url) || me.editorConfig.customization.goback.requestClose && me.appOptions.canRequestClose);
me.appOptions.canBack = me.appOptions.canBackToFolder === true; me.appOptions.canBack = me.appOptions.canBackToFolder === true;
me.appOptions.canPlugins = false; me.appOptions.canPlugins = false;
me.plugins = me.editorConfig.plugins; me.plugins = me.editorConfig.plugins;
@ -338,11 +339,15 @@ define([
}, },
goBack: function(current) { goBack: function(current) {
var href = this.appOptions.customization.goback.url; if (this.appOptions.customization.goback.requestClose && this.appOptions.canRequestClose) {
if (!current && this.appOptions.customization.goback.blank!==false) { Common.Gateway.requestClose();
window.open(href, "_blank");
} else { } else {
parent.location.href = href; var href = this.appOptions.customization.goback.url;
if (!current && this.appOptions.customization.goback.blank!==false) {
window.open(href, "_blank");
} else {
parent.location.href = href;
}
} }
}, },
@ -706,7 +711,6 @@ define([
} }
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights; me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
me.appOptions.canRequestClose = me.editorConfig.canRequestClose;
me.appOptions.canEdit = me.permissions.edit !== false && // can edit me.appOptions.canEdit = me.permissions.edit !== false && // can edit
(me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
me.appOptions.isEdit = (me.appOptions.canLicense || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) && me.permissions.edit !== false && me.editorConfig.mode !== 'view'; me.appOptions.isEdit = (me.appOptions.canLicense || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) && me.permissions.edit !== false && me.editorConfig.mode !== 'view';

View file

@ -51,7 +51,6 @@ define([
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() { SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private // private
var _backUrl;
var locked = { var locked = {
book: false, book: false,
sheet: false sheet: false
@ -70,9 +69,7 @@ define([
loadConfig: function (data) { loadConfig: function (data) {
if (data && data.config && data.config.canBackToFolder !== false && if (data && data.config && data.config.canBackToFolder !== false &&
data.config.customization && data.config.customization.goback && data.config.customization.goback.url) { data.config.customization && data.config.customization.goback && (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
_backUrl = data.config.customization.goback.url;
$('#document-back').show().single('click', _.bind(this.onBack, this)); $('#document-back').show().single('click', _.bind(this.onBack, this));
} }
}, },
@ -124,7 +121,7 @@ define([
{ {
text: me.leaveButtonText, text: me.leaveButtonText,
onClick: function() { onClick: function() {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },
{ {
@ -134,7 +131,7 @@ define([
] ]
}); });
} else { } else {
window.parent.location.href = _backUrl; Common.NotificationCenter.trigger('goback', true);
} }
}, },