Merge branch 'develop' into feature/sparklines
This commit is contained in:
commit
28f1d07c43
|
@ -371,6 +371,9 @@
|
|||
|
||||
if (!_config.document.key) {
|
||||
_config.document.key = 'xxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function (c) {var r = Math.random() * 16 | 0; return r.toString(16);});
|
||||
} else if (typeof _config.document.key !== 'string') {
|
||||
window.alert("The \"document.key\" parameter for the config object must be string. Please correct it.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ define([
|
|||
},
|
||||
|
||||
setMenu: function (m) {
|
||||
if (m && _.isObject(m) && _.isFunction(m.render)){
|
||||
if (this.rendered && m && _.isObject(m) && _.isFunction(m.render)){
|
||||
this.menu = m;
|
||||
this.menu.render(this.cmpEl);
|
||||
}
|
||||
|
|
|
@ -98,11 +98,6 @@ define([
|
|||
if (e) {
|
||||
var btn = $(e.target);
|
||||
if (btn && btn.hasClass('revision-restore')) {
|
||||
var tip = item.btnTip;
|
||||
if (tip) {
|
||||
tip.dontShow = true;
|
||||
tip.tip().remove();
|
||||
}
|
||||
if (record.get('isRevision'))
|
||||
Common.Gateway.requestRestore(record.get('revision'));
|
||||
else {
|
||||
|
|
|
@ -67,7 +67,12 @@ define([
|
|||
arrColors: [], // array of user colors for all changes of current version
|
||||
markedAsVersion: false,
|
||||
canRestore: false,
|
||||
isRevision: true
|
||||
isRevision: true,
|
||||
hasChanges: false,
|
||||
isExpanded: true,
|
||||
isVisible: true,
|
||||
allowSelected: true,
|
||||
selected: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -76,48 +76,70 @@ define([
|
|||
store: this.storeHistory,
|
||||
enableKeyEvents: false,
|
||||
itemTemplate: _.template([
|
||||
'<div id="<%= id %>" class="history-item-wrap" style="display: block;">',
|
||||
'<div id="<%= id %>" class="history-item-wrap ' + '<% if (!isVisible) { %>' + 'hidden' + '<% } %>' + '" ',
|
||||
'style="display: block; ' + '<% if (!isRevision) { %>' + 'padding-left: 40px;' + '<% } %>' + '<% if (canRestore && selected) { %>' + 'padding-bottom: 6px;' + '<% } %>' +'">',
|
||||
'<div class="user-date"><%= created %></div>',
|
||||
'<% if (markedAsVersion) { %>',
|
||||
'<div class="user-version">ver.<%=version%></div>',
|
||||
'<% } %>',
|
||||
'<% if (canRestore && selected) { %>',
|
||||
'<div class="revision-restore img-commonctrl"></div>',
|
||||
'<% if (isRevision && hasChanges) { %>',
|
||||
'<div class="revision-expand img-commonctrl ' + '<% if (isExpanded) { %>' + 'up' + '<% } %>' + '"></div>',
|
||||
'<% } %>',
|
||||
'<div class="user-name">',
|
||||
'<div class="color" style="display: inline-block; background-color:' + '<%=usercolor%>;' + '" >',
|
||||
'</div><%= Common.Utils.String.htmlEncode(username) %>',
|
||||
'</div>',
|
||||
'<% if (canRestore && selected) { %>',
|
||||
'<label class="revision-restore" role="presentation" tabindex="-1">' + this.textRestore + '</label>',
|
||||
'<% } %>',
|
||||
'</div>'
|
||||
].join(''))
|
||||
});
|
||||
|
||||
var me = this;
|
||||
this.viewHistoryList.onClickItem = function(view, record, e) {
|
||||
var btn = $(e.target);
|
||||
if (btn && btn.hasClass('revision-expand')) {
|
||||
var isExpanded = !record.get('isExpanded');
|
||||
record.set('isExpanded', isExpanded);
|
||||
var rev, revisions = me.storeHistory.findRevisions(record.get('revision'));
|
||||
if (revisions && revisions.length>1) {
|
||||
for(var i=1; i<revisions.length; i++)
|
||||
revisions[i].set('isVisible', isExpanded);
|
||||
}
|
||||
this.scroller.update({minScrollbarLength: 40});
|
||||
} else
|
||||
Common.UI.DataView.prototype.onClickItem.call(this, view, record, e);
|
||||
};
|
||||
|
||||
var changetooltip = function (dataview, view, record) {
|
||||
if (record.get('isRevision')) {
|
||||
if (view.btnTip) {
|
||||
view.btnTip.dontShow = true;
|
||||
view.btnTip.tip().remove();
|
||||
view.btnTip = null;
|
||||
}
|
||||
var btns = $(view.el).find('.revision-expand').tooltip({title: (record.get('isExpanded')) ? me.textHide : me.textShow, placement: 'cursor'});
|
||||
if (btns.length>0)
|
||||
view.btnTip = btns.data('bs.tooltip');
|
||||
}
|
||||
};
|
||||
this.viewHistoryList.on('item:add', changetooltip);
|
||||
this.viewHistoryList.on('item:change', changetooltip);
|
||||
|
||||
this.btnBackToDocument = new Common.UI.Button({
|
||||
el: $('#history-btn-back'),
|
||||
enableToggle: false
|
||||
});
|
||||
|
||||
var me = this;
|
||||
var changetooltip = function (dataview, view, record) {
|
||||
if (record.get('selected')) {
|
||||
var btns = $(view.el).find('.revision-restore').tooltip({title: me.textRestore, placement: 'cursor'});
|
||||
if (btns)
|
||||
view.btnTip = btns.data('bs.tooltip');
|
||||
} else if (view.btnTip) {
|
||||
view.btnTip.dontShow = true;
|
||||
view.btnTip.tip().remove();
|
||||
view.btnTip = null;
|
||||
}
|
||||
};
|
||||
this.viewHistoryList.on('item:add', changetooltip);
|
||||
this.viewHistoryList.on('item:change', changetooltip);
|
||||
|
||||
this.trigger('render:after', this);
|
||||
return this;
|
||||
},
|
||||
|
||||
textHistoryHeader: 'Back to Document',
|
||||
textRestore: 'Restore'
|
||||
|
||||
textRestore: 'Restore',
|
||||
textShow: 'Show Changes',
|
||||
textHide: 'Hide Changes'
|
||||
|
||||
}, Common.Views.History || {}))
|
||||
});
|
|
@ -56,6 +56,10 @@
|
|||
.user-date {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.revision-expand {
|
||||
background-position: -70px -145px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +79,7 @@
|
|||
|
||||
.user-version {
|
||||
display: inline-block;
|
||||
width: 36px;
|
||||
max-width: 60px;
|
||||
height: 18px;
|
||||
color: @primary;
|
||||
font-size: 10px;
|
||||
|
@ -83,7 +87,7 @@
|
|||
overflow: hidden;
|
||||
background-color: #e6e6e6;
|
||||
text-align: center;
|
||||
padding: 1px 0;
|
||||
padding: 1px 5px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
|
@ -93,6 +97,9 @@
|
|||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
color: @gray-darker;
|
||||
max-width: 210px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.color {
|
||||
|
@ -103,14 +110,28 @@
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.revision-restore {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-position: -22px -272px;
|
||||
margin: 0 12px;
|
||||
.revision-expand {
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
background-position: -43px -145px;
|
||||
margin: 10px 10px;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
||||
&.up {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
.revision-restore {
|
||||
color: #fff;
|
||||
border-bottom: 1px dotted #fff;
|
||||
height: 16px;
|
||||
margin-top: 5px;
|
||||
white-space: pre-wrap;
|
||||
width: auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -400,7 +400,8 @@ define([
|
|||
docId: version.key,
|
||||
markedAsVersion: (group!==version.versionGroup),
|
||||
selected: (opts.data.currentVersion == version.version),
|
||||
canRestore: this.appOptions.canHistoryRestore
|
||||
canRestore: this.appOptions.canHistoryRestore && (ver < versions.length-1),
|
||||
isExpanded: false
|
||||
}));
|
||||
if (opts.data.currentVersion == version.version) {
|
||||
currentVersion = arrVersions[arrVersions.length-1];
|
||||
|
@ -420,6 +421,7 @@ define([
|
|||
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];
|
||||
|
||||
|
@ -446,7 +448,8 @@ define([
|
|||
docIdPrev: docIdPrev,
|
||||
selected: false,
|
||||
canRestore: this.appOptions.canHistoryRestore,
|
||||
isRevision: false
|
||||
isRevision: false,
|
||||
isVisible: false
|
||||
}));
|
||||
arrColors.push(user.get('colorval'));
|
||||
}
|
||||
|
|
|
@ -183,9 +183,11 @@ define([
|
|||
toolbar.mnuTextColorPicker.on('select', _.bind(this.onTextColorSelect, this));
|
||||
toolbar.mnuBackColorPicker.on('select', _.bind(this.onBackColorSelect, this));
|
||||
toolbar.btnBorders.on('click', _.bind(this.onBorders, this));
|
||||
toolbar.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this));
|
||||
toolbar.mnuBorderWidth.on('item:toggle', _.bind(this.onBordersWidth, this));
|
||||
toolbar.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this));
|
||||
if (toolbar.btnBorders.rendered) {
|
||||
toolbar.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this));
|
||||
toolbar.mnuBorderWidth.on('item:toggle', _.bind(this.onBordersWidth, this));
|
||||
toolbar.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this));
|
||||
}
|
||||
toolbar.btnAlignLeft.on('click', _.bind(this.onHorizontalAlign, this, 'left'));
|
||||
toolbar.btnAlignCenter.on('click', _.bind(this.onHorizontalAlign, this, 'center'));
|
||||
toolbar.btnAlignRight.on('click', _.bind(this.onHorizontalAlign, this, 'right'));
|
||||
|
@ -245,11 +247,11 @@ define([
|
|||
toolbar.cmbFontSize.on('combo:focusin', _.bind(this.onComboOpen, this, false));
|
||||
if (toolbar.mnuZoomIn) toolbar.mnuZoomIn.on('click', _.bind(this.onZoomInClick, this));
|
||||
if (toolbar.mnuZoomOut) toolbar.mnuZoomOut.on('click', _.bind(this.onZoomOutClick, this));
|
||||
toolbar.btnShowMode.menu.on('item:click', _.bind(this.onHideMenu, this));
|
||||
if (toolbar.btnShowMode.rendered) toolbar.btnShowMode.menu.on('item:click', _.bind(this.onHideMenu, this));
|
||||
toolbar.listStyles.on('click', _.bind(this.onListStyleSelect, this));
|
||||
toolbar.btnNumberFormat.menu.on('item:click', _.bind(this.onNumberFormatMenu, this));
|
||||
if (toolbar.btnNumberFormat.rendered) toolbar.btnNumberFormat.menu.on('item:click', _.bind(this.onNumberFormatMenu, this));
|
||||
toolbar.btnCurrencyStyle.menu.on('item:click', _.bind(this.onNumberFormatMenu, this));
|
||||
toolbar.mnuitemCompactToolbar.on('toggle', _.bind(this.onChangeViewMode, this));
|
||||
if (toolbar.mnuitemCompactToolbar) toolbar.mnuitemCompactToolbar.on('toggle', _.bind(this.onChangeViewMode, this));
|
||||
$('#id-toolbar-menu-new-fontcolor').on('click', _.bind(this.onNewTextColor, this));
|
||||
$('#id-toolbar-menu-new-paracolor').on('click', _.bind(this.onNewBackColor, this));
|
||||
$('#id-toolbar-menu-new-bordercolor').on('click', _.bind(this.onNewBorderColor, this));
|
||||
|
@ -1297,7 +1299,10 @@ define([
|
|||
}
|
||||
|
||||
if (me.toolbar.btnInsertText.rendered)
|
||||
SSE.getController('Toolbar').fillTextArt();
|
||||
me.fillTextArt();
|
||||
|
||||
if (me.toolbar.btnTableTemplate.rendered)
|
||||
me.fillTableTemplates();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
@ -1311,8 +1316,9 @@ define([
|
|||
},
|
||||
|
||||
fillTableTemplates: function() {
|
||||
var me = this;
|
||||
if (!this.toolbar.btnTableTemplate.rendered) return;
|
||||
|
||||
var me = this;
|
||||
function createPicker(element, menu) {
|
||||
var picker = new Common.UI.DataView({
|
||||
el: element,
|
||||
|
|
|
@ -1319,198 +1319,203 @@ define([
|
|||
this.btnAutofilter.updateHint(this.tipAutofilter);
|
||||
|
||||
// set menus
|
||||
this.btnShowMode.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
this.mnuitemCompactToolbar = new Common.UI.MenuItem({
|
||||
caption : this.textCompactToolbar,
|
||||
checkable : true,
|
||||
value : 'compact'
|
||||
}),
|
||||
this.mnuitemHideTitleBar = new Common.UI.MenuItem({
|
||||
caption : this.textHideTBar,
|
||||
checkable : true,
|
||||
value : 'title'
|
||||
}),
|
||||
this.mnuitemHideFormulaBar = new Common.UI.MenuItem({
|
||||
caption : this.textHideFBar,
|
||||
checkable : true,
|
||||
value : 'formula'
|
||||
}),
|
||||
this.mnuitemHideHeadings = new Common.UI.MenuItem({
|
||||
caption : this.textHideHeadings,
|
||||
checkable : true,
|
||||
checked : this.mnuitemHideHeadings.isChecked(),
|
||||
value : 'headings'
|
||||
}),
|
||||
this.mnuitemHideGridlines = new Common.UI.MenuItem({
|
||||
caption : this.textHideGridlines,
|
||||
checkable : true,
|
||||
checked : this.mnuitemHideGridlines.isChecked(),
|
||||
value : 'gridlines'
|
||||
}),
|
||||
{caption: '--'},
|
||||
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"> </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"> </span></button>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
stopPropagation: true,
|
||||
value: this.mnuZoom.options.value
|
||||
})
|
||||
]
|
||||
}));
|
||||
|
||||
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'
|
||||
});
|
||||
|
||||
var options = {};
|
||||
JSON.parse(Common.localStorage.getItem('sse-hidden-title')) && (options.title = true);
|
||||
JSON.parse(Common.localStorage.getItem('sse-hidden-formula')) && (options.formula = true);
|
||||
// JSON.parse(Common.localStorage.getItem('sse-hidden-headings')) && (options.headings = true);
|
||||
var isCompactView = JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
|
||||
isCompactView = !!(isCompactView!==null && parseInt(isCompactView) == 1 || isCompactView === null && this.mode.customization && this.mode.customization.compactToolbar);
|
||||
|
||||
this.mnuitemCompactToolbar.setChecked(isCompactView);
|
||||
this.mnuitemHideTitleBar.setChecked(!!options.title);
|
||||
this.mnuitemHideFormulaBar.setChecked(!!options.formula);
|
||||
this.mnuitemHideHeadings.setChecked(!!options.headings);
|
||||
|
||||
if (this.mode.isDesktopApp)
|
||||
this.mnuitemHideTitleBar.hide();
|
||||
|
||||
this.btnBorders.setMenu( new Common.UI.Menu({
|
||||
items: [
|
||||
{
|
||||
caption : this.textOutBorders,
|
||||
iconCls : 'mnu-border-out',
|
||||
icls : 'btn-border-out',
|
||||
borderId : 'outer'
|
||||
},
|
||||
{
|
||||
caption : this.textAllBorders,
|
||||
iconCls : 'mnu-border-all',
|
||||
icls : 'btn-border-all',
|
||||
borderId : 'all'
|
||||
},
|
||||
{
|
||||
caption : this.textTopBorders,
|
||||
iconCls : 'mnu-border-top',
|
||||
icls : 'btn-border-top',
|
||||
borderId : Asc.c_oAscBorderOptions.Top
|
||||
},
|
||||
{
|
||||
caption : this.textBottomBorders,
|
||||
iconCls : 'mnu-border-bottom',
|
||||
icls : 'btn-border-bottom',
|
||||
borderId : Asc.c_oAscBorderOptions.Bottom
|
||||
},
|
||||
{
|
||||
caption : this.textLeftBorders,
|
||||
iconCls : 'mnu-border-left',
|
||||
icls : 'btn-border-left',
|
||||
borderId : Asc.c_oAscBorderOptions.Left
|
||||
},
|
||||
{
|
||||
caption : this.textRightBorders,
|
||||
iconCls : 'mnu-border-right',
|
||||
icls : 'btn-border-right',
|
||||
borderId : Asc.c_oAscBorderOptions.Right
|
||||
},
|
||||
{
|
||||
caption : this.textNoBorders,
|
||||
iconCls : 'mnu-border-no',
|
||||
icls : 'btn-border-no',
|
||||
borderId : 'none'
|
||||
},
|
||||
{caption: '--'},
|
||||
{
|
||||
caption : this.textInsideBorders,
|
||||
iconCls : 'mnu-border-center',
|
||||
icls : 'btn-border-center',
|
||||
borderId : 'inner'
|
||||
},
|
||||
{
|
||||
caption : this.textCenterBorders,
|
||||
iconCls : 'mnu-border-vmiddle',
|
||||
icls : 'btn-border-vmiddle',
|
||||
borderId : Asc.c_oAscBorderOptions.InnerV
|
||||
},
|
||||
{
|
||||
caption : this.textMiddleBorders,
|
||||
iconCls : 'mnu-border-hmiddle',
|
||||
icls : 'btn-border-hmiddle',
|
||||
borderId : Asc.c_oAscBorderOptions.InnerH
|
||||
},
|
||||
{
|
||||
caption : this.textDiagUpBorder,
|
||||
iconCls : 'mnu-border-diagup',
|
||||
icls : 'btn-border-diagup',
|
||||
borderId : Asc.c_oAscBorderOptions.DiagU
|
||||
},
|
||||
{
|
||||
caption : this.textDiagDownBorder,
|
||||
iconCls : 'mnu-border-diagdown',
|
||||
icls : 'btn-border-diagdown',
|
||||
borderId : Asc.c_oAscBorderOptions.DiagD
|
||||
},
|
||||
{caption: '--'},
|
||||
{
|
||||
id : 'id-toolbar-mnu-item-border-width',
|
||||
caption : this.textBordersWidth,
|
||||
iconCls : 'mnu-icon-item mnu-border-width',
|
||||
template : _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 11px; height: 11px; margin: 2px 7px 0 -9px; border-style: solid; border-width: 1px; border-color: #000;"></span><%= caption %></a>'),
|
||||
menu : (function(){
|
||||
var itemTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div class="border-size-item" style="background-position: 0 -<%= options.offsety %>px;"></div></a>');
|
||||
|
||||
me.mnuBorderWidth = new Common.UI.Menu({
|
||||
style : 'min-width: 100px;',
|
||||
menuAlign : 'tl-tr',
|
||||
id : 'toolbar-menu-borders-width',
|
||||
items: [
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'thin', offsety: 0, checked:true},
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'medium', offsety: 20},
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'thick', offsety: 40}
|
||||
]
|
||||
});
|
||||
|
||||
return me.mnuBorderWidth;
|
||||
})()
|
||||
},
|
||||
this.mnuBorderColor = new Common.UI.MenuItem({
|
||||
id : 'id-toolbar-mnu-item-border-color',
|
||||
caption : this.textBordersColor,
|
||||
iconCls : 'mnu-icon-item mnu-border-color',
|
||||
template : _.template('<a id="<%= id %>"tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 11px; height: 11px; margin: 2px 7px 0 -9px; border-style: solid; border-width: 3px; border-color: #000;"></span><%= caption %></a>'),
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign : 'tl-tr',
|
||||
items : [
|
||||
{ template: _.template('<div id="id-toolbar-menu-bordercolor" style="width: 165px; height: 220px; margin: 10px;"></div>'), stopPropagation: true },
|
||||
{ template: _.template('<a id="id-toolbar-menu-new-bordercolor" style="padding-left:12px;">' + this.textNewColor + '</a>'), stopPropagation: true }
|
||||
]
|
||||
if (this.btnShowMode.rendered) {
|
||||
this.btnShowMode.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
this.mnuitemCompactToolbar = new Common.UI.MenuItem({
|
||||
caption : this.textCompactToolbar,
|
||||
checkable : true,
|
||||
value : 'compact'
|
||||
}),
|
||||
this.mnuitemHideTitleBar = new Common.UI.MenuItem({
|
||||
caption : this.textHideTBar,
|
||||
checkable : true,
|
||||
value : 'title'
|
||||
}),
|
||||
this.mnuitemHideFormulaBar = new Common.UI.MenuItem({
|
||||
caption : this.textHideFBar,
|
||||
checkable : true,
|
||||
value : 'formula'
|
||||
}),
|
||||
this.mnuitemHideHeadings = new Common.UI.MenuItem({
|
||||
caption : this.textHideHeadings,
|
||||
checkable : true,
|
||||
checked : this.mnuitemHideHeadings.isChecked(),
|
||||
value : 'headings'
|
||||
}),
|
||||
this.mnuitemHideGridlines = new Common.UI.MenuItem({
|
||||
caption : this.textHideGridlines,
|
||||
checkable : true,
|
||||
checked : this.mnuitemHideGridlines.isChecked(),
|
||||
value : 'gridlines'
|
||||
}),
|
||||
{caption: '--'},
|
||||
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"> </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"> </span></button>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
stopPropagation: true,
|
||||
value: this.mnuZoom.options.value
|
||||
})
|
||||
})
|
||||
]
|
||||
}));
|
||||
var colorVal = $('<div class="btn-color-value-line"></div>');
|
||||
$('button:first-child', this.btnBorders.cmpEl).append(colorVal);
|
||||
colorVal.css('background-color', this.btnBorders.currentColor || 'transparent');
|
||||
]
|
||||
}));
|
||||
|
||||
this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({
|
||||
el: $('#id-toolbar-menu-bordercolor')
|
||||
});
|
||||
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'
|
||||
});
|
||||
|
||||
var options = {};
|
||||
JSON.parse(Common.localStorage.getItem('sse-hidden-title')) && (options.title = true);
|
||||
JSON.parse(Common.localStorage.getItem('sse-hidden-formula')) && (options.formula = true);
|
||||
// JSON.parse(Common.localStorage.getItem('sse-hidden-headings')) && (options.headings = true);
|
||||
var isCompactView = JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
|
||||
isCompactView = !!(isCompactView!==null && parseInt(isCompactView) == 1 || isCompactView === null && this.mode.customization && this.mode.customization.compactToolbar);
|
||||
|
||||
this.mnuitemCompactToolbar.setChecked(isCompactView);
|
||||
this.mnuitemHideTitleBar.setChecked(!!options.title);
|
||||
this.mnuitemHideFormulaBar.setChecked(!!options.formula);
|
||||
this.mnuitemHideHeadings.setChecked(!!options.headings);
|
||||
|
||||
if (this.mode.isDesktopApp)
|
||||
this.mnuitemHideTitleBar.hide();
|
||||
}
|
||||
|
||||
if (this.btnBorders.rendered) {
|
||||
this.btnBorders.setMenu( new Common.UI.Menu({
|
||||
items: [
|
||||
{
|
||||
caption : this.textOutBorders,
|
||||
iconCls : 'mnu-border-out',
|
||||
icls : 'btn-border-out',
|
||||
borderId : 'outer'
|
||||
},
|
||||
{
|
||||
caption : this.textAllBorders,
|
||||
iconCls : 'mnu-border-all',
|
||||
icls : 'btn-border-all',
|
||||
borderId : 'all'
|
||||
},
|
||||
{
|
||||
caption : this.textTopBorders,
|
||||
iconCls : 'mnu-border-top',
|
||||
icls : 'btn-border-top',
|
||||
borderId : Asc.c_oAscBorderOptions.Top
|
||||
},
|
||||
{
|
||||
caption : this.textBottomBorders,
|
||||
iconCls : 'mnu-border-bottom',
|
||||
icls : 'btn-border-bottom',
|
||||
borderId : Asc.c_oAscBorderOptions.Bottom
|
||||
},
|
||||
{
|
||||
caption : this.textLeftBorders,
|
||||
iconCls : 'mnu-border-left',
|
||||
icls : 'btn-border-left',
|
||||
borderId : Asc.c_oAscBorderOptions.Left
|
||||
},
|
||||
{
|
||||
caption : this.textRightBorders,
|
||||
iconCls : 'mnu-border-right',
|
||||
icls : 'btn-border-right',
|
||||
borderId : Asc.c_oAscBorderOptions.Right
|
||||
},
|
||||
{
|
||||
caption : this.textNoBorders,
|
||||
iconCls : 'mnu-border-no',
|
||||
icls : 'btn-border-no',
|
||||
borderId : 'none'
|
||||
},
|
||||
{caption: '--'},
|
||||
{
|
||||
caption : this.textInsideBorders,
|
||||
iconCls : 'mnu-border-center',
|
||||
icls : 'btn-border-center',
|
||||
borderId : 'inner'
|
||||
},
|
||||
{
|
||||
caption : this.textCenterBorders,
|
||||
iconCls : 'mnu-border-vmiddle',
|
||||
icls : 'btn-border-vmiddle',
|
||||
borderId : Asc.c_oAscBorderOptions.InnerV
|
||||
},
|
||||
{
|
||||
caption : this.textMiddleBorders,
|
||||
iconCls : 'mnu-border-hmiddle',
|
||||
icls : 'btn-border-hmiddle',
|
||||
borderId : Asc.c_oAscBorderOptions.InnerH
|
||||
},
|
||||
{
|
||||
caption : this.textDiagUpBorder,
|
||||
iconCls : 'mnu-border-diagup',
|
||||
icls : 'btn-border-diagup',
|
||||
borderId : Asc.c_oAscBorderOptions.DiagU
|
||||
},
|
||||
{
|
||||
caption : this.textDiagDownBorder,
|
||||
iconCls : 'mnu-border-diagdown',
|
||||
icls : 'btn-border-diagdown',
|
||||
borderId : Asc.c_oAscBorderOptions.DiagD
|
||||
},
|
||||
{caption: '--'},
|
||||
{
|
||||
id : 'id-toolbar-mnu-item-border-width',
|
||||
caption : this.textBordersWidth,
|
||||
iconCls : 'mnu-icon-item mnu-border-width',
|
||||
template : _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 11px; height: 11px; margin: 2px 7px 0 -9px; border-style: solid; border-width: 1px; border-color: #000;"></span><%= caption %></a>'),
|
||||
menu : (function(){
|
||||
var itemTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div class="border-size-item" style="background-position: 0 -<%= options.offsety %>px;"></div></a>');
|
||||
|
||||
me.mnuBorderWidth = new Common.UI.Menu({
|
||||
style : 'min-width: 100px;',
|
||||
menuAlign : 'tl-tr',
|
||||
id : 'toolbar-menu-borders-width',
|
||||
items: [
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'thin', offsety: 0, checked:true},
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'medium', offsety: 20},
|
||||
{ template: itemTemplate, stopPropagation: true, checkable: true, toggleGroup: 'border-width', value: 'thick', offsety: 40}
|
||||
]
|
||||
});
|
||||
|
||||
return me.mnuBorderWidth;
|
||||
})()
|
||||
},
|
||||
this.mnuBorderColor = new Common.UI.MenuItem({
|
||||
id : 'id-toolbar-mnu-item-border-color',
|
||||
caption : this.textBordersColor,
|
||||
iconCls : 'mnu-icon-item mnu-border-color',
|
||||
template : _.template('<a id="<%= id %>"tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 11px; height: 11px; margin: 2px 7px 0 -9px; border-style: solid; border-width: 3px; border-color: #000;"></span><%= caption %></a>'),
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign : 'tl-tr',
|
||||
items : [
|
||||
{ template: _.template('<div id="id-toolbar-menu-bordercolor" style="width: 165px; height: 220px; margin: 10px;"></div>'), stopPropagation: true },
|
||||
{ template: _.template('<a id="id-toolbar-menu-new-bordercolor" style="padding-left:12px;">' + this.textNewColor + '</a>'), stopPropagation: true }
|
||||
]
|
||||
})
|
||||
})
|
||||
]
|
||||
}));
|
||||
|
||||
var colorVal = $('<div class="btn-color-value-line"></div>');
|
||||
$('button:first-child', this.btnBorders.cmpEl).append(colorVal);
|
||||
colorVal.css('background-color', this.btnBorders.currentColor || 'transparent');
|
||||
|
||||
this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({
|
||||
el: $('#id-toolbar-menu-bordercolor')
|
||||
});
|
||||
}
|
||||
|
||||
var formatTemplate = _.template('<a id="<%= id %>" style="white-space: normal;" tabindex="-1" type="menuitem"><%= caption %><span style="float: right; color: silver;"><%= options.tplval ? options.tplval : options.value %></span></a>');
|
||||
this.btnNumberFormat.setMenu( new Common.UI.Menu({
|
||||
|
@ -1780,7 +1785,7 @@ define([
|
|||
|
||||
if (mode.isDesktopApp) {
|
||||
$('.toolbar-group-native').hide();
|
||||
this.mnuitemHideTitleBar.hide();
|
||||
this.mnuitemHideTitleBar && this.mnuitemHideTitleBar.hide();
|
||||
}
|
||||
|
||||
this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
|
||||
|
|
Loading…
Reference in a new issue