diff --git a/apps/api/wopi/convert-and-edit-wopi.ejs b/apps/api/wopi/convert-and-edit-wopi.ejs
new file mode 100644
index 000000000..5f2ab0ccd
--- /dev/null
+++ b/apps/api/wopi/convert-and-edit-wopi.ejs
@@ -0,0 +1,174 @@
+
+
+
+ ' +
+ var top = panel.position().top;
+ var box = $('
');
@@ -561,7 +562,7 @@ define([
var need_break = false;
for (var i=items.length-1; i>=0; i--) {
var item = $(items[i]);
- if (!item.is(':visible')) { // move invisible items as is and set special attr
+ if (!item.is(':visible') && !item.attr('hidden-on-resize')) { // move invisible items as is and set special attr
item.attr('data-hidden-tb-item', true);
this.$moreBar.prepend(item);
hideAllMenus = true;
@@ -585,6 +586,7 @@ define([
this.$moreBar.prepend(item);
if (last_separator) {
last_separator.css('display', '');
+ last_separator.removeAttr('hidden-on-resize');
}
hideAllMenus = true;
} else if ( offset.left+item_width > _maxright ) {
@@ -595,6 +597,7 @@ define([
this.$moreBar.prepend(item);
if (last_separator) {
last_separator.css('display', '');
+ last_separator.removeAttr('hidden-on-resize');
}
hideAllMenus = true;
break;
@@ -612,6 +615,7 @@ define([
this.$moreBar.prepend(last_group);
if (last_separator) {
last_separator.css('display', '');
+ last_separator.removeAttr('hidden-on-resize');
}
}
last_group.prepend(child);
@@ -638,6 +642,7 @@ define([
} else if (item.hasClass('separator')) {
this.$moreBar.prepend(item);
item.css('display', 'none');
+ item.attr('hidden-on-resize', true);
last_separator = item;
hideAllMenus = true;
}
@@ -683,6 +688,7 @@ define([
more_section.before(item);
if (last_separator) {
last_separator.css('display', '');
+ last_separator.removeAttr('hidden-on-resize');
}
if (this.$moreBar.children().filter('.group').length == 0) {
this.hideMoreBtns();
@@ -717,6 +723,7 @@ define([
more_section.before(last_group);
if (last_separator) {
last_separator.css('display', '');
+ last_separator.removeAttr('hidden-on-resize');
}
}
last_group.append(child);
@@ -747,6 +754,7 @@ define([
} else if (item.hasClass('separator')) {
more_section.before(item);
item.css('display', 'none');
+ item.attr('hidden-on-resize', true);
last_separator = item;
last_width = parseInt(last_separator.css('margin-left')) + parseInt(last_separator.css('margin-right')) + 1;
hideAllMenus = true;
@@ -779,7 +787,7 @@ define([
right = Common.Utils.innerWidth() - (showxy.left - parentxy.left + target.width()),
top = showxy.top - parentxy.top + target.height() + 10;
- moreContainer.css({right: right, left: 'auto', top : top});
+ moreContainer.css({right: right, left: 'auto', top : top, 'max-width': Common.Utils.innerWidth() + 'px'});
moreContainer.show();
},
diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js
index 302e98995..5b2d2f430 100644
--- a/apps/common/main/lib/component/Window.js
+++ b/apps/common/main/lib/component/Window.js
@@ -241,7 +241,7 @@ define([
function _autoSize() {
if (this.initConfig.height == 'auto') {
- var height = parseInt(this.$window.find('> .body').css('height'));
+ var height = Math.ceil(parseFloat(this.$window.find('> .body').css('height')));
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
this.$window.height(height);
}
@@ -490,7 +490,8 @@ define([
if (options.width=='auto') {
text_cnt.height(Math.max(text.height(), icon_height) + ((check.length>0) ? (check.height() + parseInt(check.css('margin-top'))) : 0));
body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height')));
- window.setSize(text.position().left + text.width() + parseInt(text_cnt.css('padding-right')),
+ var span_el = check.find('span');
+ window.setSize(Math.max(text.width(), span_el.length>0 ? span_el.position().left + span_el.width() : 0) + text.position().left + parseInt(text_cnt.css('padding-right')),
parseInt(body.css('height')) + parseInt(header.css('height')));
} else {
text.css('white-space', 'normal');
diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js
index 6cd2fb9f5..76f4b67b2 100644
--- a/apps/common/main/lib/controller/Desktop.js
+++ b/apps/common/main/lib/controller/Desktop.js
@@ -199,13 +199,11 @@ define([
};
if ( !!titlebuttons ) {
- info.hints = {
- 'print': titlebuttons['print'].btn.btnEl.attr('data-hint-title'),
- // 'home': Common.UI.HintManager.getStaticHint('btnhome'),
- 'undo': titlebuttons['undo'].btn.btnEl.attr('data-hint-title'),
- 'redo': titlebuttons['redo'].btn.btnEl.attr('data-hint-title'),
- 'save': titlebuttons['save'].btn.btnEl.attr('data-hint-title'),
- };
+ info.hints = {};
+ !!titlebuttons['print'] && (info.hints['print'] = titlebuttons['print'].btn.btnEl.attr('data-hint-title'));
+ !!titlebuttons['undo'] && (info.hints['undo'] = titlebuttons['undo'].btn.btnEl.attr('data-hint-title'));
+ !!titlebuttons['redo'] && (info.hints['redo'] = titlebuttons['redo'].btn.btnEl.attr('data-hint-title'));
+ !!titlebuttons['save'] && (info.hints['save'] = titlebuttons['save'].btn.btnEl.attr('data-hint-title'));
}
native.execCommand('althints:show', JSON.stringify(info));
@@ -291,9 +289,13 @@ define([
'modal:show': _onModalDialog.bind(this, 'open'),
'modal:close': _onModalDialog.bind(this, 'close'),
'uitheme:changed' : function (name) {
- var theme = Common.UI.Themes.get(name);
- if ( theme )
- native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
+ if (Common.localStorage.getBool('ui-theme-use-system', false)) {
+ native.execCommand("uitheme:changed", JSON.stringify({name:'theme-system'}));
+ } else {
+ var theme = Common.UI.Themes.get(name);
+ if ( theme )
+ native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
+ }
},
'hints:show': _onHintsShow.bind(this),
});
@@ -363,7 +365,7 @@ define([
if ( !!nativevars && nativevars.helpUrl ) {
var webapp = window.SSE ? 'spreadsheeteditor' :
window.PE ? 'presentationeditor' : 'documenteditor';
- return nativevars.helpUrl + webapp + '/main/resources/help';
+ return nativevars.helpUrl + '/' + webapp + '/main/resources/help';
}
return undefined;
diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js
index c041414e2..931eb5e6b 100644
--- a/apps/common/main/lib/controller/ExternalOleEditor.js
+++ b/apps/common/main/lib/controller/ExternalOleEditor.js
@@ -199,13 +199,16 @@ define([
if (this.oleEditorView) {
if (eventData.type == 'documentReady') {
this.oleEditorView._isExternalDocReady = true;
- this.oleEditorView.setControlsDisabled(false);
this.isExternalEditorVisible && (isAppFirstOpened = false);
this.oleEditorView._oleData && this.setOleData();
if (this.needDisableEditing) {
this.onOleEditingDisabled();
}
} else
+ if (eventData.type == 'oleEditorReady') {
+ if (this.needDisableEditing===undefined)
+ this.oleEditorView.setControlsDisabled(false);
+ } else
if (eventData.type == "shortcut") {
if (eventData.data.key == 'escape')
this.oleEditorView.hide();
diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js
index a946ad0f4..e9241a7ac 100644
--- a/apps/common/main/lib/controller/HintManager.js
+++ b/apps/common/main/lib/controller/HintManager.js
@@ -44,6 +44,7 @@
*
*
*
+ *
* Example usage with components:
*
* new Common.UI.Button({
@@ -118,7 +119,10 @@ Common.UI.HintManager = new(function() {
_isDocReady = false,
_isEditDiagram = false,
_usedTitles = [],
- _appPrefix;
+ _appPrefix,
+ _staticHints = { // for desktop buttons
+ "btnhome": 'K'
+ };
var _api;
@@ -223,6 +227,15 @@ Common.UI.HintManager = new(function() {
return arr;
};
+ var _getLetterInUILanguage = function (letter) {
+ var l = letter;
+ if (_arrAlphabet.indexOf(l) === -1) {
+ var ind = _arrEnAlphabet.indexOf(l);
+ l = _arrAlphabet[ind];
+ }
+ return l;
+ };
+
var _isItemDisabled = function (item) {
return (item.hasClass('disabled') || item.parent().hasClass('disabled') || item.attr('disabled'));
};
@@ -268,21 +281,25 @@ Common.UI.HintManager = new(function() {
});
return;
}
- var _arrLetters = [];
+ var _arrLetters = [],
+ _usedLetters = [];
+ if (_currentLevel === 0) {
+ for (var key in _staticHints) {
+ var t = _staticHints[key].toLowerCase();
+ _usedTitles.push(t);
+ _usedLetters.push(_arrAlphabet.indexOf(t));
+ }
+ }
if (visibleItems.length > _arrAlphabet.length) {
visibleItemsWithTitle.forEach(function (item) {
var t = $(item).data('hint-title').toLowerCase();
- if (_arrAlphabet.indexOf(t) === -1) {
- var ind = _arrEnAlphabet.indexOf(t);
- t = _arrAlphabet[ind];
- }
+ t = _getLetterInUILanguage(t);
_usedTitles.push(t);
});
- _arrLetters = _getLetters(visibleItems.length);
+ _arrLetters = _getLetters(visibleItems.length + (_currentLevel === 0 ? _.size(_staticHints) : 0));
} else {
_arrLetters = _arrAlphabet.slice();
}
- var usedLetters = [];
if (arrItemsWithTitle.length > 0) {
visibleItems.forEach(function (item) {
var el = $(item);
@@ -290,9 +307,9 @@ Common.UI.HintManager = new(function() {
if (title) {
var ind = _arrEnAlphabet.indexOf(title.toLowerCase());
if (ind === -1) { // we have already changed
- usedLetters.push(_arrAlphabet.indexOf(title.toLowerCase()));
+ _usedLetters.push(_arrAlphabet.indexOf(title.toLowerCase()));
} else {
- usedLetters.push(ind);
+ _usedLetters.push(ind);
if (_lang !== 'en') {
el.attr('data-hint-title', _arrLetters[ind].toUpperCase());
}
@@ -303,7 +320,7 @@ Common.UI.HintManager = new(function() {
var index = 0;
visibleItems.forEach(function (item) {
var el = $(item);
- while (usedLetters.indexOf(index) !== -1) {
+ while (_usedLetters.indexOf(index) !== -1) {
index++;
}
var title = el.attr('data-hint-title');
@@ -603,7 +620,9 @@ Common.UI.HintManager = new(function() {
}
}
- _needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-use-alt-key") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0);
+ _needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-use-alt-key") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT &&
+ !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0 &&
+ !(window.PE && $('#pe-preview').is(':visible')));
if (e.altKey && e.keyCode !== 115) {
e.preventDefault();
}
@@ -618,7 +637,16 @@ Common.UI.HintManager = new(function() {
_arrAlphabet = langsJson[lang];
return _arrAlphabet;
};
- return !_setAlphabet(lng) ? (!_setAlphabet(lng.split(/[\-_]/)[0]) ? _setAlphabet('en') : true) : true;
+ var loaded = !_setAlphabet(lng) ? (!_setAlphabet(lng.split(/[\-_]/)[0]) ? _setAlphabet('en') : true) : true;
+ if (loaded && _lang !== 'en') {
+ for (var key in _staticHints) {
+ var hint = _getLetterInUILanguage(_staticHints[key].toLowerCase());
+ if (hint) {
+ _staticHints[key] = hint.toUpperCase();
+ }
+ }
+ }
+ return loaded;
});
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/qwertyletters.json', function (langsJson) {
_arrQwerty = langsJson[_lang];
@@ -659,11 +687,16 @@ Common.UI.HintManager = new(function() {
_isEditDiagram = mode.isEditDiagram || mode.isEditMailMerge || mode.isEditOle;
};
+ var _getStaticHint = function (key) {
+ return _staticHints[key];
+ };
+
return {
init: _init,
setMode: _setMode,
clearHints: _clearHints,
needCloseFileMenu: _needCloseFileMenu,
- isHintVisible: _isHintVisible
+ isHintVisible: _isHintVisible,
+ getStaticHint: _getStaticHint
}
})();
\ No newline at end of file
diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js
index 05775c87a..b17280eab 100644
--- a/apps/common/main/lib/controller/Plugins.js
+++ b/apps/common/main/lib/controller/Plugins.js
@@ -162,6 +162,8 @@ define([
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
+ this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginShowButton, this));
+ this.api.asc_registerCallback('asc_onPluginHideButton', _.bind(this.onPluginHideButton, this));
this.loadPlugins();
}
@@ -242,6 +244,10 @@ define([
$('
').appendTo(me.$toolbarPanelPlugins);
_group = $('
');
rank_plugins = 0;
+ } else {
+ _group.appendTo(me.$toolbarPanelPlugins);
+ $('
').appendTo(me.$toolbarPanelPlugins);
+ _group = $('
');
}
var btn = me.panelPlugins.createPluginButton(model);
@@ -377,6 +383,7 @@ define([
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this),
help: !!help,
+ loader: plugin.get_Loader(),
modal: isModal!==undefined ? isModal : true
});
me.pluginDlg.on({
@@ -395,6 +402,9 @@ define([
},
'help': function(){
help && window.open(help, '_blank');
+ },
+ 'header:click': function(type){
+ me.api.asc_pluginButtonClick(type);
}
});
@@ -454,6 +464,14 @@ define([
this.parsePlugins(pluginsdata)
},
+ onPluginShowButton: function(id) {
+ this.pluginDlg && this.pluginDlg.showButton(id);
+ },
+
+ onPluginHideButton: function(id) {
+ this.pluginDlg && this.pluginDlg.hideButton(id);
+ },
+
runAutoStartPlugins: function() {
if (this.autostart && this.autostart.length > 0) {
this.api.asc_pluginRun(this.autostart.shift(), 0, '');
diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js
index 732e497a0..729903d03 100644
--- a/apps/common/main/lib/controller/Themes.js
+++ b/apps/common/main/lib/controller/Themes.js
@@ -36,6 +36,11 @@ define([
type: 'dark',
source: 'static',
},
+ 'theme-contrast-dark': {
+ text: locale.txtThemeContrastDark || 'Dark Contrast',
+ type: 'dark',
+ source: 'static',
+ },
}
if ( !!window.currentLoaderTheme ) {
@@ -118,6 +123,7 @@ define([
"canvas-page-border",
"canvas-ruler-background",
+ "canvas-ruler-border",
"canvas-ruler-margins-background",
"canvas-ruler-mark",
"canvas-ruler-handle-border",
@@ -296,7 +302,9 @@ define([
$(window).on('storage', function (e) {
if ( e.key == 'ui-theme' || e.key == 'ui-theme-id' ) {
if ( !!e.originalEvent.newValue ) {
- me.setTheme(e.originalEvent.newValue, true);
+ if (Common.localStorage.getBool('ui-theme-use-system', false)) {
+ me.setTheme('theme-system');
+ } else me.setTheme(e.originalEvent.newValue, true);
}
} else
if ( e.key == 'content-theme' ) {
@@ -413,19 +421,39 @@ define([
Common.NotificationCenter.trigger('contenttheme:dark', !is_current_dark);
},
- setTheme: function (obj, force) {
+ setTheme: function (obj) {
if ( !obj ) return;
- var id = get_ui_theme_name(obj);
+ var id = get_ui_theme_name(obj),
+ refresh_only = arguments[1];
+
+ if ( !refresh_only && is_theme_type_system(this.currentThemeId()) ) {
+ // TODO: need refactoring. for bug 58801
+ if ( get_system_default_theme().id == id ) {
+ Common.localStorage.setBool('ui-theme-use-system', false);
+ Common.localStorage.setItem('ui-theme-id', '');
+ Common.localStorage.setItem('ui-theme-id', id);
+ Common.NotificationCenter.trigger('uitheme:changed', id);
+ return;
+ }
+ }
if ( is_theme_type_system(id) ) {
+ if ( get_system_default_theme().id == this.currentThemeId() ) {
+ Common.localStorage.setBool('ui-theme-use-system', true);
+ Common.localStorage.setItem('ui-theme-id', '');
+ Common.localStorage.setItem('ui-theme-id', id);
+ Common.NotificationCenter.trigger('uitheme:changed', id);
+ return;
+ }
+
Common.localStorage.setBool('ui-theme-use-system', true);
id = get_system_default_theme().id;
} else {
Common.localStorage.setBool('ui-theme-use-system', false);
}
- if ( (this.currentThemeId() != id || force) && !!themes_map[id] ) {
+ if ( (this.currentThemeId() != id || refresh_only) && !!themes_map[id] ) {
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
document.body.classList.add(id, 'theme-type-' + themes_map[id].type);
@@ -456,10 +484,12 @@ define([
theme_obj.colors = obj;
}
- Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
+ if ( !refresh_only )
+ Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
}
- Common.localStorage.setItem('ui-theme-id', id);
+ if ( !refresh_only )
+ Common.localStorage.setItem('ui-theme-id', id);
Common.NotificationCenter.trigger('uitheme:changed', id);
}
},
diff --git a/apps/common/main/lib/template/SearchPanel.template b/apps/common/main/lib/template/SearchPanel.template
index bdba42b87..f9025bf78 100644
--- a/apps/common/main/lib/template/SearchPanel.template
+++ b/apps/common/main/lib/template/SearchPanel.template
@@ -17,16 +17,16 @@
-
-
-
+
-
-
+
+
|
diff --git a/apps/common/main/lib/util/Tip.js b/apps/common/main/lib/util/Tip.js
index 4a9574c24..4d9c496be 100644
--- a/apps/common/main/lib/util/Tip.js
+++ b/apps/common/main/lib/util/Tip.js
@@ -112,10 +112,13 @@
if (!me.options.keepvisible && !me.options.hideonclick && me.tip().is(':visible'))
me.hide();
}});
+ this.isDesktopApp = Common.Controllers.Desktop.isActive();
},
mousemove: function (e) {
- this.targetXY = [e.clientX*Common.Utils.zoom(), e.clientY*Common.Utils.zoom()];
+ var x = e.clientX*Common.Utils.zoom(),
+ y = e.clientY*Common.Utils.zoom();
+ this.targetXY = [x, this.isDesktopApp ? Math.max(y, 14) : y];
},
leave: function(obj) {
diff --git a/apps/common/main/lib/util/define.js b/apps/common/main/lib/util/define.js
index b0dae8936..57fc090ce 100644
--- a/apps/common/main/lib/util/define.js
+++ b/apps/common/main/lib/util/define.js
@@ -794,6 +794,9 @@ define(function(){ 'use strict';
textTurns: 'Turns',
textShapes: 'Shapes',
textLoops: 'Loops',
+ textPathCurve: 'Curve',
+ textPathLine: 'Line',
+ textPathScribble: 'Scribble',
getEffectGroupData: function () {
return [
@@ -849,8 +852,8 @@ define(function(){ 'use strict';
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_DOWN, iconCls: 'animation-motion-paths-arcs', displayValue: this.textArcs, familyEffect: 'patharcs'},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_DOWN, iconCls: 'animation-motion-paths-turns', displayValue: this.textTurns, familyEffect: 'pathturns'},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CIRCLE, iconCls: 'animation-motion-paths-shapes', displayValue: this.textShapes, familyEffect: 'pathshapes'},
- {group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'animation-motion-paths-loops', displayValue: this.textLoops, familyEffect: 'pathloops'}//,
- //{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'animation-motion-paths-custom-path', displayValue: this.textCustomPath}
+ {group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'animation-motion-paths-loops', displayValue: this.textLoops, familyEffect: 'pathloops'},
+ {group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'animation-motion-paths-custom-path', displayValue: this.textCustomPath}
];
},
@@ -1038,7 +1041,8 @@ define(function(){ 'use strict';
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_PEANUT, displayValue: this.textPeanut},
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_POINTY_STAR, displayValue: this.textPointStar},
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_SWOOSH, displayValue: this.textSwoosh},
- {group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_VERTICAL_FIGURE_8, displayValue: this.textVerticalFigure, familyEffect: 'pathloops'}
+ {group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_VERTICAL_FIGURE_8, displayValue: this.textVerticalFigure, familyEffect: 'pathloops'},
+ {group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_CUSTOM_PATH, displayValue: this.textCustomPath, notsupported: true}
];
},
@@ -1277,11 +1281,21 @@ define(function(){ 'use strict';
return undefined;
}
break;
+ case 'menu-effect-group-path':
+ switch (type) {
+ case AscFormat.MOTION_CUSTOM_PATH:
+ return [
+ {value: AscFormat.MOTION_CUSTOM_PATH_CURVE, caption: this.textPathCurve, isCustom: true},
+ {value: AscFormat.MOTION_CUSTOM_PATH_LINE, caption: this.textPathLine, isCustom: true},
+ {value: AscFormat.MOTION_CUSTOM_PATH_SCRIBBLE, caption: this.textPathScribble, isCustom: true}
+ ];
+ }
+ break;
default:
return undefined;
}
},
- getSimilarEffectsArray: function (group, familyEffect) {
+ getSimilarEffectsArray: function (familyEffect) {
switch (familyEffect){
case 'shape':
return [
diff --git a/apps/common/main/lib/util/fix-ie-compat.js b/apps/common/main/lib/util/fix-ie-compat.js
index e56227d2f..8ce3bf8ca 100644
--- a/apps/common/main/lib/util/fix-ie-compat.js
+++ b/apps/common/main/lib/util/fix-ie-compat.js
@@ -31,4 +31,10 @@ if ( !window.fetch ) {
return target;
};
}
+
+ if (typeof Object.getOwnPropertySymbols != 'function') {
+ Object.getOwnPropertySymbols = function(target) {
+ return [];
+ };
+ }
}
diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js
index ba77f887a..77392abde 100644
--- a/apps/common/main/lib/util/htmlutils.js
+++ b/apps/common/main/lib/util/htmlutils.js
@@ -62,8 +62,14 @@ if ( window.desktop ) {
}
if ( theme.id ) {
- // params.uitheme = undefined;
- localStorage.setItem("ui-theme-id", theme.id);
+ if ( theme.id == 'theme-system' ) {
+ localStorage.setItem("ui-theme-use-system", "1");
+ localStorage.removeItem("ui-theme-id");
+ delete params.uitheme;
+ } else {
+ localStorage.setItem("ui-theme-id", theme.id);
+ }
+
localStorage.removeItem("ui-theme");
}
}
@@ -93,11 +99,13 @@ if ( !!ui_theme_name ) {
}
if ( checkLocalStorage ) {
- var content_theme = localStorage.getItem("content-theme");
- if ( content_theme == 'dark' ) {
- var current_theme = localStorage.getItem("ui-theme");
- if ( !!current_theme && /type":\s*"dark/.test(current_theme) ) {
+ let current_theme = localStorage.getItem("ui-theme");
+ if ( !!current_theme && /type":\s*"dark/.test(current_theme) ) {
+ document.body.classList.add("theme-type-dark");
+
+ let content_theme = localStorage.getItem("content-theme");
+ if ( content_theme == 'dark' ) {
document.body.classList.add("content-theme-dark");
}
}
-}
+}
\ No newline at end of file
diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js
index 92ec5261f..b1d58e132 100644
--- a/apps/common/main/lib/util/utils.js
+++ b/apps/common/main/lib/util/utils.js
@@ -193,13 +193,18 @@ var utils = new(function() {
me.innerHeight = window.innerHeight * me.zoom;
me.applicationPixelRatio = scale.applicationPixelRatio || scale.devicePixelRatio;
};
+ checkSizeIE = function() {
+ me.innerWidth = window.innerWidth;
+ me.innerHeight = window.innerHeight;
+ };
me.zoom = 1;
me.applicationPixelRatio = 1;
me.innerWidth = window.innerWidth;
me.innerHeight = window.innerHeight;
- if ( isIE )
+ if ( isIE ) {
$(document.body).addClass('ie');
- else {
+ $(window).on('resize', checkSizeIE);
+ } else {
checkSize();
$(window).on('resize', checkSize);
}
@@ -436,7 +441,7 @@ var metrics = new(function() {
}
})();
-Common.Utils.Metric = _extend_object(Common.Utils.Metric, metrics);
+Common.Utils.Metric = _extend_object(metrics, Common.Utils.Metric);
Common.Utils.RGBColor = function(colorString) {
var r, g, b;
@@ -603,8 +608,12 @@ Common.Utils.RGBColor = function(colorString) {
}
};
-Common.Utils.String = new (function() {
+var utilsString = new (function() {
return {
+ textCtrl: 'Ctrl',
+ textShift: 'Shift',
+ textAlt: 'Alt',
+
format: function(format) {
var args = _.toArray(arguments).slice(1);
if (args.length && typeof args[0] == 'object')
@@ -648,7 +657,7 @@ Common.Utils.String = new (function() {
return Common.Utils.String.format(template, string.replace(/\+(?=\S)/g, '').replace(/Ctrl|ctrl/g, '⌘').replace(/Alt|alt/g, '⌥').replace(/Shift|shift/g, '⇧'));
}
- return Common.Utils.String.format(template, string);
+ return Common.Utils.String.format(template, string.replace(/Ctrl|ctrl/g, this.textCtrl).replace(/Alt|alt/g, this.textAlt).replace(/Shift|shift/g, this.textShift));
},
parseFloat: function(string) {
@@ -680,6 +689,8 @@ Common.Utils.String = new (function() {
}
})();
+Common.Utils.String = _extend_object(utilsString, Common.Utils.String);
+
Common.Utils.isBrowserSupported = function() {
return !((Common.Utils.ieVersion != 0 && Common.Utils.ieVersion < 10.0) ||
(Common.Utils.safariVersion != 0 && Common.Utils.safariVersion < 5.0) ||
@@ -986,23 +997,27 @@ jQuery.fn.extend({
var _el = document.getElementById(id.substring(1));
if ( !_el ) {
parent = parent || this;
- if ( parent instanceof jQuery ) {
+ if ( parent && parent.length > 0 ) {
parent.each(function (i, node) {
- _el = node.querySelectorAll(id);
- if ( _el.length == 0 ) {
- if ( ('#' + node.id) == id ) {
- _el = node;
+ if (node.querySelectorAll) {
+ _el = node.querySelectorAll(id);
+ if ( _el.length == 0 ) {
+ if ( ('#' + node.id) == id ) {
+ _el = node;
+ return false;
+ }
+ } else
+ if ( _el.length ) {
+ _el = _el[0];
return false;
}
- } else
- if ( _el.length ) {
- _el = _el[0];
- return false;
}
})
} else {
- _el = parent.querySelectorAll(id);
- if ( _el && _el.length ) return _el[0];
+ if (parent && parent.querySelectorAll) {
+ _el = parent.querySelectorAll(id);
+ if ( _el && _el.length ) return _el[0];
+ }
}
}
diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js
index 4e7e4e8b3..2d39995ca 100644
--- a/apps/common/main/lib/view/Header.js
+++ b/apps/common/main/lib/view/Header.js
@@ -516,7 +516,7 @@ define([
disabled: disabled === true,
dataHint:'0',
dataHintDirection: hintDirection ? hintDirection : (config.isDesktopApp ? 'right' : 'left'),
- dataHintOffset: hintOffset ? hintOffset : (config.isDesktopApp ? '10, -10' : '10, 10'),
+ dataHintOffset: hintOffset ? hintOffset : (config.isDesktopApp ? '10, -18' : '10, 10'),
dataHintTitle: hintTitle
})).render(slot);
}
@@ -756,7 +756,7 @@ define([
'focus': onFocusDocName.bind(this),
'blur': function (e) {
me.imgCrypted && me.imgCrypted.toggleClass('hidden', false);
- label[0].selectionStart = label[0].selectionEnd = 0;
+ Common.Utils.isGecko && (label[0].selectionStart = label[0].selectionEnd = 0);
if(!me.isSaveDocName) {
me.withoutExt = false;
me.setDocTitle(me.documentCaption);
diff --git a/apps/common/main/lib/view/InsertTableDialog.js b/apps/common/main/lib/view/InsertTableDialog.js
index e9890a80f..39521c44f 100644
--- a/apps/common/main/lib/view/InsertTableDialog.js
+++ b/apps/common/main/lib/view/InsertTableDialog.js
@@ -48,7 +48,7 @@ define([
Common.Views.InsertTableDialog = Common.UI.Window.extend(_.extend({
options: {
width: 230,
- height: 156,
+ height: 157,
style: 'min-width: 230px;',
cls: 'modal-dlg',
split: false,
diff --git a/apps/common/main/lib/view/ListSettingsDialog.js b/apps/common/main/lib/view/ListSettingsDialog.js
index 4df5c4906..9fe04b56a 100644
--- a/apps/common/main/lib/view/ListSettingsDialog.js
+++ b/apps/common/main/lib/view/ListSettingsDialog.js
@@ -61,7 +61,7 @@ define([
options: {
type: 0, // 0 - markers, 1 - numbers
width: 280,
- height: 255,
+ height: 261,
style: 'min-width: 240px;',
cls: 'modal-dlg',
split: false,
diff --git a/apps/common/main/lib/view/PluginDlg.js b/apps/common/main/lib/view/PluginDlg.js
index 81a5e0ce5..3fc614de0 100644
--- a/apps/common/main/lib/view/PluginDlg.js
+++ b/apps/common/main/lib/view/PluginDlg.js
@@ -77,6 +77,7 @@ define([
_options.tpl = _.template(this.template)(_options);
this.url = options.url || '';
+ this.loader = (options.loader!==undefined) ? options.loader : true;
this.frameId = options.frameId || 'plugin_iframe';
Common.UI.Window.prototype.initialize.call(this, _options);
},
@@ -90,6 +91,8 @@ define([
if (!this.options.header) this._headerFooterHeight -= 34;
this._headerFooterHeight += ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width'))));
+ this.$window.find('.header').prepend($(''));
+
var iframe = document.createElement("iframe");
iframe.id = this.frameId;
iframe.name = 'pluginFrameEditor';
@@ -102,13 +105,15 @@ define([
iframe.onload = _.bind(this._onLoad,this);
var me = this;
- setTimeout(function(){
- if (me.isLoaded) return;
- me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
- me.loadMask.setTitle(me.textLoading);
- me.loadMask.show();
- if (me.isLoaded) me.loadMask.hide();
- }, 500);
+ if (this.loader) {
+ setTimeout(function(){
+ if (me.isLoaded) return;
+ me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
+ me.loadMask.setTitle(me.textLoading);
+ me.loadMask.show();
+ if (me.isLoaded) me.loadMask.hide();
+ }, 500);
+ }
iframe.src = this.url;
$('#id-plugin-placeholder').append(iframe);
@@ -180,6 +185,32 @@ define([
}
},
+ showButton: function(id) {
+ var header = this.$window.find('.header .tools.left');
+ if (id=='back') {
+ var btn = header.find('#id-plugindlg-' + id);
+ if (btn.length<1) {
+ btn = $('←
');
+ btn.on('click', _.bind(function() {
+ this.fireEvent('header:click',id);
+ }, this));
+ header.prepend(btn);
+ }
+ btn.show();
+ header.removeClass('hidden');
+ }
+ },
+
+ hideButton: function(id) {
+ var header = this.$window.find('.header .tools.left');
+ if (id=='back') {
+ var btn = header.find('#id-plugindlg-' + id);
+ if (btn.length>0) {
+ btn.hide();
+ }
+ }
+ },
+
textLoading : 'Loading'
}, Common.Views.PluginDlg || {}));
});
\ No newline at end of file
diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js
index f9b22360a..3e160a629 100644
--- a/apps/common/main/lib/view/Protection.js
+++ b/apps/common/main/lib/view/Protection.js
@@ -78,6 +78,9 @@ define([
});
});
+ this.btnPwd.on('click', function (b, e) {
+ !b.pressed && me.fireEvent('protect:password', [b, 'delete']);
+ });
this.btnPwd.menu.on('item:click', function (menu, item, e) {
me.fireEvent('protect:password', [menu, item.value]);
});
@@ -132,6 +135,8 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-protect',
caption: this.txtEncrypt,
+ split: true,
+ enableToggle: true,
menu: true,
visible: false,
dataHint : '1',
@@ -172,7 +177,7 @@ define([
if ( config.canProtect) {
if ( config.isPasswordSupport) {
me.btnAddPwd.updateHint(me.hintAddPwd);
- me.btnPwd.updateHint(me.hintPwd);
+ me.btnPwd.updateHint([me.hintDelPwd, me.hintPwd]);
me.btnPwd.setMenu(
new Common.UI.Menu({
@@ -342,6 +347,7 @@ define([
}
}, this);
this.btnPwd.setVisible(hasPassword);
+ this.btnPwd.toggle(hasPassword, true);
},
txtEncrypt: 'Encrypt',
@@ -353,7 +359,8 @@ define([
txtDeletePwd: 'Delete password',
txtAddPwd: 'Add password',
txtInvisibleSignature: 'Add digital signature',
- txtSignatureLine: 'Add Signature line'
+ txtSignatureLine: 'Add Signature line',
+ hintDelPwd: 'Delete password'
}
}()), Common.Views.Protection || {}));
});
\ No newline at end of file
diff --git a/apps/common/main/lib/view/SearchBar.js b/apps/common/main/lib/view/SearchBar.js
index cd4774de9..9437be55d 100644
--- a/apps/common/main/lib/view/SearchBar.js
+++ b/apps/common/main/lib/view/SearchBar.js
@@ -139,14 +139,15 @@ define([
left = Common.Utils.innerWidth() - ($('#right-menu').is(':visible') ? $('#right-menu').width() : 0) - this.options.width - 32;
Common.UI.Window.prototype.show.call(this, left, top);
+ this.disableNavButtons();
if (text) {
this.inputSearch.val(text);
this.fireEvent('search:input', [text]);
} else {
this.inputSearch.val('');
+ window.SSE && this.fireEvent('search:input', ['', true]);
}
- this.disableNavButtons();
this.focus();
},
@@ -185,9 +186,9 @@ define([
},
disableNavButtons: function (resultNumber, allResults) {
- var disable = this.inputSearch.val() === '';
- this.btnBack.setDisabled(disable || !allResults || resultNumber === 0);
- this.btnNext.setDisabled(disable || resultNumber + 1 === allResults);
+ var disable = (this.inputSearch.val() === '' && !window.SSE) || !allResults;
+ this.btnBack.setDisabled(disable);
+ this.btnNext.setDisabled(disable);
},
textFind: 'Find',
diff --git a/apps/common/main/lib/view/SearchPanel.js b/apps/common/main/lib/view/SearchPanel.js
index 1f1d52163..cb43db898 100644
--- a/apps/common/main/lib/view/SearchPanel.js
+++ b/apps/common/main/lib/view/SearchPanel.js
@@ -91,6 +91,11 @@ define([
dataHintDirection: 'left',
dataHintOffset: 'small'
});
+ this.inputReplace._input.on('keydown', _.bind(function (e) {
+ if (e.keyCode === Common.UI.Keys.RETURN && !this.btnReplace.isDisabled()) {
+ this.onReplaceClick('replace');
+ }
+ }, this));
this.btnBack = new Common.UI.Button({
parentEl: $('#search-adv-back'),
@@ -205,6 +210,7 @@ define([
}).on('keyup:after', function(input, e) {
me.fireEvent('search:options', ['range', input.getValue(), e.keyCode !== Common.UI.Keys.RETURN]);
});
+ this.inputSelectRange.$el.hide();
this.cmbSearch = new Common.UI.ComboBox({
el: $('#search-adv-cmb-search'),
@@ -253,11 +259,13 @@ define([
this.cmbLookIn.setValue(0);
var tableTemplate = '',
$resultTable = $(tableTemplate).appendTo(this.$resultsContainer);
@@ -278,8 +286,7 @@ define([
});
}
Common.NotificationCenter.on('window:resize', function() {
- me.$resultsContainer.outerHeight($('#search-box').outerHeight() - $('#search-header').outerHeight() - $('#search-adv-settings').outerHeight());
- me.$resultsContainer.scroller.update({alwaysVisibleY: true});
+ me.updateResultsContainerHeight();
});
}
@@ -292,8 +299,7 @@ define([
Common.UI.BaseView.prototype.show.call(this,arguments);
this.fireEvent('show', this );
- this.$resultsContainer.outerHeight($('#search-box').outerHeight() - $('#search-header').outerHeight() - $('#search-adv-settings').outerHeight());
- this.$resultsContainer.scroller.update({alwaysVisibleY: true});
+ this.updateResultsContainerHeight();
},
hide: function () {
@@ -321,15 +327,34 @@ define([
ChangeSettings: function(props) {
},
+ updateResultsContainerHeight: function () {
+ if (this.$resultsContainer) {
+ this.$resultsContainer.outerHeight($('#search-box').outerHeight() - $('#search-header').outerHeight() - $('#search-adv-settings').outerHeight());
+ this.$resultsContainer.scroller.update({alwaysVisibleY: true});
+ }
+ },
+
updateResultsNumber: function (current, count) {
var text;
if (count > 300) {
text = this.textTooManyResults;
} else {
- text = current === 'no-results' ? this.textNoSearchResults : (!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count));
+ text = current === 'no-results' ? this.textNoSearchResults :
+ (current === 'stop' ? this.textSearchHasStopped :
+ (current === 'content-changed' ? (this.textContentChanged + ' ' + Common.Utils.String.format(this.textSearchAgain, '','')) :
+ (!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count))));
}
- this.$reaultsNumber.text(text);
- this.disableReplaceButtons(!count);
+ if (current === 'content-changed') {
+ var me = this;
+ this.$reaultsNumber.html(text);
+ this.$reaultsNumber.find('.search-again').on('click', function () {
+ me.fireEvent('search:next', [me.inputText.getValue(), true]);
+ });
+ } else {
+ this.$reaultsNumber.text(text);
+ }
+ this.updateResultsContainerHeight();
+ !window.SSE && this.disableReplaceButtons(!count);
},
onClickClosePanel: function() {
@@ -358,8 +383,7 @@ define([
this.$searchOptionsBlock[this.extendedOptions ? 'removeClass' : 'addClass']('no-expand');
Common.localStorage.setBool('sse-search-options-extended', this.extendedOptions);
- this.$resultsContainer.outerHeight($('#search-box').outerHeight() - $('#search-header').outerHeight() - $('#search-adv-settings').outerHeight());
- this.$resultsContainer.scroller.update({alwaysVisibleY: true});
+ this.updateResultsContainerHeight();
},
setFindText: function (val) {
@@ -371,9 +395,9 @@ define([
},
disableNavButtons: function (resultNumber, allResults) {
- var disable = this.inputText._input.val() === '';
- this.btnBack.setDisabled(disable || !allResults || resultNumber === 0);
- this.btnNext.setDisabled(disable || !allResults || resultNumber + 1 === allResults);
+ var disable = (this.inputText._input.val() === '' && !window.SSE) || !allResults;
+ this.btnBack.setDisabled(disable);
+ this.btnNext.setDisabled(disable);
},
disableReplaceButtons: function (disable) {
@@ -412,7 +436,10 @@ define([
textName: 'Name',
textCell: 'Cell',
textValue: 'Value',
- textFormula: 'Formula'
+ textFormula: 'Formula',
+ textSearchHasStopped: 'Search has stopped',
+ textContentChanged: 'Document changed.',
+ textSearchAgain: '{0}Perform new search{1} for accurate results.'
}, Common.Views.SearchPanel || {}));
});
\ No newline at end of file
diff --git a/apps/common/main/lib/view/SignSettingsDialog.js b/apps/common/main/lib/view/SignSettingsDialog.js
index 47347c24e..a23fec07e 100644
--- a/apps/common/main/lib/view/SignSettingsDialog.js
+++ b/apps/common/main/lib/view/SignSettingsDialog.js
@@ -63,10 +63,7 @@ define([
}, options || {});
this.template = [
- '',
- '
',
- '',
- '
',
+ '
',
'
',
'',
'
',
@@ -125,6 +122,7 @@ define([
});
me.textareaInstructions = this.$window.find('textarea');
+ me.textareaInstructions.val(this.textDefInstruction);
me.textareaInstructions.keydown(function (event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
event.stopPropagation();
@@ -136,7 +134,8 @@ define([
this.chDate = new Common.UI.CheckBox({
el: $('#id-dlg-sign-settings-date'),
labelText: this.textShowDate,
- disabled: this.type=='view'
+ disabled: this.type=='view',
+ value: 'checked'
});
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
@@ -198,13 +197,14 @@ define([
},
textInfo: 'Signer Info',
- textInfoName: 'Name',
- textInfoTitle: 'Signer Title',
- textInfoEmail: 'E-mail',
- textInstructions: 'Instructions for Signer',
+ textInfoName: 'Suggested signer',
+ textInfoTitle: 'Suggested signer\'s title',
+ textInfoEmail: 'Suggested signer\'s e-mail',
+ textInstructions: 'Instructions for signer',
txtEmpty: 'This field is required',
textAllowComment: 'Allow signer to add comment in the signature dialog',
textShowDate: 'Show sign date in signature line',
- textTitle: 'Signature Setup'
+ textTitle: 'Signature Setup',
+ textDefInstruction: 'Before signing this document, verify that the content you are signing is correct.'
}, Common.Views.SignSettingsDialog || {}))
});
\ No newline at end of file
diff --git a/apps/common/main/lib/view/SymbolTableDialog.js b/apps/common/main/lib/view/SymbolTableDialog.js
index 6032db74b..008a89954 100644
--- a/apps/common/main/lib/view/SymbolTableDialog.js
+++ b/apps/common/main/lib/view/SymbolTableDialog.js
@@ -430,7 +430,7 @@ define([
'
',
'',
'',
- ' |
',
'',
'',
- '',
+ '',
' | ',
'
',
'
',
@@ -1104,7 +1104,7 @@ define([
},
getMaxHeight: function(){
- return this.symbolTablePanel.innerHeight();
+ return this.symbolTablePanel.innerHeight()-2;
},
getRowsCount: function() {
@@ -1436,8 +1436,8 @@ define([
this.curSize = {resize: false, width: size[0], height: size[1]};
} else if (this.curSize.resize) {
this._preventUpdateScroll = false;
- this.curSize.height = size[1] - 302 + 38*(this.special ? 0 : 1);
- var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
+ this.curSize.height = size[1] - 304 + 38*(this.special ? 0 : 1);
+ var rows = Math.max(1, (((this.curSize.height-2)/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT;
this.symbolTablePanel.css({'height': this.curSize.height + 'px'});
@@ -1447,7 +1447,7 @@ define([
this.updateView(undefined, undefined, undefined, true);
- this.specialList.cmpEl.height(size[1] - 156 + 38*(this.special ? 0 : 1));
+ this.specialList.cmpEl.height(size[1] - 157 + 38*(this.special ? 0 : 1));
!this.special && (size[1] += 38);
var valJson = JSON.stringify(size);
@@ -1465,16 +1465,16 @@ define([
this.curSize.resize = true;
this.curSize.width = size[0];
- this.curSize.height = size[1] - 302 + 38*(this.special ? 0 : 1);
+ this.curSize.height = size[1] - 304 + 38*(this.special ? 0 : 1);
- var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
+ var rows = Math.max(1, (((this.curSize.height-2)/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT;
this.symbolTablePanel.css({'height': this.curSize.height + 'px'});
this.previewPanel.css({'height': height + 'px'});
this.previewScrolled.css({'height': height + 'px'});
- this.specialList.cmpEl.height(size[1] - 156 + 38*(this.special ? 0 : 1));
+ this.specialList.cmpEl.height(size[1] - 157 + 38*(this.special ? 0 : 1));
this.updateView(undefined, undefined, undefined, true);
}
diff --git a/apps/common/main/resources/help/download.html b/apps/common/main/resources/help/download.html
index 6bebaa2aa..c63fffa44 100644
--- a/apps/common/main/resources/help/download.html
+++ b/apps/common/main/resources/help/download.html
@@ -1,6 +1,10 @@