Commit 71390d54 authored by Julia Radzhabova's avatar Julia Radzhabova

[DE] Add pages count to document.

parent 10271fa7
...@@ -252,6 +252,7 @@ define([ ...@@ -252,6 +252,7 @@ define([
toolbar.mnuPageNumberPosPicker.on('item:click', _.bind(this.onInsertPageNumberClick, this)); toolbar.mnuPageNumberPosPicker.on('item:click', _.bind(this.onInsertPageNumberClick, this));
toolbar.btnEditHeader.menu.on('item:click', _.bind(this.onEditHeaderFooterClick, this)); toolbar.btnEditHeader.menu.on('item:click', _.bind(this.onEditHeaderFooterClick, this));
toolbar.mnuPageNumCurrentPos.on('click', _.bind(this.onPageNumCurrentPosClick, this)); toolbar.mnuPageNumCurrentPos.on('click', _.bind(this.onPageNumCurrentPosClick, this));
toolbar.mnuInsertPageCount.on('click', _.bind(this.onInsertPageCountClick, this));
toolbar.listStyles.on('click', _.bind(this.onListStyleSelect, this)); toolbar.listStyles.on('click', _.bind(this.onListStyleSelect, this));
toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this)); toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this));
toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this)); toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this));
...@@ -1699,6 +1700,14 @@ define([ ...@@ -1699,6 +1700,14 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Page Number'); Common.component.Analytics.trackEvent('ToolBar', 'Page Number');
}, },
onInsertPageCountClick: function(item, e) {
if (this.api)
this.api.asc_AddPageCount();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Pages Count');
},
onEditHeaderFooterClick: function(menu, item) { onEditHeaderFooterClick: function(menu, item) {
if (this.api) { if (this.api) {
if (item.value == 'header') if (item.value == 'header')
......
...@@ -555,7 +555,9 @@ define([ ...@@ -555,7 +555,9 @@ define([
}; };
this.mnuPageNumCurrentPos = clone(this.mnuPageNumberPosPicker); this.mnuPageNumCurrentPos = clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageNum = clone(this.mnuPageNumberPosPicker); this.mnuInsertPageNum = clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageCount = clone(this.mnuPageNumberPosPicker);
this.paragraphControls.push(this.mnuPageNumCurrentPos); this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.paragraphControls.push(this.mnuInsertPageCount);
this.toolbarControls.push(this.btnEditHeader); this.toolbarControls.push(this.btnEditHeader);
this.btnInsertShape = new Common.UI.Button({ this.btnInsertShape = new Common.UI.Button({
...@@ -1262,11 +1264,16 @@ define([ ...@@ -1262,11 +1264,16 @@ define([
}) })
] ]
}) })
}),
this.mnuInsertPageCount = new Common.UI.MenuItem({
caption: this.textInsertPageCount,
disabled: this.mnuInsertPageCount.isDisabled()
}) })
] ]
}) })
); );
this.paragraphControls.push(this.mnuPageNumCurrentPos); this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.paragraphControls.push(this.mnuInsertPageCount);
this.mnuZoomOut = new Common.UI.Button({ this.mnuZoomOut = new Common.UI.Button({
el : $('#id-menu-zoom-out'), el : $('#id-menu-zoom-out'),
...@@ -1900,7 +1907,8 @@ define([ ...@@ -1900,7 +1907,8 @@ define([
textRight: 'Right: ', textRight: 'Right: ',
textPageSizeCustom: 'Custom Page Size', textPageSizeCustom: 'Custom Page Size',
textPortrait: 'Portrait', textPortrait: 'Portrait',
textLandscape: 'Landscape' textLandscape: 'Landscape',
textInsertPageCount: 'Insert number of pages'
}, DE.Views.Toolbar || {})); }, DE.Views.Toolbar || {}));
}); });
...@@ -1443,6 +1443,7 @@ ...@@ -1443,6 +1443,7 @@
"DE.Views.Toolbar.textHideTitleBar": "Hide Title Bar", "DE.Views.Toolbar.textHideTitleBar": "Hide Title Bar",
"DE.Views.Toolbar.textInMargin": "In Margin", "DE.Views.Toolbar.textInMargin": "In Margin",
"DE.Views.Toolbar.textInsColumnBreak": "Insert Column Break", "DE.Views.Toolbar.textInsColumnBreak": "Insert Column Break",
"DE.Views.Toolbar.textInsertPageCount": "Insert number of pages",
"DE.Views.Toolbar.textInsertPageNumber": "Insert page number", "DE.Views.Toolbar.textInsertPageNumber": "Insert page number",
"DE.Views.Toolbar.textInsPageBreak": "Insert Page Break", "DE.Views.Toolbar.textInsPageBreak": "Insert Page Break",
"DE.Views.Toolbar.textInsSectionBreak": "Insert Section Break", "DE.Views.Toolbar.textInsSectionBreak": "Insert Section Break",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment