Merge branch 'develop' into feature/Bug_45361
15
.github/workflows/check.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
name: check
|
||||
on: [push]
|
||||
jobs:
|
||||
project-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 12
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Build using grunt
|
||||
run: |
|
||||
npm install --prefix build
|
||||
grunt --level=ADVANCED --base build --gruntfile build/Gruntfile.js
|
|
@ -1,9 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '12'
|
||||
before_install: npm install -g grunt-cli
|
||||
before_script:
|
||||
- cd build
|
||||
script:
|
||||
- npm install
|
||||
- grunt --level=ADVANCED
|
|
@ -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>,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,6 +332,8 @@
|
|||
if ( msg ) {
|
||||
if ( msg.type === "onExternalPluginMessage" ) {
|
||||
_sendCommand(msg);
|
||||
} else if (msg.type === "onExternalPluginMessageCallback") {
|
||||
postMessage(window.parent, msg);
|
||||
} else
|
||||
if ( msg.frameEditorId == placeholderId ) {
|
||||
var events = _config.events || {},
|
||||
|
@ -848,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")
|
||||
{
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
}
|
||||
|
||||
function getDocumentData(urlParams) {
|
||||
return {
|
||||
let docparams = {
|
||||
key: urlParams["key"],
|
||||
url: urlParams["url"] || '_offline_',
|
||||
title: urlParams["title"],
|
||||
|
@ -91,6 +91,11 @@
|
|||
download: true
|
||||
}
|
||||
};
|
||||
|
||||
if (urlParams['mode'] == 'review')
|
||||
docparams.permissions.edit = !(docparams.permissions.review = true);
|
||||
|
||||
return docparams;
|
||||
}
|
||||
|
||||
function getEditorConfig(urlParams) {
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@ define([
|
|||
displayField: 'displayValue',
|
||||
valueField : 'value',
|
||||
search : false,
|
||||
scrollAlwaysVisible: false
|
||||
scrollAlwaysVisible: false,
|
||||
takeFocusOnClose: false
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
|
@ -304,6 +305,9 @@ define([
|
|||
if ($list.hasClass('menu-absolute')) {
|
||||
var offset = this.cmpEl.offset();
|
||||
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
|
||||
} else if ($list.hasClass('menu-aligned')) {
|
||||
var offset = this.cmpEl.offset();
|
||||
$list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight());
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -322,6 +326,9 @@ define([
|
|||
$list.scrollTop(height);
|
||||
}
|
||||
setTimeout(function(){$selected.find('.dropdown-item').focus();}, 1);
|
||||
} else {
|
||||
var me = this;
|
||||
setTimeout(function(){me.cmpEl.find('.dropdown li:first .dropdown-item').focus();}, 1);
|
||||
}
|
||||
|
||||
if (this.scroller)
|
||||
|
@ -342,10 +349,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 +682,10 @@ define([
|
|||
wheelSpeed: 10,
|
||||
alwaysVisibleY: this.scrollAlwaysVisible
|
||||
}, this.options.scroller));
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this._input && this._input.focus();
|
||||
}
|
||||
}
|
||||
})());
|
||||
|
@ -687,6 +707,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));
|
||||
|
@ -199,7 +202,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 +304,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 +341,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) {
|
||||
this.__name = name;
|
||||
if (!this.__nameId) {
|
||||
this.__nameId = setTimeout(function () {
|
||||
me.onApiChangeFontInternal(me.__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());
|
||||
|
||||
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.focus();
|
||||
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.focus();
|
||||
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() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
201
apps/common/main/lib/component/TextareaField.js
Normal file
|
@ -0,0 +1,201 @@
|
|||
/*
|
||||
*
|
||||
* (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)
|
||||
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);
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
|
@ -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',
|
||||
|
|
|
@ -291,7 +291,7 @@ define([
|
|||
|
||||
return false;
|
||||
},
|
||||
onShowComment: function (id, selected) {
|
||||
onShowComment: function (id, selected, fromLeftPanelSelection) {
|
||||
var comment = this.findComment(id);
|
||||
if (comment) {
|
||||
if (null !== comment.get('quote')) {
|
||||
|
@ -319,9 +319,11 @@ define([
|
|||
this.isSelectedComment = selected;
|
||||
}
|
||||
|
||||
this.api.asc_selectComment(id);
|
||||
this._dontScrollToComment = true;
|
||||
this.api.asc_showComment(id,false);
|
||||
if (!fromLeftPanelSelection || !((0 === _.difference(this.uids, [id]).length) && (0 === _.difference([id], this.uids).length))) {
|
||||
this.api.asc_selectComment(id);
|
||||
this._dontScrollToComment = true;
|
||||
this.api.asc_showComment(id,false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
@ -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 || {}));
|
||||
});
|
|
@ -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});
|
||||
|
@ -84,14 +86,10 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
'<div class="separator horizontal"></div>',
|
||||
'<div class="footer center">',
|
||||
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>',
|
||||
'<button class="btn normal dlg-btn primary can-apply d-none" result="ok" style="width: 86px;">' + this.okButtonText + '</button>',
|
||||
'<button class="btn normal dlg-btn can-apply d-none" result="cancel" style="width: 86px;">' + this.cancelButtonText + '</button>',
|
||||
'</div>'
|
||||
].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";
|
||||
|
@ -105,44 +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) : [];
|
||||
|
||||
if (this.appPrefix=='de-') {
|
||||
var me = this;
|
||||
this.options.handler = function(result, value) {
|
||||
if ( result == 'ok' ) {
|
||||
var value = me.chBulleted.getValue()==='checked';
|
||||
Common.localStorage.setBool("de-settings-autoformat-bulleted", value);
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-bulleted", value);
|
||||
me.api.asc_SetAutomaticBulletedLists(value);
|
||||
|
||||
value = me.chNumbered.getValue()==='checked';
|
||||
Common.localStorage.setBool("de-settings-autoformat-numbered", value);
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-numbered", value);
|
||||
me.api.asc_SetAutomaticNumberedLists(value);
|
||||
|
||||
value = me.chQuotes.getValue()==='checked';
|
||||
Common.localStorage.setBool("de-settings-autoformat-smart-quotes", value);
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-smart-quotes", value);
|
||||
me.api.asc_SetAutoCorrectSmartQuotes(value);
|
||||
|
||||
value = me.chHyphens.getValue()==='checked';
|
||||
Common.localStorage.setBool("de-settings-autoformat-hyphens", value);
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-hyphens", value);
|
||||
me.api.asc_SetAutoCorrectHyphensWithDash(value);
|
||||
}
|
||||
};
|
||||
} else if (this.appPrefix=='sse-') {
|
||||
var me = this;
|
||||
this.options.handler = function(result, value) {
|
||||
if ( result == 'ok' ) {
|
||||
var value = me.chNewRows.getValue()==='checked';
|
||||
Common.localStorage.setBool("sse-settings-autoformat-new-rows", value);
|
||||
Common.Utils.InternalSettings.set("sse-settings-autoformat-new-rows", value);
|
||||
me.api.asc_setIncludeNewRowColTable(value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
|
@ -168,16 +128,17 @@ 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([
|
||||
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
|
||||
'<div style="min-width:110px;padding-right: 5px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
|
||||
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
|
||||
'<div style="width:110px;padding-right: 5px;overflow: hidden;text-overflow: ellipsis;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
|
||||
'<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));
|
||||
|
||||
|
@ -185,6 +146,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
el : $window.find('#auto-correct-replace'),
|
||||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
maxLength : 31,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
var _selectedItem;
|
||||
|
@ -215,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);
|
||||
|
||||
}
|
||||
|
@ -225,6 +187,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
el : $window.find('#auto-correct-by'),
|
||||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
maxLength : 255,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
me.updateControls();
|
||||
|
@ -251,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="<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
|
||||
'<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));
|
||||
|
||||
|
@ -265,6 +229,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
el : $window.find('#auto-correct-rec-find'),
|
||||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
maxLength : 255,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
var _selectedItem;
|
||||
|
@ -295,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);
|
||||
|
||||
}
|
||||
|
@ -316,41 +281,62 @@ 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,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-smart-quotes")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-smart-quotes", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-smart-quotes", checked);
|
||||
me.api.asc_SetAutoCorrectSmartQuotes(checked);
|
||||
});
|
||||
this.chHyphens = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-hyphens'),
|
||||
labelText: this.textHyphens,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyphens")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyphens", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyphens", checked);
|
||||
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
|
||||
});
|
||||
this.chBulleted = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-bulleted'),
|
||||
labelText: this.textBulleted,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-bulleted")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-bulleted", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-bulleted", checked);
|
||||
me.api.asc_SetAutomaticBulletedLists(checked);
|
||||
});
|
||||
this.chNumbered = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-numbered'),
|
||||
labelText: this.textNumbered,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||
me.api.asc_SetAutomaticNumberedLists(checked);
|
||||
});
|
||||
} else if (this.appPrefix=='sse-') {
|
||||
this.chNewRows = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-new-rows'),
|
||||
labelText: this.textNewRowCol,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-new-rows", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
|
||||
me.api.asc_setIncludeNewRowColTable(checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.applyButtons = $window.find('.dlg-btn.can-apply');
|
||||
this.closeButtons = $window.find('.dlg-btn:not(.can-apply)');
|
||||
|
||||
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
|
||||
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
|
||||
this.btnsCategory[2] && this.btnsCategory[2].on('click', _.bind(this.updateFooterButtons, this, true));
|
||||
|
||||
this.afterRender();
|
||||
},
|
||||
|
@ -364,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;
|
||||
},
|
||||
|
@ -402,7 +395,6 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
var value = this.getActiveCategory();
|
||||
if (value==0) this.onMathCategoryClick(true);
|
||||
else if (value==1) this.onRecCategoryClick(true);
|
||||
this.updateFooterButtons(value>1);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
|
@ -412,16 +404,14 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
},
|
||||
|
||||
onMathCategoryClick: function(delay) {
|
||||
this.updateFooterButtons(false);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
$('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);
|
||||
}
|
||||
|
@ -444,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'));
|
||||
}
|
||||
|
@ -466,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'));});
|
||||
|
@ -496,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
|
||||
|
@ -533,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);
|
||||
});
|
||||
|
@ -547,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;
|
||||
|
@ -593,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;
|
||||
|
@ -630,7 +620,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
});
|
||||
}
|
||||
});
|
||||
this.functionsStore.reset(data.concat(dataAdd));
|
||||
_functionsStore.reset(data.concat(dataAdd));
|
||||
this.updateRecControls();
|
||||
},
|
||||
|
||||
|
@ -660,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();
|
||||
|
@ -673,16 +663,14 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
},
|
||||
|
||||
onRecCategoryClick: function(delay) {
|
||||
this.updateFooterButtons(false);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
$('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);
|
||||
}
|
||||
|
@ -705,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'));
|
||||
}
|
||||
|
@ -726,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
|
||||
|
@ -766,12 +754,6 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
this.btnAddRec.setDisabled(!!rec || !value);
|
||||
},
|
||||
|
||||
updateFooterButtons: function(apply) {
|
||||
this.applyButtons.toggleClass('d-none', !apply);
|
||||
this.closeButtons.toggleClass('d-none', apply);
|
||||
},
|
||||
|
||||
|
||||
textTitle: 'AutoCorrect',
|
||||
textMathCorrect: 'Math AutoCorrect',
|
||||
textReplace: 'Replace',
|
||||
|
|
|
@ -283,7 +283,16 @@ define([
|
|||
} else if (!btn.hasClass('msg-reply') &&
|
||||
!btn.hasClass('btn-resolve-check') &&
|
||||
!btn.hasClass('btn-resolve')) {
|
||||
me.fireEvent('comment:show', [commentId, false]);
|
||||
var isTextSelected = false;
|
||||
if (btn.hasClass('user-message')) {
|
||||
if (window.getSelection) {
|
||||
var selection = window.getSelection();
|
||||
isTextSelected = (selection.toString()!=='')
|
||||
} else if (document.selection) {
|
||||
isTextSelected = document.selection;
|
||||
}
|
||||
}
|
||||
me.fireEvent('comment:show', [commentId, false, isTextSelected]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -78,7 +78,7 @@ define([
|
|||
blankError : me.options.error ? me.options.error : me.textLabelError,
|
||||
style : 'width: 100%;',
|
||||
validateOnBlur: false,
|
||||
validation : function(value) {
|
||||
validation : me.options.validation || function(value) {
|
||||
return value ? true : '';
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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, {
|
||||
|
|
|
@ -102,7 +102,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});
|
||||
|
@ -110,6 +112,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('d-none', 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) {
|
||||
|
|
131
apps/common/main/lib/view/OptionsDialog.js
Normal file
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* OptionsDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 15.10.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
define([
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/RadioBox'
|
||||
], function () { 'use strict';
|
||||
|
||||
Common.Views.OptionsDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
width: 214,
|
||||
header: true,
|
||||
style: 'min-width: 214px;',
|
||||
cls: 'modal-dlg',
|
||||
items: [],
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
_.extend(this.options, options || {});
|
||||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<% 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);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var me = this,
|
||||
$window = me.getChild(),
|
||||
items = this.options.items,
|
||||
checked = true,
|
||||
checkedIndex = -1;
|
||||
if (items) {
|
||||
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 || item.checked)&& !item.disabled) {
|
||||
checked = false;
|
||||
checkedIndex = i;
|
||||
}
|
||||
}
|
||||
(checkedIndex>=0) && this.radio[checkedIndex].setValue(true);
|
||||
}
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state);
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
return this.currentCell;
|
||||
},
|
||||
|
||||
onPrimary: function() {
|
||||
this._handleInput('ok');
|
||||
return false;
|
||||
}
|
||||
|
||||
}, Common.Views.OptionsDialog || {}))
|
||||
});
|
|
@ -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"));
|
||||
},
|
||||
|
|
|
@ -817,7 +817,7 @@ define([
|
|||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
this._handleInput(event.currentTarget.attributes['result'].value, true);
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
|
@ -825,7 +825,11 @@ define([
|
|||
return false;
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
_handleInput: function(state, fromButton) {
|
||||
if(!fromButton && document.activeElement && document.activeElement.localName == 'textarea' && /area_id/.test(document.activeElement.id)){
|
||||
return;
|
||||
}
|
||||
|
||||
var special = this.btnSpecial.isActive();
|
||||
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
|
||||
if (this.options.handler) {
|
||||
|
@ -1482,7 +1486,7 @@ define([
|
|||
this.specialPanel.toggleClass('d-none', !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: 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 |
|
@ -887,11 +887,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,11 @@
|
|||
.dropdown-menu.menu-absolute {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.dropdown-menu.show-top {
|
||||
top: auto;
|
||||
bottom: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.show > .combobox.combo-dataview-menu {
|
||||
|
|
|
@ -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(@black, 90%);
|
||||
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 slidein {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
#loadmask-spinner {
|
||||
animation-duration: .8s;
|
||||
animation-name: slidein;
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
white-space: pre-wrap;
|
||||
white-space: pre;
|
||||
text-align: center;
|
||||
|
||||
&::after {
|
||||
|
|
|
@ -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%;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -185,7 +185,7 @@ define([
|
|||
el.find('.color-palette a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
me.currentColor = color;
|
||||
if (effectId) {
|
||||
if (effectId!==undefined) {
|
||||
me.currentColor = {color: color, effectId: effectId};
|
||||
}
|
||||
me.trigger('select', me, me.currentColor);
|
||||
|
@ -214,7 +214,7 @@ define([
|
|||
}
|
||||
|
||||
if (/^[a-fA-F0-9]{6}|transparent$/.test(color) || _.indexOf(Common.Utils.ThemeColor.getStandartColors(), color) > -1 || _.indexOf(this.dynamicColors, color) > -1) {
|
||||
el.find('.color-palette a[data-color=' + color + ']').first().addClass('active');
|
||||
el.find('.standart-colors a[data-color=' + color + '], .dynamic-colors a[data-color=' + color + ']').first().addClass('active');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ define([
|
|||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
|
||||
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
|
||||
this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
|
||||
|
@ -229,6 +230,13 @@ define([
|
|||
me.initComments();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
|
||||
} else {
|
||||
var length = 0;
|
||||
_.each(editUsers, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
(length<1) && $('#item-edit-users').hide();
|
||||
|
||||
if(editor === 'DE' && !this.appConfig.canReview && !canViewReview) {
|
||||
$('#reviewing-settings').hide();
|
||||
}
|
||||
|
@ -241,6 +249,20 @@ define([
|
|||
editUsers = users;
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in editUsers) {
|
||||
if (undefined !== uid) {
|
||||
var user = editUsers[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
editUsers[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (editUsers[change.asc_getId()] = change);
|
||||
},
|
||||
|
||||
getUsersInfo: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
|
@ -250,7 +272,7 @@ define([
|
|||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
if((item.asc_getState()!==false) && !item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
|
@ -296,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));
|
||||
|
@ -808,9 +832,6 @@ define([
|
|||
me.indexCurrentComment = 0;
|
||||
me.updateViewComment();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(true);
|
||||
}
|
||||
},
|
||||
|
||||
apiHideComments: function() {
|
||||
|
@ -818,9 +839,6 @@ define([
|
|||
uiApp.closeModal();
|
||||
$('.container-view-comment').remove();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(false);
|
||||
}
|
||||
},
|
||||
|
||||
disabledViewComments: function(disabled) {
|
||||
|
@ -1339,8 +1357,11 @@ define([
|
|||
onEditComment: function(comment) {
|
||||
var value = $('#comment-text')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.comment = value;
|
||||
comment.userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
|
@ -1419,9 +1440,12 @@ define([
|
|||
onEditReply: function(comment, indReply) {
|
||||
var value = $('.edit-reply-textarea')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
|
@ -1438,6 +1462,8 @@ define([
|
|||
} else {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
rootView.router.back();
|
||||
|
@ -1512,7 +1538,9 @@ define([
|
|||
date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
@ -1533,8 +1561,10 @@ define([
|
|||
readSDKComment: function(id, data) {
|
||||
var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}),
|
||||
groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
var groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var username = data.asc_getUserName();
|
||||
var comment = {
|
||||
uid : id,
|
||||
|
@ -1575,7 +1605,9 @@ define([
|
|||
date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
comment.comment = data.asc_getText();
|
||||
comment.userid = data.asc_getUserId();
|
||||
comment.username = data.asc_getUserName();
|
||||
|
@ -1595,7 +1627,9 @@ define([
|
|||
dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<li id="item-edit-users">
|
||||
<a id="list-edit-users" class="item-link" data-page="#edit-users-view">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
|
|
|
@ -175,7 +175,7 @@ define([
|
|||
'<div class="item-inner">' +
|
||||
'<div class="header-comment"><div class="comment-left">';
|
||||
if (isAndroid) {
|
||||
template += '<div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>';
|
||||
template += '<div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>';
|
||||
}
|
||||
template += '<div class="user-name">' + me.getUserName(comment.username) + '</div>' +
|
||||
'<div class="comment-date">' + comment.date + '</div>';
|
||||
|
@ -200,7 +200,7 @@ define([
|
|||
'<div class="header-reply">' +
|
||||
'<div class="reply-left">';
|
||||
if (isAndroid) {
|
||||
template += '<div class="initials-reply" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>'
|
||||
template += '<div class="initials-reply" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>'
|
||||
}
|
||||
template += '<div class="user-name">' + me.getUserName(reply.username) + '</div>' +
|
||||
'<div class="reply-date">' + reply.date + '</div>' +
|
||||
|
@ -248,7 +248,7 @@ define([
|
|||
'<li class="comment item-content" data-uid="<%= item.uid %>">',
|
||||
'<div class="item-inner">',
|
||||
'<div class="header-comment"><div class="comment-left">',
|
||||
'<% if (android) { %><div class="initials-comment" style="background-color:<%= item.usercolor %> "> <%= item.userInitials %></div><div><% } %>',
|
||||
'<% if (android) { %><div class="initials-comment" style="background-color:<% if (item.usercolor!==null) { %><%=item.usercolor%><% } else { %> #cfcfcf <% } %>;"> <%= item.userInitials %></div><div><% } %>',
|
||||
'<div class="user-name"><%= scope.getUserName(item.username) %></div>',
|
||||
'<div class="comment-date"><%= item.date %></div>',
|
||||
'<% if (android) { %></div><% } %>',
|
||||
|
@ -270,7 +270,7 @@ define([
|
|||
'<li class="reply-item" data-ind="<%= reply.ind %>">',
|
||||
'<div class="header-reply">',
|
||||
'<div class="reply-left">',
|
||||
'<% if (android) { %><div class="initials-reply" style="background-color: <%= reply.usercolor %>;"><%= reply.userInitials %></div><div><% } %>',
|
||||
'<% if (android) { %><div class="initials-reply" style="background-color: <% if (reply.usercolor!==null) { %><%=reply.usercolor%><% } else { %> #cfcfcf <% } %>;"><%= reply.userInitials %></div><div><% } %>',
|
||||
'<div class="user-name"><%= scope.getUserName(reply.username) %></div>',
|
||||
'<div class="reply-date"><%= reply.date %></div>',
|
||||
'</div>',
|
||||
|
@ -304,7 +304,7 @@ define([
|
|||
var $pageEdit = $('.page-edit-comment .page-content');
|
||||
var isAndroid = Framework7.prototype.device.android === true;
|
||||
var template = '<div class="wrap-comment">' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>' : '') +
|
||||
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
|
||||
'<div class="comment-date">' + comment.date + '</div>' +
|
||||
(isAndroid ? '</div></div>' : '') +
|
||||
|
@ -330,7 +330,7 @@ define([
|
|||
var $pageEdit = $('.page-edit-reply .page-content');
|
||||
var isAndroid = Framework7.prototype.device.android === true;
|
||||
var template = '<div class="wrap-comment">' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>' : '') +
|
||||
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
|
||||
'<div class="comment-date">' + reply.date + '</div>' +
|
||||
(isAndroid ? '</div></div>' : '') +
|
||||
|
@ -401,7 +401,7 @@ define([
|
|||
'<div class="page-edit-comment">' +
|
||||
'<div class="page-content">' +
|
||||
'<div class="wrap-comment">' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>' : '') +
|
||||
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
|
||||
'<div class="comment-date">' + comment.date + '</div>' +
|
||||
(isAndroid ? '</div></div>' : '') +
|
||||
|
@ -427,7 +427,7 @@ define([
|
|||
'<div class="page add-comment">' +
|
||||
'<div class="page-content">' +
|
||||
'<div class="wrap-comment">' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>' : '') +
|
||||
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
|
||||
'<div class="comment-date">' + reply.date + '</div>' +
|
||||
(isAndroid ? '</div></div>' : '') +
|
||||
|
|
|
@ -164,3 +164,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -168,4 +168,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -91,12 +91,16 @@ DE.ApplicationController = new(function(){
|
|||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo();
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
_user.put_Id(config.user && config.user.id ? config.user.id : ('uid-' + Date.now()));
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
|
|
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"
|
||||
}
|
|
@ -24,5 +24,6 @@
|
|||
"DE.ApplicationController.waitText": "Čekejte prosím…",
|
||||
"DE.ApplicationView.txtDownload": "Stáhnout",
|
||||
"DE.ApplicationView.txtFullScreen": "Na celou obrazovku",
|
||||
"DE.ApplicationView.txtPrint": "Tisk",
|
||||
"DE.ApplicationView.txtShare": "Sdílet"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Hent",
|
||||
"DE.ApplicationView.txtEmbed": "Indlejre",
|
||||
"DE.ApplicationView.txtFullScreen": "Fuld skærm",
|
||||
"DE.ApplicationView.txtPrint": "Print",
|
||||
"DE.ApplicationView.txtShare": "Del"
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
"DE.ApplicationController.errorFilePassProtect": "Das Dokument ist kennwortgeschützt und kann nicht geöffnet werden.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Die Dateigröße überschreitet die für Ihren Server festgelegte Einschränkung.<br>Weitere Informationen können Sie von Ihrem Document Server-Administrator erhalten.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Die Internetverbindung wurde wiederhergestellt und die Dateiversion wurde geändert.<br>Bevor Sie weiterarbeiten können, müssen Sie die Datei herunterladen oder den Inhalt kopieren, um sicherzustellen, dass nichts verloren geht, und diese Seite anschließend neu laden.",
|
||||
"DE.ApplicationController.errorUserDrop": "Kein Zugriff auf diese Datei ist möglich.",
|
||||
"DE.ApplicationController.errorUserDrop": "Der Zugriff auf diese Datei ist nicht möglich.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Warnung",
|
||||
"DE.ApplicationController.scriptLoadError": "Die Verbindung ist zu langsam, einige der Komponenten konnten nicht geladen werden. Bitte laden Sie die Seite erneut.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Dokument wird geladen...",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Herunterladen",
|
||||
"DE.ApplicationView.txtEmbed": "Einbetten",
|
||||
"DE.ApplicationView.txtFullScreen": "Vollbild-Modus",
|
||||
"DE.ApplicationView.txtPrint": "Drucken",
|
||||
"DE.ApplicationView.txtShare": "Freigeben"
|
||||
}
|
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": "Διαμοιρασμός"
|
||||
}
|
|
@ -24,8 +24,8 @@
|
|||
"DE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.",
|
||||
"DE.ApplicationController.waitText": "Please, wait...",
|
||||
"DE.ApplicationView.txtDownload": "Download",
|
||||
"DE.ApplicationView.txtPrint": "Print",
|
||||
"DE.ApplicationView.txtEmbed": "Embed",
|
||||
"DE.ApplicationView.txtFullScreen": "Full Screen",
|
||||
"DE.ApplicationView.txtPrint": "Print",
|
||||
"DE.ApplicationView.txtShare": "Share"
|
||||
}
|
|
@ -5,26 +5,27 @@
|
|||
"common.view.modals.txtShare": "Compartir enlace",
|
||||
"common.view.modals.txtWidth": "Ancho",
|
||||
"DE.ApplicationController.convertationErrorText": "Fallo de conversión.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Límite de tiempo de conversión está superado.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Se superó el tiempo de espera de conversión.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Error",
|
||||
"DE.ApplicationController.downloadErrorText": "Fallo en descarga.",
|
||||
"DE.ApplicationController.downloadTextText": "Cargando documento...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Usted no tiene permisos para realizar la acción que está intentando hacer.<br> Por favor, contacte con su Administrador del Servidor de Documentos.",
|
||||
"DE.ApplicationController.downloadErrorText": "Error en la descarga",
|
||||
"DE.ApplicationController.downloadTextText": "Descargando documento...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Está tratando de realizar una acción para la cual no tiene permiso.<br> Por favor, contacte con su Administrador del Servidor de Documentos.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Código de error: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "El archivo está protegido por una contraseña y no puede ser abierto.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "El tamaño del archivo excede la limitación establecida para su servidor. Póngase en contacto con el administrador del Servidor de documentos para obtener más información.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "El tamaño del archivo excede el límite establecido para su servidor. Por favor póngase en contacto con el administrador del Servidor de Documentos para obtener más información.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "La conexión a Internet ha sido restaurada, y la versión del archivo ha sido cambiada. Antes de poder seguir trabajando, es necesario descargar el archivo o copiar su contenido para asegurarse de que no se pierda nada, y luego recargar esta página.",
|
||||
"DE.ApplicationController.errorUserDrop": "No se puede acceder al archivo ahora mismo.",
|
||||
"DE.ApplicationController.errorUserDrop": "No se puede acceder al archivo en este momento.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Aviso",
|
||||
"DE.ApplicationController.scriptLoadError": "La conexión a Internet es demasiado lenta, no se podía cargar algunos componentes. Por favor, recargue la página.",
|
||||
"DE.ApplicationController.scriptLoadError": "La conexión a Internet es demasiado lenta, algunos de los componentes no se han podido cargar. Por favor, recargue la página.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Cargando documento",
|
||||
"DE.ApplicationController.textOf": "de",
|
||||
"DE.ApplicationController.txtClose": "Cerrar",
|
||||
"DE.ApplicationController.unknownErrorText": "Error desconocido.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Su navegador no está soportado.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Su navegador no es compatible.",
|
||||
"DE.ApplicationController.waitText": "Por favor, espere...",
|
||||
"DE.ApplicationView.txtDownload": "Descargar",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporar",
|
||||
"DE.ApplicationView.txtFullScreen": "Pantalla Completa",
|
||||
"DE.ApplicationView.txtPrint": "Imprimir",
|
||||
"DE.ApplicationView.txtShare": "Compartir"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "Vous tentez d'exéсuter une action pour laquelle vous ne disposez pas des droits.<br>Veuillez contacter l'administrateur de Document Server.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Code d'erreur: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Le fichier est protégé par le mot de passe et ne peut pas être ouvert.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "La taille du fichier dépasse les limites établies sur votre serveur.<br>Veuillez contacter votre administrateur de Document Server pour obtenir plus d'information. ",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "La taille du fichier dépasse les limites établies sur votre serveur.<br>Veuillez contacter votre administrateur de Document Server pour obtenir plus d'informations. ",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "La connexion internet a été rétablie, la version du fichier est modifiée.<br>Avant de continuer, téléchargez le fichier ou copiez le contenu pour vous assurer que tous les changements ont été enregistrés, et rechargez la page.",
|
||||
"DE.ApplicationController.errorUserDrop": "Impossible d'accéder au fichier.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Avertissement",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Télécharger",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporer",
|
||||
"DE.ApplicationView.txtFullScreen": "Plein écran",
|
||||
"DE.ApplicationView.txtPrint": "Imprimer",
|
||||
"DE.ApplicationView.txtShare": "Partager"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Scarica",
|
||||
"DE.ApplicationView.txtEmbed": "Incorpora",
|
||||
"DE.ApplicationView.txtFullScreen": "Schermo intero",
|
||||
"DE.ApplicationView.txtPrint": "Stampa",
|
||||
"DE.ApplicationView.txtShare": "Condividi"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "利用権限がない操作をしようとしました。<br>Documentサーバー管理者に連絡してください。",
|
||||
"DE.ApplicationController.errorDefaultMessage": "エラー コード: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "ドキュメントがパスワードで保護されているため開くことができません",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "ファイルサイズがサーバーで設定された制限を超過しています。<br>Documentサーバー管理者に詳細を問い合わせてください。",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "ファイルサイズがサーバーで設定された制限を超過しています。<br>Documentサーバー管理者に詳細をお問い合わせください。",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "インターネット接続が復旧し、ファイルのバージョンが更新されています。<br>作業を継続する前に、ファイルをダウンロードするか内容をコピーして、変更が消えてしまわないようにしてからページを再読み込みしてください。",
|
||||
"DE.ApplicationController.errorUserDrop": "今、ファイルにアクセスすることはできません。",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "警告",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "ダウンロード",
|
||||
"DE.ApplicationView.txtEmbed": "埋め込み",
|
||||
"DE.ApplicationView.txtFullScreen": "全画面表示",
|
||||
"DE.ApplicationView.txtPrint": "印刷する",
|
||||
"DE.ApplicationView.txtShare": "シェア"
|
||||
}
|
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"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Downloaden",
|
||||
"DE.ApplicationView.txtEmbed": "Invoegen",
|
||||
"DE.ApplicationView.txtFullScreen": "Volledig scherm",
|
||||
"DE.ApplicationView.txtPrint": "Afdrukken",
|
||||
"DE.ApplicationView.txtShare": "Delen"
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Skopiuj do schowka",
|
||||
"common.view.modals.txtHeight": "Wysokość",
|
||||
"common.view.modals.txtShare": "Udostępnij link",
|
||||
"common.view.modals.txtWidth": "Szerokość",
|
||||
"DE.ApplicationController.convertationErrorText": "Konwertowanie nieudane.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Przekroczono limit czasu konwersji.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Błąd",
|
||||
"DE.ApplicationController.downloadErrorText": "Pobieranie nieudane.",
|
||||
|
@ -9,8 +11,11 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "Próbujesz wykonać działanie, na które nie masz uprawnień.<br>Proszę skontaktować się z administratorem serwera dokumentów.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Kod błędu: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Dokument jest chroniony hasłem i nie może być otwarty.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Rozmiar pliku przekracza dopuszczone limit dla twojego serwera.<br>Prosimy o kontakt z administratorem twojego serwera w celu uzyskania szczegółowych informacji.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Połączenie z internetem zostało odzyskane, a wersja pliku uległa zmianie.<br>Zanim będzie mógł kontynuować pracę, musisz pobrać plik albo skopiować jego zawartość, aby mieć pewność, że nic nie zostało utracone, a następnie odświeżyć stronę.",
|
||||
"DE.ApplicationController.errorUserDrop": "Nie można uzyskać dostępu do tego pliku.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Ostrzeżenie",
|
||||
"DE.ApplicationController.scriptLoadError": "Połączenie jest zbyt wolne, niektóre komponenty mogą być niezaładowane. Prosimy odświeżyć stronę.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Ładowanie dokumentu",
|
||||
"DE.ApplicationController.textOf": "z",
|
||||
"DE.ApplicationController.txtClose": "Zamknij",
|
||||
|
@ -19,5 +24,6 @@
|
|||
"DE.ApplicationController.waitText": "Proszę czekać...",
|
||||
"DE.ApplicationView.txtDownload": "Pobierz",
|
||||
"DE.ApplicationView.txtFullScreen": "Pełny ekran",
|
||||
"DE.ApplicationView.txtPrint": "Drukuj",
|
||||
"DE.ApplicationView.txtShare": "Udostępnij"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Transferir",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporar",
|
||||
"DE.ApplicationView.txtFullScreen": "Tela cheia",
|
||||
"DE.ApplicationView.txtPrint": "Imprimir",
|
||||
"DE.ApplicationView.txtShare": "Compartilhar"
|
||||
}
|
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": "Скачать файл",
|
||||
"DE.ApplicationView.txtEmbed": "Встроить",
|
||||
"DE.ApplicationView.txtFullScreen": "Во весь экран",
|
||||
"DE.ApplicationView.txtPrint": "Печать",
|
||||
"DE.ApplicationView.txtShare": "Поделиться"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Stiahnuť",
|
||||
"DE.ApplicationView.txtEmbed": "Vložiť",
|
||||
"DE.ApplicationView.txtFullScreen": "Celá obrazovka",
|
||||
"DE.ApplicationView.txtPrint": "Tlačiť",
|
||||
"DE.ApplicationView.txtShare": "Zdieľať"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Ladda ner",
|
||||
"DE.ApplicationView.txtEmbed": "Inbädda",
|
||||
"DE.ApplicationView.txtFullScreen": "Fullskärm",
|
||||
"DE.ApplicationView.txtPrint": "Skriva ut",
|
||||
"DE.ApplicationView.txtShare": "Dela"
|
||||
}
|
|
@ -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',
|
||||
|
|
291
apps/documenteditor/main/app/controller/FormsTab.js
Normal file
|
@ -0,0 +1,291 @@
|
|||
/*
|
||||
*
|
||||
* (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));
|
||||
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, 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:open-color': this.onColorsShow,
|
||||
'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;
|
||||
}
|
||||
},
|
||||
|
||||
onSendThemeColors: function() {
|
||||
this._needUpdateColors = true;
|
||||
},
|
||||
|
||||
updateThemeColors: function() {
|
||||
var updateColors = function(picker, defaultColorIndex) {
|
||||
if (picker) {
|
||||
var clr;
|
||||
|
||||
var effectcolors = Common.Utils.ThemeColor.getEffectColors();
|
||||
for (var i = 0; i < effectcolors.length; i++) {
|
||||
if (typeof(picker.currentColor) == 'object' &&
|
||||
clr === undefined &&
|
||||
picker.currentColor.effectId == effectcolors[i].effectId)
|
||||
clr = effectcolors[i];
|
||||
}
|
||||
|
||||
picker.updateColors(effectcolors, Common.Utils.ThemeColor.getStandartColors());
|
||||
if (picker.currentColor === undefined) {
|
||||
picker.currentColor = effectcolors[defaultColorIndex];
|
||||
} else if ( clr!==undefined ) {
|
||||
picker.currentColor = clr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.view && this.view.mnuFormsColorPicker && updateColors(this.view.mnuFormsColorPicker, 1);
|
||||
this.onChangeSpecialFormsGlobalSettings();
|
||||
},
|
||||
|
||||
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');
|
||||
}
|
||||
},
|
||||
|
||||
onColorsShow: function(menu) {
|
||||
this._needUpdateColors && this.updateThemeColors();
|
||||
this._needUpdateColors = false;
|
||||
},
|
||||
|
||||
onControlsSelect: function(type) {
|
||||
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) 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);
|
||||
|
@ -317,7 +325,9 @@ define([
|
|||
})).show();
|
||||
break;
|
||||
case 'settings':
|
||||
var isEndNote = me.api.asc_IsCursorInEndnote();
|
||||
var isEndNote = me.api.asc_IsCursorInEndnote(),
|
||||
isFootNote = me.api.asc_IsCursorInFootnote();
|
||||
isEndNote = (isEndNote || isFootNote) ? isEndNote : Common.Utils.InternalSettings.get("de-settings-note-last") || false;
|
||||
(new DE.Views.NoteSettingsDialog({
|
||||
api: me.api,
|
||||
handler: function (result, settings) {
|
||||
|
@ -328,10 +338,14 @@ define([
|
|||
setTimeout(function() {
|
||||
settings.isEndNote ? me.api.asc_AddEndnote(settings.custom) : me.api.asc_AddFootnote(settings.custom);
|
||||
}, 1);
|
||||
if (result == 'insert' || result == 'apply') {
|
||||
Common.Utils.InternalSettings.set("de-settings-note-last", settings.isEndNote);
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
},
|
||||
isEndNote: isEndNote,
|
||||
hasSections: me.api.asc_GetSectionsCount()>1,
|
||||
props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps()
|
||||
})).show();
|
||||
break;
|
||||
|
@ -470,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);
|
||||
|
||||
|
@ -545,6 +547,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 +1003,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 **/
|
||||
|
||||
|
@ -1087,6 +1091,8 @@ define([
|
|||
} else {
|
||||
documentHolderController.getView().createDelayedElementsViewer();
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
me.applyLicense();
|
||||
}
|
||||
|
||||
// TODO bug 43960
|
||||
|
@ -1116,7 +1122,8 @@ define([
|
|||
onLicenseChanged: function(params) {
|
||||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' &&
|
||||
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS))
|
||||
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|
||||
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady)
|
||||
|
@ -1128,7 +1135,11 @@ define([
|
|||
var license = this._state.licenseType,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
|
||||
(license===Asc.c_oLicenseResult.SuccessLimit || license===Asc.c_oLicenseResult.ExpiredLimited || this.appOptions.permissionsLicense===Asc.c_oLicenseResult.SuccessLimit)) {
|
||||
(license===Asc.c_oLicenseResult.ExpiredLimited) && this.getApplication().getController('LeftMenu').leftMenu.setLimitMode();// show limited hint
|
||||
license = (license===Asc.c_oLicenseResult.ExpiredLimited) ? this.warnLicenseLimitedNoAccess : this.warnLicenseLimitedRenewed;
|
||||
} else if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded;
|
||||
} else {
|
||||
license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers;
|
||||
|
@ -1136,15 +1147,17 @@ define([
|
|||
primary = 'buynow';
|
||||
}
|
||||
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("de-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
var now = (new Date).getTime();
|
||||
if (now - value > 86400000) {
|
||||
Common.UI.info({
|
||||
width: 500,
|
||||
maxwidth: 500,
|
||||
title: this.textNoLicenseTitle,
|
||||
msg : license,
|
||||
buttons: buttons,
|
||||
|
@ -1191,6 +1204,8 @@ define([
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (Asc.c_oLicenseResult.ExpiredLimited === licType)
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if ( this.onServerVersion(params.asc_getBuildVersion()) ) return;
|
||||
|
||||
|
@ -1199,6 +1214,7 @@ define([
|
|||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
this.permissions.edit = this.permissions.review = false;
|
||||
|
||||
this.appOptions.permissionsLicense = licType;
|
||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
this.appOptions.isLightVersion = params.asc_getIsLight();
|
||||
|
@ -1232,12 +1248,13 @@ 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);
|
||||
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||
this.appOptions.canFillForms = ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
||||
this.appOptions.canFillForms = this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
||||
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms);
|
||||
if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms
|
||||
this.appOptions.canComments = false;
|
||||
|
@ -1356,6 +1373,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');
|
||||
|
@ -1427,7 +1445,7 @@ define([
|
|||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationSaveError:
|
||||
config.msg = this.saveErrorText;
|
||||
config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.saveErrorTextDesktop : this.saveErrorText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.DownloadError:
|
||||
|
@ -2032,6 +2050,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();
|
||||
|
@ -2687,7 +2709,10 @@ define([
|
|||
txtEnterDate: 'Enter a date.',
|
||||
txtTypeEquation: 'Type equation here.',
|
||||
textHasMacros: 'The file contains automatic macros.<br>Do you want to run macros?',
|
||||
textRemember: 'Remember my choice'
|
||||
textRemember: 'Remember my choice',
|
||||
warnLicenseLimitedRenewed: 'License needs to be renewed.<br>You have a limited access to document editing functionality.<br>Please contact your administrator to get full access',
|
||||
warnLicenseLimitedNoAccess: 'License expired.<br>You have no access to document editing functionality.<br>Please contact your administrator.',
|
||||
saveErrorTextDesktop: 'This file cannot be saved or created.<br>Possible reasons are: <br>1. The file is read-only. <br>2. The file is being edited by other users. <br>3. The disk is full or corrupted.'
|
||||
}
|
||||
})(), DE.Controllers.Main || {}))
|
||||
});
|
|
@ -53,6 +53,7 @@ define([
|
|||
|
||||
initialize: function() {
|
||||
this.editMode = true;
|
||||
this._initSettings = true;
|
||||
|
||||
this.addListeners({
|
||||
'RightMenu': {
|
||||
|
@ -80,6 +81,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) {
|
||||
|
@ -106,10 +108,13 @@ define([
|
|||
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
|
||||
},
|
||||
|
||||
onFocusObject: function(SelectedObjects, open) {
|
||||
onFocusObject: function(SelectedObjects) {
|
||||
if (!this.editMode)
|
||||
return;
|
||||
|
||||
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
|
||||
this._initSettings = false;
|
||||
|
||||
var can_add_table = false,
|
||||
in_equation = false,
|
||||
needhide = true;
|
||||
|
@ -124,6 +129,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;
|
||||
|
@ -137,8 +144,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) {
|
||||
|
@ -153,9 +159,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;
|
||||
|
@ -166,6 +174,17 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.Signature].locked = value.get_Locked();
|
||||
}
|
||||
|
||||
if (control_props && control_props.get_FormPr()) {
|
||||
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])
|
||||
|
@ -249,11 +268,17 @@ 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();
|
||||
this.rightmenu.shapeSettings.UpdateThemeColors();
|
||||
this.rightmenu.textartSettings.UpdateThemeColors();
|
||||
this.rightmenu.formSettings && this.rightmenu.formSettings.UpdateThemeColors();
|
||||
},
|
||||
|
||||
updateMetricUnit: function() {
|
||||
|
@ -262,6 +287,7 @@ define([
|
|||
this.rightmenu.chartSettings.updateMetricUnit();
|
||||
this.rightmenu.imageSettings.updateMetricUnit();
|
||||
this.rightmenu.tableSettings.updateMetricUnit();
|
||||
this.rightmenu.formSettings && this.rightmenu.formSettings.updateMetricUnit();
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
|
@ -280,7 +306,7 @@ define([
|
|||
// this.rightmenu.shapeSettings.createDelayedElements();
|
||||
var selectedElements = this.api.getSelectedElements();
|
||||
if (selectedElements.length>0) {
|
||||
this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu));
|
||||
this.onFocusObject(selectedElements);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -340,13 +366,14 @@ define([
|
|||
|
||||
SetDisabled: function(disabled, allowMerge, allowSignature) {
|
||||
this.setMode({isEdit: !disabled});
|
||||
if (this.rightmenu) {
|
||||
if (this.rightmenu && this.rightmenu.paragraphSettings) {
|
||||
this.rightmenu.paragraphSettings.disableControls(disabled);
|
||||
this.rightmenu.shapeSettings.disableControls(disabled);
|
||||
this.rightmenu.textartSettings.disableControls(disabled);
|
||||
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);
|
||||
|
@ -365,6 +392,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;
|
||||
for (var i=0; i<14; i++)
|
||||
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[15].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
||||
toolbar.btnContentControls.menu.items[17].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;
|
||||
|
@ -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;
|
||||
|
@ -1690,7 +1690,7 @@ define([
|
|||
|
||||
switch (item.value) {
|
||||
case 0:
|
||||
this.api.asc_SetLineNumbersProps(this._state.linenum_apply, null);
|
||||
this.api.asc_SetLineNumbersProps(Asc.c_oAscSectionApplyType.Current, null);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
|
@ -1699,7 +1699,8 @@ define([
|
|||
if (this.api && item.checked) {
|
||||
var props = new Asc.CSectionLnNumType();
|
||||
props.put_Restart(item.value==1 ? Asc.c_oAscLineNumberRestartType.Continuous : (item.value==2 ? Asc.c_oAscLineNumberRestartType.NewPage : Asc.c_oAscLineNumberRestartType.NewSection));
|
||||
this.api.asc_SetLineNumbersProps(this._state.linenum_apply, props);
|
||||
!!this.api.asc_GetLineNumbersProps() && props.put_CountBy(undefined);
|
||||
this.api.asc_SetLineNumbersProps(Asc.c_oAscSectionApplyType.Current, props);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
|
@ -1906,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);
|
||||
|
@ -2972,27 +2974,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();
|
||||
|
@ -3058,7 +3069,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);
|
||||
|
@ -3082,13 +3093,22 @@ 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) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3510,7 +3530,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 || {}));
|
||||
});
|
||||
|
|
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="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>
|
|
@ -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 d-none" 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 d-none" 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 d-none" 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">
|
||||
<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;
|
||||
|
@ -327,6 +332,8 @@ define([
|
|||
},
|
||||
|
||||
onSelectBookmark: function(listView, itemView, record) {
|
||||
if (!record) return;
|
||||
|
||||
var value = record.get('value');
|
||||
this.txtName.setValue(value);
|
||||
this.btnAdd.setDisabled(false);
|
||||
|
@ -349,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() {
|
||||
|
@ -430,11 +439,11 @@ define([
|
|||
}, 0);
|
||||
}
|
||||
} else if (key === 'Backspace') {
|
||||
if ((event.target.selectionStart === event.target.selectionEnd && event.target.selectionStart < me.positionCaption + 1) || event.target.selectionStart < me.positionCaption - 1) {
|
||||
if ((event.target.selectionStart === event.target.selectionEnd && event.target.selectionStart < me.positionCaption + 1) || event.target.selectionStart < me.positionCaption) {
|
||||
event.preventDefault();
|
||||
}
|
||||
} else if (key === 'Delete') {
|
||||
if (event.target.selectionStart < me.positionCaption - 1) {
|
||||
if (event.target.selectionStart < me.positionCaption) {
|
||||
event.preventDefault();
|
||||
}
|
||||
} else if (key !== 'End') {
|
||||
|
|
|
@ -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 }
|
||||
|
@ -168,7 +169,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 +214,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 +227,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 +313,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,6 +353,28 @@ 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');
|
||||
|
@ -522,7 +551,11 @@ 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
|
||||
this.txtPlaceholder.cmpEl && this.txtPlaceholder.cmpEl.closest('tr').hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -531,7 +564,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) {
|
||||
|
@ -607,8 +640,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);
|
||||
|
@ -618,7 +655,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);
|
||||
}
|
||||
|
@ -679,7 +716,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
me.disableListButtons();
|
||||
}
|
||||
}
|
||||
me.list.cmpEl.find('.listview').focus();
|
||||
me.list.focus();
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
|
@ -699,7 +736,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
});
|
||||
}
|
||||
}
|
||||
me.list.cmpEl.find('.listview').focus();
|
||||
me.list.focus();
|
||||
}
|
||||
});
|
||||
rec && win.show();
|
||||
|
@ -719,7 +756,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
}
|
||||
}
|
||||
this.disableListButtons();
|
||||
this.list.cmpEl.find('.listview').focus();
|
||||
this.list.focus();
|
||||
},
|
||||
|
||||
onMoveItem: function(up) {
|
||||
|
@ -732,7 +769,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) {
|
||||
|
|
|
@ -200,6 +200,15 @@ define([
|
|||
|
||||
afterRender: function() {
|
||||
this._setDefaults();
|
||||
|
||||
var me = this;
|
||||
var onApiEndCalculate = function() {
|
||||
me.refreshReferences(me.cmbType.getSelectedRecord(), true);
|
||||
};
|
||||
this.api.asc_registerCallback('asc_onEndCalculate', onApiEndCalculate);
|
||||
this.on('close', function(obj){
|
||||
me.api.asc_unregisterCallback('asc_onEndCalculate', onApiEndCalculate);
|
||||
});
|
||||
},
|
||||
|
||||
_handleInput: function(state, fromButton) {
|
||||
|
@ -278,7 +287,7 @@ define([
|
|||
|
||||
refreshReferenceTypes: function(record, currentRef) {
|
||||
var arr = [],
|
||||
str = this.textWhich, type = 5;
|
||||
str = this.textWhich;
|
||||
if (record.type==1 || record.value > 4) {
|
||||
// custom labels from caption dialog and Equation, Figure, Table
|
||||
arr = [
|
||||
|
@ -289,7 +298,6 @@ define([
|
|||
{ value: Asc.c_oAscDocumentRefenceToType.AboveBelow, displayValue: this.textAboveBelow }
|
||||
];
|
||||
} else {
|
||||
type = record.value;
|
||||
switch (record.value) {
|
||||
case 0: // paragraph
|
||||
arr = [
|
||||
|
@ -345,16 +353,24 @@ define([
|
|||
}
|
||||
}
|
||||
this.cmbReference.setData(arr);
|
||||
this.cmbReference.setValue(currentRef ? currentRef : arr[0].value);
|
||||
|
||||
var rec = this.cmbReference.store.findWhere({value: currentRef});
|
||||
this.cmbReference.setValue(rec ? currentRef : arr[0].value);
|
||||
this.onReferenceSelected(this.cmbReference, this.cmbReference.getSelectedRecord());
|
||||
this.lblWhich.text(str);
|
||||
this.refreshReferences(type);
|
||||
this.refreshReferences(record);
|
||||
},
|
||||
|
||||
refreshReferences: function(type) {
|
||||
refreshReferences: function(record, reselect) {
|
||||
if (!record) return;
|
||||
|
||||
var store = this.refList.store,
|
||||
type = (record.type==1 || record.value > 4) ? 5 : record.value,
|
||||
arr = [],
|
||||
props;
|
||||
props,
|
||||
oldlength = store.length,
|
||||
oldidx = _.indexOf(store.models, this.refList.getSelectedRec());
|
||||
|
||||
switch (type) {
|
||||
case 0: // paragraph
|
||||
props = this.api.asc_GetAllNumberedParagraphs();
|
||||
|
@ -383,7 +399,7 @@ define([
|
|||
arr.push({value: name});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (props) {
|
||||
for (var i=0; i<props.length; i++) {
|
||||
arr.push({value: props[i].asc_getText(), para: props[i]});
|
||||
}
|
||||
|
@ -391,7 +407,7 @@ define([
|
|||
|
||||
store.reset(arr);
|
||||
if (store.length>0) {
|
||||
var rec = store.at(0);
|
||||
var rec = (reselect && store.length == oldlength && oldidx>=0 && oldidx<store.length) ? store.at(oldidx) : store.at(0);
|
||||
this.refList.selectRecord(rec);
|
||||
this.refList.scrollToRecord(rec);
|
||||
}
|
||||
|
@ -399,6 +415,8 @@ define([
|
|||
},
|
||||
|
||||
onReferenceSelected: function(combo, record) {
|
||||
if (!record) return;
|
||||
|
||||
var refType = record.value,
|
||||
typeRec = this.cmbType.getSelectedRecord(),
|
||||
type = (typeRec.type==1 || typeRec.value>4) ? 5 : typeRec.value;
|
||||
|
|