Merge branch 'develop' into feature/sparklines

This commit is contained in:
Julia Radzhabova 2016-10-24 12:07:08 +03:00
commit fdc4e3ec70
82 changed files with 2733 additions and 1884 deletions

View file

@ -494,9 +494,10 @@ define([
},
setMenu: function (m) {
if (this.rendered && m && _.isObject(m) && _.isFunction(m.render)){
if (m && _.isObject(m) && _.isFunction(m.render)){
this.menu = m;
this.menu.render(this.cmpEl);
if (this.rendered)
this.menu.render(this.cmpEl);
}
}
});

View file

@ -84,7 +84,8 @@ define([
menuCls : '',
menuStyle : '',
displayField: 'displayValue',
valueField : 'value'
valueField : 'value',
scrollAlwaysVisible: false
},
template: _.template([
@ -117,6 +118,7 @@ define([
this.store = me.options.store || new Common.UI.ComboBoxStore();
this.displayField = me.options.displayField;
this.valueField = me.options.valueField;
this.scrollAlwaysVisible = me.options.scrollAlwaysVisible;
me.rendered = me.options.rendered || false;
this.lastValue = null;
@ -216,7 +218,8 @@ define([
el: $('.dropdown-menu', this.cmpEl),
minScrollbarLength: 40,
scrollYMarginOffset: 30,
includePadding: true
includePadding: true,
alwaysVisibleY: this.scrollAlwaysVisible
}, this.options.scroller));
}
@ -239,7 +242,8 @@ define([
el: $('.dropdown-menu', this.cmpEl),
minScrollbarLength: 40,
scrollYMarginOffset: 30,
includePadding: true
includePadding: true,
alwaysVisibleY: this.scrollAlwaysVisible
}, this.options.scroller));
}
@ -542,7 +546,8 @@ define([
el: $('.dropdown-menu', this.cmpEl),
minScrollbarLength : 40,
scrollYMarginOffset: 30,
includePadding : true
includePadding : true,
alwaysVisibleY: this.scrollAlwaysVisible
}, this.options.scroller));
}
}

View file

@ -186,6 +186,16 @@ function getParent($this) {
return $parent && $parent.length ? $parent : $this.parent();
}
function clearMenus() {
$('.dropdown-toggle').each(function (e) {
var $parent = ($(this)).parent();
if (!$parent.hasClass('open')) return;
$parent.trigger(e = $.Event('hide.bs.dropdown'));
if (e.isDefaultPrevented()) return;
$parent.removeClass('open').trigger('hidden.bs.dropdown');
})
}
$(document)
.off('keydown.bs.dropdown.data-api')
.on('keydown.bs.dropdown.data-api', '[data-toggle=dropdown], [role=menu]' , onDropDownKeyDown);
@ -206,9 +216,8 @@ $(document)
}
function onDropDownClick(e) {
if ((e.which == 1 || e.which == undefined) && !!clickDefHandler) {
clickDefHandler(e);
}
if (e.which == 1 || e.which == undefined)
clearMenus();
}
if (!!clickDefHandler) {

View file

@ -31,11 +31,15 @@
*
*/
if (Common === undefined) {
var Common = {};
}
define(function(){ 'use strict';
DE.define = {};
Common.define = {};
DE.define.c_oAscMathMainType = {
Common.define.c_oAscMathMainType = {
Symbol : 0x00,
Fraction : 0x01,
Script : 0x02,
@ -56,7 +60,7 @@ define(function(){ 'use strict';
// equations types
DE.define.c_oAscMathType = {
Common.define.c_oAscMathType = {
Symbol_pm : 0x00000000,
Symbol_infinity : 0x00000001,
Symbol_equals : 0x00000002,

View file

@ -87,7 +87,7 @@
display: inline-block;
padding: 2px 8px;
&.renamed {
&.renamed:hover {
background-color: @app-header-bg-color-dark;
}
}

View file

@ -5,7 +5,7 @@
#history-header {
position: absolute;
height: 45px;
height: 53px;
left: 0;
top: 0;
right: 0;
@ -14,7 +14,7 @@
#history-btn-back {
height: 27px;
margin-top: 8px;
margin-top: 15px;
padding-top: 4px;
padding-left: 20px;
font-size: 13px;
@ -52,7 +52,7 @@
#history-list {
height: 100%;
overflow: hidden;
padding: 45px 0;
padding: 53px 0 45px 0;
.item {
display: block;

View file

@ -122,7 +122,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
@ -446,7 +446,7 @@ define([
}
},
onApiServerDisconnect: function() {
onApiServerDisconnect: function(disableDownload) {
this.mode.isEdit = false;
this.leftMenu.close();
@ -456,7 +456,7 @@ define([
/** coauthoring end **/
this.leftMenu.btnPlugins.setDisabled(true);
this.leftMenu.getMenu('file').setMode({isDisconnected: true});
this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload});
if ( this.dlgSearch ) {
this.leftMenu.btnSearch.toggle(false, true);
this.dlgSearch['hide']();

View file

@ -163,8 +163,10 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) {
if (!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
@ -421,39 +423,41 @@ define([
var changes = version.changes, change, i;
if (changes && changes.length>0) {
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
arrVersions[arrVersions.length-1].set('docIdPrev', docIdPrev);
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
for (i=changes.length-2; i>=0; i--) {
change = changes[i];
if (!_.isEmpty(version.serverVersion) && version.serverVersion == this.appOptions.buildVersion) {
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
for (i=changes.length-2; i>=0; i--) {
change = changes[i];
user = usersStore.findUser(change.user.id);
if (!user) {
user = new Common.Models.User({
id : change.user.id,
username : change.user.name,
colorval : Asc.c_oAscArrUserColors[usersCnt],
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
});
usersStore.add(user);
user = usersStore.findUser(change.user.id);
if (!user) {
user = new Common.Models.User({
id : change.user.id,
username : change.user.name,
colorval : Asc.c_oAscArrUserColors[usersCnt],
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
});
usersStore.add(user);
}
arrVersions.push(new Common.Models.HistoryVersion({
version: version.versionGroup,
revision: version.version,
changeid: i,
userid : change.user.id,
username : change.user.name,
usercolor: user.get('color'),
created: change.created,
docId: version.key,
docIdPrev: docIdPrev,
selected: false,
canRestore: this.appOptions.canHistoryRestore,
isRevision: false,
isVisible: true
}));
arrColors.push(user.get('colorval'));
}
arrVersions.push(new Common.Models.HistoryVersion({
version: version.versionGroup,
revision: version.version,
changeid: i,
userid : change.user.id,
username : change.user.name,
usercolor: user.get('color'),
created: change.created,
docId: version.key,
docIdPrev: docIdPrev,
selected: false,
canRestore: this.appOptions.canHistoryRestore,
isRevision: false,
isVisible: true
}));
arrColors.push(user.get('colorval'));
}
} else if (ver==0 && versions.length==1) {
arrVersions[arrVersions.length-1].set('docId', version.key + '1');
@ -520,7 +524,11 @@ define([
toolbarView.btnInsertShape.toggle(false, false);
toolbarView.btnInsertText.toggle(false, false);
}
if (this.appOptions.isEdit && toolbarView && toolbarView.btnHighlightColor.pressed &&
( !_.isObject(arguments[1]) || arguments[1].id !== 'id-toolbar-btn-highlight')) {
this.api.SetMarkerFormat(false);
toolbarView.btnHighlightColor.toggle(false, false);
}
application.getController('DocumentHolder').getView('DocumentHolder').focus();
if (this.api) {
@ -872,12 +880,12 @@ define([
documentHolderController.getView('DocumentHolder').createDelayedElements();
me.loadLanguages();
rightmenuController.createDelayedElements();
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
rightmenuController.createDelayedElements();
me.updateThemeColors();
toolbarController.activateControls();
if (me.needToUpdateVersion)
@ -948,6 +956,10 @@ define([
}
this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review;
if (params.asc_getRights() !== Asc.c_oRights.Edit)
this.permissions.edit = this.permissions.review = false;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
this.appOptions.isLightVersion = params.asc_getIsLight();
@ -972,6 +984,7 @@ define([
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = !!this.permissions.rename;
this.appOptions.buildVersion = params.asc_getBuildVersion();
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
@ -1195,7 +1208,7 @@ define([
break;
case Asc.c_oAscError.ID.CoAuthoringDisconnect:
config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect;
config.msg = this.errorViewerDisconnect;
break;
case Asc.c_oAscError.ID.ConvertationPassword:
@ -1964,7 +1977,7 @@ define([
textNoLicenseTitle: 'ONLYOFFICE open source version',
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',

View file

@ -167,14 +167,15 @@ define([
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = !can_add_table || in_equation;
}
var lastactive = -1, currentactive, priorityactive = -1;
var lastactive = -1, currentactive, priorityactive = -1,
activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; i++) {
var pnl = this._settings[i];
if (pnl===undefined || pnl.btn===undefined || pnl.panel===undefined) continue;
if ( pnl.hidden ) {
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
if (this.rightmenu.GetActivePane() == pnl.panelId)
if (activePane == pnl.panelId)
currentactive = -1;
} else {
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
@ -182,7 +183,7 @@ define([
if ( pnl.needShow ) {
pnl.needShow = false;
priorityactive = i;
} else if (this.rightmenu.GetActivePane() == pnl.panelId)
} else if (activePane == pnl.panelId)
currentactive = i;
pnl.panel.setLocked(pnl.locked);
}
@ -269,6 +270,7 @@ define([
}
if (this.editMode && this.api) {
this.rightmenu.shapeSettings.createDelayedElements();
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0) {
var open = Common.localStorage.getItem("de-hide-right-settings");

View file

@ -46,8 +46,8 @@ define([
'common/main/lib/view/CopyWarningDialog',
'common/main/lib/view/ImageFromUrlDialog',
'common/main/lib/view/InsertTableDialog',
'common/main/lib/util/define',
'documenteditor/main/app/view/Toolbar',
'documenteditor/main/app/util/define',
'documenteditor/main/app/view/HyperlinkSettingsDialog',
'documenteditor/main/app/view/DropcapSettingsAdvanced',
'documenteditor/main/app/view/MailMergeRecepients',
@ -304,7 +304,7 @@ define([
this.api.asc_registerCallback('asc_onMarkerFormatChanged', _.bind(this.onApiStartHighlight, this));
this.api.asc_registerCallback('asc_onTextHighLight', _.bind(this.onApiHighlightColor, this));
this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCanCopyCut', _.bind(this.onApiCanCopyCut, this));
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this));
@ -2291,32 +2291,32 @@ define([
// [translate, count cells, scroll]
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Symbol ] = [this.textSymbols, 11];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Fraction ] = [this.textFraction, 4];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Script ] = [this.textScript, 4];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Radical ] = [this.textRadical, 4];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Integral ] = [this.textIntegral, 3, true];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.LargeOperator] = [this.textLargeOperator, 5, true];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Bracket ] = [this.textBracket, 4, true];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Function ] = [this.textFunction, 3, true];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Accent ] = [this.textAccent, 4];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.LimitLog ] = [this.textLimitAndLog, 3];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Operator ] = [this.textOperator, 4];
c_oAscMathMainTypeStrings[DE.define.c_oAscMathMainType.Matrix ] = [this.textMatrix, 4, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Symbol ] = [this.textSymbols, 11];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Fraction ] = [this.textFraction, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Script ] = [this.textScript, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Radical ] = [this.textRadical, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Integral ] = [this.textIntegral, 3, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.LargeOperator] = [this.textLargeOperator, 5, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Bracket ] = [this.textBracket, 4, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Function ] = [this.textFunction, 3, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Accent ] = [this.textAccent, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.LimitLog ] = [this.textLimitAndLog, 3];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Operator ] = [this.textOperator, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Matrix ] = [this.textMatrix, 4, true];
// equations sub groups
// equations types
var translationTable = {}, name = '', translate = '';
for (name in DE.define.c_oAscMathType) {
if (DE.define.c_oAscMathType.hasOwnProperty(name)) {
for (name in Common.define.c_oAscMathType) {
if (Common.define.c_oAscMathType.hasOwnProperty(name)) {
var arr = name.split('_');
if (arr.length==2 && arr[0]=='Symbol') {
translate = 'txt' + arr[0] + '_' + arr[1].toLocaleLowerCase();
} else
translate = 'txt' + name;
translationTable[DE.define.c_oAscMathType[name]] = this[translate];
translationTable[Common.define.c_oAscMathType[name]] = this[translate];
}
}
@ -2554,7 +2554,7 @@ define([
me.api.SetMarkerFormat(true, true, parseInt(r, 16), parseInt(g, 16), parseInt(b, 16));
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnHighlightColor);
Common.component.Analytics.trackEvent('ToolBar', 'Highlight Color');
},
@ -2592,8 +2592,8 @@ define([
});
},
onApiCoAuthoringDisconnect: function() {
this.toolbar.setMode({isDisconnected:true});
onApiCoAuthoringDisconnect: function(disableDownload) {
this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload});
this.editMode = false;
},

View file

@ -1,7 +1,7 @@
<div class="statusbar" style="display:table;">
<div class="status-group dropup">
<label id="label-pages" class="status-label" style="margin-left: 40px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
<label id="label-pages" class="status-label dropdown-toggle" style="margin-left: 40px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
<div id="status-goto-box" class="dropdown-menu">
<label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>
<div id="status-goto-page" style="display:inline-block;"></div>

View file

@ -105,10 +105,8 @@ define([
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -307,6 +305,7 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
_ChartWrapStyleChanged: function(style) {

View file

@ -215,6 +215,7 @@ define([
applyMode: function() {
this.items[5][this.mode.canPrint?'show':'hide']();
this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.items[7][this.mode.canOpenRecent?'show':'hide']();
this.items[8][this.mode.canCreateNew?'show':'hide']();
this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
@ -261,8 +262,7 @@ define([
this.panels['help'].setLangConfig(this.mode.lang);
this.items[11][this.mode.canUseHistory?'show':'hide']();
this.items[11].setDisabled(this.mode.isDisconnected);
this.items[11][this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
},
setMode: function(mode, delay) {
@ -271,6 +271,8 @@ define([
this.mode.canOpenRecent = this.mode.canCreateNew = false;
this.mode.isDisconnected = mode.isDisconnected;
this.mode.canRename = false;
this.mode.canPrint = false;
this.mode.canDownload = this.mode.canDownloadOrigin = false;
} else {
this.mode = mode;
}

View file

@ -94,10 +94,8 @@ define([
},
ChangeSettings: function(prop) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -244,6 +242,7 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
setLocked: function (locked) {

View file

@ -182,13 +182,12 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);

View file

@ -380,13 +380,13 @@ define([
this.cmbMergeTo.setValue(this._arrMergeSrc[0].value);
}
}
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedControls();
this._initSettings = false;
}
this.disableInsertControls(this._locked);

View file

@ -276,10 +276,8 @@ define([
},
ChangeSettings: function(prop) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
this.hideTextOnlySettings(this.isChart);
@ -397,6 +395,7 @@ define([
createDelayedElements: function() {
this.UpdateThemeColors();
this.updateMetricUnit();
this._initSettings = false;
},
openAdvancedSettings: function(e) {

View file

@ -258,7 +258,7 @@ define([
this._settings[type].btn.toggle(true, false);
this._settings[type].btn.trigger('click', this._settings[type].btn);
} else {
var target_pane = $("#" + this._settings[type].panel );
var target_pane = this.$el.find("#" + this._settings[type].panel );
if ( !target_pane.hasClass('active') ) {
target_pane.parent().find('> .active').removeClass('active');
target_pane.addClass("active");
@ -271,7 +271,7 @@ define([
},
GetActivePane: function() {
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
},
clearSelection: function() {

View file

@ -764,7 +764,6 @@ define([
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props && props.get_ShapeProperties())
{
@ -1450,6 +1449,7 @@ define([
this.fillAutoShapes();
this.UpdateThemeColors();
this._initSettings = false;
},
onInitStandartTextures: function(texture) {

View file

@ -417,6 +417,7 @@ define([
usertip.setContent();
}
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
},

View file

@ -423,12 +423,12 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.UpdateThemeColors();
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
this.disableControls(this._locked);

View file

@ -515,7 +515,6 @@ define([
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props && props.get_ShapeProperties() && props.get_ShapeProperties().get_TextArtProperties())
{
@ -965,6 +964,7 @@ define([
this.createDelayedControls();
this.UpdateThemeColors();
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
this._initSettings = false;
},
fillTextArt: function() {

View file

@ -1517,6 +1517,8 @@ define([
this.cmbFontName.setDisabled(true);
this.cmbFontSize.setDisabled(true);
this.listStyles.setDisabled(true);
if (mode.disableDownload)
this.btnPrint.setDisabled(true);
}
this.mode = mode;

View file

@ -210,7 +210,7 @@
"DE.Controllers.Main.errorUpdateVersion": "Die Dateiversion wurde geändert. Die Seite wird neu geladen.",
"DE.Controllers.Main.errorUserDrop": "Kein Zugriff auf diese Datei ist möglich.",
"DE.Controllers.Main.errorUsersExceed": "Die nach dem Zahlungsplan erlaubte Anzahl der Benutzer ist überschritten",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"DE.Controllers.Main.leavePageText": "Dieses Dokument enthält ungespeicherte Änderungen. Klicken Sie auf \"Auf dieser Seite bleiben\" und dann auf \"Speichern\", um sie zu speichern. Klicken Sie auf \"Diese Seite verlassen\", um alle nicht gespeicherten Änderungen zu verwerfen.\n",
"DE.Controllers.Main.loadFontsTextText": "Daten werden geladen...",
"DE.Controllers.Main.loadFontsTitleText": "Daten werden geladen",

View file

@ -198,8 +198,6 @@
"DE.Controllers.Main.applyChangesTextText": "Loading the changes...",
"DE.Controllers.Main.applyChangesTitleText": "Loading the Changes",
"del_DE.Controllers.Main.convertationErrorText": "Conversion failed.",
"DE.Controllers.Main.openErrorText": "An error has occurred while opening the file",
"DE.Controllers.Main.saveErrorText": "An error has occurred while saving the file",
"DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
"DE.Controllers.Main.criticalErrorExtText": "Press \"OK\" to return to document list.",
"DE.Controllers.Main.criticalErrorTitle": "Error",
@ -224,7 +222,7 @@
"DE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
"DE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.",
"DE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"DE.Controllers.Main.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.",
"DE.Controllers.Main.loadFontsTextText": "Loading data...",
"DE.Controllers.Main.loadFontsTitleText": "Loading Data",

View file

@ -210,7 +210,7 @@
"DE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.",
"DE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.",
"DE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"DE.Controllers.Main.leavePageText": "Hay cambios no guardados en este documento. Haga clic en 'Permanecer en esta página', después 'Guardar' para guardarlos. Haga clic en 'Abandonar esta página' para descartar todos los cambios no guardados.",
"DE.Controllers.Main.loadFontsTextText": "Cargando datos...",
"DE.Controllers.Main.loadFontsTitleText": "Cargando datos",

View file

@ -210,7 +210,7 @@
"DE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.",
"DE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier",
"DE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"DE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans ce document. Cliquez sur 'Rester sur cette page', ensuite sur 'Enregistrer' pour enregistrer les modifications. Cliquez sur 'Quitter cette page' pour annuler toutes les modifications non enregistrées.",
"DE.Controllers.Main.loadFontsTextText": "Chargement des données...",
"DE.Controllers.Main.loadFontsTitleText": "Chargement des données",

View file

@ -169,7 +169,7 @@
font-size: 12px;
> label {
white-space: initial;
white-space: normal;
}
#status-users-list {

View file

@ -119,7 +119,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onThumbnailsShow', _.bind(this.onThumbnailsShow, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
@ -344,7 +344,7 @@ define([
// this.api.asc_selectSearchingResults(false);
},
onApiServerDisconnect: function() {
onApiServerDisconnect: function(disableDownload) {
this.mode.isEdit = false;
this.leftMenu.close();
@ -354,7 +354,7 @@ define([
/** coauthoring end **/
this.leftMenu.btnPlugins.setDisabled(true);
this.leftMenu.getMenu('file').setMode({isDisconnected: true});
this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload});
if ( this.dlgSearch ) {
this.leftMenu.btnSearch.toggle(false, true);
this.dlgSearch['hide']();

View file

@ -151,8 +151,10 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) {
if (!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
@ -651,18 +653,19 @@ define([
if (window.styles_loaded) {
clearInterval(timer_sl);
toolbarController.getView('Toolbar').createDelayedElements();
toolbarController.createDelayedElements();
documentHolderController.getView('DocumentHolder').createDelayedElements();
rightmenuController.createDelayedElements();
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me));
me.api.asc_registerCallback('asc_onUpdateLayout', _.bind(me.fillLayoutsStore, me)); // slide layouts loading
me.updateThemeColors();
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
rightmenuController.createDelayedElements();
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me));
me.fillTextArt(me.api.asc_getTextArtPreviews());
toolbarController.activateControls();
if (me.needToUpdateVersion)
@ -730,6 +733,9 @@ define([
return;
}
if (params.asc_getRights() !== Asc.c_oRights.Edit)
this.permissions.edit = false;
this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
this.appOptions.isLightVersion = params.asc_getIsLight();
@ -963,7 +969,7 @@ define([
break;
case Asc.c_oAscError.ID.CoAuthoringDisconnect:
config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect;
config.msg = this.errorViewerDisconnect;
break;
case Asc.c_oAscError.ID.ConvertationPassword:
@ -1779,7 +1785,7 @@ define([
textNoLicenseTitle: 'ONLYOFFICE open source version',
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',

View file

@ -148,14 +148,15 @@ define([
}
}
var lastactive = -1, currentactive, priorityactive = -1;
var lastactive = -1, currentactive, priorityactive = -1,
activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; i++) {
var pnl = this._settings[i];
if (pnl===undefined) continue;
if ( pnl.hidden ) {
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
if (this.rightmenu.GetActivePane() == pnl.panelId)
if (activePane == pnl.panelId)
currentactive = -1;
} else {
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
@ -165,7 +166,7 @@ define([
pnl.needShow = false;
priorityactive = i;
} else if ( i != Common.Utils.documentSettingsType.Slide || this.rightmenu._settings[i].isCurrent) {
if (this.rightmenu.GetActivePane() == pnl.panelId)
if (activePane == pnl.panelId)
currentactive = i;
}
@ -245,6 +246,7 @@ define([
if (this.editMode && this.api) {
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
this.rightmenu.shapeSettings.createDelayedElements();
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0) {
var open = Common.localStorage.getItem("pe-hide-right-settings");

View file

@ -171,7 +171,7 @@ define([
// Create toolbar view
this.toolbar = this.createView('Toolbar');
this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this));
// this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this));
},
onToolbarAfterRender: function(toolbar) {
@ -278,7 +278,7 @@ define([
this.api.asc_registerCallback('asc_onCanUnGroup', _.bind(this.onApiCanUnGroup, this));
this.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onZoomChange', _.bind(this.onApiZoomChange, this));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
@ -684,8 +684,8 @@ define([
this.toolbar.lockToolbar(PE.enumLock.themeLock, false, {array: [this.toolbar.btnColorSchemas]});
},
onApiCoAuthoringDisconnect: function() {
this.toolbar.setMode({isDisconnected:true});
onApiCoAuthoringDisconnect: function(disableDownload) {
this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload});
this.editMode = false;
},
@ -699,6 +699,7 @@ define([
$('.menu-zoom .zoom', this.toolbar.el).html(percent + '%');
this._state.zoom_percent = percent;
}
this.toolbar.mnuZoom.options.value = percent;
},
onApiInitEditorStyles: function(themes) {
@ -1829,6 +1830,11 @@ define([
}
},
createDelayedElements: function() {
this.toolbar.createDelayedElements();
this.onToolbarAfterRender(this.toolbar);
},
textEmptyImgUrl : 'You need to specify image URL.',
textWarning : 'Warning',
textFontSizeErr : 'The entered value must be more than 0',

View file

@ -2,7 +2,7 @@
<div class="statusbar" style="display:table;">
<div class="status-group dropup">
<button id="status-btn-preview" type="button" class="btn small btn-toolbar" style="margin-left: 9px;"><span class="btn-icon">&nbsp;</span></button>
<label id="status-label-pages" class="status-label" style="margin-left: 7px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
<label id="status-label-pages" class="status-label dropdown-toggle" style="margin-left: 7px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
<div id="status-goto-box" class="dropdown-menu">
<label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>
<div id="status-goto-page" style="display:inline-block;"></div>

View file

@ -62,7 +62,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
@ -83,148 +82,6 @@ define([
this._originalProps = null;
this.render();
this.btnChartType = new Common.UI.Button({
cls : 'btn-large-dataview',
iconCls : 'item-chartlist bar-normal',
menu : new Common.UI.Menu({
style: 'width: 560px;',
items: [
{ template: _.template('<div id="id-chart-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
]
})
});
this.btnChartType.on('render:after', function(btn) {
me.mnuChartTypePicker = new Common.UI.DataView({
el: $('#id-chart-menu-type'),
parentMenu: btn.menu,
restoreHeight: 411,
groups: new Common.UI.DataViewGroupStore([
{ id: 'menu-chart-group-bar', caption: me.textColumn },
{ id: 'menu-chart-group-line', caption: me.textLine },
{ id: 'menu-chart-group-pie', caption: me.textPie },
{ id: 'menu-chart-group-hbar', caption: me.textBar },
{ id: 'menu-chart-group-area', caption: me.textArea },
{ id: 'menu-chart-group-scatter', caption: me.textPoint },
{ id: 'menu-chart-group-stock', caption: me.textStock }
]),
store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal', selected: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
});
});
this.btnChartType.render($('#chart-button-type'));
this.mnuChartTypePicker.on('item:click', _.bind(this.onSelectType, this, this.btnChartType));
this.lockedControls.push(this.btnChartType);
this.btnChartStyle = new Common.UI.Button({
cls : 'btn-large-dataview',
iconCls : 'item-wrap',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-chart-menu-style" style="width: 245px; margin: 0 5px;"></div>') }
]
})
});
this.btnChartStyle.on('render:after', function(btn) {
me.mnuChartStylePicker = new Common.UI.DataView({
el: $('#id-chart-menu-style'),
style: 'max-height: 411px;',
parentMenu: btn.menu,
store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="item-wrap" style="background-image: url(<%= imageUrl %>); background-position: 0 0;"></div>')
});
if (me.btnChartStyle.menu) {
me.btnChartStyle.menu.on('show:after', function () {
me.mnuChartStylePicker.scroller.update({alwaysVisibleY: true});
});
}
});
this.btnChartStyle.render($('#chart-button-style'));
this.mnuChartStylePicker.on('item:click', _.bind(this.onSelectStyle, this, this.btnChartStyle));
this.lockedControls.push(this.btnChartStyle);
this.btnEditData = new Common.UI.Button({
el: $('#chart-button-edit-data')
});
this.btnEditData.on('click', _.bind(this.setEditData, this));
this.lockedControls.push(this.btnEditData);
this.spnWidth = new Common.UI.MetricSpinner({
el: $('#chart-spin-width'),
step: .1,
width: 78,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spinners.push(this.spnWidth);
this.lockedControls.push(this.spnWidth);
this.spnHeight = new Common.UI.MetricSpinner({
el: $('#chart-spin-height'),
step: .1,
width: 78,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spinners.push(this.spnHeight);
this.lockedControls.push(this.spnHeight);
this.spnWidth.on('change', _.bind(this.onWidthChange, this));
this.spnHeight.on('change', _.bind(this.onHeightChange, this));
this.btnRatio = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: 'advanced-btn-ratio',
style: 'margin-bottom: 1px;',
enableToggle: true,
hint: this.textKeepRatio
});
this.btnRatio.render($('#chart-button-ratio')) ;
this.lockedControls.push(this.btnRatio);
this.btnRatio.on('click', _.bind(function(btn, e) {
if (btn.pressed && this.spnHeight.getNumberValue()>0) {
this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue();
}
if (this.api) {
var props = new Asc.CAscChartProp();
props.asc_putLockAspect(btn.pressed);
this.api.ChartApply(props);
}
this.fireEvent('editcomplete', this);
}, this));
},
render: function () {
@ -243,10 +100,8 @@ define([
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -333,8 +188,127 @@ define([
}
},
createDelayedControls: function() {
var me = this;
this.btnChartType = new Common.UI.Button({
cls : 'btn-large-dataview',
iconCls : 'item-chartlist bar-normal',
menu : new Common.UI.Menu({
style: 'width: 560px;',
items: [
{ template: _.template('<div id="id-chart-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
]
})
});
this.btnChartType.on('render:after', function(btn) {
me.mnuChartTypePicker = new Common.UI.DataView({
el: $('#id-chart-menu-type'),
parentMenu: btn.menu,
restoreHeight: 411,
groups: new Common.UI.DataViewGroupStore([
{ id: 'menu-chart-group-bar', caption: me.textColumn },
{ id: 'menu-chart-group-line', caption: me.textLine },
{ id: 'menu-chart-group-pie', caption: me.textPie },
{ id: 'menu-chart-group-hbar', caption: me.textBar },
{ id: 'menu-chart-group-area', caption: me.textArea },
{ id: 'menu-chart-group-scatter', caption: me.textPoint },
{ id: 'menu-chart-group-stock', caption: me.textStock }
]),
store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal', selected: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
});
});
this.btnChartType.render($('#chart-button-type'));
this.mnuChartTypePicker.on('item:click', _.bind(this.onSelectType, this, this.btnChartType));
this.lockedControls.push(this.btnChartType);
this.btnEditData = new Common.UI.Button({
el: $('#chart-button-edit-data')
});
this.btnEditData.on('click', _.bind(this.setEditData, this));
this.lockedControls.push(this.btnEditData);
this.spnWidth = new Common.UI.MetricSpinner({
el: $('#chart-spin-width'),
step: .1,
width: 78,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spinners.push(this.spnWidth);
this.lockedControls.push(this.spnWidth);
this.spnHeight = new Common.UI.MetricSpinner({
el: $('#chart-spin-height'),
step: .1,
width: 78,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spinners.push(this.spnHeight);
this.lockedControls.push(this.spnHeight);
this.spnWidth.on('change', _.bind(this.onWidthChange, this));
this.spnHeight.on('change', _.bind(this.onHeightChange, this));
this.btnRatio = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: 'advanced-btn-ratio',
style: 'margin-bottom: 1px;',
enableToggle: true,
hint: this.textKeepRatio
});
this.btnRatio.render($('#chart-button-ratio')) ;
this.lockedControls.push(this.btnRatio);
this.btnRatio.on('click', _.bind(function(btn, e) {
if (btn.pressed && this.spnHeight.getNumberValue()>0) {
this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue();
}
if (this.api) {
var props = new Asc.CAscChartProp();
props.asc_putLockAspect(btn.pressed);
this.api.ChartApply(props);
}
this.fireEvent('editcomplete', this);
}, this));
},
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
setEditData: function() {
@ -415,6 +389,36 @@ define([
updateChartStyles: function(styles) {
var me = this;
if (!this.btnChartStyle) {
this.btnChartStyle = new Common.UI.Button({
cls : 'btn-large-dataview',
iconCls : 'item-wrap',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-chart-menu-style" style="width: 245px; margin: 0 5px;"></div>') }
]
})
});
this.btnChartStyle.render($('#chart-button-style'));
this.lockedControls.push(this.btnChartStyle);
this.mnuChartStylePicker = new Common.UI.DataView({
el: $('#id-chart-menu-style'),
style: 'max-height: 411px;',
parentMenu: this.btnChartStyle.menu,
store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="item-wrap" style="background-image: url(<%= imageUrl %>); background-position: 0 0;"></div>')
});
if (this.btnChartStyle.menu) {
this.btnChartStyle.menu.on('show:after', function () {
me.mnuChartStylePicker.scroller.update({alwaysVisibleY: true});
});
}
this.mnuChartStylePicker.on('item:click', _.bind(this.onSelectStyle, this, this.btnChartStyle));
}
if (styles && styles.length>0){
var stylesStore = this.mnuChartStylePicker.store;
if (stylesStore) {
@ -493,6 +497,8 @@ define([
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {

View file

@ -78,7 +78,7 @@ define([
'<div class="separator"/>',
'</div>',
'<div class="preview-group dropup">',
'<label id="preview-label-slides" class="status-label" data-toggle="dropdown">Slide 1 of 1</label>',
'<label id="preview-label-slides" class="status-label dropdown-toggle" data-toggle="dropdown">Slide 1 of 1</label>',
'<div id="preview-goto-box" class="dropdown-menu">',
'<label style="float:left;line-height:22px;">' + this.goToSlideText + '</label>',
'<div id="preview-goto-page" style="display:inline-block;"></div>',

View file

@ -212,6 +212,7 @@ define([
applyMode: function() {
this.items[5][this.mode.canPrint?'show':'hide']();
this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.items[7][this.mode.canOpenRecent?'show':'hide']();
this.items[8][this.mode.canCreateNew?'show':'hide']();
this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
@ -258,7 +259,10 @@ define([
if (mode.isDisconnected) {
this.mode.canEdit = this.mode.isEdit = false;
this.mode.canOpenRecent = this.mode.canCreateNew = false;
this.mode.isDisconnected = mode.isDisconnected;
this.mode.canRename = false;
this.mode.canPrint = false;
this.mode.canDownload = false;
} else {
this.mode = mode;
}

View file

@ -64,7 +64,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
@ -83,7 +82,29 @@ define([
this.labelWidth = $(this.el).find('#image-label-width');
this.labelHeight = $(this.el).find('#image-label-height');
},
render: function () {
var el = $(this.el);
el.html(this.template({
scope: this
}));
},
setApi: function(api) {
this.api = api;
return this;
},
updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
},
createDelayedControls: function() {
this.btnOriginalSize = new Common.UI.Button({
el: $('#image-button-original-size')
});
@ -114,41 +135,21 @@ define([
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
this.fireEvent('editcomplete', this);
}, this));
$(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this));
},
render: function () {
var el = $(this.el);
el.html(this.template({
scope: this
}));
this.linkAdvanced = $('#image-advanced-link');
this.lblReplace = $('#image-lbl-replace');
},
setApi: function(api) {
this.api = api;
return this;
},
updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
$(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this));
},
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -269,6 +270,8 @@ define([
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {

View file

@ -64,7 +64,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
@ -79,68 +78,6 @@ define([
this._locked = false;
this.render();
this._arrLineRule = [
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
];
// Short Size
this.cmbLineRule = new Common.UI.ComboBox({
el: $('#paragraph-combo-line-rule'),
cls: 'input-group-nr',
menuStyle: 'min-width: 85px;',
editable: false,
data: this._arrLineRule
});
this.cmbLineRule.setValue(c_paragraphLinerule.LINERULE_AUTO);
this.lockedControls.push(this.cmbLineRule);
this.numLineHeight = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-line-height'),
step: .01,
width: 85,
value: '1.5',
defaultUnit : "",
maxValue: 132,
minValue: 0.5
});
this.lockedControls.push(this.numLineHeight);
this.numSpacingBefore = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-spacing-before'),
step: .1,
width: 85,
value: '0 cm',
defaultUnit : "cm",
maxValue: 55.88,
minValue: 0,
allowAuto : true,
autoText : this.txtAutoText
});
this.spinners.push(this.numSpacingBefore);
this.lockedControls.push(this.numSpacingBefore);
this.numSpacingAfter = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-spacing-after'),
step: .1,
width: 85,
value: '0.35 cm',
defaultUnit : "cm",
maxValue: 55.88,
minValue: 0,
allowAuto : true,
autoText : this.txtAutoText
});
this.spinners.push(this.numSpacingAfter);
this.lockedControls.push(this.numSpacingAfter);
this.numLineHeight.on('change', _.bind(this.onNumLineHeightChange, this));
this.numSpacingBefore.on('change', _.bind(this.onNumSpacingBeforeChange, this));
this.numSpacingAfter.on('change', _.bind(this.onNumSpacingAfterChange, this));
this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
this.cmbLineRule.on('hide:after', _.bind(this.onHideMenus, this));
$(this.el).on('click', '#paragraph-advanced-link', _.bind(this.openAdvancedSettings, this));
},
render: function () {
@ -200,6 +137,8 @@ define([
},
_onLineSpacing: function(value) {
if (this._initSettings) return;
var linerule = value.get_LineRule();
var line = value.get_Line();
@ -229,10 +168,8 @@ define([
},
ChangeSettings: function(prop) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -297,22 +234,92 @@ define([
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
}
}
var rec = this.cmbLineRule.store.at(1);
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});
if (this.cmbLineRule) {
var rec = this.cmbLineRule.store.at(1);
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});
if (this._state.LineRule !== null) {
var obj;
rec = this.cmbLineRule.store.findWhere((obj={}, obj['value']=this._state.LineRule, obj));
if (!rec) rec = this.cmbLineRule.store.at(0);
this.numLineHeight.setDefaultUnit(rec.get('defaultUnit'));
this.numLineHeight.setStep(rec.get('step'));
if (this._state.LineRule !== null) {
var obj;
rec = this.cmbLineRule.store.findWhere((obj={}, obj['value']=this._state.LineRule, obj));
if (!rec) rec = this.cmbLineRule.store.at(0);
this.numLineHeight.setDefaultUnit(rec.get('defaultUnit'));
this.numLineHeight.setStep(rec.get('step'));
}
}
},
createDelayedControls: function() {
var me = this;
this._arrLineRule = [
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
];
// Short Size
this.cmbLineRule = new Common.UI.ComboBox({
el: $('#paragraph-combo-line-rule'),
cls: 'input-group-nr',
menuStyle: 'min-width: 85px;',
editable: false,
data: this._arrLineRule
});
this.cmbLineRule.setValue(c_paragraphLinerule.LINERULE_AUTO);
this.lockedControls.push(this.cmbLineRule);
this.numLineHeight = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-line-height'),
step: .01,
width: 85,
value: '1.5',
defaultUnit : "",
maxValue: 132,
minValue: 0.5
});
this.lockedControls.push(this.numLineHeight);
this.numSpacingBefore = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-spacing-before'),
step: .1,
width: 85,
value: '0 cm',
defaultUnit : "cm",
maxValue: 55.88,
minValue: 0,
allowAuto : true,
autoText : this.txtAutoText
});
this.spinners.push(this.numSpacingBefore);
this.lockedControls.push(this.numSpacingBefore);
this.numSpacingAfter = new Common.UI.MetricSpinner({
el: $('#paragraph-spin-spacing-after'),
step: .1,
width: 85,
value: '0.35 cm',
defaultUnit : "cm",
maxValue: 55.88,
minValue: 0,
allowAuto : true,
autoText : this.txtAutoText
});
this.spinners.push(this.numSpacingAfter);
this.lockedControls.push(this.numSpacingAfter);
this.numLineHeight.on('change', _.bind(this.onNumLineHeightChange, this));
this.numSpacingBefore.on('change', _.bind(this.onNumSpacingBeforeChange, this));
this.numSpacingAfter.on('change', _.bind(this.onNumSpacingAfterChange, this));
this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
this.cmbLineRule.on('hide:after', _.bind(this.onHideMenus, this));
$(this.el).on('click', '#paragraph-advanced-link', _.bind(this.openAdvancedSettings, this));
},
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
openAdvancedSettings: function(e) {
@ -357,6 +364,8 @@ define([
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {

View file

@ -254,7 +254,7 @@ define([
},
GetActivePane: function() {
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
},
SetDisabled: function(id, disabled, all) {

View file

@ -71,7 +71,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._originalProps = null;
this._noApply = true;
@ -123,349 +122,6 @@ define([
this.render();
this._arrFillSrc = [
{displayValue: this.textColor, value: Asc.c_oAscFill.FILL_TYPE_SOLID},
{displayValue: this.textGradientFill, value: Asc.c_oAscFill.FILL_TYPE_GRAD},
{displayValue: this.textImageTexture, value: Asc.c_oAscFill.FILL_TYPE_BLIP},
{displayValue: this.textPatternFill, value: Asc.c_oAscFill.FILL_TYPE_PATT},
{displayValue: this.textNoFill, value: Asc.c_oAscFill.FILL_TYPE_NOFILL}
];
this.cmbFillSrc = new Common.UI.ComboBox({
el: $('#shape-combo-fill-src'),
cls: 'input-group-nr',
style: 'width: 100%;',
menuStyle: 'min-width: 190px;',
editable: false,
data: this._arrFillSrc
});
this.cmbFillSrc.setValue(this._arrFillSrc[0].value);
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this.fillControls.push(this.cmbFillSrc);
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-back-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBackColor.on('render:after', function(btn) {
me.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#shape-back-color-menu'),
value: 'transparent',
transparent: true
});
me.colorsBack.on('select', _.bind(me.onColorsBackSelect, me));
});
this.btnBackColor.render( $('#shape-back-color-btn'));
this.btnBackColor.setColor('transparent');
$(this.el).on('click', '#shape-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.fillControls.push(this.btnBackColor);
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#shape-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.cmbPattern.openButton.menu.on('show:after', function () {
me.cmbPattern.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.fillControls.push(this.cmbPattern);
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-foreground-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnFGColor.on('render:after', function(btn) {
me.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#shape-foreground-color-menu'),
value: '000000'
});
me.colorsFG.on('select', _.bind(me.onColorsFGSelect, me));
});
this.btnFGColor.render( $('#shape-foreground-color-btn'));
this.btnFGColor.setColor('000000');
$(this.el).on('click', '#shape-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.fillControls.push(this.btnFGColor);
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-background-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBGColor.on('render:after', function(btn) {
me.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#shape-background-color-menu'),
value: 'ffffff'
});
me.colorsBG.on('select', _.bind(me.onColorsBGSelect, me));
});
this.btnBGColor.render( $('#shape-background-color-btn'));
this.btnBGColor.setColor('ffffff');
$(this.el).on('click', '#shape-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.fillControls.push(this.btnBGColor);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#shape-button-from-file')
});
this.fillControls.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#shape-button-from-url')
});
this.fillControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeShapeImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#shape-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.fillControls.push(this.cmbFillType);
this.btnTexture = new Common.UI.ComboBox({
el: $('#shape-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#shape-combo-fill-texture'));
this.fillControls.push(this.btnTexture);
this.numTransparency = new Common.UI.MetricSpinner({
el: $('#shape-spin-transparency'),
step: 1,
width: 62,
value: '100 %',
defaultUnit : "%",
maxValue: 100,
minValue: 0
});
this.numTransparency.on('change', _.bind(this.onNumTransparencyChange, this));
this.fillControls.push(this.numTransparency);
this.sldrTransparency = new Common.UI.SingleSlider({
el: $('#shape-slider-transparency'),
width: 75,
minValue: 0,
maxValue: 100,
value: 100
});
this.sldrTransparency.on('change', _.bind(this.onTransparencyChange, this));
this.sldrTransparency.on('changecomplete', _.bind(this.onTransparencyChangeComplete, this));
this.fillControls.push(this.sldrTransparency);
this.lblTransparencyStart = $(this.el).find('#shape-lbl-transparency-start');
this.lblTransparencyEnd = $(this.el).find('#shape-lbl-transparency-end');
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#shape-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.fillControls.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-shape-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-shape-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#shape-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.fillControls.push(this.btnDirection);
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-gradient-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnGradColor.on('render:after', function(btn) {
me.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#shape-gradient-color-menu'),
value: '000000'
});
me.colorsGrad.on('select', _.bind(me.onColorsGradientSelect, me));
});
this.btnGradColor.render( $('#shape-gradient-color-btn'));
this.btnGradColor.setColor('000000');
$(this.el).on('click', '#shape-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.fillControls.push(this.btnGradColor);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#shape-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.fillControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#shape-combo-border-size'),
style: "width: 93px;",
txtNoBorders: this.txtNoBorders
})
.on('selected', _.bind(this.onBorderSizeSelect, this))
.on('changed:before',_.bind(this.onBorderSizeChanged, this, true))
.on('changed:after', _.bind(this.onBorderSizeChanged, this, false))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.lockedControls.push(this.cmbBorderSize);
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-border-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBorderColor.on('render:after', function(btn) {
me.colorsBorder = new Common.UI.ThemeColorPalette({
el: $('#shape-border-color-menu'),
value: '000000'
});
me.colorsBorder.on('select', _.bind(me.onColorsBorderSelect, me));
});
this.btnBorderColor.render( $('#shape-border-color-btn'));
this.btnBorderColor.setColor('000000');
$(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.lockedControls.push(this.btnBorderColor);
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#shape-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.btnChangeShape = new Common.UI.Button({
cls: 'btn-icon-default',
iconCls: 'btn-change-shape',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
cls: 'menu-shapes',
items: []
})
});
this.btnChangeShape.render( $('#shape-btn-change')) ;
this.lockedControls.push(this.btnChangeShape);
$(this.el).on('click', '#shape-advanced-link', _.bind(this.openAdvancedSettings, this));
this.FillColorContainer = $('#shape-panel-color-fill');
this.FillImageContainer = $('#shape-panel-image-fill');
this.FillPatternContainer = $('#shape-panel-pattern-fill');
@ -480,8 +136,6 @@ define([
el.html(this.template({
scope: this
}));
this.linkAdvanced = $('#shape-advanced-link');
},
setApi: function(api) {
@ -1024,7 +678,6 @@ define([
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props)
{
@ -1402,7 +1055,229 @@ define([
}
},
createDelayedControls: function() {
var me = this;
this._arrFillSrc = [
{displayValue: this.textColor, value: Asc.c_oAscFill.FILL_TYPE_SOLID},
{displayValue: this.textGradientFill, value: Asc.c_oAscFill.FILL_TYPE_GRAD},
{displayValue: this.textImageTexture, value: Asc.c_oAscFill.FILL_TYPE_BLIP},
{displayValue: this.textPatternFill, value: Asc.c_oAscFill.FILL_TYPE_PATT},
{displayValue: this.textNoFill, value: Asc.c_oAscFill.FILL_TYPE_NOFILL}
];
this.cmbFillSrc = new Common.UI.ComboBox({
el: $('#shape-combo-fill-src'),
cls: 'input-group-nr',
style: 'width: 100%;',
menuStyle: 'min-width: 190px;',
editable: false,
data: this._arrFillSrc
});
this.cmbFillSrc.setValue(this._arrFillSrc[0].value);
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this.fillControls.push(this.cmbFillSrc);
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#shape-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.cmbPattern.openButton.menu.on('show:after', function () {
me.cmbPattern.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.fillControls.push(this.cmbPattern);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#shape-button-from-file')
});
this.fillControls.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#shape-button-from-url')
});
this.fillControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeShapeImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#shape-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.fillControls.push(this.cmbFillType);
this.numTransparency = new Common.UI.MetricSpinner({
el: $('#shape-spin-transparency'),
step: 1,
width: 62,
value: '100 %',
defaultUnit : "%",
maxValue: 100,
minValue: 0
});
this.numTransparency.on('change', _.bind(this.onNumTransparencyChange, this));
this.fillControls.push(this.numTransparency);
this.sldrTransparency = new Common.UI.SingleSlider({
el: $('#shape-slider-transparency'),
width: 75,
minValue: 0,
maxValue: 100,
value: 100
});
this.sldrTransparency.on('change', _.bind(this.onTransparencyChange, this));
this.sldrTransparency.on('changecomplete', _.bind(this.onTransparencyChangeComplete, this));
this.fillControls.push(this.sldrTransparency);
this.lblTransparencyStart = $(this.el).find('#shape-lbl-transparency-start');
this.lblTransparencyEnd = $(this.el).find('#shape-lbl-transparency-end');
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#shape-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.fillControls.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-shape-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-shape-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#shape-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.fillControls.push(this.btnDirection);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#shape-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.fillControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#shape-combo-border-size'),
style: "width: 93px;",
txtNoBorders: this.txtNoBorders
})
.on('selected', _.bind(this.onBorderSizeSelect, this))
.on('changed:before',_.bind(this.onBorderSizeChanged, this, true))
.on('changed:after', _.bind(this.onBorderSizeChanged, this, false))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.lockedControls.push(this.cmbBorderSize);
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#shape-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.btnChangeShape = new Common.UI.Button({
cls: 'btn-icon-default',
iconCls: 'btn-change-shape',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
cls: 'menu-shapes',
items: []
})
});
this.btnChangeShape.render( $('#shape-btn-change')) ;
this.lockedControls.push(this.btnChangeShape);
this.linkAdvanced = $('#shape-advanced-link');
$(this.el).on('click', '#shape-advanced-link', _.bind(this.openAdvancedSettings, this));
},
createDelayedElements: function() {
this.createDelayedControls();
var global_hatch_menu_map = [
0,1,3,2,4,
53,5,6,7,8,
@ -1434,14 +1309,33 @@ define([
this.PatternFillType = this.patternViewData[0].type;
}
this.fillAutoShapes();
this.UpdateThemeColors();
this._initSettings = false;
},
onInitStandartTextures: function(texture) {
var me = this;
if (texture && texture.length>0){
if (!this.btnTexture) {
this.btnTexture = new Common.UI.ComboBox({
el: $('#shape-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#shape-combo-fill-texture'));
this.fillControls.push(this.btnTexture);
}
var texturearray = [];
_.each(texture, function(item){
texturearray.push({
@ -1521,6 +1415,104 @@ define([
},
UpdateThemeColors: function() {
if (!this.btnBackColor) {
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-back-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBackColor.render( $('#shape-back-color-btn'));
this.btnBackColor.setColor('transparent');
this.fillControls.push(this.btnBackColor);
this.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#shape-back-color-menu'),
value: 'transparent',
transparent: true
});
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
$(this.el).on('click', '#shape-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-foreground-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnFGColor.render( $('#shape-foreground-color-btn'));
this.btnFGColor.setColor('000000');
this.fillControls.push(this.btnFGColor);
this.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#shape-foreground-color-menu'),
value: '000000'
});
this.colorsFG.on('select', _.bind(this.onColorsFGSelect, this));
$(this.el).on('click', '#shape-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-background-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBGColor.render( $('#shape-background-color-btn'));
this.btnBGColor.setColor('ffffff');
this.fillControls.push(this.btnBGColor);
this.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#shape-background-color-menu'),
value: 'ffffff'
});
this.colorsBG.on('select', _.bind(this.onColorsBGSelect, this));
$(this.el).on('click', '#shape-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-gradient-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnGradColor.render( $('#shape-gradient-color-btn'));
this.btnGradColor.setColor('000000');
this.fillControls.push(this.btnGradColor);
this.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#shape-gradient-color-menu'),
value: '000000'
});
this.colorsGrad.on('select', _.bind(this.onColorsGradientSelect, this));
$(this.el).on('click', '#shape-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="shape-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="shape-border-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBorderColor.render( $('#shape-border-color-btn'));
this.btnBorderColor.setColor('000000');
this.lockedControls.push(this.btnBorderColor);
this.colorsBorder = new Common.UI.ThemeColorPalette({
el: $('#shape-border-color-menu'),
value: '000000'
});
this.colorsBorder.on('select', _.bind(this.onColorsBorderSelect, this));
$(this.el).on('click', '#shape-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
}
this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
@ -1560,6 +1552,8 @@ define([
},
disableControls: function(disable, disableFill) {
if (this._initSettings) return;
this.disableFillPanels(disable || disableFill);
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;

View file

@ -68,7 +68,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._originalProps = null;
this._noApply = true;
@ -131,241 +130,6 @@ define([
this.cmbFillSrc.setValue('');
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
disabled: true,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-back-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.FillItems.push(this.btnBackColor);
this.btnBackColor.on('render:after', function(btn) {
me.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#slide-back-color-menu'),
value: 'ffffff',
transparent: true
});
me.colorsBack.on('select', _.bind(me.onColorsBackSelect, me));
});
this.btnBackColor.render( $('#slide-back-color-btn'));
this.btnBackColor.setColor('ffffff');
$(this.el).on('click', '#slide-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#slide-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.FillItems.push(this.cmbPattern);
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-foreground-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnFGColor.on('render:after', function(btn) {
me.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#slide-foreground-color-menu'),
value: '000000'
});
me.colorsFG.on('select', _.bind(me.onColorsFGSelect, me));
});
this.btnFGColor.render( $('#slide-foreground-color-btn'));
this.btnFGColor.setColor('000000');
$(this.el).on('click', '#slide-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.FillItems.push(this.btnFGColor);
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-background-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBGColor.on('render:after', function(btn) {
me.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#slide-background-color-menu'),
value: 'ffffff'
});
me.colorsBG.on('select', _.bind(me.onColorsBGSelect, me));
});
this.btnBGColor.render( $('#slide-background-color-btn'));
this.btnBGColor.setColor('ffffff');
$(this.el).on('click', '#slide-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.FillItems.push(this.btnBGColor);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#slide-button-from-file')
});
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeSlideImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.FillItems.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#slide-button-from-url')
});
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.FillItems.push(this.btnInsertFromUrl);
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#slide-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.FillItems.push(this.cmbFillType);
this.btnTexture = new Common.UI.ComboBox({
el: $('#slide-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-slide-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#slide-combo-fill-texture'));
this.FillItems.push(this.btnTexture);
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#slide-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.FillItems.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-slide-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-slide-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#slide-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.FillItems.push(this.btnDirection);
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-gradient-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnGradColor.on('render:after', function(btn) {
me.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#slide-gradient-color-menu'),
value: '000000'
});
me.colorsGrad.on('select', _.bind(me.onColorsGradientSelect, me));
});
this.btnGradColor.render( $('#slide-gradient-color-btn'));
this.btnGradColor.setColor('000000');
$(this.el).on('click', '#slide-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.FillItems.push(this.btnGradColor);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#slide-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.FillItems.push(this.sldrGradient);
this.FillColorContainer = $('#slide-panel-color-fill');
this.FillImageContainer = $('#slide-panel-image-fill');
this.FillPatternContainer = $('#slide-panel-pattern-fill');
@ -862,7 +626,142 @@ define([
})).show();
},
createDelayedControls: function() {
var me = this;
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#slide-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.FillItems.push(this.cmbPattern);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#slide-button-from-file')
});
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeSlideImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.FillItems.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#slide-button-from-url')
});
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.FillItems.push(this.btnInsertFromUrl);
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#slide-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.FillItems.push(this.cmbFillType);
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#slide-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.FillItems.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-slide-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-slide-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#slide-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.FillItems.push(this.btnDirection);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#slide-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.FillItems.push(this.sldrGradient);
},
createDelayedElements: function() {
this.createDelayedControls();
var global_hatch_menu_map = [
0,1,3,2,4,
53,5,6,7,8,
@ -895,11 +794,31 @@ define([
}
this.UpdateThemeColors();
this._initSettings = false;
},
onInitStandartTextures: function(texture) {
var me = this;
if (texture && texture.length>0){
if (!this.btnTexture) {
this.btnTexture = new Common.UI.ComboBox({
el: $('#slide-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-slide-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#slide-combo-fill-texture'));
this.FillItems.push(this.btnTexture);
}
var texturearray = [];
_.each(texture, function(item){
texturearray.push({
@ -1060,6 +979,86 @@ define([
},
UpdateThemeColors: function() {
if (!this.btnBackColor) {
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
disabled: true,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-back-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBackColor.render( $('#slide-back-color-btn'));
this.btnBackColor.setColor('ffffff');
this.FillItems.push(this.btnBackColor);
this.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#slide-back-color-menu'),
value: 'ffffff',
transparent: true
});
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
$(this.el).on('click', '#slide-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-foreground-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnFGColor.render( $('#slide-foreground-color-btn'));
this.btnFGColor.setColor('000000');
this.FillItems.push(this.btnFGColor);
this.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#slide-foreground-color-menu'),
value: '000000'
});
this.colorsFG.on('select', _.bind(this.onColorsFGSelect, this));
$(this.el).on('click', '#slide-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-background-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBGColor.render( $('#slide-background-color-btn'));
this.btnBGColor.setColor('ffffff');
this.FillItems.push(this.btnBGColor);
this.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#slide-background-color-menu'),
value: 'ffffff'
});
this.colorsBG.on('select', _.bind(this.onColorsBGSelect, this));
$(this.el).on('click', '#slide-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="slide-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="slide-gradient-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnGradColor.render( $('#slide-gradient-color-btn'));
this.btnGradColor.setColor('000000');
this.FillItems.push(this.btnGradColor);
this.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#slide-gradient-color-menu'),
value: '000000'
});
this.colorsGrad.on('select', _.bind(this.onColorsGradientSelect, this));
$(this.el).on('click', '#slide-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
}
this.colorsBack.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());
@ -1076,7 +1075,6 @@ define([
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props)
{
@ -1405,6 +1403,8 @@ define([
},
SetSlideDisabled: function(background, effects, timing) {
if (this._initSettings) return;
if (background !== this._stateDisabled.background) {
this.cmbFillSrc.setDisabled(background);
for (var i=0; i<this.FillItems.length; i++) {

View file

@ -321,6 +321,7 @@ define([
usertip.setContent();
}
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
},

View file

@ -69,7 +69,7 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
TemplateId: 0,
@ -93,185 +93,6 @@ define([
this._noApply = false;
this.render();
this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'),
labelText: this.textHeader
});
this.lockedControls.push(this.chHeader);
this.chTotal = new Common.UI.CheckBox({
el: $('#table-checkbox-total'),
labelText: this.textTotal
});
this.lockedControls.push(this.chTotal);
this.chBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chBanded);
this.chFirst = new Common.UI.CheckBox({
el: $('#table-checkbox-first'),
labelText: this.textFirst
});
this.lockedControls.push(this.chFirst);
this.chLast = new Common.UI.CheckBox({
el: $('#table-checkbox-last'),
labelText: this.textLast
});
this.lockedControls.push(this.chLast);
this.chColBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-col-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chColBanded);
this.chHeader.on('change', _.bind(this.onCheckTemplateChange, this, 0));
this.chTotal.on('change', _.bind(this.onCheckTemplateChange, this, 1));
this.chBanded.on('change', _.bind(this.onCheckTemplateChange, this, 2));
this.chFirst.on('change', _.bind(this.onCheckTemplateChange, this, 3));
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, 4));
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, 5));
this.cmbTableTemplate = new Common.UI.ComboDataView({
itemWidth: 70,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-template'
});
this.cmbTableTemplate.render($('#table-combo-template'));
this.cmbTableTemplate.openButton.menu.cmpEl.css({
'min-width': 175,
'max-width': 175
});
this.cmbTableTemplate.on('click', _.bind(this.onTableTemplateSelect, this));
this.cmbTableTemplate.openButton.menu.on('show:after', function () {
me.cmbTableTemplate.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTableTemplate);
var _arrBorderPosition = [
['l', 'btn-borders-small btn-position-left', 'table-button-border-left', this.tipLeft],
['c','btn-borders-small btn-position-inner-vert', 'table-button-border-inner-vert', this.tipInnerVert],
['r','btn-borders-small btn-position-right', 'table-button-border-right', this.tipRight],
['t','btn-borders-small btn-position-top', 'table-button-border-top', this.tipTop],
['m','btn-borders-small btn-position-inner-hor', 'table-button-border-inner-hor', this.tipInnerHor],
['b', 'btn-borders-small btn-position-bottom', 'table-button-border-bottom', this.tipBottom],
['cm', 'btn-borders-small btn-position-inner', 'table-button-border-inner', this.tipInner],
['lrtb', 'btn-borders-small btn-position-outer', 'table-button-border-outer', this.tipOuter],
['lrtbcm', 'btn-borders-small btn-position-all', 'table-button-border-all', this.tipAll],
['', 'btn-borders-small btn-position-none', 'table-button-border-none', this.tipNone]
];
this._btnsBorderPosition = [];
_.each(_arrBorderPosition, function(item, index, list){
var _btn = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: item[1],
strId :item[0],
hint: item[3]
});
_btn.render( $('#'+item[2])) ;
_btn.on('click', _.bind(this.onBtnBordersClick, this));
this._btnsBorderPosition.push( _btn );
this.lockedControls.push(_btn);
}, this);
this.cmbBorderSize = new Common.UI.ComboBorderSize({
el: $('#table-combo-border-size'),
style: "width: 93px;"
});
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.cmbBorderSize.on('selected', _.bind(this.onBorderSizeSelect, this));
this.lockedControls.push(this.cmbBorderSize);
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="table-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="table-border-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBorderColor.on('render:after', function(btn) {
me.borderColor = new Common.UI.ThemeColorPalette({
el: $('#table-border-color-menu')
});
me.borderColor.on('select', _.bind(me.onColorsBorderSelect, me));
});
this.btnBorderColor.render( $('#table-border-color-btn'));
this.btnBorderColor.setColor('000000');
$(this.el).on('click', '#table-border-color-new', _.bind(this.addNewColor, this, this.borderColor, this.btnBorderColor));
this.lockedControls.push(this.btnBorderColor);
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="table-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="table-back-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBackColor.on('render:after', function(btn) {
me.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#table-back-color-menu'),
transparent: true
});
me.colorsBack.on('select', _.bind(me.onColorsBackSelect, me));
});
this.btnBackColor.render( $('#table-back-color-btn'));
$(this.el).on('click', '#table-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.lockedControls.push(this.btnBackColor);
this.btnEdit = new Common.UI.Button({
cls: 'btn-icon-default',
iconCls: 'btn-edit-table',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
items: [
{ caption: this.selectRowText, value: 0 },
{ caption: this.selectColumnText, value: 1 },
{ caption: this.selectCellText, value: 2 },
{ caption: this.selectTableText, value: 3 },
{ caption: '--' },
{ caption: this.insertRowAboveText, value: 4 },
{ caption: this.insertRowBelowText, value: 5 },
{ caption: this.insertColumnLeftText, value: 6 },
{ caption: this.insertColumnRightText, value: 7 },
{ caption: '--' },
{ caption: this.deleteRowText, value: 8 },
{ caption: this.deleteColumnText, value: 9 },
{ caption: this.deleteTableText, value: 10 },
{ caption: '--' },
{ caption: this.mergeCellsText, value: 11 },
{ caption: this.splitCellsText, value: 12 }
]
})
});
this.btnEdit.render( $('#table-btn-edit')) ;
this.mnuMerge = this.btnEdit.menu.items[this.btnEdit.menu.items.length-2];
this.mnuSplit = this.btnEdit.menu.items[this.btnEdit.menu.items.length-1];
this.btnEdit.menu.on('show:after', _.bind( function(){
if (this.api) {
this.mnuMerge.setDisabled(!this.api.CheckBeforeMergeCells());
this.mnuSplit.setDisabled(!this.api.CheckBeforeSplitCells());
}
}, this));
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit);
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
},
onCheckTemplateChange: function(type, field, newValue, oldValue, eOpts) {
@ -398,8 +219,6 @@ define([
el.html(this.template({
scope: this
}));
this.linkAdvanced = $('#table-advanced-link');
},
setApi: function(o) {
@ -410,7 +229,134 @@ define([
return this;
},
createDelayedControls: function() {
var me = this;
this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'),
labelText: this.textHeader
});
this.lockedControls.push(this.chHeader);
this.chTotal = new Common.UI.CheckBox({
el: $('#table-checkbox-total'),
labelText: this.textTotal
});
this.lockedControls.push(this.chTotal);
this.chBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chBanded);
this.chFirst = new Common.UI.CheckBox({
el: $('#table-checkbox-first'),
labelText: this.textFirst
});
this.lockedControls.push(this.chFirst);
this.chLast = new Common.UI.CheckBox({
el: $('#table-checkbox-last'),
labelText: this.textLast
});
this.lockedControls.push(this.chLast);
this.chColBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-col-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chColBanded);
this.chHeader.on('change', _.bind(this.onCheckTemplateChange, this, 0));
this.chTotal.on('change', _.bind(this.onCheckTemplateChange, this, 1));
this.chBanded.on('change', _.bind(this.onCheckTemplateChange, this, 2));
this.chFirst.on('change', _.bind(this.onCheckTemplateChange, this, 3));
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, 4));
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, 5));
var _arrBorderPosition = [
['l', 'btn-borders-small btn-position-left', 'table-button-border-left', this.tipLeft],
['c','btn-borders-small btn-position-inner-vert', 'table-button-border-inner-vert', this.tipInnerVert],
['r','btn-borders-small btn-position-right', 'table-button-border-right', this.tipRight],
['t','btn-borders-small btn-position-top', 'table-button-border-top', this.tipTop],
['m','btn-borders-small btn-position-inner-hor', 'table-button-border-inner-hor', this.tipInnerHor],
['b', 'btn-borders-small btn-position-bottom', 'table-button-border-bottom', this.tipBottom],
['cm', 'btn-borders-small btn-position-inner', 'table-button-border-inner', this.tipInner],
['lrtb', 'btn-borders-small btn-position-outer', 'table-button-border-outer', this.tipOuter],
['lrtbcm', 'btn-borders-small btn-position-all', 'table-button-border-all', this.tipAll],
['', 'btn-borders-small btn-position-none', 'table-button-border-none', this.tipNone]
];
this._btnsBorderPosition = [];
_.each(_arrBorderPosition, function(item, index, list){
var _btn = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: item[1],
strId :item[0],
hint: item[3]
});
_btn.render( $('#'+item[2])) ;
_btn.on('click', _.bind(this.onBtnBordersClick, this));
this._btnsBorderPosition.push( _btn );
this.lockedControls.push(_btn);
}, this);
this.cmbBorderSize = new Common.UI.ComboBorderSize({
el: $('#table-combo-border-size'),
style: "width: 93px;"
});
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.cmbBorderSize.on('selected', _.bind(this.onBorderSizeSelect, this));
this.lockedControls.push(this.cmbBorderSize);
this.btnEdit = new Common.UI.Button({
cls: 'btn-icon-default',
iconCls: 'btn-edit-table',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
items: [
{ caption: this.selectRowText, value: 0 },
{ caption: this.selectColumnText, value: 1 },
{ caption: this.selectCellText, value: 2 },
{ caption: this.selectTableText, value: 3 },
{ caption: '--' },
{ caption: this.insertRowAboveText, value: 4 },
{ caption: this.insertRowBelowText, value: 5 },
{ caption: this.insertColumnLeftText, value: 6 },
{ caption: this.insertColumnRightText, value: 7 },
{ caption: '--' },
{ caption: this.deleteRowText, value: 8 },
{ caption: this.deleteColumnText, value: 9 },
{ caption: this.deleteTableText, value: 10 },
{ caption: '--' },
{ caption: this.mergeCellsText, value: 11 },
{ caption: this.splitCellsText, value: 12 }
]
})
});
this.btnEdit.render( $('#table-btn-edit')) ;
this.mnuMerge = this.btnEdit.menu.items[this.btnEdit.menu.items.length-2];
this.mnuSplit = this.btnEdit.menu.items[this.btnEdit.menu.items.length-1];
this.btnEdit.menu.on('show:after', _.bind( function(){
if (this.api) {
this.mnuMerge.setDisabled(!this.api.CheckBeforeMergeCells());
this.mnuSplit.setDisabled(!this.api.CheckBeforeSplitCells());
}
}, this));
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit);
this.linkAdvanced = $('#table-advanced-link');
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
},
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this.disableControls(this._locked);
if (props )
@ -580,19 +526,79 @@ define([
}
},
createDelayedElements: function() {
this.createDelayedControls();
this.UpdateThemeColors();
this._initSettings = false;
},
UpdateThemeColors: function() {
if (this.colorsBack)
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
if (this.borderColor) {
this.borderColor.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.btnBorderColor.setColor(this.borderColor.getColor());
if (!this.btnBackColor) {
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="table-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="table-border-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBorderColor.render( $('#table-border-color-btn'));
this.btnBorderColor.setColor('000000');
this.lockedControls.push(this.btnBorderColor);
this.borderColor = new Common.UI.ThemeColorPalette({
el: $('#table-border-color-menu')
});
this.borderColor.on('select', _.bind(this.onColorsBorderSelect, this));
$(this.el).on('click', '#table-border-color-new', _.bind(this.addNewColor, this, this.borderColor, this.btnBorderColor));
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="table-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="table-back-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBackColor.render( $('#table-back-color-btn'));
this.lockedControls.push(this.btnBackColor);
this.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#table-back-color-menu'),
transparent: true
});
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
$(this.el).on('click', '#table-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
}
this.colorsBack.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());
},
_onInitTemplates: function(Templates){
var self = this;
this._isTemplatesChanged = true;
if (!this.cmbTableTemplate) {
this.cmbTableTemplate = new Common.UI.ComboDataView({
itemWidth: 70,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-template'
});
this.cmbTableTemplate.render($('#table-combo-template'));
this.cmbTableTemplate.openButton.menu.cmpEl.css({
'min-width': 175,
'max-width': 175
});
this.cmbTableTemplate.on('click', _.bind(this.onTableTemplateSelect, this));
this.cmbTableTemplate.openButton.menu.on('show:after', function () {
self.cmbTableTemplate.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTableTemplate);
}
var count = self.cmbTableTemplate.menuPicker.store.length;
if (count>0 && count==Templates.length) {
var data = self.cmbTableTemplate.menuPicker.store.models;
@ -649,6 +655,8 @@ define([
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {

View file

@ -70,7 +70,6 @@ define([
},
initialize: function () {
var me = this;
this._initSettings = true;
this._noApply = true;
this.shapeprops = null;
@ -118,373 +117,6 @@ define([
this.render();
this.cmbTextArt = new Common.UI.ComboDataView({
itemWidth: 50,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
showLast: false,
cls: 'combo-textart'
});
this.cmbTextArt.render($('#textart-combo-template'));
this.cmbTextArt.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbTextArt.on('click', _.bind(this.onTextArtSelect, this));
this.cmbTextArt.openButton.menu.on('show:after', function () {
me.cmbTextArt.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTextArt);
this._arrFillSrc = [
{displayValue: this.textColor, value: Asc.c_oAscFill.FILL_TYPE_SOLID},
{displayValue: this.textGradientFill, value: Asc.c_oAscFill.FILL_TYPE_GRAD},
{displayValue: this.textImageTexture, value: Asc.c_oAscFill.FILL_TYPE_BLIP},
{displayValue: this.textPatternFill, value: Asc.c_oAscFill.FILL_TYPE_PATT},
{displayValue: this.textNoFill, value: Asc.c_oAscFill.FILL_TYPE_NOFILL}
];
this.cmbFillSrc = new Common.UI.ComboBox({
el: $('#textart-combo-fill-src'),
cls: 'input-group-nr',
style: 'width: 100%;',
menuStyle: 'min-width: 190px;',
editable: false,
data: this._arrFillSrc
});
this.cmbFillSrc.setValue(this._arrFillSrc[0].value);
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this.lockedControls.push(this.cmbFillSrc);
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-back-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBackColor.on('render:after', function(btn) {
me.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#textart-back-color-menu'),
value: 'transparent',
transparent: true
});
me.colorsBack.on('select', _.bind(me.onColorsBackSelect, me));
});
this.btnBackColor.render( $('#textart-back-color-btn'));
this.btnBackColor.setColor('transparent');
$(this.el).on('click', '#textart-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.lockedControls.push(this.btnBackColor);
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#textart-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.cmbPattern.openButton.menu.on('show:after', function () {
me.cmbPattern.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbPattern);
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-foreground-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnFGColor.on('render:after', function(btn) {
me.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#textart-foreground-color-menu'),
value: '000000'
});
me.colorsFG.on('select', _.bind(me.onColorsFGSelect, me));
});
this.btnFGColor.render( $('#textart-foreground-color-btn'));
this.btnFGColor.setColor('000000');
$(this.el).on('click', '#textart-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.lockedControls.push(this.btnFGColor);
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-background-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnBGColor.on('render:after', function(btn) {
me.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#textart-background-color-menu'),
value: 'ffffff'
});
me.colorsBG.on('select', _.bind(me.onColorsBGSelect, me));
});
this.btnBGColor.render( $('#textart-background-color-btn'));
this.btnBGColor.setColor('ffffff');
$(this.el).on('click', '#textart-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.lockedControls.push(this.btnBGColor);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#textart-button-from-file')
});
this.lockedControls.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#textart-button-from-url')
});
this.lockedControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeArtImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#textart-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.lockedControls.push(this.cmbFillType);
this.btnTexture = new Common.UI.ComboBox({
el: $('#textart-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-textart-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#textart-combo-fill-texture'));
this.lockedControls.push(this.btnTexture);
this.numTransparency = new Common.UI.MetricSpinner({
el: $('#textart-spin-transparency'),
step: 1,
width: 62,
value: '100 %',
defaultUnit : "%",
maxValue: 100,
minValue: 0
});
this.numTransparency.on('change', _.bind(this.onNumTransparencyChange, this));
this.lockedControls.push(this.numTransparency);
this.sldrTransparency = new Common.UI.SingleSlider({
el: $('#textart-slider-transparency'),
width: 75,
minValue: 0,
maxValue: 100,
value: 100
});
this.sldrTransparency.on('change', _.bind(this.onTransparencyChange, this));
this.sldrTransparency.on('changecomplete', _.bind(this.onTransparencyChangeComplete, this));
this.lockedControls.push(this.sldrTransparency);
this.lblTransparencyStart = $(this.el).find('#textart-lbl-transparency-start');
this.lblTransparencyEnd = $(this.el).find('#textart-lbl-transparency-end');
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#textart-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.lockedControls.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-textart-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-textart-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#textart-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.lockedControls.push(this.btnDirection);
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-gradient-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.btnGradColor.on('render:after', function(btn) {
me.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#textart-gradient-color-menu'),
value: '000000'
});
me.colorsGrad.on('select', _.bind(me.onColorsGradientSelect, me));
});
this.btnGradColor.render( $('#textart-gradient-color-btn'));
this.btnGradColor.setColor('000000');
$(this.el).on('click', '#textart-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.lockedControls.push(this.btnGradColor);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#textart-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.lockedControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#textart-combo-border-size'),
style: "width: 93px;",
txtNoBorders: this.txtNoBorders
})
.on('selected', _.bind(this.onBorderSizeSelect, this))
.on('changed:before',_.bind(this.onBorderSizeChanged, this, true))
.on('changed:after', _.bind(this.onBorderSizeChanged, this, false))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.lockedControls.push(this.cmbBorderSize);
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-border-color-new" style="padding-left:12px;">' + me.textNewColor + '</a>') }
]
})
});
this.lockedControls.push(this.btnBorderColor);
this.btnBorderColor.on('render:after', function(btn) {
me.colorsBorder = new Common.UI.ThemeColorPalette({
el: $('#textart-border-color-menu'),
value: '000000'
});
me.colorsBorder.on('select', _.bind(me.onColorsBorderSelect, me));
});
this.btnBorderColor.render( $('#textart-border-color-btn'));
this.btnBorderColor.setColor('000000');
$(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#textart-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.cmbTransform = new Common.UI.ComboDataView({
itemWidth: 50,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-textart'
});
this.cmbTransform.render($('#textart-combo-transform'));
this.cmbTransform.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbTransform.on('click', _.bind(this.onTransformSelect, this));
this.cmbTransform.openButton.menu.on('show:after', function () {
me.cmbTransform.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTransform);
this.FillColorContainer = $('#textart-panel-color-fill');
this.FillImageContainer = $('#textart-panel-image-fill');
this.FillPatternContainer = $('#textart-panel-pattern-fill');
@ -1029,7 +661,6 @@ define([
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props && props.get_TextArtProperties())
{
@ -1413,7 +1044,234 @@ define([
}
},
createDelayedControls: function() {
var me = this;
this._arrFillSrc = [
{displayValue: this.textColor, value: Asc.c_oAscFill.FILL_TYPE_SOLID},
{displayValue: this.textGradientFill, value: Asc.c_oAscFill.FILL_TYPE_GRAD},
{displayValue: this.textImageTexture, value: Asc.c_oAscFill.FILL_TYPE_BLIP},
{displayValue: this.textPatternFill, value: Asc.c_oAscFill.FILL_TYPE_PATT},
{displayValue: this.textNoFill, value: Asc.c_oAscFill.FILL_TYPE_NOFILL}
];
this.cmbFillSrc = new Common.UI.ComboBox({
el: $('#textart-combo-fill-src'),
cls: 'input-group-nr',
style: 'width: 100%;',
menuStyle: 'min-width: 190px;',
editable: false,
data: this._arrFillSrc
});
this.cmbFillSrc.setValue(this._arrFillSrc[0].value);
this.cmbFillSrc.on('selected', _.bind(this.onFillSrcSelect, this));
this.lockedControls.push(this.cmbFillSrc);
this.cmbPattern = new Common.UI.ComboDataView({
itemWidth: 28,
itemHeight: 28,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-pattern'
});
this.cmbPattern.menuPicker.itemTemplate = this.cmbPattern.fieldPicker.itemTemplate = _.template([
'<div class="style" id="<%= id %>">',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ',
'width="' + this.cmbPattern.itemWidth + '" height="' + this.cmbPattern.itemHeight + '" ',
'style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',
'</div>'
].join(''));
this.cmbPattern.render($('#textart-combo-pattern'));
this.cmbPattern.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbPattern.on('click', _.bind(this.onPatternSelect, this));
this.cmbPattern.openButton.menu.on('show:after', function () {
me.cmbPattern.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbPattern);
this.btnInsertFromFile = new Common.UI.Button({
el: $('#textart-button-from-file')
});
this.lockedControls.push(this.btnInsertFromFile);
this.btnInsertFromUrl = new Common.UI.Button({
el: $('#textart-button-from-url')
});
this.lockedControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeArtImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this._arrFillType = [
{displayValue: this.textStretch, value: Asc.c_oAscFillBlipType.STRETCH},
{displayValue: this.textTile, value: Asc.c_oAscFillBlipType.TILE}
];
this.cmbFillType = new Common.UI.ComboBox({
el: $('#textart-combo-fill-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrFillType
});
this.cmbFillType.setValue(this._arrFillType[0].value);
this.cmbFillType.on('selected', _.bind(this.onFillTypeSelect, this));
this.lockedControls.push(this.cmbFillType);
this.numTransparency = new Common.UI.MetricSpinner({
el: $('#textart-spin-transparency'),
step: 1,
width: 62,
value: '100 %',
defaultUnit : "%",
maxValue: 100,
minValue: 0
});
this.numTransparency.on('change', _.bind(this.onNumTransparencyChange, this));
this.lockedControls.push(this.numTransparency);
this.sldrTransparency = new Common.UI.SingleSlider({
el: $('#textart-slider-transparency'),
width: 75,
minValue: 0,
maxValue: 100,
value: 100
});
this.sldrTransparency.on('change', _.bind(this.onTransparencyChange, this));
this.sldrTransparency.on('changecomplete', _.bind(this.onTransparencyChangeComplete, this));
this.lockedControls.push(this.sldrTransparency);
this.lblTransparencyStart = $(this.el).find('#textart-lbl-transparency-start');
this.lblTransparencyEnd = $(this.el).find('#textart-lbl-transparency-end');
this._arrGradType = [
{displayValue: this.textLinear, value: Asc.c_oAscFillGradType.GRAD_LINEAR},
{displayValue: this.textRadial, value: Asc.c_oAscFillGradType.GRAD_PATH}
];
this.cmbGradType = new Common.UI.ComboBox({
el: $('#textart-combo-grad-type'),
cls: 'input-group-nr',
menuStyle: 'min-width: 90px;',
editable: false,
data: this._arrGradType
});
this.cmbGradType.setValue(this._arrGradType[0].value);
this.cmbGradType.on('selected', _.bind(this.onGradTypeSelect, this));
this.lockedControls.push(this.cmbGradType);
this._viewDataLinear = [
{ offsetx: 0, offsety: 0, type:45, subtype:-1, iconcls:'gradient-left-top' },
{ offsetx: 50, offsety: 0, type:90, subtype:4, iconcls:'gradient-top'},
{ offsetx: 100, offsety: 0, type:135, subtype:5, iconcls:'gradient-right-top'},
{ offsetx: 0, offsety: 50, type:0, subtype:6, iconcls:'gradient-left', cls: 'item-gradient-separator', selected: true},
{ offsetx: 100, offsety: 50, type:180, subtype:1, iconcls:'gradient-right'},
{ offsetx: 0, offsety: 100, type:315, subtype:2, iconcls:'gradient-left-bottom'},
{ offsetx: 50, offsety: 100, type:270, subtype:3, iconcls:'gradient-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({
cls : 'btn-large-dataview',
iconCls : 'item-gradient gradient-left',
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
menuAlign: 'tr-br',
items: [
{ template: _.template('<div id="id-textart-menu-direction" style="width: 175px; margin: 0 5px;"></div>') }
]
})
});
this.btnDirection.on('render:after', function(btn) {
me.mnuDirectionPicker = new Common.UI.DataView({
el: $('#id-textart-menu-direction'),
parentMenu: btn.menu,
restoreHeight: 174,
store: new Common.UI.DataViewStore(me._viewDataLinear),
itemTemplate: _.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')
});
});
this.btnDirection.render($('#textart-button-direction'));
this.mnuDirectionPicker.on('item:click', _.bind(this.onSelectGradient, this, this.btnDirection));
this.lockedControls.push(this.btnDirection);
this.sldrGradient = new Common.UI.MultiSliderGradient({
el: $('#textart-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.lockedControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#textart-combo-border-size'),
style: "width: 93px;",
txtNoBorders: this.txtNoBorders
})
.on('selected', _.bind(this.onBorderSizeSelect, this))
.on('changed:before',_.bind(this.onBorderSizeChanged, this, true))
.on('changed:after', _.bind(this.onBorderSizeChanged, this, false))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderSize = this.cmbBorderSize.store.at(2).get('value');
this.cmbBorderSize.setValue(this.BorderSize);
this.lockedControls.push(this.cmbBorderSize);
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#textart-combo-border-type'),
style: "width: 93px;",
menuStyle: 'min-width: 93px;'
}).on('selected', _.bind(this.onBorderTypeSelect, this))
.on('combo:blur', _.bind(this.onComboBlur, this, false));
this.BorderType = Asc.c_oDashType.solid;
this.cmbBorderType.setValue(this.BorderType);
this.lockedControls.push(this.cmbBorderType);
this.cmbTransform = new Common.UI.ComboDataView({
itemWidth: 50,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
cls: 'combo-textart'
});
this.cmbTransform.render($('#textart-combo-transform'));
this.cmbTransform.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbTransform.on('click', _.bind(this.onTransformSelect, this));
this.cmbTransform.openButton.menu.on('show:after', function () {
me.cmbTransform.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTransform);
},
createDelayedElements: function() {
this.createDelayedControls();
var global_hatch_menu_map = [
0,1,3,2,4,
53,5,6,7,8,
@ -1446,11 +1304,31 @@ define([
}
this.UpdateThemeColors();
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
this._initSettings = false;
},
onInitStandartTextures: function(texture) {
var me = this;
if (texture && texture.length>0){
if (!this.btnTexture) {
this.btnTexture = new Common.UI.ComboBox({
el: $('#textart-combo-fill-texture'),
template: _.template([
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
'</div>'
].join(''))
});
this.textureMenu = new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-textart-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
]
});
this.textureMenu.render($('#textart-combo-fill-texture'));
this.lockedControls.push(this.btnTexture);
}
var texturearray = [];
_.each(texture, function(item){
texturearray.push({
@ -1493,8 +1371,29 @@ define([
},
fillTextArt: function() {
var me = this,
models = this.application.getCollection('Common.Collections.TextArt').models,
var me = this;
if (!this.cmbTextArt) {
this.cmbTextArt = new Common.UI.ComboDataView({
itemWidth: 50,
itemHeight: 50,
menuMaxHeight: 300,
enableKeyEvents: true,
showLast: false,
cls: 'combo-textart'
});
this.cmbTextArt.render($('#textart-combo-template'));
this.cmbTextArt.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbTextArt.on('click', _.bind(this.onTextArtSelect, this));
this.cmbTextArt.openButton.menu.on('show:after', function () {
me.cmbTextArt.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTextArt);
}
var models = this.application.getCollection('Common.Collections.TextArt').models,
count = this.cmbTextArt.menuPicker.store.length;
if (count>0 && count==models.length) {
var data = this.cmbTextArt.menuPicker.store.models;
@ -1552,6 +1451,104 @@ define([
},
UpdateThemeColors: function() {
if (!this.btnBackColor) {
this.btnBackColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-back-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-back-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBackColor.render( $('#textart-back-color-btn'));
this.btnBackColor.setColor('transparent');
this.lockedControls.push(this.btnBackColor);
this.colorsBack = new Common.UI.ThemeColorPalette({
el: $('#textart-back-color-menu'),
value: 'transparent',
transparent: true
});
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
$(this.el).on('click', '#textart-back-color-new', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-foreground-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-foreground-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnFGColor.render( $('#textart-foreground-color-btn'));
this.btnFGColor.setColor('000000');
this.lockedControls.push(this.btnFGColor);
this.colorsFG = new Common.UI.ThemeColorPalette({
el: $('#textart-foreground-color-menu'),
value: '000000'
});
this.colorsFG.on('select', _.bind(this.onColorsFGSelect, this));
$(this.el).on('click', '#textart-foreground-color-new', _.bind(this.addNewColor, this, this.colorsFG, this.btnFGColor));
this.btnBGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-background-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-background-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBGColor.render( $('#textart-background-color-btn'));
this.btnBGColor.setColor('ffffff');
this.lockedControls.push(this.btnBGColor);
this.colorsBG = new Common.UI.ThemeColorPalette({
el: $('#textart-background-color-menu'),
value: 'ffffff'
});
this.colorsBG.on('select', _.bind(this.onColorsBGSelect, this));
$(this.el).on('click', '#textart-background-color-new', _.bind(this.addNewColor, this, this.colorsBG, this.btnBGColor));
this.btnGradColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-gradient-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-gradient-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnGradColor.render( $('#textart-gradient-color-btn'));
this.btnGradColor.setColor('000000');
this.lockedControls.push(this.btnGradColor);
this.colorsGrad = new Common.UI.ThemeColorPalette({
el: $('#textart-gradient-color-menu'),
value: '000000'
});
this.colorsGrad.on('select', _.bind(this.onColorsGradientSelect, this));
$(this.el).on('click', '#textart-gradient-color-new', _.bind(this.addNewColor, this, this.colorsGrad, this.btnGradColor));
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="textart-border-color-menu" style="width: 165px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="textart-border-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
});
this.btnBorderColor.render( $('#textart-border-color-btn'));
this.btnBorderColor.setColor('000000');
this.lockedControls.push(this.btnBorderColor);
this.colorsBorder = new Common.UI.ThemeColorPalette({
el: $('#textart-border-color-menu'),
value: '000000'
});
this.colorsBorder.on('select', _.bind(this.onColorsBorderSelect, this));
$(this.el).on('click', '#textart-border-color-new', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
}
this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
@ -1580,6 +1577,8 @@ define([
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {

View file

@ -122,8 +122,7 @@ define([
id : 'id-toolbar-btn-newdocument',
cls : 'btn-toolbar',
iconCls : 'btn-newdocument',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides],
hint : me.tipNewDocument
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides]
});
me.paragraphControls.push(me.btnNewDocument);
@ -131,8 +130,7 @@ define([
id : 'id-toolbar-btn-opendocument',
cls : 'btn-toolbar',
iconCls : 'btn-opendocument',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides],
hint : me.tipOpenDocument
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides]
});
me.paragraphControls.push(me.btnOpenDocument);
@ -140,38 +138,9 @@ define([
id : 'id-toolbar-button-add-slide',
cls : 'btn-toolbar',
iconCls : 'btn-addslide',
hint : me.tipAddSlide + Common.Utils.String.platformKey('Ctrl+M'),
split : true,
lock : [_set.menuFileOpen, _set.slideDeleted, _set.lostConnect, _set.disableOnStart],
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-addslide" class="menu-layouts" style="width: 302px; margin: 0 4px;"></div>') }
]
})
}).on('render:after', function(btn) {
me.mnuAddSlidePicker = new Common.UI.DataView({
el : $('#id-toolbar-menu-addslide'),
parentMenu : btn.menu,
showLast: false,
restoreHeight: 300,
style: 'max-height: 300px;',
store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">',
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;"/>',
'<div class="title"><%= title %></div> ',
'</div>'
].join(''))
});
if (me.btnAddSlide.menu) {
me.btnAddSlide.menu.on('show:after', function () {
me.onSlidePickerShowAfter(me.mnuAddSlidePicker);
me.mnuAddSlidePicker.scroller.update({alwaysVisibleY: true});
me.mnuAddSlidePicker.scroller.scrollTop(0);
});
}
me.mnuAddSlidePicker._needRecalcSlideLayout = true;
menu : true
});
me.slideOnlyControls.push(me.btnAddSlide);
@ -180,50 +149,15 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-changeslide',
lock : [_set.menuFileOpen, _set.slideDeleted, _set.slideLock, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipChangeSlide,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-changeslide" class="menu-layouts" style="width: 302px; margin: 0 4px;"></div>') }
]
})
}).on('render:after', function(btn) {
me.mnuChangeSlidePicker = new Common.UI.DataView({
el : $('#id-toolbar-menu-changeslide'),
parentMenu : btn.menu,
showLast: false,
restoreHeight: 300,
style: 'max-height: 300px;',
store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">',
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;"/>',
'<div class="title"><%= title %></div> ',
'</div>'
].join(''))
});
if (me.btnChangeSlide.menu) {
me.btnChangeSlide.menu.on('show:after', function () {
me.onSlidePickerShowAfter(me.mnuChangeSlidePicker);
me.mnuChangeSlidePicker.scroller.update({alwaysVisibleY: true});
me.mnuChangeSlidePicker.scroller.scrollTop(0);
});
}
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
menu : true
});
me.slideOnlyControls.push(me.btnChangeSlide);
me.listenTo(PE.getCollection('SlideLayouts'), 'reset', function() {
me.mnuAddSlidePicker._needRecalcSlideLayout = true;
if (me.mnuChangeSlidePicker)
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
});
me.btnPreview = new Common.UI.Button({
id : 'id-toolbar-button-preview',
cls : 'btn-toolbar',
iconCls : 'btn-preview',
lock : [_set.menuFileOpen, _set.slideDeleted, _set.noSlides, _set.disableOnStart],
hint : me.tipPreview,
split : true,
menu : new Common.UI.Menu({
items : [
@ -244,8 +178,7 @@ define([
id : 'id-toolbar-btn-print',
cls : 'btn-toolbar',
iconCls : 'btn-print',
lock : [_set.slideDeleted, _set.noSlides, _set.cantPrint],
hint : me.tipPrint + Common.Utils.String.platformKey('Ctrl+P')
lock : [_set.slideDeleted, _set.noSlides, _set.cantPrint]
});
me.paragraphControls.push(me.btnPrint);
@ -253,16 +186,14 @@ define([
id : 'id-toolbar-btn-save',
cls : 'btn-toolbar',
iconCls : me.btnSaveCls,
lock : [_set.lostConnect],
hint : me.btnSaveTip
lock : [_set.lostConnect]
});
me.btnUndo = new Common.UI.Button({
id : 'id-toolbar-btn-undo',
cls : 'btn-toolbar',
iconCls : 'btn-undo',
lock : [_set.undoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart],
hint : me.tipUndo + Common.Utils.String.platformKey('Ctrl+Z')
lock : [_set.undoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart]
});
me.slideOnlyControls.push(me.btnUndo);
@ -270,8 +201,7 @@ define([
id : 'id-toolbar-btn-redo',
cls : 'btn-toolbar',
iconCls : 'btn-redo',
lock : [_set.redoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart],
hint : me.tipRedo + Common.Utils.String.platformKey('Ctrl+Y')
lock : [_set.redoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart]
});
me.slideOnlyControls.push(me.btnRedo);
@ -279,8 +209,7 @@ define([
id : 'id-toolbar-btn-copy',
cls : 'btn-toolbar',
iconCls : 'btn-copy',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipCopy + Common.Utils.String.platformKey('Ctrl+C')
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart]
});
me.slideOnlyControls.push(me.btnCopy);
@ -288,8 +217,7 @@ define([
id : 'id-toolbar-btn-paste',
cls : 'btn-toolbar',
iconCls : 'btn-paste',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides],
hint : me.tipPaste + Common.Utils.String.platformKey('Ctrl+V')
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides]
});
me.paragraphControls.push(me.btnPaste);
@ -334,7 +262,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-bold',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textBold + Common.Utils.String.platformKey('Ctrl+B'),
enableToggle: true
});
me.paragraphControls.push(me.btnBold);
@ -344,7 +271,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-italic',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textItalic + Common.Utils.String.platformKey('Ctrl+I'),
enableToggle: true
});
me.paragraphControls.push(me.btnItalic);
@ -354,7 +280,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-underline',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textUnderline + Common.Utils.String.platformKey('Ctrl+U'),
enableToggle: true
});
me.paragraphControls.push(me.btnUnderline);
@ -364,7 +289,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-strikeout',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textStrikeout,
enableToggle: true
});
me.paragraphControls.push(me.btnStrikeout);
@ -374,7 +298,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-superscript',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textSuperscript,
enableToggle: true,
toggleGroup : 'superscriptGroup'
});
@ -385,7 +308,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-subscript',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.textSubscript,
enableToggle: true,
toggleGroup : 'superscriptGroup'
});
@ -396,7 +318,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-fontcolor',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
hint : me.tipFontColor,
split : true,
menu : new Common.UI.Menu({
items: [
@ -419,8 +340,7 @@ define([
id : 'id-toolbar-btn-clearstyle',
cls : 'btn-toolbar',
iconCls : 'btn-clearstyle',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipClearStyle
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected]
});
me.paragraphControls.push(me.btnClearStyle);
@ -429,7 +349,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-copystyle',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.disableOnStart],
hint : me.tipCopyStyle + Common.Utils.String.platformKey('Ctrl+Shift+C'),
enableToggle: true
});
me.slideOnlyControls.push(me.btnCopyStyle);
@ -439,34 +358,11 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-setmarkers',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipMarkers,
enableToggle: true,
toggleGroup : 'markersGroup',
split : true,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-markers" class="menu-markers" style="width: 185px; margin: 0 5px;"></div>') }
]
})
}).on('render:after', function(btn) {
me.mnuMarkersPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-markers'),
parentMenu: btn.menu,
restoreHeight: 92,
store: new Common.UI.DataViewStore([
{ offsety:0, data:{type:0, subtype:-1} },
{ offsety:38, data:{type:0, subtype:1} },
{ offsety:76, data:{type:0, subtype:2} },
{ offsety:114, data:{type:0, subtype:3} },
{ offsety:152, data:{type:0, subtype:4} },
{ offsety:190, data:{type:0, subtype:5} },
{ offsety:228, data:{type:0, subtype:6} },
{ offsety:266, data:{type:0, subtype:7} }
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-markerlist" style="background-position: 0 -<%= offsety %>px;"></div>')
});
menu : true
});
me.paragraphControls.push(me.btnMarkers);
me.btnNumbers = new Common.UI.Button({
@ -474,42 +370,34 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-numbering',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipNumbers,
enableToggle: true,
toggleGroup : 'markersGroup',
split : true,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-numbering" class="menu-markers" style="width: 330px; margin: 0 5px;"></div>') }
]
})
}).on('render:after', function(btn) {
me.mnuNumbersPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-numbering'),
parentMenu: btn.menu,
restoreHeight: 164,
store: new Common.UI.DataViewStore([
{ offsety: 0, data:{type:1,subtype:-1} },
{ offsety: 296, data:{type:1,subtype:4} },
{ offsety: 370, data:{type:1,subtype:5} },
{ offsety: 444, data:{type:1,subtype:6} },
{ offsety: 74, data:{type:1,subtype:1} },
{ offsety: 148, data:{type:1,subtype:2} },
{ offsety: 222, data:{type:1,subtype:3} },
{ offsety: 518, data:{type:1,subtype:7} }
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-numberlist" style="background-position: 0 -<%= offsety %>px;"></div>')
});
menu : true
});
me.paragraphControls.push(me.btnNumbers);
var clone = function(source) {
var obj = {};
for (var prop in source)
obj[prop] = (typeof(source[prop])=='object') ? clone(source[prop]) : source[prop];
return obj;
};
this.mnuMarkersPicker = {
conf: {index:0},
selectByIndex: function (idx) {
this.conf.index = idx;
}
};
this.mnuNumbersPicker = clone(this.mnuMarkersPicker);
me.btnHorizontalAlign = new Common.UI.Button({
id : 'id-toolbar-btn-halign',
cls : 'btn-toolbar',
iconCls : 'btn-align-left',
icls : 'btn-align-left',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipHAligh,
menu : new Common.UI.Menu({
items: [
{
@ -554,7 +442,6 @@ define([
id : 'id-toolbar-btn-valign',
cls : 'btn-toolbar',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipVAligh,
iconCls : 'btn-align-middle',
icls : 'btn-align-middle',
menu : new Common.UI.Menu({
@ -593,8 +480,7 @@ define([
id : 'id-toolbar-btn-decoffset',
cls : 'btn-toolbar',
iconCls : 'btn-decoffset',
lock : [_set.decIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipDecPrLeft + Common.Utils.String.platformKey('Ctrl+Shift+M')
lock : [_set.decIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected]
});
me.paragraphControls.push(me.btnDecLeftOffset);
@ -602,8 +488,7 @@ define([
id : 'id-toolbar-btn-incoffset',
cls : 'btn-toolbar',
iconCls : 'btn-incoffset',
lock : [_set.incIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipIncPrLeft
lock : [_set.incIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected]
});
me.paragraphControls.push(me.btnIncLeftOffset);
@ -612,7 +497,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-linespace',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipLineSpace,
menu : new Common.UI.Menu({
style: 'min-width: 60px;',
items: [
@ -632,7 +516,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-inserttable',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipInsertTable,
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-tablepicker" class="dimension-picker" style="margin: 5px 10px;"></div>') },
@ -655,7 +538,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-insertimage',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipInsertImage,
menu : new Common.UI.Menu({
items: [
{ caption: me.mniImageFromFile, value: 'file' },
@ -670,7 +552,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-insertchart',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipInsertChart,
menu : new Common.UI.Menu({
style: 'width: 560px;',
items: [
@ -730,7 +611,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-inserttext',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipInsertText,
enableToggle: true,
split : true,
menu : new Common.UI.Menu({
@ -756,8 +636,7 @@ define([
id : 'id-toolbar-btn-inserthyperlink',
cls : 'btn-toolbar',
iconCls : 'btn-inserthyperlink',
lock : [_set.hyperlinkLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
hint : me.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')
lock : [_set.hyperlinkLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected]
});
me.paragraphControls.push(me.btnInsertHyperlink);
@ -766,7 +645,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-insertshape',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipInsertShape,
enableToggle: true,
menu : new Common.UI.Menu({cls: 'menu-shapes'})
});
@ -777,12 +655,11 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-colorschemas',
lock : [_set.themeLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipColorSchemas,
menu : new Common.UI.Menu({
items : [],
maxHeight : 600,
restoreHeight: 600
}).on('render:after', function(mnu) {
}).on('show:before', function(mnu) {
this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '),
useKeyboard: this.enableKeyEvents && !this.handleSelect,
@ -815,71 +692,23 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-hidebars',
lock : [_set.menuFileOpen, _set.slideDeleted, _set.disableOnStart],
hint : me.tipViewSettings,
menu : new Common.UI.Menu({
cls: 'pull-right',
style: 'min-width: 180px;',
items: [
me.mnuitemCompactToolbar = new Common.UI.MenuItem({
caption : me.textCompactView,
checkable : true
}),
me.mnuitemHideTitleBar = new Common.UI.MenuItem({
caption : me.textHideTitleBar,
checkable : true
}),
me.mnuitemHideStatusBar = new Common.UI.MenuItem({
caption : me.textHideStatusBar,
checkable : true
}),
this.mnuitemHideRulers = new Common.UI.MenuItem({
caption : this.textHideLines,
checkable : true
}),
{ caption: '--' },
me.btnFitPage = new Common.UI.MenuItem({
caption: me.textFitPage,
checkable: true
}),
me.btnFitWidth = new Common.UI.MenuItem({
caption: me.textFitWidth,
checkable: true
}),
(new Common.UI.MenuItem({
template: _.template([
'<div id="id-toolbar-menu-zoom" class="menu-zoom" style="height: 25px;" ',
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
'data-stopPropagation="true"',
'<% } %>',
'>',
'<label class="title">' + me.textZoom + '</label>',
'<button id="id-menu-zoom-in" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomin">&nbsp;</span></button>',
'<label class="zoom">100%</label>',
'<button id="id-menu-zoom-out" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomout">&nbsp;</span></button>',
'</div>'
].join('')),
stopPropagation: true
}))
]
})
}).on('render:after', _.bind(function(cmp){
me.mnuZoomOut = new Common.UI.Button({
el : $('#id-menu-zoom-out'),
cls : 'btn-toolbar'
});
me.mnuZoomIn = new Common.UI.Button({
el : $('#id-menu-zoom-in'),
cls : 'btn-toolbar'
});
}), me);
menu : true
});
me.slideOnlyControls.push(me.btnHide);
this.btnFitPage = {
conf: {checked:false},
setChecked: function(val) { this.conf.checked = val;},
isChecked: function () { return this.conf.checked; }
};
this.btnFitWidth = clone(this.btnFitPage);
this.mnuZoom = {options: {value: 100}};
me.btnAdvSettings = new Common.UI.Button({
id : 'id-toolbar-btn-settings',
cls : 'btn-toolbar',
iconCls : 'btn-settings',
lock : [_set.slideDeleted, _set.disableOnStart],
hint : me.tipAdvSettings
lock : [_set.slideDeleted, _set.disableOnStart]
});
me.slideOnlyControls.push(me.btnAdvSettings);
@ -888,7 +717,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-align-shape',
lock : [_set.slideDeleted, _set.shapeLock, _set.lostConnect, _set.noSlides, _set.noObjectSelected, _set.disableOnStart],
hint : me.tipShapeAlign,
menu : new Common.UI.Menu({
items: [
{
@ -943,7 +771,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-arrange-shape',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.noObjectSelected, _set.disableOnStart],
hint : me.tipShapeArrange,
menu : new Common.UI.Menu({
items: [
{
@ -987,7 +814,6 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-slidesize',
lock : [_set.docPropsLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
hint : me.tipSlideSize,
menu : new Common.UI.Menu({
items: [
{
@ -1141,20 +967,6 @@ define([
var value = Common.localStorage.getItem('pe-compact-toolbar');
var valueCompact = !!(value!==null && parseInt(value) == 1 || value === null && mode.customization && mode.customization.compactToolbar);
value = Common.localStorage.getItem('pe-hidden-title');
var valueTitle = (value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem('pe-hidden-status');
var valueStatus = (value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("pe-hidden-rulers");
var valueRulers = (value !== null && parseInt(value) == 1);
me.mnuitemCompactToolbar.setChecked(valueCompact);
me.mnuitemHideTitleBar.setChecked(valueTitle);
me.mnuitemHideStatusBar.setChecked(valueStatus);
me.mnuitemHideRulers.setChecked(valueRulers);
el.html(this.template({
isCompactView: valueCompact
}));
@ -1162,8 +974,6 @@ define([
me.rendererComponents(valueCompact ? 'short' : 'full');
me.isCompactView = valueCompact;
this.mnuitemCompactToolbar.on('toggle', _.bind(this.changeViewMode, this));
this.trigger('render:after', this);
return this;
@ -1238,6 +1048,267 @@ define([
},
createDelayedElements: function() {
// set hints
this.btnNewDocument.updateHint(this.tipNewDocument);
this.btnOpenDocument.updateHint(this.tipOpenDocument);
this.btnAddSlide.updateHint(this.tipAddSlide + Common.Utils.String.platformKey('Ctrl+M'));
this.btnChangeSlide.updateHint(this.tipChangeSlide);
this.btnPreview.updateHint(this.tipPreview);
this.btnPrint.updateHint(this.tipPrint + Common.Utils.String.platformKey('Ctrl+P'));
this.btnSave.updateHint(this.btnSaveTip);
this.btnUndo.updateHint(this.tipUndo + Common.Utils.String.platformKey('Ctrl+Z'));
this.btnRedo.updateHint(this.tipRedo + Common.Utils.String.platformKey('Ctrl+Y'));
this.btnCopy.updateHint(this.tipCopy + Common.Utils.String.platformKey('Ctrl+C'));
this.btnPaste.updateHint(this.tipPaste + Common.Utils.String.platformKey('Ctrl+V'));
this.btnBold.updateHint(this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
this.btnItalic.updateHint(this.textItalic + Common.Utils.String.platformKey('Ctrl+I'));
this.btnUnderline.updateHint(this.textUnderline + Common.Utils.String.platformKey('Ctrl+U'));
this.btnStrikeout.updateHint(this.textStrikeout);
this.btnSuperscript.updateHint(this.textSuperscript);
this.btnSubscript.updateHint(this.textSubscript);
this.btnFontColor.updateHint(this.tipFontColor);
this.btnClearStyle.updateHint(this.tipClearStyle);
this.btnCopyStyle.updateHint(this.tipCopyStyle + Common.Utils.String.platformKey('Ctrl+Shift+C'));
this.btnMarkers.updateHint(this.tipMarkers);
this.btnNumbers.updateHint(this.tipNumbers);
this.btnHorizontalAlign.updateHint(this.tipHAligh);
this.btnVerticalAlign.updateHint(this.tipVAligh);
this.btnDecLeftOffset.updateHint(this.tipDecPrLeft + Common.Utils.String.platformKey('Ctrl+Shift+M'));
this.btnIncLeftOffset.updateHint(this.tipIncPrLeft);
this.btnLineSpace.updateHint(this.tipLineSpace);
this.btnInsertTable.updateHint(this.tipInsertTable);
this.btnInsertImage.updateHint(this.tipInsertImage);
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
this.btnInsertShape.updateHint(this.tipInsertShape);
this.btnColorSchemas.updateHint(this.tipColorSchemas);
this.btnHide.updateHint(this.tipViewSettings);
this.btnAdvSettings.updateHint(this.tipAdvSettings);
this.btnShapeAlign.updateHint(this.tipShapeAlign);
this.btnShapeArrange.updateHint(this.tipShapeArrange);
this.btnSlideSize.updateHint(this.tipSlideSize);
// set menus
var me = this;
this.btnHide.setMenu(
new Common.UI.Menu({
cls: 'pull-right',
style: 'min-width: 180px;',
items: [
this.mnuitemCompactToolbar = new Common.UI.MenuItem({
caption : this.textCompactView,
checkable : true
}),
this.mnuitemHideTitleBar = new Common.UI.MenuItem({
caption : this.textHideTitleBar,
checkable : true
}),
this.mnuitemHideStatusBar = new Common.UI.MenuItem({
caption : this.textHideStatusBar,
checkable : true
}),
this.mnuitemHideRulers = new Common.UI.MenuItem({
caption : this.textHideLines,
checkable : true
}),
{ caption: '--' },
this.btnFitPage = new Common.UI.MenuItem({
caption: this.textFitPage,
checkable: true,
checked: this.btnFitPage.isChecked()
}),
this.btnFitWidth = new Common.UI.MenuItem({
caption: this.textFitWidth,
checkable: true,
checked: this.btnFitWidth.isChecked()
}),
this.mnuZoom = new Common.UI.MenuItem({
template: _.template([
'<div id="id-toolbar-menu-zoom" class="menu-zoom" style="height: 25px;" ',
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
'data-stopPropagation="true"',
'<% } %>',
'>',
'<label class="title">' + this.textZoom + '</label>',
'<button id="id-menu-zoom-in" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomin">&nbsp;</span></button>',
'<label class="zoom"><%= options.value %>%</label>',
'<button id="id-menu-zoom-out" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomout">&nbsp;</span></button>',
'</div>'
].join('')),
stopPropagation: true,
value: this.mnuZoom.options.value
})
]
})
);
if (this.mode.isDesktopApp)
this.mnuitemHideTitleBar.hide();
this.mnuZoomOut = new Common.UI.Button({
el : $('#id-menu-zoom-out'),
cls : 'btn-toolbar'
});
this.mnuZoomIn = new Common.UI.Button({
el : $('#id-menu-zoom-in'),
cls : 'btn-toolbar'
});
this.btnMarkers.setMenu(
new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-markers" class="menu-markers" style="width: 185px; margin: 0 5px;"></div>') }
]
})
);
this.btnNumbers.setMenu(
new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-numbering" class="menu-markers" style="width: 330px; margin: 0 5px;"></div>') }
]
})
);
this.btnAddSlide.setMenu(
new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-addslide" class="menu-layouts" style="width: 302px; margin: 0 4px;"></div>') }
]
})
);
this.btnChangeSlide.setMenu(
new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-changeslide" class="menu-layouts" style="width: 302px; margin: 0 4px;"></div>') }
]
})
);
// set dataviews
var _conf = this.mnuMarkersPicker.conf;
this.mnuMarkersPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-markers'),
parentMenu: this.btnMarkers.menu,
restoreHeight: 92,
allowScrollbar: false,
store: new Common.UI.DataViewStore([
{ offsety:0, data:{type:0, subtype:-1} },
{ offsety:38, data:{type:0, subtype:1} },
{ offsety:76, data:{type:0, subtype:2} },
{ offsety:114, data:{type:0, subtype:3} },
{ offsety:152, data:{type:0, subtype:4} },
{ offsety:190, data:{type:0, subtype:5} },
{ offsety:228, data:{type:0, subtype:6} },
{ offsety:266, data:{type:0, subtype:7} }
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-markerlist" style="background-position: 0 -<%= offsety %>px;"></div>')
});
_conf && this.mnuMarkersPicker.selectByIndex(_conf.index, true);
_conf = this.mnuNumbersPicker.conf;
this.mnuNumbersPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-numbering'),
parentMenu: this.btnNumbers.menu,
restoreHeight: 164,
allowScrollbar: false,
store: new Common.UI.DataViewStore([
{ offsety: 0, data:{type:1,subtype:-1} },
{ offsety: 296, data:{type:1,subtype:4} },
{ offsety: 370, data:{type:1,subtype:5} },
{ offsety: 444, data:{type:1,subtype:6} },
{ offsety: 74, data:{type:1,subtype:1} },
{ offsety: 148, data:{type:1,subtype:2} },
{ offsety: 222, data:{type:1,subtype:3} },
{ offsety: 518, data:{type:1,subtype:7} }
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-numberlist" style="background-position: 0 -<%= offsety %>px;"></div>')
});
_conf && this.mnuNumbersPicker.selectByIndex(_conf.index, true);
this.mnuAddSlidePicker = new Common.UI.DataView({
el : $('#id-toolbar-menu-addslide'),
parentMenu : this.btnAddSlide.menu,
showLast: false,
restoreHeight: 300,
style: 'max-height: 300px;',
store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">',
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;"/>',
'<div class="title"><%= title %></div> ',
'</div>'
].join(''))
});
if (this.btnAddSlide.menu) {
this.btnAddSlide.menu.on('show:after', function () {
me.onSlidePickerShowAfter(me.mnuAddSlidePicker);
me.mnuAddSlidePicker.scroller.update({alwaysVisibleY: true});
me.mnuAddSlidePicker.scroller.scrollTop(0);
});
}
this.mnuAddSlidePicker._needRecalcSlideLayout = true;
var createDataPicker = function (btn) {
me.mnuChangeSlidePicker = new Common.UI.DataView({
el : $('#id-toolbar-menu-changeslide'),
parentMenu : me.btnChangeSlide.menu,
showLast: false,
restoreHeight: 300,
style: 'max-height: 300px;',
store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">',
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;"/>',
'<div class="title"><%= title %></div> ',
'</div>'
].join(''))
});
if (me.btnChangeSlide.menu) {
me.btnChangeSlide.menu.on('show:after', function () {
me.onSlidePickerShowAfter(me.mnuChangeSlidePicker);
me.mnuChangeSlidePicker.scroller.update({alwaysVisibleY: true});
me.mnuChangeSlidePicker.scroller.scrollTop(0);
});
}
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
};
// btnChangeSlide isn't in compact toolbar mode -> may be rendered after createDelayedElements
if (this.btnChangeSlide.rendered)
createDataPicker(this.btnChangeSlide);
else
this.btnChangeSlide.on('render:after', createDataPicker);
this.listenTo(PE.getCollection('SlideLayouts'), 'reset', function() {
me.mnuAddSlidePicker._needRecalcSlideLayout = true;
if (me.mnuChangeSlidePicker)
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
});
var mode = this.mode;
var value = Common.localStorage.getItem('pe-compact-toolbar');
var valueCompact = !!(value!==null && parseInt(value) == 1 || value === null && mode.customization && mode.customization.compactToolbar);
value = Common.localStorage.getItem('pe-hidden-title');
var valueTitle = (value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem('pe-hidden-status');
var valueStatus = (value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("pe-hidden-rulers");
var valueRulers = (value !== null && parseInt(value) == 1);
this.mnuitemCompactToolbar.setChecked(valueCompact, true);
this.mnuitemCompactToolbar.on('toggle', _.bind(this.changeViewMode, this));
this.mnuitemHideTitleBar.setChecked(valueTitle, true);
this.mnuitemHideStatusBar.setChecked(valueStatus, true);
this.mnuitemHideRulers.setChecked(valueRulers, true);
// // Enable none paragraph components
this.lockToolbar(PE.enumLock.disableOnStart, false, {array: this.slideOnlyControls.concat(this.shapeControls)});
@ -1282,12 +1353,10 @@ define([
}
}
if (mode.isDesktopApp) {
if (mode.isDesktopApp)
$('.toolbar-group-native').hide();
this.mnuitemHideTitleBar.hide();
}
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]});
},
changeViewMode: function(item, compact) {

View file

@ -135,7 +135,7 @@
"PE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
"PE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.",
"PE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"PE.Controllers.Main.leavePageText": "You have unsaved changes in this presentation. Click \"Stay on This Page\", then \"Save\" to save them. Click \"Leave This Page\" to discard all the unsaved changes.",
"PE.Controllers.Main.loadFontsTextText": "Loading data...",
"PE.Controllers.Main.loadFontsTitleText": "Loading Data",

View file

@ -123,7 +123,7 @@
"PE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.",
"PE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.",
"PE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"PE.Controllers.Main.leavePageText": "Hay cambios no guardados en esta presentación. Pulse \"Permanecer en esta página\", después \"Guardar\" para guardadarlos. Pulse \"Abandonar esta página\" para descartar todos los cambios no guardados.",
"PE.Controllers.Main.loadFontsTextText": "Cargando datos...",
"PE.Controllers.Main.loadFontsTitleText": "Cargando datos",

View file

@ -123,7 +123,7 @@
"PE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.",
"PE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier",
"PE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"PE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans cette présentation. Cliquez sur \"Rester sur cette page\", ensuite sur \"Enregistrer\" pour enregistrer les modifications. Cliquez sur \"Quitter cette page\" pour annuler toutes les modifications non enregistrées.",
"PE.Controllers.Main.loadFontsTextText": "Chargement des données...",
"PE.Controllers.Main.loadFontsTitleText": "Chargement des données",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -118,7 +118,7 @@
font-size: 12px;
> label {
white-space: initial;
white-space: normal;
}
#status-users-list {

View file

@ -0,0 +1,53 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EquationGroups.js
*
* Created by Alexey Musinov on 29/10/14
* Copyright (c) 2014 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone',
'spreadsheeteditor/main/app/model/EquationGroup'
], function(Backbone){ 'use strict';
if (Common === undefined)
var Common = {};
Common.Collections = Common.Collections || {};
SSE.Collections.EquationGroups = Backbone.Collection.extend({
model: SSE.Models.EquationGroup
});
});

View file

@ -1313,6 +1313,7 @@ define([
item.setDisabled(isCellLocked);
});
documentHolder.pmiCopy.setDisabled(false);
documentHolder.pmiFilterCells.setDisabled(isCellLocked || (filterInfo==null));
documentHolder.pmiSortCells.setDisabled(isCellLocked || (filterInfo==null));
documentHolder.pmiReapply.setDisabled(isCellLocked || (isApplyAutoFilter!==true));
if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event);

View file

@ -127,7 +127,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onRenameCellTextEnd', _.bind(this.onRenameText, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
@ -509,7 +509,7 @@ define([
}
},
onApiServerDisconnect: function() {
onApiServerDisconnect: function(disableDownload) {
this.mode.isEdit = false;
this.leftMenu.close();
@ -519,7 +519,7 @@ define([
/** coauthoring end **/
this.leftMenu.btnPlugins.setDisabled(true);
this.leftMenu.getMenu('file').setMode({isDisconnected: true});
this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload});
if ( this.dlgSearch ) {
this.leftMenu.btnSearch.toggle(false, true);
this.dlgSearch['hide']();

View file

@ -52,6 +52,7 @@ define([
'common/main/lib/util/LanguageInfo',
'spreadsheeteditor/main/app/collection/ShapeGroups',
'spreadsheeteditor/main/app/collection/TableTemplates',
'spreadsheeteditor/main/app/collection/EquationGroups',
'spreadsheeteditor/main/app/controller/FormulaDialog',
'spreadsheeteditor/main/app/view/FormulaLang'
], function () {
@ -159,12 +160,15 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) {
if (this.isAppDisabled === true) return;
if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible()) &&
(!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */
|| !e.relatedTarget)) {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible())) {
if (!e.relatedTarget ||
!/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
}
}
}).on('dragover', function(e) {
var event = e.originalEvent;
@ -646,7 +650,6 @@ define([
documentHolderView.createDelayedElements();
toolbarController.createDelayedElements();
rightmenuController.createDelayedElements();
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
var shapes = me.api.asc_getPropertyEditorShapes();
@ -657,6 +660,8 @@ define([
me.updateThemeColors();
}
rightmenuController.createDelayedElements();
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
@ -748,6 +753,9 @@ define([
return;
}
if (params.asc_getRights() !== Asc.c_oRights.Edit)
this.permissions.edit = false;
this.appOptions.canAutosave = true;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
@ -1076,7 +1084,7 @@ define([
break;
case Asc.c_oAscError.ID.CoAuthoringDisconnect:
config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect;
config.msg = this.errorViewerDisconnect;
break;
case Asc.c_oAscError.ID.ConvertationPassword:
@ -1144,6 +1152,10 @@ define([
config.msg = this.errorFrmlWrongReferences;
break;
case Asc.c_oAscError.ID.CopyMultiselectAreaError:
config.msg = this.errorCopyMultiselectArea;
break;
default:
config.msg = this.errorDefaultMessage.replace('%1', id);
break;
@ -1708,7 +1720,7 @@ define([
var app = this.getApplication(),
filemenu = app.getController('LeftMenu').getView('LeftMenu').getMenu('file');
app.getController('Viewport').getView('Common.Views.Header').setDocumentCaption(meta.title);
this.updateWindowTitle(true);
this.updateWindowTitle(this.api.asc_isDocumentModified(), true);
this.appOptions.spreadsheet.title = meta.title;
filemenu.loadDocument({doc:this.appOptions.spreadsheet});
filemenu.panels['info'].updateInfo(this.appOptions.spreadsheet);
@ -1969,11 +1981,12 @@ define([
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
confirmPutMergeRange: 'The source data contains merged cells.<br>They will be unmerged before they are pasted into the table.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',
saveErrorText: 'An error has occurred while saving the file'
saveErrorText: 'An error has occurred while saving the file',
errorCopyMultiselectArea: 'This command cannot be used with multiple selections.<br>Select a single range and try again.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -185,7 +185,8 @@ define([
this._settings[settingsType].hidden = 0;
}
var lastactive = -1, currentactive, priorityactive = -1;
var lastactive = -1, currentactive, priorityactive = -1,
activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; ++i) {
var pnl = this._settings[i];
if (pnl===undefined) continue;
@ -193,7 +194,7 @@ define([
if ( pnl.hidden ) {
if ( !pnl.btn.isDisabled() )
pnl.btn.setDisabled(true);
if (this.rightmenu.GetActivePane() == pnl.panelId)
if (activePane == pnl.panelId)
currentactive = -1;
} else {
if ( pnl.btn.isDisabled() )
@ -202,7 +203,7 @@ define([
if ( pnl.needShow ) {
pnl.needShow = false;
priorityactive = i;
} else if (this.rightmenu.GetActivePane() == pnl.panelId)
} else if (activePane == pnl.panelId)
currentactive = i;
pnl.panel.setLocked(pnl.locked);
}
@ -275,6 +276,7 @@ define([
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this));
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
this.rightmenu.shapeSettings.createDelayedElements();
this.onSelectionChanged(this.api.asc_getCellInfo());
}
},

View file

@ -43,6 +43,7 @@ define([
'common/main/lib/component/Window',
'common/main/lib/view/CopyWarningDialog',
'common/main/lib/view/ImageFromUrlDialog',
'common/main/lib/util/define',
'spreadsheeteditor/main/app/view/Toolbar',
'spreadsheeteditor/main/app/collection/TableTemplates',
'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog',
@ -209,6 +210,7 @@ define([
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.menu.on('item:click', _.bind(this.onInsertTextClick, this));
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
toolbar.mnuitemSortAZ.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
@ -270,10 +272,11 @@ define([
this.api.asc_registerCallback('asc_onInitTablePictures', _.bind(this.onApiInitTableTemplates, this));
this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onLockDefNameManager', _.bind(this.onLockDefNameManager, this));
this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this));
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this));
},
onNewDocument: function(btn, e) {
@ -1303,6 +1306,9 @@ define([
if (me.toolbar.btnTableTemplate.rendered)
me.fillTableTemplates();
if (me.toolbar.btnInsertEquation.rendered)
me.fillEquations();
}, 100);
}
@ -1417,8 +1423,8 @@ define([
window.styles_loaded = true;
},
onApiCoAuthoringDisconnect: function() {
this.toolbar.setMode({isDisconnected:true});
onApiCoAuthoringDisconnect: function(disableDownload) {
this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload});
this.editMode = false;
},
@ -2090,6 +2096,200 @@ define([
}
},
fillEquations: function() {
if (!this.toolbar.btnInsertEquation.rendered) return;
var me = this, equationsStore = this.getApplication().getCollection('EquationGroups');
me.equationPickers = [];
me.toolbar.btnInsertEquation.menu.removeAll();
for (var i = 0; i < equationsStore.length; ++i) {
var equationGroup = equationsStore.at(i);
var menuItem = new Common.UI.MenuItem({
caption: equationGroup.get('groupName'),
menu: new Common.UI.Menu({
menuAlign: 'tl-tr',
items: [
{ template: _.template('<div id="id-toolbar-menu-equationgroup' + i +
'" class="menu-shape" style="width:' + (equationGroup.get('groupWidth') + 8) + 'px; ' +
equationGroup.get('groupHeight') + 'margin-left:5px;"></div>') }
]
})
});
me.toolbar.btnInsertEquation.menu.addItem(menuItem);
var equationPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-equationgroup' + i),
store: equationGroup.get('groupStore'),
parentMenu: menuItem.menu,
showLast: false,
itemTemplate: _.template('<div class="item-equation" '+
'style="background-position:<%= posX %>px <%= posY %>px;" >' +
'<div style="width:<%= width %>px;height:<%= height %>px;" id="<%= id %>">')
});
if (equationGroup.get('groupHeight').length) {
me.equationPickers.push(equationPicker);
me.toolbar.btnInsertEquation.menu.on('show:after', function () {
if (me.equationPickers.length) {
var element = $(this.el).find('.over').find('.menu-shape');
if (element.length) {
for (var i = 0; i < me.equationPickers.length; ++i) {
if (element[0].id == me.equationPickers[i].el.id) {
me.equationPickers[i].scroller.update({alwaysVisibleY: true});
me.equationPickers.splice(i, 1);
return;
}
}
}
}
});
}
equationPicker.on('item:click', function(picker, item, record, e) {
if (me.api) {
me.api.asc_AddMath(record.get('data').equationType);
if (me.toolbar.btnInsertText.pressed) {
me.toolbar.btnInsertText.toggle(false, true);
}
if (me.toolbar.btnInsertShape.pressed) {
me.toolbar.btnInsertShape.toggle(false, true);
}
if (e.type !== 'click')
me.toolbar.btnInsertEquation.menu.hide();
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertEquation);
Common.component.Analytics.trackEvent('ToolBar', 'Add Equation');
}
});
}
},
onInsertEquationClick: function() {
if (this.api && !this._state.in_equation) {
this.api.asc_AddMath();
Common.component.Analytics.trackEvent('ToolBar', 'Add Equation');
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation);
},
onMathTypes: function(equation) {
var equationgrouparray = [],
equationsStore = this.getCollection('EquationGroups');
equationsStore.reset();
// equations groups
var c_oAscMathMainTypeStrings = {};
// [translate, count cells, scroll]
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Symbol ] = [this.textSymbols, 11];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Fraction ] = [this.textFraction, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Script ] = [this.textScript, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Radical ] = [this.textRadical, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Integral ] = [this.textIntegral, 3, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.LargeOperator] = [this.textLargeOperator, 5, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Bracket ] = [this.textBracket, 4, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Function ] = [this.textFunction, 3, true];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Accent ] = [this.textAccent, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.LimitLog ] = [this.textLimitAndLog, 3];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Operator ] = [this.textOperator, 4];
c_oAscMathMainTypeStrings[Common.define.c_oAscMathMainType.Matrix ] = [this.textMatrix, 4, true];
// equations sub groups
// equations types
var translationTable = {}, name = '', translate = '';
for (name in Common.define.c_oAscMathType) {
if (Common.define.c_oAscMathType.hasOwnProperty(name)) {
var arr = name.split('_');
if (arr.length==2 && arr[0]=='Symbol') {
translate = 'txt' + arr[0] + '_' + arr[1].toLocaleLowerCase();
} else
translate = 'txt' + name;
translationTable[Common.define.c_oAscMathType[name]] = this[translate];
}
}
var i,id = 0, count = 0, length = 0, width = 0, height = 0, store = null, list = null, eqStore = null, eq = null;
if (equation) {
count = equation.get_Data().length;
if (count) {
for (var j = 0; j < count; ++j) {
id = equation.get_Data()[j].get_Id();
width = equation.get_Data()[j].get_W();
height = equation.get_Data()[j].get_H();
store = new Backbone.Collection([], {
model: SSE.Models.EquationModel
});
if (store) {
var allItemsCount = 0, itemsCount = 0, ids = 0;
length = equation.get_Data()[j].get_Data().length;
for (i = 0; i < length; ++i) {
eqStore = equation.get_Data()[j].get_Data()[i];
itemsCount = eqStore.get_Data().length;
for (var p = 0; p < itemsCount; ++p) {
eq = eqStore.get_Data()[p];
ids = eq.get_Id();
translate = '';
if (translationTable.hasOwnProperty(ids)) {
translate = translationTable[ids];
}
store.add({
data : {equationType: ids},
tip : translate,
allowSelected : true,
selected : false,
width : eqStore.get_W(),
height : eqStore.get_H(),
posX : -eq.get_X(),
posY : -eq.get_Y()
});
}
allItemsCount += itemsCount;
}
width = c_oAscMathMainTypeStrings[id][1] * (width + 10); // 4px margin + 4px margin + 1px border + 1px border
var normHeight = parseInt(370 / (height + 10)) * (height + 10);
equationgrouparray.push({
groupName : c_oAscMathMainTypeStrings[id][0],
groupStore : store,
groupWidth : width,
groupHeight : c_oAscMathMainTypeStrings[id][2] ? ' height:'+ normHeight +'px!important; ' : ''
});
}
}
equationsStore.add(equationgrouparray);
this.fillEquations();
}
}
},
attachToControlEvents: function() {
// this.control({
// 'menu[action=table-templates]':{
@ -2139,7 +2339,8 @@ define([
is_shape_text = seltype == Asc.c_oAscSelectionType.RangeShapeText,
is_shape = seltype == Asc.c_oAscSelectionType.RangeShape,
is_image = seltype == Asc.c_oAscSelectionType.RangeImage,
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart;
is_equation = seltype == Asc.c_oAscSelectionType.RangeMath,
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart || is_equation;
if ( coauth_disable ) {
toolbar.lockToolbar(SSE.enumLock.coAuth, coauth_disable);
@ -2152,6 +2353,7 @@ define([
case Asc.c_oAscSelectionType.RangeShapeText: type = _set.selShapeText; break;
case Asc.c_oAscSelectionType.RangeChart: type = _set.selChart; break;
case Asc.c_oAscSelectionType.RangeChartText: type = _set.selChartText; break;
case Asc.c_oAscSelectionType.RangeMath: type = _set.selEquation; break;
}
toolbar.lockToolbar(type, type != seltype, {
@ -2166,7 +2368,7 @@ define([
toolbar.mnuitemClearFilter
],
merge: true,
clear: [_set.selImage, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.coAuth]
clear: [_set.selImage, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selEquation, _set.coAuth]
});
}
@ -2318,6 +2520,347 @@ define([
textWarning : 'Warning',
textFontSizeErr : 'The entered value is incorrect.<br>Please enter a numeric value between 1 and 409',
textCancel : 'Cancel',
confirmAddFontName : 'The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the device fonts, the saved font will be used when it is available.<br>Do you want to continue?'
confirmAddFontName : 'The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the device fonts, the saved font will be used when it is available.<br>Do you want to continue?',
textSymbols : 'Symbols',
textFraction : 'Fraction',
textScript : 'Script',
textRadical : 'Radical',
textIntegral : 'Integral',
textLargeOperator : 'Large Operator',
textBracket : 'Bracket',
textFunction : 'Function',
textAccent : 'Accent',
textLimitAndLog : 'Limit And Log',
textOperator : 'Operator',
textMatrix : 'Matrix',
txtSymbol_pm : 'Plus Minus',
txtSymbol_infinity : 'Infinity',
txtSymbol_equals : 'Equal',
txtSymbol_neq : 'Not Equal To',
txtSymbol_about : 'Approximately',
txtSymbol_times : 'Multiplication Sign',
txtSymbol_div : 'Division Sign',
txtSymbol_factorial : 'Factorial',
txtSymbol_propto : 'Proportional To',
txtSymbol_less : 'Less Than',
txtSymbol_ll : 'Much Less Than',
txtSymbol_greater : 'Greater Than',
txtSymbol_gg : 'Much Greater Than',
txtSymbol_leq : 'Less Than or Equal To',
txtSymbol_geq : 'Greater Than or Equal To',
txtSymbol_mp : 'Minus Plus',
txtSymbol_cong : 'Approximately Equal To',
txtSymbol_approx : 'Almost Equal To',
txtSymbol_equiv : 'Identical To',
txtSymbol_forall : 'For All',
txtSymbol_additional : 'Complement',
txtSymbol_partial : 'Partial Differential',
txtSymbol_sqrt : 'Radical Sign',
txtSymbol_cbrt : 'Cube Root',
txtSymbol_qdrt : 'Fourth Root',
txtSymbol_cup : 'Union',
txtSymbol_cap : 'Intersection',
txtSymbol_emptyset : 'Empty Set',
txtSymbol_percent : 'Percentage',
txtSymbol_degree : 'Degrees',
txtSymbol_fahrenheit : 'Degrees Fahrenheit',
txtSymbol_celsius : 'Degrees Celsius',
txtSymbol_inc : 'Increment',
txtSymbol_nabla : 'Nabla',
txtSymbol_exists : 'There Exist',
txtSymbol_notexists : 'There Does Not Exist',
txtSymbol_in : 'Element Of',
txtSymbol_ni : 'Contains as Member',
txtSymbol_leftarrow : 'Left Arrow',
txtSymbol_uparrow : 'Up Arrow',
txtSymbol_rightarrow : 'Right Arrow',
txtSymbol_downarrow : 'Down Arrow',
txtSymbol_leftrightarrow : 'Left-Right Arrow',
txtSymbol_therefore : 'Therefore',
txtSymbol_plus : 'Plus',
txtSymbol_minus : 'Minus',
txtSymbol_not : 'Not Sign',
txtSymbol_ast : 'Asterisk Operator',
txtSymbol_bullet : 'Bulet Operator',
txtSymbol_vdots : 'Vertical Ellipsis',
txtSymbol_cdots : 'Midline Horizontal Ellipsis',
txtSymbol_rddots : 'Up Right Diagonal Ellipsis',
txtSymbol_ddots : 'Down Right Diagonal Ellipsis',
txtSymbol_aleph : 'Alef',
txtSymbol_beth : 'Bet',
txtSymbol_qed : 'End of Proof',
txtSymbol_alpha : 'Alpha',
txtSymbol_beta : 'Beta',
txtSymbol_gamma : 'Gamma',
txtSymbol_delta : 'Delta',
txtSymbol_varepsilon : 'Epsilon Variant',
txtSymbol_epsilon : 'Epsilon',
txtSymbol_zeta : 'Zeta',
txtSymbol_eta : 'Eta',
txtSymbol_theta : 'Theta',
txtSymbol_vartheta : 'Theta Variant',
txtSymbol_iota : 'Iota',
txtSymbol_kappa : 'Kappa',
txtSymbol_lambda : 'Lambda',
txtSymbol_mu : 'Mu',
txtSymbol_nu : 'Nu',
txtSymbol_xsi : 'Xi',
txtSymbol_o : 'Omicron',
txtSymbol_pi : 'Pi',
txtSymbol_varpi : 'Pi Variant',
txtSymbol_rho : 'Rho',
txtSymbol_varrho : 'Rho Variant',
txtSymbol_sigma : 'Sigma',
txtSymbol_varsigma : 'Sigma Variant',
txtSymbol_tau : 'Tau',
txtSymbol_upsilon : 'Upsilon',
txtSymbol_varphi : 'Phi Variant',
txtSymbol_phi : 'Phi',
txtSymbol_chi : 'Chi',
txtSymbol_psi : 'Psi',
txtSymbol_omega : 'Omega',
txtFractionVertical : 'Stacked Fraction',
txtFractionDiagonal : 'Skewed Fraction',
txtFractionHorizontal : 'Linear Fraction',
txtFractionSmall : 'Small Fraction',
txtFractionDifferential_1 : 'Differential',
txtFractionDifferential_2 : 'Differential',
txtFractionDifferential_3 : 'Differential',
txtFractionDifferential_4 : 'Differential',
txtFractionPi_2 : 'Pi Over 2',
txtScriptSup : 'Superscript',
txtScriptSub : 'Subscript',
txtScriptSubSup : 'Subscript-Superscript',
txtScriptSubSupLeft : 'Left Subscript-Superscript',
txtScriptCustom_1 : 'Script',
txtScriptCustom_2 : 'Script',
txtScriptCustom_3 : 'Script',
txtScriptCustom_4 : 'Script',
txtRadicalSqrt : 'Square Root',
txtRadicalRoot_n : 'Radical With Degree',
txtRadicalRoot_2 : 'Square Root With Degree',
txtRadicalRoot_3 : 'Cubic Root',
txtRadicalCustom_1 : 'Radical',
txtRadicalCustom_2 : 'Radical',
txtIntegral : 'Integral',
txtIntegralSubSup : 'Integral',
txtIntegralCenterSubSup : 'Integral',
txtIntegralDouble : 'Double Integral',
txtIntegralDoubleSubSup : 'Double Integral',
txtIntegralDoubleCenterSubSup : 'Double Integral',
txtIntegralTriple : 'Triple Integral',
txtIntegralTripleSubSup : 'Triple Integral',
txtIntegralTripleCenterSubSup : 'Triple Integral',
txtIntegralOriented : 'Contour Integral',
txtIntegralOrientedSubSup : 'Contour Integral',
txtIntegralOrientedCenterSubSup : 'Contour Integral',
txtIntegralOrientedDouble : 'Surface Integral',
txtIntegralOrientedDoubleSubSup : 'Surface Integral',
txtIntegralOrientedDoubleCenterSubSup : 'Surface Integral',
txtIntegralOrientedTriple : 'Volume Integral',
txtIntegralOrientedTripleSubSup : 'Volume Integral',
txtIntegralOrientedTripleCenterSubSup : 'Volume Integral',
txtIntegral_dx : 'Differential x',
txtIntegral_dy : 'Differential y',
txtIntegral_dtheta : 'Differential theta',
txtLargeOperator_Sum : 'Summation',
txtLargeOperator_Sum_CenterSubSup : 'Summation',
txtLargeOperator_Sum_SubSup : 'Summation',
txtLargeOperator_Sum_CenterSub : 'Summation',
txtLargeOperator_Sum_Sub : 'Summation',
txtLargeOperator_Prod : 'Product',
txtLargeOperator_Prod_CenterSubSup : 'Product',
txtLargeOperator_Prod_SubSup : 'Product',
txtLargeOperator_Prod_CenterSub : 'Product',
txtLargeOperator_Prod_Sub : 'Product',
txtLargeOperator_CoProd : 'Co-Product',
txtLargeOperator_CoProd_CenterSubSup : 'Co-Product',
txtLargeOperator_CoProd_SubSup : 'Co-Product',
txtLargeOperator_CoProd_CenterSub : 'Co-Product',
txtLargeOperator_CoProd_Sub : 'Co-Product',
txtLargeOperator_Union : 'Union',
txtLargeOperator_Union_CenterSubSup : 'Union',
txtLargeOperator_Union_SubSup : 'Union',
txtLargeOperator_Union_CenterSub : 'Union',
txtLargeOperator_Union_Sub : 'Union',
txtLargeOperator_Intersection : 'Intersection',
txtLargeOperator_Intersection_CenterSubSup : 'Intersection',
txtLargeOperator_Intersection_SubSup : 'Intersection',
txtLargeOperator_Intersection_CenterSub : 'Intersection',
txtLargeOperator_Intersection_Sub : 'Intersection',
txtLargeOperator_Disjunction : 'Vee',
txtLargeOperator_Disjunction_CenterSubSup : 'Vee',
txtLargeOperator_Disjunction_SubSup : 'Vee',
txtLargeOperator_Disjunction_CenterSub : 'Vee',
txtLargeOperator_Disjunction_Sub : 'Vee',
txtLargeOperator_Conjunction : 'Wedge',
txtLargeOperator_Conjunction_CenterSubSup : 'Wedge',
txtLargeOperator_Conjunction_SubSup : 'Wedge',
txtLargeOperator_Conjunction_CenterSub : 'Wedge',
txtLargeOperator_Conjunction_Sub : 'Wedge',
txtLargeOperator_Custom_1 : 'Summation',
txtLargeOperator_Custom_2 : 'Summation',
txtLargeOperator_Custom_3 : 'Summation',
txtLargeOperator_Custom_4 : 'Product',
txtLargeOperator_Custom_5 : 'Union',
txtBracket_Round : 'Brackets',
txtBracket_Square : 'Brackets',
txtBracket_Curve : 'Brackets',
txtBracket_Angle : 'Brackets',
txtBracket_LowLim : 'Brackets',
txtBracket_UppLim : 'Brackets',
txtBracket_Line : 'Brackets',
txtBracket_LineDouble : 'Brackets',
txtBracket_Square_OpenOpen : 'Brackets',
txtBracket_Square_CloseClose : 'Brackets',
txtBracket_Square_CloseOpen : 'Brackets',
txtBracket_SquareDouble : 'Brackets',
txtBracket_Round_Delimiter_2 : 'Brackets with Separators',
txtBracket_Curve_Delimiter_2 : 'Brackets with Separators',
txtBracket_Angle_Delimiter_2 : 'Brackets with Separators',
txtBracket_Angle_Delimiter_3 : 'Brackets with Separators',
txtBracket_Round_OpenNone : 'Single Bracket',
txtBracket_Round_NoneOpen : 'Single Bracket',
txtBracket_Square_OpenNone : 'Single Bracket',
txtBracket_Square_NoneOpen : 'Single Bracket',
txtBracket_Curve_OpenNone : 'Single Bracket',
txtBracket_Curve_NoneOpen : 'Single Bracket',
txtBracket_Angle_OpenNone : 'Single Bracket',
txtBracket_Angle_NoneOpen : 'Single Bracket',
txtBracket_LowLim_OpenNone : 'Single Bracket',
txtBracket_LowLim_NoneNone : 'Single Bracket',
txtBracket_UppLim_OpenNone : 'Single Bracket',
txtBracket_UppLim_NoneOpen : 'Single Bracket',
txtBracket_Line_OpenNone : 'Single Bracket',
txtBracket_Line_NoneOpen : 'Single Bracket',
txtBracket_LineDouble_OpenNone : 'Single Bracket',
txtBracket_LineDouble_NoneOpen : 'Single Bracket',
txtBracket_SquareDouble_OpenNone : 'Single Bracket',
txtBracket_SquareDouble_NoneOpen : 'Single Bracket',
txtBracket_Custom_1 : 'Case (Two Conditions)',
txtBracket_Custom_2 : 'Cases (Three Conditions)',
txtBracket_Custom_3 : 'Stack Object',
txtBracket_Custom_4 : 'Stack Object',
txtBracket_Custom_5 : 'Cases Example',
txtBracket_Custom_6 : 'Binomial Coefficient',
txtBracket_Custom_7 : 'Binomial Coefficient',
txtFunction_Sin : 'Sine Function',
txtFunction_Cos : 'Cosine Function',
txtFunction_Tan : 'Tangent Function',
txtFunction_Csc : 'Cosecant Function',
txtFunction_Sec : 'Secant Function',
txtFunction_Cot : 'Cotangent Function',
txtFunction_1_Sin : 'Inverse Sine Function',
txtFunction_1_Cos : 'Inverse Cosine Function',
txtFunction_1_Tan : 'Inverse Tangent Function',
txtFunction_1_Csc : 'Inverse Cosecant Function',
txtFunction_1_Sec : 'Inverse Secant Function',
txtFunction_1_Cot : 'Inverse Cotangent Function',
txtFunction_Sinh : 'Hyperbolic Sine Function',
txtFunction_Cosh : 'Hyperbolic Cosine Function',
txtFunction_Tanh : 'Hyperbolic Tangent Function',
txtFunction_Csch : 'Hyperbolic Cosecant Function',
txtFunction_Sech : 'Hyperbolic Secant Function',
txtFunction_Coth : 'Hyperbolic Cotangent Function',
txtFunction_1_Sinh : 'Hyperbolic Inverse Sine Function',
txtFunction_1_Cosh : 'Hyperbolic Inverse Cosine Function',
txtFunction_1_Tanh : 'Hyperbolic Inverse Tangent Function',
txtFunction_1_Csch : 'Hyperbolic Inverse Cosecant Function',
txtFunction_1_Sech : 'Hyperbolic Inverse Secant Function',
txtFunction_1_Coth : 'Hyperbolic Inverse Cotangent Function',
txtFunction_Custom_1 : 'Sine theta',
txtFunction_Custom_2 : 'Cos 2x',
txtFunction_Custom_3 : 'Tangent formula',
txtAccent_Dot : 'Dot',
txtAccent_DDot : 'Double Dot',
txtAccent_DDDot : 'Triple Dot',
txtAccent_Hat : 'Hat',
txtAccent_Check : 'Check',
txtAccent_Accent : 'Acute',
txtAccent_Grave : 'Grave',
txtAccent_Smile : 'Breve',
txtAccent_Tilde : 'Tilde',
txtAccent_Bar : 'Bar',
txtAccent_DoubleBar : 'Double Overbar',
txtAccent_CurveBracketTop : 'Overbrace',
txtAccent_CurveBracketBot : 'Underbrace',
txtAccent_GroupTop : 'Grouping Character Above',
txtAccent_GroupBot : 'Grouping Character Below',
txtAccent_ArrowL : 'Leftwards Arrow Above',
txtAccent_ArrowR : 'Rightwards Arrow Above',
txtAccent_ArrowD : 'Right-Left Arrow Above',
txtAccent_HarpoonL : 'Leftwards Harpoon Above',
txtAccent_HarpoonR : 'Rightwards Harpoon Above',
txtAccent_BorderBox : 'Boxed Formula (With Placeholder)',
txtAccent_BorderBoxCustom : 'Boxed Formula (Example)',
txtAccent_BarTop : 'Overbar',
txtAccent_BarBot : 'Underbar',
txtAccent_Custom_1 : 'Vector A',
txtAccent_Custom_2 : 'ABC With Overbar',
txtAccent_Custom_3 : 'x XOR y With Overbar',
txtLimitLog_LogBase : 'Logarithm',
txtLimitLog_Log : 'Logarithm',
txtLimitLog_Lim : 'Limit',
txtLimitLog_Min : 'Minimum',
txtLimitLog_Max : 'Maximum',
txtLimitLog_Ln : 'Natural Logarithm',
txtLimitLog_Custom_1 : 'Limit Example',
txtLimitLog_Custom_2 : 'Maximum Example',
txtOperator_ColonEquals : 'Colon Equal',
txtOperator_EqualsEquals : 'Equal Equal',
txtOperator_PlusEquals : 'Plus Equal',
txtOperator_MinusEquals : 'Minus Equal',
txtOperator_Definition : 'Equal to By Definition',
txtOperator_UnitOfMeasure : 'Measured By',
txtOperator_DeltaEquals : 'Delta Equal To',
txtOperator_ArrowL_Top : 'Leftwards Arrow Above',
txtOperator_ArrowR_Top : 'Rightwards Arrow Above',
txtOperator_ArrowL_Bot : 'Leftwards Arrow Below',
txtOperator_ArrowR_Bot : 'Rightwards Arrow Below',
txtOperator_DoubleArrowL_Top : 'Leftwards Arrow Above',
txtOperator_DoubleArrowR_Top : 'Rightwards Arrow Above',
txtOperator_DoubleArrowL_Bot : 'Leftwards Arrow Below',
txtOperator_DoubleArrowR_Bot : 'Rightwards Arrow Below',
txtOperator_ArrowD_Top : 'Right-Left Arrow Above',
txtOperator_ArrowD_Bot : 'Right-Left Arrow Above',
txtOperator_DoubleArrowD_Top : 'Right-Left Arrow Below',
txtOperator_DoubleArrowD_Bot : 'Right-Left Arrow Below',
txtOperator_Custom_1 : 'Yileds',
txtOperator_Custom_2 : 'Delta Yields',
txtMatrix_1_2 : '1x2 Empty Matrix',
txtMatrix_2_1 : '2x1 Empty Matrix',
txtMatrix_1_3 : '1x3 Empty Matrix',
txtMatrix_3_1 : '3x1 Empty Matrix',
txtMatrix_2_2 : '2x2 Empty Matrix',
txtMatrix_2_3 : '2x3 Empty Matrix',
txtMatrix_3_2 : '3x2 Empty Matrix',
txtMatrix_3_3 : '3x3 Empty Matrix',
txtMatrix_Dots_Center : 'Midline Dots',
txtMatrix_Dots_Baseline : 'Baseline Dots',
txtMatrix_Dots_Vertical : 'Vertical Dots',
txtMatrix_Dots_Diagonal : 'Diagonal Dots',
txtMatrix_Identity_2 : '2x2 Identity Matrix',
txtMatrix_Identity_2_NoZeros : '3x3 Identity Matrix',
txtMatrix_Identity_3 : '3x3 Identity Matrix',
txtMatrix_Identity_3_NoZeros : '3x3 Identity Matrix',
txtMatrix_2_2_RoundBracket : 'Empty Matrix with Brackets',
txtMatrix_2_2_SquareBracket : 'Empty Matrix with Brackets',
txtMatrix_2_2_LineBracket : 'Empty Matrix with Brackets',
txtMatrix_2_2_DLineBracket : 'Empty Matrix with Brackets',
txtMatrix_Flat_Round : 'Sparse Matrix',
txtMatrix_Flat_Square : 'Sparse Matrix'
}, SSE.Controllers.Toolbar || {}));
});

View file

@ -0,0 +1,71 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EquationGroup.js
*
* Created by Alexey Musinov on 29/10/14
* Copyright (c) 2014 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone'
], function(Backbone){ 'use strict';
SSE.Models = SSE.Models || {};
SSE.Models.EquationModel = Backbone.Model.extend({
defaults: function() {
return {
id : Common.UI.getId(),
data : null,
width : 0,
height : 0,
posX : 0,
posY : 0
}
}
});
SSE.Models.EquationGroup = Backbone.Model.extend({
defaults: function() {
return {
id : Common.UI.getId(),
groupName : null,
groupId : null,
groupStore : null
}
}
});
});

View file

@ -222,7 +222,8 @@
</div>
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserthyperlink"></span>
<span class="btn-placeholder " id="id-toolbar-full-placeholder-btn-insertshape"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertshape"></span>
<span class="btn-placeholder hidden" id="id-toolbar-full-placeholder-btn-insertequation"></span>
</div>
</div>
<div class="separator long"></div>

View file

@ -119,9 +119,10 @@ define([
this.cmbCondition1 = new Common.UI.ComboBox({
el : $('#id-search-begin-digital-combo', this.$window),
menuStyle : 'min-width: 225px;',
menuStyle : 'min-width: 225px;max-height: 135px;',
cls : 'input-group-nr',
data : this.conditions,
scrollAlwaysVisible: true,
editable : false
});
this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals);
@ -130,9 +131,10 @@ define([
this.cmbCondition2 = new Common.UI.ComboBox({
el : $('#id-search-end-digital-combo', this.$window),
menuStyle : 'min-width: 225px;',
menuStyle : 'min-width: 225px;max-height: 135px;',
cls : 'input-group-nr',
data : this.conditions,
scrollAlwaysVisible: true,
editable : false
});
this.cmbCondition2.setValue(0);
@ -150,39 +152,34 @@ define([
name : 'asc-radio-filter-tab'
});
this.txtValue1 = new Common.UI.InputField({
this.cmbValue1 = new Common.UI.ComboBox({
el : $('#id-sd-cell-search-begin', this.$window),
template: _.template([
'<div class="input-field" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'name="<%= name %>" ',
'class="form-control <%= cls %>" style="float:none" ',
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'>',
'</div>'].join('')),
allowBlank : true,
validateOnChange: true,
validation : function () { return true; }
cls : 'input-group-nr',
menuStyle : 'min-width: 225px;max-height: 135px;',
scrollAlwaysVisible: true,
data : []
});
this.txtValue2 = new Common.UI.InputField({
this.cmbValue2 = new Common.UI.ComboBox({
el : $('#id-sd-cell-search-end', this.$window),
template: _.template([
'<div class="input-field" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'name="<%= name %>" ',
'class="form-control <%= cls %>" style="float:none" ',
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'>',
'</div>'].join('')),
allowBlank : true,
validateOnChange: true,
validation : function () { return true; }
cls : 'input-group-nr',
menuStyle : 'min-width: 225px;max-height: 135px;',
scrollAlwaysVisible: true,
data : []
});
var comparator = function(item1, item2) {
var n1 = item1.get('intval'),
n2 = item2.get('intval'),
isN1 = n1!==undefined,
isN2 = n2!==undefined;
if (isN1 !== isN2) return (isN1) ? -1 : 1;
!isN1 && (n1 = item1.get('value').toLowerCase()) && (n2 = item2.get('value').toLowerCase());
if (n1==n2) return 0;
return (n2=='' || n1!=='' && n1<n2) ? -1 : 1;
};
this.cmbValue1.store.comparator = this.cmbValue2.store.comparator = comparator;
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.loadDefaults();
@ -192,8 +189,8 @@ define([
var me = this;
_.defer(function () {
if (me.txtValue1) {
me.txtValue1.focus();
if (me.cmbValue1) {
me.cmbValue1._input.focus();
}
}, 500);
},
@ -221,8 +218,18 @@ define([
loadDefaults: function () {
if (this.properties && this.rbOr && this.rbAnd &&
this.cmbCondition1 && this.cmbCondition2 && this.txtValue1 && this.txtValue2) {
this.cmbCondition1 && this.cmbCondition2 && this.cmbValue1 && this.cmbValue2) {
var arr = [];
this.properties.asc_getValues().forEach(function (item) {
var value = item.asc_getText();
if (!_.isEmpty(value)) {
arr.push({value: value, displayValue: value,
intval: (!isNaN(parseFloat(value)) && isFinite(value)) ? parseFloat(value) : undefined});
}
});
this.cmbValue1.setData(arr);
this.cmbValue2.setData(arr);
var filterObj = this.properties.asc_getFilterObj();
if (filterObj.asc_getType() == Asc.c_oAscAutoFilterTypes.CustomFilters) {
var customFilter = filterObj.asc_getFilter(),
@ -233,14 +240,14 @@ define([
this.cmbCondition1.setValue(customFilters[0].asc_getOperator() || Asc.c_oAscCustomAutoFilter.equals);
this.cmbCondition2.setValue((customFilters.length>1) ? (customFilters[1].asc_getOperator() || 0) : 0);
this.txtValue1.setValue(null === customFilters[0].asc_getVal() ? '' : customFilters[0].asc_getVal());
this.txtValue2.setValue((customFilters.length>1) ? (null === customFilters[1].asc_getVal() ? '' : customFilters[1].asc_getVal()) : '');
this.cmbValue1.setValue(null === customFilters[0].asc_getVal() ? '' : customFilters[0].asc_getVal());
this.cmbValue2.setValue((customFilters.length>1) ? (null === customFilters[1].asc_getVal() ? '' : customFilters[1].asc_getVal()) : '');
}
}
},
save: function () {
if (this.api && this.properties && this.rbOr && this.rbAnd &&
this.cmbCondition1 && this.cmbCondition2 && this.txtValue1 && this.txtValue2) {
this.cmbCondition1 && this.cmbCondition2 && this.cmbValue1 && this.cmbValue2) {
var filterObj = this.properties.asc_getFilterObj();
filterObj.asc_setFilter(new Asc.CustomFilters());
@ -253,10 +260,10 @@ define([
customFilter.asc_setAnd(this.rbAnd.getValue());
customFilters[0].asc_setOperator(this.cmbCondition1.getValue());
customFilters[0].asc_setVal(this.txtValue1.getValue());
customFilters[0].asc_setVal(this.cmbValue1.getValue());
if (this.cmbCondition2.getValue() !== 0) {
customFilters[1].asc_setOperator(this.cmbCondition2.getValue() || undefined);
customFilters[1].asc_setVal(this.txtValue2.getValue());
customFilters[1].asc_setVal(this.cmbValue2.getValue());
}
this.api.asc_applyAutoFilter(this.properties);
@ -390,8 +397,8 @@ define([
var me = this;
_.defer(function () {
if (me.txtValue1) {
me.txtValue1.focus();
if (me.spnCount) {
me.spnCount.$input.focus();
}
}, 500);
},

View file

@ -127,10 +127,8 @@ define([
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.ShowHideElem(!!(props && props.asc_getChartProperties && props.asc_getChartProperties()));
this.disableControls(this._locked);
@ -852,6 +850,7 @@ define([
this.createDelayedControls();
this.updateMetricUnit();
this.UpdateThemeColors();
this._initSettings = false;
},
ShowHideElem: function(isChart) {

View file

@ -198,6 +198,7 @@ define([
applyMode: function() {
this.items[5][this.mode.canPrint?'show':'hide']();
this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.items[7][this.mode.canOpenRecent?'show':'hide']();
this.items[8][this.mode.canCreateNew?'show':'hide']();
this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
@ -242,7 +243,10 @@ define([
if (mode.isDisconnected) {
this.mode.canEdit = this.mode.isEdit = false;
this.mode.canOpenRecent = this.mode.canCreateNew = false;
this.mode.isDisconnected = mode.isDisconnected;
this.mode.canRename = false;
this.mode.canPrint = false;
this.mode.canDownload = false;
} else {
this.mode = mode;
}

View file

@ -193,13 +193,12 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);

View file

@ -177,10 +177,8 @@ define([
},
ChangeSettings: function(prop) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
}
this.disableControls(this._locked);
@ -328,6 +326,7 @@ define([
createDelayedElements: function() {
this.createDelayedControls();
this.updateMetricUnit();
this._initSettings = false;
},
openAdvancedSettings: function(e) {

View file

@ -234,7 +234,7 @@ define([
},
GetActivePane: function() {
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
},
clearSelection: function() {

View file

@ -698,7 +698,6 @@ define([
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (this.imgprops==null)
this.imgprops = new Asc.asc_CImgProperty();
@ -1336,6 +1335,7 @@ define([
this.fillAutoShapes();
this.UpdateThemeColors();
this._initSettings = false;
},
onInitStandartTextures: function(texture) {

View file

@ -300,7 +300,7 @@ define([
});
});
this.tabbar.$el.append('<div class="menu-backdrop" data-toggle="dropdown" style="width:0; height:0;"/>');
this.tabbar.$el.append('<div class="menu-backdrop dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>');
this.tabMenu.render(this.tabbar.$el);
this.tabMenu.on('show:after', _.bind(this.onTabMenuAfterShow, this));
this.tabMenu.on('hide:after', _.bind(this.onTabMenuAfterHide, this));
@ -445,6 +445,7 @@ define([
usertip.setContent();
}
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
},

View file

@ -249,13 +249,13 @@ define([
}, this));
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit);
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings) {
if (this._initSettings)
this.createDelayedControls();
this._initSettings = false;
}
this.disableControls(this._locked);

View file

@ -664,7 +664,6 @@ define([
if (this._initSettings)
this.createDelayedElements();
this._initSettings = false;
if (props && props.asc_getShapeProperties() && props.asc_getShapeProperties().get_TextArtProperties())
{
@ -1310,6 +1309,7 @@ define([
this.UpdateThemeColors();
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
this._initSettings = false;
},
onInitStandartTextures: function(texture) {

View file

@ -75,7 +75,8 @@ define([
ruleFilter: 'rule-filter',
ruleDelFilter: 'rule-clear-filter',
menuFileOpen: 'menu-file-open',
cantPrint: 'cant-print'
cantPrint: 'cant-print',
selEquation: 'sel-equation'
};
SSE.Views.Toolbar = Backbone.View.extend(_.extend({
@ -325,7 +326,7 @@ define([
icls : 'btn-border-out',
borderId : 'outer',
borderswidth: 'thin',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
split : true,
menu : true
});
@ -373,7 +374,7 @@ define([
enableToggle: true,
allowDepress: true,
split : true,
lock : [_set.editCell, _set.selShape, _set.selShapeText, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleMerge],
lock : [_set.editCell, _set.selShape, _set.selShapeText, _set.selChart, _set.selChartText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleMerge],
menu : new Common.UI.Menu({
items: [
{
@ -427,7 +428,7 @@ define([
id : 'id-toolbar-rtn-wrap',
cls : 'btn-toolbar',
iconCls : 'btn-wrap',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
enableToggle: true,
allowDepress: true
});
@ -436,7 +437,7 @@ define([
id : 'id-toolbar-rtn-textorient',
cls : 'btn-toolbar',
iconCls : 'btn-text-orient',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
items: [
{
@ -573,25 +574,34 @@ define([
})
});
this.btnInsertEquation = new Common.UI.Button({
id : 'id-toolbar-btn-insertequation',
cls : 'btn-toolbar',
iconCls : 'btn-insertequation',
split : true,
lock : [_set.editCell, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({cls: 'menu-shapes'})
});
me.btnSortDown = new Common.UI.Button({
id : 'id-toolbar-btn-sort-down',
cls : 'btn-toolbar',
iconCls : 'btn-sort-down',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleFilter]
});
me.btnSortUp = new Common.UI.Button({
id : 'id-toolbar-btn-sort-up',
cls : 'btn-toolbar',
iconCls : 'btn-sort-up',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleFilter]
});
me.btnSetAutofilter = new Common.UI.Button({
id : 'id-toolbar-btn-setautofilter',
cls : 'btn-toolbar',
iconCls : 'btn-autofilter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleFilter],
enableToggle: true
});
@ -599,7 +609,7 @@ define([
id : 'id-toolbar-btn-clearfilter',
cls : 'btn-toolbar',
iconCls : 'btn-clear-filter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleDelFilter]
});
me.btnSearch = new Common.UI.Button({
@ -613,7 +623,7 @@ define([
id : 'id-toolbar-btn-ttempl',
cls : 'btn-toolbar',
iconCls : 'btn-ttempl',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleFilter],
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-table-templates" style="width: 288px; height: 300px; margin: 0px 4px;"></div>') }
@ -624,11 +634,11 @@ define([
me.listStyles = new Common.UI.ComboDataView({
cls : 'combo-styles',
enableKeyEvents : true,
itemWidth : 104,
itemWidth : 112,
itemHeight : 38,
hint : this.tipCellStyle,
menuMaxHeight : 226,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
beforeOpenHandler: function(e) {
var cmp = this,
menu = cmp.openButton.menu,
@ -664,7 +674,7 @@ define([
cls : 'btn-toolbar btn-text-value',
caption : me.txtGeneral,
style : 'width: 100%;',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRange, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRange, _set.selEquation, _set.lostConnect, _set.coAuth],
menu : true
});
@ -672,7 +682,7 @@ define([
id : 'id-toolbar-btn-percent-style',
cls : 'btn-toolbar',
iconCls : 'btn-percent-style',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
styleName : 'Percent'
});
@ -680,7 +690,7 @@ define([
id : 'id-toolbar-btn-accounting-style',
cls : 'btn-toolbar',
iconCls : 'btn-currency-style',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
styleName : 'Currency',
split : true,
menu : new Common.UI.Menu({
@ -714,14 +724,14 @@ define([
id : 'id-toolbar-btn-decdecimal',
cls : 'btn-toolbar',
iconCls : 'btn-decdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth]
});
me.btnIncDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-incdecimal',
cls : 'btn-toolbar',
iconCls : 'btn-incdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth]
});
me.btnInsertFormula = new Common.UI.Button({
@ -729,7 +739,7 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-formula',
split : true,
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRange, _set.lostConnect, _set.coAuth],
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRange, _set.selEquation, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
style : 'min-width: 110px',
items : [
@ -750,7 +760,7 @@ define([
id : 'id-toolbar-btn-insertrange',
cls : 'btn-toolbar',
iconCls : 'btn-named-range',
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.selRange],
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.selRange],
menu : new Common.UI.Menu({
style : 'min-width: 110px',
items : [
@ -786,22 +796,22 @@ define([
},
{
caption : me.txtClearText,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth],
value : Asc.c_oAscCleanOptions.Text
},
{
caption : me.txtClearFormat,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth],
value : Asc.c_oAscCleanOptions.Format
},
{
caption : me.txtClearComments,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth],
value : Asc.c_oAscCleanOptions.Comments
},
{
caption : me.txtClearHyper,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth],
value : Asc.c_oAscCleanOptions.Hyperlinks
}
]
@ -820,7 +830,7 @@ define([
id : 'id-toolbar-btn-addcell',
cls : 'btn-toolbar',
iconCls : 'btn-addcell',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
items : [
{
@ -847,7 +857,7 @@ define([
id : 'id-toolbar-btn-delcell',
cls : 'btn-toolbar',
iconCls : 'btn-delcell',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
items : [
{
@ -1037,32 +1047,32 @@ define([
id : 'id-toolbar-btn-autofilter',
cls : 'btn-toolbar',
iconCls : 'btn-autofilter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.lostConnect, _set.coAuth, _set.ruleFilter],
menu : new Common.UI.Menu({
items : [
me.mnuitemSortAZ = new Common.UI.MenuItem({
caption : me.txtSortAZ,
iconCls : 'mnu-sort-asc',
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth, _set.ruleFilter],
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth, _set.ruleFilter],
value : Asc.c_oAscSortOptions.Ascending
}),
me.mnuitemSortZA = new Common.UI.MenuItem({
caption : me.txtSortZA,
iconCls : 'mnu-sort-desc',
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth, _set.ruleFilter],
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth, _set.ruleFilter],
value : Asc.c_oAscSortOptions.Descending
}),
me.mnuitemAutoFilter = new Common.UI.MenuItem({
caption : me.txtFilter,
iconCls : 'mnu-filter-add',
checkable: true,
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth, _set.ruleFilter],
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth, _set.ruleFilter],
value : 'set-filter'
}),
me.mnuitemClearFilter = new Common.UI.MenuItem({
caption : me.txtClearFilter,
iconCls : 'mnu-filter-clear',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.coAuth, _set.ruleDelFilter],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selEquation, _set.coAuth, _set.ruleDelFilter],
value : 'clear-filter'
})
/*,{
@ -1084,7 +1094,7 @@ define([
me.btnItalic, me.btnUnderline, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop,
me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor,
me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape,
me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation,
me.btnInsertText, me.btnSortUp, me.btnSortDown, me.btnSetAutofilter, me.btnClearAutofilter, me.btnTableTemplate,
me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell,
me.btnNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink,
@ -1101,7 +1111,7 @@ define([
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
me.btnAlignMiddle, me.btnAlignBottom, me.btnHorizontalAlign, me.btnVerticalAlign,
me.btnInsertImage, me.btnInsertText, me.btnInsertShape, me.btnIncFontSize, me.btnDecFontSize,
me.btnInsertImage, me.btnInsertText, me.btnInsertShape, me.btnInsertEquation, me.btnIncFontSize, me.btnDecFontSize,
me.btnBold, me.btnItalic, me.btnUnderline, me.btnTextColor, me.btnBackColor,
me.btnInsertHyperlink, me.btnBorders, me.btnTextOrient, me.btnPercentStyle, me.btnCurrencyStyle, me.btnColorSchemas,
me.btnSettings, me.btnInsertFormula, me.btnNamedRange, me.btnDecDecimal, me.btnIncDecimal, me.btnNumberFormat, me.btnWrap,
@ -1230,6 +1240,7 @@ define([
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-inserthyperlink',this.btnInsertHyperlink);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-insertshape', this.btnInsertShape);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-text', this.btnInsertText);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-insertequation', this.btnInsertEquation);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-sortdesc', this.btnSortDown);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-sortasc', this.btnSortUp);
replacePlacholder('#id-toolbar-' + mode + '-placeholder-btn-setfilter', this.btnSetAutofilter);
@ -1294,6 +1305,7 @@ define([
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
this.btnInsertShape.updateHint(this.tipInsertShape);
this.btnInsertEquation.updateHint(this.tipInsertEquation);
this.btnSortDown.updateHint(this.txtSortAZ);
this.btnSortUp.updateHint(this.txtSortZA);
this.btnSetAutofilter.updateHint(this.txtFilter + ' (Ctrl+Shift+L)');
@ -1772,6 +1784,7 @@ define([
this.lockToolbar( SSE.enumLock.lostConnect, true );
this.lockToolbar( SSE.enumLock.lostConnect, true,
{array:[this.btnEditChart,this.btnUndo,this.btnRedo,this.btnOpenDocument,this.btnNewDocument,this.btnSave]} );
this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]});
} else {
this.mode = mode;
@ -2109,6 +2122,7 @@ define([
textInsSparklines: 'Sparklines',
textLineSpark: 'Line',
textColumnSpark: 'Column',
textWinLossSpark: 'Win/Loss'
textWinLossSpark: 'Win/Loss',
tipInsertEquation: 'Insert Equation'
}, SSE.Views.Toolbar || {}));
});

View file

@ -145,6 +145,7 @@
"SSE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"SSE.Controllers.Main.errorCoAuthoringDisconnect": "Server connection lost. The document cannot be edited right now.",
"SSE.Controllers.Main.errorConnectToServer": "The document could not be saved. Please check connection settings or contact your administrator.<br>When you click the 'OK' button, you will be prompted to download the document.<br><br>Find more information about connecting Document Server <a href=\"https://api.onlyoffice.com/editors/callback\" target=\"_blank\">here</a>",
"SSE.Controllers.Main.errorCopyMultiselectArea": "This command cannot be used with multiple selections.<br>Select a single range and try again.",
"SSE.Controllers.Main.errorCountArg": "An error in the entered formula.<br>Incorrect number of arguments is used.",
"SSE.Controllers.Main.errorCountArgExceed": "An error in the entered formula.<br>Number of arguments is exceeded.",
"SSE.Controllers.Main.errorCreateDefName": "The existing named ranges cannot be edited and the new ones cannot be created<br>at the moment as some of them are being edited.",
@ -173,7 +174,7 @@
"SSE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
"SSE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.",
"SSE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.<br>Wrong number of brackets is used.",
"SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error or use the Esc button to cancel the formula editing.",
"SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.",

View file

@ -167,7 +167,7 @@
"SSE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.",
"SSE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.",
"SSE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"SSE.Controllers.Main.errorWrongBracketsCount": "Un error en la fórmula introducida.<br>Número incorrecto de corchetes es usado.",
"SSE.Controllers.Main.errorWrongOperator": "Un error en la fórmula introducida.Operador inválido es usado.<br>Por favor, corrija el error o utilice el botón Esc para cancelar la edición de fórmulas.",
"SSE.Controllers.Main.leavePageText": "Usted tiene cambios no guardados en esta hoja de cálculo. Haga clic en 'Permanecer en esta página', después 'Guardar' para guardarlos. Haga clic en 'Abandonar esta página' para descartar todos los cambios no guardados.",

View file

@ -167,7 +167,7 @@
"SSE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.",
"SSE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier",
"SSE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"SSE.Controllers.Main.errorWrongBracketsCount": "Une erreur dans la formule entrée.<br>Nombre utilisé entre parenthèses est incorrect.",
"SSE.Controllers.Main.errorWrongOperator": "Une erreur dans la formule entrée.<br>Opérateur utilisé est incorrect.<br>Veuillez corriger l'erreur ou utilisez le bouton Esc pour annuler l'édition de formule.",
"SSE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans cette feuille de calcul. Cliquez sur 'Rester sur cette page ' ensuite 'Enregistrer' pour les enregistrer. Cliquez sur 'Quitter cette page' pour annuler toutes les modifications non enregistrées.",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -66,7 +66,7 @@
right: 0;
> label {
white-space: initial;
white-space: normal;
}
#status-users-list {

View file

@ -188,6 +188,7 @@
.toolbar-btn-icon(btn-border-diagdown, 43, @toolbar-icon-size);
.toolbar-btn-icon(btn-named-range, 77, @toolbar-icon-size);
.toolbar-btn-icon(btn-insertequation, 82, @toolbar-icon-size);
@menu-icon-size: 22px;
.menu-btn-icon(mnu-align-center, 0, @menu-icon-size);