Merge pull request #48 from ONLYOFFICE/feature/table-of-contents
Feature/table of contents
This commit is contained in:
commit
c7a7dd6aff
|
@ -143,11 +143,17 @@ define([
|
|||
el.off('click').on('click', _.bind(this.onClick, this));
|
||||
el.off('dblclick').on('dblclick', _.bind(this.onDblClick, this));
|
||||
el.off('contextmenu').on('contextmenu', _.bind(this.onContextMenu, this));
|
||||
el.toggleClass('disabled', this.model.get('disabled'));
|
||||
el.toggleClass('disabled', !!this.model.get('disabled'));
|
||||
|
||||
if (!_.isUndefined(this.model.get('cls')))
|
||||
el.addClass(this.model.get('cls'));
|
||||
|
||||
var tip = el.data('bs.tooltip');
|
||||
if (tip) {
|
||||
if (tip.dontShow===undefined)
|
||||
tip.dontShow = true;
|
||||
}
|
||||
|
||||
this.trigger('change', this, this.model);
|
||||
|
||||
return this;
|
||||
|
@ -441,7 +447,11 @@ define([
|
|||
onResetItems: function() {
|
||||
_.each(this.dataViewItems, function(item) {
|
||||
var tip = item.$el.data('bs.tooltip');
|
||||
if (tip) (tip.tip()).remove();
|
||||
if (tip) {
|
||||
if (tip.dontShow===undefined)
|
||||
tip.dontShow = true;
|
||||
(tip.tip()).remove();
|
||||
}
|
||||
}, this);
|
||||
|
||||
$(this.el).html(this.template({
|
||||
|
|
269
apps/common/main/lib/component/TreeView.js
Normal file
269
apps/common/main/lib/component/TreeView.js
Normal file
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* TreeView.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 12/14/17
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([
|
||||
'common/main/lib/component/DataView'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
Common.UI.TreeViewModel = Common.UI.DataViewModel.extend({
|
||||
defaults: function() {
|
||||
return {
|
||||
id: Common.UI.getId(),
|
||||
name: '',
|
||||
isNotHeader: false,
|
||||
hasSubItems: false,
|
||||
hasParent: false,
|
||||
isEmptyItem: false,
|
||||
isExpanded: true,
|
||||
isVisible: true,
|
||||
selected: false,
|
||||
allowSelected: true,
|
||||
disabled: false,
|
||||
level: 0,
|
||||
index: 0
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Common.UI.TreeViewStore = Backbone.Collection.extend({
|
||||
model: Common.UI.TreeViewModel,
|
||||
|
||||
expandSubItems: function(record) {
|
||||
var me = this;
|
||||
var _expand_sub_items = function(idx, expanded, level) {
|
||||
for (var i=idx+1; i<me.length; i++) {
|
||||
var item = me.at(i);
|
||||
var item_level = item.get('level');
|
||||
if (item_level>level) {
|
||||
if (expanded)
|
||||
item.set('isVisible', true);
|
||||
if (item.get('hasSubItems'))
|
||||
i = _expand_sub_items(i, item.get('isExpanded'), item_level );
|
||||
} else {
|
||||
return (i-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
record.set('isExpanded', true);
|
||||
_expand_sub_items(record.get('index'), true, record.get('level'));
|
||||
},
|
||||
|
||||
collapseSubItems: function(record) {
|
||||
var start_level = record.get('level'),
|
||||
index = record.get('index');
|
||||
for (var i=index+1; i<this.length; i++) {
|
||||
var item = this.at(i);
|
||||
var item_level = item.get('level');
|
||||
if (item_level>start_level) {
|
||||
item.set('isVisible', false);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i-1;
|
||||
},
|
||||
|
||||
expandAll: function() {
|
||||
this.each(function(item) {
|
||||
item.set('isExpanded', true);
|
||||
item.set('isVisible', true);
|
||||
});
|
||||
},
|
||||
|
||||
collapseAll: function() {
|
||||
for (var i=0; i<this.length; i++) {
|
||||
var item = this.at(i);
|
||||
if (!item.get('isNotHeader')) {
|
||||
item.set('isExpanded', false);
|
||||
i = this.collapseSubItems(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
expandToLevel: function(expandLevel) {
|
||||
var me = this;
|
||||
var _expand_sub_items = function(idx, level) {
|
||||
var parent = me.at(idx);
|
||||
parent.set('isExpanded', false);
|
||||
for (var i=idx+1; i<me.length; i++) {
|
||||
var item = me.at(i);
|
||||
var item_level = item.get('level');
|
||||
if (item_level>level) {
|
||||
if (item_level<=expandLevel)
|
||||
parent.set('isExpanded', true);
|
||||
item.set('isVisible', item_level<=expandLevel);
|
||||
if (item.get('hasSubItems'))
|
||||
i = _expand_sub_items(i, item_level );
|
||||
} else {
|
||||
return (i-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (var j=0; j<this.length; j++) {
|
||||
var item = this.at(j);
|
||||
if (item.get('level')<=expandLevel || !item.get('hasParent')) {
|
||||
item.set('isVisible', true);
|
||||
if (!item.get('isNotHeader'))
|
||||
j = _expand_sub_items(j, item.get('level'));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Common.UI.TreeView = Common.UI.DataView.extend((function() {
|
||||
return {
|
||||
options: {
|
||||
handleSelect: true,
|
||||
showLast: true,
|
||||
allowScrollbar: true,
|
||||
emptyItemText: ''
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
'<div class="treeview inner"></div>'
|
||||
].join('')),
|
||||
|
||||
initialize : function(options) {
|
||||
options.store = options.store || new Common.UI.TreeViewStore();
|
||||
options.emptyItemText = options.emptyItemText || '';
|
||||
options.itemTemplate = options.itemTemplate || _.template([
|
||||
'<div id="<%= id %>" class="tree-item <% if (!isVisible) { %>' + 'hidden' + '<% } %>" style="display: block;padding-left: <%= level*16 + 24 %>px;">',
|
||||
'<% if (hasSubItems) { %>',
|
||||
'<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*16 %>px;"></div>',
|
||||
'<% } %>',
|
||||
'<% if (isNotHeader) { %>',
|
||||
'<div class="name not-header"><%= name %></div>',
|
||||
'<% } else if (isEmptyItem) { %>',
|
||||
'<div class="name empty">' + options.emptyItemText + '</div>',
|
||||
'<% } else { %>',
|
||||
'<div class="name"><%= name %></div>',
|
||||
'<% } %>',
|
||||
'</div>'
|
||||
].join(''));
|
||||
Common.UI.DataView.prototype.initialize.call(this, options);
|
||||
},
|
||||
|
||||
onAddItem: function(record, store, opts) {
|
||||
var view = new Common.UI.DataViewItem({
|
||||
template: this.itemTemplate,
|
||||
model: record
|
||||
});
|
||||
|
||||
if (view) {
|
||||
var innerEl = $(this.el).find('.inner').addBack().filter('.inner');
|
||||
if (innerEl) {
|
||||
innerEl.find('.empty-text').remove();
|
||||
|
||||
if (opts && opts.at!==undefined) {
|
||||
var idx = opts.at;
|
||||
var innerDivs = innerEl.find('> div');
|
||||
if (idx > 0)
|
||||
$(innerDivs.get(idx - 1)).after(view.render().el);
|
||||
else {
|
||||
(innerDivs.length > 0) ? $(innerDivs[idx]).before(view.render().el) : innerEl.append(view.render().el);
|
||||
}
|
||||
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
|
||||
} else {
|
||||
innerEl.append(view.render().el);
|
||||
this.dataViewItems.push(view);
|
||||
}
|
||||
|
||||
var name = record.get('name');
|
||||
if (name.length > 37 - record.get('level')*2)
|
||||
record.set('tip', name);
|
||||
if (record.get('tip')) {
|
||||
var view_el = $(view.el);
|
||||
view_el.attr('data-toggle', 'tooltip');
|
||||
view_el.tooltip({
|
||||
title : record.get('tip'),
|
||||
placement : 'cursor',
|
||||
zIndex : this.tipZIndex
|
||||
});
|
||||
}
|
||||
|
||||
this.listenTo(view, 'change', this.onChangeItem);
|
||||
this.listenTo(view, 'remove', this.onRemoveItem);
|
||||
this.listenTo(view, 'click', this.onClickItem);
|
||||
this.listenTo(view, 'dblclick', this.onDblClickItem);
|
||||
this.listenTo(view, 'select', this.onSelectItem);
|
||||
this.listenTo(view, 'contextmenu', this.onContextMenuItem);
|
||||
|
||||
if (!this.isSuspendEvents)
|
||||
this.trigger('item:add', this, view, record);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onClickItem: function(view, record, e) {
|
||||
var btn = $(e.target);
|
||||
if (btn && btn.hasClass('tree-caret')) {
|
||||
var tip = view.$el.data('bs.tooltip');
|
||||
if (tip) (tip.tip()).remove();
|
||||
|
||||
var isExpanded = !record.get('isExpanded');
|
||||
record.set('isExpanded', isExpanded);
|
||||
this.store[(isExpanded) ? 'expandSubItems' : 'collapseSubItems'](record);
|
||||
this.scroller.update({minScrollbarLength: 40});
|
||||
} else
|
||||
Common.UI.DataView.prototype.onClickItem.call(this, view, record, e);
|
||||
},
|
||||
|
||||
expandAll: function() {
|
||||
this.store.expandAll();
|
||||
this.scroller.update({minScrollbarLength: 40});
|
||||
},
|
||||
|
||||
collapseAll: function() {
|
||||
this.store.collapseAll();
|
||||
this.scroller.update({minScrollbarLength: 40});
|
||||
},
|
||||
|
||||
expandToLevel: function(expandLevel) {
|
||||
this.store.expandToLevel(expandLevel);
|
||||
this.scroller.update({minScrollbarLength: 40});
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
|
@ -154,11 +154,15 @@
|
|||
|
||||
if (typeof at == 'object') {
|
||||
var tp = {top: at[1] + 15, left: at[0] + 18},
|
||||
innerWidth = Common.Utils.innerWidth();
|
||||
innerWidth = Common.Utils.innerWidth(),
|
||||
innerHeight = Common.Utils.innerHeight();
|
||||
|
||||
if (tp.left + $tip.width() > innerWidth) {
|
||||
tp.left = innerWidth - $tip.width() - 30;
|
||||
}
|
||||
if (tp.top + $tip.height() > innerHeight) {
|
||||
tp.top = innerHeight - $tip.height() - 30;
|
||||
}
|
||||
|
||||
$tip.offset(tp).addClass('in');
|
||||
} else {
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
@common-controls-width: 100px;
|
||||
.img-commonctrl,
|
||||
.theme-colorpalette .color-transparent, .palette-color-ext .color-transparent, .dropdown-menu li .checked:before, .input-error:before,
|
||||
.btn-toolbar .icon.img-commonctrl {
|
||||
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before {
|
||||
background-image: data-uri(%("%s",'@{common-image-path}/@{common-controls}'));
|
||||
background-repeat: no-repeat;
|
||||
|
||||
|
|
|
@ -278,19 +278,6 @@
|
|||
.button-normal-icon(btn-addslide, 11, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-docspell', 12, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-review', 13, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-sharing', 31, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-coedit', 32, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-chat', 33, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-history', 34, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-protect', 35, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-signature', 36, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-add-pivot', 37, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-update-pivot', 38, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-pivot-layout', 39, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-blank-rows', 43, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-subtotals', 46, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-grand-totals', 52, @toolbar-big-icon-size);
|
||||
.button-normal-icon(review-save, 14, @toolbar-big-icon-size);
|
||||
.button-normal-icon(review-deny, 15, @toolbar-big-icon-size);
|
||||
.button-normal-icon(review-next, 16, @toolbar-big-icon-size);
|
||||
|
@ -307,4 +294,19 @@
|
|||
.button-normal-icon(btn-img-bkwd, 27, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-img-frwd, 28, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-img-wrap, 29, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-sharing', 31, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-coedit', 32, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-chat', 33, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-history', 34, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-protect', 35, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-ic-signature', 36, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-add-pivot', 37, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-update-pivot', 38, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-contents-update, 38, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-pivot-layout', 39, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-blank-rows', 43, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-subtotals', 46, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-grand-totals', 52, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-contents', 53, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-controls, 54, @toolbar-big-icon-size);
|
||||
|
|
66
apps/common/main/resources/less/treeview.less
Normal file
66
apps/common/main/resources/less/treeview.less
Normal file
|
@ -0,0 +1,66 @@
|
|||
.treeview {
|
||||
&.inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.empty-text {
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: #b2b2b2;
|
||||
}
|
||||
}
|
||||
|
||||
> .item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
.box-shadow(none);
|
||||
margin: 0;
|
||||
|
||||
&:hover,
|
||||
&.over,
|
||||
&.selected {
|
||||
background-color: @secondary;
|
||||
}
|
||||
|
||||
&.selected .empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tree-item {
|
||||
width: 100%;
|
||||
min-height: 28px;
|
||||
padding: 0px 0 0 24px;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 100%;
|
||||
padding: 5px 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&.empty {
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-caret {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-position: 3px -270px;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&.up {
|
||||
transform: rotate(270deg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -150,6 +150,8 @@ require([
|
|||
'DocumentHolder',
|
||||
'Toolbar',
|
||||
'Statusbar',
|
||||
'Links',
|
||||
'Navigation',
|
||||
'RightMenu',
|
||||
'LeftMenu',
|
||||
'Main',
|
||||
|
@ -174,6 +176,8 @@ require([
|
|||
'documenteditor/main/app/controller/DocumentHolder',
|
||||
'documenteditor/main/app/controller/Toolbar',
|
||||
'documenteditor/main/app/controller/Statusbar',
|
||||
'documenteditor/main/app/controller/Links',
|
||||
'documenteditor/main/app/controller/Navigation',
|
||||
'documenteditor/main/app/controller/RightMenu',
|
||||
'documenteditor/main/app/controller/LeftMenu',
|
||||
'documenteditor/main/app/controller/Main',
|
||||
|
|
|
@ -42,10 +42,7 @@ define([
|
|||
'backbone',
|
||||
'documenteditor/main/app/model/EquationGroup'
|
||||
], function(Backbone){ 'use strict';
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
Common.Collections = Common.Collections || {};
|
||||
DE.Collections = DE.Collections || {};
|
||||
|
||||
DE.Collections.EquationGroups = Backbone.Collection.extend({
|
||||
model: DE.Models.EquationGroup
|
||||
|
|
50
apps/documenteditor/main/app/collection/Navigation.js
Normal file
50
apps/documenteditor/main/app/collection/Navigation.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* User: Julia.Radzhabova
|
||||
* Date: 14.12.17
|
||||
*/
|
||||
|
||||
DE.Collections = DE.Collections || {};
|
||||
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/main/lib/component/TreeView'
|
||||
], function(_, Backbone){
|
||||
'use strict';
|
||||
|
||||
DE.Collections.Navigation = Common.UI.TreeViewStore.extend({
|
||||
model: Common.UI.TreeViewModel
|
||||
});
|
||||
});
|
|
@ -199,6 +199,8 @@ define([
|
|||
if (this.mode.canUseHistory)
|
||||
this.leftMenu.setOptionsPanel('history', this.getApplication().getController('Common.Controllers.History').getView('Common.Views.History'));
|
||||
|
||||
this.leftMenu.setOptionsPanel('navigation', this.getApplication().getController('Navigation').getView('Navigation'));
|
||||
|
||||
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
|
||||
|
||||
Common.util.Shortcuts.resumeEvents();
|
||||
|
@ -499,6 +501,7 @@ define([
|
|||
this.leftMenu.btnChat.setDisabled(true);
|
||||
/** coauthoring end **/
|
||||
this.leftMenu.btnPlugins.setDisabled(true);
|
||||
this.leftMenu.btnNavigation.setDisabled(true);
|
||||
|
||||
this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload});
|
||||
if ( this.dlgSearch ) {
|
||||
|
@ -516,6 +519,7 @@ define([
|
|||
this.leftMenu.btnChat.setDisabled(disable);
|
||||
/** coauthoring end **/
|
||||
this.leftMenu.btnPlugins.setDisabled(disable);
|
||||
this.leftMenu.btnNavigation.setDisabled(disable);
|
||||
if (disableFileMenu) this.leftMenu.getMenu('file').SetDisabled(disable);
|
||||
},
|
||||
|
||||
|
|
305
apps/documenteditor/main/app/controller/Links.js
Normal file
305
apps/documenteditor/main/app/controller/Links.js
Normal file
|
@ -0,0 +1,305 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Links.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 22.12.2017
|
||||
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/main/app/view/Links',
|
||||
'documenteditor/main/app/view/NoteSettingsDialog',
|
||||
'documenteditor/main/app/view/HyperlinkSettingsDialog',
|
||||
'documenteditor/main/app/view/TableOfContentsSettings'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.Links = Backbone.Controller.extend(_.extend({
|
||||
models : [],
|
||||
collections : [
|
||||
],
|
||||
views : [
|
||||
'Links'
|
||||
],
|
||||
sdkViewName : '#id_main',
|
||||
|
||||
initialize: function () {
|
||||
|
||||
this.addListeners({
|
||||
'Links': {
|
||||
'links:contents': this.onTableContents,
|
||||
'links:update': this.onTableContentsUpdate,
|
||||
'links:notes': this.onNotesClick,
|
||||
'links:hyperlink': this.onHyperlinkClick
|
||||
}
|
||||
});
|
||||
},
|
||||
onLaunch: function () {
|
||||
this._state = {
|
||||
prcontrolsdisable:undefined
|
||||
};
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
if (api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onFocusObject', this.onApiFocusObject.bind(this));
|
||||
this.api.asc_registerCallback('asc_onCanAddHyperlink', _.bind(this.onApiCanAddHyperlink, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setConfig: function(config) {
|
||||
this.toolbar = config.toolbar;
|
||||
this.view = this.createView('Links', {
|
||||
toolbar: this.toolbar.toolbar
|
||||
});
|
||||
},
|
||||
|
||||
SetDisabled: function(state) {
|
||||
this.view && this.view.SetDisabled(state);
|
||||
},
|
||||
|
||||
getView: function(name) {
|
||||
return !name && this.view ?
|
||||
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
||||
},
|
||||
|
||||
onCoAuthoringDisconnect: function() {
|
||||
this.SetDisabled(true);
|
||||
},
|
||||
|
||||
onApiFocusObject: function(selectedObjects) {
|
||||
if (!this.toolbar.editMode) return;
|
||||
|
||||
var pr, i = -1, type,
|
||||
paragraph_locked = false,
|
||||
header_locked = false,
|
||||
in_header = false,
|
||||
in_equation = false,
|
||||
in_image = false;
|
||||
|
||||
while (++i < selectedObjects.length) {
|
||||
type = selectedObjects[i].get_ObjectType();
|
||||
pr = selectedObjects[i].get_ObjectValue();
|
||||
|
||||
if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
paragraph_locked = pr.get_Locked();
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Header) {
|
||||
header_locked = pr.get_Locked();
|
||||
in_header = true;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Image) {
|
||||
in_image = true;
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Math) {
|
||||
in_equation = true;
|
||||
}
|
||||
}
|
||||
|
||||
this._state.prcontrolsdisable = paragraph_locked || header_locked;
|
||||
|
||||
var need_disable = paragraph_locked || in_equation || in_image || in_header;
|
||||
_.each (this.view.btnsNotes, function(item){
|
||||
item.setDisabled(need_disable);
|
||||
}, this);
|
||||
},
|
||||
|
||||
onApiCanAddHyperlink: function(value) {
|
||||
var need_disable = !value || this._state.prcontrolsdisable;
|
||||
|
||||
if ( this.toolbar.editMode ) {
|
||||
_.each (this.view.btnsHyperlink, function(item){
|
||||
item.setDisabled(need_disable);
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
|
||||
onHyperlinkClick: function(btn) {
|
||||
var me = this,
|
||||
win, props, text;
|
||||
|
||||
if (me.api){
|
||||
|
||||
var handlerDlg = function(dlg, result) {
|
||||
if (result == 'ok') {
|
||||
props = dlg.getSettings();
|
||||
(text!==false)
|
||||
? me.api.add_Hyperlink(props)
|
||||
: me.api.change_Hyperlink(props);
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
};
|
||||
|
||||
text = me.api.can_AddHyperlink();
|
||||
|
||||
if (text !== false) {
|
||||
win = new DE.Views.HyperlinkSettingsDialog({
|
||||
api: me.api,
|
||||
handler: handlerDlg
|
||||
});
|
||||
|
||||
props = new Asc.CHyperlinkProperty();
|
||||
props.put_Text(text);
|
||||
|
||||
win.show();
|
||||
win.setSettings(props);
|
||||
} else {
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
if (selectedElements && _.isArray(selectedElements)){
|
||||
_.each(selectedElements, function(el, i) {
|
||||
if (selectedElements[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink)
|
||||
props = selectedElements[i].get_ObjectValue();
|
||||
});
|
||||
}
|
||||
if (props) {
|
||||
win = new DE.Views.HyperlinkSettingsDialog({
|
||||
api: me.api,
|
||||
handler: handlerDlg
|
||||
});
|
||||
win.show();
|
||||
win.setSettings(props);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Add Hyperlink');
|
||||
},
|
||||
|
||||
onTableContents: function(type){
|
||||
switch (type) {
|
||||
case 0:
|
||||
var props = this.api.asc_GetTableOfContentsPr(),
|
||||
hasTable = !!props;
|
||||
if (!props) {
|
||||
props = new Asc.CTableOfContentsPr();
|
||||
props.put_OutlineRange(1, 9);
|
||||
}
|
||||
props.put_Hyperlink(true);
|
||||
props.put_ShowPageNumbers(true);
|
||||
props.put_RightAlignTab(true);
|
||||
props.put_TabLeader( Asc.c_oAscTabLeader.Dot);
|
||||
(hasTable) ? this.api.asc_SetTableOfContentsPr(props) : this.api.asc_AddTableOfContents(null, props);
|
||||
break;
|
||||
case 1:
|
||||
var props = this.api.asc_GetTableOfContentsPr(),
|
||||
hasTable = !!props;
|
||||
if (!props) {
|
||||
props = new Asc.CTableOfContentsPr();
|
||||
props.put_OutlineRange(1, 9);
|
||||
}
|
||||
props.put_Hyperlink(true);
|
||||
props.put_ShowPageNumbers(false);
|
||||
props.put_TabLeader( Asc.c_oAscTabLeader.None);
|
||||
(hasTable) ? this.api.asc_SetTableOfContentsPr(props) : this.api.asc_AddTableOfContents(null, props);
|
||||
break;
|
||||
case 'settings':
|
||||
var props = this.api.asc_GetTableOfContentsPr(),
|
||||
me = this;
|
||||
var win = new DE.Views.TableOfContentsSettings({
|
||||
api: this.api,
|
||||
props: props,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
(props) ? me.api.asc_SetTableOfContentsPr(value) : me.api.asc_AddTableOfContents(null, value);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
break;
|
||||
case 'remove':
|
||||
this.api.asc_RemoveTableOfContents();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onTableContentsUpdate: function(type){
|
||||
this.api.asc_UpdateTableOfContents(type == 'pages');
|
||||
},
|
||||
|
||||
onNotesClick: function(type) {
|
||||
var me = this;
|
||||
switch (type) {
|
||||
case 'ins_footnote':
|
||||
this.api.asc_AddFootnote();
|
||||
break;
|
||||
case 'delele':
|
||||
Common.UI.warning({
|
||||
msg: this.view.confirmDeleteFootnotes,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function (btn) {
|
||||
if (btn == 'yes') {
|
||||
this.api.asc_RemoveAllFootnotes();
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
case 'settings':
|
||||
(new DE.Views.NoteSettingsDialog({
|
||||
api: me.api,
|
||||
handler: function (result, settings) {
|
||||
if (settings) {
|
||||
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
|
||||
if (result == 'insert')
|
||||
me.api.asc_AddFootnote(settings.custom);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
},
|
||||
props: me.api.asc_GetFootnoteProps()
|
||||
})).show();
|
||||
break;
|
||||
case 'prev':
|
||||
this.api.asc_GotoFootnote(false);
|
||||
setTimeout(function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}, 50);
|
||||
break;
|
||||
case 'next':
|
||||
this.api.asc_GotoFootnote(true);
|
||||
setTimeout(function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}, 50);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}, DE.Controllers.Links || {}));
|
||||
});
|
|
@ -893,7 +893,8 @@ define([
|
|||
rightmenuController = application.getController('RightMenu'),
|
||||
leftmenuController = application.getController('LeftMenu'),
|
||||
chatController = application.getController('Common.Controllers.Chat'),
|
||||
pluginsController = application.getController('Common.Controllers.Plugins');
|
||||
pluginsController = application.getController('Common.Controllers.Plugins'),
|
||||
navigationController = application.getController('Navigation');
|
||||
|
||||
leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document});
|
||||
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
||||
|
@ -907,6 +908,8 @@ define([
|
|||
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
|
||||
me.api.asc_registerCallback('asc_onPluginsReset', _.bind(me.resetPluginsList, me));
|
||||
|
||||
navigationController.setApi(me.api);
|
||||
|
||||
documentHolderController.setApi(me.api);
|
||||
documentHolderController.createDelayedElements();
|
||||
statusbarController.createDelayedElements();
|
||||
|
|
231
apps/documenteditor/main/app/controller/Navigation.js
Normal file
231
apps/documenteditor/main/app/controller/Navigation.js
Normal file
|
@ -0,0 +1,231 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* User: Julia.Radzhabova
|
||||
* Date: 14.12.17
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/main/app/collection/Navigation',
|
||||
'documenteditor/main/app/view/Navigation'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.Navigation = Backbone.Controller.extend(_.extend({
|
||||
models: [],
|
||||
collections: [
|
||||
'Navigation'
|
||||
],
|
||||
views: [
|
||||
'Navigation'
|
||||
],
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
this.addListeners({
|
||||
'Navigation': {
|
||||
'show': function() {
|
||||
var obj = me.api.asc_ShowDocumentOutline();
|
||||
if (!me._navigationObject)
|
||||
me._navigationObject = obj;
|
||||
me.updateNavigation();
|
||||
},
|
||||
'hide': function() {
|
||||
me.api.asc_HideDocumentOutline();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
events: function() {
|
||||
},
|
||||
|
||||
onLaunch: function() {
|
||||
this.panelNavigation= this.createView('Navigation', {
|
||||
storeNavigation: this.getApplication().getCollection('Navigation')
|
||||
});
|
||||
this.panelNavigation.on('render:after', _.bind(this.onAfterRender, this));
|
||||
this._navigationObject = null;
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onDocumentOutlineUpdate', _.bind(this.updateNavigation, this));
|
||||
this.api.asc_registerCallback('asc_onDocumentOutlineCurrentPosition', _.bind(this.onChangeOutlinePosition, this));
|
||||
this.api.asc_registerCallback('asc_onDocumentOutlineUpdateAdd', _.bind(this.updateNavigation, this));
|
||||
this.api.asc_registerCallback('asc_onDocumentOutlineUpdateChange', _.bind(this.updateChangeNavigation, this));
|
||||
this.api.asc_registerCallback('asc_onDocumentOutlineUpdateRemove', _.bind(this.updateNavigation, this));
|
||||
return this;
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
},
|
||||
|
||||
onAfterRender: function(panelNavigation) {
|
||||
panelNavigation.viewNavigationList.on('item:click', _.bind(this.onSelectItem, this));
|
||||
panelNavigation.viewNavigationList.on('item:contextmenu', _.bind(this.onItemContextMenu, this));
|
||||
panelNavigation.navigationMenu.on('item:click', _.bind(this.onMenuItemClick, this));
|
||||
panelNavigation.navigationMenu.items[11].menu.on('item:click', _.bind(this.onMenuLevelsItemClick, this));
|
||||
},
|
||||
|
||||
updateNavigation: function() {
|
||||
if (!this._navigationObject) return;
|
||||
|
||||
var count = this._navigationObject.get_ElementsCount(),
|
||||
prev_level = -1,
|
||||
header_level = -1,
|
||||
first_header = !this._navigationObject.isFirstItemNotHeader(),
|
||||
arr = [];
|
||||
for (var i=0; i<count; i++) {
|
||||
var level = this._navigationObject.get_Level(i),
|
||||
hasParent = true;
|
||||
if (level>prev_level && i>0)
|
||||
arr[i-1].set('hasSubItems', true);
|
||||
if (header_level<0 || level<=header_level) {
|
||||
if (i>0 || first_header)
|
||||
header_level = level;
|
||||
hasParent = false;
|
||||
}
|
||||
arr.push(new Common.UI.TreeViewModel({
|
||||
name : this._navigationObject.get_Text(i),
|
||||
level: level,
|
||||
index: i,
|
||||
hasParent: hasParent,
|
||||
isEmptyItem: this._navigationObject.isEmptyItem(i)
|
||||
}));
|
||||
prev_level = level;
|
||||
}
|
||||
if (count>0 && !first_header) {
|
||||
arr[0].set('hasSubItems', false);
|
||||
arr[0].set('isNotHeader', true);
|
||||
arr[0].set('name', this.txtBeginning);
|
||||
arr[0].set('tip', this.txtGotoBeginning);
|
||||
}
|
||||
this.getApplication().getCollection('Navigation').reset(arr);
|
||||
},
|
||||
|
||||
updateChangeNavigation: function(index) {
|
||||
if (!this._navigationObject) return;
|
||||
|
||||
var item = this.getApplication().getCollection('Navigation').at(index);
|
||||
if (item.get('level') !== this._navigationObject.get_Level(index) ||
|
||||
index==0 && item.get('isNotHeader') !== this._navigationObject.isFirstItemNotHeader()) {
|
||||
this.updateNavigation();
|
||||
} else {
|
||||
item.set('name', this._navigationObject.get_Text(index));
|
||||
item.set('isEmptyItem', this._navigationObject.isEmptyItem(index));
|
||||
}
|
||||
},
|
||||
|
||||
onChangeOutlinePosition: function(index) {
|
||||
this.panelNavigation.viewNavigationList.selectByIndex(index);
|
||||
},
|
||||
|
||||
onItemContextMenu: function(picker, item, record, e){
|
||||
var showPoint;
|
||||
var menu = this.panelNavigation.navigationMenu;
|
||||
if (menu.isVisible()) {
|
||||
menu.hide();
|
||||
}
|
||||
|
||||
var parentOffset = this.panelNavigation.$el.offset(),
|
||||
top = e.clientY*Common.Utils.zoom();
|
||||
showPoint = [e.clientX*Common.Utils.zoom() + 5, top - parentOffset.top + 5];
|
||||
|
||||
var isNotHeader = record.get('isNotHeader');
|
||||
menu.items[0].setDisabled(isNotHeader);
|
||||
menu.items[1].setDisabled(isNotHeader);
|
||||
menu.items[3].setDisabled(isNotHeader);
|
||||
menu.items[7].setDisabled(isNotHeader);
|
||||
|
||||
if (showPoint != undefined) {
|
||||
var menuContainer = this.panelNavigation.$el.find('#menu-navigation-container');
|
||||
if (!menu.rendered) {
|
||||
if (menuContainer.length < 1) {
|
||||
menuContainer = $('<div id="menu-navigation-container" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>', menu.id);
|
||||
$(this.panelNavigation.$el).append(menuContainer);
|
||||
}
|
||||
menu.render(menuContainer);
|
||||
menu.cmpEl.attr({tabindex: "-1"});
|
||||
}
|
||||
menu.cmpEl.attr('data-value', record.get('index'));
|
||||
menuContainer.css({
|
||||
left: showPoint[0],
|
||||
top: showPoint[1]
|
||||
});
|
||||
menu.show();
|
||||
_.delay(function() {
|
||||
menu.cmpEl.focus();
|
||||
}, 10);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onSelectItem: function(picker, item, record, e){
|
||||
if (!this._navigationObject) return;
|
||||
this._navigationObject.goto(record.get('index'));
|
||||
},
|
||||
|
||||
onMenuItemClick: function (menu, item) {
|
||||
if (!this._navigationObject) return;
|
||||
|
||||
var index = parseInt(menu.cmpEl.attr('data-value'));
|
||||
if (item.value == 'promote') {
|
||||
this._navigationObject.promote(index);
|
||||
} else if (item.value == 'demote') {
|
||||
this._navigationObject.demote(index);
|
||||
} else if (item.value == 'before') {
|
||||
this._navigationObject.insertHeader(index, true);
|
||||
} else if (item.value == 'after') {
|
||||
this._navigationObject.insertHeader(index, false);
|
||||
} else if (item.value == 'new') {
|
||||
this._navigationObject.insertSubHeader(index);
|
||||
} else if (item.value == 'select') {
|
||||
this._navigationObject.selectContent(index);
|
||||
} else if (item.value == 'expand') {
|
||||
this.panelNavigation.viewNavigationList.expandAll();
|
||||
} else if (item.value == 'collapse') {
|
||||
this.panelNavigation.viewNavigationList.collapseAll();
|
||||
}
|
||||
},
|
||||
|
||||
onMenuLevelsItemClick: function (menu, item) {
|
||||
this.panelNavigation.viewNavigationList.expandToLevel(item.value-1);
|
||||
},
|
||||
|
||||
txtBeginning: 'Beginning of document',
|
||||
txtGotoBeginning: 'Go to the beginning of the document'
|
||||
|
||||
}, DE.Controllers.Navigation || {}));
|
||||
});
|
|
@ -48,13 +48,11 @@ define([
|
|||
'common/main/lib/view/InsertTableDialog',
|
||||
'common/main/lib/util/define',
|
||||
'documenteditor/main/app/view/Toolbar',
|
||||
'documenteditor/main/app/view/HyperlinkSettingsDialog',
|
||||
'documenteditor/main/app/view/DropcapSettingsAdvanced',
|
||||
'documenteditor/main/app/view/MailMergeRecepients',
|
||||
'documenteditor/main/app/view/StyleTitleDialog',
|
||||
'documenteditor/main/app/view/PageMarginsDialog',
|
||||
'documenteditor/main/app/view/PageSizeDialog',
|
||||
'documenteditor/main/app/view/NoteSettingsDialog',
|
||||
'documenteditor/main/app/controller/PageLayout',
|
||||
'documenteditor/main/app/view/CustomColumnsDialog',
|
||||
'documenteditor/main/app/view/ControlSettingsDialog'
|
||||
|
@ -277,7 +275,6 @@ define([
|
|||
toolbar.mnuLineSpace.on('item:toggle', _.bind(this.onLineSpaceToggle, this));
|
||||
toolbar.mnuNonPrinting.on('item:toggle', _.bind(this.onMenuNonPrintingToggle, this));
|
||||
toolbar.btnShowHidenChars.on('toggle', _.bind(this.onNonPrintingToggle, this));
|
||||
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlinkClick, this));
|
||||
toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this));
|
||||
toolbar.mnuInsertTable.on('item:click', _.bind(this.onInsertTableClick, this));
|
||||
toolbar.mnuInsertImage.on('item:click', _.bind(this.onInsertImageClick, this));
|
||||
|
@ -311,10 +308,6 @@ define([
|
|||
toolbar.mnuZoomIn.on('click', _.bind(this.onZoomInClick, this));
|
||||
toolbar.mnuZoomOut.on('click', _.bind(this.onZoomOutClick, this));
|
||||
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
|
||||
toolbar.btnNotes.on('click', _.bind(this.onNotesClick, this));
|
||||
toolbar.btnNotes.menu.on('item:click', _.bind(this.onNotesMenuClick, this));
|
||||
toolbar.mnuGotoFootPrev.on('click', _.bind(this.onFootnotePrevClick, this));
|
||||
toolbar.mnuGotoFootNext.on('click', _.bind(this.onFootnoteNextClick, this));
|
||||
|
||||
$('#id-save-style-plus, #id-save-style-link', toolbar.$el).on('click', this.onMenuSaveStyle.bind(this));
|
||||
|
||||
|
@ -338,7 +331,6 @@ define([
|
|||
this.api.asc_registerCallback('asc_onPrAlign', _.bind(this.onApiParagraphAlign, this));
|
||||
this.api.asc_registerCallback('asc_onTextColor', _.bind(this.onApiTextColor, this));
|
||||
this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this.onApiLineSpacing, this));
|
||||
this.api.asc_registerCallback('asc_onCanAddHyperlink', _.bind(this.onApiCanAddHyperlink, this));
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||
this.api.asc_registerCallback('asc_onDocSize', _.bind(this.onApiPageSize, this));
|
||||
this.api.asc_registerCallback('asc_onPaintFormatChanged', _.bind(this.onApiStyleChange, this));
|
||||
|
@ -574,14 +566,6 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onApiCanAddHyperlink: function(value) {
|
||||
var need_disable = !value || this._state.prcontrolsdisable;
|
||||
|
||||
if ( this.editMode ) {
|
||||
this.toolbar.btnInsertHyperlink.setDisabled(need_disable);
|
||||
}
|
||||
},
|
||||
|
||||
onApiPageSize: function(w, h) {
|
||||
var width = this._state.pgorient ? w : h,
|
||||
height = this._state.pgorient ? h : w;
|
||||
|
@ -770,10 +754,6 @@ define([
|
|||
|
||||
toolbar.btnEditHeader.setDisabled(in_equation);
|
||||
|
||||
need_disable = paragraph_locked || in_equation || in_image || in_header || control_plain;
|
||||
if (need_disable !== toolbar.btnNotes.isDisabled())
|
||||
toolbar.btnNotes.setDisabled(need_disable);
|
||||
|
||||
need_disable = paragraph_locked || header_locked || in_image || control_plain;
|
||||
if (need_disable != toolbar.btnColumns.isDisabled())
|
||||
toolbar.btnColumns.setDisabled(need_disable);
|
||||
|
@ -1314,58 +1294,6 @@ define([
|
|||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onHyperlinkClick: function(btn) {
|
||||
var me = this,
|
||||
win, props, text;
|
||||
|
||||
if (me.api){
|
||||
|
||||
var handlerDlg = function(dlg, result) {
|
||||
if (result == 'ok') {
|
||||
props = dlg.getSettings();
|
||||
(text!==false)
|
||||
? me.api.add_Hyperlink(props)
|
||||
: me.api.change_Hyperlink(props);
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
};
|
||||
|
||||
text = me.api.can_AddHyperlink();
|
||||
|
||||
if (text !== false) {
|
||||
win = new DE.Views.HyperlinkSettingsDialog({
|
||||
api: me.api,
|
||||
handler: handlerDlg
|
||||
});
|
||||
|
||||
props = new Asc.CHyperlinkProperty();
|
||||
props.put_Text(text);
|
||||
|
||||
win.show();
|
||||
win.setSettings(props);
|
||||
} else {
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
if (selectedElements && _.isArray(selectedElements)){
|
||||
_.each(selectedElements, function(el, i) {
|
||||
if (selectedElements[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink)
|
||||
props = selectedElements[i].get_ObjectValue();
|
||||
});
|
||||
}
|
||||
if (props) {
|
||||
win = new DE.Views.HyperlinkSettingsDialog({
|
||||
api: me.api,
|
||||
handler: handlerDlg
|
||||
});
|
||||
win.show();
|
||||
win.setSettings(props);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Add Hyperlink');
|
||||
},
|
||||
|
||||
onTablePickerSelect: function(picker, columns, rows, e) {
|
||||
if (this.api) {
|
||||
this.toolbar.fireEvent('inserttable', this.toolbar);
|
||||
|
@ -2109,68 +2037,6 @@ define([
|
|||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onNotesClick: function() {
|
||||
if (this.api)
|
||||
this.api.asc_AddFootnote();
|
||||
},
|
||||
|
||||
onNotesMenuClick: function(menu, item) {
|
||||
if (this.api) {
|
||||
if (item.value == 'ins_footnote')
|
||||
this.api.asc_AddFootnote();
|
||||
else if (item.value == 'delele')
|
||||
Common.UI.warning({
|
||||
msg: this.confirmDeleteFootnotes,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (btn == 'yes') {
|
||||
this.api.asc_RemoveAllFootnotes();
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
}, this)
|
||||
});
|
||||
else if (item.value == 'settings') {
|
||||
var me = this;
|
||||
(new DE.Views.NoteSettingsDialog({
|
||||
api: me.api,
|
||||
handler: function(result, settings) {
|
||||
if (settings) {
|
||||
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
|
||||
if (result == 'insert')
|
||||
me.api.asc_AddFootnote(settings.custom);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
},
|
||||
props : me.api.asc_GetFootnoteProps()
|
||||
})).show();
|
||||
} else
|
||||
return;
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
}
|
||||
},
|
||||
|
||||
onFootnotePrevClick: function(btn) {
|
||||
if (this.api)
|
||||
this.api.asc_GotoFootnote(false);
|
||||
|
||||
var me = this;
|
||||
setTimeout(function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}, 50);
|
||||
},
|
||||
|
||||
onFootnoteNextClick: function(btn) {
|
||||
if (this.api)
|
||||
this.api.asc_GotoFootnote(true);
|
||||
|
||||
var me = this;
|
||||
setTimeout(function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}, 50);
|
||||
},
|
||||
|
||||
_clearBullets: function() {
|
||||
this.toolbar.btnMarkers.toggle(false, true);
|
||||
this.toolbar.btnNumbers.toggle(false, true);
|
||||
|
@ -2895,15 +2761,19 @@ define([
|
|||
var $panel = this.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||
|
||||
if ( $panel )
|
||||
me.toolbar.addTab(tab, $panel, 3);
|
||||
me.toolbar.addTab(tab, $panel, 4);
|
||||
|
||||
if (config.isDesktopApp && config.isOffline) {
|
||||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||
|
||||
if ( $panel )
|
||||
me.toolbar.addTab(tab, $panel, 4);
|
||||
me.toolbar.addTab(tab, $panel, 5);
|
||||
}
|
||||
|
||||
var links = me.getApplication().getController('Links');
|
||||
links.setApi(me.api).setConfig({toolbar: me});
|
||||
Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons());
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3309,8 +3179,7 @@ define([
|
|||
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?',
|
||||
notcriticalErrorTitle: 'Warning',
|
||||
txtMarginsW: 'Left and right margins are too high for a given page wight',
|
||||
txtMarginsH: 'Top and bottom margins are too high for a given page height',
|
||||
confirmDeleteFootnotes: 'Do you want to delete all footnotes?'
|
||||
txtMarginsH: 'Top and bottom margins are too high for a given page height'
|
||||
|
||||
}, DE.Controllers.Toolbar || {}));
|
||||
});
|
|
@ -6,6 +6,7 @@
|
|||
<button id="left-btn-chat" class="btn btn-category" content-target="left-panel-chat"><i class="icon img-toolbarmenu btn-menu-chat"> </i></button>
|
||||
<!-- /** coauthoring end **/ -->
|
||||
<button id="left-btn-plugins" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-plugin"> </i></button>
|
||||
<button id="left-btn-navigation" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-navigation"> </i></button>
|
||||
<button id="left-btn-support" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-support"> </i></button>
|
||||
<button id="left-btn-about" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-about"> </i></button>
|
||||
</div>
|
||||
|
@ -15,5 +16,6 @@
|
|||
<div id="left-panel-chat" class="" style="display: none;" />
|
||||
<!-- /** coauthoring end **/ -->
|
||||
<div id="left-panel-plugins" class="" style="display: none; height: 100%;" />
|
||||
<div id="left-panel-navigation" class="" style="display: none; height: 100%;" />
|
||||
</div>
|
||||
</div>
|
|
@ -108,6 +108,7 @@
|
|||
<div class="group">
|
||||
<span class="btn-slot text x-huge btn-pagebreak"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-editheader"></span>
|
||||
<span class="btn-slot text x-huge btn-contents"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
|
@ -121,8 +122,8 @@
|
|||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-inshyperlink"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-notes"></span>
|
||||
<span class="btn-slot text x-huge slot-inshyperlink"></span>
|
||||
<span class="btn-slot text x-huge slot-notes"></span>
|
||||
<span class="btn-slot text x-huge slot-comment"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
|
@ -160,6 +161,20 @@
|
|||
<span class="btn-slot text x-huge" id="slot-img-wrapping"></span>
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel" data-tab="links">
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge btn-contents"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-contents-update"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge slot-notes"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge slot-inshyperlink"></span>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
|
@ -53,7 +53,8 @@ define([
|
|||
'common/main/lib/view/Plugins',
|
||||
'common/main/lib/view/About',
|
||||
'common/main/lib/view/SearchDialog',
|
||||
'documenteditor/main/app/view/FileMenu'
|
||||
'documenteditor/main/app/view/FileMenu',
|
||||
'documenteditor/main/app/view/Navigation'
|
||||
], function (menuTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
|
@ -73,6 +74,7 @@ define([
|
|||
'click #left-btn-chat': _.bind(this.onCoauthOptions, this),
|
||||
/** coauthoring end **/
|
||||
'click #left-btn-plugins': _.bind(this.onCoauthOptions, this),
|
||||
'click #left-btn-navigation': _.bind(this.onCoauthOptions, this),
|
||||
'click #left-btn-support': function() {
|
||||
var config = this.mode.customization;
|
||||
config && !!config.feedback && !!config.feedback.url ?
|
||||
|
@ -151,6 +153,15 @@ define([
|
|||
this.btnPlugins.hide();
|
||||
this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this));
|
||||
|
||||
this.btnNavigation = new Common.UI.Button({
|
||||
el: $('#left-btn-navigation'),
|
||||
hint: this.tipNavigation,
|
||||
enableToggle: true,
|
||||
disabled: true,
|
||||
toggleGroup: 'leftMenuGroup'
|
||||
});
|
||||
this.btnNavigation.on('click', _.bind(this.onBtnMenuClick, this));
|
||||
|
||||
this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this));
|
||||
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
|
||||
|
||||
|
@ -222,6 +233,12 @@ define([
|
|||
this.panelChat['hide']();
|
||||
}
|
||||
}
|
||||
if (this.panelNavigation) {
|
||||
if (this.btnNavigation.pressed) {
|
||||
this.panelNavigation.show();
|
||||
} else
|
||||
this.panelNavigation['hide']();
|
||||
}
|
||||
/** coauthoring end **/
|
||||
// if (this.mode.canPlugins && this.panelPlugins) {
|
||||
// if (this.btnPlugins.pressed) {
|
||||
|
@ -243,6 +260,9 @@ define([
|
|||
} else
|
||||
if (name == 'plugins' && !this.panelPlugins) {
|
||||
this.panelPlugins = panel.render(/*'#left-panel-plugins'*/);
|
||||
} else
|
||||
if (name == 'navigation' && !this.panelNavigation) {
|
||||
this.panelNavigation = panel.render('#left-panel-navigation');
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -284,6 +304,10 @@ define([
|
|||
this.panelPlugins['hide']();
|
||||
this.btnPlugins.toggle(false, true);
|
||||
}
|
||||
if (this.panelNavigation) {
|
||||
this.panelNavigation['hide']();
|
||||
this.btnNavigation.toggle(false, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -304,6 +328,7 @@ define([
|
|||
this.btnChat.setDisabled(false);
|
||||
/** coauthoring end **/
|
||||
this.btnPlugins.setDisabled(false);
|
||||
this.btnNavigation.setDisabled(false);
|
||||
},
|
||||
|
||||
showMenu: function(menu, opts) {
|
||||
|
@ -385,6 +410,7 @@ define([
|
|||
tipSearch : 'Search',
|
||||
tipPlugins : 'Plugins',
|
||||
txtDeveloper: 'DEVELOPER MODE',
|
||||
txtTrial: 'TRIAL MODE'
|
||||
txtTrial: 'TRIAL MODE',
|
||||
tipNavigation: 'Navigation'
|
||||
}, DE.Views.LeftMenu || {}));
|
||||
});
|
||||
|
|
272
apps/documenteditor/main/app/view/Links.js
Normal file
272
apps/documenteditor/main/app/view/Links.js
Normal file
|
@ -0,0 +1,272 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Links.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 22.12.2017
|
||||
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/component/Layout'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
DE.Views.Links = Common.UI.BaseView.extend(_.extend((function(){
|
||||
function setEvents() {
|
||||
var me = this;
|
||||
this.btnsContents.forEach(function(button) {
|
||||
button.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('links:contents', [item.value]);
|
||||
});
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:contents', [0]);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnContentsUpdate.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('links:update', [item.value]);
|
||||
});
|
||||
this.btnContentsUpdate.on('click', function (b, e) {
|
||||
me.fireEvent('links:update', ['all']);
|
||||
});
|
||||
|
||||
this.btnsNotes.forEach(function(button) {
|
||||
button.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('links:notes', [item.value]);
|
||||
});
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['ins_footnote']);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsPrevNote.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['prev']);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsNextNote.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['next']);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsHyperlink.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:hyperlink');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
options: {},
|
||||
|
||||
initialize: function (options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this);
|
||||
this.toolbar = options.toolbar;
|
||||
|
||||
this.btnsContents = [];
|
||||
this.btnsNotes = [];
|
||||
this.btnsPrevNote = [];
|
||||
this.btnsNextNote = [];
|
||||
this.btnsHyperlink = [];
|
||||
this.paragraphControls = [];
|
||||
|
||||
var me = this,
|
||||
$host = me.toolbar.$el;
|
||||
var _injectComponent = function (id, cmp) {
|
||||
var $slot = $host.find(id);
|
||||
if ($slot.length)
|
||||
cmp.rendered ? $slot.append(cmp.$el) : cmp.render($slot);
|
||||
};
|
||||
|
||||
var _injectComponents = function ($slots, iconCls, split, menu, caption, btnsArr) {
|
||||
$slots.each(function(index, el) {
|
||||
var _cls = 'btn-toolbar';
|
||||
/x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
|
||||
|
||||
var button = new Common.UI.Button({
|
||||
cls: _cls,
|
||||
iconCls: iconCls,
|
||||
caption: caption,
|
||||
split: split,
|
||||
menu: menu,
|
||||
disabled: true
|
||||
}).render( $slots.eq(index) );
|
||||
|
||||
btnsArr.push(button);
|
||||
me.paragraphControls.push(button);
|
||||
});
|
||||
};
|
||||
|
||||
_injectComponents($host.find('.btn-slot.btn-contents'), 'btn-contents', true, true, me.capBtnInsContents, me.btnsContents);
|
||||
_injectComponents($host.find('.btn-slot.slot-notes'), 'btn-notes', true, true, me.capBtnInsFootnote, me.btnsNotes);
|
||||
_injectComponents($host.find('.btn-slot.slot-inshyperlink'), 'btn-inserthyperlink', false, false, me.capBtnInsLink, me.btnsHyperlink);
|
||||
|
||||
this.btnContentsUpdate = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-contents-update',
|
||||
caption: this.capBtnContentsUpdate,
|
||||
split: true,
|
||||
menu: true,
|
||||
disabled: true
|
||||
});
|
||||
_injectComponent('#slot-btn-contents-update', this.btnContentsUpdate);
|
||||
this.paragraphControls.push(this.btnContentsUpdate);
|
||||
|
||||
this._state = {disabled: false};
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
|
||||
render: function (el) {
|
||||
return this;
|
||||
},
|
||||
|
||||
onAppReady: function (config) {
|
||||
var me = this;
|
||||
(new Promise(function (accept, reject) {
|
||||
accept();
|
||||
})).then(function(){
|
||||
var contentsTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem" class="item-contents"><div style="background-position: 0 -<%= options.offsety %>px;" ></div></a>');
|
||||
me.btnsContents.forEach( function(btn) {
|
||||
btn.updateHint( me.tipContents );
|
||||
|
||||
var _menu = new Common.UI.Menu({
|
||||
items: [
|
||||
{template: contentsTemplate, offsety: 0, value: 0},
|
||||
{template: contentsTemplate, offsety: 72, value: 1},
|
||||
{caption: me.textContentsSettings, value: 'settings'},
|
||||
{caption: me.textContentsRemove, value: 'remove'}
|
||||
]
|
||||
});
|
||||
|
||||
btn.setMenu(_menu);
|
||||
});
|
||||
|
||||
me.btnContentsUpdate.updateHint(me.tipContentsUpdate);
|
||||
me.btnContentsUpdate.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: me.textUpdateAll, value: 'all'},
|
||||
{caption: me.textUpdatePages, value: 'pages'}
|
||||
]
|
||||
}));
|
||||
|
||||
me.btnsNotes.forEach( function(btn, index) {
|
||||
btn.updateHint( me.tipNotes );
|
||||
|
||||
var _menu = new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: me.mniInsFootnote, value: 'ins_footnote'},
|
||||
{caption: '--'},
|
||||
new Common.UI.MenuItem({
|
||||
template: _.template([
|
||||
'<div class="menu-zoom" style="height: 25px;" ',
|
||||
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
|
||||
'data-stopPropagation="true"',
|
||||
'<% } %>', '>',
|
||||
'<label class="title">' + me.textGotoFootnote + '</label>',
|
||||
'<button id="id-menu-goto-footnote-next-' + index + '" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><i class="icon mmerge-next"> </i></button>',
|
||||
'<button id="id-menu-goto-footnote-prev-' + index + '" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><i class="icon mmerge-prev"> </i></button>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
stopPropagation: true
|
||||
}),
|
||||
{caption: '--'},
|
||||
{caption: me.mniDelFootnote, value: 'delele'},
|
||||
{caption: me.mniNoteSettings, value: 'settings'}
|
||||
]
|
||||
});
|
||||
btn.setMenu(_menu);
|
||||
|
||||
me.btnsPrevNote.push(new Common.UI.Button({
|
||||
el: $('#id-menu-goto-footnote-prev-'+index),
|
||||
cls: 'btn-toolbar'
|
||||
}));
|
||||
me.btnsNextNote.push(me.mnuGotoFootNext = new Common.UI.Button({
|
||||
el: $('#id-menu-goto-footnote-next-'+index),
|
||||
cls: 'btn-toolbar'
|
||||
}));
|
||||
});
|
||||
|
||||
me.btnsHyperlink.forEach( function(btn) {
|
||||
btn.updateHint(me.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
|
||||
});
|
||||
|
||||
setEvents.call(me);
|
||||
});
|
||||
},
|
||||
|
||||
show: function () {
|
||||
Common.UI.BaseView.prototype.show.call(this);
|
||||
this.fireEvent('show', this);
|
||||
},
|
||||
|
||||
getButtons: function() {
|
||||
return this.paragraphControls;
|
||||
},
|
||||
|
||||
SetDisabled: function (state) {
|
||||
this._state.disabled = state;
|
||||
this.paragraphControls.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(state);
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
capBtnInsContents: 'Table of Contents',
|
||||
tipContents: 'Insert table of contents',
|
||||
textContentsSettings: 'Settings',
|
||||
textContentsRemove: 'Remove table of contents',
|
||||
capBtnContentsUpdate: 'Update',
|
||||
tipContentsUpdate: 'Update table of contents',
|
||||
textUpdateAll: 'Update entire table',
|
||||
textUpdatePages: 'Update page numbers only',
|
||||
tipNotes: 'Footnotes',
|
||||
mniInsFootnote: 'Insert Footnote',
|
||||
mniDelFootnote: 'Delete All Footnotes',
|
||||
mniNoteSettings: 'Notes Settings',
|
||||
textGotoFootnote: 'Go to Footnotes',
|
||||
capBtnInsFootnote: 'Footnotes',
|
||||
confirmDeleteFootnotes: 'Do you want to delete all footnotes?',
|
||||
capBtnInsLink: 'Hyperlink',
|
||||
tipInsertHyperlink: 'Add Hyperlink'
|
||||
}
|
||||
}()), DE.Views.Links || {}));
|
||||
});
|
163
apps/documenteditor/main/app/view/Navigation.js
Normal file
163
apps/documenteditor/main/app/view/Navigation.js
Normal file
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* User: Julia.Radzhabova
|
||||
* Date: 14.12.17
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/component/Layout',
|
||||
'common/main/lib/component/TreeView'
|
||||
], function (template) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.Navigation = Common.UI.BaseView.extend(_.extend({
|
||||
el: '#left-panel-navigation',
|
||||
|
||||
storeNavigation: undefined,
|
||||
template: _.template([
|
||||
'<div id="navigation-box" class="layout-ct vbox">',
|
||||
// '<div id="navigation-header"><%= scope.strNavigate %></div>',
|
||||
'<div id="navigation-list" class="">',
|
||||
'</div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
initialize: function(options) {
|
||||
_.extend(this, options);
|
||||
Common.UI.BaseView.prototype.initialize.call(this, arguments);
|
||||
},
|
||||
|
||||
render: function(el) {
|
||||
el = el || this.el;
|
||||
$(el).html(this.template({scope: this}));
|
||||
this.$el = $(el);
|
||||
|
||||
this.viewNavigationList = new Common.UI.TreeView({
|
||||
el: $('#navigation-list'),
|
||||
store: this.storeNavigation,
|
||||
enableKeyEvents: false,
|
||||
emptyText: this.txtEmpty,
|
||||
emptyItemText: this.txtEmptyItem
|
||||
});
|
||||
this.viewNavigationList.cmpEl.off('click');
|
||||
this.navigationMenu = new Common.UI.Menu({
|
||||
items: [{
|
||||
caption : this.txtPromote,
|
||||
value: 'promote'
|
||||
},
|
||||
{
|
||||
caption : this.txtDemote,
|
||||
value: 'demote'
|
||||
},
|
||||
{
|
||||
caption : '--'
|
||||
},
|
||||
{
|
||||
caption : this.txtHeadingBefore,
|
||||
value: 'before'
|
||||
},
|
||||
{
|
||||
caption : this.txtHeadingAfter,
|
||||
value: 'after'
|
||||
},
|
||||
{
|
||||
caption : this.txtNewHeading,
|
||||
value: 'new'
|
||||
},
|
||||
{
|
||||
caption : '--'
|
||||
},
|
||||
{
|
||||
caption : this.txtSelect,
|
||||
value: 'select'
|
||||
},
|
||||
{
|
||||
caption : '--'
|
||||
},
|
||||
{
|
||||
caption : this.txtExpand,
|
||||
value: 'expand'
|
||||
},
|
||||
{
|
||||
caption : this.txtCollapse,
|
||||
value: 'collapse'
|
||||
},
|
||||
{
|
||||
caption : this.txtExpandToLevel,
|
||||
menu: new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
style: 'min-width: 60px;',
|
||||
items: [{ caption : '1', value: 1 }, { caption : '2', value: 2 }, { caption : '3', value: 3 },
|
||||
{ caption : '4', value: 4 }, { caption : '5', value: 5 }, { caption : '6', value: 6 },
|
||||
{ caption : '7', value: 7 }, { caption : '8', value: 8 }, { caption : '9', value: 9 }
|
||||
]
|
||||
})
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
this.trigger('render:after', this);
|
||||
return this;
|
||||
},
|
||||
|
||||
show: function () {
|
||||
Common.UI.BaseView.prototype.show.call(this,arguments);
|
||||
this.fireEvent('show', this );
|
||||
},
|
||||
|
||||
hide: function () {
|
||||
Common.UI.BaseView.prototype.hide.call(this,arguments);
|
||||
this.fireEvent('hide', this );
|
||||
},
|
||||
|
||||
ChangeSettings: function(props) {
|
||||
},
|
||||
|
||||
strNavigate: 'Table of Contents',
|
||||
txtPromote: 'Promote',
|
||||
txtDemote: 'Demote',
|
||||
txtHeadingBefore: 'New heading before',
|
||||
txtHeadingAfter: 'New heading after',
|
||||
txtNewHeading: 'New subheading',
|
||||
txtSelect: 'Select content',
|
||||
txtExpand: 'Expand all',
|
||||
txtCollapse: 'Collapse all',
|
||||
txtExpandToLevel: 'Expand to level...',
|
||||
txtEmpty: 'This document doesn\'t contain headings',
|
||||
txtEmptyItem: 'Empty Heading'
|
||||
|
||||
}, DE.Views.Navigation || {}));
|
||||
});
|
615
apps/documenteditor/main/app/view/TableOfContentsSettings.js
Normal file
615
apps/documenteditor/main/app/view/TableOfContentsSettings.js
Normal file
|
@ -0,0 +1,615 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* TableOfContentsSettings.js.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 26.12.2017
|
||||
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/component/MetricSpinner',
|
||||
'common/main/lib/component/ComboBox',
|
||||
'common/main/lib/view/AdvancedSettingsWindow'
|
||||
], function () { 'use strict';
|
||||
|
||||
DE.Views.TableOfContentsSettings = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||
options: {
|
||||
contentWidth: 500,
|
||||
height: 455
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
var me = this;
|
||||
|
||||
_.extend(this.options, {
|
||||
title: this.textTitle,
|
||||
template: [
|
||||
'<div class="box" style="height:' + (me.options.height - 85) + 'px;">',
|
||||
'<div class="content-panel" style="padding: 15px 10px;"><div class="inner-content">',
|
||||
'<div class="settings-panel active">',
|
||||
'<table cols="2" style="width: 100%;">',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<div id="tableofcontents-chb-pages"></div>',
|
||||
'</td>',
|
||||
'<td rowspan="5" class="padding-small" style="vertical-align: top;">',
|
||||
'<div style="border: 1px solid #cbcbcb;width: 230px; height: 172px; float: right;">',
|
||||
'<div id="tableofcontents-img" style="width: 100%; height: 100%;"></div>',
|
||||
'</div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<div id="tableofcontents-chb-align"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-large">',
|
||||
'<label class="input-label">' + me.textLeader + '</label>',
|
||||
'<div id="tableofcontents-combo-leader" class="input-group-nr" style="display: inline-block; width:95px; margin-left: 10px;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-large">',
|
||||
'<div id="tableofcontents-chb-links"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<label class="input-label padding-small" style="display: block;">' + me.textBuildTable + '</label>',
|
||||
'<div id="tableofcontents-radio-styles" class="padding-small" style="display: block;"></div>',
|
||||
'<div id="tableofcontents-radio-levels" class="" style="display: block;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small" style="vertical-align: top;">',
|
||||
'<div id="tableofcontents-from-levels" style="width:220px;">',
|
||||
'<label class="input-label">' + me.textLevels + '</label>',
|
||||
'<div id="tableofcontents-spin-levels" style="display: inline-block; width:95px; margin-left: 10px;"></div>',
|
||||
'</div>',
|
||||
'<div id="tableofcontents-from-styles" class="hidden">',
|
||||
'<table><tr><td style="height: 25px;">',
|
||||
'<label class="input-label" style="width: 144px; margin-left: 23px;">' + me.textStyle + '</label>',
|
||||
'<label class="input-label" style="">' + me.textLevel + '</label>',
|
||||
'</td></tr>',
|
||||
'<tr><td>',
|
||||
'<div id="tableofcontents-styles-list" class="header-styles-tableview" style="width:100%; height: 122px;"></div>',
|
||||
'</td></tr></table>',
|
||||
'</div>',
|
||||
'</td>',
|
||||
'<td class="padding-small" style="vertical-align: top;">',
|
||||
'<label class="input-label" style="margin-left: 15px;">' + me.textStyles + '</label>',
|
||||
'<div id="tableofcontents-combo-styles" class="input-group-nr" style="display: inline-block; width:95px; margin-left: 10px;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div></div>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'<div class="separator horizontal"/>',
|
||||
'<div class="footer center">',
|
||||
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px; width: 86px;">' + me.okButtonText + '</button>',
|
||||
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + me.cancelButtonText + '</button>',
|
||||
'</div>'
|
||||
].join('')
|
||||
}, options);
|
||||
|
||||
this.api = options.api;
|
||||
this.handler = options.handler;
|
||||
this.props = options.props;
|
||||
this.startLevel = 1;
|
||||
this.endLevel = 3;
|
||||
this._noApply = true;
|
||||
this._originalProps = null;
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||
var me = this;
|
||||
|
||||
this.chPages = new Common.UI.CheckBox({
|
||||
el: $('#tableofcontents-chb-pages'),
|
||||
labelText: this.strShowPages,
|
||||
value: 'checked'
|
||||
});
|
||||
this.chPages.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()=='checked');
|
||||
this.chAlign.setDisabled(!checked);
|
||||
this.cmbLeader.setDisabled(!checked);
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.put_ShowPageNumbers(checked);
|
||||
if (checked) {
|
||||
properties.put_RightAlignTab(this.chAlign.getValue() == 'checked');
|
||||
properties.put_TabLeader(this.cmbLeader.getValue());
|
||||
}
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.chAlign = new Common.UI.CheckBox({
|
||||
el: $('#tableofcontents-chb-align'),
|
||||
labelText: this.strAlign,
|
||||
value: 'checked'
|
||||
});
|
||||
this.chAlign.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()=='checked');
|
||||
this.cmbLeader.setDisabled(!checked);
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.put_RightAlignTab(checked);
|
||||
if (checked) {
|
||||
properties.put_TabLeader(this.cmbLeader.getValue());
|
||||
}
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.cmbLeader = new Common.UI.ComboBox({
|
||||
el : $('#tableofcontents-combo-leader'),
|
||||
style : 'width: 85px;',
|
||||
menuStyle : 'min-width: 85px;',
|
||||
editable : false,
|
||||
cls : 'input-group-nr',
|
||||
data : [
|
||||
{ value: Asc.c_oAscTabLeader.None, displayValue: this.textNone },
|
||||
{ value: Asc.c_oAscTabLeader.Dot, displayValue: '....................' },
|
||||
{ value: Asc.c_oAscTabLeader.Hyphen, displayValue: '-----------------' },
|
||||
{ value: Asc.c_oAscTabLeader.Underscore,displayValue: '__________' }
|
||||
]
|
||||
});
|
||||
this.cmbLeader.setValue(Asc.c_oAscTabLeader.Dot);
|
||||
this.cmbLeader.on('selected', _.bind(function(combo, record) {
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.put_TabLeader(record.value);
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.chLinks = new Common.UI.CheckBox({
|
||||
el: $('#tableofcontents-chb-links'),
|
||||
labelText: this.strLinks,
|
||||
value: 'checked'
|
||||
});
|
||||
this.chLinks.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.put_Hyperlink(field.getValue()=='checked');
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.radioLevels = new Common.UI.RadioBox({
|
||||
el: $('#tableofcontents-radio-levels'),
|
||||
labelText: this.textRadioLevels,
|
||||
name: 'asc-radio-content-build',
|
||||
checked: true
|
||||
});
|
||||
this.radioLevels.on('change', _.bind(function(field, newValue, eOpts) {
|
||||
if (newValue) {
|
||||
this.levelsContainer.toggleClass('hidden', !newValue);
|
||||
this.stylesContainer.toggleClass('hidden', newValue);
|
||||
if (this._needUpdateOutlineLevels)
|
||||
this.synchronizeLevelsFromStyles();
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.radioStyles = new Common.UI.RadioBox({
|
||||
el: $('#tableofcontents-radio-styles'),
|
||||
labelText: this.textRadioStyles,
|
||||
name: 'asc-radio-content-build'
|
||||
});
|
||||
this.radioStyles.on('change', _.bind(function(field, newValue, eOpts) {
|
||||
if (newValue) {
|
||||
this.stylesContainer.toggleClass('hidden', !newValue);
|
||||
this.levelsContainer.toggleClass('hidden', newValue);
|
||||
if (this._needUpdateStyles)
|
||||
this.synchronizeLevelsFromOutline();
|
||||
this.stylesList.scroller.update({alwaysVisibleY: true});
|
||||
setTimeout(function(){
|
||||
var rec = me.stylesLevels.findWhere({checked: true});
|
||||
if (rec)
|
||||
me.stylesList.scrollToRecord(rec);
|
||||
}, 10);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.cmbStyles = new Common.UI.ComboBox({
|
||||
el: $('#tableofcontents-combo-styles'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 150px;',
|
||||
editable: false,
|
||||
data: [
|
||||
{ displayValue: this.txtCurrent, value: Asc.c_oAscTOCStylesType.Current },
|
||||
{ displayValue: this.txtSimple, value: Asc.c_oAscTOCStylesType.Simple },
|
||||
{ displayValue: this.txtStandard, value: Asc.c_oAscTOCStylesType.Standard },
|
||||
{ displayValue: this.txtModern, value: Asc.c_oAscTOCStylesType.Modern },
|
||||
{ displayValue: this.txtClassic, value: Asc.c_oAscTOCStylesType.Classic }
|
||||
]
|
||||
});
|
||||
this.cmbStyles.setValue(Asc.c_oAscTOCStylesType.Current);
|
||||
this.cmbStyles.on('selected', _.bind(function(combo, record) {
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.put_StylesType(record.value);
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.spnLevels = new Common.UI.CustomSpinner({
|
||||
el: $('#tableofcontents-spin-levels'),
|
||||
step: 1,
|
||||
width: 85,
|
||||
defaultUnit : "",
|
||||
value: 3,
|
||||
maxValue: 9,
|
||||
minValue: 1,
|
||||
allowDecimal: false,
|
||||
maskExp: /[1-9]/
|
||||
});
|
||||
this.spnLevels.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
this._needUpdateStyles = true;
|
||||
this.startLevel = 1;
|
||||
this.endLevel = field.getNumberValue();
|
||||
|
||||
if (this.api && !this._noApply) {
|
||||
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.clear_Styles();
|
||||
properties.put_OutlineRange(this.startLevel, this.endLevel);
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.stylesLevels = new Common.UI.DataViewStore();
|
||||
|
||||
if (this.stylesLevels) {
|
||||
this.stylesList = new Common.UI.ListView({
|
||||
el: $('#tableofcontents-styles-list', this.$window),
|
||||
store: this.stylesLevels,
|
||||
simpleAddMode: true,
|
||||
showLast: false,
|
||||
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
|
||||
itemTemplate: _.template([
|
||||
'<div id="<%= id %>" class="list-item">',
|
||||
'<div class="<% if (checked) { %>checked<% } %>"><%= name %></div>',
|
||||
'<div>',
|
||||
'<div class="input-field" style="width:40px;"><input type="text" class="form-control" value="<%= value %>" style="text-align: right;">',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
].join(''))
|
||||
});
|
||||
this.stylesList.on('item:change', _.bind(this.onItemChange, this));
|
||||
this.stylesList.on('item:add', _.bind(this.addEvents, this));
|
||||
}
|
||||
|
||||
this.levelsContainer = $('#tableofcontents-from-levels');
|
||||
this.stylesContainer = $('#tableofcontents-from-styles');
|
||||
this.afterRender();
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this._setDefaults(this.props);
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
|
||||
},
|
||||
|
||||
_setDefaults: function (props) {
|
||||
this._noApply = true;
|
||||
|
||||
var me = this,
|
||||
docStyles = this.api.asc_GetStylesArray(),
|
||||
styles = [];
|
||||
_.each(docStyles, function (style) {
|
||||
var name = style.get_Name(),
|
||||
level = me.api.asc_GetHeadingLevel(name);
|
||||
if (style.get_QFormat() || level>=0) {
|
||||
styles.push({
|
||||
name: name,
|
||||
allowSelected: false,
|
||||
checked: false,
|
||||
value: '',
|
||||
headerLevel: (level>=0) ? level+1 : -1 // -1 if is not header
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (props) {
|
||||
var value = props.get_Hyperlink();
|
||||
this.chLinks.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
|
||||
value = props.get_StylesType();
|
||||
this.cmbStyles.setValue((value!==null) ? value : Asc.c_oAscTOCStylesType.Current);
|
||||
|
||||
var start = props.get_OutlineStart(),
|
||||
end = props.get_OutlineEnd(),
|
||||
count = props.get_StylesCount();
|
||||
|
||||
this.startLevel = start;
|
||||
this.endLevel = end;
|
||||
|
||||
if ((start<0 || end<0) && count<1) {
|
||||
start = 1;
|
||||
end = 9;
|
||||
this.spnLevels.setValue(end, true);
|
||||
}
|
||||
|
||||
var disable_outlines = false;
|
||||
for (var i=0; i<count; i++) {
|
||||
var style = props.get_StyleName(i),
|
||||
level = props.get_StyleLevel(i),
|
||||
rec = _.findWhere(styles, {name: style});
|
||||
if (rec) {
|
||||
rec.checked = true;
|
||||
rec.value = level;
|
||||
if (rec.headerLevel !== level)
|
||||
disable_outlines = true;
|
||||
} else {
|
||||
styles.push({
|
||||
name: style,
|
||||
allowSelected: false,
|
||||
checked: true,
|
||||
value: level,
|
||||
headerLevel: -1
|
||||
});
|
||||
disable_outlines = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (start>0 && end>0) {
|
||||
for (var i=start; i<=end; i++) {
|
||||
var rec = _.findWhere(styles, {headerLevel: i});
|
||||
if (rec) {
|
||||
rec.checked = true;
|
||||
rec.value = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
var new_start = -1, new_end = -1, empty_index = -1;
|
||||
for (var i=0; i<9; i++) {
|
||||
var rec = _.findWhere(styles, {headerLevel: i+1});
|
||||
if (rec) {
|
||||
var headerLevel = rec.headerLevel,
|
||||
level = rec.value;
|
||||
if (headerLevel == level) {
|
||||
if (empty_index<1) {
|
||||
if (new_start<1)
|
||||
new_start = level;
|
||||
new_end = level;
|
||||
} else {
|
||||
new_start = new_end = -1;
|
||||
disable_outlines = true;
|
||||
break;
|
||||
}
|
||||
} else if (!rec.checked) {
|
||||
(new_start>0) && (empty_index = i+1);
|
||||
} else {
|
||||
new_start = new_end = -1;
|
||||
disable_outlines = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.spnLevels.setValue(new_end>0 ? new_end : '', true);
|
||||
this.spnLevels.setDisabled(disable_outlines || new_start>1 );
|
||||
}
|
||||
this.stylesLevels.reset(styles);
|
||||
if (this.spnLevels.isDisabled()) {
|
||||
this.radioStyles.setValue(true);
|
||||
this.stylesList.scroller.update({alwaysVisibleY: true});
|
||||
var rec = this.stylesLevels.findWhere({checked: true});
|
||||
if (rec)
|
||||
this.stylesList.scrollToRecord(rec);
|
||||
}
|
||||
|
||||
// Show Pages is always true when window is opened
|
||||
this._originalProps = (props) ? props : new Asc.CTableOfContentsPr();
|
||||
if (!props) {
|
||||
this._originalProps.put_OutlineRange(this.startLevel, this.endLevel);
|
||||
this._originalProps.put_Hyperlink(this.chLinks.getValue() == 'checked');
|
||||
}
|
||||
this._originalProps.put_ShowPageNumbers(this.chPages.getValue() == 'checked');
|
||||
if (this.chPages.getValue() == 'checked') {
|
||||
this._originalProps.put_RightAlignTab(this.chAlign.getValue() == 'checked');
|
||||
this._originalProps.put_TabLeader(this.cmbLeader.getValue());
|
||||
}
|
||||
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', this._originalProps);
|
||||
|
||||
this._noApply = false;
|
||||
},
|
||||
|
||||
synchronizeLevelsFromOutline: function() {
|
||||
var start = 1, end = this.spnLevels.getNumberValue();
|
||||
this.stylesLevels.each(function (style) {
|
||||
var header = style.get('headerLevel');
|
||||
if (header>=start && header<=end) {
|
||||
style.set('checked', true);
|
||||
style.set('value', header);
|
||||
} else {
|
||||
style.set('checked', false);
|
||||
style.set('value', '');
|
||||
}
|
||||
});
|
||||
this._needUpdateStyles = false;
|
||||
},
|
||||
|
||||
synchronizeLevelsFromStyles: function() {
|
||||
var new_start = -1, new_end = -1, empty_index = -1,
|
||||
disable_outlines = false;
|
||||
|
||||
for (var i=0; i<9; i++) {
|
||||
var rec = this.stylesLevels.findWhere({headerLevel: i+1});
|
||||
if (rec) {
|
||||
var headerLevel = rec.get('headerLevel'),
|
||||
level = rec.get('value');
|
||||
if (headerLevel == level) {
|
||||
if (empty_index<1) {
|
||||
if (new_start<1)
|
||||
new_start = level;
|
||||
new_end = level;
|
||||
} else {
|
||||
new_start = new_end = -1;
|
||||
disable_outlines = true;
|
||||
break;
|
||||
}
|
||||
} else if (!rec.get('checked')) {
|
||||
(new_start>0) && (empty_index = i+1);
|
||||
} else {
|
||||
new_start = new_end = -1;
|
||||
disable_outlines = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (new_start<0 && new_end<0) {
|
||||
var rec = this.stylesLevels.findWhere({checked: true});
|
||||
if (rec) { // has checked style
|
||||
disable_outlines = true;
|
||||
} else { // all levels are empty
|
||||
new_start = 1;
|
||||
new_end = 9;
|
||||
}
|
||||
}
|
||||
|
||||
this.startLevel = new_start;
|
||||
this.endLevel = new_end;
|
||||
|
||||
this.spnLevels.setValue(new_end>0 ? new_end : '', true);
|
||||
this.spnLevels.setDisabled(disable_outlines || new_start>1 );
|
||||
this._needUpdateOutlineLevels = false;
|
||||
},
|
||||
|
||||
getSettings: function () {
|
||||
var props = new Asc.CTableOfContentsPr();
|
||||
|
||||
props.put_Hyperlink(this.chLinks.getValue() == 'checked');
|
||||
props.put_ShowPageNumbers(this.chPages.getValue() == 'checked');
|
||||
if (this.chPages.getValue() == 'checked') {
|
||||
props.put_RightAlignTab(this.chAlign.getValue() == 'checked');
|
||||
props.put_TabLeader(this.cmbLeader.getValue());
|
||||
}
|
||||
props.put_StylesType(this.cmbStyles.getValue());
|
||||
|
||||
props.clear_Styles();
|
||||
if (this._needUpdateOutlineLevels) {
|
||||
this.synchronizeLevelsFromStyles();
|
||||
}
|
||||
if (!this._needUpdateStyles) // if this._needUpdateStyles==true - fill only OutlineRange
|
||||
this.stylesLevels.each(function (style) {
|
||||
if (style.get('checked'))
|
||||
props.add_Style(style.get('name'), style.get('value'));
|
||||
});
|
||||
props.put_OutlineRange(this.startLevel, this.endLevel);
|
||||
return props;
|
||||
},
|
||||
|
||||
addEvents: function(listView, itemView, record) {
|
||||
var input = itemView.$el.find('input'),
|
||||
me = this;
|
||||
input.on('keypress', function(e) {
|
||||
var charCode = String.fromCharCode(e.which);
|
||||
if(!/[1-9]/.test(charCode) && !e.ctrlKey && e.keyCode !== Common.UI.Keys.DELETE && e.keyCode !== Common.UI.Keys.BACKSPACE &&
|
||||
e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT && e.keyCode !== Common.UI.Keys.HOME &&
|
||||
e.keyCode !== Common.UI.Keys.END && e.keyCode !== Common.UI.Keys.ESC && e.keyCode !== Common.UI.Keys.INSERT &&
|
||||
e.keyCode !== Common.UI.Keys.TAB || input.val().length>1){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
});
|
||||
input.on('input', function(e) {
|
||||
// console.log(input.val());
|
||||
var isEmpty = _.isEmpty(input.val());
|
||||
if (record.get('checked') !== !isEmpty) {
|
||||
record.set('checked', !isEmpty);
|
||||
}
|
||||
record.set('value', (isEmpty) ? '' : parseInt(input.val()));
|
||||
me._needUpdateOutlineLevels = true;
|
||||
|
||||
if (me.api && !me._noApply) {
|
||||
var properties = (me._originalProps) ? me._originalProps : new Asc.CTableOfContentsPr();
|
||||
properties.clear_Styles();
|
||||
me.stylesLevels.each(function (style) {
|
||||
if (style.get('checked'))
|
||||
properties.add_Style(style.get('name'), style.get('value'));
|
||||
});
|
||||
if (properties.get_StylesCount()>0)
|
||||
properties.put_OutlineRange(-1, -1);
|
||||
else
|
||||
properties.put_OutlineRange(1, 9);
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
onItemChange: function(listView, itemView, record) {
|
||||
this.addEvents(listView, itemView, record);
|
||||
setTimeout(function(){
|
||||
itemView.$el.find('input').focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
textTitle: 'Table of Contents',
|
||||
textLeader: 'Leader',
|
||||
textBuildTable: 'Build table of contents from',
|
||||
textLevels: 'Levels',
|
||||
textStyles: 'Styles',
|
||||
strShowPages: 'Show page numbers',
|
||||
strAlign: 'Right align page numbers',
|
||||
strLinks: 'Format Table of Contents as links',
|
||||
textNone: 'None',
|
||||
textRadioLevels: 'Outline levels',
|
||||
textRadioStyles: 'Selected styles',
|
||||
textStyle: 'Style',
|
||||
textLevel: 'Level',
|
||||
cancelButtonText: 'Cancel',
|
||||
okButtonText : 'Ok',
|
||||
txtCurrent: 'Current',
|
||||
txtSimple: 'Simple',
|
||||
txtStandard: 'Standard',
|
||||
txtModern: 'Modern',
|
||||
txtClassic: 'Classic'
|
||||
|
||||
}, DE.Views.TableOfContentsSettings || {}))
|
||||
});
|
|
@ -83,7 +83,8 @@ define([
|
|||
{ caption: me.textTabFile, action: 'file', extcls: 'canedit'},
|
||||
{ caption: me.textTabHome, action: 'home', extcls: 'canedit'},
|
||||
{ caption: me.textTabInsert, action: 'ins', extcls: 'canedit'},
|
||||
{ caption: me.textTabLayout, action: 'layout', extcls: 'canedit'}
|
||||
{ caption: me.textTabLayout, action: 'layout', extcls: 'canedit'},
|
||||
{ caption: me.textTabLinks, action: 'links', extcls: 'canedit'}
|
||||
]}
|
||||
);
|
||||
|
||||
|
@ -520,14 +521,6 @@ define([
|
|||
});
|
||||
this.paragraphControls.push(this.btnInsertTextArt);
|
||||
|
||||
this.btnInsertHyperlink = new Common.UI.Button({
|
||||
id: 'tlbtn-insertlink',
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: me.capBtnInsLink,
|
||||
iconCls: 'btn-inserthyperlink'
|
||||
});
|
||||
this.paragraphControls.push(this.btnInsertHyperlink);
|
||||
|
||||
this.btnEditHeader = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-editheader',
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
|
@ -942,16 +935,6 @@ define([
|
|||
});
|
||||
this.toolbarControls.push(this.btnColorSchemas);
|
||||
|
||||
this.btnNotes = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-notes',
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-notes',
|
||||
caption: me.capBtnInsFootnote,
|
||||
split: true,
|
||||
menu: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnNotes);
|
||||
|
||||
this.btnMailRecepients = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-mailrecepients',
|
||||
cls: 'btn-toolbar',
|
||||
|
@ -1293,7 +1276,6 @@ define([
|
|||
_injectComponent('#slot-btn-dropcap', this.btnDropCap);
|
||||
_injectComponent('#slot-btn-controls', this.btnContentControls);
|
||||
_injectComponent('#slot-btn-columns', this.btnColumns);
|
||||
_injectComponent('#slot-btn-inshyperlink', this.btnInsertHyperlink);
|
||||
_injectComponent('#slot-btn-editheader', this.btnEditHeader);
|
||||
_injectComponent('#slot-btn-insshape', this.btnInsertShape);
|
||||
_injectComponent('#slot-btn-insequation', this.btnInsertEquation);
|
||||
|
@ -1309,7 +1291,6 @@ define([
|
|||
_injectComponent('#slot-field-styles', this.listStyles);
|
||||
_injectComponent('#slot-btn-halign', this.btnHorizontalAlign);
|
||||
_injectComponent('#slot-btn-mailrecepients', this.btnMailRecepients);
|
||||
_injectComponent('#slot-btn-notes', this.btnNotes);
|
||||
_injectComponent('#slot-img-align', this.btnImgAlign);
|
||||
_injectComponent('#slot-img-group', this.btnImgGroup);
|
||||
_injectComponent('#slot-img-movefrwd', this.btnImgForward);
|
||||
|
@ -1544,7 +1525,6 @@ define([
|
|||
this.btnInsertChart.updateHint(this.tipInsertChart);
|
||||
this.btnInsertText.updateHint(this.tipInsertText);
|
||||
this.btnInsertTextArt.updateHint(this.tipInsertTextArt);
|
||||
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
|
||||
this.btnEditHeader.updateHint(this.tipEditHeader);
|
||||
this.btnInsertShape.updateHint(this.tipInsertShape);
|
||||
this.btnInsertEquation.updateHint(this.tipInsertEquation);
|
||||
|
@ -1560,7 +1540,6 @@ define([
|
|||
this.btnMailRecepients.updateHint(this.tipMailRecepients);
|
||||
this.btnHide.updateHint(this.tipViewSettings);
|
||||
this.btnAdvSettings.updateHint(this.tipAdvSettings);
|
||||
this.btnNotes.updateHint(this.tipNotes);
|
||||
|
||||
// set menus
|
||||
|
||||
|
@ -1685,40 +1664,6 @@ define([
|
|||
cls: 'btn-toolbar'
|
||||
});
|
||||
|
||||
this.btnNotes.setMenu(
|
||||
new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: this.mniInsFootnote, value: 'ins_footnote'},
|
||||
{caption: '--'},
|
||||
this.mnuGotoFootnote = new Common.UI.MenuItem({
|
||||
template: _.template([
|
||||
'<div id="id-toolbar-menu-goto-footnote" class="menu-zoom" style="height: 25px;" ',
|
||||
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
|
||||
'data-stopPropagation="true"',
|
||||
'<% } %>', '>',
|
||||
'<label class="title">' + this.textGotoFootnote + '</label>',
|
||||
'<button id="id-menu-goto-footnote-next" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><i class="icon mmerge-next"> </i></button>',
|
||||
'<button id="id-menu-goto-footnote-prev" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><i class="icon mmerge-prev"> </i></button>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
stopPropagation: true
|
||||
}),
|
||||
{caption: '--'},
|
||||
{caption: this.mniDelFootnote, value: 'delele'},
|
||||
{caption: this.mniNoteSettings, value: 'settings'}
|
||||
]
|
||||
})
|
||||
);
|
||||
|
||||
this.mnuGotoFootPrev = new Common.UI.Button({
|
||||
el: $('#id-menu-goto-footnote-prev'),
|
||||
cls: 'btn-toolbar'
|
||||
});
|
||||
this.mnuGotoFootNext = new Common.UI.Button({
|
||||
el: $('#id-menu-goto-footnote-next'),
|
||||
cls: 'btn-toolbar'
|
||||
});
|
||||
|
||||
// set dataviews
|
||||
|
||||
var _conf = this.mnuMarkersPicker.conf;
|
||||
|
@ -2362,7 +2307,6 @@ define([
|
|||
tipEditHeader: 'Edit Document Header or Footer',
|
||||
mniEditHeader: 'Edit Document Header',
|
||||
mniEditFooter: 'Edit Document Footer',
|
||||
tipInsertHyperlink: 'Add Hyperlink',
|
||||
mniHiddenChars: 'Nonprinting Characters',
|
||||
mniHiddenBorders: 'Hidden Table Borders',
|
||||
tipSynchronize: 'The document has been changed by another user. Please click to save your changes and reload the updates.',
|
||||
|
@ -2453,17 +2397,11 @@ define([
|
|||
textLandscape: 'Landscape',
|
||||
textInsertPageCount: 'Insert number of pages',
|
||||
textCharts: 'Charts',
|
||||
tipNotes: 'Footnotes',
|
||||
mniInsFootnote: 'Insert Footnote',
|
||||
mniDelFootnote: 'Delete All Footnotes',
|
||||
mniNoteSettings: 'Notes Settings',
|
||||
textGotoFootnote: 'Go to Footnotes',
|
||||
tipChangeChart: 'Change Chart Type',
|
||||
capBtnInsPagebreak: 'Page Break',
|
||||
capBtnInsImage: 'Picture',
|
||||
capBtnInsTable: 'Table',
|
||||
capBtnInsChart: 'Chart',
|
||||
capBtnInsLink: 'Hyperlink',
|
||||
textTabFile: 'File',
|
||||
textTabHome: 'Home',
|
||||
textTabInsert: 'Insert',
|
||||
|
@ -2473,7 +2411,6 @@ define([
|
|||
capBtnInsTextbox: 'Text Box',
|
||||
capBtnInsTextart: 'Text Art',
|
||||
capBtnInsDropcap: 'Drop Cap',
|
||||
capBtnInsFootnote: 'Footnotes',
|
||||
capBtnInsEquation: 'Equation',
|
||||
capBtnInsHeader: 'Headers/Footers',
|
||||
capBtnColumns: 'Columns',
|
||||
|
@ -2495,6 +2432,7 @@ define([
|
|||
textSurface: 'Surface',
|
||||
textTabCollaboration: 'Collaboration',
|
||||
textTabProtect: 'Protection',
|
||||
textTabLinks: 'Links',
|
||||
capBtnInsControls: 'Content Control',
|
||||
textRichControl: 'Rich text',
|
||||
textPlainControl: 'Plain text',
|
||||
|
|
|
@ -140,6 +140,8 @@ require([
|
|||
'DocumentHolder',
|
||||
'Toolbar',
|
||||
'Statusbar',
|
||||
'Links',
|
||||
'Navigation',
|
||||
'RightMenu',
|
||||
'LeftMenu',
|
||||
'Main',
|
||||
|
@ -163,6 +165,8 @@ require([
|
|||
'documenteditor/main/app/controller/Viewport',
|
||||
'documenteditor/main/app/controller/DocumentHolder',
|
||||
'documenteditor/main/app/controller/Toolbar',
|
||||
'documenteditor/main/app/controller/Links',
|
||||
'documenteditor/main/app/controller/Navigation',
|
||||
'documenteditor/main/app/controller/Statusbar',
|
||||
'documenteditor/main/app/controller/RightMenu',
|
||||
'documenteditor/main/app/controller/LeftMenu',
|
||||
|
|
|
@ -436,7 +436,7 @@
|
|||
"DE.Controllers.Statusbar.tipReview": "Track changes",
|
||||
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
|
||||
"DE.Controllers.Toolbar.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 system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
|
||||
"DE.Controllers.Toolbar.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
|
||||
"del_DE.Controllers.Toolbar.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
|
||||
"DE.Controllers.Toolbar.notcriticalErrorTitle": "Warning",
|
||||
"DE.Controllers.Toolbar.textAccent": "Accents",
|
||||
"DE.Controllers.Toolbar.textBracket": "Brackets",
|
||||
|
@ -1252,6 +1252,23 @@
|
|||
"DE.Views.LeftMenu.tipTitles": "Titles",
|
||||
"DE.Views.LeftMenu.txtDeveloper": "DEVELOPER MODE",
|
||||
"DE.Views.LeftMenu.txtTrial": "TRIAL MODE",
|
||||
"DE.Views.Links.capBtnContentsUpdate": "Update",
|
||||
"DE.Views.Links.capBtnInsContents": "Table of Contents",
|
||||
"DE.Views.Links.capBtnInsFootnote": "Footnote",
|
||||
"DE.Views.Links.capBtnInsLink": "Hyperlink",
|
||||
"DE.Views.Links.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
|
||||
"DE.Views.Links.mniDelFootnote": "Delete All Footnotes",
|
||||
"DE.Views.Links.mniInsFootnote": "Insert Footnote",
|
||||
"DE.Views.Links.mniNoteSettings": "Notes Settings",
|
||||
"DE.Views.Links.textContentsRemove": "Remove table of contents",
|
||||
"DE.Views.Links.textContentsSettings": "Settings",
|
||||
"DE.Views.Links.textGotoFootnote": "Go to Footnotes",
|
||||
"DE.Views.Links.textUpdateAll": "Update entire table",
|
||||
"DE.Views.Links.textUpdatePages": "Update page numbers only",
|
||||
"DE.Views.Links.tipContents": "Insert table of contents",
|
||||
"DE.Views.Links.tipContentsUpdate": "Update table of contents",
|
||||
"DE.Views.Links.tipInsertHyperlink": "Add hyperlink",
|
||||
"DE.Views.Links.tipNotes": "Insert or edit footnotes",
|
||||
"DE.Views.MailMergeEmailDlg.cancelButtonText": "Cancel",
|
||||
"DE.Views.MailMergeEmailDlg.filePlaceholder": "PDF",
|
||||
"DE.Views.MailMergeEmailDlg.okButtonText": "Send",
|
||||
|
@ -1643,10 +1660,10 @@
|
|||
"DE.Views.Toolbar.capBtnInsControls": "Content Controls",
|
||||
"DE.Views.Toolbar.capBtnInsDropcap": "Drop Cap",
|
||||
"DE.Views.Toolbar.capBtnInsEquation": "Equation",
|
||||
"DE.Views.Toolbar.capBtnInsFootnote": "Footnote",
|
||||
"del_DE.Views.Toolbar.capBtnInsFootnote": "Footnote",
|
||||
"DE.Views.Toolbar.capBtnInsHeader": "Header/Footer",
|
||||
"DE.Views.Toolbar.capBtnInsImage": "Picture",
|
||||
"DE.Views.Toolbar.capBtnInsLink": "Hyperlink",
|
||||
"del_DE.Views.Toolbar.capBtnInsLink": "Hyperlink",
|
||||
"DE.Views.Toolbar.capBtnInsPagebreak": "Breaks",
|
||||
"DE.Views.Toolbar.capBtnInsShape": "Shape",
|
||||
"DE.Views.Toolbar.capBtnInsTable": "Table",
|
||||
|
@ -1661,7 +1678,7 @@
|
|||
"DE.Views.Toolbar.capImgGroup": "Group",
|
||||
"DE.Views.Toolbar.capImgWrapping": "Wrapping",
|
||||
"DE.Views.Toolbar.mniCustomTable": "Insert Custom Table",
|
||||
"DE.Views.Toolbar.mniDelFootnote": "Delete All Footnotes",
|
||||
"del_DE.Views.Toolbar.mniDelFootnote": "Delete All Footnotes",
|
||||
"DE.Views.Toolbar.mniEditControls": "Control Settings",
|
||||
"DE.Views.Toolbar.mniEditDropCap": "Drop Cap Settings",
|
||||
"DE.Views.Toolbar.mniEditFooter": "Edit Footer",
|
||||
|
@ -1670,8 +1687,8 @@
|
|||
"DE.Views.Toolbar.mniHiddenChars": "Nonprinting Characters",
|
||||
"DE.Views.Toolbar.mniImageFromFile": "Picture from File",
|
||||
"DE.Views.Toolbar.mniImageFromUrl": "Picture from URL",
|
||||
"DE.Views.Toolbar.mniInsFootnote": "Insert Footnote",
|
||||
"DE.Views.Toolbar.mniNoteSettings": "Notes Settings",
|
||||
"del_DE.Views.Toolbar.mniInsFootnote": "Insert Footnote",
|
||||
"del_DE.Views.Toolbar.mniNoteSettings": "Notes Settings",
|
||||
"DE.Views.Toolbar.strMenuNoFill": "No Fill",
|
||||
"DE.Views.Toolbar.textArea": "Area",
|
||||
"DE.Views.Toolbar.textAutoColor": "Automatic",
|
||||
|
@ -1691,7 +1708,7 @@
|
|||
"DE.Views.Toolbar.textEvenPage": "Even Page",
|
||||
"DE.Views.Toolbar.textFitPage": "Fit to Page",
|
||||
"DE.Views.Toolbar.textFitWidth": "Fit to Width",
|
||||
"DE.Views.Toolbar.textGotoFootnote": "Go to Footnotes",
|
||||
"del_DE.Views.Toolbar.textGotoFootnote": "Go to Footnotes",
|
||||
"DE.Views.Toolbar.textHideLines": "Hide Rulers",
|
||||
"DE.Views.Toolbar.textHideStatusBar": "Hide Status Bar",
|
||||
"DE.Views.Toolbar.textHideTitleBar": "Hide Title Bar",
|
||||
|
@ -1777,7 +1794,7 @@
|
|||
"DE.Views.Toolbar.tipIncPrLeft": "Increase indent",
|
||||
"DE.Views.Toolbar.tipInsertChart": "Insert chart",
|
||||
"DE.Views.Toolbar.tipInsertEquation": "Insert equation",
|
||||
"DE.Views.Toolbar.tipInsertHyperlink": "Add hyperlink",
|
||||
"del_DE.Views.Toolbar.tipInsertHyperlink": "Add hyperlink",
|
||||
"DE.Views.Toolbar.tipInsertImage": "Insert picture",
|
||||
"DE.Views.Toolbar.tipInsertNum": "Insert Page Number",
|
||||
"DE.Views.Toolbar.tipInsertShape": "Insert autoshape",
|
||||
|
@ -1788,7 +1805,7 @@
|
|||
"DE.Views.Toolbar.tipMailRecepients": "Mail merge",
|
||||
"DE.Views.Toolbar.tipMarkers": "Bullets",
|
||||
"DE.Views.Toolbar.tipMultilevels": "Multilevel list",
|
||||
"DE.Views.Toolbar.tipNotes": "Insert or edit footnotes",
|
||||
"del_DE.Views.Toolbar.tipNotes": "Insert or edit footnotes",
|
||||
"DE.Views.Toolbar.tipNumbers": "Numbering",
|
||||
"DE.Views.Toolbar.tipPageBreak": "Insert page or section break",
|
||||
"DE.Views.Toolbar.tipPageMargins": "Page margins",
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
BIN
apps/documenteditor/main/resources/img/toolbar/contents.png
Normal file
BIN
apps/documenteditor/main/resources/img/toolbar/contents.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 733 B |
BIN
apps/documenteditor/main/resources/img/toolbar/contents@2x.png
Normal file
BIN
apps/documenteditor/main/resources/img/toolbar/contents@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -75,6 +75,36 @@
|
|||
height:20px;
|
||||
}
|
||||
|
||||
.header-styles-tableview {
|
||||
.list-item > div{
|
||||
&:nth-child(1) {
|
||||
width:160px;
|
||||
height: 16px;
|
||||
padding-left:16px;
|
||||
padding-right: 5px;
|
||||
|
||||
&.checked {
|
||||
&:before {
|
||||
content: '';
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin-left: -18px;
|
||||
background-position: @menu-check-offset-x @menu-check-offset-y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
padding-right: 6px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
@import "../../../../common/main/resources/less/radiobox.less";
|
||||
@import "../../../../common/main/resources/less/dataview.less";
|
||||
@import "../../../../common/main/resources/less/listview.less";
|
||||
@import "../../../../common/main/resources/less/treeview.less";
|
||||
@import "../../../../common/main/resources/less/colorpalette.less";
|
||||
@import "../../../../common/main/resources/less/theme-colorpalette.less";
|
||||
@import "../../../../common/main/resources/less/dimension-picker.less";
|
||||
|
@ -127,6 +128,7 @@
|
|||
@import "filemenu.less";
|
||||
@import "rightmenu.less";
|
||||
@import "advanced-settings.less";
|
||||
@import "navigation.less";
|
||||
|
||||
.font-size-small {
|
||||
.fontsize(@font-size-small);
|
||||
|
|
|
@ -22,6 +22,7 @@ button.notify .btn-menu-comments {background-position: -0*@toolbar-icon-size -60
|
|||
.button-normal-icon(btn-menu-about, 68, @toolbar-icon-size);
|
||||
.button-normal-icon(btn-menu-support, 70, @toolbar-icon-size);
|
||||
.button-normal-icon(btn-menu-plugin, 77, @toolbar-icon-size);
|
||||
.button-normal-icon(btn-menu-navigation, 83, @toolbar-icon-size);
|
||||
|
||||
.tool-menu-btns {
|
||||
width: 40px;
|
||||
|
|
27
apps/documenteditor/main/resources/less/navigation.less
Normal file
27
apps/documenteditor/main/resources/less/navigation.less
Normal file
|
@ -0,0 +1,27 @@
|
|||
#navigation-box {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
#navigation-header {
|
||||
position: absolute;
|
||||
height: 38px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid @gray-dark;
|
||||
}
|
||||
|
||||
#navigation-list {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 8px 0;
|
||||
font-size: 12px;
|
||||
|
||||
.name.not-header {
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,6 +54,37 @@
|
|||
height: 38px;
|
||||
}
|
||||
|
||||
a.item-contents {
|
||||
}
|
||||
|
||||
.btn-contents {
|
||||
.dropdown-menu {
|
||||
> li > a.item-contents {
|
||||
div {
|
||||
.background-ximage('@{app-image-path}/toolbar/contents.png', '@{app-image-path}/toolbar/contents@2x.png', 246px);
|
||||
width: 246px;
|
||||
height: 72px;
|
||||
|
||||
.box-shadow(0 0 0 1px @gray);
|
||||
|
||||
&:hover,
|
||||
&.selected {
|
||||
.box-shadow(0 0 0 2px @primary);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
background-color: transparent;
|
||||
|
||||
div {
|
||||
.box-shadow(0 0 0 2px @primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.color-schemas-menu {
|
||||
span {
|
||||
&.colors {
|
||||
|
|
Loading…
Reference in a new issue