diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 2af3895bc..3ecce3439 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -148,9 +148,6 @@ reviewDisplay: 'original', // original for viewer, markup for editor trackChanges: undefined // true/false - open editor with track changes mode on/off, }, - font: { - size: 11px; - }, layout: { // hide elements, but don't disable feature toolbar: { file: { // menu file @@ -196,6 +193,10 @@ change: false/true // hide/show feature in de/pe/sse } / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter }, + font: { + name: "Arial", + size: "11px"; + }, chat: true, comments: true, zoom: 100, diff --git a/apps/common/main/lib/component/ComboBorderSize.js b/apps/common/main/lib/component/ComboBorderSize.js index d784d0f7a..6401e6867 100644 --- a/apps/common/main/lib/component/ComboBorderSize.js +++ b/apps/common/main/lib/component/ComboBorderSize.js @@ -102,12 +102,12 @@ define([ var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt), data = [ {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, - {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, + {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, //pxValue = 1.34px {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100}, - {displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120} + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, offsety: 100}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, offsety: 120} ]; if (options.allowNoBorders !== false) data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 }); @@ -209,8 +209,8 @@ define([ {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100}, - {displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120} + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, offsety: 100}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, offsety: 120} ]; if (options.allowNoBorders !== false) diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 8bb1399aa..e2413e9d8 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -1368,12 +1368,30 @@ define([ props = {minScrollbarLength : this.minScrollbarLength}; this.scrollAlwaysVisible && (props.alwaysVisibleY = this.scrollAlwaysVisible); - if (top + menuH > docH ) { - innerEl.css('max-height', (docH - top - paddings - margins) + 'px'); - this.scroller.update(props); - } else if ( top + menuH < docH && innerEl.height() < this.options.restoreHeight ) { - innerEl.css('max-height', (Math.min(docH - top - paddings - margins, this.options.restoreHeight)) + 'px'); - this.scroller.update(props); + var menuUp = false; + if (this.parentMenu.menuAlign) { + var m = this.parentMenu.menuAlign.match(/^([a-z]+)-([a-z]+)/); + menuUp = (m[1]==='bl' || m[1]==='br'); + } + if (menuUp) { + var bottom = top + menuH; + if (top<0) { + innerEl.css('max-height', (bottom - paddings - margins) + 'px'); + menuRoot.css('top', 0); + this.scroller.update(props); + } else if (top>0 && innerEl.height() < this.options.restoreHeight) { + innerEl.css('max-height', (Math.min(bottom - paddings - margins, this.options.restoreHeight)) + 'px'); + menuRoot.css('top', bottom - menuRoot.outerHeight()); + this.scroller.update(props); + } + } else { + if (top + menuH > docH ) { + innerEl.css('max-height', (docH - top - paddings - margins) + 'px'); + this.scroller.update(props); + } else if ( top + menuH < docH && innerEl.height() < this.options.restoreHeight ) { + innerEl.css('max-height', (Math.min(docH - top - paddings - margins, this.options.restoreHeight)) + 'px'); + this.scroller.update(props); + } } }, diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index c58a1b5f1..8b2c0e30d 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -145,7 +145,7 @@ define([ style : '', itemTemplate: null, items : [], - menuAlign : 'tl-bl', + menuAlign : 'tl-bl',//menu - parent menuAlignEl : null, offset : [0, 0], cyclic : true, diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 7b59950ed..0361f6c1d 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -399,7 +399,9 @@ define([ _btns = data.buttons, _flex = data.flex; var more_section = $active.find('.more-box'); - + if (more_section.length===0) { + me.setMoreButton($active.attr('data-tab'), $active); + } if ( !_rightedge ) { _rightedge = $active.get(0).getBoundingClientRect().right; } @@ -527,10 +529,30 @@ define([ this.$moreBar = btnsMore[tab].panel; }, + clearMoreButton: function(tab) { + var panel = this.$panels.filter('[data-tab=' + tab + ']'); + if ( panel.length ) { + var data = panel.data(); + data.buttons = data.flex = data.rightedge = undefined; + panel.find('.more-box').remove(); + } + if (btnsMore[tab]) { + var moreContainer = optsFold.$bar.find('.more-container[data-tab="' + tab + '"]'); + moreContainer.remove(); + btnsMore[tab].remove(); + delete btnsMore[tab]; + } + }, + resizeToolbar: function(reset) { var $active = this.$panels.filter('.active'), - more_section = $active.find('.more-box'), - more_section_width = parseInt(more_section.css('width')) || 0, + more_section = $active.find('.more-box'); + + if (more_section.length===0) { + this.setMoreButton($active.attr('data-tab'), $active); + } + + var more_section_width = parseInt(more_section.css('width')) || 0, box_controls_width = $active.parents('.box-controls').width(), _maxright = box_controls_width, _rightedge = $active.get(0).getBoundingClientRect().right, diff --git a/apps/common/main/lib/component/TableStyler.js b/apps/common/main/lib/component/TableStyler.js index 018873d69..b54139f7e 100644 --- a/apps/common/main/lib/component/TableStyler.js +++ b/apps/common/main/lib/component/TableStyler.js @@ -45,324 +45,202 @@ define([ 'common/main/lib/component/BaseView' ], function () { 'use strict'; + Common.UI.CellBorder = function (options){ + var me =this; - Common.UI.CellStyler = Common.UI.BaseView.extend({ - options : { - clickOffset : 10, - overwriteStyle : true, - maxBorderSize : 6, - halfBorderSize : false, - defaultBorderSize : 1, - defaultBorderColor : '#ccc' - }, + var virtualBorderSize, + virtualBorderColor, + borderSize, + borderColor, + borderAlfa; - template: _.template([ - '
', - ' |
', - ' |
', - ' | ', - ' |
', - '<% } %>', - ' |
', - ' | ', - ' |
', - ' |
', - ' |
+ + + | +
+ + | +
+ + | +
+ + + | +
+ + | +
+ + + + | +
', ' | |||||||||||||||||||||||||||
', ' | |||||||||||||||||||||||||||
',
+ '',
+ ' ',
+ ' | ',
+ '|||||||||||||||||||||||||||
', ' | ',
@@ -699,6 +761,17 @@ define([
})).on('click', _.bind(me.applySettings, me));
});
+ this.chQuickPrint = new Common.UI.CheckBox({
+ el: $markup.findById('#fms-chb-quick-print'),
+ labelText: '',
+ dataHint: '2',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.chQuickPrint.$el.parent().on('click', function (){
+ me.chQuickPrint.setValue(!me.chQuickPrint.isChecked());
+ });
+
this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply');
this.pnlTable = this.pnlSettings.find('table');
@@ -733,7 +806,7 @@ define([
updateScroller: function() {
if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
- var scrolled = this.$el.height()< this.pnlTable.parent().height() + 25 + this.pnlApply.height();
+ var scrolled = this.$el.height()< this.pnlTable.parent().height() + 25 + this.pnlApply.height() + this.$el.find('.header').outerHeight(true);
this.pnlApply.toggleClass('hidden', !scrolled);
this.trApply.toggleClass('hidden', scrolled);
this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
@@ -763,9 +836,9 @@ define([
$('tr.view-review', this.el)[mode.canViewReview ? 'show' : 'hide']();
$('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
-
/** coauthoring end **/
+ $('tr.quick-print', this.el)[mode.canQuickPrint ? 'show' : 'hide']();
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
@@ -836,6 +909,7 @@ define([
this.cmbMacros.setValue(item ? item.get('value') : 0);
this.chPaste.setValue(Common.Utils.InternalSettings.get("de-settings-paste-button"));
+ this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("de-settings-quick-print-button"));
var data = [];
for (var t in Common.UI.Themes.map()) {
@@ -905,6 +979,7 @@ define([
}
Common.localStorage.setItem("de-settings-paste-button", this.chPaste.isChecked() ? 1 : 0);
+ Common.localStorage.setBool("de-settings-quick-print-button", this.chQuickPrint.isChecked());
Common.localStorage.save();
@@ -1002,7 +1077,10 @@ define([
txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make',
strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE',
strIgnoreWordsWithNumbers: 'Ignore words with numbers',
- strShowOthersChanges: 'Show changes from other users'
+ strShowOthersChanges: 'Show changes from other users',
+ txtAdvancedSettings: 'Advanced Settings',
+ txtQuickPrint: 'Show the Quick Print button in the editor header',
+ txtQuickPrintTip: 'The document will be printed on the last selected or default printer'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
@@ -1010,7 +1088,8 @@ define([
menu: undefined,
template: _.template([
- ''
+ ' <%= scope.txtOpenRecent %> ',
+ ''
].join('')),
initialize: function(options) {
@@ -1021,7 +1100,7 @@ define([
},
render: function() {
- this.$el.html(this.template());
+ this.$el.html(this.template({scope: this}));
this.viewRecentPicker = new Common.UI.DataView({
el: $('#id-recent-view'),
@@ -1060,7 +1139,9 @@ define([
onRecentFileClick: function(view, itemview, record){
if ( this.menu )
this.menu.fireEvent('recent:open', [this.menu, record.get('url')]);
- }
+ },
+
+ txtOpenRecent: 'Open Recent'
});
DE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({
@@ -1075,7 +1156,7 @@ define([
},
template: _.template([
- '<%= scope.txtCreateNew %>', + '<%= scope.txtCreateNew %> ',
'',
'<% if (blank) { %> ',
' ',
@@ -1163,7 +1244,8 @@ define([
this.template = _.template([
' ',
- '
',
- '
',
+ ' ',
+ '<%= scope.txtProtectDocument %> ',
+ '',
+ '',
+ ' ',
'<%= scope.txtEncrypted %> ',
+ ' ',
+ '',
'',
- '',
+ ' '
].join('')),
@@ -2240,15 +2337,13 @@ define([
var me = this;
this.templateSignature = _.template([
- '',
+ ' ',
+ '<%= scope.txtAddSignature %> ',
+ '',
+ '',
+ ' ',
'',
'<%= scope.txtAddedSignature %> ',
+ '
" : "")+ tipText; this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested})); + + var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden'); + this.cntAddSignature.toggleClass('hidden', isAddedSignature); + this.cntAddedSignature.toggleClass('hidden', !isAddedSignature); }, updateEncrypt: function() { - this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); + var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden'); + this.cntEncryptBlock.toggleClass('hidden', isProtected); + this.cntEncryptedBlock.toggleClass('hidden', !isProtected); }, strProtect: 'Protect Document', @@ -2376,8 +2482,348 @@ define([ notcriticalErrorTitle: 'Warning', txtEditWarning: 'Editing will remove the signatures from the document. Are you sure you want to continue?', strEncrypt: 'With Password', - txtEncrypted: 'This document has been protected by password' + txtProtectDocument: 'Encrypt this document with a password', + txtEncrypted: 'A password is required to open this document', + txtAddSignature: 'Ensure the integrity of the document by adding an invisible digital signature', + txtAddedSignature: 'Valid signatures have been added to the document. The document is protected from editing.' }, DE.Views.FileMenuPanels.ProtectDoc || {})); + DE.Views.PrintWithPreview = Common.UI.BaseView.extend(_.extend({ + el: '#panel-print', + menu: undefined, + + template: _.template([ + ' ',
+ ' '
+ ].join('')),
+
+ initialize: function(options) {
+ Common.UI.BaseView.prototype.initialize.call(this,arguments);
+
+ this.menu = options.menu;
+
+ this._initSettings = true;
+ },
+
+ render: function(node) {
+ var me = this;
+
+ var $markup = $(this.template({scope: this}));
+
+ this.cmbRange = new Common.UI.ComboBox({
+ el: $markup.findById('#print-combo-range'),
+ menuStyle: 'min-width: 248px;max-height: 280px;',
+ editable: false,
+ takeFocusOnClose: true,
+ cls: 'input-group-nr',
+ data: [
+ { value: 'all', displayValue: this.txtAllPages },
+ { value: 'current', displayValue: this.txtCurrentPage },
+ { value: -1, displayValue: this.txtCustomPages }
+ ],
+ dataHint: '2',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'big'
+ });
+ this.cmbRange.setValue('all');
+
+ this.inputPages = new Common.UI.InputField({
+ el: $markup.findById('#print-txt-pages'),
+ allowBlank: true,
+ validateOnChange: true,
+ validateOnBlur: false,
+ maskExp: /[0-9,\-]/,
+ dataHint: '2',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+
+ this.cmbPaperSize = new Common.UI.ComboBox({
+ el: $markup.findById('#print-combo-pages'),
+ menuStyle: 'max-height: 280px; min-width: 248px;',
+ editable: false,
+ takeFocusOnClose: true,
+ cls: 'input-group-nr',
+ data: [
+ { value: 0, displayValue:'US Letter (21,59cm x 27,94cm)', caption: 'US Letter', size: [215.9, 279.4]},
+ { value: 1, displayValue:'US Legal (21,59cm x 35,56cm)', caption: 'US Legal', size: [215.9, 355.6]},
+ { value: 2, displayValue:'A4 (21cm x 29,7cm)', caption: 'A4', size: [210, 297]},
+ { value: 3, displayValue:'A5 (14,8cm x 21cm)', caption: 'A5', size: [148, 210]},
+ { value: 4, displayValue:'B5 (17,6cm x 25cm)', caption: 'B5', size: [176, 250]},
+ { value: 5, displayValue:'Envelope #10 (10,48cm x 24,13cm)', caption: 'Envelope #10', size: [104.8, 241.3]},
+ { value: 6, displayValue:'Envelope DL (11cm x 22cm)', caption: 'Envelope DL', size: [110, 220]},
+ { value: 7, displayValue:'Tabloid (27,94cm x 43,18cm)', caption: 'Tabloid', size: [279.4, 431.8]},
+ { value: 8, displayValue:'A3 (29,7cm x 42cm)', caption: 'A3', size: [297, 420]},
+ { value: 9, displayValue:'Tabloid Oversize (30,48cm x 45,71cm)', caption: 'Tabloid Oversize', size: [304.8, 457.1]},
+ { value: 10, displayValue:'ROC 16K (19,68cm x 27,3cm)', caption: 'ROC 16K', size: [196.8, 273]},
+ { value: 11, displayValue:'Envelope Choukei 3 (11,99cm x 23,49cm)', caption: 'Envelope Choukei 3', size: [119.9, 234.9]},
+ { value: 12, displayValue:'Super B/A3 (33,02cm x 48,25cm)', caption: 'Super B/A3', size: [330.2, 482.5]},
+ { value: 13, displayValue:'A4 (84,1cm x 118,9cm)', caption: 'A0', size: [841, 1189]},
+ { value: 14, displayValue:'A4 (59,4cm x 84,1cm)', caption: 'A1', size: [594, 841]},
+ { value: 16, displayValue:'A4 (42cm x 59,4cm)', caption: 'A2', size: [420, 594]},
+ { value: 17, displayValue:'A4 (10,5cm x 14,8cm)', caption: 'A6', size: [105, 148]},
+ { value: -1, displayValue: this.txtCustom, caption: this.txtCustom, size: []}
+ ],
+ dataHint: '2',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'big'
+ });
+
+ this.cmbPaperOrientation = new Common.UI.ComboBox({
+ el : $markup.findById('#print-combo-orient'),
+ menuStyle : 'min-width: 150px;',
+ editable : false,
+ takeFocusOnClose: true,
+ cls : 'input-group-nr',
+ data : [
+ { value: Asc.c_oAscPageOrientation.PagePortrait, displayValue: this.txtPortrait },
+ { value: Asc.c_oAscPageOrientation.PageLandscape, displayValue: this.txtLandscape }
+ ],
+ dataHint: '2',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'big'
+ });
+
+ this.cmbPaperMargins = new Common.UI.ComboBox({
+ el: $markup.findById('#print-combo-margins'),
+ menuStyle: 'max-height: 280px; min-width: 248px;',
+ editable: false,
+ takeFocusOnClose: true,
+ cls: 'input-group-nr',
+ data: [
+ { value: 0, displayValue: this.textMarginsNormal, size: [20, 30, 20, 15]},
+ { value: 1, displayValue: this.textMarginsUsNormal, size: [25.4, 25.4, 25.4, 25.4]},
+ { value: 2, displayValue: this.textMarginsNarrow, size: [12.7, 12.7, 12.7, 12.7]},
+ { value: 3, displayValue: this.textMarginsModerate, size: [25.4, 19.1, 25.4, 19.1]},
+ { value: 4, displayValue: this.textMarginsWide, size: [25.4, 50.8, 25.4, 50.8]},
+ { value: -1, displayValue: this.txtCustom, size: null}
+ ],
+ itemsTemplate: _.template([
+ '<% _.each(items, function(item) { %>',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '<%= scope.txtPrint %> ',
+ '
',
+ '',
+ ' ',
+ ' ',
+ '<%= scope.getDisplayValue(item) %> ',
+ '<% if (item.size !== null) { %>' +
+ '' +
+ ' ' +
+ '' +
+ ' ' +
+ '<% } %>',
+ '<% }); %>'
+ ].join('')),
+ dataHint: '2',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'big'
+ });
+
+ this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
+ this.pnlTable = $(this.pnlSettings.find('table')[0]);
+ this.trApply = $markup.find('.fms-btn-apply');
+
+ this.btnPrint = new Common.UI.Button({
+ el: $markup.findById('#print-btn-print')
+ });
+ this.btnPrintPdf = new Common.UI.Button({
+ el: $markup.findById('#print-btn-print-pdf')
+ });
+
+ this.btnPrevPage = new Common.UI.Button({
+ parentEl: $markup.findById('#print-prev-page'),
+ cls: 'btn-prev-page',
+ iconCls: 'arrow',
+ dataHint: '2',
+ dataHintDirection: 'top'
+ });
+
+ this.btnNextPage = new Common.UI.Button({
+ parentEl: $markup.findById('#print-next-page'),
+ cls: 'btn-next-page',
+ iconCls: 'arrow',
+ dataHint: '2',
+ dataHintDirection: 'top'
+ });
+
+ this.countOfPages = $markup.findById('#print-count-page');
+
+ this.txtNumberPage = new Common.UI.InputField({
+ el: $markup.findById('#print-number-page'),
+ allowBlank: true,
+ validateOnChange: true,
+ style: 'width: 50px;',
+ maskExp: /[0-9]/,
+ validation: function(value) {
+ if (/(^[0-9]+$)/.test(value)) {
+ value = parseInt(value);
+ if (undefined !== value && value > 0 && value <= me.pageCount)
+ return true;
+ }
+
+ return me.txtPageNumInvalid;
+ },
+ dataHint: '2',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+
+ this.$el = $(node).html($markup);
+ this.$previewBox = $('#print-preview-box');
+
+ if (_.isUndefined(this.scroller)) {
+ this.scroller = new Common.UI.Scroller({
+ el: this.pnlSettings,
+ suppressScrollX: true,
+ alwaysVisibleY: true
+ });
+ }
+
+ Common.NotificationCenter.on({
+ 'window:resize': function() {
+ me.isVisible() && me.updateScroller();
+ }
+ });
+
+ this.updateMetricUnit();
+
+ this.fireEvent('render:after', this);
+
+ return this;
+ },
+
+ show: function() {
+ Common.UI.BaseView.prototype.show.call(this,arguments);
+ if (this._initSettings) {
+ this.updateMetricUnit();
+ this._initSettings = false;
+ }
+ this.updateScroller();
+ this.fireEvent('show', this);
+ },
+
+ updateScroller: function() {
+ if (this.scroller) {
+ Common.UI.Menu.Manager.hideAll();
+ var scrolled = this.$el.height()< this.pnlTable.height() + 25 + this.$el.find('.main-header').outerHeight(true);
+ this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
+ this.scroller.update();
+ }
+ },
+
+ setMode: function(mode) {
+ this.mode = mode;
+ },
+
+ setApi: function(api) {
+
+ },
+
+ updateMetricUnit: function() {
+ if (!this.cmbPaperSize) return;
+ var store = this.cmbPaperSize.store;
+ for (var i=0; i',
- '',
+ ' ',
'',
' |