Merge branch release/v6.2.0 into master
|
@ -11,10 +11,11 @@
|
|||
# Full #
|
||||
|
||||
config = {
|
||||
type: 'desktop or mobile',
|
||||
type: 'desktop or mobile or embedded',
|
||||
width: '100% by default',
|
||||
height: '100% by default',
|
||||
documentType: 'word' | 'cell' | 'slide',// deprecate 'text' | 'spreadsheet' | 'presentation',
|
||||
token: <string> encrypted signature
|
||||
document: {
|
||||
title: 'document title',
|
||||
url: 'document url'
|
||||
|
@ -51,6 +52,12 @@
|
|||
}
|
||||
},
|
||||
editorConfig: {
|
||||
actionLink: { // open file and scroll to data, used with onMakeActionLink or the onRequestSendNotify event
|
||||
action: {
|
||||
type: "bookmark", // or type="comment"
|
||||
data: <bookmark name> // or comment id
|
||||
}
|
||||
},
|
||||
mode: 'view or edit',
|
||||
lang: <language code>,
|
||||
location: <location>,
|
||||
|
@ -141,7 +148,8 @@
|
|||
mentionShare : true // customize tooltip for mention,
|
||||
macros: true // can run macros in document
|
||||
plugins: true // can run plugins in document
|
||||
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn'
|
||||
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
|
||||
trackChanges: undefined // true/false - open editor with track changes mode on/off
|
||||
},
|
||||
plugins: {
|
||||
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
||||
|
@ -155,9 +163,30 @@
|
|||
},
|
||||
events: {
|
||||
'onAppReady': <application ready callback>,
|
||||
'onBack': <back to folder callback>,
|
||||
'onDocumentStateChange': <document state changed callback>
|
||||
'onDocumentReady': <document ready callback>
|
||||
'onRequestEditRights': <request rights for switching from view to edit>,
|
||||
'onRequestHistory': <request version history>,// must call refreshHistory method
|
||||
'onRequestHistoryData': <request version data>,// must call setHistoryData method
|
||||
'onRequestRestore': <try to restore selected version>,
|
||||
'onRequestHistoryClose': <request closing history>,
|
||||
'onError': <error callback>,
|
||||
'onWarning': <warning callback>,
|
||||
'onInfo': <document open callback>,// send view or edit mode
|
||||
'onOutdatedVersion': <outdated version callback>,// send when previous version is opened
|
||||
'onDownloadAs': <download as callback>,// send url of downloaded file as a response for downloadAs method
|
||||
'onRequestSaveAs': <try to save copy of the document>,
|
||||
'onCollaborativeChanges': <co-editing changes callback>,// send when other user co-edit document
|
||||
'onRequestRename': <try to rename document>,
|
||||
'onMetaChange': // send when meta information changed
|
||||
'onRequestClose': <request close editor>,
|
||||
'onMakeActionLink': <request link to document with bookmark, comment...>,// must call setActionLink method
|
||||
'onRequestUsers': <request users list for mentions>,// must call setUsers method
|
||||
'onRequestSendNotify': //send when user is mentioned in a comment,
|
||||
'onRequestInsertImage': <try to insert image>,// must call insertImage method
|
||||
'onRequestCompareFile': <request file to compare>,// must call setRevisedFile method
|
||||
'onRequestSharingSettings': <request sharing settings>,// must call setSharingSettings method
|
||||
'onRequestCreateNew': <try to create document>,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,7 +390,7 @@
|
|||
|
||||
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||
_config.document.fileType = _config.document.fileType.toLowerCase();
|
||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott))$/
|
||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2))$/
|
||||
.exec(_config.document.fileType);
|
||||
if (!type) {
|
||||
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||
|
@ -850,7 +879,7 @@
|
|||
iframe.allowFullscreen = true;
|
||||
iframe.setAttribute("allowfullscreen",""); // for IE11
|
||||
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
||||
iframe.setAttribute("allow", "autoplay");
|
||||
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture");
|
||||
|
||||
if (config.type == "mobile")
|
||||
{
|
||||
|
|
|
@ -237,7 +237,7 @@ define([
|
|||
me.yearPicker.store.reset(arrYears);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
me.monthPicker.focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
|
@ -312,7 +312,7 @@ define([
|
|||
me.monthsPicker.store.reset(arrMonths);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
me.monthPicker.focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
|
@ -435,7 +435,7 @@ define([
|
|||
me.monthPicker.store.reset(arrDays);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
me.monthPicker.focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ define([
|
|||
var me = this;
|
||||
options.menu = me.getMenu(options);
|
||||
me.on('render:after', function(btn) {
|
||||
me.getPicker(options.color);
|
||||
me.getPicker(options.color, options.colors);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -88,12 +88,13 @@ define([
|
|||
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
|
||||
},
|
||||
|
||||
getPicker: function(color) {
|
||||
getPicker: function(color, colors) {
|
||||
if (!this.colorPicker) {
|
||||
this.colorPicker = new Common.UI.ThemeColorPalette({
|
||||
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
|
||||
transparent: this.options.transparent,
|
||||
value: color
|
||||
value: color,
|
||||
colors: colors
|
||||
});
|
||||
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
|
||||
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
|
||||
|
@ -104,13 +105,14 @@ define([
|
|||
getMenu: function(options) {
|
||||
if (typeof this.menu !== 'object') {
|
||||
options = options || this.options;
|
||||
var height = options.paletteHeight || 216;
|
||||
var id = Common.UI.getId(),
|
||||
menu = new Common.UI.Menu({
|
||||
id: id,
|
||||
cls: 'shifted-left',
|
||||
additionalAlign: options.additionalAlign,
|
||||
items: (options.additionalItems ? options.additionalItems : []).concat([
|
||||
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
|
||||
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
|
||||
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
|
||||
])
|
||||
});
|
||||
|
@ -122,7 +124,7 @@ define([
|
|||
setMenu: function (m) {
|
||||
m = m || this.getMenu();
|
||||
Common.UI.Button.prototype.setMenu.call(this, m);
|
||||
this.getPicker(this.options.color);
|
||||
this.getPicker(this.options.color, this.options.colors);
|
||||
},
|
||||
|
||||
addNewColor: function() {
|
||||
|
|
|
@ -86,7 +86,8 @@ define([
|
|||
displayField: 'displayValue',
|
||||
valueField : 'value',
|
||||
search : false,
|
||||
scrollAlwaysVisible: false
|
||||
scrollAlwaysVisible: false,
|
||||
takeFocusOnClose: false
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
|
@ -323,6 +324,9 @@ define([
|
|||
$list.scrollTop(height);
|
||||
}
|
||||
setTimeout(function(){$selected.find('a').focus();}, 1);
|
||||
} else {
|
||||
var me = this;
|
||||
setTimeout(function(){me.cmpEl.find('ul li:first a').focus();}, 1);
|
||||
}
|
||||
|
||||
if (this.scroller)
|
||||
|
@ -343,10 +347,19 @@ define([
|
|||
this.cmpEl.find('.dropdown-toggle').blur();
|
||||
this.trigger('hide:after', this, e, isFromInputControl);
|
||||
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
|
||||
if (this.options.takeFocusOnClose) {
|
||||
var me = this;
|
||||
setTimeout(function(){me.focus();}, 1);
|
||||
}
|
||||
},
|
||||
|
||||
onAfterKeydownMenu: function(e) {
|
||||
if (e.keyCode == Common.UI.Keys.RETURN) {
|
||||
if (e.keyCode == Common.UI.Keys.DOWN && !this.editable && !this.isMenuOpen()) {
|
||||
this.openMenu();
|
||||
this.onAfterShowMenu();
|
||||
return false;
|
||||
}
|
||||
else if (e.keyCode == Common.UI.Keys.RETURN && (this.editable || this.isMenuOpen())) {
|
||||
$(e.target).click();
|
||||
var me = this;
|
||||
if (this.rendered) {
|
||||
|
@ -666,6 +679,10 @@ define([
|
|||
wheelSpeed: 10,
|
||||
alwaysVisibleY: this.scrollAlwaysVisible
|
||||
}, this.options.scroller));
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this._input && this._input.focus();
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
@ -687,6 +704,10 @@ define([
|
|||
Common.UI.ComboBox.prototype.selectRecord.call(this, record);
|
||||
if (this.options.updateFormControl)
|
||||
this.options.updateFormControl.call(this, this._selectedItem);
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this.cmpEl && this.cmpEl.find('.form-control').focus();
|
||||
}
|
||||
}, Common.UI.ComboBoxCustom || {}));
|
||||
});
|
|
@ -105,14 +105,17 @@ define([
|
|||
|
||||
render : function(parentEl) {
|
||||
var oldRawValue = null;
|
||||
var oldTabindex = '';
|
||||
|
||||
if (!_.isUndefined(this._input)) {
|
||||
oldRawValue = this._input.val();
|
||||
oldTabindex = this._input.attr('tabindex');
|
||||
}
|
||||
|
||||
Common.UI.ComboBox.prototype.render.call(this, parentEl);
|
||||
|
||||
this.setRawValue(oldRawValue);
|
||||
this._input.attr('tabindex', oldTabindex);
|
||||
|
||||
this._input.on('keyup', _.bind(this.onInputKeyUp, this));
|
||||
this._input.on('keydown', _.bind(this.onInputKeyDown, this));
|
||||
|
@ -128,6 +131,8 @@ define([
|
|||
if ($(e.target).closest('input').length) { // enter in input field
|
||||
if (this.lastValue !== this._input.val())
|
||||
this._input.trigger('change');
|
||||
else
|
||||
return true;
|
||||
} else { // enter in dropdown list
|
||||
$(e.target).click();
|
||||
if (this.rendered) {
|
||||
|
@ -136,7 +141,7 @@ define([
|
|||
else
|
||||
this._input.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else if (e.keyCode == Common.UI.Keys.ESC && this.isMenuOpen()) {
|
||||
this._input.val(this.lastValue);
|
||||
|
@ -199,7 +204,7 @@ define([
|
|||
me.closeMenu();
|
||||
me.onAfterHideMenu(e);
|
||||
}, 10);
|
||||
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT){
|
||||
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT && e.keyCode != Common.UI.Keys.TAB){
|
||||
if (!this.isMenuOpen() && !e.ctrlKey)
|
||||
this.openMenu();
|
||||
|
||||
|
@ -301,7 +306,7 @@ define([
|
|||
if (callback) {
|
||||
this.spriteThumbs = new Image();
|
||||
this.spriteThumbs.onload = callback;
|
||||
this.spriteThumbs.src = (window.devicePixelRatio > 1) ? thumbPath2x : thumbPath;
|
||||
this.spriteThumbs.src = isRetina ? thumbPath2x : thumbPath;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -338,16 +343,21 @@ define([
|
|||
|
||||
onApiChangeFont: function(font) {
|
||||
var me = this;
|
||||
setTimeout(function () {
|
||||
me.onApiChangeFontInternal(font);
|
||||
}, 100);
|
||||
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
|
||||
if (this.__name !== name) {
|
||||
if (!this.__nameId) {
|
||||
this.__nameId = setTimeout(function () {
|
||||
me.onApiChangeFontInternal(name);
|
||||
me.__nameId = null;
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onApiChangeFontInternal: function(font) {
|
||||
onApiChangeFontInternal: function(name) {
|
||||
if (this.inFormControl) return;
|
||||
|
||||
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
|
||||
|
||||
this.__name = name;
|
||||
if (this.getRawValue() !== name) {
|
||||
var record = this.store.findWhere({
|
||||
name: name
|
||||
|
|
|
@ -242,6 +242,7 @@ define([
|
|||
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
|
||||
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
|
||||
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
|
||||
me.tabindex = me.options.tabindex || 0;
|
||||
if (me.parentMenu)
|
||||
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
|
||||
me.rendered = false;
|
||||
|
@ -678,7 +679,7 @@ define([
|
|||
if (this.enableKeyEvents && this.handleSelect) {
|
||||
var el = $(this.el).find('.inner').addBack().filter('.inner');
|
||||
el.addClass('canfocused');
|
||||
el.attr('tabindex', '0');
|
||||
el.attr('tabindex', this.tabindex.toString());
|
||||
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
|
||||
}
|
||||
},
|
||||
|
@ -763,6 +764,10 @@ define([
|
|||
|
||||
onResize: function() {
|
||||
this._layoutParams = undefined;
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this.cmpEl && this.cmpEl.find('.dataview').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -798,6 +803,8 @@ define([
|
|||
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
|
||||
me.style = me.options.style || '';
|
||||
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
|
||||
me.tabindex = me.options.tabindex || 0;
|
||||
|
||||
if (me.parentMenu)
|
||||
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
|
||||
me.rendered = false;
|
||||
|
@ -1120,7 +1127,7 @@ define([
|
|||
if (this.enableKeyEvents && this.handleSelect) {
|
||||
var el = $(this.el).find('.inner').addBack().filter('.inner');
|
||||
el.addClass('canfocused');
|
||||
el.attr('tabindex', '0');
|
||||
el.attr('tabindex', this.tabindex.toString());
|
||||
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
|
||||
}
|
||||
},
|
||||
|
@ -1192,6 +1199,10 @@ define([
|
|||
|
||||
onResize: function() {
|
||||
this._layoutParams = undefined;
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this.cmpEl && this.cmpEl.find('.dataview').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
176
apps/common/main/lib/component/FocusManager.js
Normal file
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2020
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* FocusManager.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 24.09.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
if (Common.UI === undefined) {
|
||||
Common.UI = {};
|
||||
}
|
||||
|
||||
Common.UI.FocusManager = new(function() {
|
||||
var _tabindex = 1,
|
||||
_windows = [],
|
||||
_count = 0;
|
||||
|
||||
var register = function(fields) {
|
||||
var arr = [];
|
||||
if (!fields.forEach) {
|
||||
fields = [fields];
|
||||
}
|
||||
fields.forEach(function(field) {
|
||||
if (field) {
|
||||
var item = (field.cmp && typeof field.selector == 'string') ? field : {cmp: field, selector: '.form-control'};
|
||||
item.el = (item.cmp.$el || $(item.cmp.el || item.cmp)).find(item.selector).addBack().filter(item.selector);
|
||||
item.el && item.el.attr && item.el.attr('tabindex', _tabindex.toString());
|
||||
arr.push(item);
|
||||
}
|
||||
});
|
||||
return arr;
|
||||
};
|
||||
|
||||
var addTraps = function(current) {
|
||||
if (!current || current.traps || !current.fields || current.fields.length<1) return;
|
||||
|
||||
var trapFirst = $('<span aria-hidden="true" tabindex="' + _tabindex + '"></span>');
|
||||
trapFirst.on('focus', function() {
|
||||
if (current.hidden) return;
|
||||
var fields = current.fields;
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
var field = fields[i];
|
||||
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
|
||||
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
|
||||
el && setTimeout(function(){ el.focus(); }, 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
current.parent.$window.prepend(trapFirst);
|
||||
|
||||
var trapLast = $('<span aria-hidden="true" tabindex="' + (_tabindex+1) + '"></span>');
|
||||
trapLast.on('focus', function() {
|
||||
if (current.hidden) return;
|
||||
var fields = current.fields;
|
||||
for (var i=fields.length-1; i>=0; i--) {
|
||||
var field = fields[i];
|
||||
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
|
||||
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
|
||||
el && setTimeout(function(){ el.focus(); }, 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
current.parent.$window.append(trapLast);
|
||||
current.traps = [trapFirst, trapLast];
|
||||
};
|
||||
|
||||
var updateTabIndexes = function(increment) {
|
||||
var step = increment ? 1 : -1;
|
||||
for (var cid in _windows) {
|
||||
if (_windows.hasOwnProperty(cid)) {
|
||||
var item = _windows[cid];
|
||||
if (item && item.index < _count-1 && item.traps)
|
||||
item.traps[1].attr('tabindex', (parseInt(item.traps[1].attr('tabindex')) + step).toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _add = function(e, fields) {
|
||||
if (e && e.cid) {
|
||||
if (_windows[e.cid]) {
|
||||
_windows[e.cid].fields = (_windows[e.cid].fields || []).concat(register(fields));
|
||||
} else {
|
||||
_windows[e.cid] = {
|
||||
parent: e,
|
||||
fields: register(fields),
|
||||
hidden: false,
|
||||
index: _count++
|
||||
};
|
||||
}
|
||||
addTraps(_windows[e.cid]);
|
||||
}
|
||||
};
|
||||
|
||||
var _init = function() {
|
||||
Common.NotificationCenter.on({
|
||||
'modal:show': function(e){
|
||||
if (e && e.cid) {
|
||||
if (_windows[e.cid]) {
|
||||
_windows[e.cid].hidden = false;
|
||||
} else {
|
||||
_windows[e.cid] = {
|
||||
parent: e,
|
||||
hidden: false,
|
||||
index: _count++
|
||||
};
|
||||
updateTabIndexes(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
'window:show': function(e){
|
||||
if (e && e.cid && _windows[e.cid] && !_windows[e.cid].fields) {
|
||||
_windows[e.cid].fields = register(e.getFocusedComponents());
|
||||
addTraps(_windows[e.cid]);
|
||||
}
|
||||
|
||||
var el = e ? e.getDefaultFocusableComponent() : null;
|
||||
el && setTimeout(function(){ el.focus(); }, 100);
|
||||
},
|
||||
'modal:close': function(e, last) {
|
||||
if (e && e.cid && _windows[e.cid]) {
|
||||
updateTabIndexes(false);
|
||||
delete _windows[e.cid];
|
||||
_count--;
|
||||
}
|
||||
},
|
||||
'modal:hide': function(e, last) {
|
||||
if (e && e.cid && _windows[e.cid]) {
|
||||
_windows[e.cid].hidden = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
init: _init,
|
||||
add: _add
|
||||
}
|
||||
})();
|
|
@ -246,6 +246,10 @@ define([
|
|||
|
||||
if (e.keyCode === Common.UI.Keys.RETURN)
|
||||
this._doChange(e);
|
||||
if (e.keyCode == Common.UI.Keys.ESC)
|
||||
this.setValue(this.value);
|
||||
if (e.keyCode==Common.UI.Keys.RETURN || e.keyCode==Common.UI.Keys.ESC)
|
||||
this.trigger('inputleave', this);
|
||||
},
|
||||
|
||||
onKeyUp: function(e) {
|
||||
|
@ -300,7 +304,7 @@ define([
|
|||
},
|
||||
|
||||
focus: function() {
|
||||
this._input.focus();
|
||||
this._input && this._input.focus();
|
||||
},
|
||||
|
||||
checkValidate: function() {
|
||||
|
@ -354,10 +358,10 @@ define([
|
|||
return true;
|
||||
},
|
||||
|
||||
showError: function(errors) {
|
||||
showError: function(errors, isWarning) {
|
||||
var me = this;
|
||||
if (!_.isEmpty(errors)) {
|
||||
me.cmpEl.addClass('error');
|
||||
me.cmpEl.addClass(isWarning ? 'warning' : 'error');
|
||||
|
||||
var errorBadge = me.cmpEl.find('.input-error'),
|
||||
modalParents = errorBadge.closest('.asc-window'),
|
||||
|
@ -376,7 +380,12 @@ define([
|
|||
}
|
||||
} else {
|
||||
me.cmpEl.removeClass('error');
|
||||
me.cmpEl.removeClass('warning');
|
||||
}
|
||||
},
|
||||
|
||||
showWarning: function(errors) {
|
||||
this.showError(errors, true);
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
|
|
@ -115,6 +115,10 @@ define([
|
|||
if (!this.isSuspendEvents)
|
||||
this.trigger('item:add', this, view, record);
|
||||
}
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this.cmpEl && this.cmpEl.find('.listview').focus();
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
|
|
@ -78,8 +78,8 @@ define([
|
|||
|
||||
template: _.template([
|
||||
'<div id="<%= id %>" class="asc-loadmask-body <%= cls %>" role="presentation" tabindex="-1">',
|
||||
'<div class="asc-loadmask-image"></div>',
|
||||
'<div class="asc-loadmask-title"><%= title %></div>',
|
||||
'<i id="loadmask-spinner" class="asc-loadmask-image"></i>',
|
||||
'<div class="asc-loadmask-title"><%= title %></div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
|
@ -128,10 +128,6 @@ define([
|
|||
ownerEl.append(maskeEl);
|
||||
ownerEl.append(loaderEl);
|
||||
|
||||
loaderEl.css({
|
||||
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
|
||||
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'
|
||||
});
|
||||
// if (ownerEl.height()<1 || ownerEl.width()<1)
|
||||
// loaderEl.css({visibility: 'hidden'});
|
||||
|
||||
|
|
|
@ -234,10 +234,7 @@ define([
|
|||
},
|
||||
|
||||
getNumberValue: function(){
|
||||
if (this.options.allowAuto && this.value==this.options.autoText)
|
||||
return -1;
|
||||
else
|
||||
return parseFloat(this.value);
|
||||
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
|
||||
},
|
||||
|
||||
getUnitValue: function(){
|
||||
|
@ -262,7 +259,7 @@ define([
|
|||
this.lastValue = this.value;
|
||||
if ( typeof value === 'undefined' || value === ''){
|
||||
this.value = '';
|
||||
} else if (this.options.allowAuto && (Math.abs(Common.Utils.String.parseFloat(value)+1.)<0.0001 || value==this.options.autoText)) {
|
||||
} else if (this.options.allowAuto && (Math.abs(Common.Utils.String.parseFloat(value)+1.)<0.0001 || this.checkAutoText(value))) {
|
||||
this.value = this.options.autoText;
|
||||
} else {
|
||||
var number = this._add(Common.Utils.String.parseFloat(value), 0, (this.options.allowDecimal) ? 3 : 0);
|
||||
|
@ -450,8 +447,8 @@ define([
|
|||
val = this.getRawValue();
|
||||
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
|
||||
} else if(me.getValue() !== '') {
|
||||
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
|
||||
val = me.options.minValue-me.options.step;
|
||||
if (me.checkAutoText(me.getValue())) {
|
||||
val = me.options.defaultValue-me.options.step;
|
||||
} else
|
||||
val = Common.Utils.String.parseFloat(me.getValue());
|
||||
if (isNaN(val))
|
||||
|
@ -471,7 +468,7 @@ define([
|
|||
val = this.getRawValue();
|
||||
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
|
||||
} else if(me.getValue() !== '') {
|
||||
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
|
||||
if (me.checkAutoText(me.getValue())) {
|
||||
val = me.options.minValue;
|
||||
} else
|
||||
val = Common.Utils.String.parseFloat(me.getValue());
|
||||
|
@ -537,6 +534,22 @@ define([
|
|||
v_out = parseFloat((v_out * 6.0 / 25.4).toFixed(6));
|
||||
|
||||
return v_out;
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
if (this.$input) this.$input.focus();
|
||||
},
|
||||
|
||||
setDefaultValue: function(value) {
|
||||
this.options.defaultValue = value;
|
||||
},
|
||||
|
||||
checkAutoText: function(value) {
|
||||
if (this.options.allowAuto && typeof value == 'string') {
|
||||
var val = value.toLowerCase();
|
||||
return (val==this.options.autoText.toLowerCase() || val=='auto');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -267,7 +267,8 @@ define([
|
|||
me.dblclick_el = tab;
|
||||
delete me.dblclick_timer;
|
||||
},500);
|
||||
}
|
||||
} else
|
||||
me.dblclick_el = tab;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
202
apps/common/main/lib/component/TextareaField.js
Normal file
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2020
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* TextareaField.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 29/09/20
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/component/Tooltip'
|
||||
], function () { 'use strict';
|
||||
|
||||
Common.UI.TextareaField = Common.UI.BaseView.extend((function() {
|
||||
return {
|
||||
options : {
|
||||
id : null,
|
||||
cls : '',
|
||||
style : '',
|
||||
value : '',
|
||||
maxlength : undefined,
|
||||
placeHolder : '',
|
||||
spellcheck : false,
|
||||
disabled: false
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
'<div class="textarea-field" style="<%= style %>">',
|
||||
'<textarea ',
|
||||
'spellcheck="<%= spellcheck %>" ',
|
||||
'class="form-control <%= cls %>" ',
|
||||
'placeholder="<%= placeHolder %>" ',
|
||||
'></textarea>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
||||
var me = this;
|
||||
|
||||
this.id = me.options.id || Common.UI.getId();
|
||||
this.cls = me.options.cls;
|
||||
this.style = me.options.style;
|
||||
this.value = me.options.value;
|
||||
this.placeHolder = me.options.placeHolder;
|
||||
this.template = me.options.template || me.template;
|
||||
this.disabled = me.options.disabled;
|
||||
this.spellcheck = me.options.spellcheck;
|
||||
this.maxLength = me.options.maxLength;
|
||||
|
||||
me.rendered = me.options.rendered || false;
|
||||
|
||||
if (me.options.el) {
|
||||
me.render();
|
||||
}
|
||||
},
|
||||
|
||||
render : function(parentEl) {
|
||||
var me = this;
|
||||
|
||||
if (!me.rendered) {
|
||||
this.cmpEl = $(this.template({
|
||||
id : this.id,
|
||||
cls : this.cls,
|
||||
style : this.style,
|
||||
placeHolder : this.placeHolder,
|
||||
spellcheck : this.spellcheck,
|
||||
scope : me
|
||||
}));
|
||||
|
||||
if (parentEl) {
|
||||
this.setElement(parentEl, false);
|
||||
parentEl.html(this.cmpEl);
|
||||
} else {
|
||||
this.$el.html(this.cmpEl);
|
||||
}
|
||||
} else {
|
||||
this.cmpEl = this.$el;
|
||||
}
|
||||
|
||||
if (!me.rendered) {
|
||||
var el = this.cmpEl;
|
||||
|
||||
this._input = this.cmpEl.find('textarea').addBack().filter('textarea');
|
||||
this._input.on('blur', _.bind(this.onInputChanged, this));
|
||||
this._input.on('keydown', _.bind(this.onKeyDown, this));
|
||||
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
|
||||
|
||||
if (this.disabled)
|
||||
this.setDisabled(this.disabled);
|
||||
}
|
||||
|
||||
me.rendered = true;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_doChange: function(e, extra) {
|
||||
// skip processing for internally-generated synthetic event
|
||||
// to avoid double processing
|
||||
if (extra && extra.synthetic)
|
||||
return;
|
||||
|
||||
var newValue = $(e.target).val(),
|
||||
oldValue = this.value;
|
||||
|
||||
this.trigger('changed:before', this, newValue, oldValue, e);
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return;
|
||||
|
||||
this.value = newValue;
|
||||
|
||||
// trigger changed event
|
||||
this.trigger('changed:after', this, newValue, oldValue, e);
|
||||
},
|
||||
|
||||
onInputChanged: function(e, extra) {
|
||||
this._doChange(e, extra);
|
||||
},
|
||||
|
||||
onKeyDown: function(e) {
|
||||
this.trigger('keydown:before', this, e);
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return;
|
||||
|
||||
if (e.keyCode === Common.UI.Keys.RETURN) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
if (e.keyCode == Common.UI.Keys.ESC)
|
||||
this.setValue(this.value);
|
||||
if (e.keyCode==Common.UI.Keys.ESC)
|
||||
this.trigger('inputleave', this);
|
||||
},
|
||||
|
||||
setDisabled: function(disabled) {
|
||||
this.disabled = disabled;
|
||||
$(this.el).toggleClass('disabled', disabled);
|
||||
disabled
|
||||
? this._input.attr('disabled', true)
|
||||
: this._input.removeAttr('disabled');
|
||||
},
|
||||
|
||||
isDisabled: function() {
|
||||
return this.disabled;
|
||||
},
|
||||
|
||||
setValue: function(value) {
|
||||
this.value = value;
|
||||
|
||||
if (this.rendered){
|
||||
this._input.val(value);
|
||||
}
|
||||
},
|
||||
|
||||
getValue: function() {
|
||||
return this.value;
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this._input.focus();
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
|
@ -60,7 +60,7 @@ define([
|
|||
|
||||
template :
|
||||
_.template(
|
||||
'<div style="padding: 12px;">' +
|
||||
'<div style="padding: 8px 12px 12px;">' +
|
||||
'<% var me = this; %>' +
|
||||
'<% $(colors).each(function(num, item) { %>' +
|
||||
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +
|
||||
|
|
|
@ -159,11 +159,12 @@ define([
|
|||
showLast: true,
|
||||
allowScrollbar: true,
|
||||
scrollAlwaysVisible: true,
|
||||
emptyItemText: ''
|
||||
emptyItemText: '',
|
||||
keyMoveDirection: 'both'
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
'<div class="treeview inner"></div>'
|
||||
'<div class="treeview inner" style="<%= style %>"></div>'
|
||||
].join('')),
|
||||
|
||||
initialize : function(options) {
|
||||
|
@ -280,6 +281,86 @@ define([
|
|||
this.store.collapseSubItems(record);
|
||||
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
}
|
||||
},
|
||||
|
||||
onKeyDown: function (e, data) {
|
||||
if ( this.disabled ) return;
|
||||
if (data===undefined) data = e;
|
||||
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
|
||||
data.preventDefault();
|
||||
data.stopPropagation();
|
||||
var rec = this.getSelectedRec();
|
||||
if (this.lastSelectedRec===null)
|
||||
this.lastSelectedRec = rec;
|
||||
if (data.keyCode==Common.UI.Keys.RETURN) {
|
||||
this.lastSelectedRec = null;
|
||||
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
|
||||
rec = this.selectedBeforeHideRec;
|
||||
this.trigger('item:click', this, this, rec, e);
|
||||
this.trigger('item:select', this, this, rec, e);
|
||||
this.trigger('entervalue', this, rec, e);
|
||||
if (this.parentMenu)
|
||||
this.parentMenu.hide();
|
||||
} else {
|
||||
var idx = _.indexOf(this.store.models, rec);
|
||||
if (idx<0) {
|
||||
if (data.keyCode==Common.UI.Keys.LEFT) {
|
||||
var target = $(e.target).closest('.dropdown-submenu.over');
|
||||
if (target.length>0) {
|
||||
target.removeClass('over');
|
||||
target.find('> a').focus();
|
||||
} else
|
||||
idx = 0;
|
||||
} else
|
||||
idx = 0;
|
||||
} else if (this.options.keyMoveDirection == 'both') {
|
||||
var hasSubItems = rec.get('hasSubItems');
|
||||
var hasParent = rec.get('hasParent');
|
||||
var isExpanded = rec.get('isExpanded');
|
||||
if (data.keyCode==Common.UI.Keys.LEFT) {
|
||||
if (hasSubItems && isExpanded)
|
||||
this.collapseRecord(rec);
|
||||
} else if (data.keyCode==Common.UI.Keys.RIGHT) {
|
||||
if (hasSubItems && !isExpanded)
|
||||
this.expandRecord(rec);
|
||||
} else {
|
||||
if (data.keyCode==Common.UI.Keys.DOWN) {
|
||||
for (var i=idx+1; i<this.store.length; i++) {
|
||||
if (this.store.at(i).get('isVisible')) {
|
||||
idx=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
||||
for (var i=idx-1; i>=0; i--) {
|
||||
if (this.store.at(i).get('isVisible')) {
|
||||
idx=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
||||
? Math.max(0, idx-1)
|
||||
: Math.min(this.store.length - 1, idx + 1) ;
|
||||
}
|
||||
|
||||
if (idx !== undefined && idx>=0) rec = this.store.at(idx);
|
||||
if (rec) {
|
||||
this._fromKeyDown = true;
|
||||
this.selectRecord(rec);
|
||||
this._fromKeyDown = false;
|
||||
this.scrollToRecord(rec);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.trigger('item:keydown', this, rec, e);
|
||||
}
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this.cmpEl && this.cmpEl.find('.treeview').focus();
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
|
|
@ -137,7 +137,8 @@
|
|||
|
||||
define([
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/component/CheckBox'
|
||||
'common/main/lib/component/CheckBox',
|
||||
'common/main/lib/component/FocusManager'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
|
@ -238,6 +239,14 @@ define([
|
|||
return {width: width, height: height, top: Common.Utils.InternalSettings.get('window-inactive-area-top')};
|
||||
}
|
||||
|
||||
function _autoSize() {
|
||||
if (this.initConfig.height == 'auto') {
|
||||
var height = parseInt(this.$window.find('> .body').css('height'));
|
||||
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
|
||||
this.$window.height(height);
|
||||
}
|
||||
}
|
||||
|
||||
function _centre() {
|
||||
var main_geometry = _readDocumetGeometry(),
|
||||
main_width = main_geometry.width,
|
||||
|
@ -597,7 +606,7 @@ define([
|
|||
if (b.value !== undefined)
|
||||
newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')};
|
||||
} else {
|
||||
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
|
||||
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''};
|
||||
if (b=='custom')
|
||||
newBtns[b].cls += ' custom';
|
||||
}
|
||||
|
@ -658,11 +667,7 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
if (this.initConfig.height == 'auto') {
|
||||
var height = parseInt(this.$window.find('> .body').css('height'));
|
||||
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
|
||||
this.$window.height(height);
|
||||
} else {
|
||||
if (this.initConfig.height !== 'auto') {
|
||||
this.$window.css('height',this.initConfig.height);
|
||||
}
|
||||
|
||||
|
@ -719,6 +724,7 @@ define([
|
|||
|
||||
if (!this.$window) {
|
||||
this.render();
|
||||
_autoSize.call(this);
|
||||
|
||||
if (_.isNumber(x) && _.isNumber(y)) {
|
||||
this.$window.css('left',Math.floor(x));
|
||||
|
@ -773,7 +779,7 @@ define([
|
|||
this.fireEvent('show', this);
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('window:show');
|
||||
Common.NotificationCenter.trigger('window:show', this);
|
||||
},
|
||||
|
||||
close: function(suppressevent) {
|
||||
|
@ -979,6 +985,13 @@ define([
|
|||
|
||||
onPrimary: function() {},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function() {
|
||||
},
|
||||
|
||||
cancelButtonText: 'Cancel',
|
||||
okButtonText: 'OK',
|
||||
yesButtonText: 'Yes',
|
||||
|
|
|
@ -111,7 +111,7 @@ define([
|
|||
} else
|
||||
if (/button:click/.test(cmd)) {
|
||||
var obj = JSON.parse(param);
|
||||
if ( !!obj.action ) {
|
||||
if ( !!obj.action && !!titlebuttons[obj.action] ) {
|
||||
titlebuttons[obj.action].btn.click();
|
||||
}
|
||||
} else
|
||||
|
|
|
@ -139,6 +139,12 @@ define([
|
|||
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
|
||||
}, 10);
|
||||
} else {
|
||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||
if (commentsController) {
|
||||
commentsController.onApiHideComment();
|
||||
commentsController.clearCollections();
|
||||
}
|
||||
|
||||
var urlDiff = record.get('urlDiff'),
|
||||
token = record.get('token'),
|
||||
hist = new Asc.asc_CVersionHistory();
|
||||
|
@ -152,11 +158,6 @@ define([
|
|||
hist.asc_setServerVersion(this.currentServerVersion);
|
||||
this.api.asc_showRevision(hist);
|
||||
|
||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||
if (commentsController) {
|
||||
commentsController.onApiHideComment();
|
||||
commentsController.clearCollections();
|
||||
}
|
||||
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
|
||||
if (reviewController)
|
||||
reviewController.onApiShowChange();
|
||||
|
@ -175,6 +176,12 @@ define([
|
|||
};
|
||||
Common.UI.alert(config);
|
||||
} else {
|
||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||
if (commentsController) {
|
||||
commentsController.onApiHideComment();
|
||||
commentsController.clearCollections();
|
||||
}
|
||||
|
||||
var data = opts.data;
|
||||
var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions');
|
||||
if (historyStore && data!==null) {
|
||||
|
@ -210,11 +217,6 @@ define([
|
|||
hist.asc_setServerVersion(this.currentServerVersion);
|
||||
this.api.asc_showRevision(hist);
|
||||
|
||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||
if (commentsController) {
|
||||
commentsController.onApiHideComment();
|
||||
commentsController.clearCollections();
|
||||
}
|
||||
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
|
||||
if (reviewController)
|
||||
reviewController.onApiShowChange();
|
||||
|
|
|
@ -644,23 +644,23 @@ define([
|
|||
arr = [],
|
||||
plugins = this.configPlugins,
|
||||
warn = false;
|
||||
if (plugins.plugins && plugins.plugins.length>0) {
|
||||
if (plugins.plugins && plugins.plugins.length>0)
|
||||
arr = plugins.plugins;
|
||||
var val = plugins.config.autostart || plugins.config.autoStartGuid;
|
||||
if (typeof (val) == 'string')
|
||||
val = [val];
|
||||
warn = !!plugins.config.autoStartGuid;
|
||||
autostart = val || [];
|
||||
}
|
||||
var val = plugins.config.autostart || plugins.config.autoStartGuid;
|
||||
if (typeof (val) == 'string')
|
||||
val = [val];
|
||||
warn = !!plugins.config.autoStartGuid;
|
||||
autostart = val || [];
|
||||
|
||||
plugins = this.serverPlugins;
|
||||
if (plugins.plugins && plugins.plugins.length>0) {
|
||||
if (plugins.plugins && plugins.plugins.length>0)
|
||||
arr = arr.concat(plugins.plugins);
|
||||
var val = plugins.config.autostart || plugins.config.autoStartGuid;
|
||||
if (typeof (val) == 'string')
|
||||
val = [val];
|
||||
(warn || plugins.config.autoStartGuid) && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration.");
|
||||
autostart = autostart.concat(val || []);
|
||||
}
|
||||
val = plugins.config.autostart || plugins.config.autoStartGuid;
|
||||
if (typeof (val) == 'string')
|
||||
val = [val];
|
||||
(warn || plugins.config.autoStartGuid) && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration.");
|
||||
autostart = autostart.concat(val || []);
|
||||
|
||||
this.autostart = autostart;
|
||||
this.parsePlugins(arr, false);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ define([
|
|||
'common/main/lib/collection/ReviewChanges',
|
||||
'common/main/lib/view/ReviewChanges',
|
||||
'common/main/lib/view/ReviewPopover',
|
||||
'common/main/lib/view/LanguageDialog'
|
||||
'common/main/lib/view/LanguageDialog',
|
||||
'common/main/lib/view/OptionsDialog'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
|
@ -571,8 +572,8 @@ define([
|
|||
if ( this.appConfig.canReview ) {
|
||||
state = (state == 'on');
|
||||
|
||||
this.api.asc_SetTrackRevisions(state);
|
||||
Common.localStorage.setItem(this.view.appPrefix + "track-changes-" + (this.appConfig.fileKey || ''), state ? 1 : 0);
|
||||
this.api.asc_SetTrackRevisions(state);
|
||||
|
||||
this.view.turnChanges(state);
|
||||
}
|
||||
|
@ -630,13 +631,19 @@ define([
|
|||
}).show();
|
||||
}
|
||||
} else if (item === 'settings') {
|
||||
(new DE.Views.CompareSettingsDialog({
|
||||
props: me._state.compareSettings,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
me._state.compareSettings = value;
|
||||
var value = me._state.compareSettings ? me._state.compareSettings.getWords() : true;
|
||||
(new Common.Views.OptionsDialog({
|
||||
title: me.textTitleComparison,
|
||||
items: [
|
||||
{caption: me.textChar, value: false, checked: (value===false)},
|
||||
{caption: me.textWord, value: true, checked: (value!==false)}
|
||||
],
|
||||
label: me.textShow,
|
||||
handler: function (dlg, result) {
|
||||
if (result=='ok') {
|
||||
me._state.compareSettings = new AscCommonWord.ComparisonOptions();
|
||||
me._state.compareSettings.putWords(dlg.getSettings());
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
|
@ -739,7 +746,7 @@ define([
|
|||
leftMenu.setPreviewMode(disable);
|
||||
|
||||
if (this.view) {
|
||||
this.view.$el.find('.no-group-mask').css('opacity', 1);
|
||||
this.view.$el.find('.no-group-mask.review').css('opacity', 1);
|
||||
|
||||
this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
|
||||
if ( button ) {
|
||||
|
@ -772,7 +779,8 @@ define([
|
|||
me.api.asc_SetTrackRevisions(state);
|
||||
};
|
||||
|
||||
var state = config.isReviewOnly || Common.localStorage.getBool(me.view.appPrefix + "track-changes-" + (config.fileKey || ''));
|
||||
var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined;
|
||||
var state = config.isReviewOnly || trackChanges===true || (trackChanges!==false) && Common.localStorage.getBool(me.view.appPrefix + "track-changes-" + (config.fileKey || ''));
|
||||
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
|
||||
_setReviewStatus(state);
|
||||
|
||||
|
@ -964,6 +972,11 @@ define([
|
|||
textParaMoveFromUp: '<b>Moved Up:</b>',
|
||||
textParaMoveFromDown: '<b>Moved Down:</b>',
|
||||
textUrl: 'Paste a document URL',
|
||||
textAcceptBeforeCompare: 'In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?'
|
||||
textAcceptBeforeCompare: 'In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?',
|
||||
textTitleComparison: 'Comparison Settings',
|
||||
textShow: 'Show changes at',
|
||||
textChar: 'Character level',
|
||||
textWord: 'Word level'
|
||||
|
||||
}, Common.Controllers.ReviewChanges || {}));
|
||||
});
|
|
@ -25,9 +25,9 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 8px;">
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-reset" style="min-width: 86px;"><%= scope.textResetAll %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 86px;float: right;"><%= scope.textDelete %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 86px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-reset" style="min-width: 80px;"><%= scope.textResetAll %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 80px;float: right;"><%= scope.textDelete %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 80px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -106,7 +106,8 @@ Common.Utils = _.extend(new(function() {
|
|||
Signature : 9,
|
||||
Pivot : 10,
|
||||
Cell : 11,
|
||||
Slicer : 12
|
||||
Slicer : 12,
|
||||
Form : 13
|
||||
},
|
||||
importTextType = {
|
||||
DRM: 0,
|
||||
|
@ -878,23 +879,24 @@ Common.Utils.warningDocumentIsLocked = function (opts) {
|
|||
opts.disablefunc(true);
|
||||
|
||||
var app = window.DE || window.PE || window.SSE;
|
||||
var tip = new Common.UI.SynchronizeTip({
|
||||
extCls : 'simple',
|
||||
text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
|
||||
textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
|
||||
placement : 'document'
|
||||
});
|
||||
tip.on({
|
||||
'dontshowclick': function() {
|
||||
if ( opts.disablefunc ) opts.disablefunc(false);
|
||||
app.getController('Main').api.asc_setIsReadOnly(false);
|
||||
this.close();
|
||||
},
|
||||
'closeclick': function() {
|
||||
this.close();
|
||||
|
||||
Common.UI.warning({
|
||||
msg: Common.Locale.get("warnFileLocked",{name:"Common.Translation", default: "You can't edit this file. Document is in use by another application."}),
|
||||
buttons: [{
|
||||
value: 'view',
|
||||
caption: Common.Locale.get("warnFileLockedBtnView",{name:"Common.Translation", default: "Open for viewing"})
|
||||
}, {
|
||||
value: 'edit',
|
||||
caption: Common.Locale.get("warnFileLockedBtnEdit",{name:"Common.Translation", default: "Create a copy"})
|
||||
}],
|
||||
primary: 'view',
|
||||
callback: function(btn){
|
||||
if (btn == 'edit') {
|
||||
if ( opts.disablefunc ) opts.disablefunc(false);
|
||||
app.getController('Main').api.asc_setIsReadOnly(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
tip.show();
|
||||
};
|
||||
|
||||
jQuery.fn.extend({
|
||||
|
|
|
@ -96,7 +96,7 @@ define([
|
|||
allowDepress: false,
|
||||
contentTarget: btnEl.attr('content-target')
|
||||
});
|
||||
btn.on('click', _.bind(me.onCategoryClick, me));
|
||||
btn.on('click', _.bind(me.onCategoryClick, me, btn, index));
|
||||
me.btnsCategory.push(btn);
|
||||
});
|
||||
var cnt_panel = $window.find('.content-panel'),
|
||||
|
@ -125,7 +125,7 @@ define([
|
|||
this.close();
|
||||
},
|
||||
|
||||
onCategoryClick: function(btn, event) {
|
||||
onCategoryClick: function(btn, index) {
|
||||
this.content_panels.filter('.active').removeClass('active');
|
||||
$("#" + btn.options.contentTarget).addClass("active");
|
||||
},
|
||||
|
@ -144,19 +144,21 @@ define([
|
|||
|
||||
setActiveCategory: function(index) {
|
||||
if (this.btnsCategory.length<1) return;
|
||||
|
||||
var btnActive = this.btnsCategory[(index>=0 && index<this.btnsCategory.length) ? index : 0];
|
||||
|
||||
index = (index>=0 && index<this.btnsCategory.length) ? index : 0;
|
||||
var btnActive = this.btnsCategory[index];
|
||||
if (!btnActive.isVisible() || btnActive.isDisabled()) {
|
||||
for (var i = 0; i<this.btnsCategory.length; i++){
|
||||
var btn = this.btnsCategory[i];
|
||||
if (btn.isVisible() && !btn.isDisabled()) {
|
||||
btnActive = btn;
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
btnActive.toggle(true);
|
||||
this.onCategoryClick(btnActive);
|
||||
this.onCategoryClick(btnActive, index);
|
||||
},
|
||||
|
||||
getActiveCategory: function() {
|
||||
|
|
|
@ -45,6 +45,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/CheckBox'
|
||||
], function (contentTemplate) { 'use strict';
|
||||
var _mathStore = new Common.UI.DataViewStore();
|
||||
var _functionsStore = new Common.UI.DataViewStore();
|
||||
|
||||
Common.Views.AutoCorrectDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||
options: {
|
||||
|
@ -62,7 +64,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
{panelId: 'id-autocorrect-dialog-settings-math', panelCaption: this.textMathCorrect},
|
||||
{panelId: 'id-autocorrect-dialog-settings-recognized', panelCaption: this.textRecognized}
|
||||
];
|
||||
if (this.appPrefix=='de-')
|
||||
if (this.appPrefix=='de-' || this.appPrefix=='pe-')
|
||||
items.push({panelId: 'id-autocorrect-dialog-settings-de-autoformat', panelCaption: this.textAutoFormat});
|
||||
else if (this.appPrefix=='sse-')
|
||||
items.push({panelId: 'id-autocorrect-dialog-settings-sse-autoformat', panelCaption: this.textAutoFormat});
|
||||
|
@ -88,8 +90,6 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
].join('')
|
||||
}, options || {});
|
||||
|
||||
this.mathStore = this.options.mathStore || new Common.UI.DataViewStore();
|
||||
this.functionsStore = this.options.functionsStore || new Common.UI.DataViewStore();
|
||||
this.api = this.options.api;
|
||||
|
||||
var path = this.appPrefix + "settings-math-correct";
|
||||
|
@ -103,7 +103,6 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.arrAddRec = value ? JSON.parse(value) : [];
|
||||
value = Common.Utils.InternalSettings.get(path + "-rem");
|
||||
this.arrRemRec = value ? JSON.parse(value) : [];
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
|
@ -129,7 +128,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
|
||||
this.mathList = new Common.UI.ListView({
|
||||
el: $window.find('#auto-correct-math-list'),
|
||||
store: new Common.UI.DataViewStore(this.mathStore.slice(0, 9)),
|
||||
store: new Common.UI.DataViewStore(_mathStore.slice(0, 9)),
|
||||
simpleAddMode: false,
|
||||
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
|
||||
itemTemplate: _.template([
|
||||
|
@ -138,7 +137,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
'<div style="width:230px;overflow: hidden;text-overflow: ellipsis;flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
scrollAlwaysVisible: true
|
||||
scrollAlwaysVisible: true,
|
||||
tabindex: 1
|
||||
});
|
||||
this.mathList.on('item:select', _.bind(this.onSelectMathItem, this));
|
||||
|
||||
|
@ -177,7 +177,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
me.mathList.scrollToRecord(_selectedItem);
|
||||
}
|
||||
_.delay(function(){
|
||||
me.mathList.cmpEl.find('.listview').focus();
|
||||
me.mathList.focus();
|
||||
},10);
|
||||
|
||||
}
|
||||
|
@ -214,13 +214,14 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
|
||||
this.mathRecList = new Common.UI.ListView({
|
||||
el: $window.find('#auto-correct-recognized-list'),
|
||||
store: new Common.UI.DataViewStore(this.functionsStore.slice(0, 9)),
|
||||
store: new Common.UI.DataViewStore(_functionsStore.slice(0, 9)),
|
||||
simpleAddMode: false,
|
||||
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
|
||||
itemTemplate: _.template([
|
||||
'<div id="<%= id %>" class="list-item" style="width: 340px;text-overflow: ellipsis;overflow: hidden;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
|
||||
].join('')),
|
||||
scrollAlwaysVisible: true
|
||||
scrollAlwaysVisible: true,
|
||||
tabindex: 1
|
||||
});
|
||||
this.mathRecList.on('item:select', _.bind(this.onSelectRecItem, this));
|
||||
|
||||
|
@ -259,7 +260,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
me.mathRecList.scrollToRecord(_selectedItem);
|
||||
}
|
||||
_.delay(function(){
|
||||
me.mathRecList.cmpEl.find('.listview').focus();
|
||||
me.mathRecList.focus();
|
||||
},10);
|
||||
|
||||
}
|
||||
|
@ -280,7 +281,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
});
|
||||
this.btnDeleteRec.on('click', _.bind(this.onDeleteRec, this, false));
|
||||
|
||||
if (this.appPrefix=='de-') {
|
||||
if (this.appPrefix=='de-' || this.appPrefix=='pe-') {
|
||||
this.chQuotes = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-quotes'),
|
||||
labelText: this.textQuotes,
|
||||
|
@ -349,6 +350,13 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
}
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [
|
||||
this.inputReplace, this.inputBy, {cmp: this.mathList, selector: '.listview'}, // 0 tab
|
||||
this.inputRecFind, {cmp: this.mathRecList, selector: '.listview'} // 1 tab
|
||||
];
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
return;
|
||||
},
|
||||
|
@ -401,9 +409,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
$('input', me.inputReplace.cmpEl).select().focus();
|
||||
},delay ? 50 : 0);
|
||||
|
||||
if (me.mathList.store.length < me.mathStore.length) {
|
||||
if (me.mathList.store.length < _mathStore.length) {
|
||||
_.delay(function(){
|
||||
me.mathList.setStore(me.mathStore);
|
||||
me.mathList.setStore(_mathStore);
|
||||
me.mathList.onResetItems();
|
||||
},delay ? 100 : 10);
|
||||
}
|
||||
|
@ -426,7 +434,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.btnDelete.setCaption(disabled ? this.textRestore : this.textDelete);
|
||||
disabled ? this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced')) : this.api.asc_AddOrEditFromAutoCorrectMathSymbols(rec.get('replaced'), rec.get('defaultValue'));
|
||||
} else {
|
||||
this.mathStore.remove(rec);
|
||||
_mathStore.remove(rec);
|
||||
this.mathList.scroller && this.mathList.scroller.update({});
|
||||
this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced'));
|
||||
}
|
||||
|
@ -448,7 +456,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
me.mathList.scrollToRecord(record);
|
||||
};
|
||||
if (!rec) {
|
||||
rec = this.mathStore.findWhere({replaced: this.inputReplace.getValue()})
|
||||
rec = _mathStore.findWhere({replaced: this.inputReplace.getValue()})
|
||||
}
|
||||
if (rec) {
|
||||
var idx = _.findIndex(this.arrAdd, function(item){return (item[0]==rec.get('replaced'));});
|
||||
|
@ -478,7 +486,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
});
|
||||
|
||||
} else {
|
||||
rec = this.mathStore.add({
|
||||
rec = _mathStore.add({
|
||||
replaced: this.inputReplace.getValue(),
|
||||
by: this.inputBy.getValue(),
|
||||
defaultDisabled: false
|
||||
|
@ -515,8 +523,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.arrAdd = [];
|
||||
this.arrRem = [];
|
||||
|
||||
this.mathStore.remove(this.mathStore.where({defaultValue: undefined}));
|
||||
this.mathStore.each(function(item, index){
|
||||
_mathStore.remove(_mathStore.where({defaultValue: undefined}));
|
||||
_mathStore.each(function(item, index){
|
||||
item.set('by', item.get('defaultValueStr'));
|
||||
item.set('defaultDisabled', false);
|
||||
});
|
||||
|
@ -529,9 +537,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
},
|
||||
|
||||
onInitList: function() {
|
||||
if (this.mathStore.length>0) return;
|
||||
if (_mathStore.length>0) return;
|
||||
|
||||
this.mathStore.comparator = function(item1, item2) {
|
||||
_mathStore.comparator = function(item1, item2) {
|
||||
var n1 = item1.get('replaced').toLowerCase(),
|
||||
n2 = item2.get('replaced').toLowerCase();
|
||||
if (n1==n2) return 0;
|
||||
|
@ -575,14 +583,14 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
changed.by = item[1];
|
||||
}
|
||||
});
|
||||
this.mathStore.reset(data.concat(dataAdd));
|
||||
_mathStore.reset(data.concat(dataAdd));
|
||||
this.updateControls();
|
||||
},
|
||||
|
||||
onInitRecList: function() {
|
||||
if (this.functionsStore.length>0) return;
|
||||
if (_functionsStore.length>0) return;
|
||||
|
||||
this.functionsStore.comparator = function(item1, item2) {
|
||||
_functionsStore.comparator = function(item1, item2) {
|
||||
var n1 = item1.get('value').toLowerCase(),
|
||||
n2 = item2.get('value').toLowerCase();
|
||||
if (n1==n2) return 0;
|
||||
|
@ -612,7 +620,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
});
|
||||
}
|
||||
});
|
||||
this.functionsStore.reset(data.concat(dataAdd));
|
||||
_functionsStore.reset(data.concat(dataAdd));
|
||||
this.updateRecControls();
|
||||
},
|
||||
|
||||
|
@ -642,8 +650,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.arrAddRec = [];
|
||||
this.arrRemRec = [];
|
||||
|
||||
this.functionsStore.remove(this.functionsStore.where({defaultValue: false}));
|
||||
this.functionsStore.each(function(item, index){
|
||||
_functionsStore.remove(_functionsStore.where({defaultValue: false}));
|
||||
_functionsStore.each(function(item, index){
|
||||
item.set('defaultDisabled', false);
|
||||
});
|
||||
this.mathRecList.deselectAll();
|
||||
|
@ -660,9 +668,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
$('input', me.inputRecFind.cmpEl).select().focus();
|
||||
},delay ? 50 : 0);
|
||||
|
||||
if (me.mathRecList.store.length < me.functionsStore.length) {
|
||||
if (me.mathRecList.store.length < _functionsStore.length) {
|
||||
_.delay(function(){
|
||||
me.mathRecList.setStore(me.functionsStore);
|
||||
me.mathRecList.setStore(_functionsStore);
|
||||
me.mathRecList.onResetItems();
|
||||
},delay ? 100 : 10);
|
||||
}
|
||||
|
@ -685,7 +693,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.btnDeleteRec.setCaption(disabled ? this.textRestore : this.textDelete);
|
||||
disabled ? this.api.asc_deleteFromAutoCorrectMathFunctions(rec.get('value')) : this.api.asc_AddFromAutoCorrectMathFunctions(rec.get('value'));
|
||||
} else {
|
||||
this.functionsStore.remove(rec);
|
||||
_functionsStore.remove(rec);
|
||||
this.mathRecList.scroller && this.mathRecList.scroller.update({});
|
||||
this.api.asc_deleteFromAutoCorrectMathFunctions(rec.get('value'));
|
||||
}
|
||||
|
@ -706,11 +714,11 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
me.mathRecList.scrollToRecord(record);
|
||||
};
|
||||
if (!rec) {
|
||||
rec = this.functionsStore.findWhere({value: this.inputRecFind.getValue()})
|
||||
rec = _functionsStore.findWhere({value: this.inputRecFind.getValue()})
|
||||
}
|
||||
if (!rec) {
|
||||
if (/^[A-Z]+$/i.test(this.inputRecFind.getValue())) {
|
||||
rec = this.functionsStore.add({
|
||||
rec = _functionsStore.add({
|
||||
value: this.inputRecFind.getValue(),
|
||||
defaultValue: false,
|
||||
defaultDisabled: false
|
||||
|
|
|
@ -85,7 +85,6 @@ define([
|
|||
defaultUnit : "",
|
||||
maxValue: 255,
|
||||
minValue: 0,
|
||||
tabindex: 1,
|
||||
maskExp: /[0-9]/,
|
||||
allowDecimal: false
|
||||
});
|
||||
|
@ -98,7 +97,6 @@ define([
|
|||
defaultUnit : "",
|
||||
maxValue: 255,
|
||||
minValue: 0,
|
||||
tabindex: 2,
|
||||
maskExp: /[0-9]/,
|
||||
allowDecimal: false
|
||||
});
|
||||
|
@ -111,7 +109,6 @@ define([
|
|||
defaultUnit : "",
|
||||
maxValue: 255,
|
||||
minValue: 0,
|
||||
tabindex: 3,
|
||||
maskExp: /[0-9]/,
|
||||
allowDecimal: false
|
||||
});
|
||||
|
@ -128,7 +125,6 @@ define([
|
|||
this.spinB.on('change', _.bind(this.showColor, this, null, true)).on('changing', _.bind(this.onChangingRGB, this, 3));
|
||||
this.textColor.on('change', _.bind(this.onChangeMaskedField, this));
|
||||
this.textColor.on('changed', _.bind(this.onChangedMaskedField, this));
|
||||
this.textColor.$el.attr('tabindex', 4);
|
||||
this.spinR.$el.find('input').attr('maxlength', 3);
|
||||
this.spinG.$el.find('input').attr('maxlength', 3);
|
||||
this.spinB.$el.find('input').attr('maxlength', 3);
|
||||
|
@ -146,9 +142,18 @@ define([
|
|||
this.rendered = true;
|
||||
if (this.color!==undefined)
|
||||
this.setColor(this.color);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.spinR, this.spinG, this.spinB, {cmp: this.textColor, selector: 'input'}];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.getChild('#extended-text-color');
|
||||
},
|
||||
|
||||
onChangeColor: function(o, color) {
|
||||
this.colorNew.css({'background-color' : color});
|
||||
|
||||
|
@ -271,15 +276,6 @@ define([
|
|||
me.stopevents = false;
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.getChild('#extended-text-color').focus();
|
||||
},50);
|
||||
},
|
||||
|
||||
onPrimary: function() {
|
||||
this.trigger('onmodalresult', 1);
|
||||
this.close(true);
|
||||
|
|
|
@ -630,6 +630,8 @@ define([
|
|||
getButton: function(type) {
|
||||
if (type == 'save')
|
||||
return this.btnSave;
|
||||
else if (type == 'users')
|
||||
return $panelUsers;
|
||||
},
|
||||
|
||||
lockHeaderBtns: function (alias, lock) {
|
||||
|
|
|
@ -107,6 +107,14 @@ define([
|
|||
// this.udRows.on('entervalue', _.bind(this.onPrimary, this));
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.udColumns, this.udRows];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.udColumns;
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, event.currentTarget.attributes['result'].value, {
|
||||
|
|
|
@ -101,7 +101,9 @@ define([
|
|||
'</span>'
|
||||
].join('')),
|
||||
data: this.options.languages,
|
||||
search: true
|
||||
takeFocusOnClose: true,
|
||||
search: true,
|
||||
scrollAlwaysVisible: true
|
||||
});
|
||||
|
||||
if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true});
|
||||
|
@ -109,6 +111,11 @@ define([
|
|||
var langname = Common.util.LanguageInfo.getLocalLanguageName(this.options.current);
|
||||
this.cmbLanguage.setValue(langname[0], langname[1]);
|
||||
this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord());
|
||||
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
me.cmbLanguage.focus();
|
||||
}, 100);
|
||||
},
|
||||
|
||||
close: function(suppressevent) {
|
||||
|
|
|
@ -155,6 +155,7 @@ define([
|
|||
el : $('#id-dlg-list-numbering-format'),
|
||||
menuStyle : 'min-width: 100%;max-height: 183px;',
|
||||
editable : false,
|
||||
takeFocusOnClose: true,
|
||||
cls : 'input-group-nr',
|
||||
data : [
|
||||
{ displayValue: this.txtNone, value: -1 },
|
||||
|
@ -196,6 +197,7 @@ define([
|
|||
menuStyle : 'min-width: 100%;max-height: 183px;',
|
||||
style : "width: 100px;",
|
||||
editable : false,
|
||||
takeFocusOnClose: true,
|
||||
template : _.template(template.join('')),
|
||||
itemsTemplate: _.template(itemsTemplate.join('')),
|
||||
data : [
|
||||
|
@ -318,6 +320,10 @@ define([
|
|||
this.afterRender();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart];
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this.updateThemeColors();
|
||||
this._setDefaults(this.props);
|
||||
|
@ -342,6 +348,13 @@ define([
|
|||
this.numberingControls.toggleClass('hidden', value==0);
|
||||
this.cmbNumFormat.setVisible(value==1);
|
||||
this.cmbBulletFormat.setVisible(value==0);
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
if (value)
|
||||
me.cmbNumFormat.focus();
|
||||
else
|
||||
me.cmbBulletFormat.focus();
|
||||
},50);
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
|
|
|
@ -59,7 +59,7 @@ define([
|
|||
width = 414;
|
||||
height = 277;
|
||||
} else {
|
||||
width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 420 : 262);
|
||||
width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 420 : 280);
|
||||
height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ define([
|
|||
'</div>',
|
||||
'<% } else { %>',
|
||||
'<div>',
|
||||
'<label class="header">' + t.txtPassword + '</label>',
|
||||
'<label class="">' + t.txtOpenFile + '</label>',
|
||||
'<div id="id-password-txt"></div>',
|
||||
'</div>',
|
||||
'<% } %>',
|
||||
|
@ -507,7 +507,8 @@ define([
|
|||
txtColon: 'Colon',
|
||||
txtSemicolon: 'Semicolon',
|
||||
txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.',
|
||||
txtAdvanced: 'Advanced'
|
||||
txtAdvanced: 'Advanced',
|
||||
txtOpenFile: "Enter a password to open the file"
|
||||
|
||||
}, Common.Views.OpenDialog || {}));
|
||||
});
|
|
@ -31,9 +31,9 @@
|
|||
*
|
||||
*/
|
||||
/**
|
||||
* CellsAddDialog.js
|
||||
* OptionsDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 08.05.2020
|
||||
* Created by Julia Radzhabova on 15.10.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
@ -42,13 +42,13 @@ define([
|
|||
'common/main/lib/component/RadioBox'
|
||||
], function () { 'use strict';
|
||||
|
||||
SSE.Views.CellsAddDialog = Common.UI.Window.extend(_.extend({
|
||||
Common.Views.OptionsDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
width: 214,
|
||||
height: 195,
|
||||
header: true,
|
||||
style: 'min-width: 214px;',
|
||||
cls: 'modal-dlg',
|
||||
items: [],
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
|
@ -57,14 +57,18 @@ define([
|
|||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div id="cell-ins-radio-1" style="margin-bottom: 10px;"></div>',
|
||||
'<div id="cell-ins-radio-2" style="margin-bottom: 10px;"></div>',
|
||||
'<div id="cell-ins-radio-3" style="margin-bottom: 10px;"></div>',
|
||||
'<div id="cell-ins-radio-4" style="margin-bottom: 2px;"></div>',
|
||||
'<% if (typeof label !== "undefined" && label !=="") { %>',
|
||||
'<label style="margin-bottom: 10px;"><%= label %></label>',
|
||||
'<% } %>',
|
||||
'<% _.each(items, function(item, index) { %>',
|
||||
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
||||
'<div id="<%= item.id %>" style="margin-bottom: 10px;"></div>',
|
||||
'<% }) %>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
this.radio = [];
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
@ -73,30 +77,32 @@ define([
|
|||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var me = this,
|
||||
$window = me.getChild(),
|
||||
items = this.options.items,
|
||||
checked = true;
|
||||
checked = true,
|
||||
checkedIndex = -1;
|
||||
if (items) {
|
||||
for (var i=0; i<4; i++) {
|
||||
var radio = new Common.UI.RadioBox({
|
||||
el: $('#cell-ins-radio-' + (i+1)),
|
||||
labelText: items[i].caption,
|
||||
name: 'asc-radio-cell-ins',
|
||||
value: items[i].value,
|
||||
disabled: items[i].disabled,
|
||||
checked: checked && !items[i].disabled
|
||||
for (var i=0; i<items.length; i++) {
|
||||
var item = items[i];
|
||||
this.radio.push(new Common.UI.RadioBox({
|
||||
el: $window.find('#' + item.id),
|
||||
labelText: item.caption || '',
|
||||
name: 'asc-radio-opt-dlg',
|
||||
value: item.value,
|
||||
disabled: !!item.disabled,
|
||||
checked: checked && !item.disabled
|
||||
}).on('change', function(field, newValue, eOpts) {
|
||||
if (newValue) {
|
||||
me.currentCell = field.options.value;
|
||||
}
|
||||
});
|
||||
if (checked && !items[i].disabled) {
|
||||
}));
|
||||
if ((checked || item.checked)&& !item.disabled) {
|
||||
checked = false;
|
||||
me.currentCell = items[i].value;
|
||||
checkedIndex = i;
|
||||
}
|
||||
}
|
||||
(checkedIndex>=0) && this.radio[checkedIndex].setValue(true);
|
||||
}
|
||||
|
||||
var $window = this.getChild();
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
|
@ -121,5 +127,5 @@ define([
|
|||
return false;
|
||||
}
|
||||
|
||||
}, SSE.Views.CellsAddDialog || {}))
|
||||
}, Common.Views.OptionsDialog || {}))
|
||||
});
|
|
@ -54,8 +54,8 @@ define([
|
|||
_options = {};
|
||||
|
||||
_.extend(_options, {
|
||||
width : 350,
|
||||
height : 238,
|
||||
width : 395,
|
||||
height : 270,
|
||||
header : true,
|
||||
cls : 'modal-dlg',
|
||||
contentTemplate : '',
|
||||
|
@ -77,6 +77,7 @@ define([
|
|||
'<label>' + t.txtRepeat + '</label>',
|
||||
'</div>',
|
||||
'<div id="id-repeat-txt" class="input-row" style="margin-bottom: 10px;"></div>',
|
||||
'<label>' + t.txtWarning + '</label>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
|
@ -154,7 +155,8 @@ define([
|
|||
txtPassword : "Password",
|
||||
txtDescription : "A Password is required to open this document",
|
||||
txtRepeat: 'Repeat password',
|
||||
txtIncorrectPwd: 'Confirmation password is not identical'
|
||||
txtIncorrectPwd: 'Confirmation password is not identical',
|
||||
txtWarning: 'Warning: If you lose or forget the password, it cannot be recovered. Please keep it in a safe place.'
|
||||
|
||||
}, Common.Views.PasswordDialog || {}));
|
||||
});
|
|
@ -210,6 +210,7 @@ define([
|
|||
this.iframePlugin.align = "top";
|
||||
this.iframePlugin.frameBorder = 0;
|
||||
this.iframePlugin.scrolling = "no";
|
||||
this.iframePlugin.allow = "camera; microphone; display-capture";
|
||||
this.iframePlugin.onload = _.bind(this._onLoad,this);
|
||||
this.currentPluginFrame.append(this.iframePlugin);
|
||||
|
||||
|
@ -393,6 +394,7 @@ define([
|
|||
iframe.align = "top";
|
||||
iframe.frameBorder = 0;
|
||||
iframe.scrolling = "no";
|
||||
iframe.allow = "camera; microphone; display-capture";
|
||||
iframe.onload = _.bind(this._onLoad,this);
|
||||
|
||||
var me = this;
|
||||
|
|
|
@ -57,7 +57,7 @@ define([
|
|||
Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){
|
||||
var template =
|
||||
'<section id="review-changes-panel" class="panel" data-tab="review">' +
|
||||
'<div class="group no-group-mask">' +
|
||||
'<div class="group no-group-mask review">' +
|
||||
'<span id="slot-btn-sharing" class="btn-slot text x-huge"></span>' +
|
||||
'<span id="slot-btn-coauthmode" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
|
@ -70,7 +70,7 @@ define([
|
|||
'<div class="group">' +
|
||||
'<span id="btn-review-on" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="group no-group-mask" style="padding-left: 0;">' +
|
||||
'<div class="group no-group-mask review" style="padding-left: 0;">' +
|
||||
'<span id="btn-review-view" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="group move-changes" style="padding-left: 0;">' +
|
||||
|
@ -84,11 +84,11 @@ define([
|
|||
'<span id="btn-compare" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long compare"></div>' +
|
||||
'<div class="group no-group-mask">' +
|
||||
'<div class="group no-group-mask review form-view">' +
|
||||
'<span id="slot-btn-chat" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long chat"></div>' +
|
||||
'<div class="group no-group-mask">' +
|
||||
'<div class="group no-group-mask review form-view">' +
|
||||
'<span id="slot-btn-history" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
|
@ -647,7 +647,7 @@ define([
|
|||
button.setDisabled(state);
|
||||
}
|
||||
}, this);
|
||||
this.btnChat && this.btnChat.setDisabled(state);
|
||||
// this.btnChat && this.btnChat.setDisabled(state);
|
||||
|
||||
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
|
||||
},
|
||||
|
|
|
@ -74,6 +74,8 @@ define([
|
|||
bold: false,
|
||||
italic: false
|
||||
};
|
||||
var filter = Common.localStorage.getKeysFilter();
|
||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
||||
|
||||
this.template = [
|
||||
'<div class="box" style="height: ' + ((this.signType == 'invisible') ? '132px;' : '300px;') + '">',
|
||||
|
@ -145,6 +147,7 @@ define([
|
|||
menuStyle : 'min-width: 234px;max-height: 270px;',
|
||||
store : new Common.Collections.Fonts(),
|
||||
recent : 0,
|
||||
takeFocusOnClose: true,
|
||||
hint : me.tipFontName
|
||||
}).on('selected', function(combo, record) {
|
||||
if (me.signObject) {
|
||||
|
@ -160,6 +163,7 @@ define([
|
|||
menuCls : 'scrollable-menu',
|
||||
menuStyle: 'min-width: 55px;max-height: 270px;',
|
||||
hint: this.tipFontSize,
|
||||
takeFocusOnClose: true,
|
||||
data: [
|
||||
{ value: 8, displayValue: "8" },
|
||||
{ value: 9, displayValue: "9" },
|
||||
|
@ -186,11 +190,13 @@ define([
|
|||
me.font.size = record.value;
|
||||
});
|
||||
this.cmbFontSize.setValue(this.font.size);
|
||||
this.cmbFontSize.on('changed:before', _.bind(this.onFontSizeChanged, this, true));
|
||||
this.cmbFontSize.on('changed:after', _.bind(this.onFontSizeChanged, this, false));
|
||||
|
||||
me.btnBold = new Common.UI.Button({
|
||||
parentEl: $('#id-dlg-sign-bold'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-bold',
|
||||
iconCls: 'toolbar__icon btn-bold',
|
||||
enableToggle: true,
|
||||
hint: me.textBold
|
||||
});
|
||||
|
@ -204,7 +210,7 @@ define([
|
|||
me.btnItalic = new Common.UI.Button({
|
||||
parentEl: $('#id-dlg-sign-italic'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-italic',
|
||||
iconCls: 'toolbar__icon btn-italic',
|
||||
enableToggle: true,
|
||||
hint: me.textItalic
|
||||
});
|
||||
|
@ -241,6 +247,10 @@ define([
|
|||
me.afterRender();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.inputPurpose, this.inputName, this.cmbFonts, this.cmbFontSize];
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
|
||||
|
@ -301,8 +311,14 @@ define([
|
|||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
if (state == 'ok' && (this.btnOk.isDisabled() || this.signObject && !this.signObject.isValid()))
|
||||
return;
|
||||
if (state == 'ok' && (this.btnOk.isDisabled() || this.signObject && !this.signObject.isValid())) {
|
||||
if (!this.btnOk.isDisabled()) {
|
||||
this.inputName.showError([this.textNameError]);
|
||||
this.inputName.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.options.handler.call(this, this, state);
|
||||
}
|
||||
|
@ -334,6 +350,39 @@ define([
|
|||
this.signObject.setText(value, this.font.name, this.font.size, this.font.italic, this.font.bold);
|
||||
},
|
||||
|
||||
onFontSizeChanged: function(before, combo, record, e) {
|
||||
var value,
|
||||
me = this;
|
||||
|
||||
if (before) {
|
||||
var item = combo.store.findWhere({
|
||||
displayValue: record.value
|
||||
});
|
||||
|
||||
if (!item) {
|
||||
value = /^\+?(\d*(\.|,)?\d+)$|^\+?(\d+(\.|,)?\d*)$/.exec(record.value);
|
||||
|
||||
if (!value) {
|
||||
value = combo.getValue();
|
||||
combo.setRawValue(value);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var maxvalue = (this.appPrefix=='sse-') ? 409 : 300;
|
||||
value = Common.Utils.String.parseFloat(record.value);
|
||||
value = value > maxvalue ? maxvalue :
|
||||
value < 1 ? 1 : Math.floor((value+0.4)*2)/2;
|
||||
|
||||
combo.setRawValue(value);
|
||||
if (this.signObject) {
|
||||
this.signObject.setText(this.inputName.getValue(), this.font.name, value, this.font.italic, this.font.bold);
|
||||
}
|
||||
this.font.size = value;
|
||||
}
|
||||
},
|
||||
|
||||
textTitle: 'Sign Document',
|
||||
textPurpose: 'Purpose for signing this document',
|
||||
textCertificate: 'Certificate',
|
||||
|
@ -347,7 +396,8 @@ define([
|
|||
tipFontSize: 'Font Size',
|
||||
textBold: 'Bold',
|
||||
textItalic: 'Italic',
|
||||
textSelect: 'Select'
|
||||
textSelect: 'Select',
|
||||
textNameError: 'Signer name must not be empty.'
|
||||
|
||||
}, Common.Views.SignDialog || {}))
|
||||
});
|
|
@ -142,13 +142,12 @@ define([
|
|||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
getFocusedComponents: function() {
|
||||
return [this.inputName, this.inputTitle, this.inputEmail, this.textareaInstructions];
|
||||
},
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.inputName.cmpEl.find('input').focus();
|
||||
},500);
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.inputName;
|
||||
},
|
||||
|
||||
setSettings: function (props) {
|
||||
|
@ -164,6 +163,8 @@ define([
|
|||
value = props.asc_getInstructions();
|
||||
me.textareaInstructions.val(value ? value : '');
|
||||
me.chDate.setValue(props.asc_getShowDate());
|
||||
|
||||
me._currentGuid = props.asc_getGuid();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -176,6 +177,7 @@ define([
|
|||
props.asc_setEmail(me.inputEmail.getValue());
|
||||
props.asc_setInstructions(me.textareaInstructions.val());
|
||||
props.asc_setShowDate(me.chDate.getValue()=='checked');
|
||||
(me._currentGuid!==undefined) && props.asc_setGuid(me._currentGuid);
|
||||
|
||||
return props;
|
||||
},
|
||||
|
|
|
@ -489,9 +489,18 @@ define([
|
|||
var init = (aFontSelects.length<1);
|
||||
init && this.initFonts();
|
||||
|
||||
//fill recents
|
||||
this.fillRecentSymbols();
|
||||
|
||||
var lastfont;
|
||||
if (options.font) {
|
||||
lastfont = options.font;
|
||||
} else if (aRecents.length>0) {
|
||||
lastfont = aRecents[0].font;
|
||||
}
|
||||
if (lastfont) {
|
||||
for(var i = 0; i < aFontSelects.length; ++i){
|
||||
if(aFontSelects[i].displayValue === options.font){
|
||||
if(aFontSelects[i].displayValue === lastfont){
|
||||
nCurrentFont = i;
|
||||
break;
|
||||
}
|
||||
|
@ -526,6 +535,8 @@ define([
|
|||
nCurrentSymbol = options.code;
|
||||
} else if (options.symbol) {
|
||||
nCurrentSymbol = this.fixedCharCodeAt(options.symbol, 0);
|
||||
} else if (aRecents.length>0) {
|
||||
nCurrentSymbol = aRecents[0].symbol;
|
||||
}
|
||||
|
||||
if (init && this.options.lang && this.options.lang != 'en') {
|
||||
|
@ -539,6 +550,8 @@ define([
|
|||
|
||||
this.on('resizing', _.bind(this.onWindowResizing, this));
|
||||
this.on('resize', _.bind(this.onWindowResize, this));
|
||||
|
||||
bMainFocus = true;
|
||||
},
|
||||
|
||||
initFonts: function() {
|
||||
|
@ -705,9 +718,6 @@ define([
|
|||
me.updateInput();
|
||||
});
|
||||
|
||||
//fill recents
|
||||
this.fillRecentSymbols();
|
||||
|
||||
this.symbolTablePanel = $window.find('#symbol-table-scrollable-div');
|
||||
this.previewPanel = $window.find('#id-preview-data');
|
||||
this.previewParent = this.previewPanel.parent();
|
||||
|
@ -790,13 +800,16 @@ define([
|
|||
},
|
||||
|
||||
getPasteSymbol: function(cellId) {
|
||||
var bUpdateRecents = cellId[0] === 'c';
|
||||
var bUpdateRecents = false;
|
||||
var sFont;
|
||||
if(bUpdateRecents){
|
||||
sFont = aFontSelects[nCurrentFont].displayValue;
|
||||
} else {
|
||||
var nFontId = parseInt(cellId.split('_')[2]);
|
||||
sFont = aFontSelects[nFontId].displayValue;
|
||||
if (cellId && cellId.length>0) {
|
||||
bUpdateRecents = (cellId[0] === 'c');
|
||||
if(bUpdateRecents){
|
||||
sFont = aFontSelects[nCurrentFont].displayValue;
|
||||
} else {
|
||||
var nFontId = parseInt(cellId.split('_')[2]);
|
||||
sFont = aFontSelects[nFontId].displayValue;
|
||||
}
|
||||
}
|
||||
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents};
|
||||
},
|
||||
|
@ -821,12 +834,12 @@ define([
|
|||
}
|
||||
|
||||
var special = this.btnSpecial.isActive();
|
||||
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
|
||||
var settings = (state=='ok') ? (special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'))) : {};
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state, settings);
|
||||
}
|
||||
if (state=='ok') {
|
||||
!special && settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
|
||||
!special && this.checkRecent(nCurrentSymbol, settings.font);
|
||||
!special && settings.updateRecents && this.updateRecents();
|
||||
if (this.type)
|
||||
return;
|
||||
|
@ -1054,7 +1067,7 @@ define([
|
|||
this._handleInput('ok');
|
||||
else {
|
||||
var settings = this.getPasteSymbol($(e.target).attr('id'));
|
||||
settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
|
||||
this.checkRecent(nCurrentSymbol, settings.font);
|
||||
settings.updateRecents && this.updateView(false, undefined, undefined, true);
|
||||
this.fireEvent('symbol:dblclick', this, 'ok', settings);
|
||||
}
|
||||
|
@ -1476,7 +1489,7 @@ define([
|
|||
this.specialPanel.toggleClass('hidden', !special);
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
special ? me.specialList.cmpEl.find('.listview').focus() : me.previewPanel.focus();
|
||||
special ? me.specialList.focus() : me.previewPanel.focus();
|
||||
},50);
|
||||
|
||||
},
|
||||
|
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
14
apps/common/main/resources/img/load-mask/loading.svg
Normal file
|
@ -0,0 +1,14 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<style>
|
||||
use {display: none}
|
||||
use:target {display: inline}
|
||||
</style>
|
||||
<symbol id="symb-middle" viewBox="0 0 28 28">
|
||||
<circle cx="14" cy="14" fill="none" stroke="#fff" stroke-width="1.5" r="10.25" stroke-dasharray="160%, 40%" />
|
||||
</symbol>
|
||||
<symbol id="symb-small1" viewBox="0 0 20 20">
|
||||
<circle cx="10" cy="10" fill="none" stroke="#444" stroke-width="1.5" r="7.25" stroke-dasharray="160%, 40%" />
|
||||
</symbol>
|
||||
<use id="middle" href="#symb-middle" />
|
||||
<use id="small" href="#symb-small" />
|
||||
</svg>
|
After Width: | Height: | Size: 632 B |
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 842 B |
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 953 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
BIN
apps/common/main/resources/img/toolbar/1x/btn-arrow-down.png
Normal file
After Width: | Height: | Size: 287 B |
BIN
apps/common/main/resources/img/toolbar/1x/btn-arrow-up.png
Normal file
After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
apps/common/main/resources/img/toolbar/2x/btn-arrow-down.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
apps/common/main/resources/img/toolbar/2x/btn-arrow-up.png
Normal file
After Width: | Height: | Size: 414 B |
|
@ -200,7 +200,7 @@
|
|||
|
||||
@common-controls-width: 100px;
|
||||
.img-commonctrl,
|
||||
.dropdown-menu li .checked:before, .input-error:before,
|
||||
.dropdown-menu li .checked:before, .input-error:before, .input-warning:before,
|
||||
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before
|
||||
{
|
||||
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})");
|
||||
|
|
|
@ -877,11 +877,11 @@ svg.icon {
|
|||
only screen and (min-resolution: 144dpi),
|
||||
only screen and (min-resolution: 240dpi) {
|
||||
.@{class100} {
|
||||
display: none;
|
||||
//display: none;
|
||||
}
|
||||
|
||||
.@{class150} {
|
||||
display: block;
|
||||
//display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,18 @@
|
|||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&.warning {
|
||||
input:not([disabled]) + .input-error {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.input-error {
|
||||
&:before {
|
||||
background-position: @input-warning-offset-x @input-warning-offset-y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input:required:focus:invalid,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.listview {
|
||||
border: 1px solid @input-border;
|
||||
.border-radius(@border-radius-small);
|
||||
line-height: 15px;
|
||||
|
||||
&.inner {
|
||||
|
@ -20,6 +21,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:not(.no-focus):focus {
|
||||
border-color: @gray-darker;
|
||||
}
|
||||
|
||||
& > .item {
|
||||
// display: block;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
@loadmask-zindex: @zindex-modal + 100;
|
||||
@loadmask-image-height: 28px;
|
||||
@loadmask-image-width: 28px;
|
||||
@loadmask-small-image-height: 20px;
|
||||
@loadmask-small-image-width: 20px;
|
||||
|
||||
.asc-loadmask {
|
||||
position: absolute;
|
||||
|
@ -14,30 +18,55 @@
|
|||
.asc-loadmask-body {
|
||||
position: absolute;
|
||||
z-index: @loadmask-zindex + 1;
|
||||
padding: 20px;
|
||||
line-height: 33px;
|
||||
padding: 24px;
|
||||
line-height: @loadmask-image-height;
|
||||
border: none;
|
||||
background-image: none;
|
||||
background-color: fade(darken(@gray-deep, 15%), 70%);
|
||||
background-color: fade(@gray-deep, 95%);
|
||||
color: @gray-light;
|
||||
.border-radius(@border-radius-large);
|
||||
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%);
|
||||
|
||||
& > div {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.asc-loadmask-image {
|
||||
background-image: ~"url(@{common-image-const-path}/load-mask/loading.gif)";
|
||||
height: 33px;
|
||||
width: 33px;
|
||||
//background-image: ~"url(@{common-image-const-path}/load-mask/loading.svg#middle)";
|
||||
background-image: ~"url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyOCAyOCI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgcj0iMTAuMjUiIHN0cm9rZS1kYXNoYXJyYXk9IjE2MCUsIDQwJSIgLz48L3N2Zz4=)";
|
||||
height: @loadmask-image-height;
|
||||
width: @loadmask-image-width;
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.asc-loadmask-title {
|
||||
.fontsize(@font-size-large);
|
||||
margin: 0 20px;
|
||||
margin: 0 8px 0 12px;
|
||||
}
|
||||
|
||||
.left-panel & {
|
||||
line-height: @loadmask-small-image-height;
|
||||
background-color: transparent;
|
||||
color: @gray-deep;
|
||||
padding: 8px;
|
||||
top: 78px;
|
||||
transform: translate(-50%, 0);
|
||||
|
||||
.asc-loadmask-image {
|
||||
//background-image: ~"url(@{common-image-const-path}/load-mask/loading.svg#small)";
|
||||
background-image: ~"url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNDQ0IiBzdHJva2Utd2lkdGg9IjEuNSIgcj0iNy4yNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTYwJSwgNDAlIiAvPjwvc3ZnPg==)";
|
||||
height: @loadmask-small-image-height;
|
||||
width: @loadmask-small-image-width;
|
||||
}
|
||||
|
||||
.asc-loadmask-title {
|
||||
margin: 0 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,3 +106,20 @@
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
#loadmask-spinner {
|
||||
animation-duration: .8s;
|
||||
animation-name: rotation;
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
|
|
|
@ -425,7 +425,7 @@
|
|||
}
|
||||
|
||||
&.style-skip-docname .toolbar {
|
||||
#box-doc-name > input {
|
||||
#box-doc-name > label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
.treeview {
|
||||
border: 1px solid @input-border;
|
||||
.border-radius(@border-radius-small);
|
||||
|
||||
&.inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -16,6 +19,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border-color: @gray-darker;
|
||||
}
|
||||
|
||||
> .item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
|
|
@ -771,6 +771,10 @@
|
|||
@input-error-offset-x: -73px;
|
||||
@input-error-offset-y: -170px;
|
||||
|
||||
// Input warning
|
||||
@input-warning-offset-x: -57px;
|
||||
@input-warning-offset-y: -170px;
|
||||
|
||||
// Spinner
|
||||
@spinner-offset-x: -41px;
|
||||
@spinner-offset-y: -187px;
|
||||
|
|
|
@ -138,34 +138,40 @@
|
|||
z-index: @zindex-modal - 2;
|
||||
}
|
||||
|
||||
&.alert {
|
||||
min-height: 90px;
|
||||
min-width: 230px;
|
||||
.icon {
|
||||
&.warn {
|
||||
width: 35px;
|
||||
height: 32px;
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 105px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
float: left;
|
||||
&.error, &.info, &.confirm {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
margin: 0 0 0 10px;
|
||||
|
||||
&.warn {
|
||||
height: 32px;
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 105px;
|
||||
}
|
||||
|
||||
&.error {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 0;
|
||||
}
|
||||
|
||||
&.info {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 35px;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 70px;
|
||||
}
|
||||
}
|
||||
|
||||
&.error {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 0;
|
||||
}
|
||||
|
||||
&.info {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 35px;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
background-position: @alerts-offset-x @alerts-offset-y - 70px;
|
||||
}
|
||||
}
|
||||
|
||||
&.alert {
|
||||
.icon {
|
||||
float: left;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
min-height: 90px;
|
||||
min-width: 230px;
|
||||
|
||||
.body {
|
||||
.info-box {
|
||||
padding: 20px 20px 20px 10px;
|
||||
|
|
|
@ -318,7 +318,9 @@ define([
|
|||
|
||||
initReviewingSettingsView: function () {
|
||||
var me = this;
|
||||
$('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || '')));
|
||||
|
||||
var trackChanges = typeof (this.appConfig.customization) == 'object' ? this.appConfig.customization.trackChanges : undefined;
|
||||
$('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || trackChanges===true || (trackChanges!==false) && Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || '')));
|
||||
$('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me));
|
||||
$('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me));
|
||||
$('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me));
|
||||
|
@ -409,6 +411,7 @@ define([
|
|||
}
|
||||
!suppressEvent && this.initReviewingSettingsView();
|
||||
DE.getController('Toolbar').setDisplayMode(displayMode);
|
||||
DE.getController('DocumentHolder').setDisplayMode(displayMode);
|
||||
},
|
||||
|
||||
|
||||
|
@ -890,28 +893,31 @@ define([
|
|||
});
|
||||
mainView.hideNavbar();
|
||||
} else {
|
||||
me.modalViewComment = uiApp.popover(
|
||||
'<div class="popover container-view-comment">' +
|
||||
'<div class="popover-inner">' +
|
||||
me.view.getTemplateContainerViewComments() +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
$$('#toolbar-collaboration')
|
||||
);
|
||||
this.picker = $$(me.modalViewComment);
|
||||
var $overlay = $('.modal-overlay');
|
||||
|
||||
$$(this.picker).on('opened', function () {
|
||||
$overlay.on('removeClass', function () {
|
||||
if (!$overlay.hasClass('modal-overlay-visible')) {
|
||||
$overlay.addClass('modal-overlay-visible')
|
||||
}
|
||||
if (!me.openModal) {
|
||||
me.modalViewComment = uiApp.popover(
|
||||
'<div class="popover container-view-comment">' +
|
||||
'<div class="popover-inner">' +
|
||||
me.view.getTemplateContainerViewComments() +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
$$('#toolbar-collaboration')
|
||||
);
|
||||
this.picker = $$(me.modalViewComment);
|
||||
var $overlay = $('.modal-overlay');
|
||||
me.openModal = true;
|
||||
$$(this.picker).on('opened', function () {
|
||||
$overlay.on('removeClass', function () {
|
||||
if (!$overlay.hasClass('modal-overlay-visible')) {
|
||||
$overlay.addClass('modal-overlay-visible')
|
||||
}
|
||||
});
|
||||
}).on('close', function () {
|
||||
$overlay.off('removeClass');
|
||||
$overlay.removeClass('modal-overlay-visible');
|
||||
$('.popover').remove();
|
||||
me.openModal = false;
|
||||
});
|
||||
}).on('close', function () {
|
||||
$overlay.off('removeClass');
|
||||
$overlay.removeClass('modal-overlay-visible');
|
||||
$('.popover').remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
me.getView('Common.Views.Collaboration').renderViewComments(me.showComments, me.indexCurrentComment);
|
||||
$('.prev-comment').single('click', _.bind(me.onViewPrevComment, me));
|
||||
|
|
31
apps/documenteditor/embed/locale/be.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Скапіяваць у буфер абмену",
|
||||
"common.view.modals.txtEmbed": "Убудаваць",
|
||||
"common.view.modals.txtHeight": "Вышыня",
|
||||
"common.view.modals.txtShare": "Падзяліцца спасылкай",
|
||||
"common.view.modals.txtWidth": "Шырыня",
|
||||
"DE.ApplicationController.convertationErrorText": "Пераўтварыць не атрымалася.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Час чакання пераўтварэння сышоў.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Памылка",
|
||||
"DE.ApplicationController.downloadErrorText": "Не атрымалася спампаваць.",
|
||||
"DE.ApplicationController.downloadTextText": "Спампоўванне дакумента...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Вы спрабуеце выканаць дзеянне, на якое не маеце правоў.<br>Калі ласка, звярніцеся да адміністратара сервера дакументаў.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Код памылкі: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Файл абаронены паролем, яго немагчыма адкрыць.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Памер файла перавышае ліміт, вызначаны для вашага сервера.<br>Звярніцеся да адміністратара сервера дакументаў за дадатковымі звесткамі.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Злучэнне з інтэрнэтам было адноўлена, і версія файла змянілася.<br>Перш чым працягнуць працу, неабходна спампаваць файл альбо скапіяваць яго змесціва, каб захаваць даныя, а пасля перазагрузіць старонку.",
|
||||
"DE.ApplicationController.errorUserDrop": "На дадзены момант файл недаступны.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Увага",
|
||||
"DE.ApplicationController.scriptLoadError": "Занадта павольнае злучэнне, не ўсе кампаненты атрымалася загрузіць. Калі ласка, абнавіце старонку.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Загрузка дакумента",
|
||||
"DE.ApplicationController.textOf": "з",
|
||||
"DE.ApplicationController.txtClose": "Закрыць",
|
||||
"DE.ApplicationController.unknownErrorText": "Невядомая памылка.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Ваш браўзер не падтрымліваецца.",
|
||||
"DE.ApplicationController.waitText": "Калі ласка, пачакайце...",
|
||||
"DE.ApplicationView.txtDownload": "Спампаваць",
|
||||
"DE.ApplicationView.txtEmbed": "Убудаваць",
|
||||
"DE.ApplicationView.txtFullScreen": "Поўнаэкранны рэжым",
|
||||
"DE.ApplicationView.txtPrint": "Друк",
|
||||
"DE.ApplicationView.txtShare": "Падзяліцца"
|
||||
}
|
31
apps/documenteditor/embed/locale/ca.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Copiat al porta-retalls",
|
||||
"common.view.modals.txtEmbed": "Incrustar",
|
||||
"common.view.modals.txtHeight": "Alçada",
|
||||
"common.view.modals.txtShare": "Compartir Enllaç",
|
||||
"common.view.modals.txtWidth": "Amplada",
|
||||
"DE.ApplicationController.convertationErrorText": "Conversió Fallida",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Conversió fora de temps",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Error",
|
||||
"DE.ApplicationController.downloadErrorText": "Descàrrega fallida.",
|
||||
"DE.ApplicationController.downloadTextText": "Descarregant document...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Intenteu realitzar una acció per la qual no teniu drets.<br>Poseu-vos en contacte amb l'administrador del servidor de documents.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Error codi:%1 ",
|
||||
"DE.ApplicationController.errorFilePassProtect": "El fitxer està protegit amb contrasenya i no es pot obrir.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "La mida del fitxer excedeix la limitació establerta per al vostre servidor. Podeu contactar amb l'administrador del Document Server per obtenir més detalls.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "La connexió a Internet s'ha restaurat i la versió del fitxer s'ha canviat. <br> Abans de continuar treballant, heu de descarregar el fitxer o copiar-ne el contingut per assegurar-vos que no es perdi res i, després, tornar a carregar aquesta pàgina.",
|
||||
"DE.ApplicationController.errorUserDrop": "Ara no es pot accedir al fitxer.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Avis",
|
||||
"DE.ApplicationController.scriptLoadError": "La connexió és massa lenta, alguns dels components no s’han pogut carregar. Torneu a carregar la pàgina.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Carregant document",
|
||||
"DE.ApplicationController.textOf": "de",
|
||||
"DE.ApplicationController.txtClose": "Tancar",
|
||||
"DE.ApplicationController.unknownErrorText": "Error Desconegut.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "El vostre navegador no és compatible.",
|
||||
"DE.ApplicationController.waitText": "Si us plau, esperi...",
|
||||
"DE.ApplicationView.txtDownload": "Descàrrega",
|
||||
"DE.ApplicationView.txtEmbed": "Incrustar",
|
||||
"DE.ApplicationView.txtFullScreen": "Pantalla Completa",
|
||||
"DE.ApplicationView.txtPrint": "Imprimir",
|
||||
"DE.ApplicationView.txtShare": "Compartir"
|
||||
}
|
31
apps/documenteditor/embed/locale/el.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Αντιγραφή στο πρόχειρο",
|
||||
"common.view.modals.txtEmbed": "Ενσωμάτωση",
|
||||
"common.view.modals.txtHeight": "Ύψος",
|
||||
"common.view.modals.txtShare": "Διαμοιρασμός συνδέσμου",
|
||||
"common.view.modals.txtWidth": "Πλάτος",
|
||||
"DE.ApplicationController.convertationErrorText": "Αποτυχία μετατροπής.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Υπέρβαση χρονικού ορίου μετατροπής.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Σφάλμα",
|
||||
"DE.ApplicationController.downloadErrorText": "Αποτυχία λήψης.",
|
||||
"DE.ApplicationController.downloadTextText": "Γίνεται λήψη εγγράφου...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Προσπαθείτε να εκτελέσετε μια ενέργεια για την οποία δεν έχετε δικαιώματα.<br>Παρακαλούμε να επικοινωνήστε με τον διαχειριστή του διακομιστή εγγράφων.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Κωδικός σφάλματος: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Το αρχείο προστατεύεται με συνθηματικό και δεν μπορεί να ανοίξει.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Το μέγεθος του αρχείου υπερβαίνει το όριο που έχει οριστεί για τον διακομιστή σας.<br>Παρακαλούμε επικοινωνήστε με τον διαχειριστή του διακομιστή εγγράφων για λεπτομέρειες.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Η σύνδεση στο Διαδίκτυο έχει αποκατασταθεί και η έκδοση του αρχείου έχει αλλάξει.<br>Προτού συνεχίσετε να εργάζεστε, πρέπει να κατεβάσετε το αρχείο ή να αντιγράψετε το περιεχόμενό του για να βεβαιωθείτε ότι δεν έχει χαθεί τίποτα και, στη συνέχεια, φορτώστε ξανά αυτήν τη σελίδα.",
|
||||
"DE.ApplicationController.errorUserDrop": "Δεν είναι δυνατή η πρόσβαση στο αρχείο αυτήν τη στιγμή.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Προειδοποίηση",
|
||||
"DE.ApplicationController.scriptLoadError": "Η σύνδεση είναι πολύ αργή, δεν ήταν δυνατή η φόρτωση ορισμένων στοιχείων. Φορτώστε ξανά τη σελίδα.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Φόρτωση εγγράφου",
|
||||
"DE.ApplicationController.textOf": "του",
|
||||
"DE.ApplicationController.txtClose": "Κλείσιμο",
|
||||
"DE.ApplicationController.unknownErrorText": "Άγνωστο σφάλμα.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Ο περιηγητής σας δεν υποστηρίζεται.",
|
||||
"DE.ApplicationController.waitText": "Παρακαλούμε, περιμένετε...",
|
||||
"DE.ApplicationView.txtDownload": "Λήψη",
|
||||
"DE.ApplicationView.txtEmbed": "Ενσωμάτωση",
|
||||
"DE.ApplicationView.txtFullScreen": "Πλήρης οθόνη",
|
||||
"DE.ApplicationView.txtPrint": "Εκτύπωση",
|
||||
"DE.ApplicationView.txtShare": "Διαμοιρασμός"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Másolás a vágólapra",
|
||||
"common.view.modals.txtCopy": "Másolás vágólapra",
|
||||
"common.view.modals.txtEmbed": "Beágyazás",
|
||||
"common.view.modals.txtHeight": "Magasság",
|
||||
"common.view.modals.txtShare": "Hivatkozás megosztása",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Letöltés",
|
||||
"DE.ApplicationView.txtEmbed": "Beágyazás",
|
||||
"DE.ApplicationView.txtFullScreen": "Teljes képernyő",
|
||||
"DE.ApplicationView.txtPrint": "Nyomtatás",
|
||||
"DE.ApplicationView.txtShare": "Megosztás"
|
||||
}
|
31
apps/documenteditor/embed/locale/lo.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "ເກັບໄວ້ໃນຄຣິບບອດ",
|
||||
"common.view.modals.txtEmbed": "ຝັງໄວ້",
|
||||
"common.view.modals.txtHeight": "ລວງສູງ",
|
||||
"common.view.modals.txtShare": "ແບ່ງປັນລິ້ງ",
|
||||
"common.view.modals.txtWidth": "ລວງກວ້າງ",
|
||||
"DE.ApplicationController.convertationErrorText": " ການປ່ຽນແປງບໍ່ສຳເລັດ.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "ໝົດເວລາການປ່ຽນແປງ.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "ຂໍ້ຜິດພາດ",
|
||||
"DE.ApplicationController.downloadErrorText": "ດາວໂຫຼດບໍ່ສຳເລັດ.",
|
||||
"DE.ApplicationController.downloadTextText": "ກຳລັງດາວໂຫຼດເອກະສານ",
|
||||
"DE.ApplicationController.errorAccessDeny": "ທ່ານບໍ່ມີສິດຈະດຳເນີນການອັນນີ້. <br>ກະລຸນະຕິດຕໍ່ຜູ້ຄຸ້ມຄອງລົບຂອງທ່ານ",
|
||||
"DE.ApplicationController.errorDefaultMessage": "ລະຫັດຂໍ້ຜິດພາດ: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "ມີລະຫັດປົກປ້ອງຟາຍນີ້ຈຶ່ງບໍ່ສາມາດເປີດໄດ້",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "ຂະໜາດຂອງຟາຍໃຫຍ່ກວ່າທີ່ກຳນົດໄວ້ໃນລະບົບ. <br>ກະລຸນະຕິດຕໍ່ຜູ້ຄຸ້ມຄອງລົບຂອງທ່ານ",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "ການເຊື່ອຕໍ່ອິນເຕີເນັດຫາກໍ່ກັບມາ, ແລະຟາຍເອກະສານໄດ້ມີການປ່ຽນແປງແລ້ວ. <b>ກ່ອນທີ່ທ່ານຈະດຳເນີການຕໍ່ໄປ, ທ່ານຕ້ອງໄດ້ດາວໂຫຼດຟາຍ ຫຼືສຳເນົາເນື້ອຫາ ເພື່ອປ້ອງການການສູນເສຍ, ແລະກໍ່ທຳການໂຫຼດໜ້າຄືນອີກຄັ້ງ.",
|
||||
"DE.ApplicationController.errorUserDrop": "ບໍ່ສາມາດເຂົ້າເຖິງຟາຍໄດ້",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "ເຕືອນ",
|
||||
"DE.ApplicationController.scriptLoadError": "ການເຊື່ອມຕໍ່ອິນເຕີເນັດຊ້າເກີນໄປ, ບາງອົງປະກອບບໍ່ສາມາດໂຫຼດໄດ້. ກະລຸນາໂຫຼດໜ້ານີ້ຄືນໃໝ່",
|
||||
"DE.ApplicationController.textLoadingDocument": "ກຳລັງໂຫຼດເອກະສານ",
|
||||
"DE.ApplicationController.textOf": "ຂອງ",
|
||||
"DE.ApplicationController.txtClose": " ປິດ",
|
||||
"DE.ApplicationController.unknownErrorText": "ມີຂໍ້ຜິດພາດທີ່ບໍ່ຮູ້ສາເຫດ",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "ບຣາວເຊີຂອງທ່ານບໍ່ສາມານຳໃຊ້ໄດ້",
|
||||
"DE.ApplicationController.waitText": "ກະລຸນາລໍຖ້າ...",
|
||||
"DE.ApplicationView.txtDownload": "ດາວໂຫຼດ",
|
||||
"DE.ApplicationView.txtEmbed": "ຝັງໄວ້",
|
||||
"DE.ApplicationView.txtFullScreen": "ເຕັມຈໍ",
|
||||
"DE.ApplicationView.txtPrint": "ພິມ",
|
||||
"DE.ApplicationView.txtShare": "ແບ່ງປັນ"
|
||||
}
|
19
apps/documenteditor/embed/locale/nb.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Kopier til utklippstavle",
|
||||
"common.view.modals.txtHeight": "Høyde",
|
||||
"common.view.modals.txtShare": "Del link",
|
||||
"common.view.modals.txtWidth": "Bredde",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Feil",
|
||||
"DE.ApplicationController.downloadErrorText": "Nedlasting feilet.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Feilkode: %1",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Advarsel",
|
||||
"DE.ApplicationController.textLoadingDocument": "Laster dokument",
|
||||
"DE.ApplicationController.textOf": "av",
|
||||
"DE.ApplicationController.txtClose": "Lukk",
|
||||
"DE.ApplicationController.unknownErrorText": "Ukjent feil.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Nettleseren din er ikke støttet.",
|
||||
"DE.ApplicationController.waitText": "Vennligst vent...",
|
||||
"DE.ApplicationView.txtDownload": "Last ned",
|
||||
"DE.ApplicationView.txtFullScreen": "Fullskjerm",
|
||||
"DE.ApplicationView.txtShare": "Del"
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Skopiuj do schowka",
|
||||
"common.view.modals.txtEmbed": "Osadź",
|
||||
"common.view.modals.txtHeight": "Wysokość",
|
||||
"common.view.modals.txtShare": "Udostępnij link",
|
||||
"common.view.modals.txtWidth": "Szerokość",
|
||||
|
@ -23,6 +24,7 @@
|
|||
"DE.ApplicationController.unsupportedBrowserErrorText": "Twoja przeglądarka nie jest wspierana.",
|
||||
"DE.ApplicationController.waitText": "Proszę czekać...",
|
||||
"DE.ApplicationView.txtDownload": "Pobierz",
|
||||
"DE.ApplicationView.txtEmbed": "Osadź",
|
||||
"DE.ApplicationView.txtFullScreen": "Pełny ekran",
|
||||
"DE.ApplicationView.txtPrint": "Drukuj",
|
||||
"DE.ApplicationView.txtShare": "Udostępnij"
|
||||
|
|
31
apps/documenteditor/embed/locale/ro.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Copiere cu clipbiard",
|
||||
"common.view.modals.txtEmbed": "Încorporare",
|
||||
"common.view.modals.txtHeight": "Înălțime",
|
||||
"common.view.modals.txtShare": "Partajare link",
|
||||
"common.view.modals.txtWidth": "Lățime",
|
||||
"DE.ApplicationController.convertationErrorText": "Conversia nu a reușit.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Timpul de așteptare pentru conversie a expirat.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Eroare",
|
||||
"DE.ApplicationController.downloadErrorText": "Descărcare eșuată.",
|
||||
"DE.ApplicationController.downloadTextText": "Descărcarea documentului...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Nu aveți dreptul să efectuați acțiunea pe care doriți.<br>Contactați administratorul dumneavoastră de Server Documente.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Codul de eroare: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Fișierul este protejat cu parolă și deaceea nu poate fi deschis.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Dimensiunea fișierului depășește limita permisă de serverul Dvs.<br>Pentru detalii, contactați administratorul dumneavoastră de Server Documente.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Conexiunea la Internet s-a restabilit și versiunea fișierului s-a schimbat.<br>Înainte de a continua, fișierul trebuie descărcat sau conținutul fișierului copiat ca să vă asigurați că nimic nu e pierdut, apoi reîmprospătați această pagină.",
|
||||
"DE.ApplicationController.errorUserDrop": "Fișierul nu poate fi accesat deocamdată.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Avertisment",
|
||||
"DE.ApplicationController.scriptLoadError": "Conexeunea e prea lentă și unele elemente nu se încarcă. Încercați să reîmprospătati pagina.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Încărcare document",
|
||||
"DE.ApplicationController.textOf": "din",
|
||||
"DE.ApplicationController.txtClose": "Închidere",
|
||||
"DE.ApplicationController.unknownErrorText": "Eroare Necunoscut.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Browserul nu este compatibil.",
|
||||
"DE.ApplicationController.waitText": "Vă rugăm să așteptați...",
|
||||
"DE.ApplicationView.txtDownload": "Descărcare",
|
||||
"DE.ApplicationView.txtEmbed": "Încorporare",
|
||||
"DE.ApplicationView.txtFullScreen": "Ecran complet",
|
||||
"DE.ApplicationView.txtPrint": "Imprimare",
|
||||
"DE.ApplicationView.txtShare": "Partajează"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Prenesi",
|
||||
"DE.ApplicationView.txtEmbed": "Vdelano",
|
||||
"DE.ApplicationView.txtFullScreen": "Celozaslonski",
|
||||
"DE.ApplicationView.txtPrint": "Natisni",
|
||||
"DE.ApplicationView.txtShare": "Deli"
|
||||
}
|
|
@ -13,18 +13,19 @@
|
|||
"DE.ApplicationController.errorDefaultMessage": "错误代码:%1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "该文档受密码保护,无法被打开。",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "文件大小超出了为服务器设置的限制.<br>有关详细信息,请与文档服务器管理员联系。",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "网连接已还原文件版本已更改。.<br>在继续工作之前,需要下载文件或复制其内容以确保没有丢失任何内容,然后重新加载此页。",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "网络连接已恢复,文件版本已变更。<br>在继续工作之前,需要下载文件或复制其内容以避免丢失数据,然后刷新此页。",
|
||||
"DE.ApplicationController.errorUserDrop": "该文件现在无法访问。",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "警告",
|
||||
"DE.ApplicationController.scriptLoadError": "连接速度过慢,部分组件无法被加载。请重新加载页面。",
|
||||
"DE.ApplicationController.textLoadingDocument": "文件加载中…",
|
||||
"DE.ApplicationController.textOf": "的",
|
||||
"DE.ApplicationController.txtClose": "关闭",
|
||||
"DE.ApplicationController.unknownErrorText": "示知错误",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "你的浏览器不支持",
|
||||
"DE.ApplicationController.unknownErrorText": "未知错误。",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "您的浏览器不受支持",
|
||||
"DE.ApplicationController.waitText": "请稍候...",
|
||||
"DE.ApplicationView.txtDownload": "下载",
|
||||
"DE.ApplicationView.txtEmbed": "嵌入",
|
||||
"DE.ApplicationView.txtFullScreen": "全屏",
|
||||
"DE.ApplicationView.txtPrint": "打印",
|
||||
"DE.ApplicationView.txtShare": "共享"
|
||||
}
|
|
@ -151,6 +151,7 @@ require([
|
|||
'Toolbar',
|
||||
'Statusbar',
|
||||
'Links',
|
||||
'FormsTab',
|
||||
'Navigation',
|
||||
'RightMenu',
|
||||
'LeftMenu',
|
||||
|
@ -176,6 +177,7 @@ require([
|
|||
'documenteditor/main/app/controller/DocumentHolder',
|
||||
'documenteditor/main/app/controller/Toolbar',
|
||||
'documenteditor/main/app/controller/Statusbar',
|
||||
'documenteditor/main/app/controller/FormsTab',
|
||||
'documenteditor/main/app/controller/Links',
|
||||
'documenteditor/main/app/controller/Navigation',
|
||||
'documenteditor/main/app/controller/RightMenu',
|
||||
|
|
254
apps/documenteditor/main/app/controller/FormsTab.js
Normal file
|
@ -0,0 +1,254 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2020
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* FormsTab.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 06.10.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/main/app/view/FormsTab'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.FormsTab = Backbone.Controller.extend(_.extend({
|
||||
models : [],
|
||||
collections : [
|
||||
],
|
||||
views : [
|
||||
'FormsTab'
|
||||
],
|
||||
sdkViewName : '#id_main',
|
||||
|
||||
initialize: function () {
|
||||
},
|
||||
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_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this));
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
|
||||
// this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
|
||||
// this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setConfig: function(config) {
|
||||
this.toolbar = config.toolbar;
|
||||
this.view = this.createView('FormsTab', {
|
||||
toolbar: this.toolbar.toolbar
|
||||
});
|
||||
this.addListeners({
|
||||
'FormsTab': {
|
||||
'forms:insert': this.onControlsSelect,
|
||||
'forms:new-color': this.onNewControlsColor,
|
||||
'forms:clear': this.onClearClick,
|
||||
'forms:no-color': this.onNoControlsColor,
|
||||
'forms:select-color': this.onSelectControlsColor,
|
||||
'forms:mode': this.onModeClick
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
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;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
var in_control = this.api.asc_IsContentControl();
|
||||
var control_props = in_control ? this.api.asc_GetContentControlProperties() : null,
|
||||
lock_type = (in_control&&control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
|
||||
control_plain = (in_control&&control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
|
||||
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
|
||||
var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
|
||||
var need_disable = (paragraph_locked || header_locked || control_plain || content_locked);
|
||||
if (this._state.prcontrolsdisable !== need_disable) {
|
||||
this.view.btnTextField.setDisabled(need_disable);
|
||||
this.view.btnComboBox.setDisabled(need_disable);
|
||||
this.view.btnDropDown.setDisabled(need_disable);
|
||||
this.view.btnCheckBox.setDisabled(need_disable);
|
||||
this.view.btnRadioBox.setDisabled(need_disable);
|
||||
this.view.btnImageField.setDisabled(need_disable);
|
||||
this.view.btnTextField.setDisabled(need_disable);
|
||||
this._state.prcontrolsdisable = need_disable;
|
||||
}
|
||||
},
|
||||
|
||||
onChangeSpecialFormsGlobalSettings: function() {
|
||||
if (this.view && this.view.mnuFormsColorPicker) {
|
||||
var clr = this.api.asc_GetSpecialFormsHighlightColor(),
|
||||
show = !!clr;
|
||||
this.view.mnuNoFormsColor.setChecked(!show, true);
|
||||
this.view.mnuFormsColorPicker.clearSelection();
|
||||
if (clr) {
|
||||
clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
|
||||
this.view.mnuFormsColorPicker.selectByRGB(clr, true);
|
||||
}
|
||||
this.view.btnHighlight.currentColor = clr;
|
||||
$('.btn-color-value-line', this.view.btnHighlight.cmpEl).css('background-color', clr ? '#' + clr : 'transparent');
|
||||
}
|
||||
},
|
||||
|
||||
onControlsSelect: function(type) {
|
||||
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl && this.toolbar.mode.canFeatureForms)) return;
|
||||
|
||||
var oPr,
|
||||
oFormPr = new AscCommon.CSdtFormPr();
|
||||
this.toolbar.toolbar.fireEvent('insertcontrol', this.toolbar.toolbar);
|
||||
if (type == 'picture')
|
||||
this.api.asc_AddContentControlPicture(oFormPr);
|
||||
else if (type == 'checkbox' || type == 'radiobox') {
|
||||
oPr = new AscCommon.CSdtCheckBoxPr();
|
||||
(type == 'radiobox') && oPr.put_GroupKey('Group 1');
|
||||
this.api.asc_AddContentControlCheckBox(oPr, oFormPr);
|
||||
} else if (type == 'combobox' || type == 'dropdown')
|
||||
this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr);
|
||||
else if (type == 'text') {
|
||||
oPr = new AscCommon.CSdtTextFormPr();
|
||||
this.api.asc_AddContentControlTextForm(oPr, oFormPr);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onModeClick: function(state) {
|
||||
if (this.api) {
|
||||
this.disableEditing(state);
|
||||
this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None);
|
||||
this.api.asc_SetPerformContentControlActionByClick(state);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onClearClick: function() {
|
||||
if (this.api) {
|
||||
this.api.asc_ClearAllSpecialForms();
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onNewControlsColor: function() {
|
||||
this.view.mnuFormsColorPicker.addNewColor();
|
||||
},
|
||||
|
||||
onNoControlsColor: function(item) {
|
||||
if (!item.isChecked())
|
||||
this.api.asc_SetSpecialFormsHighlightColor(255, 192, 0);
|
||||
else
|
||||
this.api.asc_SetSpecialFormsHighlightColor();
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onSelectControlsColor: function(color) {
|
||||
var clr = Common.Utils.ThemeColor.getRgbColor(color);
|
||||
if (this.api) {
|
||||
this.api.asc_SetSpecialFormsHighlightColor(clr.get_r(), clr.get_g(), clr.get_b());
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
disableEditing: function(disable) {
|
||||
if (this._state.DisabledEditing != disable) {
|
||||
this._state.DisabledEditing = disable;
|
||||
|
||||
var app = this.getApplication();
|
||||
var rightMenuController = app.getController('RightMenu');
|
||||
rightMenuController.getView('RightMenu').clearSelection();
|
||||
rightMenuController.SetDisabled(disable);
|
||||
app.getController('Toolbar').DisableToolbar(disable, false, false, true);
|
||||
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
||||
app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
|
||||
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
||||
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
|
||||
app.getController('LeftMenu').setPreviewMode(disable);
|
||||
var comments = app.getController('Common.Controllers.Comments');
|
||||
if (comments)
|
||||
comments.setPreviewMode(disable);
|
||||
if (this.view)
|
||||
this.view.$el.find('.no-group-mask.form-view').css('opacity', 1);
|
||||
}
|
||||
},
|
||||
|
||||
onAppReady: function (config) {
|
||||
var me = this;
|
||||
(new Promise(function (accept, reject) {
|
||||
accept();
|
||||
})).then(function(){
|
||||
if (config.canEditContentControl) {
|
||||
var clr = me.api.asc_GetSpecialFormsHighlightColor();
|
||||
clr && (clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b()));
|
||||
me.view.btnHighlight.currentColor = clr;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}, DE.Controllers.FormsTab || {}));
|
||||
});
|
|
@ -206,7 +206,7 @@ define([
|
|||
|
||||
this.leftMenu.setOptionsPanel('navigation', this.getApplication().getController('Navigation').getView('Navigation'));
|
||||
|
||||
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
|
||||
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
|
||||
|
||||
Common.util.Shortcuts.resumeEvents();
|
||||
return this;
|
||||
|
@ -218,7 +218,7 @@ define([
|
|||
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
|
||||
} else
|
||||
this.leftMenu.btnPlugins.hide();
|
||||
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
|
||||
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
|
||||
},
|
||||
|
||||
clickMenuFileItem: function(menu, action, isopts) {
|
||||
|
|
|
@ -48,7 +48,8 @@ define([
|
|||
'documenteditor/main/app/view/BookmarksDialog',
|
||||
'documenteditor/main/app/view/CaptionDialog',
|
||||
'documenteditor/main/app/view/NotesRemoveDialog',
|
||||
'documenteditor/main/app/view/CrossReferenceDialog'
|
||||
'documenteditor/main/app/view/CrossReferenceDialog',
|
||||
'common/main/lib/view/OptionsDialog'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
|
@ -71,7 +72,9 @@ define([
|
|||
'links:hyperlink': this.onHyperlinkClick,
|
||||
'links:bookmarks': this.onBookmarksClick,
|
||||
'links:caption': this.onCaptionClick,
|
||||
'links:crossref': this.onCrossRefClick
|
||||
'links:crossref': this.onCrossRefClick,
|
||||
'links:tof': this.onTableFigures,
|
||||
'links:tof-update': this.onTableFiguresUpdate
|
||||
},
|
||||
'DocumentHolder': {
|
||||
'links:contents': this.onTableContents,
|
||||
|
@ -98,6 +101,8 @@ define([
|
|||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
|
||||
this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
|
||||
this.api.asc_registerCallback('asc_onAscReplaceCurrentTOF',_.bind(this.onAscReplaceCurrentTOF, this));
|
||||
this.api.asc_registerCallback('asc_onAscTOFUpdate',_.bind(this.onAscTOFUpdate, this));
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
@ -173,6 +178,8 @@ define([
|
|||
|
||||
need_disable = in_header || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock;
|
||||
this.view.btnsContents.setDisabled(need_disable);
|
||||
this.view.btnTableFigures.setDisabled(need_disable);
|
||||
this.view.btnTableFiguresUpdate.setDisabled(need_disable || paragraph_locked || !this.api.asc_CanUpdateTablesOfFigures());
|
||||
|
||||
need_disable = in_header;
|
||||
this.view.btnCaption.setDisabled(need_disable);
|
||||
|
@ -269,6 +276,7 @@ define([
|
|||
win = new DE.Views.TableOfContentsSettings({
|
||||
api: this.api,
|
||||
props: props,
|
||||
type: 0,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
(props) ? me.api.asc_SetTableOfContentsPr(value) : me.api.asc_AddTableOfContents(null, value);
|
||||
|
@ -476,6 +484,61 @@ define([
|
|||
me.crossRefProps = me.dlgCrossRefDialog.getSettings();
|
||||
});
|
||||
me.dlgCrossRefDialog.show();
|
||||
},
|
||||
|
||||
onTableFigures: function(){
|
||||
var props = this.api.asc_GetTableOfFiguresPr();
|
||||
var me = this,
|
||||
win = new DE.Views.TableOfContentsSettings({
|
||||
api: this.api,
|
||||
props: props,
|
||||
type: 1,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
me.api.asc_AddTableOfFigures(value);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onTableFiguresUpdate: function(){
|
||||
this.api.asc_UpdateTablesOfFigures();
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
},
|
||||
|
||||
onAscReplaceCurrentTOF: function(apiCallback) {
|
||||
Common.UI.warning({
|
||||
msg: this.view.confirmReplaceTOF,
|
||||
buttons: ['yes', 'no', 'cancel'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (btn=='yes' || btn=='no') {
|
||||
apiCallback && apiCallback(btn === 'yes');
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
}, this)
|
||||
});
|
||||
},
|
||||
|
||||
onAscTOFUpdate: function(apiCallback) {
|
||||
var me = this;
|
||||
(new Common.Views.OptionsDialog({
|
||||
width: 300,
|
||||
title: this.view.titleUpdateTOF,
|
||||
items: [
|
||||
{caption: this.view.textUpdatePages, value: true, checked: true},
|
||||
{caption: this.view.textUpdateAll, value: false, checked: false}
|
||||
],
|
||||
handler: function (dlg, result) {
|
||||
if (result=='ok') {
|
||||
apiCallback && apiCallback(dlg.getSettings());
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
}
|
||||
|
||||
}, DE.Controllers.Links || {}));
|
||||
|
|
|
@ -170,6 +170,8 @@ define([
|
|||
window["flat_desine"] = true;
|
||||
this.api = this.getApplication().getController('Viewport').getApi();
|
||||
|
||||
Common.UI.FocusManager.init();
|
||||
|
||||
if (this.api){
|
||||
this.api.SetDrawingFreeze(true);
|
||||
|
||||
|
@ -369,6 +371,7 @@ define([
|
|||
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
||||
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
|
||||
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
|
||||
this.appOptions.canFeatureForms = false; // hide in 6.2
|
||||
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
|
||||
|
||||
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
||||
|
@ -545,6 +548,7 @@ define([
|
|||
} else {
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
appHeader.setCanRename(false);
|
||||
appHeader.getButton('users') && appHeader.getButton('users').hide();
|
||||
this.getApplication().getController('LeftMenu').getView('LeftMenu').showHistory();
|
||||
this.disableEditing(true);
|
||||
var versions = opts.data.history,
|
||||
|
@ -1000,6 +1004,7 @@ define([
|
|||
me.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None);
|
||||
}
|
||||
Common.Utils.InternalSettings.set("de-settings-coauthmode", me._state.fastCoauth);
|
||||
me.api.asc_SetPerformContentControlActionByClick(me.appOptions.isRestrictedEdit && me.appOptions.canFillForms);
|
||||
|
||||
/** coauthoring end **/
|
||||
|
||||
|
@ -1244,6 +1249,7 @@ define([
|
|||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||
this.appOptions.isBeta = params.asc_getIsBeta();
|
||||
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
||||
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
|
||||
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
|
||||
|
@ -1368,6 +1374,7 @@ define([
|
|||
toolbarView.on('insertshape', _.bind(me.onInsertShape, me));
|
||||
toolbarView.on('inserttextart', _.bind(me.onInsertTextArt, me));
|
||||
toolbarView.on('insertchart', _.bind(me.onInsertChart, me));
|
||||
toolbarView.on('insertcontrol', _.bind(me.onInsertControl, me));
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem('de-settings-unit');
|
||||
|
@ -2044,6 +2051,10 @@ define([
|
|||
this.getApplication().getController('RightMenu').onInsertTextArt();
|
||||
},
|
||||
|
||||
onInsertControl: function() {
|
||||
this.getApplication().getController('RightMenu').onInsertControl();
|
||||
},
|
||||
|
||||
unitsChanged: function(m) {
|
||||
var value = Common.localStorage.getItem("de-settings-unit");
|
||||
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
|
||||
|
@ -2265,7 +2276,7 @@ define([
|
|||
var _disable_ui = function (disable) {
|
||||
me.disableEditing(disable);
|
||||
var app = me.getApplication();
|
||||
app.getController('DocumentHolder').getView().SetDisabled(disable, true);
|
||||
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
||||
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
|
||||
|
||||
var leftMenu = app.getController('LeftMenu');
|
||||
|
|
|
@ -60,6 +60,8 @@ define([
|
|||
'rightmenuclick': this.onRightMenuClick
|
||||
}
|
||||
});
|
||||
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-form", 1);
|
||||
},
|
||||
|
||||
onLaunch: function() {
|
||||
|
@ -81,6 +83,7 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
|
||||
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false};
|
||||
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: 1, props: {}, locked: false};
|
||||
this._settings[Common.Utils.documentSettingsType.Form] = {panelId: "id-form-settings", panel: rightMenu.formSettings, btn: rightMenu.btnForm, hidden: 1, props: {}, locked: false};
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
|
@ -94,8 +97,29 @@ define([
|
|||
this.editMode = mode.isEdit;
|
||||
},
|
||||
|
||||
onRightMenuClick: function(menu, type, minimized) {
|
||||
onRightMenuClick: function(menu, type, minimized, event) {
|
||||
if (!minimized && this.editMode) {
|
||||
if (event) { // user click event
|
||||
if (!this._settings[Common.Utils.documentSettingsType.Form].hidden) {
|
||||
if (type == Common.Utils.documentSettingsType.Form) {
|
||||
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden)
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 0);
|
||||
if (!this._settings[Common.Utils.documentSettingsType.Image].hidden)
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
|
||||
if (!this._settings[Common.Utils.documentSettingsType.Shape].hidden)
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
|
||||
} else if (type == Common.Utils.documentSettingsType.Paragraph) {
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 2);
|
||||
} else if (type == Common.Utils.documentSettingsType.Image) {
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 2);
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
|
||||
} else if (type == Common.Utils.documentSettingsType.Shape) {
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 2);
|
||||
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var panel = this._settings[type].panel;
|
||||
var props = this._settings[type].props;
|
||||
if (props && panel)
|
||||
|
@ -128,6 +152,8 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.Signature].locked = false;
|
||||
|
||||
var isChart = false;
|
||||
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
|
||||
control_lock = false;
|
||||
for (i=0; i<SelectedObjects.length; i++)
|
||||
{
|
||||
var content_locked = false;
|
||||
|
@ -141,8 +167,7 @@ define([
|
|||
|
||||
var value = SelectedObjects[i].get_ObjectValue();
|
||||
if (settingsType == Common.Utils.documentSettingsType.Image) {
|
||||
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
|
||||
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
|
||||
var lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
|
||||
content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
|
||||
|
||||
if (value.get_ChartProperties() !== null) {
|
||||
|
@ -157,9 +182,11 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.TextArt].locked = value.get_Locked() || content_locked;
|
||||
}
|
||||
}
|
||||
control_lock = control_lock || value.get_Locked();
|
||||
} else if (settingsType == Common.Utils.documentSettingsType.Paragraph) {
|
||||
this._settings[settingsType].panel.isChart = isChart;
|
||||
can_add_table = value.get_CanAddTable();
|
||||
control_lock = control_lock || value.get_Locked();
|
||||
}
|
||||
this._settings[settingsType].props = value;
|
||||
this._settings[settingsType].hidden = 0;
|
||||
|
@ -170,6 +197,17 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.Signature].locked = value.get_Locked();
|
||||
}
|
||||
|
||||
if (control_props && control_props.get_FormPr() && this.rightmenu.formSettings) {
|
||||
var spectype = control_props.get_SpecificType();
|
||||
if (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
|
||||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) {
|
||||
settingsType = Common.Utils.documentSettingsType.Form;
|
||||
this._settings[settingsType].props = control_props;
|
||||
this._settings[settingsType].locked = control_lock;
|
||||
this._settings[settingsType].hidden = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( this._settings[Common.Utils.documentSettingsType.Header].locked ) { // если находимся в locked header/footer, то считаем, что все элементы в нем тоже недоступны
|
||||
for (i=0; i<this._settings.length; i++) {
|
||||
if (this._settings[i])
|
||||
|
@ -208,6 +246,26 @@ define([
|
|||
if (!this.rightmenu.minimizedMode || open) {
|
||||
var active;
|
||||
|
||||
if (priorityactive<0 && !this._settings[Common.Utils.documentSettingsType.Form].hidden &&
|
||||
(!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden || !this._settings[Common.Utils.documentSettingsType.Image].hidden
|
||||
|| !this._settings[Common.Utils.documentSettingsType.Shape].hidden)) {
|
||||
var imageactive = Common.Utils.InternalSettings.get("de-rightpanel-active-image") || 0,
|
||||
shapeactive = Common.Utils.InternalSettings.get("de-rightpanel-active-shape") || 0,
|
||||
paraactive = Common.Utils.InternalSettings.get("de-rightpanel-active-para") || 0,
|
||||
formactive = Common.Utils.InternalSettings.get("de-rightpanel-active-form") || 0;
|
||||
|
||||
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden) {
|
||||
priorityactive = (formactive>paraactive) ? Common.Utils.documentSettingsType.Form : Common.Utils.documentSettingsType.Paragraph;
|
||||
} else if (!this._settings[Common.Utils.documentSettingsType.Paragraph].Image || !this._settings[Common.Utils.documentSettingsType.Shape].hidden) {
|
||||
if (formactive>shapeactive && formactive>imageactive)
|
||||
priorityactive = Common.Utils.documentSettingsType.Form;
|
||||
else if (shapeactive>formactive && shapeactive>imageactive)
|
||||
priorityactive = Common.Utils.documentSettingsType.Shape;
|
||||
else
|
||||
priorityactive = Common.Utils.documentSettingsType.Image;
|
||||
}
|
||||
}
|
||||
|
||||
if (priorityactive>-1) active = priorityactive;
|
||||
else if (lastactive>=0 && currentactive<0) active = lastactive;
|
||||
else if (currentactive>=0) active = currentactive;
|
||||
|
@ -253,6 +311,11 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.TextArt].needShow = true;
|
||||
},
|
||||
|
||||
onInsertControl: function() {
|
||||
if (this._settings[Common.Utils.documentSettingsType.Form])
|
||||
this._settings[Common.Utils.documentSettingsType.Form].needShow = true;
|
||||
},
|
||||
|
||||
UpdateThemeColors: function() {
|
||||
this.rightmenu.paragraphSettings.UpdateThemeColors();
|
||||
this.rightmenu.tableSettings.UpdateThemeColors();
|
||||
|
@ -266,6 +329,7 @@ define([
|
|||
this.rightmenu.chartSettings.updateMetricUnit();
|
||||
this.rightmenu.imageSettings.updateMetricUnit();
|
||||
this.rightmenu.tableSettings.updateMetricUnit();
|
||||
this.rightmenu.formSettings && this.rightmenu.formSettings.updateMetricUnit();
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
|
@ -351,6 +415,7 @@ define([
|
|||
this.rightmenu.headerSettings.disableControls(disabled);
|
||||
this.rightmenu.tableSettings.disableControls(disabled);
|
||||
this.rightmenu.imageSettings.disableControls(disabled);
|
||||
this.rightmenu.formSettings && this.rightmenu.formSettings.disableControls(disabled);
|
||||
if (!allowMerge && this.rightmenu.mergeSettings) {
|
||||
this.rightmenu.mergeSettings.disableControls(disabled);
|
||||
disabled && this.rightmenu.btnMailMerge.setDisabled(disabled);
|
||||
|
@ -369,6 +434,7 @@ define([
|
|||
this.rightmenu.btnShape.setDisabled(disabled);
|
||||
this.rightmenu.btnTextArt.setDisabled(disabled);
|
||||
this.rightmenu.btnChart.setDisabled(disabled);
|
||||
this.rightmenu.btnForm && this.rightmenu.btnForm.setDisabled(disabled);
|
||||
} else {
|
||||
var selectedElements = this.api.getSelectedElements();
|
||||
if (selectedElements.length > 0)
|
||||
|
|
|
@ -143,7 +143,8 @@ define([
|
|||
}
|
||||
}
|
||||
|
||||
if ( config.isReviewOnly || Common.localStorage.getBool("de-track-changes-" + (config.fileKey || ''))) {
|
||||
var trackChanges = typeof (config.customization) == 'object' ? config.customization.trackChanges : undefined;
|
||||
if ( config.isReviewOnly || trackChanges===true || (trackChanges!==false) && Common.localStorage.getBool("de-track-changes-" + (config.fileKey || ''))) {
|
||||
_process_changestip();
|
||||
} else if ( me.api.asc_IsTrackRevisions() ) {
|
||||
var showNewChangesTip = !Common.localStorage.getBool("de-new-changes");
|
||||
|
|
|
@ -58,7 +58,6 @@ define([
|
|||
'documenteditor/main/app/view/CustomColumnsDialog',
|
||||
'documenteditor/main/app/view/ControlSettingsDialog',
|
||||
'documenteditor/main/app/view/WatermarkSettingsDialog',
|
||||
'documenteditor/main/app/view/CompareSettingsDialog',
|
||||
'documenteditor/main/app/view/ListSettingsDialog',
|
||||
'documenteditor/main/app/view/DateTimeDialog',
|
||||
'documenteditor/main/app/view/LineNumbersDialog'
|
||||
|
@ -791,11 +790,12 @@ define([
|
|||
|
||||
toolbar.btnContentControls.setDisabled(paragraph_locked || header_locked);
|
||||
if (!(paragraph_locked || header_locked)) {
|
||||
var control_disable = control_plain || content_locked;
|
||||
var control_disable = control_plain || content_locked,
|
||||
if_form = control_props && control_props.get_FormPr();
|
||||
for (var i=0; i<7; i++)
|
||||
toolbar.btnContentControls.menu.items[i].setDisabled(control_disable);
|
||||
toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
||||
toolbar.btnContentControls.menu.items[10].setDisabled(!in_control);
|
||||
toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked || if_form);
|
||||
toolbar.btnContentControls.menu.items[10].setDisabled(!in_control || if_form);
|
||||
}
|
||||
|
||||
var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock;
|
||||
|
@ -1015,13 +1015,13 @@ define([
|
|||
|
||||
onChangeSdtGlobalSettings: function() {
|
||||
var show = this.api.asc_GetGlobalContentControlShowHighlight();
|
||||
this.toolbar.mnuNoControlsColor.setChecked(!show, true);
|
||||
this.toolbar.mnuControlsColorPicker.clearSelection();
|
||||
this.toolbar.mnuNoControlsColor && this.toolbar.mnuNoControlsColor.setChecked(!show, true);
|
||||
this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.clearSelection();
|
||||
if (show){
|
||||
var clr = this.api.asc_GetGlobalContentControlHighlightColor();
|
||||
if (clr) {
|
||||
clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
|
||||
this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
|
||||
this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1321,8 +1321,8 @@ define([
|
|||
}
|
||||
} else {
|
||||
value = Common.Utils.String.parseFloat(record.value);
|
||||
value = value > 100
|
||||
? 100
|
||||
value = value > 300
|
||||
? 300
|
||||
: value < 1
|
||||
? 1
|
||||
: Math.floor((value+0.4)*2)/2;
|
||||
|
@ -1907,6 +1907,7 @@ define([
|
|||
oPr, oFormPr;
|
||||
if (isnew) {
|
||||
oFormPr = new AscCommon.CSdtFormPr();
|
||||
this.toolbar.fireEvent('insertcontrol', this.toolbar);
|
||||
}
|
||||
if (item.value == 'plain' || item.value == 'rich')
|
||||
this.api.asc_AddContentControl((item.value=='plain') ? Asc.c_oAscSdtLevelType.Inline : Asc.c_oAscSdtLevelType.Block);
|
||||
|
@ -2659,7 +2660,8 @@ define([
|
|||
if (this.dlgSymbolTable && this.dlgSymbolTable.isVisible()) return;
|
||||
|
||||
if (this.api) {
|
||||
var me = this;
|
||||
var me = this,
|
||||
selected = me.api.asc_GetSelectedText();
|
||||
me.dlgSymbolTable = new Common.Views.SymbolTableDialog({
|
||||
api: me.api,
|
||||
lang: me.mode.lang,
|
||||
|
@ -2667,6 +2669,8 @@ define([
|
|||
type: 1,
|
||||
special: true,
|
||||
showShortcutKey: true,
|
||||
font: selected && selected.length>0 ? this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name() : undefined,
|
||||
symbol: selected && selected.length>0 ? selected.charAt(0) : undefined,
|
||||
buttons: [{value: 'ok', caption: this.textInsert}, 'close'],
|
||||
handler: function(dlg, result, settings) {
|
||||
if (result == 'ok') {
|
||||
|
@ -2857,9 +2861,6 @@ define([
|
|||
this.onParagraphColor(this._state.clrshd_asccolor);
|
||||
}
|
||||
this._state.clrshd_asccolor = undefined;
|
||||
|
||||
updateColors(this.toolbar.mnuControlsColorPicker, 1);
|
||||
this.onChangeSdtGlobalSettings();
|
||||
},
|
||||
|
||||
_onInitEditorStyles: function(styles) {
|
||||
|
@ -2966,27 +2967,36 @@ define([
|
|||
this.DisableToolbar(true, true);
|
||||
},
|
||||
|
||||
DisableToolbar: function(disable, viewMode, reviewmode) {
|
||||
DisableToolbar: function(disable, viewMode, reviewmode, fillformmode) {
|
||||
if (viewMode!==undefined) this.editMode = !viewMode;
|
||||
disable = disable || !this.editMode;
|
||||
|
||||
var toolbar_mask = $('.toolbar-mask'),
|
||||
group_mask = $('.toolbar-group-mask'),
|
||||
mask = reviewmode ? group_mask : toolbar_mask;
|
||||
mask = (reviewmode || fillformmode) ? group_mask : toolbar_mask;
|
||||
if (disable && mask.length>0 || !disable && mask.length==0) return;
|
||||
|
||||
var toolbar = this.toolbar;
|
||||
if(disable) {
|
||||
if (reviewmode) {
|
||||
mask = $("<div class='toolbar-group-mask'>").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask)'));
|
||||
mask = $("<div class='toolbar-group-mask'>").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask.review)'));
|
||||
} else if (fillformmode) {
|
||||
mask = $("<div class='toolbar-group-mask'>").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask.form-view)'));
|
||||
} else
|
||||
mask = $("<div class='toolbar-mask'>").appendTo(toolbar.$el.find('.toolbar'));
|
||||
} else {
|
||||
mask.remove();
|
||||
}
|
||||
$('.no-group-mask').css('opacity', (reviewmode || !disable) ? 1 : 0.4);
|
||||
$('.no-group-mask').each(function(index, item){
|
||||
var $el = $(item);
|
||||
if ($el.find('.toolbar-group-mask').length>0)
|
||||
$el.css('opacity', 0.4);
|
||||
else {
|
||||
$el.css('opacity', reviewmode || fillformmode || !disable ? 1 : 0.4);
|
||||
}
|
||||
});
|
||||
|
||||
disable = disable || (reviewmode ? toolbar_mask.length>0 : group_mask.length>0);
|
||||
disable = disable || ((reviewmode || fillformmode) ? toolbar_mask.length>0 : group_mask.length>0);
|
||||
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
||||
if ( toolbar.synchTooltip )
|
||||
toolbar.synchTooltip.hide();
|
||||
|
@ -3052,7 +3062,7 @@ define([
|
|||
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
||||
var $panel = me.application.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||
if ( $panel )
|
||||
me.toolbar.addTab(tab, $panel, 4);
|
||||
me.toolbar.addTab(tab, $panel, 5);
|
||||
|
||||
if ( config.isEdit ) {
|
||||
me.toolbar.setMode(config);
|
||||
|
@ -3076,13 +3086,25 @@ define([
|
|||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||
|
||||
if ($panel) me.toolbar.addTab(tab, $panel, 5);
|
||||
if ($panel) me.toolbar.addTab(tab, $panel, 6);
|
||||
}
|
||||
}
|
||||
|
||||
var links = me.getApplication().getController('Links');
|
||||
links.setApi(me.api).setConfig({toolbar: me});
|
||||
Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons());
|
||||
|
||||
if (config.canFeatureContentControl) {
|
||||
if (config.canFeatureForms) {
|
||||
tab = {caption: me.textTabForms, action: 'forms'};
|
||||
var forms = me.getApplication().getController('FormsTab');
|
||||
forms.setApi(me.api).setConfig({toolbar: me});
|
||||
me.toolbar.addTab(tab, $panel, 4);
|
||||
me.toolbar.setVisible('forms', true);
|
||||
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
|
||||
}
|
||||
me.onChangeSdtGlobalSettings();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3158,7 +3180,7 @@ define([
|
|||
|
||||
textEmptyImgUrl : 'You need to specify image URL.',
|
||||
textWarning : 'Warning',
|
||||
textFontSizeErr : 'The entered value is incorrect.<br>Please enter a numeric value between 1 and 100',
|
||||
textFontSizeErr : 'The entered value is incorrect.<br>Please enter a numeric value between 1 and 300',
|
||||
textSymbols : 'Symbols',
|
||||
textFraction : 'Fraction',
|
||||
textScript : 'Script',
|
||||
|
@ -3504,7 +3526,8 @@ define([
|
|||
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',
|
||||
textInsert: 'Insert'
|
||||
textInsert: 'Insert',
|
||||
textTabForms: 'Forms'
|
||||
|
||||
}, DE.Controllers.Toolbar || {}));
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<button type="button" class="btn btn-text-default" id="chart-button-edit-data" style="width:115px;"><%= scope.textEditData %></button>
|
||||
<button type="button" class="btn btn-text-default auto" id="chart-button-edit-data" style="min-width:115px;"><%= scope.textEditData %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
108
apps/documenteditor/main/app/template/FormSettings.template
Normal file
|
@ -0,0 +1,108 @@
|
|||
<table cols="1">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="header padding-small" id="form-settings-name"><%= scope.textField %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-keyfield">
|
||||
<td class="padding-small">
|
||||
<label class="input-label"><%= scope.textKey %></label>
|
||||
<div id="form-combo-key" style="width: 100%;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-connected">
|
||||
<td class="padding-small">
|
||||
<label style="opacity: 0.5; margin-right: 5px;" id="form-settings-connected"><%= scope.textConnected %></label>
|
||||
<label class="link-solid" id="form-settings-disconnect"><%= scope.textDisconnect %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-radiobox">
|
||||
<td class="padding-small">
|
||||
<label class="input-label"><%= scope.textGroupKey %></label>
|
||||
<div id="form-combo-group-key" style="width: 100%;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-placeholder">
|
||||
<td class="padding-small">
|
||||
<label class="input-label"><%= scope.textPlaceholder %></label>
|
||||
<div id="form-txt-pholder"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-large">
|
||||
<label class="input-label"><%= scope.textTip %></label>
|
||||
<div id="form-txt-help"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-textfield">
|
||||
<td class="padding-small">
|
||||
<div id="form-chb-max-chars" style="display: inline-block;margin-top: 4px;"></div>
|
||||
<div id="form-spin-max-chars" style="display: inline-block;float: right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-textfield">
|
||||
<td class="padding-small">
|
||||
<div id="form-chb-comb"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-textfield">
|
||||
<td class="padding-small">
|
||||
<label class="input-label" style="margin-left: 22px;margin-top: 4px;"><%= scope.textWidth %></label>
|
||||
<div id="form-spin-width" style="display: inline-block; float: right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-textfield">
|
||||
<td class="padding-large">
|
||||
<label class="input-label" style="margin-left: 22px;margin-top: 4px;"><%= scope.textColor %></label>
|
||||
<div id="form-color-btn" style="display: inline-block; float: right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-image">
|
||||
<td class="padding-large">
|
||||
<div id="form-button-replace" style="width:100%;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cols="2" class="form-list">
|
||||
<tr>
|
||||
<td colspan="2" class="padding-small">
|
||||
<label class="input-label"><%= scope.textValue %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td class="padding-small">
|
||||
<div id="form-txt-new-value" style="margin-right: 5px;"></div>
|
||||
</td>
|
||||
<td class="padding-small">
|
||||
<div id="form-list-add" style="margin-left: 5px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td class="padding-large">
|
||||
<div id="form-list-list" style="width:162px; height: 95px;margin-right: 5px;background-color: #fff;"></div>
|
||||
</td>
|
||||
<td class="padding-large">
|
||||
<div id="form-list-delete" style="margin-bottom: 5px;margin-left: 5px;"></div>
|
||||
<div id="form-list-up" style="margin-bottom: 5px;margin-left: 5px;"></div>
|
||||
<div id="form-list-down" style="margin-left: 5px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cols="1">
|
||||
<tr>
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small">
|
||||
<div id="form-btn-delete"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small">
|
||||
<div id="form-btn-lock"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="finish-cell"></tr>
|
||||
</table>
|
|
@ -20,7 +20,7 @@
|
|||
<label class="input-label"><%= scope.strIndentsRightText %></label>
|
||||
<div id="paragraphadv-spin-indent-right"></div>
|
||||
</div><!--
|
||||
--><div class="padding-large" style="display: inline-block;">
|
||||
--><div class="padding-large" style="display: inline-block;vertical-align: top">
|
||||
<div>
|
||||
<label class="input-label"><%= scope.strIndentsSpecial %></label>
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<label class="input-label"><%= scope.strIndentsSpacingAfter %></label>
|
||||
<div id="paragraphadv-spin-spacing-after"></div>
|
||||
</div><!--
|
||||
--><div style="display: inline-block;">
|
||||
--><div style="display: inline-block;vertical-align: top">
|
||||
<div>
|
||||
<label class="input-label"><%= scope.strIndentsLineSpacing %></label>
|
||||
</div>
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
</div>
|
||||
<div id="id-signature-settings" class="settings-panel">
|
||||
</div>
|
||||
<div id="id-form-settings" class="settings-panel">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tool-menu-btns">
|
||||
<div class="ct-btn-category arrow-left"></div>
|
||||
|
@ -30,5 +32,6 @@
|
|||
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon toolbar__icon btn-menu-textart"> </i></button>
|
||||
<button id="id-right-menu-mail-merge" class="btn btn-category arrow-left hidden" content-target="id-mail-merge-settings"><i class="icon toolbar__icon btn-mailmerge"> </i></button>
|
||||
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon toolbar__icon btn-menu-signature"> </i></button>
|
||||
<button id="id-right-menu-form" class="btn btn-category arrow-left hidden" content-target="id-form-settings"><i class="icon toolbar__icon btn-field"> </i></button>
|
||||
</div>
|
||||
</div>
|
|
@ -158,9 +158,43 @@
|
|||
<div class="group">
|
||||
<span class="btn-slot text x-huge slot-inshyperlink"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-bookmarks"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-caption"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-crossref"></span>
|
||||
</div>
|
||||
<div class="group sheet-views" style="padding-left: 5px;">
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="slot-btn-tof"></span>
|
||||
</div>
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="slot-btn-tof-update"></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel" data-tab="forms">
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-field"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-combobox"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-dropdown"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-checkbox"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-radiobox"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-image"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group no-group-mask form-view">
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="slot-form-clear-fields"></span>
|
||||
</div>
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="slot-form-highlight"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group no-group-mask form-view">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-form-view"></span>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -173,6 +173,7 @@ define([
|
|||
this.bookmarksList = new Common.UI.ListView({
|
||||
el: $('#bookmarks-list', this.$window),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
tabindex: 1,
|
||||
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;"><%= value %></div>')
|
||||
});
|
||||
this.bookmarksList.store.comparator = function(rec) {
|
||||
|
@ -247,6 +248,10 @@ define([
|
|||
this.afterRender();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.txtName, {cmp: this.bookmarksList, selector: '.listview'}];
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this._setDefaults(this.props);
|
||||
var me = this;
|
||||
|
@ -351,6 +356,7 @@ define([
|
|||
var rec = this.bookmarksList.store.findWhere({value: this.txtName.getValue()});
|
||||
this.bookmarksList.selectRecord(rec);
|
||||
this.bookmarksList.scrollToRecord(rec);
|
||||
this.txtName.focus();
|
||||
},
|
||||
|
||||
onDblClickBookmark: function(listView, itemView, record) {
|
||||
|
|
|
@ -152,6 +152,7 @@ define([
|
|||
menuStyle: 'min-width: 75px;',
|
||||
editable: false,
|
||||
disabled: !this.isObject,
|
||||
takeFocusOnClose: true,
|
||||
data: [
|
||||
{ displayValue: this.textBefore, value: 1 },
|
||||
{ displayValue: this.textAfter, value: 0 }
|
||||
|
@ -180,6 +181,7 @@ define([
|
|||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 160px;max-height:155px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
data: this.arrLabel,
|
||||
alwaysVisibleY: true
|
||||
});
|
||||
|
@ -264,6 +266,7 @@ define([
|
|||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 160px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
data: [
|
||||
{ displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 },
|
||||
{ displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' },
|
||||
|
@ -305,6 +308,7 @@ define([
|
|||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 160px;max-height:135px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
disabled: true,
|
||||
data: this._arrLevel
|
||||
});
|
||||
|
@ -320,6 +324,7 @@ define([
|
|||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 160px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
disabled: true,
|
||||
data: [
|
||||
{ displayValue: '- (' + this.textHyphen + ')', value: '-' },
|
||||
|
@ -341,12 +346,16 @@ define([
|
|||
this.afterRender();
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this._setDefaults(this.props);
|
||||
getFocusedComponents: function() {
|
||||
return [this.txtCaption, this.cmbPosition, this.cmbLabel, this.cmbNumbering, this.cmbChapter, this.cmbSeparator];
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.txtCaption;
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this._setDefaults(this.props);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
|
|
|
@ -85,6 +85,7 @@ define([
|
|||
style: 'width: 110px;',
|
||||
menuStyle: 'min-width: 110px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
scrollAlwaysVisible: true,
|
||||
data: [
|
||||
{ value: 0, displayValue: this.textRow},
|
||||
|
@ -128,6 +129,14 @@ define([
|
|||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.cmbRowCol, this.spnCount];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.spnCount;
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, state, this.getSettings());
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* CellsRemoveDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 05.09.2019
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/RadioBox'
|
||||
], function () { 'use strict';
|
||||
|
||||
DE.Views.CellsRemoveDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
width: 214,
|
||||
header: true,
|
||||
style: 'min-width: 214px;',
|
||||
cls: 'modal-dlg',
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
_.extend(this.options, {
|
||||
title: this.textTitle
|
||||
}, options || {});
|
||||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div id="table-radio-cells-left" style="padding-bottom: 8px;"></div>',
|
||||
'<div id="table-radio-cells-row" style="padding-bottom: 8px;"></div>',
|
||||
'<div id="table-radio-cells-col" style="padding-bottom: 8px;"></div>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
this.radioLeft = new Common.UI.RadioBox({
|
||||
el: $('#table-radio-cells-left'),
|
||||
labelText: this.textLeft,
|
||||
name: 'asc-radio-table-cells-rem',
|
||||
checked: true
|
||||
});
|
||||
|
||||
this.radioRow = new Common.UI.RadioBox({
|
||||
el: $('#table-radio-cells-row'),
|
||||
labelText: this.textRow,
|
||||
name: 'asc-radio-table-cells-rem'
|
||||
});
|
||||
|
||||
this.radioCol = new Common.UI.RadioBox({
|
||||
el: $('#table-radio-cells-col'),
|
||||
labelText: this.textCol,
|
||||
name: 'asc-radio-table-cells-rem'
|
||||
});
|
||||
|
||||
var $window = this.getChild();
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, state, this.getSettings());
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
return this.radioRow.getValue() ? 'row' : (this.radioCol.getValue() ? 'col' : 'left') ;
|
||||
},
|
||||
|
||||
onPrimary: function() {
|
||||
this._handleInput('ok');
|
||||
return false;
|
||||
},
|
||||
|
||||
textTitle: 'Delete Cells',
|
||||
textLeft: 'Shift cells left',
|
||||
textRow: 'Delete entire row',
|
||||
textCol: 'Delete entire column'
|
||||
|
||||
}, DE.Views.CellsRemoveDialog || {}))
|
||||
});
|
|
@ -1,150 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* CompareSettingsDialog.js.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 14.08.2019
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/component/CheckBox',
|
||||
'common/main/lib/component/InputField',
|
||||
'common/main/lib/view/AdvancedSettingsWindow'
|
||||
], function () { 'use strict';
|
||||
|
||||
DE.Views.CompareSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||
options: {
|
||||
contentWidth: 220,
|
||||
height: 160
|
||||
},
|
||||
|
||||
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: 0 5px;"><div class="inner-content">',
|
||||
'<div class="settings-panel active">',
|
||||
'<table cols="1" style="width: 100%;">',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<label class="header">', me.textShow, '</label>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<div id="compare-settings-radio-char"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<div id="compare-settings-radio-word"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div></div>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
].join('')
|
||||
}, options);
|
||||
|
||||
this.handler = options.handler;
|
||||
this.props = options.props;
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||
var me = this;
|
||||
|
||||
this.radioChar = new Common.UI.RadioBox({
|
||||
el: $('#compare-settings-radio-char'),
|
||||
labelText: this.textChar,
|
||||
name: 'asc-radio-compare-show'
|
||||
});
|
||||
|
||||
this.radioWord = new Common.UI.RadioBox({
|
||||
el: $('#compare-settings-radio-word'),
|
||||
labelText: this.textWord,
|
||||
name: 'asc-radio-compare-show'
|
||||
});
|
||||
|
||||
this.afterRender();
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this._setDefaults(this.props);
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
|
||||
},
|
||||
|
||||
_setDefaults: function (props) {
|
||||
if (props) {
|
||||
var value = props.getWords();
|
||||
(value==false) ? this.radioChar.setValue(true, true) : this.radioWord.setValue(true, true);
|
||||
}
|
||||
},
|
||||
|
||||
getSettings: function () {
|
||||
var props = new AscCommonWord.ComparisonOptions();
|
||||
props.putWords(this.radioWord.getValue());
|
||||
return props;
|
||||
},
|
||||
|
||||
onDlgBtnClick: function(event) {
|
||||
var me = this;
|
||||
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
|
||||
if (state == 'ok') {
|
||||
this.handler && this.handler.call(this, state, this.getSettings());
|
||||
Common.localStorage.setBool("de-compare-char", this.radioChar.getValue());
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
textTitle: 'Comparison Settings',
|
||||
textShow: 'Show changes at',
|
||||
textChar: 'Character level',
|
||||
textWord: 'Word level'
|
||||
|
||||
}, DE.Views.CompareSettingsDialog || {}))
|
||||
});
|
|
@ -120,6 +120,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 120px;',
|
||||
editable: false,
|
||||
takeFocusOnClose: true,
|
||||
data: [
|
||||
{ displayValue: this.textBox, value: Asc.c_oAscSdtAppearance.Frame },
|
||||
{ displayValue: this.textNone, value: Asc.c_oAscSdtAppearance.Hidden }
|
||||
|
@ -136,7 +137,13 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
},
|
||||
{caption: '--'}],
|
||||
additionalAlign: this.menuAddAlign,
|
||||
color: '000000'
|
||||
color: '000000',
|
||||
colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600',
|
||||
'808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966',
|
||||
'33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF',
|
||||
'993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF'
|
||||
],
|
||||
paletteHeight: 94
|
||||
});
|
||||
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
|
||||
this.colors = this.btnColor.getPicker();
|
||||
|
@ -168,7 +175,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
'<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;margin-right: 5px;"><%= name %></div>',
|
||||
'<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= value %></div>',
|
||||
'</div>'
|
||||
].join(''))
|
||||
].join('')),
|
||||
tabindex: 1
|
||||
});
|
||||
this.list.on('item:select', _.bind(this.onSelectItem, this));
|
||||
|
||||
|
@ -212,7 +220,10 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
menuStyle : 'min-width: 100%; max-height: 185px;',
|
||||
cls : 'input-group-nr',
|
||||
editable : false,
|
||||
data : data
|
||||
takeFocusOnClose: true,
|
||||
data : data,
|
||||
search: true,
|
||||
scrollAlwaysVisible: true
|
||||
});
|
||||
this.cmbLang.setValue(0x0409);
|
||||
this.cmbLang.on('selected',function(combo, record) {
|
||||
|
@ -222,7 +233,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
this.listFormats = new Common.UI.ListView({
|
||||
el: $('#control-settings-format'),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
scrollAlwaysVisible: true
|
||||
scrollAlwaysVisible: true,
|
||||
tabindex: 1
|
||||
});
|
||||
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
|
||||
|
||||
|
@ -307,7 +319,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
step: .1,
|
||||
width: 80,
|
||||
defaultUnit : "cm",
|
||||
value: '3 cm',
|
||||
value: 'Auto',
|
||||
allowAuto: true,
|
||||
maxValue: 55.88,
|
||||
minValue: 0.1
|
||||
});
|
||||
|
@ -346,16 +359,34 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
this.afterRender();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [
|
||||
this.txtName, this.txtTag, this.txtPlaceholder, this.cmbShow, // 0 tab
|
||||
{cmp: this.list, selector: '.listview'}, // 2 tab
|
||||
this.txtDate, {cmp: this.listFormats, selector: '.listview'}, this.cmbLang // 3 tab
|
||||
];
|
||||
},
|
||||
|
||||
onCategoryClick: function(btn, index) {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
|
||||
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
if (index==0) {
|
||||
me.txtName.focus();
|
||||
} else if (index==2) {
|
||||
me.list.focus();
|
||||
} else if (index==3)
|
||||
me.txtDate.focus();
|
||||
}, 100);
|
||||
},
|
||||
|
||||
onColorsSelect: function(btn, color) {
|
||||
var clr_item = this.btnColor.menu.$el.find('#control-settings-system-color > a');
|
||||
clr_item.hasClass('selected') && clr_item.removeClass('selected');
|
||||
this.isSystemColor = false;
|
||||
},
|
||||
|
||||
updateThemeColors: function() {
|
||||
this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
|
||||
},
|
||||
|
||||
onSystemColor: function(e) {
|
||||
var color = Common.Utils.ThemeColor.getHexColor(220, 220, 220);
|
||||
this.btnColor.setColor(color);
|
||||
|
@ -366,7 +397,6 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
},
|
||||
|
||||
afterRender: function() {
|
||||
this.updateThemeColors();
|
||||
this.updateMetricUnit();
|
||||
this._setDefaults(this.props);
|
||||
if (this.storageName) {
|
||||
|
@ -522,7 +552,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
this.spnMaxChars.setValue(val && val>=0 ? val : 10);
|
||||
|
||||
val = formTextPr.get_Width();
|
||||
this.spnWidth.setValue(val ? val : '', true);
|
||||
this.spnWidth.setValue(val!==0 && val!==undefined ? Common.Utils.Metric.fnRecalcFromMM(val * 25.4 / 20 / 72.0) : -1, true);
|
||||
}
|
||||
|
||||
if ((type == Asc.c_oAscContentControlSpecificType.CheckBox || type == Asc.c_oAscContentControlSpecificType.Picture) && !formPr ) {// standart checkbox or picture
|
||||
|
@ -535,7 +565,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
var props = new AscCommon.CContentControlPr();
|
||||
props.put_Alias(this.txtName.getValue());
|
||||
props.put_Tag(this.txtTag.getValue());
|
||||
props.put_PlaceholderText(this.txtPlaceholder.getValue());
|
||||
props.put_PlaceholderText(this.txtPlaceholder.getValue() || ' ');
|
||||
props.put_Appearance(this.cmbShow.getValue());
|
||||
|
||||
if (this.isSystemColor) {
|
||||
|
@ -611,8 +641,12 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
|
||||
if (this.btnsCategory[5].isVisible()) {
|
||||
var formTextPr = new AscCommon.CSdtTextFormPr();
|
||||
if (this.spnWidth.getValue())
|
||||
formTextPr.put_Width(this.spnWidth.getNumberValue());
|
||||
if (this.spnWidth.getValue()) {
|
||||
var value = this.spnWidth.getNumberValue();
|
||||
formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
|
||||
} else
|
||||
formTextPr.put_Width(0);
|
||||
|
||||
if (this.placeholder && this.placeholder.changed) {
|
||||
formTextPr.put_PlaceHolderSymbol(this.placeholder.code);
|
||||
formTextPr.put_PlaceHolderFont(this.placeholder.font);
|
||||
|
@ -622,7 +656,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
var checked = (this.chMaxChars.getValue()=='checked' || this.chComb.getValue()=='checked');
|
||||
formTextPr.put_MaxCharacters(checked);
|
||||
if (checked)
|
||||
formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 12);
|
||||
formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 10);
|
||||
|
||||
props.put_TextFormPr(formTextPr);
|
||||
}
|
||||
|
@ -683,7 +717,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
me.disableListButtons();
|
||||
}
|
||||
}
|
||||
me.list.cmpEl.find('.listview').focus();
|
||||
me.list.focus();
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
|
@ -703,7 +737,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
});
|
||||
}
|
||||
}
|
||||
me.list.cmpEl.find('.listview').focus();
|
||||
me.list.focus();
|
||||
}
|
||||
});
|
||||
rec && win.show();
|
||||
|
@ -723,7 +757,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
}
|
||||
}
|
||||
this.disableListButtons();
|
||||
this.list.cmpEl.find('.listview').focus();
|
||||
this.list.focus();
|
||||
},
|
||||
|
||||
onMoveItem: function(up) {
|
||||
|
@ -736,7 +770,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
this.list.selectRecord(rec);
|
||||
this.list.scrollToRecord(rec);
|
||||
}
|
||||
this.list.cmpEl.find('.listview').focus();
|
||||
this.list.focus();
|
||||
},
|
||||
|
||||
updateFormats: function(lang) {
|
||||
|
|
|
@ -130,6 +130,14 @@ define([
|
|||
this.updateMetricUnit();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.spnColumns, this.spnSpacing];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.spnColumns;
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state);
|
||||
|
|
|
@ -102,7 +102,10 @@ define([
|
|||
menuStyle : 'min-width: 100%; max-height: 185px;',
|
||||
cls : 'input-group-nr',
|
||||
editable : false,
|
||||
data : data
|
||||
takeFocusOnClose: true,
|
||||
data : data,
|
||||
search: true,
|
||||
scrollAlwaysVisible: true
|
||||
});
|
||||
this.cmbLang.setValue(0x0409);
|
||||
this.cmbLang.on('selected', _.bind(function(combo, record) {
|
||||
|
@ -120,13 +123,13 @@ define([
|
|||
this.listFormats = new Common.UI.ListView({
|
||||
el: $('#datetime-dlg-format'),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
tabindex: 1,
|
||||
scrollAlwaysVisible: true
|
||||
});
|
||||
|
||||
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
|
||||
this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this));
|
||||
this.listFormats.on('entervalue', _.bind(this.onPrimary, this));
|
||||
this.listFormats.$el.find('.listview').focus();
|
||||
|
||||
this.btnDefault = new Common.UI.Button({
|
||||
el: $('#datetime-dlg-default')
|
||||
|
@ -172,6 +175,14 @@ define([
|
|||
this._setDefaults();
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.cmbLang, {cmp: this.listFormats, selector: '.listview'}];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.cmbLang;
|
||||
},
|
||||
|
||||
_setDefaults: function () {
|
||||
this.props = new Asc.CAscDateTime();
|
||||
if (this.lang) {
|
||||
|
|
|
@ -50,13 +50,13 @@ define([
|
|||
'common/main/lib/component/Calendar',
|
||||
'common/main/lib/view/InsertTableDialog',
|
||||
'common/main/lib/view/CopyWarningDialog',
|
||||
'common/main/lib/view/OptionsDialog',
|
||||
'documenteditor/main/app/view/DropcapSettingsAdvanced',
|
||||
'documenteditor/main/app/view/HyperlinkSettingsDialog',
|
||||
'documenteditor/main/app/view/ParagraphSettingsAdvanced',
|
||||
'documenteditor/main/app/view/TableSettingsAdvanced',
|
||||
'documenteditor/main/app/view/ControlSettingsDialog',
|
||||
'documenteditor/main/app/view/NumberingValueDialog',
|
||||
'documenteditor/main/app/view/CellsRemoveDialog',
|
||||
'documenteditor/main/app/view/CellsAddDialog'
|
||||
], function ($, _, Backbone, gateway) { 'use strict';
|
||||
|
||||
|
@ -491,20 +491,24 @@ define([
|
|||
var showPoint, ToolTip,
|
||||
type = moveData.get_Type();
|
||||
|
||||
if (type==1 || type==3) { // 1 - hyperlink, 3 - footnote
|
||||
if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form) { // 1 - hyperlink, 3 - footnote
|
||||
if (isTooltipHiding) {
|
||||
mouseMoveData = moveData;
|
||||
return;
|
||||
}
|
||||
|
||||
if (type==1) {
|
||||
if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) {
|
||||
var hyperProps = moveData.get_Hyperlink();
|
||||
if (!hyperProps) return;
|
||||
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
|
||||
} else {
|
||||
} else if (type == Asc.c_oAscMouseMoveDataTypes.Footnote) {
|
||||
ToolTip = moveData.get_FootnoteText();
|
||||
if (ToolTip.length>1000)
|
||||
ToolTip = ToolTip.substr(0, 1000) + '...';
|
||||
} else if (type==Asc.c_oAscMouseMoveDataTypes.Form) {
|
||||
ToolTip = moveData.get_FormHelpText();
|
||||
if (ToolTip.length>1000)
|
||||
ToolTip = ToolTip.substr(0, 1000) + '...';
|
||||
}
|
||||
|
||||
var recalc = false;
|
||||
|
@ -513,7 +517,7 @@ define([
|
|||
ToolTip = Common.Utils.String.htmlEncode(ToolTip);
|
||||
|
||||
if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
|
||||
screenTip.toolTip.setTitle((type==1) ? (ToolTip + '<br><b>' + me.txtPressLink + '</b>') : ToolTip);
|
||||
screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '<br><b>' + me.txtPressLink + '</b>') : ToolTip);
|
||||
screenTip.tipLength = ToolTip.length;
|
||||
screenTip.strTip = ToolTip;
|
||||
screenTip.tipType = type;
|
||||
|
@ -547,7 +551,7 @@ define([
|
|||
screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
|
||||
}
|
||||
/** coauthoring begin **/
|
||||
else if (moveData.get_Type()==2 && me.mode.isEdit) { // 2 - locked object
|
||||
else if (moveData.get_Type()==Asc.c_oAscMouseMoveDataTypes.LockedObject && me.mode.isEdit) { // 2 - locked object
|
||||
var src;
|
||||
if (me.usertipcount >= me.usertips.length) {
|
||||
src = $(document.createElement("div"));
|
||||
|
@ -1876,7 +1880,7 @@ define([
|
|||
}
|
||||
})).show();
|
||||
} else if (item.value == 'remove') {
|
||||
this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
|
||||
props.get_FormPr() ? this.api.asc_RemoveContentControl(props.get_InternalId()) : this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
|
@ -1920,9 +1924,16 @@ define([
|
|||
|
||||
onCellsRemove: function() {
|
||||
var me = this;
|
||||
(new DE.Views.CellsRemoveDialog({
|
||||
handler: function (result, value) {
|
||||
if (result == 'ok') {
|
||||
(new Common.Views.OptionsDialog({
|
||||
title: me.textTitleCellsRemove,
|
||||
items: [
|
||||
{caption: this.textLeft, value: 'left'},
|
||||
{caption: this.textRow, value: 'row'},
|
||||
{caption: this.textCol, value: 'col'}
|
||||
],
|
||||
handler: function (dlg, result) {
|
||||
if (result=='ok') {
|
||||
var value = dlg.getSettings();
|
||||
if (value == 'row')
|
||||
me.api.remRow();
|
||||
else if (value == 'col')
|
||||
|
@ -2786,13 +2797,14 @@ define([
|
|||
});
|
||||
|
||||
var menuTableRemoveControl = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon cc-remove',
|
||||
caption: me.textRemove,
|
||||
value: 'remove'
|
||||
}).on('click', _.bind(me.onControlsSelect, me));
|
||||
|
||||
var menuTableControlSettings = new Common.UI.MenuItem({
|
||||
caption: me.textSettings,
|
||||
value: 'settings'
|
||||
caption: me.textSettings,
|
||||
value: 'settings'
|
||||
}).on('click', _.bind(me.onControlsSelect, me));
|
||||
|
||||
var menuTableControl = new Common.UI.MenuItem({
|
||||
|
@ -3222,9 +3234,11 @@ define([
|
|||
menuTableControl.setVisible(in_control);
|
||||
if (in_control) {
|
||||
var control_props = me.api.asc_GetContentControlProperties(),
|
||||
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
|
||||
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
|
||||
is_form = control_props && control_props.get_FormPr();
|
||||
menuTableRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
||||
menuTableControlSettings.setVisible(me.mode.canEditContentControl);
|
||||
menuTableRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl);
|
||||
menuTableControlSettings.setVisible(me.mode.canEditContentControl && !is_form);
|
||||
|
||||
var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
|
||||
control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
|
||||
|
@ -3297,7 +3311,6 @@ define([
|
|||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
style : 'width: 100px',
|
||||
items : [
|
||||
new Common.UI.MenuItem({
|
||||
caption: me.insertColumnLeftText
|
||||
|
@ -3669,6 +3682,7 @@ define([
|
|||
});
|
||||
|
||||
var menuParaRemoveControl = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon cc-remove',
|
||||
caption: me.textRemoveControl,
|
||||
value: 'remove'
|
||||
}).on('click', _.bind(me.onControlsSelect, me));
|
||||
|
@ -3901,14 +3915,16 @@ define([
|
|||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
|
||||
|
||||
var in_toc = me.api.asc_GetTableOfContentsPr(true),
|
||||
in_control = !in_toc && me.api.asc_IsContentControl() ;
|
||||
in_control = !in_toc && me.api.asc_IsContentControl(),
|
||||
control_props = in_control ? me.api.asc_GetContentControlProperties() : null,
|
||||
is_form = control_props && control_props.get_FormPr();
|
||||
menuParaRemoveControl.setVisible(in_control);
|
||||
menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl);
|
||||
menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form);
|
||||
menuParaControlSeparator.setVisible(in_control);
|
||||
if (in_control) {
|
||||
var control_props = me.api.asc_GetContentControlProperties(),
|
||||
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
|
||||
var lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
|
||||
menuParaRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
||||
menuParaRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl);
|
||||
|
||||
var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
|
||||
control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
|
||||
|
@ -4229,6 +4245,7 @@ define([
|
|||
var type = obj.type,
|
||||
props = obj.pr,
|
||||
specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr(),
|
||||
isForm = !!props.get_FormPr(),
|
||||
menu = this.listControlMenu,
|
||||
menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null,
|
||||
me = this;
|
||||
|
@ -4265,14 +4282,26 @@ define([
|
|||
});
|
||||
}
|
||||
if (specProps) {
|
||||
if (isForm){ // for dropdown and combobox form control always add placeholder item
|
||||
var text = props.get_PlaceholderText();
|
||||
menu.addItem(new Common.UI.MenuItem({
|
||||
caption : (text.trim()!=='') ? text : this.txtEmpty,
|
||||
value : '',
|
||||
template : _.template([
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" style="<% if (options.value=="") { %> opacity: 0.6 <% } %>">',
|
||||
'<%= caption %>',
|
||||
'</a>'
|
||||
].join(''))
|
||||
}));
|
||||
}
|
||||
var count = specProps.get_ItemsCount();
|
||||
for (var i=0; i<count; i++) {
|
||||
menu.addItem(new Common.UI.MenuItem({
|
||||
(specProps.get_ItemValue(i)!=='' || !isForm) && menu.addItem(new Common.UI.MenuItem({
|
||||
caption : specProps.get_ItemDisplayText(i),
|
||||
value : specProps.get_ItemValue(i)
|
||||
}));
|
||||
}
|
||||
if (count<1) {
|
||||
if (!isForm && menu.items.length<1) {
|
||||
menu.addItem(new Common.UI.MenuItem({
|
||||
caption : this.txtEmpty,
|
||||
value : -1
|
||||
|
@ -4304,6 +4333,10 @@ define([
|
|||
return;
|
||||
}
|
||||
this.api.asc_addImage(obj);
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
me.api.asc_UncheckContentControlButtons();
|
||||
}, 500);
|
||||
break;
|
||||
case Asc.c_oAscContentControlSpecificType.DropDownList:
|
||||
case Asc.c_oAscContentControlSpecificType.ComboBox:
|
||||
|
@ -4320,6 +4353,23 @@ define([
|
|||
this._state.lock_doc = false;
|
||||
},
|
||||
|
||||
getControlLabel: function(props) {
|
||||
var type = props ? props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
|
||||
switch (type) {
|
||||
case Asc.c_oAscContentControlSpecificType.CheckBox:
|
||||
var specProps = props.get_CheckBoxPr();
|
||||
return (typeof specProps.get_GroupKey() !== 'string') ? this.textRemCheckBox : this.textRemRadioBox;
|
||||
case Asc.c_oAscContentControlSpecificType.ComboBox:
|
||||
return this.textRemComboBox;
|
||||
case Asc.c_oAscContentControlSpecificType.DropDownList:
|
||||
return this.textRemDropdown;
|
||||
case Asc.c_oAscContentControlSpecificType.Picture:
|
||||
return this.textRemPicture;
|
||||
default:
|
||||
return this.textRemField;
|
||||
}
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
var me = this;
|
||||
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
||||
|
@ -4546,7 +4596,16 @@ define([
|
|||
txtInsertCaption: 'Insert Caption',
|
||||
txtEmpty: '(Empty)',
|
||||
textFromStorage: 'From Storage',
|
||||
advancedDropCapText: 'Drop Cap Settings'
|
||||
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
advancedDropCapText: 'Drop Cap Settings',
|
||||
textTitleCellsRemove: 'Delete Cells',
|
||||
textLeft: 'Shift cells left',
|
||||
textRow: 'Delete entire row',
|
||||
textCol: 'Delete entire column',
|
||||
textRemCheckBox: 'Remove Checkbox',
|
||||
textRemRadioBox: 'Remove Radio Button',
|
||||
textRemComboBox: 'Remove Combo Box',
|
||||
textRemDropdown: 'Remove Dropdown',
|
||||
textRemPicture: 'Remove Image',
|
||||
textRemField: 'Remove Text Field'
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -141,6 +141,7 @@ define([
|
|||
el : $('#drop-advanced-input-bordersize'),
|
||||
style : 'width: 90px;',
|
||||
store : new Backbone.Collection(),
|
||||
takeFocusOnClose: true,
|
||||
data: [
|
||||
{id: Common.UI.getId(), displayValue: this.txtNoBorders, value: 0, borderstyle: ''},
|
||||
{id: Common.UI.getId(), displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0},
|
||||
|
@ -353,7 +354,8 @@ define([
|
|||
menuStyle : 'min-width: 55px;max-height: 236px;',
|
||||
store : new Common.Collections.Fonts(),
|
||||
recent : 0,
|
||||
hint: this.tipFontName
|
||||
hint: this.tipFontName,
|
||||
takeFocusOnClose: true
|
||||
})
|
||||
.on('selected', _.bind(function(combo, record) {
|
||||
if (me._changedProps) {
|
||||
|
@ -418,6 +420,7 @@ define([
|
|||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 130px;',
|
||||
editable : false,
|
||||
takeFocusOnClose: true,
|
||||
data : this._arrWidth
|
||||
})
|
||||
.on('selected', _.bind(function(combo, record) {
|
||||
|
@ -457,6 +460,7 @@ define([
|
|||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 130px;',
|
||||
editable : false,
|
||||
takeFocusOnClose: true,
|
||||
data : this._arrHeight
|
||||
})
|
||||
.on('selected', _.bind(function(combo, record) {
|
||||
|
@ -539,7 +543,8 @@ define([
|
|||
el : $('#frame-advanced-input-hposition'),
|
||||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 130px;',
|
||||
data : this._arrHAlign
|
||||
data : this._arrHAlign,
|
||||
takeFocusOnClose: true
|
||||
})
|
||||
.on('changed:after', _.bind(function(combo, record) {
|
||||
if (me._changedProps) {
|
||||
|
@ -564,7 +569,8 @@ define([
|
|||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 95px;',
|
||||
data : this._arrHRelative,
|
||||
editable : false
|
||||
editable : false,
|
||||
takeFocusOnClose: true
|
||||
})
|
||||
.on('selected', _.bind(function(combo, record) {
|
||||
if (me._changedProps) {
|
||||
|
@ -582,7 +588,8 @@ define([
|
|||
el : $('#frame-advanced-input-vposition'),
|
||||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 130px;',
|
||||
data : this._arrVAlign
|
||||
data : this._arrVAlign,
|
||||
takeFocusOnClose: true
|
||||
})
|
||||
.on('changed:after', _.bind(function(combo, record) {
|
||||
if (me._changedProps) {
|
||||
|
@ -607,7 +614,8 @@ define([
|
|||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 95px;',
|
||||
data : this._arrVRelative,
|
||||
editable : false
|
||||
editable : false,
|
||||
takeFocusOnClose: true
|
||||
})
|
||||
.on('selected', _.bind(function(combo, record) {
|
||||
if (me._changedProps) {
|
||||
|
@ -687,6 +695,28 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [
|
||||
this.cmbWidth, this.spnWidth, this.cmbHeight, this.spnHeight, this.cmbHAlign, this.cmbHRelative, this.spnX, this.cmbVAlign, this.cmbVRelative, this.spnY, // 0 tab
|
||||
this.cmbFonts, this.spnRowHeight, this.numDistance, // 1 tab
|
||||
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight // 3 tab
|
||||
];
|
||||
},
|
||||
|
||||
onCategoryClick: function(btn, index) {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
|
||||
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
if (index==0) {
|
||||
me.cmbWidth.focus();
|
||||
} else if (index==1) {
|
||||
me.cmbFonts.focus();
|
||||
} else if (index==3)
|
||||
me.spnMarginTop.focus();
|
||||
}, 100);
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
if (this.ChangedBorders === null) {
|
||||
this._changedProps.put_Borders(this.Borders);
|
||||
|
|
|
@ -125,13 +125,12 @@ define([
|
|||
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
getFocusedComponents: function() {
|
||||
return [this.inputName, this.inputValue];
|
||||
},
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.inputName.cmpEl.find('input').focus();
|
||||
},50);
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.inputName;
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
|
@ -147,11 +146,11 @@ define([
|
|||
if (this.options.handler) {
|
||||
if (state == 'ok') {
|
||||
if (this.inputName.checkValidate() !== true) {
|
||||
this.inputName.cmpEl.find('input').focus();
|
||||
this.inputName.focus();
|
||||
return;
|
||||
}
|
||||
if (this.inputValue.checkValidate() !== true) {
|
||||
this.inputValue.cmpEl.find('input').focus();
|
||||
this.inputValue.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -645,14 +645,7 @@ define([
|
|||
|
||||
autoCorrect: function() {
|
||||
if (this.dlgAutoCorrect && this.dlgAutoCorrect.isVisible()) return;
|
||||
|
||||
if (!this._mathCorrect)
|
||||
this._mathCorrect = new Common.UI.DataViewStore();
|
||||
if (!this._funcCorrect)
|
||||
this._funcCorrect = new Common.UI.DataViewStore();
|
||||
this.dlgAutoCorrect = new Common.Views.AutoCorrectDialog({
|
||||
mathStore: this._mathCorrect,
|
||||
functionsStore: this._funcCorrect,
|
||||
api: this.api
|
||||
});
|
||||
this.dlgAutoCorrect.show();
|
||||
|
|
923
apps/documenteditor/main/app/view/FormSettings.js
Normal file
|
@ -0,0 +1,923 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2020
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* FormSettings.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 28/09/20
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/main/app/template/FormSettings.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/main/lib/component/ComboBox',
|
||||
'common/main/lib/component/MetricSpinner',
|
||||
'common/main/lib/component/TextareaField',
|
||||
'common/main/lib/component/CheckBox',
|
||||
'common/main/lib/view/ImageFromUrlDialog'
|
||||
], function (menuTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.FormSettings = Backbone.View.extend(_.extend({
|
||||
el: '#id-form-settings',
|
||||
|
||||
// Compile our stats template
|
||||
template: _.template(menuTemplate),
|
||||
|
||||
// Delegated events for creating new items, and clearing completed ones.
|
||||
events: {
|
||||
},
|
||||
|
||||
options: {
|
||||
alias: 'FormSettings'
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this._initSettings = true;
|
||||
|
||||
this._state = {
|
||||
DisabledControls: undefined,
|
||||
LockDelete: undefined
|
||||
};
|
||||
this.spinners = [];
|
||||
this.lockedControls = [];
|
||||
this.internalId = null;
|
||||
this._locked = true;
|
||||
this._originalTextFormProps = null;
|
||||
this._originalFormProps = null;
|
||||
this._originalProps = null;
|
||||
|
||||
this.render();
|
||||
},
|
||||
|
||||
render: function () {
|
||||
var el = this.$el || $(this.el);
|
||||
el.html(this.template({
|
||||
scope: this
|
||||
}));
|
||||
|
||||
this.TextOnlySettings = el.find('.form-textfield');
|
||||
this.PlaceholderSettings = el.find('.form-placeholder');
|
||||
this.KeySettings = el.find('.form-keyfield');
|
||||
this.KeySettingsTd = this.KeySettings.find('td');
|
||||
this.CheckOnlySettings = el.find('.form-checkbox');
|
||||
this.RadioOnlySettings = el.find('.form-radiobox');
|
||||
this.ListOnlySettings = el.find('.form-list');
|
||||
this.ImageOnlySettings = el.find('.form-image');
|
||||
this.ConnectedSettings = el.find('.form-connected');
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
this._initSettings = false;
|
||||
|
||||
var $markup = this.$el || $(this.el);
|
||||
|
||||
var me = this;
|
||||
|
||||
this.labelFormName = $markup.findById('#form-settings-name');
|
||||
this.labelConnectedFields = $markup.findById('#form-settings-connected');
|
||||
$markup.findById('#form-settings-disconnect').on('click', _.bind(this.onDisconnect, this));
|
||||
|
||||
// Common props
|
||||
this.cmbKey = new Common.UI.ComboBox({
|
||||
el: $markup.findById('#form-combo-key'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 100%;',
|
||||
editable: true,
|
||||
data: []
|
||||
});
|
||||
this.cmbKey.setValue('');
|
||||
this.lockedControls.push(this.cmbKey);
|
||||
this.cmbKey.on('selected', this.onKeyChanged.bind(this));
|
||||
this.cmbKey.on('changed:after', this.onKeyChanged.bind(this));
|
||||
this.cmbKey.on('hide:after', this.onHideMenus.bind(this));
|
||||
|
||||
this.txtPlaceholder = new Common.UI.InputField({
|
||||
el : $markup.findById('#form-txt-pholder'),
|
||||
allowBlank : true,
|
||||
validateOnChange: false,
|
||||
validateOnBlur: false,
|
||||
style : 'width: 100%;',
|
||||
value : ''
|
||||
});
|
||||
this.lockedControls.push(this.txtPlaceholder);
|
||||
this.txtPlaceholder.on('changed:after', this.onPlaceholderChanged.bind(this));
|
||||
this.txtPlaceholder.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
this.textareaHelp = new Common.UI.TextareaField({
|
||||
el : $markup.findById('#form-txt-help'),
|
||||
style : 'width: 100%; height: 60px;',
|
||||
value : ''
|
||||
});
|
||||
this.lockedControls.push(this.textareaHelp);
|
||||
this.textareaHelp.on('changed:after', this.onHelpChanged.bind(this));
|
||||
this.textareaHelp.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
// Text props
|
||||
this.chMaxChars = new Common.UI.CheckBox({
|
||||
el: $markup.findById('#form-chb-max-chars'),
|
||||
labelText: this.textMaxChars
|
||||
});
|
||||
this.chMaxChars.on('change', this.onChMaxCharsChanged.bind(this));
|
||||
this.lockedControls.push(this.chMaxChars);
|
||||
|
||||
this.spnMaxChars = new Common.UI.MetricSpinner({
|
||||
el: $markup.findById('#form-spin-max-chars'),
|
||||
step: 1,
|
||||
width: 45,
|
||||
defaultUnit : "",
|
||||
value: '10',
|
||||
maxValue: 1000000,
|
||||
minValue: 1
|
||||
});
|
||||
this.lockedControls.push(this.spnMaxChars);
|
||||
this.spnMaxChars.on('change', this.onMaxCharsChange.bind(this));
|
||||
this.spnMaxChars.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
this.chComb = new Common.UI.CheckBox({
|
||||
el: $markup.findById('#form-chb-comb'),
|
||||
labelText: this.textComb
|
||||
});
|
||||
this.chComb.on('change', this.onChCombChanged.bind(this));
|
||||
this.lockedControls.push(this.chComb);
|
||||
|
||||
this.spnWidth = new Common.UI.MetricSpinner({
|
||||
el: $markup.findById('#form-spin-width'),
|
||||
step: .1,
|
||||
width: 64,
|
||||
defaultUnit : "cm",
|
||||
value: 'Auto',
|
||||
allowAuto: true,
|
||||
maxValue: 55.88,
|
||||
minValue: 0.1
|
||||
});
|
||||
this.lockedControls.push(this.spnWidth);
|
||||
this.spinners.push(this.spnWidth);
|
||||
this.spnWidth.on('change', this.onWidthChange.bind(this));
|
||||
this.spnWidth.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
// Radio props
|
||||
this.cmbGroupKey = new Common.UI.ComboBox({
|
||||
el: $markup.findById('#form-combo-group-key'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 100%;',
|
||||
editable: true,
|
||||
data: []
|
||||
});
|
||||
this.cmbGroupKey.setValue('');
|
||||
this.lockedControls.push(this.cmbGroupKey);
|
||||
this.cmbGroupKey.on('selected', this.onGroupKeyChanged.bind(this));
|
||||
this.cmbGroupKey.on('changed:after', this.onGroupKeyChanged.bind(this));
|
||||
this.cmbGroupKey.on('hide:after', this.onHideMenus.bind(this));
|
||||
|
||||
// combobox & dropdown list
|
||||
this.txtNewValue = new Common.UI.InputField({
|
||||
el : $markup.findById('#form-txt-new-value'),
|
||||
allowBlank : true,
|
||||
validateOnChange: false,
|
||||
validateOnBlur: false,
|
||||
style : 'width: 100%;',
|
||||
value : ''
|
||||
});
|
||||
this.lockedControls.push(this.txtNewValue);
|
||||
this.txtNewValue.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
this.txtNewValue._input.on('keydown', _.bind(this.onNewValueKeydown, this));
|
||||
|
||||
this.list = new Common.UI.ListView({
|
||||
el: $markup.findById('#form-list-list'),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
emptyText: '',
|
||||
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
|
||||
itemTemplate: _.template([
|
||||
'<div id="<%= id %>" class="list-item" style="width: 100%;display:inline-block;">',
|
||||
// '<div style="width:65px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;margin-right: 5px;"><%= name %></div>',
|
||||
'<div style="width:145px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= name %></div>',
|
||||
'</div>'
|
||||
].join(''))
|
||||
});
|
||||
this.list.on('item:select', _.bind(this.onSelectItem, this));
|
||||
this.lockedControls.push(this.list);
|
||||
|
||||
this.btnListAdd = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-list-add'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-zoomup',
|
||||
hint: this.textTipAdd
|
||||
});
|
||||
this.btnListAdd.on('click', _.bind(this.onAddItem, this));
|
||||
this.lockedControls.push(this.btnListAdd);
|
||||
|
||||
this.btnListDelete = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-list-delete'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon cc-remove',
|
||||
hint: this.textTipDelete
|
||||
});
|
||||
this.btnListDelete.on('click', _.bind(this.onDeleteItem, this));
|
||||
this.lockedControls.push(this.btnListDelete);
|
||||
|
||||
this.btnListUp = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-list-up'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-arrow-up',
|
||||
hint: this.textTipUp
|
||||
});
|
||||
this.btnListUp.on('click', _.bind(this.onMoveItem, this, true));
|
||||
this.lockedControls.push(this.btnListUp);
|
||||
|
||||
this.btnListDown = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-list-down'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-arrow-down',
|
||||
hint: this.textTipDown
|
||||
});
|
||||
this.btnListDown.on('click', _.bind(this.onMoveItem, this, false));
|
||||
this.lockedControls.push(this.btnListDown);
|
||||
|
||||
// image props
|
||||
this.btnSelectImage = new Common.UI.Button({
|
||||
parentEl: $('#form-button-replace'),
|
||||
cls: 'btn-text-menu-default',
|
||||
caption: this.textSelectImage,
|
||||
style: "width:100%;",
|
||||
menu: new Common.UI.Menu({
|
||||
style: 'min-width: 194px;',
|
||||
maxHeight: 200,
|
||||
items: [
|
||||
{caption: this.textFromFile, value: 0},
|
||||
{caption: this.textFromUrl, value: 1},
|
||||
{caption: this.textFromStorage, value: 2}
|
||||
]
|
||||
})
|
||||
});
|
||||
this.lockedControls.push(this.btnSelectImage);
|
||||
this.btnSelectImage.menu.on('item:click', _.bind(this.onImageSelect, this));
|
||||
this.btnSelectImage.menu.items[2].setVisible(this.mode.canRequestInsertImage || this.mode.fileChoiceUrl && this.mode.fileChoiceUrl.indexOf("{documentType}")>-1);
|
||||
|
||||
this.btnRemForm = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-btn-delete'),
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'toolbar__icon cc-remove',
|
||||
caption : this.textDelete,
|
||||
style : 'text-align: left;'
|
||||
});
|
||||
this.btnRemForm.on('click', _.bind(function(btn){
|
||||
this.api.asc_RemoveContentControl(this._state.id);
|
||||
}, this));
|
||||
this.lockedControls.push(this.btnRemForm);
|
||||
|
||||
this.btnLockForm = new Common.UI.Button({
|
||||
parentEl: $markup.findById('#form-btn-lock'),
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'toolbar__icon btn-lock',
|
||||
caption : this.textLock,
|
||||
style : 'text-align: left;'
|
||||
});
|
||||
this.btnLockForm.on('click', _.bind(function(btn){
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
props.put_Lock(!this._state.LockDelete ? Asc.c_oAscSdtLockType.SdtLocked : Asc.c_oAscSdtLockType.Unlocked);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.updateMetricUnit();
|
||||
this.UpdateThemeColors();
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
if (this.api) {
|
||||
// this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this._onLineSpacing, this));
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
},
|
||||
|
||||
onKeyChanged: function(combo, record) {
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
|
||||
formPr.put_Key(record.value);
|
||||
props.put_FormPr(formPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onPlaceholderChanged: function(input, newValue, oldValue, e) {
|
||||
if (this.api && !this._noApply && (newValue!==oldValue)) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
props.put_PlaceholderText(newValue || ' ');
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className))
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onHelpChanged: function(input, newValue, oldValue, e) {
|
||||
if (this.api && !this._noApply && (newValue!==oldValue)) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
|
||||
formPr.put_HelpText(newValue);
|
||||
props.put_FormPr(formPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className))
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onChMaxCharsChanged: function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()=='checked');
|
||||
this.spnMaxChars.setDisabled(!checked);
|
||||
if (!checked) {
|
||||
this.chComb.setValue(false, true);
|
||||
this.spnWidth.setDisabled(true);
|
||||
}
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
(!checked) && formTextPr.put_Comb(checked);
|
||||
formTextPr.put_MaxCharacters(checked ? (this.spnMaxChars.getNumberValue() || 10) : checked);
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onMaxCharsChange: function(field, newValue, oldValue, eOpts){
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
var checked = (this.chMaxChars.getValue()=='checked' || this.chComb.getValue()=='checked');
|
||||
formTextPr.put_MaxCharacters(checked ? (field.getNumberValue() || 10) : checked);
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onChCombChanged: function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()=='checked');
|
||||
if (checked) {
|
||||
this.chMaxChars.setValue(true, true);
|
||||
this.spnMaxChars.setDisabled(false);
|
||||
}
|
||||
this.spnWidth.setDisabled(!checked);
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
formTextPr.put_Comb(checked);
|
||||
if (checked) {
|
||||
formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 10);
|
||||
if (this.spnWidth.getValue()) {
|
||||
var value = this.spnWidth.getNumberValue();
|
||||
formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4 + 0.1));
|
||||
} else
|
||||
formTextPr.put_Width(0);
|
||||
}
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onWidthChange: function(field, newValue, oldValue, eOpts){
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
if (this.spnWidth.getValue()) {
|
||||
var value = this.spnWidth.getNumberValue();
|
||||
formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4 + 0.1));
|
||||
} else
|
||||
formTextPr.put_Width(0);
|
||||
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onGroupKeyChanged: function(combo, record) {
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var specProps = this._originalCheckProps || new AscCommon.CSdtCheckBoxPr();
|
||||
specProps.put_GroupKey(record.value);
|
||||
props.put_CheckBoxPr(specProps);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
fillListProps: function() {
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var specProps = this._originalListProps || new AscCommon.CSdtComboBoxPr();
|
||||
specProps.clear();
|
||||
this.list.store.each(function (item, index) {
|
||||
specProps.add_Item(item.get('name'), item.get('value'));
|
||||
});
|
||||
(this.type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.put_ComboBoxPr(specProps) : props.put_DropDownListPr(specProps);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
}
|
||||
},
|
||||
|
||||
onNewValueKeydown: function(event) {
|
||||
if (this.api && !this._noApply && event.keyCode == Common.UI.Keys.RETURN) {
|
||||
this.onAddItem();
|
||||
}
|
||||
},
|
||||
|
||||
onAddItem: function() {
|
||||
var store = this.list.store,
|
||||
value = this.txtNewValue.getValue();
|
||||
if (value!=='') {
|
||||
var rec = store.findWhere({value: value});
|
||||
if (!rec) {
|
||||
store.add({value: value, name: value});
|
||||
this._state.listValue = value;
|
||||
this._state.listIndex = undefined;
|
||||
this.fillListProps();
|
||||
}
|
||||
}
|
||||
this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
onDeleteItem: function(btn, eOpts){
|
||||
var rec = this.list.getSelectedRec();
|
||||
if (rec) {
|
||||
var store = this.list.store;
|
||||
this._state.listIndex = store.indexOf(rec);
|
||||
this._state.listValue = undefined;
|
||||
store.remove(rec);
|
||||
this.fillListProps();
|
||||
}
|
||||
this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
onMoveItem: function(up) {
|
||||
var store = this.list.store,
|
||||
length = store.length,
|
||||
rec = this.list.getSelectedRec();
|
||||
if (rec) {
|
||||
var index = store.indexOf(rec);
|
||||
store.add(store.remove(rec), {at: up ? Math.max(0, index-1) : Math.min(length-1, index+1)});
|
||||
this.fillListProps();
|
||||
}
|
||||
this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
setImageUrl: function(url, token) {
|
||||
this.api.asc_SetContentControlPictureUrl(url, this.internalId, token);
|
||||
},
|
||||
|
||||
insertImageFromStorage: function(data) {
|
||||
if (data && data.url && data.c=='control') {
|
||||
this.setImageUrl(data.url, data.token);
|
||||
}
|
||||
},
|
||||
|
||||
onImageSelect: function(menu, item) {
|
||||
if (item.value==1) {
|
||||
var me = this;
|
||||
(new Common.Views.ImageFromUrlDialog({
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
var checkUrl = value.replace(/ /g, '');
|
||||
if (!_.isEmpty(checkUrl)) {
|
||||
me.setImageUrl(checkUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
})).show();
|
||||
} else if (item.value==2) {
|
||||
Common.NotificationCenter.trigger('storage:image-load', 'control');
|
||||
} else {
|
||||
if (this._isFromFile) return;
|
||||
this._isFromFile = true;
|
||||
if (this.api) this.api.asc_addImage(this._originalProps);
|
||||
this.fireEvent('editcomplete', this);
|
||||
this._isFromFile = false;
|
||||
}
|
||||
},
|
||||
|
||||
onColorPickerSelect: function(btn, color) {
|
||||
this.BorderColor = color;
|
||||
this._state.BorderColor = undefined;
|
||||
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
if (color == 'transparent') {
|
||||
formTextPr.put_CombBorder();
|
||||
} else {
|
||||
var brd = formTextPr.get_CombBorder();
|
||||
if (!brd)
|
||||
brd = new Asc.asc_CTextBorder();
|
||||
brd.put_Value(1);
|
||||
brd.put_Color(Common.Utils.ThemeColor.getRgbColor(color));
|
||||
formTextPr.put_CombBorder(brd);
|
||||
}
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onNoBorderClick: function(item) {
|
||||
this.BorderColor = 'transparent';
|
||||
this._state.BorderColor = undefined;
|
||||
|
||||
if (this.api && !this._noApply) {
|
||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||
formTextPr.put_CombBorder();
|
||||
props.put_TextFormPr(formTextPr);
|
||||
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
ChangeSettings: function(props) {
|
||||
if (this._initSettings)
|
||||
this.createDelayedElements();
|
||||
|
||||
if (props) {
|
||||
this._originalProps = props;
|
||||
|
||||
this._noApply = true;
|
||||
|
||||
this.internalId = props.get_InternalId();
|
||||
|
||||
var val = props.get_PlaceholderText();
|
||||
if (this._state.placeholder !== val) {
|
||||
this.txtPlaceholder.setValue(val ? val : '');
|
||||
this._state.placeholder = val;
|
||||
}
|
||||
|
||||
val = props.get_Lock();
|
||||
(val===undefined) && (val = Asc.c_oAscSdtLockType.Unlocked);
|
||||
if (this._state.LockDelete !== (val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked)) {
|
||||
this._state.LockDelete = (val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked);
|
||||
this.btnLockForm.setCaption(this._state.LockDelete ? this.textUnlock : this.textLock);
|
||||
}
|
||||
this.disableControls(this._locked);
|
||||
|
||||
var type = props.get_SpecificType(),
|
||||
connected = false;
|
||||
var specProps;
|
||||
//for list controls
|
||||
if (type == Asc.c_oAscContentControlSpecificType.ComboBox || type == Asc.c_oAscContentControlSpecificType.DropDownList) {
|
||||
this.labelFormName.text(type == Asc.c_oAscContentControlSpecificType.ComboBox ? this.textCombobox : this.textDropDown);
|
||||
specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr();
|
||||
if (specProps) {
|
||||
this._originalListProps = specProps;
|
||||
var count = specProps.get_ItemsCount();
|
||||
var arr = [];
|
||||
for (var i=0; i<count; i++) {
|
||||
(specProps.get_ItemValue(i)!=='') && arr.push({
|
||||
value: specProps.get_ItemValue(i),
|
||||
name: specProps.get_ItemDisplayText(i)
|
||||
});
|
||||
}
|
||||
this.list.store.reset(arr);
|
||||
var rec = null;
|
||||
if (arr.length>0 && this._state.internalId === this.internalId && (this._state.listValue!==undefined || this._state.listIndex!==undefined)) {
|
||||
if (this._state.listIndex!==undefined) {
|
||||
(this._state.listIndex>=this.list.store.length) && (this._state.listIndex = this.list.store.length-1);
|
||||
}
|
||||
rec = (this._state.listValue!==undefined) ? this.list.store.findWhere({value: this._state.listValue}) : this.list.store.at(this._state.listIndex);
|
||||
}
|
||||
if (rec) {
|
||||
this.list.selectRecord(rec);
|
||||
this.list.scrollToRecord(rec);
|
||||
} else {
|
||||
this.txtNewValue.setValue('');
|
||||
this._state.listValue = this._state.listIndex = undefined;
|
||||
}
|
||||
}
|
||||
this.disableListButtons();
|
||||
} else if (type == Asc.c_oAscContentControlSpecificType.CheckBox) {
|
||||
specProps = props.get_CheckBoxPr();
|
||||
this._originalCheckProps = specProps;
|
||||
}
|
||||
|
||||
// form settings
|
||||
var formPr = props.get_FormPr();
|
||||
if (formPr) {
|
||||
this._originalFormProps = formPr;
|
||||
|
||||
var data = [];
|
||||
if (type == Asc.c_oAscContentControlSpecificType.CheckBox)
|
||||
data = this.api.asc_GetCheckBoxFormKeys();
|
||||
else if (type == Asc.c_oAscContentControlSpecificType.Picture) {
|
||||
data = this.api.asc_GetPictureFormKeys();
|
||||
this.labelFormName.text(this.textImage);
|
||||
} else
|
||||
data = this.api.asc_GetTextFormKeys();
|
||||
if (!this._state.arrKey || this._state.arrKey.length!==data.length || _.difference(this._state.arrKey, data).length>0) {
|
||||
var arr = [];
|
||||
data.forEach(function(item) {
|
||||
arr.push({ displayValue: item, value: item });
|
||||
});
|
||||
this.cmbKey.setData(arr);
|
||||
this._state.arrKey=data;
|
||||
}
|
||||
|
||||
val = formPr.get_Key();
|
||||
if (this._state.Key!==val) {
|
||||
this.cmbKey.setValue(val ? val : '');
|
||||
this._state.Key=val;
|
||||
}
|
||||
|
||||
if (val) {
|
||||
val = this.api.asc_GetFormsCountByKey(val);
|
||||
connected = (val>1);
|
||||
}
|
||||
connected && this.labelConnectedFields.text(this.textConnected + ': ' + val);
|
||||
|
||||
val = formPr.get_HelpText();
|
||||
if (this._state.help!==val) {
|
||||
this.textareaHelp.setValue(val ? val : '');
|
||||
this._state.help=val;
|
||||
}
|
||||
|
||||
if (type == Asc.c_oAscContentControlSpecificType.CheckBox && specProps) {
|
||||
val = specProps.get_GroupKey();
|
||||
var ischeckbox = (typeof val !== 'string');
|
||||
if (!ischeckbox) {
|
||||
data = this.api.asc_GetRadioButtonGroupKeys();
|
||||
if (!this._state.arrGroupKey || this._state.arrGroupKey.length!==data.length || _.difference(this._state.arrGroupKey, data).length>0) {
|
||||
var arr = [];
|
||||
data.forEach(function(item) {
|
||||
arr.push({ displayValue: item, value: item });
|
||||
});
|
||||
this.cmbGroupKey.setData(arr);
|
||||
this._state.arrGroupKey=data;
|
||||
}
|
||||
|
||||
if (this._state.groupKey!==val) {
|
||||
this.cmbGroupKey.setValue(val ? val : '');
|
||||
this._state.groupKey=val;
|
||||
}
|
||||
}
|
||||
|
||||
this.labelFormName.text(ischeckbox ? this.textCheckbox : this.textRadiobox);
|
||||
}
|
||||
}
|
||||
|
||||
var formTextPr = props.get_TextFormPr();
|
||||
if (formTextPr) {
|
||||
this._originalTextFormProps = formTextPr;
|
||||
|
||||
this.labelFormName.text(this.textField);
|
||||
val = formTextPr.get_Comb();
|
||||
if ( this._state.Comb!==val ) {
|
||||
this.chComb.setValue(!!val, true);
|
||||
this._state.Comb=val;
|
||||
}
|
||||
|
||||
this.btnColor.setDisabled(!val);
|
||||
|
||||
this.spnWidth.setDisabled(!val);
|
||||
val = formTextPr.get_Width();
|
||||
if ( (val===undefined || this._state.Width===undefined)&&(this._state.Width!==val) || Math.abs(this._state.Width-val)>0.1) {
|
||||
this.spnWidth.setValue(val!==0 && val!==undefined ? Common.Utils.Metric.fnRecalcFromMM(val * 25.4 / 20 / 72.0) : -1, true);
|
||||
this._state.Width=val;
|
||||
}
|
||||
|
||||
val = this.api.asc_GetTextFormAutoWidth();
|
||||
if ( (this._state.WidthPlaceholder!==val) || Math.abs(this._state.WidthPlaceholder-val)>0.01) {
|
||||
this.spnWidth.setDefaultValue(val!==undefined && val!==null ? Common.Utils.Metric.fnRecalcFromMM(val) : this.spnWidth.options.minValue);
|
||||
this._state.WidthPlaceholder=val;
|
||||
}
|
||||
|
||||
val = formTextPr.get_MaxCharacters();
|
||||
this.chMaxChars.setValue(val && val>=0);
|
||||
this.spnMaxChars.setDisabled(!val || val<0);
|
||||
if ( (val===undefined || this._state.MaxChars===undefined)&&(this._state.MaxChars!==val) || Math.abs(this._state.MaxChars-val)>0.1) {
|
||||
this.spnMaxChars.setValue(val && val>=0 ? val : 10, true);
|
||||
this._state.MaxChars=val;
|
||||
}
|
||||
|
||||
var brd = formTextPr.get_CombBorder();
|
||||
if (brd) {
|
||||
var color = brd.get_Color();
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
this.BorderColor = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() };
|
||||
} else {
|
||||
this.BorderColor = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
|
||||
}
|
||||
} else
|
||||
this.BorderColor = 'transparent';
|
||||
} else
|
||||
this.BorderColor = 'transparent';
|
||||
|
||||
var type1 = typeof(this.BorderColor),
|
||||
type2 = typeof(this._state.BorderColor);
|
||||
if ( (type1 !== type2) || (type1=='object' &&
|
||||
(this.BorderColor.effectValue!==this._state.BorderColor.effectValue || this._state.BorderColor.color.indexOf(this.BorderColor.color)<0)) ||
|
||||
(type1!='object' && this._state.BorderColor.indexOf(this.BorderColor)<0 )) {
|
||||
|
||||
this.btnColor.setColor(this.BorderColor);
|
||||
this.mnuColorPicker.clearSelection();
|
||||
this.mnuNoBorder.setChecked(this.BorderColor == 'transparent', true);
|
||||
(this.BorderColor != 'transparent') && this.mnuColorPicker.selectByRGB(typeof(this.BorderColor) == 'object' ? this.BorderColor.color : this.BorderColor,true);
|
||||
this._state.BorderColor = this.BorderColor;
|
||||
}
|
||||
}
|
||||
|
||||
this._noApply = false;
|
||||
|
||||
this.KeySettingsTd.toggleClass('padding-small', !connected);
|
||||
this.ConnectedSettings.toggleClass('hidden', !connected);
|
||||
if (this.type !== type || type == Asc.c_oAscContentControlSpecificType.CheckBox)
|
||||
this.showHideControls(type, formTextPr, specProps);
|
||||
this.type = type;
|
||||
|
||||
this._state.internalId = this.internalId;
|
||||
}
|
||||
},
|
||||
|
||||
updateMetricUnit: function() {
|
||||
if (this.spinners) {
|
||||
for (var i=0; i<this.spinners.length; i++) {
|
||||
var spinner = this.spinners[i];
|
||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||
}
|
||||
var val = this._state.Width;
|
||||
this.spnWidth && this.spnWidth.setMinValue(Common.Utils.Metric.fnRecalcFromMM(1));
|
||||
this.spnWidth && this.spnWidth.setValue(val!==0 && val!==undefined ? Common.Utils.Metric.fnRecalcFromMM(val * 25.4 / 20 / 72.0) : -1, true);
|
||||
}
|
||||
},
|
||||
|
||||
UpdateThemeColors: function() {
|
||||
if (this._initSettings) return;
|
||||
|
||||
if (!this.btnColor) {
|
||||
this.btnColor = new Common.UI.ColorButton({
|
||||
parentEl: (this.$el || $(this.el)).findById('#form-color-btn'),
|
||||
additionalItems: [
|
||||
this.mnuNoBorder = new Common.UI.MenuItem({
|
||||
style: 'padding-left:20px;',
|
||||
caption: this.textNoBorder,
|
||||
toggleGroup: 'form-settings-no-border',
|
||||
checkable: true
|
||||
}), {caption: '--'}],
|
||||
menu : true,
|
||||
colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600',
|
||||
'808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966',
|
||||
'33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF',
|
||||
'993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF'
|
||||
],
|
||||
paletteHeight: 94
|
||||
});
|
||||
this.lockedControls.push(this.btnColor);
|
||||
this.mnuNoBorder.on('click', _.bind(this.onNoBorderClick, this));
|
||||
this.btnColor.on('color:select', this.onColorPickerSelect.bind(this));
|
||||
this.btnColor.setMenu();
|
||||
this.mnuColorPicker = this.btnColor.getPicker();
|
||||
}
|
||||
},
|
||||
|
||||
onHideMenus: function(menu, e, isFromInputControl){
|
||||
if (!isFromInputControl) this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
setLocked: function (locked) {
|
||||
this._locked = locked;
|
||||
},
|
||||
|
||||
disableControls: function(disable) {
|
||||
if (this._initSettings) return;
|
||||
|
||||
var me = this;
|
||||
if (this._state.DisabledControls!==(this._state.LockDelete || disable)) {
|
||||
this._state.DisabledControls = this._state.LockDelete || disable;
|
||||
_.each(this.lockedControls, function(item) {
|
||||
item.setDisabled(me._state.DisabledControls);
|
||||
});
|
||||
}
|
||||
this.btnLockForm.setDisabled(disable);
|
||||
},
|
||||
|
||||
showHideControls: function(type, textProps, specProps) {
|
||||
var textOnly = false,
|
||||
checkboxOnly = false,
|
||||
radioboxOnly = false,
|
||||
listOnly = false,
|
||||
imageOnly = false;
|
||||
if (type == Asc.c_oAscContentControlSpecificType.ComboBox || type == Asc.c_oAscContentControlSpecificType.DropDownList) {
|
||||
listOnly = !!specProps;
|
||||
} else if (type == Asc.c_oAscContentControlSpecificType.CheckBox) {
|
||||
if (specProps) {
|
||||
checkboxOnly = (typeof specProps.get_GroupKey() !== 'string');
|
||||
radioboxOnly = !checkboxOnly;
|
||||
}
|
||||
} else if (type == Asc.c_oAscContentControlSpecificType.Picture) {
|
||||
imageOnly = true;
|
||||
} else if (type == Asc.c_oAscContentControlSpecificType.None) {
|
||||
textOnly = !!textProps;
|
||||
}
|
||||
this.TextOnlySettings.toggleClass('hidden', !textOnly);
|
||||
this.ListOnlySettings.toggleClass('hidden', !listOnly);
|
||||
this.ImageOnlySettings.toggleClass('hidden', !imageOnly);
|
||||
this.RadioOnlySettings.toggleClass('hidden', !radioboxOnly);
|
||||
this.KeySettings.toggleClass('hidden', radioboxOnly);
|
||||
var value = (checkboxOnly || radioboxOnly);
|
||||
this.PlaceholderSettings.toggleClass('hidden', value);
|
||||
this.CheckOnlySettings.toggleClass('hidden', !value);
|
||||
},
|
||||
|
||||
onSelectItem: function(listView, itemView, record) {
|
||||
this.txtNewValue.setValue(record.get('name'));
|
||||
this._state.listValue = record.get('name');
|
||||
this._state.listIndex = undefined;
|
||||
this.disableListButtons(false);
|
||||
},
|
||||
|
||||
onDisconnect: function() {
|
||||
this.onKeyChanged(this.cmbKey, {value: ""});
|
||||
},
|
||||
|
||||
disableListButtons: function(disabled) {
|
||||
if (disabled===undefined)
|
||||
disabled = !this.list.getSelectedRec();
|
||||
this.btnListDelete.setDisabled(disabled || this._state.DisabledControls);
|
||||
this.btnListUp.setDisabled(disabled || this._state.DisabledControls);
|
||||
this.btnListDown.setDisabled(disabled || this._state.DisabledControls);
|
||||
},
|
||||
|
||||
textField: 'Text Field',
|
||||
textKey: 'Key',
|
||||
textPlaceholder: 'Placeholder',
|
||||
textTip: 'Tip',
|
||||
textMaxChars: 'Characters limit',
|
||||
textComb: 'Comb of characters',
|
||||
textWidth: 'Cell width',
|
||||
textDelete: 'Delete',
|
||||
textLock: 'Lock',
|
||||
textUnlock: 'Unlock',
|
||||
textRadiobox: 'Radio Button',
|
||||
textCheckbox: 'Checkbox',
|
||||
textCombobox: 'Combo Box',
|
||||
textDropDown: 'Dropdown',
|
||||
textImage: 'Image',
|
||||
textGroupKey: 'Group key',
|
||||
textTipAdd: 'Add new value',
|
||||
textTipDelete: 'Delete value',
|
||||
textTipUp: 'Move up',
|
||||
textTipDown: 'Move down',
|
||||
textValue: 'Value Options',
|
||||
textSelectImage: 'Select Image',
|
||||
textFromUrl: 'From URL',
|
||||
textFromFile: 'From File',
|
||||
textFromStorage: 'From Storage',
|
||||
textColor: 'Border color',
|
||||
textConnected: 'Fields connected',
|
||||
textDisconnect: 'Disconnect',
|
||||
textNoBorder: 'No border'
|
||||
|
||||
}, DE.Views.FormSettings || {}));
|
||||
});
|
281
apps/documenteditor/main/app/view/FormsTab.js
Normal file
|
@ -0,0 +1,281 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2020
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* FormsTab.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 06.10.2020
|
||||
* Copyright (c) 2020 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.FormsTab = Common.UI.BaseView.extend(_.extend((function(){
|
||||
function setEvents() {
|
||||
var me = this;
|
||||
this.btnTextField.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['text']);
|
||||
});
|
||||
this.btnComboBox.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['combobox']);
|
||||
});
|
||||
this.btnDropDown.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['dropdown']);
|
||||
});
|
||||
this.btnCheckBox.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['checkbox']);
|
||||
});
|
||||
this.btnRadioBox.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['radiobox']);
|
||||
});
|
||||
this.btnImageField.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['picture']);
|
||||
});
|
||||
this.btnViewForm.on('click', function (b, e) {
|
||||
me.fireEvent('forms:mode', [b.pressed]);
|
||||
});
|
||||
if (this.mnuFormsColorPicker) {
|
||||
this.btnClearFields.on('click', function (b, e) {
|
||||
me.fireEvent('forms:clear');
|
||||
});
|
||||
$('#id-toolbar-menu-new-form-color').on('click', function (b, e) {
|
||||
me.fireEvent('forms:new-color');
|
||||
});
|
||||
this.mnuNoFormsColor.on('click', function (item) {
|
||||
me.fireEvent('forms:no-color', [item]);
|
||||
});
|
||||
this.mnuFormsColorPicker.on('select', function(picker, color) {
|
||||
me.fireEvent('forms:select-color', [color]);
|
||||
});
|
||||
this.btnHighlight.menu.on('show:after', function(picker, color) {
|
||||
me.fireEvent('forms:open-color', [color]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
options: {},
|
||||
|
||||
initialize: function (options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this);
|
||||
this.toolbar = options.toolbar;
|
||||
|
||||
this.paragraphControls = [];
|
||||
|
||||
var me = this,
|
||||
$host = me.toolbar.$el;
|
||||
|
||||
this.btnTextField = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-field'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-text-field',
|
||||
caption: this.capBtnText,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnTextField);
|
||||
|
||||
this.btnComboBox = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-combobox'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-combo-box',
|
||||
caption: this.capBtnComboBox,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnComboBox);
|
||||
|
||||
this.btnDropDown = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-dropdown'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-dropdown',
|
||||
caption: this.capBtnDropDown,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnDropDown);
|
||||
|
||||
this.btnCheckBox = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-checkbox'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-checkbox',
|
||||
caption: this.capBtnCheckBox,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnCheckBox);
|
||||
|
||||
this.btnRadioBox = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-radiobox'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-radio-button',
|
||||
caption: this.capBtnRadioBox,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnRadioBox);
|
||||
|
||||
this.btnImageField = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-image'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-insertimage',
|
||||
caption: this.capBtnImage,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnImageField);
|
||||
|
||||
this.btnViewForm = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-form-view'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-sheet-view',
|
||||
caption: this.capBtnView,
|
||||
enableToggle: true,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnViewForm);
|
||||
|
||||
this.btnClearFields = new Common.UI.Button({
|
||||
parentEl : $host.find('#slot-form-clear-fields'),
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'toolbar__icon btn-clearstyle',
|
||||
caption : this.textClearFields,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnClearFields);
|
||||
|
||||
this.btnHighlight = new Common.UI.Button({
|
||||
parentEl : $host.find('#slot-form-highlight'),
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'toolbar__icon btn-highlight',
|
||||
caption : this.textHighlight,
|
||||
menu : true,
|
||||
disabled: true
|
||||
});
|
||||
this.paragraphControls.push(this.btnHighlight);
|
||||
|
||||
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(){
|
||||
if (config.canEditContentControl) {
|
||||
me.btnHighlight.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
me.mnuNoFormsColor = new Common.UI.MenuItem({
|
||||
id: 'id-toolbar-menu-no-highlight-form',
|
||||
caption: me.textNoHighlight,
|
||||
checkable: true,
|
||||
checked: me.btnHighlight.currentColor === null
|
||||
}),
|
||||
{caption: '--'},
|
||||
{template: _.template('<div id="id-toolbar-menu-form-color" style="width: 169px; height: 94px; margin: 10px;"></div>')},
|
||||
{template: _.template('<a id="id-toolbar-menu-new-form-color" style="padding-left:12px;">' + me.textNewColor + '</a>')}
|
||||
]
|
||||
}));
|
||||
me.mnuFormsColorPicker = new Common.UI.ThemeColorPalette({
|
||||
el: $('#id-toolbar-menu-form-color'),
|
||||
colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600',
|
||||
'808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966',
|
||||
'33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF',
|
||||
'993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF'
|
||||
],
|
||||
value: me.btnHighlight.currentColor
|
||||
});
|
||||
var colorVal = $('<div class="btn-color-value-line"></div>');
|
||||
$('button:first-child', me.btnHighlight.cmpEl).append(colorVal);
|
||||
colorVal.css('background-color', me.btnHighlight.currentColor ? '#' + me.btnHighlight.currentColor : 'transparent');
|
||||
} else {
|
||||
me.btnHighlight.cmpEl.parents('.group').hide().prev('.separator').hide();
|
||||
}
|
||||
|
||||
me.btnTextField.updateHint(me.tipTextField);
|
||||
me.btnComboBox.updateHint(me.tipComboBox);
|
||||
me.btnDropDown.updateHint(me.tipDropDown);
|
||||
me.btnCheckBox.updateHint(me.tipCheckBox);
|
||||
me.btnRadioBox.updateHint(me.tipRadioBox);
|
||||
me.btnImageField.updateHint(me.tipImageField);
|
||||
me.btnViewForm.updateHint(me.tipViewForm);
|
||||
|
||||
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);
|
||||
},
|
||||
|
||||
capBtnText: 'Text Field',
|
||||
capBtnComboBox: 'Combo Box',
|
||||
capBtnDropDown: 'Dropdown',
|
||||
capBtnCheckBox: 'Checkbox',
|
||||
capBtnRadioBox: 'Radio Button',
|
||||
capBtnImage: 'Image',
|
||||
capBtnView: 'Fill Form',
|
||||
textClearFields: 'Clear All Fields',
|
||||
textHighlight: 'Highlight Settings',
|
||||
tipTextField: 'Insert text field',
|
||||
tipComboBox: 'Insert combo box',
|
||||
tipDropDown: 'Insert dropdown list',
|
||||
tipCheckBox: 'Insert checkbox',
|
||||
tipRadioBox: 'Insert radio button',
|
||||
tipImageField: 'Insert image',
|
||||
tipViewForm: 'Fill form mode',
|
||||
textNoHighlight: 'No highlighting',
|
||||
textNewColor: 'Add New Custom Color'
|
||||
}
|
||||
}()), DE.Views.FormsTab || {}));
|
||||
});
|
|
@ -214,6 +214,7 @@ define([
|
|||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||
}
|
||||
this.numPosition && this.numPosition.setValue(Common.Utils.Metric.fnRecalcFromMM(this._state.Position), true);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ define([
|
|||
'<div class="input-row">',
|
||||
'<label>' + this.textUrl + '</label>',
|
||||
'</div>',
|
||||
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;border: 1px solid #cfcfcf;"></div>',
|
||||
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;"></div>',
|
||||
'</div>',
|
||||
'<div class="input-row">',
|
||||
'<label>' + this.textDisplay + '</label>',
|
||||
|
@ -169,7 +169,8 @@ define([
|
|||
me.internalList = new Common.UI.TreeView({
|
||||
el: $('#id-dlg-hyperlink-list'),
|
||||
store: new Common.UI.TreeViewStore(),
|
||||
enableKeyEvents: true
|
||||
enableKeyEvents: true,
|
||||
tabindex: 1
|
||||
});
|
||||
me.internalList.on('item:select', _.bind(this.onSelectItem, this));
|
||||
|
||||
|
@ -183,6 +184,10 @@ define([
|
|||
me.internalPanel = $window.find('#id-internal-link');
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputDisplay, this.inputTip];
|
||||
},
|
||||
|
||||
ShowHideElem: function(value) {
|
||||
this.externalPanel.toggleClass('hidden', value !== c_oHyperlinkType.WebLink);
|
||||
this.internalPanel.toggleClass('hidden', value !== c_oHyperlinkType.InternalLink);
|
||||
|
@ -269,8 +274,17 @@ define([
|
|||
}
|
||||
var rec = this.internalList.getSelectedRec();
|
||||
this.btnOk.setDisabled(!rec || rec.get('level')==0 && rec.get('index')>0);
|
||||
} else
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.inputDisplay.focus();
|
||||
},50);
|
||||
} else {
|
||||
this.btnOk.setDisabled($.trim(this.inputUrl.getValue())=='');
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.inputUrl.focus();
|
||||
},50);
|
||||
}
|
||||
},
|
||||
|
||||
onLinkTypeClick: function(type, btn, event) {
|
||||
|
@ -296,11 +310,6 @@ define([
|
|||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.inputUrl.cmpEl.find('input').focus();
|
||||
},50);
|
||||
},
|
||||
|
||||
setSettings: function (props) {
|
||||
|
@ -414,7 +423,7 @@ define([
|
|||
if (this.btnExternal.isActive()) {//WebLink
|
||||
if (this.inputUrl.checkValidate() !== true) {
|
||||
this.isInputFirstChange = true;
|
||||
this.inputUrl.cmpEl.find('input').focus();
|
||||
this.inputUrl.focus();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -423,7 +432,7 @@ define([
|
|||
return;
|
||||
}
|
||||
if (this.inputDisplay.checkValidate() !== true) {
|
||||
this.inputDisplay.cmpEl.find('input').focus();
|
||||
this.inputDisplay.focus();
|
||||
return;
|
||||
}
|
||||
(!this._originalProps.get_Bookmark() && !this._originalProps.get_Value()) && Common.Utils.InternalSettings.set("de-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink
|
||||
|
|