[PE] Show View tab in view/commenting mode
This commit is contained in:
parent
f2531c0ad7
commit
633b44b7bd
|
@ -1255,12 +1255,10 @@ define([
|
||||||
reviewController = application.getController('Common.Controllers.ReviewChanges');
|
reviewController = application.getController('Common.Controllers.ReviewChanges');
|
||||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api).loadDocument({doc:me.document});
|
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api).loadDocument({doc:me.document});
|
||||||
|
|
||||||
if (this.appOptions.isEdit || this.appOptions.isRestrictedEdit) { // set api events for toolbar in the Restricted Editing mode)
|
var toolbarController = application.getController('Toolbar');
|
||||||
var toolbarController = application.getController('Toolbar');
|
toolbarController && toolbarController.setApi(me.api);
|
||||||
toolbarController && toolbarController.setApi(me.api);
|
|
||||||
|
|
||||||
if (!this.appOptions.isEdit) return;
|
|
||||||
|
|
||||||
|
if (this.appOptions.isEdit) { // set api events for toolbar in the Restricted Editing mode)
|
||||||
var rightmenuController = application.getController('RightMenu'),
|
var rightmenuController = application.getController('RightMenu'),
|
||||||
fontsControllers = application.getController('Common.Controllers.Fonts');
|
fontsControllers = application.getController('Common.Controllers.Fonts');
|
||||||
|
|
||||||
|
|
|
@ -2502,10 +2502,6 @@ define([
|
||||||
Array.prototype.push.apply(me.toolbar.lockControls,transitController.getView().getButtons());
|
Array.prototype.push.apply(me.toolbar.lockControls,transitController.getView().getButtons());
|
||||||
Array.prototype.push.apply(me.toolbar.slideOnlyControls,transitController.getView().getButtons());
|
Array.prototype.push.apply(me.toolbar.slideOnlyControls,transitController.getView().getButtons());
|
||||||
|
|
||||||
var viewtab = me.getApplication().getController('ViewTab');
|
|
||||||
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
|
|
||||||
Array.prototype.push.apply(me.toolbar.lockControls, viewtab.getView('ViewTab').getButtons());
|
|
||||||
|
|
||||||
var animationController = me.getApplication().getController('Animation');
|
var animationController = me.getApplication().getController('Animation');
|
||||||
animationController.setApi(me.api).setConfig({toolbar: me,mode:config}).createToolbarPanel();
|
animationController.setApi(me.api).setConfig({toolbar: me,mode:config}).createToolbarPanel();
|
||||||
|
|
||||||
|
@ -2533,6 +2529,15 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tab = {caption: me.toolbar.textTabView, action: 'view', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-view', dataHintTitle: 'W'};
|
||||||
|
var viewtab = me.getApplication().getController('ViewTab');
|
||||||
|
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
|
||||||
|
$panel = viewtab.createToolbarPanel();
|
||||||
|
if ($panel) {
|
||||||
|
me.toolbar.addTab(tab, $panel, 6);
|
||||||
|
me.toolbar.setVisible('view', Common.UI.LayoutManager.isElementVisible('toolbar-view'));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAppReady: function (config) {
|
onAppReady: function (config) {
|
||||||
|
|
|
@ -63,6 +63,7 @@ define([
|
||||||
};
|
};
|
||||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||||
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
|
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
|
||||||
|
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function (api) {
|
setApi: function (api) {
|
||||||
|
@ -70,6 +71,8 @@ define([
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onZoomChange', _.bind(this.onZoomChange, this));
|
this.api.asc_registerCallback('asc_onZoomChange', _.bind(this.onZoomChange, this));
|
||||||
this.api.asc_registerCallback('asc_onNotesShow', _.bind(this.onNotesShow, this));
|
this.api.asc_registerCallback('asc_onNotesShow', _.bind(this.onNotesShow, this));
|
||||||
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -82,21 +85,6 @@ define([
|
||||||
mode: mode,
|
mode: mode,
|
||||||
compactToolbar: this.toolbar.toolbar.isCompactView
|
compactToolbar: this.toolbar.toolbar.isCompactView
|
||||||
});
|
});
|
||||||
if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
|
|
||||||
this.view.chStatusbar.$el.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mode.isEdit) { // if view tab will be visible in view/restricted-editing mode
|
|
||||||
this.view.chToolbar.hide();
|
|
||||||
var me = this;
|
|
||||||
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
|
||||||
if ((action=='plugins' || action=='review') && visible) {
|
|
||||||
me.view.chToolbar.show();
|
|
||||||
}
|
|
||||||
}, this));
|
|
||||||
|
|
||||||
this.view.chRulers.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'ViewTab': {
|
'ViewTab': {
|
||||||
|
@ -122,6 +110,10 @@ define([
|
||||||
this.view && this.view.SetDisabled(state);
|
this.view && this.view.SetDisabled(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createToolbarPanel: function() {
|
||||||
|
return this.view.getPanel();
|
||||||
|
},
|
||||||
|
|
||||||
getView: function(name) {
|
getView: function(name) {
|
||||||
return !name && this.view ?
|
return !name && this.view ?
|
||||||
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
||||||
|
@ -131,6 +123,10 @@ define([
|
||||||
this.SetDisabled(true);
|
this.SetDisabled(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDocumentReady: function() {
|
||||||
|
Common.Utils.lockControls(Common.enumLock.disableOnStart, false, {array: this.view.lockedControls});
|
||||||
|
},
|
||||||
|
|
||||||
onZoomChange: function (percent, type) {
|
onZoomChange: function (percent, type) {
|
||||||
if (this._state.zoom_type !== type) {
|
if (this._state.zoom_type !== type) {
|
||||||
this.view.btnFitToSlide.toggle(type == 2, true);
|
this.view.btnFitToSlide.toggle(type == 2, true);
|
||||||
|
@ -155,6 +151,22 @@ define([
|
||||||
accept();
|
accept();
|
||||||
})).then(function () {
|
})).then(function () {
|
||||||
me.view.setEvents();
|
me.view.setEvents();
|
||||||
|
|
||||||
|
if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
|
||||||
|
me.view.chStatusbar.$el.remove();
|
||||||
|
|
||||||
|
if (!config.isEdit) {
|
||||||
|
var slotChkNotes = me.view.chNotes.$el,
|
||||||
|
groupRulers = slotChkNotes.closest('.group'),
|
||||||
|
groupToolbar = me.view.chToolbar.$el.closest('.group');
|
||||||
|
groupToolbar.find('.elset')[1].append(slotChkNotes[0]);
|
||||||
|
groupRulers.remove();
|
||||||
|
me.view.$el.find('.separator-rulers').remove();
|
||||||
|
}
|
||||||
|
} else if (!config.isEdit) {
|
||||||
|
me.view.chRulers.hide();
|
||||||
|
}
|
||||||
|
|
||||||
me.view.cmbZoom.on('selected', _.bind(me.onSelectedZoomValue, me))
|
me.view.cmbZoom.on('selected', _.bind(me.onSelectedZoomValue, me))
|
||||||
.on('changed:before',_.bind(me.onZoomChanged, me, true))
|
.on('changed:before',_.bind(me.onZoomChanged, me, true))
|
||||||
.on('changed:after', _.bind(me.onZoomChanged, me, false))
|
.on('changed:after', _.bind(me.onZoomChanged, me, false))
|
||||||
|
|
|
@ -178,46 +178,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="panel" data-tab="view">
|
|
||||||
<div class="group small">
|
|
||||||
<div class="elset" style="display: flex;">
|
|
||||||
<span class="btn-slot" id="slot-field-zoom" style="flex-grow: 1;"></span>
|
|
||||||
</div>
|
|
||||||
<div class="elset" style="text-align: center;">
|
|
||||||
<span class="btn-slot text" id="slot-lbl-zoom" style="font-size: 11px;text-align: center;margin-top: 4px;"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="group small">
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-btn-fts" style="font-size: 11px;text-align: center;"></span>
|
|
||||||
</div>
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-btn-ftw" style="font-size: 11px;text-align: center;"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="separator long"></div>
|
|
||||||
<div class="group">
|
|
||||||
<span class="btn-slot text x-huge" id="slot-btn-interface-theme"></span>
|
|
||||||
</div>
|
|
||||||
<div class="separator long"></div>
|
|
||||||
<div class="group small">
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-chk-notes"></span>
|
|
||||||
</div>
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-chk-rulers"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="separator long"></div>
|
|
||||||
<div class="group small">
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-chk-toolbar"></span>
|
|
||||||
</div>
|
|
||||||
<div class="elset">
|
|
||||||
<span class="btn-slot text" id="slot-chk-statusbar"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section id="animation-panel" class="panel" data-tab="animate">
|
<section id="animation-panel" class="panel" data-tab="animate">
|
||||||
<div class="group flex small" id="animation-field-effects" style="width: 700px; max-width: 700px; min-width: 210px;" data-group-width="700px"></div>
|
<div class="group flex small" id="animation-field-effects" style="width: 700px; max-width: 700px; min-width: 210px;" data-group-width="700px"></div>
|
||||||
<div class="group small">
|
<div class="group small">
|
||||||
|
|
|
@ -150,9 +150,8 @@ define([
|
||||||
{caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'},
|
{caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'},
|
||||||
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'},
|
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'},
|
||||||
{caption: me.textTabTransitions, action: 'transit', extcls: 'canedit', dataHintTitle: 'N'},
|
{caption: me.textTabTransitions, action: 'transit', extcls: 'canedit', dataHintTitle: 'N'},
|
||||||
{caption: me.textTabAnimation, action: 'animate', extcls: 'canedit', dataHintTitle: 'A'},
|
{caption: me.textTabAnimation, action: 'animate', extcls: 'canedit', dataHintTitle: 'A'}
|
||||||
undefined, undefined,
|
// undefined, undefined, undefined,
|
||||||
{caption: me.textTabView, action: 'view', extcls: 'canedit', layoutname: 'toolbar-view', dataHintTitle: 'W'}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,6 +46,47 @@ define([
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
PE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){
|
PE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){
|
||||||
|
var template =
|
||||||
|
'<section class="panel" data-tab="view">' +
|
||||||
|
'<div class="group small">' +
|
||||||
|
'<div class="elset" style="display: flex;">' +
|
||||||
|
'<span class="btn-slot" id="slot-field-zoom" style="flex-grow: 1;"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="elset" style="text-align: center;">' +
|
||||||
|
'<span class="btn-slot text" id="slot-lbl-zoom" style="font-size: 11px;text-align: center;margin-top: 4px;"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="group small">' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-btn-fts" style="font-size: 11px;text-align: center;"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-btn-ftw" style="font-size: 11px;text-align: center;"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="separator long"></div>' +
|
||||||
|
'<div class="group">' +
|
||||||
|
'<span class="btn-slot text x-huge" id="slot-btn-interface-theme"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="separator long"></div>' +
|
||||||
|
'<div class="group small">' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-chk-notes"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-chk-rulers"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="separator long separator-rulers"></div>' +
|
||||||
|
'<div class="group small">' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-chk-toolbar"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="elset">' +
|
||||||
|
'<span class="btn-slot text" id="slot-chk-statusbar"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</section>';
|
||||||
return {
|
return {
|
||||||
options: {},
|
options: {},
|
||||||
|
|
||||||
|
@ -81,11 +122,9 @@ define([
|
||||||
|
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
|
|
||||||
var me = this,
|
var me = this;
|
||||||
$host = me.toolbar.$el;
|
|
||||||
|
|
||||||
this.cmbZoom = new Common.UI.ComboBox({
|
this.cmbZoom = new Common.UI.ComboBox({
|
||||||
el: $host.find('#slot-field-zoom'),
|
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 55px;',
|
menuStyle: 'min-width: 55px;',
|
||||||
editable: true,
|
editable: true,
|
||||||
|
@ -109,10 +148,7 @@ define([
|
||||||
this.cmbZoom.setValue(100);
|
this.cmbZoom.setValue(100);
|
||||||
this.lockedControls.push(this.cmbZoom);
|
this.lockedControls.push(this.cmbZoom);
|
||||||
|
|
||||||
$host.find('#slot-lbl-zoom').text(this.textZoom);
|
|
||||||
|
|
||||||
this.btnFitToSlide = new Common.UI.Button({
|
this.btnFitToSlide = new Common.UI.Button({
|
||||||
parentEl: $host.find('#slot-btn-fts'),
|
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'toolbar__icon btn-ic-zoomtoslide',
|
iconCls: 'toolbar__icon btn-ic-zoomtoslide',
|
||||||
caption: this.textFitToSlide,
|
caption: this.textFitToSlide,
|
||||||
|
@ -126,7 +162,6 @@ define([
|
||||||
this.lockedControls.push(this.btnFitToSlide);
|
this.lockedControls.push(this.btnFitToSlide);
|
||||||
|
|
||||||
this.btnFitToWidth = new Common.UI.Button({
|
this.btnFitToWidth = new Common.UI.Button({
|
||||||
parentEl: $host.find('#slot-btn-ftw'),
|
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'toolbar__icon btn-ic-zoomtowidth',
|
iconCls: 'toolbar__icon btn-ic-zoomtowidth',
|
||||||
caption: this.textFitToWidth,
|
caption: this.textFitToWidth,
|
||||||
|
@ -140,7 +175,6 @@ define([
|
||||||
this.lockedControls.push(this.btnFitToWidth);
|
this.lockedControls.push(this.btnFitToWidth);
|
||||||
|
|
||||||
this.btnInterfaceTheme = new Common.UI.Button({
|
this.btnInterfaceTheme = new Common.UI.Button({
|
||||||
parentEl: $host.find('#slot-btn-interface-theme'),
|
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'toolbar__icon day',
|
iconCls: 'toolbar__icon day',
|
||||||
caption: this.textInterfaceTheme,
|
caption: this.textInterfaceTheme,
|
||||||
|
@ -153,7 +187,6 @@ define([
|
||||||
this.lockedControls.push(this.btnInterfaceTheme);
|
this.lockedControls.push(this.btnInterfaceTheme);
|
||||||
|
|
||||||
this.chStatusbar = new Common.UI.CheckBox({
|
this.chStatusbar = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-statusbar'),
|
|
||||||
labelText: this.textStatusBar,
|
labelText: this.textStatusBar,
|
||||||
value: !Common.localStorage.getBool("pe-hidden-status"),
|
value: !Common.localStorage.getBool("pe-hidden-status"),
|
||||||
lock: [_set.disableOnStart],
|
lock: [_set.disableOnStart],
|
||||||
|
@ -164,7 +197,6 @@ define([
|
||||||
this.lockedControls.push(this.chStatusbar);
|
this.lockedControls.push(this.chStatusbar);
|
||||||
|
|
||||||
this.chToolbar = new Common.UI.CheckBox({
|
this.chToolbar = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-toolbar'),
|
|
||||||
labelText: this.textAlwaysShowToolbar,
|
labelText: this.textAlwaysShowToolbar,
|
||||||
value: !options.compactToolbar,
|
value: !options.compactToolbar,
|
||||||
lock: [_set.disableOnStart],
|
lock: [_set.disableOnStart],
|
||||||
|
@ -175,7 +207,6 @@ define([
|
||||||
this.lockedControls.push(this.chToolbar);
|
this.lockedControls.push(this.chToolbar);
|
||||||
|
|
||||||
this.chRulers = new Common.UI.CheckBox({
|
this.chRulers = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-rulers'),
|
|
||||||
labelText: this.textRulers,
|
labelText: this.textRulers,
|
||||||
value: !Common.Utils.InternalSettings.get("pe-hidden-rulers"),
|
value: !Common.Utils.InternalSettings.get("pe-hidden-rulers"),
|
||||||
lock: [_set.disableOnStart],
|
lock: [_set.disableOnStart],
|
||||||
|
@ -186,7 +217,6 @@ define([
|
||||||
this.lockedControls.push(this.chRulers);
|
this.lockedControls.push(this.chRulers);
|
||||||
|
|
||||||
this.chNotes = new Common.UI.CheckBox({
|
this.chNotes = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-notes'),
|
|
||||||
labelText: this.textNotes,
|
labelText: this.textNotes,
|
||||||
value: !Common.localStorage.getBool('pe-hidden-notes', this.appConfig.customization && this.appConfig.customization.hideNotes===true),
|
value: !Common.localStorage.getBool('pe-hidden-notes', this.appConfig.customization && this.appConfig.customization.hideNotes===true),
|
||||||
lock: [_set.disableOnStart],
|
lock: [_set.disableOnStart],
|
||||||
|
@ -198,9 +228,27 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function (el) {
|
render: function (el) {
|
||||||
|
if ( el ) el.html( this.getPanel() );
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getPanel: function () {
|
||||||
|
this.$el = $(_.template(template)( {} ));
|
||||||
|
var $host = this.$el;
|
||||||
|
|
||||||
|
this.cmbZoom.render($host.find('#slot-field-zoom'));
|
||||||
|
$host.find('#slot-lbl-zoom').text(this.textZoom);
|
||||||
|
this.btnFitToSlide.render($host.find('#slot-btn-fts'));
|
||||||
|
this.btnFitToWidth.render($host.find('#slot-btn-ftw'));
|
||||||
|
this.btnInterfaceTheme.render($host.find('#slot-btn-interface-theme'));
|
||||||
|
this.chStatusbar.render($host.find('#slot-chk-statusbar'));
|
||||||
|
this.chToolbar.render($host.find('#slot-chk-toolbar'));
|
||||||
|
this.chRulers.render($host.find('#slot-chk-rulers'));
|
||||||
|
this.chNotes.render($host.find('#slot-chk-notes'));
|
||||||
|
return this.$el;
|
||||||
|
},
|
||||||
|
|
||||||
show: function () {
|
show: function () {
|
||||||
Common.UI.BaseView.prototype.show.call(this);
|
Common.UI.BaseView.prototype.show.call(this);
|
||||||
this.fireEvent('show', this);
|
this.fireEvent('show', this);
|
||||||
|
|
Loading…
Reference in a new issue