Merge branch release/v7.0.0 into master

This commit is contained in:
papacarlo 2022-01-17 14:33:54 +00:00
commit 6ea745f969
1369 changed files with 137879 additions and 36917 deletions

View file

@ -55,7 +55,8 @@
view: ["Group1", ""] // current user can view comments made by users from Group1 and users without a group.
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
}
},
protect: <can protect document> // default = true. show/hide protect tab or protect buttons
}
},
editorConfig: {
@ -104,7 +105,8 @@
customization: {
logo: {
image: url,
imageEmbedded: url,
imageDark: url, // logo for dark theme
imageEmbedded: url, // deprecated, use image instead
url: http://...
},
customer: {
@ -113,7 +115,8 @@
mail: 'support@gmail.com',
www: 'www.superpuper.com',
info: 'Some info',
logo: ''
logo: '',
logoDark: '', // logo for dark theme
},
about: true,
feedback: {
@ -137,7 +140,10 @@
},
review: {
hideReviewDisplay: false, // hide button Review mode
hoverMode: false // true - show review balloons on mouse move, not on click on text
hoverMode: false, // true - show review balloons on mouse move, not on click on text
showReviewChanges: false,
reviewDisplay: 'original', // original for viewer, markup for editor
trackChanges: undefined // true/false - open editor with track changes mode on/off,
},
chat: true,
comments: true,
@ -151,12 +157,12 @@
autosave: true,
forcesave: false,
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
showReviewChanges: false,
showReviewChanges: false, // must be deprecated. use customization.review.showReviewChanges instead
help: true,
compactHeader: false,
toolbarNoTabs: false,
toolbarHideFileName: false,
reviewDisplay: 'original', // original for viewer, markup for editor
reviewDisplay: 'original', // must be deprecated. use customization.review.reviewDisplay instead
spellcheck: true,
compatibleFeatures: false,
unit: 'cm' // cm, pt, inch,
@ -164,7 +170,7 @@
macros: true // can run macros in document
plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off,
trackChanges: undefined // true/false - open editor with track changes mode on/off, // must be deprecated. use customization.review.trackChanges instead
hideRulers: false // hide or show rulers on first loading (presentation or document editor)
hideNotes: false // hide or show notes panel on first loading (presentation editor)
uiTheme: 'theme-dark' // set interface theme: id or default-dark/default-light
@ -415,7 +421,7 @@
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
_config.document.fileType = _config.document.fileType.toLowerCase();
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml))$/
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf))$/
.exec(_config.document.fileType);
if (!type) {
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
@ -865,22 +871,23 @@
check = function(regex){ return regex.test(userAgent); },
isIE = !check(/opera/) && (check(/msie/) || check(/trident/) || check(/edge/)),
isChrome = !isIE && check(/\bchrome\b/),
isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0);
isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0),
path_type;
path += app + "/";
path += (config.type === "mobile" || isSafari_mobile)
? "mobile"
: (config.type === "embedded")
? "embed"
: "main";
path_type = (config.type === "mobile" || isSafari_mobile)
? "mobile" : (config.type === "embedded")
? "embed" : (config.document && typeof config.document.fileType === 'string' && config.document.fileType.toLowerCase() === 'oform')
? "forms" : "main";
path += path_type;
var index = "/index.html";
if (config.editorConfig) {
if (config.editorConfig && path_type!=="forms") {
var customization = config.editorConfig.customization;
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
index = "/index_loader.html";
} else if (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge')
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge')
index = "/index_internal.html";
}
@ -902,10 +909,12 @@
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) {
if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + encodeURIComponent(config.editorConfig.customization.loaderLogo);
} else if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.logo) {
if (config.type=='embedded' && config.editorConfig.customization.logo.imageEmbedded)
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.imageEmbedded);
else if (config.type!='embedded' && config.editorConfig.customization.logo.image)
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image);
if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded))
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded);
else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
config.editorConfig.customization.logo.image && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image));
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
}
}
}

View file

@ -109,6 +109,7 @@
},
mode : urlParams["mode"] || 'edit',
lang : urlParams["lang"] || 'en',
createUrl : 'desktop://create.new',
user: {
id: urlParams["userid"] || urlParams["username"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek'
}

View file

@ -102,6 +102,7 @@ div {
var sendNotificationTimer;
var sessionId;
var fileInfo;
var insertImageType;
var innerAlert = function (message) {
if (console && console.log)
@ -117,6 +118,12 @@ div {
innerAlert('Grab_Focus');
docEditor.grabFocus();
},
'Action_InsertGraphic': function (data) {
data && data.Values && docEditor.insertImage({
"c": insertImageType,
"images": [{ "url": data.Values.url }]
});
},
'Host_PostmessageReady': function (data) {
innerAlert('Host_PostmessageReady');
}
@ -226,6 +233,11 @@ div {
window.open(fileInfo.FileVersionUrl, "_blank");
};
var onRequestInsertImage = function (event) {
insertImageType = event.data.c;
_postMessage('UI_InsertGraphic', {});
};
var onError = function (event) {
if (event)
innerAlert(event.data);
@ -305,7 +317,8 @@ div {
"onRequestClose": fileInfo.ClosePostMessage || fileInfo.CloseUrl ? onRequestClose : undefined,
"onRequestRename": fileInfo.SupportsRename && fileInfo.UserCanRename ? onRequestRename : undefined,
"onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined,
"onRequestInsertImage": fileInfo.EnableInsertRemoteImage ? onRequestInsertImage : undefined
}
};

View file

@ -203,12 +203,13 @@ if (window.Common === undefined) {
});
},
requestRestore: function(version, url) {
requestRestore: function(version, url, fileType) {
_postMessage({
event: 'onRequestRestore',
data: {
version: version,
url: url
url: url,
fileType: fileType
}
});
},
@ -273,19 +274,23 @@ if (window.Common === undefined) {
_postMessage({ event: 'onOutdatedVersion' });
},
downloadAs: function(url) {
downloadAs: function(url, fileType) {
_postMessage({
event: 'onDownloadAs',
data: url
data: {
url: url,
fileType: fileType
}
});
},
requestSaveAs: function(url, title) {
requestSaveAs: function(url, title, fileType) {
_postMessage({
event: 'onRequestSaveAs',
data: {
url: url,
title: title
title: title,
fileType: fileType
}
});
},

View file

@ -69,7 +69,7 @@ Common.IrregularStack = function(config) {
}
var _get = function(obj) {
var index = _indexOf(obj, _weakCompare);
var index = (typeof obj === 'object')? _indexOf(obj, _weakCompare) : obj;
if (index != -1)
return _stack[index];
return undefined;
@ -79,10 +79,15 @@ Common.IrregularStack = function(config) {
return !(_indexOf(obj, _strongCompare) < 0);
}
var _length = function() {
return _stack.length;
}
return {
push: _push,
pop: _pop,
get: _get,
exist: _exist
exist: _exist,
length: _length
}
};

View file

@ -92,6 +92,14 @@
str = num.toString();
for (var i=str.length; i<digits; i++) strfill += fill;
return strfill + str;
},
getKeyByValue: function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
}
};
})();

View file

@ -1 +1,4 @@
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="-4 23 100 24"><style>.st0{fill:#5B5B5B;} .st1{fill:#3A3A3A;} .st2{opacity:0.42;fill:#8C8C8C;enable-background:new ;} .st3{opacity:0.72;fill:#9B9B9B;enable-background:new ;} .st4{fill:#9B9B9B;}</style><path class="st0" d="M21.3 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2 1.2 0 2.2.4 3.1 1.2.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.8-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3-.4-.5-.8-.8-1.3-.9-.1 0-.2-.1-.3-.1h-.6c-.1 0-.2 0-.3.1-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h2.4l3.1 5.6.5 1.2v-6.8h1.8V40h-2.3l-3.2-5.9-.4-1h-.1l.1 1.6V40H31zm9.3 0h1.9v7.4h3.6V40h-5.5zm4.4 0h2.1l1.8 3 .2.7h.1l.3-.7 1.8-3h2l-3.3 5.2V40H48v-3.7z"/><path class="st1" d="M53.1 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2s2.2.4 3.1 1.2c.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.9-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3s-.8-.8-1.3-.9c-.1 0-.2-.1-.3-.1h-.6s-.2 0-.3.1c-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h5v1.5h-3.2v2.1h3.1v1.5h-3.1V40h-1.8zm6.1 0h5v1.5h-3.2v2.1h3v1.5h-3V40h-1.8zm6 8.9v-8.9h1.9V40zM85 31.3v1.6c-.3-.1-.6-.2-1-.3s-.7-.1-1.1-.1c-1 0-1.7.3-2.2.9-.5.6-.8 1.3-.8 2.2s.2 1.6.7 2.2c.5.6 1.2.9 2.1.9.3 0 .7 0 1-.1.4 0 .8-.2 1.2-.3l.1 1.5c-.1 0-.1.1-.2.1s-.2.1-.4.1h-.8c-.3 0-.7.1-1.1.1h-.4c-1-.1-2-.5-2.9-1.2-.9-.7-1.3-1.8-1.3-3.4 0-1.5.4-2.6 1.3-3.5.9-.8 2-1.2 3.4-1.2h1c.3 0 .6.1.9.2.1 0 .1 0 .2.1s.2.1.3.2zm1.1-.2h5.5v1.4H88v2.1h3.2V36H88v2.6h3.6V40h-5.5z"/><path class="st2" d="M7.4 43.1l-7.7-3.7c-.7-.3-.7-.8 0-1.1L2.3 37l5.1 2.4c.7.3 1.7.3 2.4 0l5.1-2.4 2.7 1.3c.7.3.7.8 0 1.1l-7.7 3.7c-.7.3-1.8.3-2.5 0z"/><path class="st3" d="M7.4 38.7L-.3 35c-.7-.3-.7-.8 0-1.1l2.7-1.3L7.5 35c.7.3 1.7.3 2.4 0l5.2-2.4 2.7 1.2c.7.3.7.8 0 1.1L10 38.6c-.8.4-1.9.4-2.6.1z"/><path class="st4" d="M7.4 34.3l-7.7-3.7c-.7-.3-.7-.8 0-1.1l7.7-3.7c.7-.3 1.7-.3 2.4 0l7.7 3.7c.7.3.7.8 0 1.1l-7.7 3.7c-.6.3-1.7.3-2.4 0z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="20" fill="none">
<g fill-rule="evenodd" fill="#444"><path d="M20.211 7.003C19.395 7.655 19 8.658 19 9.987s.395 2.332 1.21 3.009S21.947 14 23.026 14c1.053 0 2-.326 2.79-1.003.79-.652 1.184-1.655 1.184-2.984 0-1.354-.395-2.332-1.184-3.009S24.105 6 23.026 6 21 6.326 20.211 7.003zm1.053 4.991c-.342-.426-.526-1.078-.526-2.006 0-.903.184-1.555.526-1.956.368-.426.763-.702 1.184-.803h0c.105-.025.211-.05.289-.05.079-.025.158-.025.263-.025h0a1.03 1.03 0 0 1 .145.013l.145.013c.079 0 .184.025.289.05.421.1.816.376 1.158.803s.526 1.103.526 1.981-.184 1.555-.526 1.981-.737.702-1.158.803l-.052.013c-.081.02-.15.037-.237.037-.105.025-.184.025-.29.025-.04 0-.085-.006-.132-.013h0l-.132-.013c-.087 0-.156-.017-.237-.037h0 0l-.052-.013c-.421-.1-.816-.376-1.184-.803zM30.134 6H28v8h1.639V9.282l-.026-1.41h.026l.416.897L32.866 14H35V6h-1.639v4.718l.026 1.41h-.026l-.416-1.077L30.134 6zm6.186 0H38v6.641h3.5V14h-5.18V6zm5.687 0H40l3.161 4.744V14h1.732v-3.256L48 6h-1.842l-1.787 2.821-.275.538h-.055l-.275-.538L42.007 6zM48 9.987c0-1.329.395-2.332 1.211-2.984C50 6.326 50.947 6 52.026 6s2 .326 2.79 1.003S56 8.658 56 10.013c0 1.329-.395 2.332-1.184 2.984-.79.677-1.737 1.003-2.79 1.003-1.079 0-2-.326-2.816-1.003C48.421 12.32 48 11.317 48 9.987zm1.737 0c0 .928.184 1.58.526 2.006.368.426.737.702 1.184.803.105.025.21.05.289.05.039 0 .086.006.132.013l.132.013c.105 0 .184 0 .289-.025.087 0 .156-.017.237-.037l.038-.009.014-.003c.421-.1.816-.376 1.158-.803s.526-1.103.526-1.981-.184-1.555-.526-1.981-.737-.702-1.158-.803c-.105-.025-.21-.05-.289-.05-.053 0-.099-.006-.145-.013L52 7.154c-.105 0-.184 0-.263.025-.079 0-.184.025-.289.05-.421.1-.816.376-1.184.803-.342.401-.526 1.053-.526 1.956zM62 6h-4.63v8H59v-3.359h2.871V9.282H59V7.359h3V6zm1.37 0H68v1.359h-3v1.923h2.871v1.359H65V14h-1.63V6zm6.13 0v8h1.638V6H69.5zm9 .202v1.363c-.273-.101-.546-.177-.843-.227a5.79 5.79 0 0 0-.967-.076c-.818 0-1.438.252-1.884.782-.446.505-.669 1.161-.669 1.943 0 .757.198 1.388.62 1.893s1.016.782 1.785.782c.236 0 .471-.019.739-.04h0l.129-.01c.322-.05.645-.126.992-.278l.099 1.338c-.05.025-.124.05-.198.076l-.322.076a4.65 4.65 0 0 1-.446.08h0l-.297.046-.917.05h-.248c-.893-.05-1.711-.404-2.455-1.009-.744-.631-1.116-1.615-1.116-2.927 0-1.287.372-2.297 1.091-3.003S75.302 6 76.517 6l.868.025c.236.022.454.063.684.106l.109.02c.025.013.056.019.087.025a.35.35 0 0 1 .087.025c.015-.016.04-.012.074-.007.021.003.046.007.074.007zM85 6h-5v8h5v-1.256h-3.336v-2.231h2.885V9.256h-2.885v-2H85V6z"/><path opacity=".5" d="M1.605 12.508l4.958 2.318c.503.229 1.348.229 1.874 0l4.936-2.307 1.188.557c.525.252.525.641 0 .87l-6.169 2.883c-.48.229-1.325.229-1.828 0L.394 13.945c-.526-.252-.526-.641 0-.87l1.21-.568z"/><path opacity=".75" d="M1.555 8.985l5.008 2.341c.503.229 1.348.229 1.874 0l5.008-2.341 1.161.544c.526.252.526.641 0 .87l-6.169 2.883c-.526.252-1.371.252-1.874 0L.394 10.398c-.526-.252-.526-.641 0-.87l1.161-.543z"/><path d="M6.563 9.825L.394 6.942c-.526-.252-.526-.641 0-.87l6.169-2.883c.525-.252 1.371-.252 1.874 0l6.169 2.883c.525.252.525.641 0 .87L8.437 9.825c-.526.229-1.371.229-1.874 0z"/>
</g><defs />
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -99,13 +99,13 @@
right: 0;
&.top {
top: 48px;
top: 40px;
bottom: 0;
}
&.bottom {
top: 0;
bottom: 46px;
bottom: 38px;
}
}
@ -126,7 +126,7 @@
top: 0;
left: 0;
width: 100%;
height: 48px;
height: 40px;
-webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
//-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
@ -137,7 +137,7 @@
bottom: 0;
left: 0;
width: 100%;
height: 46px;
height: 38px;
-webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
//-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
@ -238,7 +238,7 @@
.brand-logo {
display: block;
width: 100px;
height: 24px;
height: 20px;
background: url(../../../../common/embed/resources/img/logo.svg) no-repeat;
}

View file

@ -0,0 +1,225 @@
!window.Common && (window.Common = {});
!Common.Views && (Common.Views = {});
define([
'common/main/lib/component/Window',
'common/main/lib/component/MetricSpinner',
'common/main/lib/component/TextareaField'
], function () { 'use strict';
Common.Views.EmbedDialog = Common.UI.Window.extend(_.extend({
options: {
width: 300,
header: true,
style: 'min-width: 300px;',
cls: 'modal-dlg',
buttons: null
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
this.template = [
'<div class="box" style="height: 110px;">',
'<table cols="2" style="width: 100%;">',
'<tr>',
'<td style="padding-right: 10px;">',
'<label class="input-label">' + this.textWidth + ':</label>',
'<div id="embed-size-spin-width" style="display: inline-block;margin-left: 5px;"></div>',
'</td>',
'<td style="float:right;">',
'<label class="input-label">' + this.textHeight + ':</label>',
'<div id="embed-size-spin-height" style="display: inline-block;margin-left: 5px;"></div>',
'</td>',
'</tr>',
'<tr>',
'<td colspan="2">',
'<div id="embed-textarea" style="margin-top: 15px;"></div>',
'</td>',
'</tr>',
'</table>',
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer center">',
'<button class="btn normal primary dlg-btn" style="min-width: 86px;width: auto;">' + this.txtCopy + '</button>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.embedConfig = this.options.embedConfig;
this.embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{0}" width="{1}" height="{2}"></iframe>';
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
this.spnWidth = new Common.UI.MetricSpinner({
el: $('#embed-size-spin-width'),
step: 1,
width: 70,
defaultUnit : "px",
value: '400 px',
minValue: 400,
maxValue: 10000
});
this.spnWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){
this.updateEmbedCode();
}, this));
this.spnHeight = new Common.UI.MetricSpinner({
el: $('#embed-size-spin-height'),
step: 1,
width: 70,
defaultUnit : "px",
value: '600 px',
minValue: 600,
maxValue: 10000
});
this.spnHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
this.updateEmbedCode();
}, this));
this.textareaInput = new Common.UI.TextareaField({
el : $('#embed-textarea'),
style : 'width: 100%; height: 65px;',
value : ''
});
this.textareaInput._input.attr('readonly', true);
this.updateEmbedCode();
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
getFocusedComponents: function() {
return [this.spnWidth, this.spnHeight, this.textareaInput];
},
getDefaultFocusableComponent: function () {
return this.textareaInput;
},
onBtnClick: function(event) {
this.textareaInput._input.select();
if ( !document.execCommand('copy') ) {
Common.UI.warning({
msg: this.warnCopy,
buttons: ['ok']
});
}
},
updateEmbedCode: function() {
this.textareaInput.setValue(Common.Utils.String.format(this.embedCode, this.embedConfig.embedUrl, this.spnWidth.getNumberValue(), this.spnHeight.getNumberValue()));
},
textTitle: 'Embed',
textWidth: 'Width',
textHeight: 'Height',
txtCopy: 'Copy to clipboard',
warnCopy: 'Browser\'s error! Use keyboard shortcut [Ctrl] + [C]'
}, Common.Views.EmbedDialog || {}));
Common.Views.ShareDialog = Common.UI.Window.extend(_.extend({
options: {
width: 300,
header: true,
style: 'min-width: 300px;',
cls: 'modal-dlg',
buttons: null
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
this.template = [
'<div class="box" style="height: 100px;">',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td>',
'<div id="share-link-txt"></div>',
'</td>',
'</tr>',
'<tr>',
'<td>',
'<div class="share-buttons" style="margin-top: 15px;">',
'<span class="svg big-facebook" data-name="facebook"></span>',
'<span class="svg big-twitter" data-name="twitter"></span>',
'<span class="svg big-email" data-name="email"></span>',
'<div class="autotest" id="email" style="display: none"></div>',
'</div>',
'</td>',
'</tr>',
'</table>',
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer center">',
'<button class="btn normal primary dlg-btn" style="min-width: 86px;width: auto;">' + this.txtCopy + '</button>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.embedConfig = this.options.embedConfig;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
this.textUrl = new Common.UI.InputField({
el : $('#share-link-txt'),
editable : false,
value: this.embedConfig.shareUrl || ''
});
this.updateShareCode();
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
onBtnClick: function(event) {
this.textUrl._input.select();
if ( !document.execCommand('copy') ) {
Common.UI.warning({
msg: this.warnCopy,
buttons: ['ok']
});
}
},
updateShareCode: function() {
var me = this,
_encoded = encodeURIComponent(this.embedConfig.shareUrl),
docTitle = this.embedConfig.docTitle || '',
_mailto = 'mailto:?subject=I have shared a document with you: ' + docTitle + '&body=I have shared a document with you: ' + _encoded;
this.getChild().find('.share-buttons > span').on('click', function(e){
var _url;
switch ($(e.target).attr('data-name')) {
case 'facebook':
_url = 'https://www.facebook.com/sharer/sharer.php?u=' + me.embedConfig.shareUrl + '&t=' + encodeURI(docTitle);
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
break;
case 'twitter':
_url = 'https://twitter.com/share?url='+ _encoded;
!!docTitle && (_url += encodeURIComponent('&text=' + docTitle));
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
break;
case 'email':
window.open(_mailto, '_self');
break;
}
});
},
textTitle: 'Share Link',
txtCopy: 'Copy to clipboard',
warnCopy: 'Browser\'s error! Use keyboard shortcut [Ctrl] + [C]'
}, Common.Views.ShareDialog || {}))
});

View file

@ -0,0 +1,188 @@
<svg width="480" height="40" viewBox="0 0 480 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon-menu-sprite Embedded Viewer">
<g id="view-settings">
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
<path id="Vector_2" d="M17 30H3V31H17V30Z" fill="white"/>
<path id="Vector_3" d="M17 34H3V35H17V34Z" fill="white"/>
</g>
<g id="download">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M31 22H30V33.2929L25.3536 28.6464L24.6465 29.3536L30.1465 34.8536L30.5 35.2071L30.8536 34.8536L36.3536 29.3536L35.6465 28.6464L31 33.2929V22Z" fill="white"/>
<rect id="Rectangle 88" x="24" y="36" width="13" height="1" fill="white"/>
</g>
<g id="share">
<path id="share_2" d="M56 25C56 26.1046 55.1046 27 54 27C53.4663 27 52.9815 26.791 52.6229 26.4503L47.9076 29.3974C47.9676 29.5875 48 29.79 48 30C48 30.21 47.9676 30.4125 47.9076 30.6026L52.6229 33.5497C52.9815 33.209 53.4663 33 54 33C55.1046 33 56 33.8954 56 35C56 36.1046 55.1046 37 54 37C52.8954 37 52 36.1046 52 35C52 34.79 52.0324 34.5875 52.0924 34.3974L47.3771 31.4503C47.0185 31.791 46.5337 32 46 32C44.8954 32 44 31.1046 44 30C44 28.8954 44.8954 28 46 28C46.5337 28 47.0185 28.209 47.3771 28.5497L52.0924 25.6026C52.0324 25.4125 52 25.21 52 25C52 23.8954 52.8954 23 54 23C55.1046 23 56 23.8954 56 25Z" fill="white"/>
</g>
<g id="embed ">
<g id="embed _2">
<path d="M67.8536 25.3536L67.1465 24.6465L62.293 29.5L67.1465 34.3536L67.8536 33.6465L63.7072 29.5L67.8536 25.3536Z" fill="white"/>
<path d="M72.1465 25.3536L72.8536 24.6465L77.7072 29.5L72.8536 34.3536L72.1465 33.6465L76.293 29.5L72.1465 25.3536Z" fill="white"/>
</g>
</g>
<g id="full-screen">
<path id="Rectangle 81 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M93 27H87V33H93V27ZM86 26V34H94V26H86Z" fill="white"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M86 23H83V26H84V24H86V23Z" fill="white"/>
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M97 26L97 23L94 23L94 24L96 24L96 26L97 26Z" fill="white"/>
<path id="Subtract_3" fill-rule="evenodd" clip-rule="evenodd" d="M94 37L97 37L97 34L96 34L96 36L94 36L94 37Z" fill="white"/>
<path id="Subtract_4" fill-rule="evenodd" clip-rule="evenodd" d="M83 34L83 37L86 37L86 36L84 36L84 34L83 34Z" fill="white"/>
</g>
<g id="zoom-in">
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M111 25H110V30H105V31H110V36H111V31H116V30H111V25Z" fill="white"/>
</g>
<g id="zoom-out">
<rect id="Rectangle 44.8" x="135" y="30" width="1" height="10" transform="rotate(90 135 30)" fill="white"/>
</g>
<g id="scroll-to-first-sheet">
<path id="Vector 13 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M155 25L147 30L155 35V25Z" fill="white"/>
<path id="Rectangle 225" d="M145 25H146V35H145V25Z" fill="white"/>
</g>
<g id="scroll-to-last-sheet">
<path id="Vector 13 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M165 35L173 30L165 25V35Z" fill="white"/>
<path id="Rectangle 225 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M174 35H175V25H174V35Z" fill="white"/>
</g>
<g id="play">
<path id="Vector 8 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M185 23L198 30L185 37V23Z" fill="white"/>
</g>
<g id="pause">
<path id="Rectangle 81 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M205 25V35H209V25H205Z" fill="white"/>
<path id="Rectangle 81.1 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M211 25V35H215V25H211Z" fill="white"/>
</g>
<g id=" print">
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M226 24H234V26H226V24ZM225 26V24C225 23.4477 225.448 23 226 23H234C234.552 23 235 23.4477 235 24V26H237C237.552 26 238 26.4477 238 27V33C238 33.5523 237.552 34 237 34H235V36C235 36.5523 234.552 37 234 37H226C225.448 37 225 36.5523 225 36V34H223C222.448 34 222 33.5523 222 33V27C222 26.4477 222.448 26 223 26H225ZM225 33V31C225 30.4477 225.448 30 226 30H234C234.552 30 235 30.4477 235 31V33H237V27H234H226H223V33H225ZM225 28H224V29H225V28ZM234 31H226V36H234V31ZM227 32H233V33H227V32ZM233 34H227V35H233V34Z" fill="white"/>
</g>
<g id="clear-style">
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 24.5608C252.291 23.5845 250.708 23.5845 249.732 24.5608L243.561 30.7324C242.584 31.7087 242.584 33.2916 243.561 34.268L245.146 35.8537L245.293 36.0002L245.5 36.0002H249.5L249.707 36.0002L255 36.0002V35.0002H250.707L255.439 30.268C256.416 29.2916 256.416 27.7087 255.439 26.7324L253.268 24.5608ZM249.293 35.0002L252.793 31.5002L248.5 27.2073L244.268 31.4395C243.682 32.0253 243.682 32.9751 244.268 33.5609L245.707 35.0002L249.293 35.0002ZM249.207 26.5002L253.5 30.7931L254.732 29.5608C255.318 28.9751 255.318 28.0253 254.732 27.4395L252.561 25.268C251.975 24.6822 251.025 24.6822 250.439 25.268L249.207 26.5002Z" fill="white"/>
</g>
<g id="view-settings_2">
<path id="Vector_4" d="M17 6H3V7H17V6Z" fill="black"/>
<path id="Vector_5" d="M17 10H3V11H17V10Z" fill="black"/>
<path id="Vector_6" d="M17 14H3V15H17V14Z" fill="black"/>
</g>
<g id="download_2">
<path id="Union_5" fill-rule="evenodd" clip-rule="evenodd" d="M31 2H30V13.2929L25.3536 8.64645L24.6465 9.35355L30.1465 14.8536L30.5 15.2071L30.8536 14.8536L36.3536 9.35355L35.6465 8.64645L31 13.2929V2Z" fill="black"/>
<rect id="Rectangle 88_2" x="24" y="16" width="13" height="1" fill="black"/>
</g>
<g id="share_3">
<path id="share_4" d="M56 5C56 6.10457 55.1046 7 54 7C53.4663 7 52.9815 6.79098 52.6229 6.45034L47.9076 9.39737C47.9676 9.58754 48 9.78999 48 10C48 10.21 47.9676 10.4125 47.9076 10.6026L52.6229 13.5497C52.9815 13.209 53.4663 13 54 13C55.1046 13 56 13.8954 56 15C56 16.1046 55.1046 17 54 17C52.8954 17 52 16.1046 52 15C52 14.79 52.0324 14.5875 52.0924 14.3974L47.3771 11.4503C47.0185 11.791 46.5337 12 46 12C44.8954 12 44 11.1046 44 10C44 8.89543 44.8954 8 46 8C46.5337 8 47.0185 8.20902 47.3771 8.54966L52.0924 5.60264C52.0324 5.41246 52 5.21001 52 5C52 3.89543 52.8954 3 54 3C55.1046 3 56 3.89543 56 5Z" fill="black"/>
</g>
<g id="embed _3">
<g id="embed _4">
<path d="M67.8536 5.35359L67.1465 4.64648L62.293 9.50004L67.1465 14.3536L67.8536 13.6465L63.7072 9.50004L67.8536 5.35359Z" fill="black"/>
<path d="M72.1465 5.35359L72.8536 4.64648L77.7072 9.50004L72.8536 14.3536L72.1465 13.6465L76.293 9.50004L72.1465 5.35359Z" fill="black"/>
</g>
</g>
<g id="full-screen_2">
<path id="Rectangle 81 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M93 7H87V13H93V7ZM86 6V14H94V6H86Z" fill="black"/>
<path id="Subtract_5" fill-rule="evenodd" clip-rule="evenodd" d="M86 3H83V6H84V4H86V3Z" fill="black"/>
<path id="Subtract_6" fill-rule="evenodd" clip-rule="evenodd" d="M97 6L97 3L94 3L94 4L96 4L96 6L97 6Z" fill="black"/>
<path id="Subtract_7" fill-rule="evenodd" clip-rule="evenodd" d="M94 17L97 17L97 14L96 14L96 16L94 16L94 17Z" fill="black"/>
<path id="Subtract_8" fill-rule="evenodd" clip-rule="evenodd" d="M83 14L83 17L86 17L86 16L84 16L84 14L83 14Z" fill="black"/>
</g>
<g id="zoom-in_2">
<path id="Union_6" fill-rule="evenodd" clip-rule="evenodd" d="M111 5H110V10H105V11H110V16H111V11H116V10H111V5Z" fill="black"/>
</g>
<g id="zoom-out_2">
<rect id="Rectangle 44.8_2" x="135" y="10" width="1" height="10" transform="rotate(90 135 10)" fill="black"/>
</g>
<g id="scroll-to-first-sheet_2">
<path id="Vector 13 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M155 5L147 10L155 15V5Z" fill="black"/>
<path id="Rectangle 225_2" d="M145 5H146V15H145V5Z" fill="black"/>
</g>
<g id="scroll-to-last-sheet_2">
<path id="Vector 13 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M165 15L173 10L165 5V15Z" fill="black"/>
<path id="Rectangle 225 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M174 15H175V5H174V15Z" fill="black"/>
</g>
<g id="play_2">
<path id="Vector 8 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M185 3L198 10L185 17V3Z" fill="black"/>
</g>
<g id="pause_2">
<path id="Rectangle 81 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M205 5V15H209V5H205Z" fill="black"/>
<path id="Rectangle 81.1 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M211 5V15H215V5H211Z" fill="black"/>
</g>
<g id=" print_2">
<path id="Union_7" fill-rule="evenodd" clip-rule="evenodd" d="M226 4H234V6H226V4ZM225 6V4C225 3.44772 225.448 3 226 3H234C234.552 3 235 3.44772 235 4V6H237C237.552 6 238 6.44772 238 7V13C238 13.5523 237.552 14 237 14H235V16C235 16.5523 234.552 17 234 17H226C225.448 17 225 16.5523 225 16V14H223C222.448 14 222 13.5523 222 13V7C222 6.44772 222.448 6 223 6H225ZM225 13V11C225 10.4477 225.448 10 226 10H234C234.552 10 235 10.4477 235 11V13H237V7H234H226H223V13H225ZM225 8H224V9H225V8ZM234 11H226V16H234V11ZM227 12H233V13H227V12ZM233 14H227V15H233V14Z" fill="black"/>
</g>
<g id="clear-style_2">
<path id="Union_8" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 4.56085C252.291 3.58454 250.708 3.58453 249.732 4.56085L243.561 10.7324C242.584 11.7087 242.584 13.2916 243.561 14.268L245.146 15.8537L245.293 16.0002L245.5 16.0002H249.5L249.707 16.0002L255 16.0002V15.0002H250.707L255.439 10.268C256.416 9.29164 256.416 7.70873 255.439 6.73242L253.268 4.56085ZM249.293 15.0002L252.793 11.5002L248.5 7.20729L244.268 11.4395C243.682 12.0253 243.682 12.9751 244.268 13.5609L245.707 15.0002L249.293 15.0002ZM249.207 6.50019L253.5 10.7931L254.732 9.56085C255.318 8.97506 255.318 8.02531 254.732 7.43953L252.561 5.26795C251.975 4.68217 251.025 4.68217 250.439 5.26795L249.207 6.50019Z" fill="black"/>
</g>
<g id="edit">
<path id="Vector_7" d="M263 34V37H266L274 29L271 26L263 34Z" fill="white"/>
<path id="Vector 2" d="M275 28L272 25L274 23H275L277 25V26L275 28Z" fill="white"/>
</g>
<g id="more-vertical">
<circle id="Ellipse" cx="290" cy="26" r="1" transform="rotate(90 290 26)" fill="white"/>
<circle id="Ellipse_2" cx="290" cy="30" r="1" transform="rotate(90 290 30)" fill="white"/>
<circle id="Ellipse_3" cx="290" cy="34" r="1" transform="rotate(90 290 34)" fill="white"/>
</g>
<g id="go-to-location">
<path id="Vector_8" d="M317 26H311V25C311 24.45 310.55 24 310 24H303C302.45 24 302 24.45 302 25V36C302 36.55 302.45 37 303 37H317C317.55 37 318 36.55 318 36V27C318 26.45 317.55 26 317 26ZM317 36H303V25H310V27H317V36Z" fill="white"/>
<path id="Union_9" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 33.6465L310.354 34.3536L313.207 31.5L310.354 28.6465L309.646 29.3536L311.268 30.9747H306V31.9747H311.318L309.646 33.6465Z" fill="white"/>
</g>
<g id="arrow-down">
<path id="Union_10" fill-rule="evenodd" clip-rule="evenodd" d="M331 23H330V34.2929L325.354 29.6464L324.646 30.3536L330.146 35.8536L330.5 36.2071L330.854 35.8536L336.354 30.3536L335.646 29.6464L331 34.2929V23Z" fill="white"/>
</g>
<g id="edit_2">
<path id="Vector_9" d="M263 14V17H266L274 9L271 6L263 14Z" fill="black"/>
<path id="Vector 2_2" d="M275 8L272 5L274 3H275L277 5V6L275 8Z" fill="black"/>
</g>
<g id="more-vertical_2">
<circle id="Ellipse_4" cx="290" cy="6" r="1" transform="rotate(90 290 6)" fill="black"/>
<circle id="Ellipse_5" cx="290" cy="10" r="1" transform="rotate(90 290 10)" fill="black"/>
<circle id="Ellipse_6" cx="290" cy="14" r="1" transform="rotate(90 290 14)" fill="black"/>
</g>
<g id="go-to-location_2">
<path id="Vector_10" d="M317 6H311V5C311 4.45 310.55 4 310 4H303C302.45 4 302 4.45 302 5V16C302 16.55 302.45 17 303 17H317C317.55 17 318 16.55 318 16V7C318 6.45 317.55 6 317 6ZM317 16H303V5H310V7H317V16Z" fill="black"/>
<path id="Union_11" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 13.6465L310.354 14.3536L313.207 11.5L310.354 8.64648L309.646 9.35359L311.268 10.9747H306V11.9747H311.318L309.646 13.6465Z" fill="black"/>
</g>
<g id="arrow-down_2">
<path id="Union_12" fill-rule="evenodd" clip-rule="evenodd" d="M331 3H330V14.2929L325.354 9.64645L324.646 10.3536L330.146 15.8536L330.5 16.2071L330.854 15.8536L336.354 10.3536L335.646 9.64645L331 14.2929V3Z" fill="black"/>
</g>
<g id="arrow-up">
<path id="Union_13" fill-rule="evenodd" clip-rule="evenodd" d="M350 36.207L351 36.207L351 24.9141L355.646 29.5606L356.354 28.8535L350.854 23.3535L350.5 22.9999L350.146 23.3535L344.646 28.8535L345.354 29.5606L350 24.9141L350 36.207Z" fill="white"/>
</g>
<g id="arrow-up_2">
<path id="Union_14" fill-rule="evenodd" clip-rule="evenodd" d="M350 16.207L351 16.207L351 4.91414L355.646 9.56059L356.354 8.85348L350.854 3.35348L350.5 2.99993L350.146 3.35348L344.646 8.85348L345.354 9.56059L350 4.91414L350 16.207Z" fill="black"/>
</g>
<g id="close">
<path id="Vector 73" d="M366 25L375 34M375 25L366 34" stroke="white" stroke-width="1.5"/>
</g>
<g id="close_2">
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
</g>
<g id="сut">
<circle id="Ellipse 103" cx="385.5" cy="13.5" r="2" stroke="black"/>
<circle id="Ellipse 104" cx="385.5" cy="6.5" r="2" stroke="black"/>
<path id="Rectangle 1552" d="M387.188 7.56689L398.446 14.0669V14.0669C398.17 14.5452 397.559 14.7091 397.08 14.4329L386.688 8.43292L387.188 7.56689Z" fill="black"/>
<path id="Rectangle 1553" d="M386.688 11.5669L397.08 5.56689C397.558 5.29075 398.17 5.45463 398.446 5.93292V5.93292L387.188 12.4329L386.688 11.5669Z" fill="black"/>
</g>
<g id="сut_2">
<circle id="Ellipse 103_2" cx="385.5" cy="33.5" r="2" stroke="white"/>
<circle id="Ellipse 104_2" cx="385.5" cy="26.5" r="2" stroke="white"/>
<path id="Rectangle 1552_2" d="M387.188 27.5669L398.446 34.0669V34.0669C398.17 34.5452 397.559 34.7091 397.08 34.4329L386.688 28.4329L387.188 27.5669Z" fill="white"/>
<path id="Rectangle 1553_2" d="M386.688 31.5669L397.08 25.5669C397.558 25.2908 398.17 25.4546 398.446 25.9329V25.9329L387.188 32.4329L386.688 31.5669Z" fill="white"/>
</g>
<g id="copy">
<path id="Union_27" fill-rule="evenodd" clip-rule="evenodd" d="M404 5H412V7H413V5C413 4.44772 412.552 4 412 4H404C403.448 4 403 4.44772 403 5V12C403 12.5523 403.448 13 404 13H406V12H404V5ZM411 6H405V7H411V6ZM408 9V16H416V9H408ZM408 8C407.448 8 407 8.44772 407 9V16C407 16.5523 407.448 17 408 17H416C416.552 17 417 16.5523 417 16V9C417 8.44772 416.552 8 416 8H408ZM406 8H405V9H406V8ZM405 10H406V11H405V10ZM415 11V10H409V11H415ZM415 12V13H409V12H415ZM415 15V14H409V15H415Z" fill="black"/>
</g>
<g id="copy_2">
<path id="Union_28" fill-rule="evenodd" clip-rule="evenodd" d="M404 25H412V27H413V25C413 24.4477 412.552 24 412 24H404C403.448 24 403 24.4477 403 25V32C403 32.5523 403.448 33 404 33H406V32H404V25ZM411 26H405V27H411V26ZM408 29V36H416V29H408ZM408 28C407.448 28 407 28.4477 407 29V36C407 36.5523 407.448 37 408 37H416C416.552 37 417 36.5523 417 36V29C417 28.4477 416.552 28 416 28H408ZM406 28H405V29H406V28ZM405 30H406V31H405V30ZM415 31V30H409V31H415ZM415 32V33H409V32H415ZM415 35V34H409V35H415Z" fill="white"/>
</g>
<g id="paste">
<path id="Union_29" fill-rule="evenodd" clip-rule="evenodd" d="M426 3H432V4H434C434.552 4 435 4.44772 435 5V7H434V5H432V6H426V5H424V12H426V13H424C423.448 13 423 12.5523 423 12V5C423 4.44772 423.448 4 424 4H426V3ZM436 16V9H428V16H436ZM428 8C427.448 8 427 8.44772 427 9V16C427 16.5523 427.448 17 428 17H436C436.552 17 437 16.5523 437 16V9C437 8.44772 436.552 8 436 8H428ZM429 11V10H435V11H429ZM435 12H429V13H435V12ZM429 15V14H435V15H429Z" fill="black"/>
</g>
<g id="paste_2">
<path id="Union_30" fill-rule="evenodd" clip-rule="evenodd" d="M426 23H432V24H434C434.552 24 435 24.4477 435 25V27H434V25H432V26H426V25H424V32H426V33H424C423.448 33 423 32.5523 423 32V25C423 24.4477 423.448 24 424 24H426V23ZM436 36V29H428V36H436ZM428 28C427.448 28 427 28.4477 427 29V36C427 36.5523 427.448 37 428 37H436C436.552 37 437 36.5523 437 36V29C437 28.4477 436.552 28 436 28H428ZM429 31V30H435V31H429ZM435 32H429V33H435V32ZM429 35V34H435V35H429Z" fill="white"/>
</g>
<g id="redo">
<path id="Vector" d="M469.1 7C471.1 7 473.2 8.3 474.5 9.5L477 7V14H470L472.5 11.5C471.7 10.2 469.9 9.1 468.2 9.1C465.7 9.1 462.8 10.8 462.5 13.2C462.9 9.7 465.5 7 469.1 7Z" fill="black"/>
</g>
<g id="redo_2">
<path id="Vector_2" d="M469.1 27C471.1 27 473.2 28.3 474.5 29.5L477 27V34H470L472.5 31.5C471.7 30.2 469.9 29.1 468.2 29.1C465.7 29.1 462.8 30.8 462.5 33.2C462.9 29.7 465.5 27 469.1 27Z" fill="white"/>
</g>
<g id="undo">
<path id="Vector_3" d="M450.9 7C448.9 7 446.8 8.3 445.5 9.5L443 7V14H450L447.5 11.5C448.3 10.2 450.1 9.1 451.8 9.1C454.3 9.1 457.2 10.8 457.5 13.2C457.1 9.7 454.5 7 450.9 7Z" fill="black"/>
</g>
<g id="undo_2">
<path id="Vector_4" d="M450.9 27C448.9 27 446.8 28.3 445.5 29.5L443 27V34H450L447.5 31.5C448.3 30.2 450.1 29.1 451.8 29.1C454.3 29.1 457.2 30.8 457.5 33.2C457.1 29.7 454.5 27 450.9 27Z" fill="white"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 152 76"><defs><path id="a" d="M144.9 0h-23.8c-3.9 0-7.1 3.2-7.1 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zm1.8 28.3c0 1.3-1.1 2.4-2.4 2.4h-22.4c-1.3 0-2.4-1.1-2.4-2.4V9.7c0-1.3 1.1-2.4 2.4-2.4h22.4c1.3 0 2.4 1.1 2.4 2.4v18.6zM68.9 0H45.1C41.2 0 38 3.2 38 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm-1.8 14.6v.7c0 6.9-5.2 14.8-14.8 14.8-2.9 0-5.7-.9-8-2.3.4 0 .8.1 1.2.1 2.4 0 4.7-.8 6.5-2.2-2.3 0-4.2-1.6-4.8-3.6.3 0 .6.1 1 .1.5 0 .8-.1 1.3-.2-2.4-.5-4.3-2.6-4.3-5.1.8.4 1.6.6 2.5.6-1.4-.9-2.3-2.5-2.3-4.3 0-.9.3-1.9.7-2.6 2.6 3.2 6.4 5.2 10.7 5.4-.1-.4-.1-.8-.1-1.2 0-2.9 2.3-5.2 5.2-5.2 1.5 0 2.8.6 3.8 1.6 1.2-.2 2.3-.7 3.3-1.3-.4 1.2-1.2 2.3-2.3 2.9 1.1-.1 2.1-.4 3-.8-.7 1-1.6 1.9-2.6 2.6zM30.9 0H7.1C3.2 0 0 3.2 0 7.1v23.7c0 4 3.2 7.2 7.1 7.2h11.7V26.8h-5.3v-5.7h5.3V17c0-4.8 3.2-7.5 7.9-7.5 2.2 0 4.2.1 4.7.2v5.1h-3.2c-2.6 0-3.1 1.1-3.1 2.7v3.6h6.1l-.8 5.7h-5.3V38h5.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm105.9 20.6c-1.1.9-2.4 2-3.8 2-1.5 0-2.8-1.1-3.8-2l-6-4.8c-.4-.3-.7-.6-1-.9v12.6c0 .2.2.5.4.5h20.7c.2 0 .4-.2.4-.5V14.9c-.3.3-.6.6-1 .9-1.9 1.6-3.9 3.2-5.9 4.8zM106.9 0H83.1C79.2 0 76 3.2 76 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zM89.6 28.5c-5.3 0-9.5-4.3-9.5-9.5s4.2-9.5 9.5-9.5c2.5 0 4.7.9 6.4 2.5l-2.6 2.5c-.7-.7-2-1.5-3.8-1.5-3.3 0-5.9 2.7-5.9 6s2.6 6 5.9 6c3.8 0 5.2-2.7 5.4-4.1h-5.4v-3.3h9c.1.5.1 1 .1 1.6 0 5.4-3.7 9.3-9.1 9.3zm20.3-8.1h-2.7v2.7h-2.7v-2.7h-2.7v-2.7h2.7V15h2.7v2.7h2.7v2.7zM143.3 10h-20.7c-.2 0-.4.2-.4.5 0 1.6.8 3 2.1 4 1.9 1.5 3.8 3 5.6 4.5.7.6 2.1 1.9 3.1 1.9s2.3-1.3 3.1-1.9c1.9-1.5 3.7-3 5.6-4.5.9-.7 2.1-2.3 2.1-3.5 0-.4.1-1-.5-1z"/></defs><use xlink:href="#a" fill="#999"/><use xlink:href="#a" fill="#666" y="38"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1 @@
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="-4 23 100 24"><style>.st0{fill:#5B5B5B;} .st1{fill:#3A3A3A;} .st2{opacity:0.42;fill:#8C8C8C;enable-background:new ;} .st3{opacity:0.72;fill:#9B9B9B;enable-background:new ;} .st4{fill:#9B9B9B;}</style><path class="st0" d="M21.3 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2 1.2 0 2.2.4 3.1 1.2.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.8-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3-.4-.5-.8-.8-1.3-.9-.1 0-.2-.1-.3-.1h-.6c-.1 0-.2 0-.3.1-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h2.4l3.1 5.6.5 1.2v-6.8h1.8V40h-2.3l-3.2-5.9-.4-1h-.1l.1 1.6V40H31zm9.3 0h1.9v7.4h3.6V40h-5.5zm4.4 0h2.1l1.8 3 .2.7h.1l.3-.7 1.8-3h2l-3.3 5.2V40H48v-3.7z"/><path class="st1" d="M53.1 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2s2.2.4 3.1 1.2c.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.9-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3s-.8-.8-1.3-.9c-.1 0-.2-.1-.3-.1h-.6s-.2 0-.3.1c-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h5v1.5h-3.2v2.1h3.1v1.5h-3.1V40h-1.8zm6.1 0h5v1.5h-3.2v2.1h3v1.5h-3V40h-1.8zm6 8.9v-8.9h1.9V40zM85 31.3v1.6c-.3-.1-.6-.2-1-.3s-.7-.1-1.1-.1c-1 0-1.7.3-2.2.9-.5.6-.8 1.3-.8 2.2s.2 1.6.7 2.2c.5.6 1.2.9 2.1.9.3 0 .7 0 1-.1.4 0 .8-.2 1.2-.3l.1 1.5c-.1 0-.1.1-.2.1s-.2.1-.4.1h-.8c-.3 0-.7.1-1.1.1h-.4c-1-.1-2-.5-2.9-1.2-.9-.7-1.3-1.8-1.3-3.4 0-1.5.4-2.6 1.3-3.5.9-.8 2-1.2 3.4-1.2h1c.3 0 .6.1.9.2.1 0 .1 0 .2.1s.2.1.3.2zm1.1-.2h5.5v1.4H88v2.1h3.2V36H88v2.6h3.6V40h-5.5z"/><path class="st2" d="M7.4 43.1l-7.7-3.7c-.7-.3-.7-.8 0-1.1L2.3 37l5.1 2.4c.7.3 1.7.3 2.4 0l5.1-2.4 2.7 1.3c.7.3.7.8 0 1.1l-7.7 3.7c-.7.3-1.8.3-2.5 0z"/><path class="st3" d="M7.4 38.7L-.3 35c-.7-.3-.7-.8 0-1.1l2.7-1.3L7.5 35c.7.3 1.7.3 2.4 0l5.2-2.4 2.7 1.2c.7.3.7.8 0 1.1L10 38.6c-.8.4-1.9.4-2.6.1z"/><path class="st4" d="M7.4 34.3l-7.7-3.7c-.7-.3-.7-.8 0-1.1l7.7-3.7c.7-.3 1.7-.3 2.4 0l7.7 3.7c.7.3.7.8 0 1.1l-7.7 3.7c-.6.3-1.7.3-2.4 0z"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

View file

@ -0,0 +1,637 @@
@import "../../../../common/main/resources/less/asc-mixins.less";
// Bootstrap overwrite
@import "../../../../common/main/resources/less/variables.less";
@import "../../../../common/main/resources/less/colors-table.less";
@import "../../../../common/main/resources/less/colors-table-classic.less";
@import "../../../../common/main/resources/less/colors-table-dark.less";
// Core variables and mixins
//@import "../../../../../vendor/bootstrap/less/variables.less";
@icon-font-path: "../../../../../vendor/bootstrap/dist/fonts/";
@import "../../../../../vendor/bootstrap/less/mixins.less";
// Reset
@import "../../../../../vendor/bootstrap/less/normalize.less";
//@import "../../../../../vendor/bootstrap/less/print.less";
// Core CSS
@import "../../../../../vendor/bootstrap/less/scaffolding.less";
@import "../../../../../vendor/bootstrap/less/type.less";
//@import "code.less";
//@import "grid.less";
//@import "tables.less";
@import "../../../../../vendor/bootstrap/less/forms.less";
@import "../../../../../vendor/bootstrap/less/buttons.less";
// Components
@import "../../../../../vendor/bootstrap/less/component-animations.less";
//@import "../../../../../vendor/bootstrap/less/glyphicons.less";
//@import "dropdowns.less";
//@import "button-groups.less";
//@import "input-groups.less";
//@import "navs.less";
//@import "navbar.less";
//@import "breadcrumbs.less";
//@import "pagination.less";
//@import "pager.less";
//@import "../../../../../vendor/bootstrap/less/labels.less";
//@import "badges.less";
//@import "jumbotron.less";
//@import "thumbnails.less";
//@import "../../../../../vendor/bootstrap/less/alerts.less";
//@import "progress-bars.less";
//@import "media.less";
//@import "list-group.less";
//@import "panels.less";
//@import "wells.less";
//@import "../../../../../vendor/bootstrap/less/close.less";
// Components w/ JavaScript
//@import "../../../../../vendor/bootstrap/less/modals.less";
@import "../../../../../vendor/bootstrap/less/tooltip.less";
//@import "../../../../../vendor/bootstrap/less/popovers.less";
@import "../../../../../vendor/bootstrap/less/dropdowns.less";
@import "../../../../../vendor/bootstrap/less/button-groups.less";
@import "../../../../../vendor/bootstrap/less/input-groups.less";
//@import "carousel.less";
// Utility classes
@import "../../../../../vendor/bootstrap/less/utilities.less";
@import "../../../../../vendor/bootstrap/less/responsive-utilities.less";
@import "../../../../common/main/resources/less/buttons.less";
@import "../../../../common/main/resources/less/dropdown-menu.less";
@import "../../../../common/main/resources/less/dropdown-submenu.less";
@import "../../../../common/main/resources/less/separator.less";
@import "../../../../common/main/resources/less/input.less";
@import "../../../../common/main/resources/less/combobox.less";
@import "../../../../common/main/resources/less/window.less";
@import "../../../../common/main/resources/less/loadmask.less";
@import "../../../../common/main/resources/less/dataview.less";
@import "../../../../common/main/resources/less/tooltip.less";
@import "../../../../common/main/resources/less/scroller.less";
@import "../../../../common/main/resources/less/synchronize-tip.less";
@import "../../../../common/main/resources/less/common.less";
@import "../../../../common/main/resources/less/winxp_fix.less";
@import "../../../../common/main/resources/less/calendar.less";
@import "../../../../common/main/resources/less/spinner.less";
@import "../../../../common/main/resources/less/checkbox.less";
@import "../../../../common/main/resources/less/opendialog.less";
@toolbarBorderColor: @border-toolbar-ie;
@toolbarBorderColor: @border-toolbar;
@toolbarTopColor: @background-toolbar-ie;
@toolbarTopColor: @background-toolbar;
@toolbarFontSize: 12px;
@iconSpriteCommonPath: "../../../../common/forms/resources/img/glyphicons.png";
@icon-socnet-size: 40px;
@loadmask-zindex: 10000;
.embed-body {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
font-size: @toolbarFontSize;
overflow: hidden;
color: @text-normal-ie;
color: @text-normal;
}
// Document Viewer
// -------------------------
.viewer {
position: absolute;
margin: 0;
padding: 0;
left: 0;
right: 0;
&.top {
top: 40px;
bottom: 0;
}
&.bottom {
top: 0;
bottom: 46px;
}
}
// Toolbar
// -------------------------
.toolbar {
position: fixed;
font-size: @toolbarFontSize;
min-width: 340px;
z-index: 100;
background-color: @toolbarTopColor;
display: flex;
align-items: center;
white-space: nowrap;
&.top {
top: 0;
left: 0;
width: 100%;
height: 40px;
.box-inner-shadow(0 -1px 0 @toolbarBorderColor);
}
.group {
margin: 0;
padding: 0;
.item {
input {
font-size: inherit;
padding: 0;
text-align: right;
}
.text {
cursor: default;
}
}
&.left {
left: 0;
padding-left: 10px;
.item {
float: left;
}
& > div {
display: inline-block;
vertical-align: middle;
}
}
&.right {
right: 0;
padding-right: 10px;
.item {
display: inline-block;
}
}
&.center {
display: flex;
justify-content: center;
flex-grow: 1;
overflow: hidden;
padding: 0 20px;
#title-doc-name {
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.margin-right-small {
margin-right: 8px;
}
.margin-right-large {
margin-right: 12px;
}
.margin-left-small {
margin-left: 8px;
}
.margin-left-large {
margin-left: 12px;
}
}
// Logo
// -------------------------
.brand-logo {
display: block;
width: 100px;
height: 20px;
background: data-uri('../../../../common/main/resources/img/header/dark-logo_s.svg') no-repeat;
}
.theme-dark {
.brand-logo {
background: data-uri('../../../../common/main/resources/img/header/header-logo_s.svg') no-repeat;
}
}
.btn-text-default {
width: auto;
&.colored {
padding: 0 16px;
height: 28px;
background-color: @background-accent-button-ie;
background-color: @background-accent-button;
border: 1px solid transparent;
border-radius: 3px;
color: @text-contrast-background-ie !important;
color: @text-contrast-background !important;
font-weight: 700;
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @highlight-accent-button-hover-ie !important;
background-color: @highlight-accent-button-hover !important;
}
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @highlight-accent-button-pressed-ie !important;
background-color: @highlight-accent-button-pressed !important;
}
}
}
// Overlay control
// -------------------------
.overlay-controls {
position: absolute;
bottom: 55px;
z-index: 10;
left: 50%;
ul {
padding: 0;
list-style-type: none;
margin: 0 auto;
li {
display: inline-block;
&:first-child {
margin-right: 5px;
}
&:last-child {
margin-left: 5px;
}
}
}
.overlay {
width: 32px;
height: 32px;
display: inline-block;
cursor: pointer;
background-color: black;
border: 5px solid black;
border-radius: 50%;
outline: none;
opacity: 0.3;
background-origin: content-box;
padding: 1px 0 0 1px;
.box-shadow(0 0 0 2px rgba(255,255,255,0.3));
&:hover {
opacity: .6;
}
&.active, &:active {
opacity: .8;
}
}
}
// Error mask
// -------------------------
.errormask {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 30002;
.error-body {
position: relative;
top: 40%;
width: 400px;
margin: 0 auto;
padding: 20px;
background-color: #FFFFFF;
border: 1px solid #C0C0C0;
.title {
font-weight: bold;
font-size: 1.6em;
padding-bottom: 10px;
}
}
}
// Modals
// -------------------------
.share-buttons {
ul {
width: 244px;
//height: 25px;
list-style-type: none;
margin: 5px 0 0;
overflow: hidden;
li {
display: inline-block;
float: left;
margin: 1px 5px 0 0;
vertical-align: middle;
&.share-mail {
float: right;
padding-right: 1px;
margin: 0;
a {
min-width: 64px;
}
.glyphicon {
margin-right: 4px;
}
}
&.share-twitter {
max-width: 93px;
}
}
}
}
.size-manual {
margin-bottom: 10px;
.right {
float: right;
}
.caption {
margin-top: 2px;
margin-right: 8px;
}
input {
display: inline-block;
font-size: 1em;
padding: 0 4px;
//border-radius: 0;
margin: 0;
margin-top: -1px;
&.input-xs {
width: 50px;
}
}
}
.socnet-btn(@index) {
background-position: -@icon-socnet-size*@index 0;
&:hover {
background-position: -@icon-socnet-size*@index -@icon-socnet-size;
}
}
.svg {
background: data-uri('../../../../common/forms/resources/img/icon-social-sprite.svg');
width: 40px;
height: 40px;
background-size: @icon-socnet-size*4 @icon-socnet-size*2;
&.big-facebook:hover {
background-position: 0 -@icon-socnet-size;
}
&.big-twitter { .socnet-btn(1); }
&.big-gplus { .socnet-btn(2); }
&.big-email { .socnet-btn(3); }
}
@icon-width: 20px;
@icon-height: 20px;
.theme-dark {
@neg-value: -@icon-height;
--icon-normal-top: @neg-value;
}
@icon-normal-top: var(--icon-normal-top, 0);
.svg-icon {
background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat;
background-size: @icon-width*24 @icon-height*2;
&.download {
background-position: -@icon-width 0;
background-position: -@icon-width @icon-normal-top;
}
&.share {
background-position: -@icon-width*2 0;
background-position: -@icon-width*2 @icon-normal-top;
}
&.embed {
background-position: -@icon-width*3 0;
background-position: -@icon-width*3 @icon-normal-top;
}
&.fullscr {
background-position: -@icon-width*4 0;
background-position: -@icon-width*4 @icon-normal-top;
}
&.zoom-up {
background-position: -@icon-width*5 -@icon-height;
}
&.zoom-down {
background-position: -@icon-width*6 -@icon-height;
}
&.slide-prev {
background-position: -@icon-width*7 -@icon-height;
}
&.slide-next {
background-position: -@icon-width*8 -@icon-height;
}
&.play {
background-position: -@icon-width*9 -@icon-height;
}
&.pause {
background-position: -@icon-width*10 -@icon-height;
}
&.print {
background-position: -@icon-width*11 0;
background-position: -@icon-width*11 @icon-normal-top;
}
&.arrow-up {
background-position: -@icon-width*17 0;
background-position: -@icon-width*17 @icon-normal-top;
}
&.arrow-down {
background-position: -@icon-width*16 0;
background-position: -@icon-width*16 @icon-normal-top;
}
&.clear-style {
background-position: -@icon-width*12 0;
background-position: -@icon-width*12 @icon-normal-top;
}
&.go-to-location {
background-position: -@icon-width*15 0;
background-position: -@icon-width*15 @icon-normal-top;
}
&.more-vertical {
background-position: -@icon-width*14 0;
background-position: -@icon-width*14 @icon-normal-top;
}
&.cut {
background-position: -@icon-width*19 0;
background-position: -@icon-width*19 @icon-normal-top;
}
&.copy {
background-position: -@icon-width*20 0;
background-position: -@icon-width*20 @icon-normal-top;
}
&.paste {
background-position: -@icon-width*21 0;
background-position: -@icon-width*21 @icon-normal-top;
}
&.undo {
background-position: -@icon-width*22 0;
background-position: -@icon-width*22 @icon-normal-top;
}
&.redo {
background-position: -@icon-width*23 0;
background-position: -@icon-width*23 @icon-normal-top;
}
}
.btn {
&.active, &:active {
&:not(:disabled):not(.disabled) {
.icon {
@btn-active-icon-offset: -20px;
background-position-y: @btn-active-icon-offset;
background-position-y: var(--button-small-active-icon-offset-x, 0);
}
}
}
}
.mi-icon {
width: @icon-width;
height: @icon-height;
float: left;
margin: -3px 4px 0 -24px;
}
.modal-dlg {
textarea {
.user-select(text);
width: 100%;
resize: none;
margin-bottom: 5px;
border: @scaled-one-px-value-ie solid @border-regular-control-ie;
border: @scaled-one-px-value solid @border-regular-control;
height: 100%;
&.disabled {
opacity: @component-disabled-opacity;
cursor: default !important;
}
}
label {
.font-size-normal();
font-weight: normal;
&.input-label{
margin-bottom: 0;
vertical-align: middle;
}
&.header {
font-weight: bold;
}
}
.form-control[readonly] {
cursor: auto;
}
.share-buttons {
height: 40px;
text-align: center;
span {
display: inline-block;
margin: 0 7px;
cursor: pointer;
}
}
}
.masked {
background-color: transparent;
border-color: transparent;
.box-shadow(none);
}
#pages {
cursor: pointer;
display: inline-block;
line-height: 22px;
padding: 0 0 0 3px;
vertical-align: middle;
}
#page-number {
.masked {
cursor: pointer;
line-height: 22px;
}
}
.submit-tooltip {
position: absolute;
z-index: 1000;
top: 58px;
right: 15px;
padding: 7px 15px;
border-radius: 5px;
background-color: @background-notification-popover-ie;
background-color: @background-notification-popover;
.box-shadow(0 4px 15px -2px rgba(0, 0, 0, 0.5));
font-size: 11px;
}
.font-size-small {
.fontsize(@font-size-small);
}
.font-size-normal {
.fontsize(@font-size-base);
}
.font-size-large {
.fontsize(@font-size-large);
}

View file

@ -98,8 +98,9 @@ Common.Locale = new(function() {
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
var _requireLang = function () {
var lang = (_getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
var _requireLang = function (l) {
typeof l != 'string' && (l = null);
var lang = (l || _getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
currentLang = lang;
fetch('locale/' + lang + '.json')
.then(function(response) {
@ -127,6 +128,12 @@ Common.Locale = new(function() {
l10n = json || {};
apply && _applyLocalization();
}).catch(function(e) {
if ( !/loaded/.test(e) && currentLang != defLang && defLang && defLang.length < 3 ) {
return setTimeout(function(){
_requireLang(defLang)
}, 0);
}
l10n = l10n || {};
apply && _applyLocalization();
if ( e.message == 'loaded' ) {

View file

@ -194,7 +194,7 @@ define([
'<% } %>';
var templateHugeCaption =
'<button type="button" class="btn <%= cls %>" id="<%= id %>" > ' +
'<button type="button" class="btn <%= cls %>" id="<%= id %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>> ' +
'<div class="inner-box-icon">' +
templateBtnIcon +
'</div>' +
@ -205,7 +205,7 @@ define([
var templateHugeMenuCaption =
'<div class="btn-group icon-top" id="<%= id %>" style="<%= style %>">' +
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">' +
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>' +
'<div class="inner-box-icon">' +
templateBtnIcon +
'</div>' +
@ -223,7 +223,7 @@ define([
templateBtnIcon +
'</span>' +
'</button>' +
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>' +
'<span class="btn-fixflex-vcenter">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret"></i>' +
@ -245,7 +245,10 @@ define([
disabled : false,
pressed : false,
split : false,
visible : true
visible : true,
dataHint : '',
dataHintDirection: '',
dataHintOffset: '0, 0'
},
template: _.template([
@ -261,13 +264,13 @@ define([
'}} %>',
'<% } %>',
'<% if ( !menu ) { %>',
'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
'<% applyicon() %>',
'<span class="caption"><%= caption %></span>',
'</button>',
'<% } else if (split == false) {%>',
'<div class="btn-group" id="<%= id %>" style="<%= style %>">',
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">',
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
'<% applyicon() %>',
'<span class="caption"><%= caption %></span>',
'<span class="inner-box-caret">' +
@ -281,7 +284,7 @@ define([
'<% applyicon() %>',
'<span class="caption"><%= caption %></span>',
'</button>',
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">',
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
'<i class="caret"></i>',
'<span class="sr-only"></span>',
'</button>',
@ -350,7 +353,11 @@ define([
disabled : me.disabled,
pressed : me.pressed,
caption : me.caption,
style : me.style
style : me.style,
dataHint : me.options.dataHint,
dataHintDirection: me.options.dataHintDirection,
dataHintOffset: me.options.dataHintOffset,
dataHintTitle: me.options.dataHintTitle
}));
if (me.menu && _.isObject(me.menu) && _.isFunction(me.menu.render))

View file

@ -95,7 +95,7 @@ define([
value : 'unchecked',
template : _.template('<label class="checkbox-indeterminate"><input id="<%= id %>" type="checkbox" class="checkbox__native">' +
'<label for="<%= id %>" class="checkbox__shape"></label><span></span></label>'),
'<label for="<%= id %>" class="checkbox__shape" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>"></label><span></span></label>'),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
@ -108,7 +108,10 @@ define([
var me = this;
if (!me.rendered) {
var elem = this.template({
id: Common.UI.getId('chb-')
id: Common.UI.getId('chb-'),
dataHint: me.options.dataHint,
dataHintDirection: me.options.dataHintDirection,
dataHintOffset: me.options.dataHintOffset
});
if (parentEl) {
this.setElement(parentEl, false);

View file

@ -39,7 +39,162 @@ define([
], function () {
'use strict';
Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
this.colorEl = this.cmpEl.find('.btn-color-value-line');
if (this.options.auto)
this.autocolor = (typeof this.options.auto == 'object') ? this.options.auto.color || '000000' : '000000';
if (this.options.color!==undefined)
this.setColor(this.options.color);
},
getPicker: function(color, colors) {
if (!this.colorPicker) {
this.colorPicker = new Common.UI.ThemeColorPalette({
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color,
colors: colors
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
if (this.options.auto) {
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
(color == 'auto') && this.setAutoColor(true);
}
this.initInnerMenu();
}
return this.colorPicker;
},
setPicker: function(picker) {
this.colorPicker = picker;
},
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var height = options.paletteHeight || 240,
id = Common.UI.getId(),
auto = [];
if (options.auto) {
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
auto.push({
id: id + '-color-auto',
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
});
auto.push({caption: '--'});
}
var menu = new Common.UI.Menu({
id: id,
cls: 'shifted-left',
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
{
id: id + '-color-new',
template: _.template('<a tabindex="-1" type="menuitem" style="">' + this.textNewColor + '</a>')
}
])
});
this.initInnerMenu();
var me = this;
menu.on('keydown:before', _.bind(this.onBeforeKeyDown, this));
menu.on('show:after', function(menu) {
me.colorPicker && _.delay(function() {
me.colorPicker.showLastSelected();
!(options.additionalItems || options.auto) && me.colorPicker.focus();
}, 10);
}).on('hide:after', function() {
if (me.options.takeFocusOnClose) {
setTimeout(function(){me.focus();}, 1);
}
});
return menu;
}
return this.menu;
},
initInnerMenu: function() {
if (!this.colorPicker || typeof this.menu !== 'object') return;
var index = (this.options.additionalItems || []).length + (this.options.auto ? 2 : 0);
this.colorPicker.outerMenu = {menu: this.menu, index: index};
this.menu.setInnerMenu([{menu: this.colorPicker, index: index}]);
},
setMenu: function (m) {
m = m || this.getMenu();
Common.UI.Button.prototype.setMenu.call(this, m);
this.getPicker(this.options.color, this.options.colors);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.setAutoColor(false);
this.trigger('color:select', this, color);
},
setColor: function(color) {
if (color == 'auto' && this.options.auto)
color = this.autocolor;
this.color = color;
if (this.colorEl) {
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
this.colorEl.toggleClass('bordered', color=='transparent');
}
},
setAutoColor: function(selected) {
if (!this.colorAuto) return;
if (selected && !this.colorAuto.hasClass('selected'))
this.colorAuto.addClass('selected');
else if (!selected && this.colorAuto.hasClass('selected'))
this.colorAuto.removeClass('selected');
},
isAutoColor: function() {
return this.colorAuto && this.colorAuto.hasClass('selected');
},
onAutoColorSelect: function() {
this.setColor('auto');
this.setAutoColor(true);
this.colorPicker && this.colorPicker.clearSelection();
this.trigger('auto:select', this, this.autocolor);
},
addNewColor: function() {
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
},
onBeforeKeyDown: function(menu, e) {
if ((e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.SPACE) && !this.isMenuOpen()) {
$('button', this.cmpEl).click();
return false;
}
},
isMenuOpen: function() {
return this.cmpEl.hasClass('open');
},
textNewColor: 'Add New Custom Color',
textAutoColor: 'Automatic'
}, Common.UI.ButtonColored || {}));
Common.UI.ColorButton = Common.UI.ButtonColored.extend(_.extend({
options : {
id : null,
hint : false,
@ -58,7 +213,7 @@ define([
template: _.template([
'<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
'<span>&nbsp;</span>',
'<span class="inner-box-caret">',
'<i class="caret"></i>',
@ -90,12 +245,6 @@ define([
this.setColor(this.options.color);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.setAutoColor(false);
this.trigger('color:select', this, color);
},
setColor: function(color) {
if (color == 'auto' && this.options.auto)
color = this.autocolor;
@ -106,105 +255,9 @@ define([
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
},
getPicker: function(color, colors) {
if (!this.colorPicker) {
this.colorPicker = new Common.UI.ThemeColorPalette({
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color,
colors: colors
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
if (this.options.auto) {
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
(color == 'auto') && this.setAutoColor(true);
}
}
return this.colorPicker;
},
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var height = options.paletteHeight || 216,
id = Common.UI.getId(),
auto = [];
if (options.auto) {
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
auto.push({
id: id + '-color-auto',
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
});
auto.push({caption: '--'});
}
var menu = new Common.UI.Menu({
id: id,
cls: 'shifted-left',
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
])
});
return menu;
}
return this.menu;
},
setMenu: function (m) {
m = m || this.getMenu();
Common.UI.Button.prototype.setMenu.call(this, m);
this.getPicker(this.options.color, this.options.colors);
},
addNewColor: function() {
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
},
onAutoColorSelect: function() {
this.setColor('auto');
this.setAutoColor(true);
this.colorPicker && this.colorPicker.clearSelection();
this.trigger('auto:select', this, this.autocolor);
},
setAutoColor: function(selected) {
if (!this.colorAuto) return;
if (selected && !this.colorAuto.hasClass('selected'))
this.colorAuto.addClass('selected');
else if (!selected && this.colorAuto.hasClass('selected'))
this.colorAuto.removeClass('selected');
},
isAutoColor: function() {
return this.colorAuto && this.colorAuto.hasClass('selected');
},
textNewColor: 'Add New Custom Color',
textAutoColor: 'Automatic'
}, Common.UI.ColorButton || {}));
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
this.colorEl = this.cmpEl.find('.btn-color-value-line');
},
setColor: function(color) {
if (this.colorEl) {
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
this.colorEl.toggleClass('bordered', color=='transparent');
}
focus: function() {
$('button', this.cmpEl).focus();
}
}, Common.UI.ButtonColored || {}));
}, Common.UI.ColorButton || {}));
});

View file

@ -77,7 +77,7 @@ define([
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="<%= style %>">',
'<div class="form-control" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
'<i class="image"></i>',
'<span class="text"></span>',
'</div>',
@ -122,6 +122,7 @@ define([
render : function(parentEl) {
Common.UI.ComboBox.prototype.render.call(this, parentEl);
this._formControl = this.cmpEl.find('.form-control');
return this;
},
@ -172,13 +173,17 @@ define([
}
},
focus: function() {
this._formControl && this._formControl.focus();
},
txtNoBorders: 'No Borders'
}, Common.UI.ComboBorderSize || {}));
Common.UI.ComboBorderSizeEditable = Common.UI.ComboBox.extend(_.extend({
template: _.template([
'<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control text">',
'<input type="text" class="form-control text" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
@ -230,7 +235,7 @@ define([
Common.UI.ComboBorderType = Common.UI.ComboBorderSize.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="<%= style %>">',
'<div class="form-control" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
'<i class="image"></i>',
'</div>',
'<div style="display: table-cell;"></div>',

View file

@ -87,12 +87,15 @@ define([
valueField : 'value',
search : false,
scrollAlwaysVisible: false,
takeFocusOnClose: false
takeFocusOnClose: false,
dataHint: '',
dataHintDirection: '',
dataHintOffset: ''
},
template: _.template([
'<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false">',
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
@ -147,7 +150,10 @@ define([
menuCls : this.menuCls,
menuStyle : this.menuStyle,
items : items,
scope : me
scope : me,
dataHint : this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset: this.options.dataHintOffset
}));
if (this.itemsTemplate)
this.cmpEl.find('ul').html(

View file

@ -91,7 +91,7 @@ define([
return {
template: _.template([
'<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false"> ',
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>"> ',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
@ -182,6 +182,7 @@ define([
},
onInputKeyUp: function(e) {
if (!this._isKeyDown) return;
if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode !== Common.UI.Keys.SHIFT &&
e.keyCode !== Common.UI.Keys.CTRL && e.keyCode !== Common.UI.Keys.ALT &&
e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT &&
@ -213,9 +214,11 @@ define([
}, 10);
}
}
this._isKeyDown = false;
},
onInputKeyDown: function(e) {
this._isKeyDown = true;
this._inInputKeyDown = (new Date());
var me = this;
@ -226,8 +229,10 @@ define([
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 && e.keyCode != Common.UI.Keys.TAB){
if (!this.isMenuOpen() && !e.ctrlKey)
if (!this.isMenuOpen() && !e.ctrlKey) {
this.openMenu();
(this.recent > 0) && this.flushVisibleFontsTiles();
}
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
_.delay(function() {

View file

@ -60,7 +60,10 @@ define([
beforeOpenHandler : null,
additionalMenuItems : null,
showLast: true,
minWidth: -1
minWidth: -1,
dataHint: '',
dataHintDirection: '',
dataHintOffset: ''
},
template: _.template([
@ -88,6 +91,7 @@ define([
this.rendered = false;
this.needFillComboView = false;
this.minWidth = this.options.minWidth;
this.delayRenderTips = this.options.delayRenderTips || false;
this.fieldPicker = new Common.UI.DataView({
cls: 'field-picker',
@ -99,7 +103,8 @@ define([
'<span class="title"><%= title %></span>',
'<% } %>',
'</div>'
].join(''))
].join('')),
delayRenderTips: this.delayRenderTips
});
this.openButton = new Common.UI.Button({
@ -109,17 +114,17 @@ define([
offset: [0, 3],
items: [
{template: _.template('<div class="menu-picker-container"></div>')}
]
})
].concat(this.options.additionalMenuItems != null ? this.options.additionalMenuItems : [])
}),
dataHint: this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset: this.options.dataHintOffset
});
if (this.options.additionalMenuItems != null) {
this.openButton.menu.items = this.openButton.menu.items.concat(this.options.additionalMenuItems)
}
this.menuPicker = new Common.UI.DataView({
cls: 'menu-picker',
parentMenu: this.openButton.menu,
outerMenu: this.options.additionalMenuItems ? {menu: this.openButton.menu, index: 0} : undefined,
restoreHeight: this.menuMaxHeight,
style: 'max-height: '+this.menuMaxHeight+'px;',
enableKeyEvents: this.options.enableKeyEvents,
@ -131,9 +136,14 @@ define([
'<span class="title"><%= title %></span>',
'<% } %>',
'</div>'
].join(''))
].join('')),
delayRenderTips: this.delayRenderTips
});
if (this.options.additionalMenuItems != null) {
this.openButton.menu.setInnerMenu([{menu: this.menuPicker, index: 0}]);
}
// Handle resize
setInterval(_.bind(this.checkSize, this), 500);
@ -208,6 +218,9 @@ define([
me.trigger('render:after', me);
}
if (this.disabled) {
this.setDisabled(!!this.disabled);
}
return this;
},

View file

@ -125,6 +125,9 @@ define([
var me = this;
me.template = me.options.template || me.template;
me.dataHint = me.options.dataHint || '';
me.dataHintDirection = me.options.dataHintDirection || '';
me.dataHintOffset = me.options.dataHintOffset || '';
me.listenTo(me.model, 'change', this.model.get('skipRenderOnChange') ? me.onChange : me.render);
me.listenTo(me.model, 'change:selected', me.onSelectChange);
@ -140,6 +143,15 @@ define([
el.html(this.template(this.model.toJSON()));
el.addClass('item');
el.toggleClass('selected', this.model.get('selected') && this.model.get('allowSelected'));
if (this.dataHint !== '') {
el.attr('data-hint', this.dataHint);
el.attr('data-hint-direction', this.dataHintDirection);
el.attr('data-hint-offset', this.dataHintOffset);
}
if (!_.isUndefined(this.model.get('contentTarget')))
el.attr('content-target', this.model.get('contentTarget'));
el.off('click dblclick contextmenu');
el.on({ 'click': _.bind(this.onClick, this),
'dblclick': _.bind(this.onDblClick, this),
@ -244,9 +256,13 @@ define([
me.store = me.options.store || new Common.UI.DataViewStore();
me.groups = me.options.groups || null;
me.itemTemplate = me.options.itemTemplate || null;
me.itemDataHint = me.options.itemDataHint || '';
me.itemDataHintDirection = me.options.itemDataHintDirection || '';
me.itemDataHintOffset = me.options.itemDataHintOffset || '';
me.multiSelect = me.options.multiSelect;
me.handleSelect = me.options.handleSelect;
me.parentMenu = me.options.parentMenu;
me.outerMenu = me.options.outerMenu;
me.enableKeyEvents= me.options.enableKeyEvents;
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
me.showLast = me.options.showLast;
@ -257,6 +273,7 @@ define([
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0;
me.delayRenderTips = me.options.delayRenderTips || false;
if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false;
@ -282,7 +299,8 @@ define([
this.cmpEl = $(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style,
cls: me.cls
cls: me.cls,
options: me.options
}));
parentEl.html(this.cmpEl);
@ -291,7 +309,8 @@ define([
this.cmpEl.html(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style,
cls: me.cls
cls: me.cls,
options: me.options
}));
}
@ -413,7 +432,10 @@ define([
onAddItem: function(record, store, opts) {
var view = new Common.UI.DataViewItem({
template: this.itemTemplate,
model: record
model: record,
dataHint: this.itemDataHint,
dataHintDirection: this.itemDataHintDirection,
dataHintOffset: this.itemDataHintOffset
});
if (view) {
@ -436,14 +458,28 @@ define([
var idx = _.indexOf(this.store.models, record);
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
if (record.get('tip')) {
var view_el = $(view.el);
view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({
title : record.get('tip'),
placement : 'cursor',
zIndex : this.tipZIndex
});
var me = this,
view_el = $(view.el),
tip = record.get('tip');
if (tip) {
if (this.delayRenderTips)
view_el.one('mouseenter', function(){ // hide tooltip when mouse is over menu
view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({
title : tip,
placement : 'cursor',
zIndex : me.tipZIndex
});
view_el.mouseenter();
});
else {
view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({
title : tip,
placement : 'cursor',
zIndex : me.tipZIndex
});
}
}
this.listenTo(view, 'change', this.onChangeItem);
@ -472,7 +508,8 @@ define([
$(this.el).html(this.template({
groups: this.groups ? this.groups.toJSON() : null,
style: this.style,
cls: this.cls
cls: this.cls,
options: this.options
}));
if (!_.isUndefined(this.scroller)) {
@ -665,17 +702,27 @@ define([
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else if (data.keyCode==Common.UI.Keys.UP) {
while (idx===undefined) {
topIdx--;
if (topIdx<0) topIdx = this._layoutParams.rows-1;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
this.deselectAll(true);
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
return;
} else
while (idx===undefined) {
topIdx--;
if (topIdx<0) topIdx = this._layoutParams.rows-1;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else {
while (idx===undefined) {
topIdx++;
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
this.deselectAll(true);
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
return;
} else
while (idx===undefined) {
topIdx++;
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
}
} else {
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
@ -761,14 +808,14 @@ define([
};
var el = $(this.dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0;
for (var i=0; i<this.dataViewItems.length; i++) {
var top = $(this.dataViewItems[i].el).offset().top - offsetTop;
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW + 0.01);
if (top>prevtop) {
prevtop = top;
this._layoutParams.itemsIndexes.push([]);
@ -787,8 +834,22 @@ define([
this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
focus: function(index) {
$(this.el).find('.inner').addBack().filter('.inner').focus();
if (typeof index == 'string') {
if (index == 'first') {
this.selectByIndex(0, true);
} else if (index == 'last') {
if (this._layoutParams === undefined)
this.fillIndexesArray();
this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true);
}
} else if (index !== undefined)
this.selectByIndex(index, true);
},
focusInner: function(e) {
this.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
}
});
@ -806,7 +867,7 @@ define([
'<div class="dataview inner" style="<%= style %>">',
'<% _.each(items, function(item) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>',
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> data-hint="<%= item.dataHint %>" data-hint-direction="<%= item.dataHintDirection %>" data-hint-offset="<%= item.dataHintOffset %>"><%= itemTemplate(item) %></div>',
'<% }) %>',
'</div>'
].join('')),
@ -968,7 +1029,7 @@ define([
var template = _.template([
'<% _.each(items, function(item) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>',
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> data-hint="<%= item.dataHint %>" data-hint-direction="<%= item.dataHintDirection %>" data-hint-offset="<%= item.dataHintOffset %>"><%= itemTemplate(item) %></div>',
'<% }) %>'
].join(''));
this.cmpEl && this.cmpEl.find('.inner').html(template({
@ -1113,17 +1174,27 @@ define([
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else if (data.keyCode==Common.UI.Keys.UP) {
while (idx===undefined) {
topIdx--;
if (topIdx<0) topIdx = this._layoutParams.rows-1;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
this.deselectAll(true);
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
return;
} else
while (idx===undefined) {
topIdx--;
if (topIdx<0) topIdx = this._layoutParams.rows-1;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else {
while (idx===undefined) {
topIdx++;
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
this.deselectAll(true);
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
return;
} else
while (idx===undefined) {
topIdx++;
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
}
} else {
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
@ -1195,7 +1266,7 @@ define([
};
var el = this.dataViewItems[0].el,
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0;

View file

@ -55,7 +55,7 @@ define([
'<% } %>'+
'<div>'+
'<div class="cnt-hb img-colorpicker">'+
'<div class="cnt-hb-arrow img-colorpicker"></div>'+
'<div class="cnt-hb-arrow"></div>'+
'</div>'+
'<% if (this.changeSaturation) { %>'+
'<div class="cnt-root">'+
@ -106,6 +106,7 @@ define([
refreshUI();
me.trigger('changecolor', me, me.color);
};
var refreshUI = function(){
@ -125,8 +126,7 @@ define([
previewColorText[0].innerHTML = (me.color == 'transparent') ? me.textNoColor : me.color.toUpperCase();
if (arrowSatBrightness.length>0 && arrowHue.length>0) {
arrowSatBrightness.css('left', saturationVal + '%');
arrowSatBrightness.css('top', 100 - brightnessVal + '%');
arrowSatBrightness.css({'left': saturationVal + '%', 'top': 100 - brightnessVal + '%', 'background-color' : me.color});
arrowHue.css('top', parseInt(hueVal * 100 / 360.0) + '%');
}
};

View file

@ -0,0 +1,638 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2021
*
* 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
*
*/
/**
* HintManager.js
*
* Created by Julia Radzhabova on 21.04.2021
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
*
*/
/**
* Example usage with simple items:
*
* <button ... data-hint="1" data-hint-direction="right" data-hint-offset="big" data-hint-title="B">...</button>
* <label ... data-hint="1" data-hint-direction="bottom" data-hint-offset="medium" data-hint-title="L">...</label>
*
* Example usage with components:
*
* new Common.UI.Button({
* ...
* dataHint: '1', // '0' - tabs in toolbar, left and right menu, statusbar;
* // '1' - file menu, contents of toolbar tabs, contents of right and left panels
* dataHintDirection: 'bottom', // top, bottom, right, left, left-top
* dataHintOffset: 'small', // big - 6px, medium - 4px, small - 2px
* dataHintTitle : 'S'
* });
*
* new Common.UI.CheckBox({
* ...
* dataHint: '1',
* dataHintDirection: 'left',
* dataHintOffset: 'small'
* });
*
* new Common.UI.ComboBox({
* ...
* dataHint: '1',
* dataHintDirection: 'bottom',
* dataHintOffset: 'big'
* });
*
* new Common.UI.InputField({
* ...
* dataHint: '1',
* dataHintDirection: 'left',
* dataHintOffset: 'small'
* });
*
* new Common.UI.MetricSpinner({
* ...
* dataHint: '1',
* dataHintDirection: 'bottom',
* dataHintOffset: 'big'
* });
*
* new Common.UI.RadioBox({
* ...
* dataHint: '1',
* dataHintDirection: 'left',
* dataHintOffset: 'small'
* });
*/
if (Common === undefined)
var Common = {};
if (Common.UI === undefined) {
Common.UI = {};
}
Common.UI.HintManager = new(function() {
var _lang = 'en',
_arrAlphabet = [],
_arrEnAlphabet = [],
_arrQwerty = [],
_arrEnQwerty = [],
_needShow = false,
_hintVisible = false,
_currentLevel = 0,
_currentSection = document,
_currentControls = [],
_currentHints = [],
_inputLetters = '',
_isComplete = false,
_isLockedKeyEvents = false,
_inputTimer,
_isDocReady = false,
_isEditDiagram = false;
var _api;
var _setCurrentSection = function (btn, section) {
if (section) {
_currentSection = section;
return;
}
if (btn === 'esc') {
if (_currentLevel === 0) {
_currentSection = document;
}
return;
}
if (_isEditDiagram) {
_currentSection = [$(window.parent.document).find('.advanced-settings-dlg')[0], window.document];
} else if ($('#file-menu-panel').is(':visible')) {
_currentSection = $('#file-menu-panel');
} else {
_currentSection = (btn && btn.closest('.hint-section')) || document;
}
};
var _lockedKeyEvents = function (isLocked) {
if (_api) {
_isLockedKeyEvents = isLocked;
_api.asc_enableKeyEvents(!isLocked);
}
};
var _showHints = function () {
_inputLetters = '';
if (_currentLevel === 0) {
Common.NotificationCenter.trigger('toolbar:collapse');
}
if (_currentHints.length === 0 || ($('#file-menu-panel').is(':visible' || _isEditDiagram) && _currentLevel === 1)) {
_getHints();
}
if (_currentHints.length > 0) {
!_isLockedKeyEvents && _lockedKeyEvents(true);
_hintVisible = true;
_currentHints.forEach(function(item) {
item.show();
});
_inputTimer = setInterval(function () {
if (_inputLetters.length > 0) {
_inputLetters = '';
}
}, 5000);
} else {
_hintVisible = false;
}
};
var _hideHints = function() {
_hintVisible = false;
_currentHints && _currentHints.forEach(function(item) {
item.remove()
});
clearInterval(_inputTimer);
};
var _nextLevel = function(level) {
_removeHints();
_currentHints.length = 0;
_currentControls.length = 0;
if (level !== undefined) {
_currentLevel = level;
} else {
_currentLevel++;
}
};
var _prevLevel = function() {
_removeHints();
_currentHints.length = 0;
_currentControls.length = 0;
_currentLevel--;
};
var _getLetters = function(countButtons) {
var arr = _arrAlphabet.slice();
arr[0] = _arrAlphabet[0] + _arrAlphabet[0];
for (var i = 1; arr.length < countButtons; i++) {
arr.push(_arrAlphabet[0] + _arrAlphabet[i]);
}
return arr;
};
var _isItemDisabled = function (item) {
return (item.hasClass('disabled') || item.parent().hasClass('disabled') || item.attr('disabled'));
};
var _getControls = function() {
_currentControls = [];
var arr = [],
arrItemsWithTitle = [];
if (_.isArray(_currentSection)) {
_currentSection.forEach(function (section) {
arr = arr.concat($(section).find('[data-hint=' + (_currentLevel) + ']').toArray());
arrItemsWithTitle = arrItemsWithTitle.concat($(section).find('[data-hint-title][data-hint=' + (_currentLevel) + ']').toArray());
});
} else {
arr = $(_currentSection).find('[data-hint=' + (_currentLevel) + ']').toArray();
arrItemsWithTitle = $(_currentSection).find('[data-hint-title][data-hint=' + (_currentLevel) + ']').toArray();
}
var visibleItems = arr.filter(function (item) {
return $(item).is(':visible');
});
var visibleItemsWithTitle = arrItemsWithTitle.filter(function (item) {
return $(item).is(':visible');
});
if (visibleItems.length === visibleItemsWithTitle.length) { // all buttons have data-hint-title
visibleItems.forEach(function (item) {
var el = $(item);
if (_lang !== 'en') {
var title = el.attr('data-hint-title').toLowerCase(),
firstLetter = title.substr(0, 1);
if (_arrAlphabet.indexOf(firstLetter) === -1) { // tip is in English
var newTip = '';
for (var i = 0; i < title.length; i++) {
var letter = title.substr(i, 1),
ind = _arrEnAlphabet.indexOf(letter);
newTip = newTip + _arrAlphabet[ind].toUpperCase();
}
el.attr('data-hint-title', newTip);
}
}
_currentControls.push(el);
});
return;
}
var _arrLetters = [];
if (visibleItems.length > _arrAlphabet.length) {
_arrLetters = _getLetters(visibleItems.length);
} else {
_arrLetters = _arrAlphabet.slice();
}
var usedLetters = [];
if (arrItemsWithTitle.length > 0) {
visibleItems.forEach(function (item) {
var el = $(item);
var title = el.attr('data-hint-title');
if (title) {
var ind = _arrEnAlphabet.indexOf(title.toLowerCase());
if (ind === -1) { // we have already changed
usedLetters.push(_arrAlphabet.indexOf(title.toLowerCase()));
} else {
usedLetters.push(ind);
if (_lang !== 'en') {
el.attr('data-hint-title', _arrLetters[ind].toUpperCase());
}
}
}
});
}
var index = 0;
visibleItems.forEach(function (item) {
var el = $(item);
while (usedLetters.indexOf(index) !== -1) {
index++;
}
var title = el.attr('data-hint-title');
if (!title) {
el.attr('data-hint-title', _arrLetters[index].toUpperCase());
index++;
}
_currentControls.push(el);
});
};
var _getHints = function() {
var docH = _isEditDiagram ? (window.parent.innerHeight * Common.Utils.zoom()) : (Common.Utils.innerHeight() - 20),
docW = _isEditDiagram ? (window.parent.innerWidth * Common.Utils.zoom()) : (Common.Utils.innerWidth()),
section = _isEditDiagram ? _currentSection[0] : _currentSection,
topSection = _currentLevel !== 0 && $(section).length > 0 && !_isEditDiagram ? $(section).offset().top : 0,
bottomSection = _currentLevel !== 0 && $(section).length > 0 && !_isEditDiagram ? topSection + $(section).height() : docH;
if ($(section).prop('id') === 'toolbar' && $(section).outerHeight() < $(section).find('.box-controls').outerHeight()) {
bottomSection += $(section).find('.box-controls').outerHeight();
}
if (_currentControls.length === 0)
_getControls();
_currentControls.forEach(function(item, index) {
if (!_isItemDisabled(item)) {
var leftBorder = 0,
rightBorder = docW;
if (!_isEditDiagram && $(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0 || item.closest('.group').find('.toolbar-group-mask').length > 0)
|| ($('#about-menu-panel').is(':visible') && item.closest('.hint-section').prop('id') === 'right-menu')) { // don't show right menu hints when about is visible
return;
}
if (window.SSE && item.parent().prop('id') === 'statusbar_bottom') {
var $statusbar = item.parent();
if (item.offset().left > $statusbar.offset().left + $statusbar.width()) {
return;
}
}
if (_currentLevel === 0 && item.closest('.tabs.short').length > 0) {
var blockTabs = item.closest('.tabs.short');
leftBorder = blockTabs.offset().left;
rightBorder = leftBorder + blockTabs.width();
if (!item.hasClass('scroll')) {
leftBorder += 20;
rightBorder -= 20;
}
}
var hint = $('<div style="" class="hint-div">' + item.attr('data-hint-title') + '</div>');
var direction = item.attr('data-hint-direction');
// exceptions
if (window.SSE && !_isEditDiagram && _currentSection.nodeType !== 9 &&
_currentSection.prop('id') === 'toolbar' && item.closest('.panel').attr('data-tab') === 'data') {
if (item.parent().hasClass('slot-sortdesc') || item.parent().hasClass('slot-btn-setfilter')) {
direction = 'top';
item.attr('data-hint-direction', 'top');
} else if (item.parent().hasClass('slot-btn-clear-filter') || item.parent().hasClass('slot-sortasc')) {
direction = 'bottom';
item.attr('data-hint-direction', 'bottom');
}
}
var maxHeight = docH;
if ($('#file-menu-panel').is(':visible') && _currentLevel > 1 &&
($('.fms-flex-apply').is(':visible') || $('#fms-flex-apply').is(':visible')) &&
item.closest('.fms-flex-apply').length < 1 && item.closest('#fms-flex-apply').length < 1) {
maxHeight = docH - $('.fms-flex-apply').height();
}
var offsets = item.attr('data-hint-offset');
var applyOffset = offsets === 'big' ? 6 : (offsets === 'medium' ? 4 : (offsets === 'small' ? 2 : 0));
if (applyOffset) {
switch (direction) {
case 'bottom':
offsets = [-applyOffset, 0];
break;
case 'top':
offsets = [applyOffset, 0];
break;
case 'right':
offsets = [0, -applyOffset];
break;
case 'left':
offsets = [0, applyOffset];
break;
}
} else {
offsets = offsets ? item.attr('data-hint-offset').split(',').map(function (item) { return parseInt(item); }) : [0, 0];
}
var offset = item.offset();
var top, left;
if (direction === 'left-top') {
top = offset.top - 10 + offsets[0];
left = offset.left - 10 + offsets[1];
} else if (direction === 'top') {
top = offset.top - 18 + offsets[0];
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
} else if (direction === 'right') {
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
left = offset.left + item.outerWidth() + offsets[1];
} else if (direction === 'left') {
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
left = offset.left - 18 + offsets[1];
} else {
top = offset.top + item.outerHeight() + offsets[0];
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
}
if (top < maxHeight && left < docW && top > topSection && top < bottomSection && left > leftBorder && left + 18 < rightBorder) {
hint.css({
top: top,
left: left
});
if (_isEditDiagram && index < 2) {
hint.css('z-index', '1060');
$(window.parent.document.body).append(hint);
} else {
$(document.body).append(hint);
}
}
_currentHints.push(hint);
}
});
};
var _removeHints = function() {
_currentHints && _currentHints.forEach(function(item) {
item.remove()
});
};
var _resetToDefault = function() {
_currentLevel = ($('#file-menu-panel').is(':visible') || _isEditDiagram) ? 1 : 0;
_setCurrentSection();
_currentHints.length = 0;
_currentControls.length = 0;
};
var _init = function(api) {
_api = api;
Common.NotificationCenter.on({
'app:ready': function (mode) {
var lang = mode.lang ? mode.lang.toLowerCase() : 'en';
_getAlphabetLetters(lang);
_isDocReady = true;
},
'hints:clear': _clearHints,
'window:resize': _clearHints
});
$('#editor_sdk').on('click', function () {
_clearHints();
});
$(document).on('mousedown', function () {
_clearHints();
});
$(document).on('keyup', function(e) {
if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) {
e.preventDefault();
if (!_hintVisible) {
$('input:focus').blur(); // to change value in inputField
_currentLevel = ($('#file-menu-panel').is(':visible') || _isEditDiagram) ? 1 : 0;
_setCurrentSection();
_showHints();
} else {
_hideHints();
_resetToDefault();
if (_isLockedKeyEvents) {
_isLockedKeyEvents = false;
_api.asc_enableKeyEvents(true);
}
}
} else if (_hintVisible) {
e.preventDefault();
}
_needShow = false;
});
$(document).on('keydown', function(e) {
if (_hintVisible) {
e.preventDefault();
if (e.keyCode == Common.UI.Keys.ESC ) {
setTimeout(function () {
if (_currentLevel === 0) {
_hideHints();
_resetToDefault();
_lockedKeyEvents(false);
} else {
_prevLevel();
_setCurrentSection('esc');
_showHints();
}
}, 10);
} else {
var curLetter = null,
match = false;
var keyCode = e.keyCode;
if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) {
curLetter = _lang === 'en' ? ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : e.key;
}
if (curLetter) {
var curr;
if (_lang !== 'en' && _arrAlphabet.indexOf(curLetter.toLowerCase()) === -1) {
var ind = _arrEnQwerty.indexOf(curLetter.toLowerCase());
if (ind !== -1) {
curLetter = _arrQwerty[ind];
}
}
_inputLetters = _inputLetters + curLetter.toUpperCase();
for (var i = 0; i < _currentControls.length; i++) {
var item = _currentControls[i];
if (!_isItemDisabled(item)) {
var title = item.attr('data-hint-title'),
regExp = new RegExp('^' + _inputLetters + '');
if (regExp.test(title)) {
match = true;
}
if (title === _inputLetters) {
curr = item;
break;
}
}
}
if (curr) {
var tag = curr.prop("tagName").toLowerCase();
if (window.SSE && curr.parent().prop('id') === 'statusbar_bottom') {
_hideHints();
curr.contextmenu();
_resetToDefault();
} else if (tag === 'input' || tag === 'textarea') {
_hideHints();
curr.trigger(jQuery.Event('click', {which: 1}));
curr.focus();
_resetToDefault();
} else if (curr.hasClass('listview')) {
_hideHints();
curr.focus();
_resetToDefault();
} else {
_isComplete = false;
_hideHints();
if (!_isEditDiagram && $(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0 || curr.closest('.group').find('.toolbar-group-mask').length > 0)) {
_resetToDefault();
return;
}
var needOpenPanel = (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible') ||
(curr.parent().prop('id') === 'slot-btn-chat' && !$('#left-panel-chat').is(':visible')) ||
(curr.parent().hasClass('ribtab') && !$('#toolbar').children('.toolbar').hasClass('expanded')));
if ((!curr.attr('content-target') && curr.parent().prop('id') !== 'slot-btn-chat') || needOpenPanel) { // need to open panel
if (!($('#file-menu-panel').is(':visible') && (curr.parent().prop('id') === 'fm-btn-info' && $('#panel-info').is(':visible') ||
curr.parent().prop('id') === 'fm-btn-settings' && $('#panel-settings').is(':visible')))) {
if (curr.attr('for')) { // to trigger event in checkbox
$('#' + curr.attr('for')).trigger(jQuery.Event('click', {which: 1}));
} else {
curr.trigger(jQuery.Event('click', {which: 1}));
if (needOpenPanel)
_isComplete = false; // to show next level of hints
}
}
}
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' ||
curr.closest('.btn-slot').prop('id') === 'slot-btn-mode' || curr.prop('id') === 'btn-favorite' || curr.parent().prop('id') === 'tlb-box-users' ||
curr.prop('id') === 'left-btn-thumbs' || curr.hasClass('scroll') || curr.prop('id') === 'left-btn-about' ||
curr.prop('id') === 'left-btn-support') {
_resetToDefault();
return;
}
if (curr.prop('id') === 'add-comment-doc') {
_removeHints();
_currentHints.length = 0;
_currentControls.length = 0;
_showHints();
return;
}
if (!_isComplete) {
if (curr.parent().prop('id') === 'slot-btn-chat') {
_nextLevel(1);
_setCurrentSection(undefined, $('#left-menu.hint-section'));
} else if (curr.prop('id') === 'id-right-menu-signature') {
_nextLevel(2);
_setCurrentSection(curr);
} else {
_nextLevel();
_setCurrentSection(curr);
}
_showHints();
if (_currentHints.length < 1) {
_resetToDefault();
}
}
}
} else if (!match) {
_inputLetters = '';
}
}
}
}
var isAlt = e.keyCode == Common.UI.Keys.ALT;
_needShow = (isAlt && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0);
if (isAlt) {
e.preventDefault();
}
});
};
var _getAlphabetLetters = function (lng) {
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/alphabetletters.json', function (langsJson) {
_arrEnAlphabet = langsJson['en'];
var _setAlphabet = function (lang) {
_lang = lang;
_arrAlphabet = langsJson[lang];
return _arrAlphabet;
};
return !_setAlphabet(lng) ? (!_setAlphabet(lng.split(/[\-_]/)[0]) ? _setAlphabet('en') : true) : true;
});
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/qwertyletters.json', function (langsJson) {
_arrQwerty = langsJson[_lang];
if (_lang !== 'en') {
_arrEnQwerty = langsJson['en'];
}
});
};
var _needCloseFileMenu = function () {
return !(_hintVisible && _currentLevel > 1);
};
var _clearHints = function (isComplete) {
_hintVisible && _hideHints();
if (_currentHints.length > 0) {
_resetToDefault();
}
_isLockedKeyEvents && _lockedKeyEvents(false);
if (isComplete) {
_isComplete = true;
}
if ($('.hint-div').length > 0) {
$('.hint-div').remove();
}
if ($('iframe').length > 0) {
$('iframe').contents().find('.hint-div').remove();
}
};
var _isHintVisible = function () {
return _hintVisible;
};
var _setMode = function (mode) {
_isEditDiagram = mode.isEditDiagram;
};
return {
init: _init,
setMode: _setMode,
clearHints: _clearHints,
needCloseFileMenu: _needCloseFileMenu,
isHintVisible: _isHintVisible
}
})();

View file

@ -81,12 +81,14 @@ define([
template: _.template([
'<div class="input-field" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'type="text" ',
'name="<%= name %>" ',
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'data-hint="<%= dataHint %>"',
'data-hint-direction="<%= dataHintDirection %>"',
'data-hint-offset="<%= dataHintOffset %>"',
'>',
'<span class="input-error"></span>',
'</div>'
@ -135,6 +137,9 @@ define([
name : this.name,
placeHolder : this.placeHolder,
spellcheck : this.spellcheck,
dataHint : this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset: this.options.dataHintOffset,
scope : me
}));
@ -159,6 +164,8 @@ define([
this._input.on('keydown', _.bind(this.onKeyDown, this));
this._input.on('keyup', _.bind(this.onKeyUp, this));
if (this.validateOnChange) this._input.on('input', _.bind(this.onInputChanging, this));
if (this.type=='password') this._input.on('input', _.bind(this.checkPasswordType, this));
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
}
@ -177,9 +184,20 @@ define([
me.rendered = true;
if (me.value)
me.setValue(me.value);
return this;
},
checkPasswordType: function(){
if (this._input.val() !== '') {
(this._input.attr('type') !== 'password') && this._input.attr('type', 'password');
} else {
this._input.attr('type', 'text');
}
},
_doChange: function(e, extra) {
// skip processing for internally-generated synthetic event
// to avoid double processing
@ -297,6 +315,8 @@ define([
if (this.rendered){
this._input.val(value);
}
(this.type=='password') && this.checkPasswordType();
},
getValue: function() {

View file

@ -59,7 +59,7 @@ define([
},
template: _.template([
'<div class="listview inner <%= cls %>"></div>'
'<div class="listview inner <%= cls %>" <% if (options.dataHint) { %> data-hint="<%= options.dataHint %>" <% } if (options.dataHintDirection) { %> data-hint-direction="<%= options.dataHintDirection %>" <% } if (options.dataHintOffset) { %> data-hint-offset="<%= options.dataHintOffset %>" <% } %>></div>'
].join('')),
onResetItems : function() {

View file

@ -171,6 +171,7 @@ define([
this.menuAlignEl = this.options.menuAlignEl;
this.scrollAlwaysVisible = this.options.scrollAlwaysVisible;
this.search = this.options.search;
this.outerMenu = this.options.outerMenu;
if (this.options.restoreHeight) {
this.options.restoreHeight = (typeof (this.options.restoreHeight) == "number") ? this.options.restoreHeight : (this.options.maxHeight ? this.options.maxHeight : 100000);
@ -267,6 +268,8 @@ define([
this.parentEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
this.parentEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me));
this.parentEl.on('keydown.after.bs.dropdown', _.bind(me.onAfterKeydownMenu, me));
this.parentEl.on('keydown.before.bs.dropdown', _.bind(me.onBeforeKeydownMenu, me));
this.options.innerMenus && this.on('keydown:before', _.bind(me.onBeforeKeyDown, me));
menuRoot.hover(
function(e) { me.isOver = true;},
@ -453,6 +456,21 @@ define([
}
},
onBeforeKeydownMenu: function(e) {
if (e.isDefaultPrevented() || !(this.outerMenu && this.outerMenu.menu))
return;
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
var $items = this.menuRoot.find('> li').find('> a'),
index = $items.index($items.filter(':focus'));
if (e.keyCode==Common.UI.Keys.UP && index==0 || e.keyCode == Common.UI.Keys.DOWN && index==$items.length-1) {
this.outerMenu.menu.focusOuter(e, this.outerMenu.index);
e.preventDefault();
e.stopPropagation();
}
}
},
selectCandidate: function() {
var index = this._search.index || 0,
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
@ -491,6 +509,85 @@ define([
}
},
onBeforeKeyDown: function(menu, e) {
if (e.keyCode == Common.UI.Keys.RETURN) {
var li = $(e.target).closest('li');
if (li.length>0) {
e.preventDefault();
e.stopPropagation();
li.click();
}
Common.UI.Menu.Manager.hideAll();
} else if (e.namespace!=="after.bs.dropdown" && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) {
if ( this.menuRoot.length<1 || $(e.target).closest('ul[role=menu]').get(0) !== this.menuRoot.get(0)) return;
var innerMenu = this.findInnerMenu(e.keyCode);
if (innerMenu && innerMenu.focusInner) {
e.preventDefault();
e.stopPropagation();
_.delay(function() {
innerMenu.focusInner(e);
}, 10);
}
}
},
setInnerMenu: function(menus) {
if (this.options.innerMenus || !menus) return;
this.options.innerMenus = menus;
this.rendered && this.on('keydown:before', _.bind(this.onBeforeKeyDown, this));
},
findInnerMenu: function(direction, index, findOuter) {
if (!this.options.innerMenus) return;
var $allItems = $('> li', this.menuRoot),
$liItems = $('> li:not(.divider):not(.disabled):visible', this.menuRoot),
length = $liItems.length;
if (!length) return;
var step = 0;
while (step<length) {
var focusedIndex = (index!==undefined) ? $liItems.index($allItems.eq(index)) : $liItems.index($liItems.find('> a').filter(':focus').parent());
var checkedIndex = (direction == Common.UI.Keys.DOWN) ? (focusedIndex<length-1 ? focusedIndex+1 : 0) : (focusedIndex>0 ? focusedIndex-1 : length-1),
checkedItem = $liItems.eq(checkedIndex);
index = $allItems.index(checkedItem);
for (var i=0; i<this.options.innerMenus.length; i++) {
var item = this.options.innerMenus[i];
if (item && item.menu && item.index==index) {
return item.menu;
}
}
if (checkedItem.find('> a').length>0)
return findOuter ? checkedItem : undefined;
step++;
}
},
focusInner: function(e) {
if (e.keyCode == Common.UI.Keys.UP)
this.items[this.items.length-1].cmpEl.find('> a').focus();
else
this.items[0].cmpEl.find('> a').focus();
},
focusOuter: function(e, index) {
var innerMenu = this.findInnerMenu(e.keyCode, index, true);
if (innerMenu && innerMenu.focusInner) {
_.delay(function() {
innerMenu.focusInner(e);
}, 10);
} else if (innerMenu) {
innerMenu.find('> a').focus();
} else {
var $items = $('> li:not(.divider):not(.disabled):visible', this.menuRoot).find('> a'),
length = $items.length;
length && $items.eq(e.keyCode == Common.UI.Keys.UP ? (index<0 ? length-1 : index) : (index>=length-1 ? 0 : index+1)).focus();
}
},
onItemClick: function(item, e) {
if (!item.menu) this.isOver = false;
if (item.options.stopPropagation) {

View file

@ -98,17 +98,22 @@ define([
checked : false,
allowDepress: false,
disabled : false,
visible : true,
value : null,
toggleGroup : null,
iconCls : '',
menu : null,
canFocused : true
canFocused : true,
dataHint : '',
dataHintDirection: '',
dataHintOffset: '',
dataHintTitle: ''
},
tagName : 'li',
template: _.template([
'<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; %> >',
'<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; if(options.dataHintTitle) { %> data-hint-title="<%= options.dataHintTitle %>" <% }; %> >',
'<% if (!_.isEmpty(iconCls)) { %>',
'<span class="menu-item-icon <%= iconCls %>"></span>',
'<% } %>',
@ -130,6 +135,7 @@ define([
this.checked = me.options.checked;
me.allowDepress = me.options.allowDepress;
this.disabled = me.options.disabled;
this.visible = me.options.visible;
this.value = me.options.value;
this.toggleGroup = me.options.toggleGroup;
this.template = me.options.template || this.template;
@ -213,6 +219,9 @@ define([
});
}
if (this.cls)
el.addClass(this.cls);
if (this.disabled)
el.toggleClass('disabled', this.disabled);
@ -222,6 +231,8 @@ define([
Common.UI.ToggleManager.register(me);
}
}
if (!this.visible)
this.setVisible(this.visible);
me.cmpEl = el;
me.rendered = true;

View file

@ -110,7 +110,10 @@ define([
hold : true,
speed : 'medium',
width : 90,
allowDecimal: true
allowDecimal: true,
dataHint : '',
dataHintDirection: '',
dataHintOffset: ''
},
disabled : false,
@ -118,7 +121,7 @@ define([
rendered : false,
template :
'<input type="text" class="form-control" spellcheck="false">' +
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">' +
'<div class="spinner-buttons">' +
'<button type="button" class="spinner-up"><i class="arrow"></i></button>' +
'<button type="button" class="spinner-down"><i class="arrow"></i></button>' +
@ -185,7 +188,13 @@ define([
render: function () {
var el = this.$el || $(this.el);
el.html(this.template);
var template = _.template(this.template);
el.html($(template({
dataHint : this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset : this.options.dataHintOffset
})));
this.$input = el.find('.form-control');
this.rendered = true;

View file

@ -93,19 +93,19 @@ define([
var _template_tabs =
'<section class="tabs">' +
'<a class="scroll left"></a>' +
'<a class="scroll left" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="V"></a>' +
'<ul>' +
'<% for(var i in items) { %>' +
'<% if (typeof items[i] == "object") { %>' +
'<li class="ribtab' +
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>">' +
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>"><%= items[i].caption %></a>' +
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small" <% if (typeof items[i].dataHintTitle !== "undefined") { %> data-hint-title="<%= items[i].dataHintTitle %>" <% } %>><%= items[i].caption %></a>' +
'</li>' +
'<% } %>' +
'<% } %>' +
'</ul>' +
'<a class="scroll right"></a>' +
'<a class="scroll right" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="R"></a>' +
'</section>';
this.$layout = $(options.template({
@ -316,7 +316,7 @@ define([
return config.tabs[index].action;
}
var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><a data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>');
var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><a data-tab="<%= action %>" data-title="<%= caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small" <% if (typeof dataHintTitle !== "undefined") { %> data-hint-title="<%= dataHintTitle %>" <% } %> ><%= caption %></a></li>');
config.tabs[after + 1] = tab;
var _after_action = _get_tab_action(after);

View file

@ -55,6 +55,8 @@ define([
values: [0, 100],
colorValues: ['#000000', '#ffffff'],
currentThumb: 0,
includeSnap: true,
intervalSnap: 5,
thumbTemplate: '<div class="thumb" style="">' +
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +

View file

@ -71,12 +71,21 @@ define([
disabled : false,
rendered : false,
template : _.template('<label class="radiobox"><input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
'<label for="<%= id %>" class="radiobox__shape"></label><span></span></label>'),
template : _.template('<div class="radiobox" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">' +
'<input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">' +
'<circle class="rb-circle" cx="8" cy="8" r="6.5" />' +
'<circle class="rb-check-mark" cx="8" cy="8" r="4" />' +
'</svg>' +
'<span></span></div>'),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
this.dataHint = options.dataHint;
this.dataHintDirection = options.dataHintDirection;
this.dataHintOffset = options.dataHintOffset;
var me = this;
this.name = this.options.name || Common.UI.getId();
@ -92,7 +101,6 @@ define([
this.setCaption(this.options.labelText);
// handle events
this.$radio.on('click', _.bind(this.onItemCheck, this));
},
render: function () {
@ -100,13 +108,22 @@ define([
el.html(this.template({
labelText: this.options.labelText,
name: this.name,
id: Common.UI.getId('rdb-')
id: Common.UI.getId('rdb-'),
dataHint: this.dataHint,
dataHintDirection: this.dataHintDirection,
dataHintOffset: this.dataHintOffset
}));
this.$radio = el.find('input[type=radio]');
this.$label = el.find('label.radiobox');
this.$label = el.find('div.radiobox');
this.$span = this.$label.find('span');
this.$label.on('keydown', this.onKeyDown.bind(this));
this.$label.on({
'keydown': this.onKeyDown.bind(this),
'click': function(e){
if ( !this.disabled )
this.setValue(true);
}.bind(this),});
this.rendered = true;
return this;

View file

@ -82,13 +82,14 @@ define([
maxValue: 100,
step: 1,
value: 100,
enableKeyEvents: false
enableKeyEvents: false,
direction: 'horizontal' // 'vertical'
},
disabled: false,
template : _.template([
'<div class="slider single-slider" style="">',
'<div class="slider single-slider <% if (this.options.direction === \'vertical\') { %>vertical<% } %>" style="">',
'<div class="track"></div>',
'<div class="thumb" style=""></div>',
'<% if (this.options.enableKeyEvents) { %>',
@ -107,6 +108,7 @@ define([
me.maxValue = me.options.maxValue;
me.delta = 100/(me.maxValue - me.minValue);
me.step = me.options.step;
me.direction = me.options.direction;
if (me.options.el) {
me.render();
@ -133,7 +135,7 @@ define([
}
this.cmpEl.find('.track-center').width(me.options.width - 14);
this.cmpEl.width(me.options.width);
this.cmpEl[me.direction === 'vertical' ? 'height' : 'width'](me.options.width);
this.thumb = this.cmpEl.find('.thumb');
@ -141,7 +143,9 @@ define([
e.preventDefault();
e.stopPropagation();
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100))));
var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
) / me.width * 100))));
me.setThumbPosition(pos);
me.lastValue = me.value;
@ -162,7 +166,9 @@ define([
e.preventDefault();
e.stopPropagation();
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100))));
var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
) / me.width * 100))));
me.setThumbPosition(pos);
me.lastValue = me.value;
@ -174,7 +180,7 @@ define([
var onMouseDown = function (e) {
if ( me.disabled ) return;
me._dragstart = e.pageX*Common.Utils.zoom() - me.thumb.offset().left - 7;
me._dragstart = me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.thumb.offset().top) : (e.pageX*Common.Utils.zoom() - me.thumb.offset().left) - 7;
me.thumb.addClass('active');
$(document).on('mouseup', onMouseUp);
@ -187,7 +193,9 @@ define([
var onTrackMouseDown = function (e) {
if ( me.disabled ) return;
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) / me.width * 100))));
var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left)
) / me.width * 100))));
me.setThumbPosition(pos);
me.lastValue = me.value;
@ -245,8 +253,12 @@ define([
return this;
},
setThumbPosition: function(x) {
this.thumb.css({left: x + '%'});
setThumbPosition: function(pos) {
if (this.direction === 'vertical') {
this.thumb.css({top: pos + '%'});
} else {
this.thumb.css({left: pos + '%'});
}
},
setValue: function(value) {
@ -273,6 +285,8 @@ define([
minValue: 0,
maxValue: 100,
values: [0, 100],
includeSnap: false,
intervalSnap: undefined,
thumbTemplate: '<div class="thumb" style=""></div>'
},
@ -300,8 +314,9 @@ define([
me.minValue = me.options.minValue;
me.maxValue = me.options.maxValue;
me.delta = 100/(me.maxValue - me.minValue);
me.includeSnap = me.options.includeSnap;
me.intervalSnap = me.options.intervalSnap;
me.thumbs = [];
if (me.options.el) {
me.render();
}
@ -330,9 +345,38 @@ define([
el.find('.track-center').width(me.options.width - 14);
el.width(me.options.width);
var setCenters = function (index) {
if(!me.includeSnap) return;
var n = me.minValue;
var getX = function (position) {
return (0.01 * me.width * position + me.cmpEl.offset().left + me._dragstart)/Common.Utils.zoom();
};
me.centers = [];
_.each(me.thumbs, function (thumb, indexT) {
if ((indexT != index) && (n != thumb.position)) {
me.centers.push(getX((thumb.position - n) / 2 + n));
n = thumb.position;
}
});
if(n != me.maxValue) me.centers.push(getX((me.maxValue - n) / 2 + n));
};
var resetPageX = function (e) {
if(!me.includeSnap) return;
_.each(me.centers, function (x) {
if((e.pageX <= x + me.intervalSnap) && (e.pageX >= x - me.intervalSnap)) {
e.pageX = x;
return;
}
});
};
var onMouseUp = function (e) {
e.preventDefault();
e.stopPropagation();
resetPageX(e);
var index = e.data.index,
lastValue = me.thumbs[index].value,
@ -343,6 +387,9 @@ define([
pos = Math.max(0, Math.min(100, position)),
value = pos/me.delta + me.minValue;
if (me.thumbs.length < 3)
me.isRemoveThumb = false;
if (me.isRemoveThumb) {
if (me.thumbs.length < 3) {
$(document).off('mouseup', me.binding.onMouseUp);
@ -375,6 +422,7 @@ define([
e.preventDefault();
e.stopPropagation();
resetPageX(e);
var index = e.data.index,
lastValue = me.thumbs[index].value,
@ -406,6 +454,7 @@ define([
thumb = me.thumbs[index].thumb;
me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2;
setCenters(index);
me.setActiveThumb(index);
_.each(me.thumbs, function (item, idx) {
@ -416,6 +465,7 @@ define([
$(document).on('mousemove', null, e.data, me.binding.onMouseMove);
};
var onTrackMouseUp = function (e) {
if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return;

View file

@ -44,7 +44,9 @@ define([
target : $(document.body),
text : '',
placement: 'right-bottom',
showLink: true
showLink: true,
showButton: false,
closable: true
},
template: _.template([
@ -53,11 +55,16 @@ define([
'<div class="tip-arrow <%= scope.placement %>"></div>',
'<div>',
'<div class="tip-text"><%= scope.text %></div>',
'<% if ( scope.closable ) { %>',
'<div class="close"></div>',
'<% } %>',
'</div>',
'<% if ( scope.showLink ) { %>',
'<div class="show-link"><label><%= scope.textLink %></label></div>',
'<% } %>',
'<% if ( scope.showButton ) { %>',
'<div class="btn-div"><%= scope.textButton %></div>',
'<% } %>',
'</div>',
'</div>'
].join('')),
@ -71,6 +78,9 @@ define([
this.textLink = !_.isEmpty(this.options.textLink) ? this.options.textLink : this.textDontShow;
this.placement = this.options.placement;
this.showLink = this.options.showLink;
this.showButton = this.options.showButton;
this.closable = this.options.closable;
this.textButton = this.options.textButton || '';
},
render: function() {
@ -79,6 +89,7 @@ define([
$(document.body).append(this.cmpEl);
this.cmpEl.find('.close').on('click', _.bind(function() { this.trigger('closeclick');}, this));
this.cmpEl.find('.show-link label').on('click', _.bind(function() { this.trigger('dontshowclick');}, this));
this.cmpEl.find('.btn-div').on('click', _.bind(function() { this.trigger('buttonclick');}, this));
}
this.applyPlacement();
@ -143,8 +154,14 @@ define([
}
top = (top!==undefined) ? (top + 'px') : 'auto';
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
left = (left!==undefined) ? (left + 'px') : 'auto';
right = (right!==undefined) ? (right + 'px') : 'auto';
if (left!==undefined) {
var width = this.cmpEl.width();
if (left+width>Common.Utils.innerWidth())
left = Common.Utils.innerWidth() - width - 10;
left = (left + 'px');
} else
left = 'auto';
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
}
},

View file

@ -121,76 +121,6 @@ define([
me.tabBarRight = me.bounds[length - 1].right;
me.tabBarRight = Math.min(me.tabBarRight, barBounds.right - 1);
}
},
setHookTabs: function (e, bar, tabs) {
var me = this;
function dragComplete() {
if (!_.isUndefined(me.drag)) {
bar.dragging = false;
bar.$el.find('li.mousemove').removeClass('mousemove right');
var arrSelectIndex = [];
tabs.forEach(function (item) {
arrSelectIndex.push(item.sheetindex);
});
if (!_.isUndefined(me.drag.place)) {
me.bar.trigger('tab:move', arrSelectIndex, me.drag.place);
me.bar.$bar.scrollLeft(me.scrollLeft);
me.bar.scrollX = undefined;
} else {
me.bar.trigger('tab:move', arrSelectIndex);
me.bar.$bar.scrollLeft(me.scrollLeft);
me.bar.scrollX = undefined;
}
me.bar.checkInvisible();
me.drag = undefined;
me.bar.trigger('tab:drop', this);
}
}
function dragMove (event) {
if (!_.isUndefined(me.drag)) {
me.drag.moveX = event.clientX*Common.Utils.zoom();
if (me.drag.moveX < me.leftBorder) {
me.scrollLeft -= 20;
me.bar.$bar.scrollLeft(me.scrollLeft);
me.calculateBounds();
} else if (me.drag.moveX < me.tabBarRight && me.drag.moveX > me.tabBarLeft) {
var name = $(event.target).parent().data('label'),
currentTab = _.findIndex(bar.tabs, {label: name});
if (currentTab === -1) {
bar.$el.find('li.mousemove').removeClass('mousemove right');
me.drag.place = undefined;
} else if (me.bounds[currentTab].left - me.scrollLeft >= me.tabBarLeft) {
me.drag.place = currentTab;
$(event.target).parent().parent().find('li.mousemove').removeClass('mousemove right');
$(event.target).parent().addClass('mousemove');
}
} else if (me.drag.moveX > me.lastTabRight && Math.abs(me.tabBarRight - me.bounds[me.bar.tabs.length - 1].right) < 1) { //move to end of list, right border of the right tab is visible
bar.$el.find('li.mousemove').removeClass('mousemove right');
bar.tabs[bar.tabs.length - 1].$el.addClass('mousemove right');
me.drag.place = bar.tabs.length;
} else if (me.drag.moveX - me.rightBorder > 3) {
me.scrollLeft += 20;
me.bar.$bar.scrollLeft(me.scrollLeft);
me.calculateBounds();
}
}
}
if (!_.isUndefined(bar) && !_.isUndefined(tabs) && bar.tabs.length > 1) {
me.bar = bar;
me.drag = {tabs: tabs};
bar.dragging = true;
this.calculateBounds();
$(document).on('mousemove.tabbar', dragMove);
$(document).on('mouseup.tabbar', function (e) {
dragComplete(e);
$(document).off('mouseup.tabbar');
$(document).off('mousemove.tabbar', dragMove);
});
this.bar.trigger('tab:drag', this.bar.selectTabs);
}
}
}
});
@ -240,19 +170,25 @@ define([
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab, this.selectTabs);
}, this.bar),
mousedown: $.proxy(function (e) {
if ((3 !== e.which) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
if ((3 !== e.which) && !e.shiftKey) {
var lockDrag = tab.isLockTheDrag;
this.bar.selectTabs.forEach(function (item) {
if (item.isLockTheDrag) {
lockDrag = true;
}
});
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1 || this.bar.isEditFormula) {
if (((this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1) && !(e.ctrlKey || (Common.Utils.isMac && e.altKey))) || this.bar.isEditFormula) {
lockDrag = true;
}
// move last selected sheet if all sheets are selected
if (this.bar.selectTabs.length === this.bar.tabs.length && this.bar.tabs.length > 1 && !e.ctrlKey && !(Common.Utils.isMac && e.altKey)) {
lockDrag = false;
this.bar.$el.find('ul > li.selected').removeClass('selected');
}
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
if (!lockDrag)
if (!lockDrag && !e.ctrlKey && !e.metaKey) {
tab.changeState();
}
} else {
this.bar.$el.find('ul > li > span').attr('draggable', 'false');
}
@ -269,15 +205,15 @@ define([
tab.$el.children().on(
{dragstart: $.proxy(function (e) {
var event = e.originalEvent;
if (!Common.Utils.isIE) {
if (!Common.Utils.isIE && !Common.Utils.isSafari) {
var img = document.createElement('div');
event.dataTransfer.setDragImage(img, 0, 0);
} else {
} else if (Common.Utils.isIE) {
this.bar.selectTabs.forEach(function (tab) {
tab.$el.find('span').prop('title', '');
});
}
event.dataTransfer.effectAllowed = 'move';
event.dataTransfer.effectAllowed = 'copyMove';
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
}, this),
dragenter: $.proxy(function (e) {
@ -285,14 +221,7 @@ define([
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
var data;
if (!Common.Utils.isIE) {
data = event.dataTransfer.getData('onlyoffice');
event.dataTransfer.dropEffect = data ? 'move' : 'none';
} else {
data = event.dataTransfer.getData('text');
event.dataTransfer.dropEffect = data === 'sheet' ? 'move' : 'none';
}
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
} else {
event.dataTransfer.dropEffect = 'none';
}
@ -305,6 +234,7 @@ define([
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
} else {
event.dataTransfer.dropEffect = 'none';
}
@ -314,8 +244,11 @@ define([
$(e.currentTarget).parent().removeClass('mousemove right');
}, this),
dragend: $.proxy(function (e) {
if (Common.Utils.isMac && e.altKey) { // don't show alt hints after copy by drag and drop
this.bar.isDragDrop = true;
}
var event = e.originalEvent;
if (event.dataTransfer.dropEffect === 'move') {
if (event.dataTransfer.dropEffect === 'move' && !event.dataTransfer.mozUserCancelled) {
this.bar.trigger('tab:dragend', true);
} else {
this.bar.trigger('tab:dragend', false);
@ -323,10 +256,13 @@ define([
this.bar.$el.find('.mousemove').removeClass('mousemove right');
}, this),
drop: $.proxy(function (e) {
if (Common.Utils.isMac && e.altKey) { // don't show alt hints after copy by drag and drop
this.bar.isDragDrop = true;
}
var event = e.originalEvent,
index = $(event.currentTarget).data('index');
this.bar.$el.find('.mousemove').removeClass('mousemove right');
this.bar.trigger('tab:drop', event.dataTransfer, index);
this.bar.trigger('tab:drop', event.dataTransfer, index, (event.ctrlKey || Common.Utils.isMac && event.altKey));
this.bar.isDrop = true;
}, this)
});
@ -365,23 +301,20 @@ define([
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
addEvent(this.$bar[0], 'dragstart', _.bind(function (event) {
event.dataTransfer.effectAllowed = 'move';
event.dataTransfer.effectAllowed = 'copyMove';
}, this));
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
var data;
if (!Common.Utils.isIE) {
data = event.dataTransfer.getData('onlyoffice');
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
if (!this.isEditFormula) {
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
} else {
data = event.dataTransfer.getData('text');
event.dataTransfer.dropEffect = (data === 'sheet' && !this.isEditFormula) ? 'move' : 'none';
event.dataTransfer.dropEffect = 'none';
}
}, this));
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
if (event.preventDefault) {
event.preventDefault(); // Necessary. Allows us to drop.
}
event.dataTransfer.dropEffect = !this.isEditFormula ? 'move' : 'none';
event.dataTransfer.dropEffect = !this.isEditFormula ? ((event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move') : 'none';
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
return false;
}, this));
@ -392,7 +325,10 @@ define([
addEvent(this.$bar[0], 'drop', _.bind(function (event) {
this.$el.find('.mousemove').removeClass('mousemove right');
if (this.isDrop === undefined) {
this.trigger('tab:drop', event.dataTransfer, 'last');
if (Common.Utils.isMac && event.altKey) { // don't show alt hints after copy by drag and drop
this.isDragDrop = true;
}
this.trigger('tab:drop', event.dataTransfer, 'last', (event.ctrlKey || Common.Utils.isMac && event.altKey));
} else {
this.isDrop = undefined;
}
@ -423,6 +359,7 @@ define([
this.setTabVisible('backward');
}
}
Common.NotificationCenter.trigger('hints:clear');
},
onProcessMouse: function(data) {
@ -671,6 +608,29 @@ define([
}
return false;
}
},
addDataHint: function (index) { //Hint Manager
var oldHintTab = this.$bar.find('[data-hint]');
if (oldHintTab.length > 0) {
oldHintTab.removeAttr('data-hint');
oldHintTab.removeAttr('data-hint-direction');
oldHintTab.removeAttr('data-hint-offset');
oldHintTab.removeAttr('data-hint-title');
}
var newHintTab = this.tabs[index].$el;
newHintTab.attr('data-hint', '0');
newHintTab.attr('data-hint-direction', 'top');
newHintTab.attr('data-hint-offset', 'medium');
newHintTab.attr('data-hint-title', 'M');
},
getWidth: function() {
var width = 21;
this.tabs.forEach(function(tab){
width += tab.$el.width();
});
return width;
},
});
});

View file

@ -65,6 +65,15 @@ define([
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
'placeholder="<%= placeHolder %>" ',
'<% if (dataHint) {%>',
'data-hint="<%= dataHint %>" ',
'<% } %>',
'<% if (dataHintDirection) {%>',
'data-hint-direction="<%= dataHintDirection %>" ',
'<% } %>',
'<% if (dataHintOffset) {%>',
'data-hint-offset="<%= dataHintOffset %>" ',
'<% } %>',
'></textarea>',
'</div>'
].join('')),
@ -101,6 +110,9 @@ define([
style : this.style,
placeHolder : this.placeHolder,
spellcheck : this.spellcheck,
dataHint : this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset: this.options.dataHintOffset,
scope : me
}));

View file

@ -55,26 +55,28 @@ define([
effects: 5,
allowReselect: true,
transparent: false,
value: '000000'
value: '000000',
enableKeyEvents: true,
keyMoveDirection: 'both' // 'vertical', 'horizontal'
},
template :
_.template(
'<div style="padding: 8px 12px 12px;">' +
'<% var me = this; %>' +
'<% var me = this; var idx = 0; %>' +
'<% $(colors).each(function(num, item) { %>' +
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +
'<% } else if (me.isSeparator(item)) { %> </div><div class="divider" style="width:100%;float:left;"></div><div style="padding: 12px;">' +
'<% } else if (me.isColor(item)) { %> ' +
'<a class="palette-color color-<%=item%>" style="background:#<%=item%>" hidefocus="on">' +
'<a class="palette-color color-<%=item%>" style="background:#<%=item%>" idx="<%=idx++%>">' +
'<em><span style="background:#<%=item%>;" unselectable="on">&#160;</span></em>' +
'</a>' +
'<% } else if (me.isTransparent(item)) { %>' +
'<a class="color-<%=item%>" hidefocus="on">' +
'<a class="color-<%=item%>" idx="<%=idx++%>">' +
'<em><span unselectable="on">&#160;</span></em>' +
'</a>' +
'<% } else if (me.isEffect(item)) { %>' +
'<a effectid="<%=item.effectId%>" effectvalue="<%=item.effectValue%>" class="palette-color-effect color-<%=item.color%>" style="background:#<%=item.color%>" hidefocus="on">' +
'<a effectid="<%=item.effectId%>" effectvalue="<%=item.effectValue%>" class="palette-color-effect color-<%=item.color%>" style="background:#<%=item.color%>" idx="<%=idx++%>">' +
'<em><span style="background:#<%=item.color%>;" unselectable="on">&#160;</span></em>' +
'</a>' +
'<% } else if (me.isCaption(item)) { %>' +
@ -85,7 +87,7 @@ define([
'<% if (me.options.dynamiccolors!==undefined) { %>' +
'<div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div><div style="padding: 12px;">' +
'<% for (var i=0; i<me.options.dynamiccolors; i++) { %>' +
'<a class="color-dynamic-<%=i%> dynamic-empty-color" color="" hidefocus="on">' +
'<a class="color-dynamic-<%=i%> dynamic-empty-color" color="" idx="<%=idx++%>">' +
'<em><span unselectable="on">&#160;</span></em></a>' +
'<% } %>' +
'<% } %>' +
@ -101,6 +103,18 @@ define([
el = me.$el || $(this.el);
this.colors = me.options.colors || this.generateColorData(me.options.themecolors, me.options.effects, me.options.standardcolors, me.options.transparent);
this.enableKeyEvents= me.options.enableKeyEvents;
this.tabindex = me.options.tabindex || 0;
this.outerMenu = me.options.outerMenu;
this.lastSelectedIdx = -1;
me.colorItems = [];
if (me.options.keyMoveDirection=='vertical')
me.moveKeys = [Common.UI.Keys.UP, Common.UI.Keys.DOWN];
else if (me.options.keyMoveDirection=='horizontal')
me.moveKeys = [Common.UI.Keys.LEFT, Common.UI.Keys.RIGHT];
else
me.moveKeys = [Common.UI.Keys.UP, Common.UI.Keys.DOWN, Common.UI.Keys.LEFT, Common.UI.Keys.RIGHT];
el.addClass('theme-colorpalette');
this.render();
@ -117,6 +131,12 @@ define([
render: function () {
this.$el.html(this.template({colors: this.colors}));
var me = this;
this.moveKeys && this.$el.find('a').each(function(num, item) {
me.colorItems.push({el: item, index: num});
});
this.attachKeyEvents();
return this;
},
@ -146,7 +166,7 @@ define([
updateCustomColors: function() {
var el = this.$el || $(this.el);
if (el) {
var selected = el.find('a.' + this.selectedCls),
var selected = (this.lastSelectedIdx>=0) ? $(this.colorItems[this.lastSelectedIdx].el) : el.find('a.' + this.selectedCls),
color = (selected.length>0 && /color-dynamic/.test(selected[0].className)) ? selected.attr('color') : undefined;
if (color) { // custom color was selected
color = color.toUpperCase();
@ -165,6 +185,7 @@ define([
});
if (colors[i] == color) {
colorEl.addClass(this.selectedCls);
this.lastSelectedIdx = parseInt(colorEl.attr('idx'));
color = undefined; //select only first found color
}
}
@ -179,42 +200,55 @@ define([
if (target.length==0) return;
if (target.hasClass('color-transparent') ) {
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
me.clearSelection(true);
target.addClass(me.selectedCls);
me.value = 'transparent';
me.trigger('select', me, 'transparent');
if (!e.suppressEvent) {
me.lastSelectedIdx = parseInt(target.attr('idx'));
me.value = 'transparent';
me.trigger('select', me, 'transparent');
}
} else if ( !(target[0].className.search('color-dynamic')<0) ) {
if (!/dynamic-empty-color/.test(target[0].className)) {
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
me.clearSelection(true);
target.addClass(me.selectedCls);
color = target.attr('color');
if (color) me.trigger('select', me, color);
me.value = color.toUpperCase();
if (!e.suppressEvent) {
me.lastSelectedIdx = parseInt(target.attr('idx'));
color = target.attr('color');
me.trigger('select', me, color);
me.value = color.toUpperCase();
}
} else {
setTimeout(function(){
me.addNewColor();
}, 10);
if (e.suppressEvent) {
me.clearSelection(true);
target.addClass(me.selectedCls);
} else
setTimeout(function(){
me.addNewColor();
}, 10);
}
} else {
if (!/^[a-fA-F0-9]{6}$/.test(me.value) || _.indexOf(me.colors, me.value)<0 )
me.value = false;
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
me.clearSelection(true);
target.addClass(me.selectedCls);
color = target[0].className.match(me.colorRe)[1];
if ( target.hasClass('palette-color-effect') ) {
var effectId = parseInt(target.attr('effectid'));
if (color) {
if (color && !e.suppressEvent) {
me.value = color.toUpperCase();
me.trigger('select', me, {color: color, effectId: effectId});
me.lastSelectedIdx = parseInt(target.attr('idx'));
}
} else {
if (/#?[a-fA-F0-9]{6}/.test(color)) {
color = /#?([a-fA-F0-9]{6})/.exec(color)[1].toUpperCase();
me.value = color;
me.trigger('select', me, color);
if (color && !e.suppressEvent) {
me.value = color;
me.trigger('select', me, color);
me.lastSelectedIdx = parseInt(target.attr('idx'));
}
}
}
}
@ -225,8 +259,7 @@ define([
color = /#?([a-fA-F0-9]{6})/.exec(color);
if (color) {
this.saveCustomColor(color[1]);
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
this.clearSelection(true);
var child = el.find('.dynamic-empty-color');
if (child.length==0) {
@ -273,7 +306,7 @@ define([
select: function(color, suppressEvent) {
var el = this.$el || $(this.el);
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
this.clearSelection();
if (typeof(color) == 'object' ) {
var effectEl;
@ -281,6 +314,7 @@ define([
effectEl = el.find('a[effectid="'+color.effectId+'"]').first();
if (effectEl.length>0) {
effectEl.addClass(this.selectedCls);
this.lastSelectedIdx = parseInt(effectEl.attr('idx'));
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
} else
this.value = false;
@ -288,6 +322,7 @@ define([
effectEl = el.find('a[effectvalue="'+color.effectValue+'"].color-' + color.color.toUpperCase()).first();
if (effectEl.length>0) {
effectEl.addClass(this.selectedCls);
this.lastSelectedIdx = parseInt(effectEl.attr('idx'));
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
} else
this.value = false;
@ -302,8 +337,9 @@ define([
if (_.indexOf(this.colors, this.value)<0) this.value = false;
if (color != this.value || this.options.allowReselect) {
(color == 'transparent') ? el.find('a.color-transparent').addClass(this.selectedCls) : el.find('a.palette-color.color-' + color).first().addClass(this.selectedCls);
var co = (color == 'transparent') ? el.find('a.color-transparent').addClass(this.selectedCls) : el.find('a.palette-color.color-' + color).first().addClass(this.selectedCls);
this.value = color;
this.lastSelectedIdx = parseInt(co.attr('idx'));
if (suppressEvent !== true) {
this.fireEvent('select', this, color);
}
@ -314,6 +350,7 @@ define([
co = el.find('a[color="'+color+'"]').first();
if (co.length>0) {
co.addClass(this.selectedCls);
this.lastSelectedIdx = parseInt(co.attr('idx'));
this.value = color.toUpperCase();
}
}
@ -322,7 +359,7 @@ define([
selectByRGB: function(rgb, suppressEvent) {
var el = this.$el || $(this.el);
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
this.clearSelection(true);
var color = (typeof(rgb) == 'object') ? rgb.color : rgb;
if (/#?[a-fA-F0-9]{6}/.test(color)) {
@ -338,6 +375,7 @@ define([
co = el.find('a[color="'+color+'"]').first();
if (co.length>0) {
co.addClass(this.selectedCls);
this.lastSelectedIdx = parseInt(co.attr('idx'));
this.value = color;
}
if (suppressEvent !== true) {
@ -417,7 +455,28 @@ define([
clearSelection: function(suppressEvent) {
this.$el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
this.value = undefined;
if (!suppressEvent) {
this.value = undefined;
this.lastSelectedIdx = -1;
}
},
showLastSelected: function() {
this.selectByIndex(this.lastSelectedIdx, true);
},
getSelectedColor: function() {
var el = this.$el || $(this.el);
var idx = el.find('a.' + this.selectedCls).attr('idx');
return (idx!==undefined) ? this.colorItems[parseInt(idx)] : null;
},
selectByIndex: function(index, suppressEvent) {
this.clearSelection(true);
if (index>=0 && index<this.colorItems.length) {
this.handleClick({target: this.colorItems[index].el, suppressEvent: suppressEvent});
}
},
generateColorData: function(themecolors, effects, standardcolors, transparent) {
@ -449,6 +508,137 @@ define([
return arr;
},
onKeyDown: function (e, data) {
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.getSelectedColor();
if (data.keyCode==Common.UI.Keys.RETURN) {
rec && this.selectByIndex(rec.index);
if (this.outerMenu && this.outerMenu.menu)
this.outerMenu.menu.hide();
} else {
var idx = rec ? rec.index : -1;
if (idx<0) {
idx = 0;
} else if (this.options.keyMoveDirection == 'both') {
if (this._layoutParams === undefined)
this.fillIndexesArray();
var topIdx = this.colorItems[idx].topIdx,
leftIdx = this.colorItems[idx].leftIdx;
idx = undefined;
if (data.keyCode==Common.UI.Keys.LEFT) {
while (idx===undefined) {
leftIdx--;
if (leftIdx<0) {
leftIdx = this._layoutParams.columns-1;
}
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else if (data.keyCode==Common.UI.Keys.RIGHT) {
while (idx===undefined) {
leftIdx++;
if (leftIdx>this._layoutParams.columns-1) leftIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else if (data.keyCode==Common.UI.Keys.UP) {
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
this.clearSelection(true);
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
} else
while (idx===undefined) {
topIdx--;
if (topIdx<0) topIdx = this._layoutParams.rows-1;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else {
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
this.clearSelection(true);
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
} else
while (idx===undefined) {
topIdx++;
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
}
} else {
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
? Math.max(0, idx-1)
: Math.min(this.colorItems.length - 1, idx + 1) ;
}
if (idx !== undefined && idx>=0) {
this._fromKeyDown = true;
this.selectByIndex(idx, true);
this._fromKeyDown = false;
}
}
}
},
fillIndexesArray: function() {
if (this.colorItems.length<=0) return;
this._layoutParams = {
itemsIndexes: [],
columns: 0,
rows: 0
};
var el = $(this.colorItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0;
for (var i=0; i<this.colorItems.length; i++) {
var top = $(this.colorItems[i].el).offset().top - offsetTop;
leftIdx = Math.floor(($(this.colorItems[i].el).offset().left - offsetLeft)/itemW);
if (top>prevtop) {
prevtop = top;
this._layoutParams.itemsIndexes.push([]);
topIdx = this._layoutParams.itemsIndexes.length-1;
}
this._layoutParams.itemsIndexes[topIdx][leftIdx] = i;
this.colorItems[i].topIdx = topIdx;
this.colorItems[i].leftIdx = leftIdx;
if (this._layoutParams.columns<leftIdx) this._layoutParams.columns = leftIdx;
}
this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
this._layoutParams.columns++;
},
attachKeyEvents: function() {
if (this.enableKeyEvents) {
var el = this.$el || $(this.el);
el.addClass('canfocused');
el.attr('tabindex', this.tabindex.toString());
el.on('keydown', _.bind(this.onKeyDown, this));
}
},
focus: function(index) {
var el = this.$el || $(this.el);
el && el.focus();
if (typeof index == 'string') {
if (index == 'first') {
this.selectByIndex(0, true);
} else if (index == 'last') {
if (this._layoutParams === undefined)
this.fillIndexesArray();
this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true);
}
} else if (index !== undefined)
this.selectByIndex(index, true);
},
focusInner: function(e) {
this.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
},
textThemeColors : 'Theme Colors',
textStandartColors : 'Standart Colors'
}, Common.UI.ThemeColorPalette || {}));

View file

@ -455,7 +455,7 @@ define([
if (!options.width) options.width = 'auto';
var template = '<div class="info-box">' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl img-colored <%= iconCls %>"></div><% } %>' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon <%= iconCls %>"></div><% } %>' +
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
'</div>' +

View file

@ -102,7 +102,8 @@ define([
// work handlers
'comment:closeEditing': _.bind(this.closeEditing, this)
'comment:closeEditing': _.bind(this.closeEditing, this),
'comment:sort': _.bind(this.setComparator, this)
},
'Common.Views.ReviewPopover': {
@ -144,10 +145,11 @@ define([
}.bind(this));
},
onLaunch: function () {
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
this.collection = this.getApplication().getCollection('Common.Collections.Comments');
if (this.collection) {
this.collection.comparator = function (collection) { return -collection.get('time'); };
}
this.setComparator();
this.popoverComments = new Common.Collections.Comments();
if (this.popoverComments) {
@ -192,6 +194,7 @@ define([
this.api.asc_registerCallback('asc_onUpdateCommentPosition', _.bind(this.onApiUpdateCommentPosition, this));
this.api.asc_registerCallback('asc_onDocumentPlaceChanged', _.bind(this.onDocumentPlaceChanged, this));
this.api.asc_registerCallback('asc_onDeleteComment', _.bind(this.onDeleteComment, this)); // only for PE, when del or ctrl+x pressed
this.api.asc_registerCallback('asc_onChangeCommentLogicalPosition', _.bind(this.onApiChangeCommentLogicalPosition, this)); // change comments position in document
}
},
@ -204,6 +207,42 @@ define([
},
//
setComparator: function(type) {
if (this.collection) {
var sort = (type !== undefined);
if (type === undefined) {
type = Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc';
}
Common.localStorage.setItem(this.appPrefix + "comments-sort", type);
Common.Utils.InternalSettings.set(this.appPrefix + "comments-sort", type);
if (type=='position-asc' || type=='position-desc') {
var direction = (type=='position-asc') ? 1 : -1;
this.collection.comparator = function (collection) {
return direction * collection.get('position');
};
} else if (type=='author-asc' || type=='author-desc') {
var direction = (type=='author-asc') ? 1 : -1;
this.collection.comparator = function(item1, item2) {
var n1 = item1.get('parsedName').toLowerCase(),
n2 = item2.get('parsedName').toLowerCase();
if (n1==n2) return 0;
return (n1<n2) ? -direction : direction;
};
} else { // date
var direction = (type=='date-asc') ? 1 : -1;
this.collection.comparator = function (collection) {
return direction * collection.get('time');
};
}
sort && this.updateComments(true);
}
},
getComparator: function() {
return Common.Utils.InternalSettings.get(this.appPrefix + "comments-sort") || 'date';
},
onCreateComment: function (panel, commentVal, editMode, hidereply, documentFlag) {
if (this.api && commentVal && commentVal.length > 0) {
var comment = buildCommentData(); // new asc_CCommentData(null);
@ -693,7 +732,7 @@ define([
} else
this.collection.push(comment);
this.updateComments(true);
this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc'); // don't sort by position
if (this.showPopover) {
if (null !== data.asc_getQuoteText()) {
@ -713,7 +752,7 @@ define([
comment.get('groupName') ? this.addCommentToGroupCollection(comment) : this.collection.push(comment);
}
this.updateComments(true);
this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc');
},
onApiRemoveComment: function (id, silentUpdate) {
for (var name in this.groupCollection) {
@ -776,9 +815,11 @@ define([
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
var user = this.userCollection.findOriginalUser(data.asc_getUserId());
var needSort = (this.getComparator() == 'author-asc' || this.getComparator() == 'author-desc') && (data.asc_getUserName() !== comment.get('username'));
comment.set('comment', data.asc_getText());
comment.set('userid', data.asc_getUserId());
comment.set('username', data.asc_getUserName());
comment.set('parsedName', AscCommon.UserInfoParser.getParsedName(data.asc_getUserName()));
comment.set('usercolor', (user) ? user.get('color') : null);
comment.set('resolved', data.asc_getSolved());
comment.set('quote', data.asc_getQuoteText());
@ -804,6 +845,7 @@ define([
id : Common.UI.getId(),
userid : data.asc_getReply(i).asc_getUserId(),
username : data.asc_getReply(i).asc_getUserName(),
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getReply(i).asc_getUserName()),
usercolor : (user) ? user.get('color') : null,
date : t.dateToLocaleTimeString(dateReply),
reply : data.asc_getReply(i).asc_getText(),
@ -825,7 +867,7 @@ define([
}
if (!silentUpdate) {
this.updateComments(false, true);
this.updateComments(needSort, !needSort);
// if (this.getPopover() && this.getPopover().isVisible()) {
// this._dontScrollToComment = true;
@ -1065,17 +1107,28 @@ define([
}
},
onApiChangeCommentLogicalPosition: function (comments) {
for (var uid in comments) {
if (comments.hasOwnProperty(uid)) {
var comment = this.findComment(uid) || this.findCommentInGroup(uid);
comment && comment.set('position', comments[uid]);
}
}
(this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc') && this.updateComments(true);
},
// internal
updateComments: function (needRender, disableSort, loadText) {
var me = this;
me.updateCommentsTime = new Date();
me.disableSort = !!disableSort;
if (me.timerUpdateComments===undefined)
me.timerUpdateComments = setInterval(function(){
if ((new Date()) - me.updateCommentsTime>100) {
clearInterval(me.timerUpdateComments);
me.timerUpdateComments = undefined;
me.updateCommentsView(needRender, disableSort, loadText);
me.updateCommentsView(needRender, me.disableSort, loadText);
}
}, 25);
},
@ -1089,7 +1142,7 @@ define([
var i, end = true;
if (_.isUndefined(disableSort)) {
if (!disableSort) {
this.collection.sort();
}
@ -1254,6 +1307,7 @@ define([
guid : data.asc_getGuid(),
userid : data.asc_getUserId(),
username : data.asc_getUserName(),
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getUserName()),
usercolor : (user) ? user.get('color') : null,
date : this.dateToLocaleTimeString(date),
quote : data.asc_getQuoteText(),
@ -1300,6 +1354,7 @@ define([
id : Common.UI.getId(),
userid : data.asc_getReply(i).asc_getUserId(),
username : data.asc_getReply(i).asc_getUserName(),
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getReply(i).asc_getUserName()),
usercolor : (user) ? user.get('color') : null,
date : this.dateToLocaleTimeString(date),
reply : data.asc_getReply(i).asc_getText(),
@ -1341,6 +1396,7 @@ define([
date: this.dateToLocaleTimeString(date),
userid: this.currentUserId,
username: AscCommon.UserInfoParser.getCurrentName(),
parsedName: AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName()),
usercolor: (user) ? user.get('color') : null,
editTextInPopover: true,
showReplyInPopover: false,

View file

@ -60,8 +60,10 @@ define([
'btn-save-coauth': 'coauth',
'btn-synch': 'synch' };
var is_win_xp = window.RendererProcessVariable && window.RendererProcessVariable.os === 'winxp';
if ( !!native ) {
native.features = native.features || {};
window.on_native_message = function (cmd, param) {
if (/^style:change/.test(cmd)) {
var obj = JSON.parse(param);
@ -88,7 +90,12 @@ define([
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
} else
if ( obj.lockthemes != undefined ) {
Common.UI.Themes.setAvailable(!obj.lockthemes);
// TODO: remove after 7.0.2. depricated. used is_win_xp variable instead
// Common.UI.Themes.setAvailable(!obj.lockthemes);
}
if ( obj.singlewindow !== undefined ) {
$('#box-document-title .hedset')[obj.singlewindow ? 'hide' : 'show']();
native.features.singlewindow = obj.singlewindow;
}
} else
if (/editor:config/.test(cmd)) {
@ -185,6 +192,7 @@ define([
_.extend(config, opts);
if ( config.isDesktopApp ) {
Common.UI.Themes.setAvailable(!is_win_xp);
Common.NotificationCenter.on('app:ready', function (opts) {
_.extend(config, opts);
!!native && native.execCommand('doc:onready', '');
@ -240,6 +248,10 @@ define([
config.callback_editorconfig();
delete config.callback_editorconfig;
}
if ( native.features.singlewindow !== undefined ) {
$('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
}
});
Common.NotificationCenter.on({
@ -251,6 +263,21 @@ define([
native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
}
});
webapp.addListeners({
'FileMenu': {
'item:click': function (menu, action, isopts) {
if ( action == 'file:exit' ) {
native.execCommand('editor:event', JSON.stringify({action: 'file:close'}));
menu.hide();
} else
if ( action == 'file:open' ) {
native.execCommand('editor:event', JSON.stringify({action: 'file:open'}));
menu.hide();
}
},
},
}, {id: 'desktop'});
}
},
process: function (opts) {
@ -276,9 +303,16 @@ define([
},
requestClose: function () {
if ( config.isDesktopApp && !!native ) {
native.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url}));
native.execCommand('editor:event', JSON.stringify({action:'file:close', url: config.customization.goback.url}));
}
}
},
isActive: function () {
return !!native;
},
isOffline: function () {
// return webapp.getController('Main').api.asc_isOffline();
return webapp.getController('Main').appOptions.isOffline;
},
};
};

View file

@ -100,9 +100,10 @@ define([
this.panelHistory.$el.find('#history-list').css('padding-bottom', hasChanges ? '45px' : 0);
},
onDownloadUrl: function(url) {
if (this.isFromSelectRevision !== undefined)
Common.Gateway.requestRestore(this.isFromSelectRevision, url);
onDownloadUrl: function(url, fileType) {
if (this.isFromSelectRevision !== undefined) {
Common.Gateway.requestRestore(this.isFromSelectRevision, url, fileType);
}
this.isFromSelectRevision = undefined;
},
@ -111,7 +112,7 @@ define([
var btn = $(e.target);
if (btn && btn.hasClass('revision-restore')) {
if (record.get('isRevision'))
Common.Gateway.requestRestore(record.get('revision'));
Common.Gateway.requestRestore(record.get('revision'), undefined, record.get('fileType'));
else {
this.isFromSelectRevision = record.get('revision');
var fileType = Asc.c_oAscFileType[(record.get('fileType') || '').toUpperCase()] || Asc.c_oAscFileType.DOCX;
@ -201,6 +202,7 @@ define([
urlGetTime = new Date();
var diff = (!opts.data.previous || this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
fileType = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.fileType : opts.data.fileType,
docId = opts.data.key ? opts.data.key : this.currentDocId,
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
token = opts.data.token;
@ -216,6 +218,7 @@ define([
rev.set('docIdPrev', docIdPrev, {silent: true});
}
rev.set('token', token, {silent: true});
fileType && rev.set('fileType', fileType, {silent: true});
}
}
var hist = new Asc.asc_CVersionHistory();

View file

@ -63,7 +63,7 @@ define([
var appOptions = me.getApplication().getController('Main').appOptions;
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption};
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, dataHintTitle: 'E'};
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel
@ -203,34 +203,13 @@ define([
arr = [];
storePlugins.each(function(item){
var plugin = new Asc.CPlugin();
plugin.set_Name(item.get('name'));
plugin.set_Guid(item.get('guid'));
plugin.set_BaseUrl(item.get('baseUrl'));
plugin.set_MinVersion && plugin.set_MinVersion(item.get('minVersion'));
plugin.deserialize(item.attributes);
var variations = item.get('variations'),
variationsArr = [];
variations.forEach(function(itemVar){
var variation = new Asc.CPluginVariation();
variation.set_Description(itemVar.get('description'));
variation.set_Url(itemVar.get('url'));
variation.set_Icons(itemVar.get('icons'));
variation.set_Visual(itemVar.get('isVisual'));
variation.set_CustomWindow(itemVar.get('isCustomWindow'));
variation.set_System(itemVar.get('isSystem'));
variation.set_Viewer(itemVar.get('isViewer'));
variation.set_EditorsSupport(itemVar.get('EditorsSupport'));
variation.set_Modal(itemVar.get('isModal'));
variation.set_InsideMode(itemVar.get('isInsideMode'));
variation.set_InitDataType(itemVar.get('initDataType'));
variation.set_InitData(itemVar.get('initData'));
variation.set_UpdateOleOnResize(itemVar.get('isUpdateOleOnResize'));
variation.set_Buttons(itemVar.get('buttons'));
variation.set_Size(itemVar.get('size'));
variation.set_InitOnSelectionChanged(itemVar.get('initOnSelectionChanged'));
variation.set_Events(itemVar.get('events'));
variation.set_Help(itemVar.get('help'));
variation.deserialize(itemVar.attributes);
variationsArr.push(variation);
});

View file

@ -153,7 +153,6 @@ define([
var me = this,
win = new Common.Views.PasswordDialog({
api: me.api,
signType: 'invisible',
handler: function(result, props) {
if (result == 'ok') {
me.api.asc_setCurrentPassword(props);

View file

@ -101,7 +101,7 @@ define([
this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges');
this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null /*new AscCommon.CComparisonPr()*/};
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null, wsLock: false, wsProps: []};
Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this));
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
@ -109,6 +109,7 @@ define([
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
this.userCollection.on('reset', _.bind(this.onUpdateUsers, this));
this.userCollection.on('add', _.bind(this.onUpdateUsers, this));
@ -162,7 +163,7 @@ define([
SetDisabled: function(state) {
if (this.dlgChanges)
this.dlgChanges.close();
this.view && this.view.SetDisabled(state, this.langs);
this.view && this.view.SetDisabled(state, this.langs, {comments: !!this._state.wsProps['Objects']});
this.setPreviewMode(state);
},
@ -209,6 +210,7 @@ define([
this.dlgChanges.btnReject.setDisabled(btnlock);
}
this._state.lock = btnlock;
Common.Utils.InternalSettings.set(this.view.appPrefix + "accept-reject-lock", btnlock);
}
this._state.posx = posX;
this._state.posy = posY;
@ -758,25 +760,26 @@ define([
},
disableEditing: function(disable) {
var app = this.getApplication();
app.getController('Toolbar').DisableToolbar(disable, false, true);
app.getController('DocumentHolder').getView().SetDisabled(disable);
if (this.appConfig.canReview) {
disable && app.getController('RightMenu').getView('RightMenu').clearSelection();
app.getController('RightMenu').SetDisabled(disable, false);
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
}
var comments = app.getController('Common.Controllers.Comments');
if (comments)
comments.setPreviewMode(disable);
var leftMenu = app.getController('LeftMenu');
leftMenu.leftMenu.getMenu('file').getButton('protect').setDisabled(disable);
leftMenu.setPreviewMode(disable);
Common.NotificationCenter.trigger('editing:disable', disable, {
viewMode: false,
reviewMode: true,
fillFormwMode: false,
allowMerge: false,
allowSignature: false,
allowProtect: false,
rightMenu: {clear: true, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: {protect: true},
navigation: {disable: false, previewMode: true},
comments: {disable: false, previewMode: true},
chat: false,
review: false,
viewport: false,
documentHolder: true,
toolbar: true,
plugins: true
}, 'review');
if (this.view) {
this.view.$el.find('.no-group-mask.review').css('opacity', 1);
@ -813,7 +816,9 @@ define([
// Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
// };
var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined;
var trackChanges = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.trackChanges : undefined;
(trackChanges===undefined) && (trackChanges = me.appConfig.customization ? me.appConfig.customization.trackChanges : undefined);
if (config.isReviewOnly || trackChanges!==undefined)
me.api.asc_SetLocalTrackRevisions(config.isReviewOnly || trackChanges===true);
else
@ -821,12 +826,17 @@ define([
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor");
if (val===null)
val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'markup';
if (val===null) {
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : 'markup';
}
me.turnDisplayMode(val); // load display mode for all modes (viewer or editor)
me.view.turnDisplayMode(val);
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.review && me.appConfig.customization.review.showReviewChanges==true ||
(!me.appConfig.customization.review || me.appConfig.customization.review.showReviewChanges===undefined) && me.appConfig.customization.showReviewChanges==true) ) {
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
popoverChanges : me.popoverChanges,
mode : me.appConfig
@ -840,8 +850,11 @@ define([
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
if (config.canViewReview) {
var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "review-mode"));
if (val===null)
val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
if (val===null) {
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
}
me.turnDisplayMode(val);
me.view.turnDisplayMode(val);
}
@ -853,9 +866,10 @@ define([
me.view.turnChat(state);
});
}
me.onChangeProtectSheet();
if (me.view) {
me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true) || !!this._state.wsProps['Objects']);
me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true) || !!this._state.wsProps['Objects']);
}
var val = Common.localStorage.getItem(me.view.appPrefix + "settings-review-hover-mode");
@ -905,6 +919,8 @@ define([
applySettings: function(menu) {
this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
if ((this.appConfig.canReview || this.appConfig.canViewReview) && this.appConfig.reviewHoverMode)
this.onApiShowChange();
},
synchronizeChanges: function() {
@ -995,8 +1011,24 @@ define([
commentsShowHide: function(mode) {
if (!this.view) return;
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value);
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value || !!this._state.wsProps['Objects']);
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value || !!this._state.wsProps['Objects']);
},
onChangeProtectSheet: function(props) {
if (!props) {
var wbprotect = this.getApplication().getController('WBProtection');
props = wbprotect ? wbprotect.getWSProps() : null;
}
this._state.wsProps = props ? props.wsProps : [];
this._state.wsLock = props ? props.wsLock : false;
if (!this.view) return;
var leftmenu = this.getApplication().getController('LeftMenu'),
isCommentsVisible = leftmenu && leftmenu.isCommentsVisible();
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(!isCommentsVisible && !value || !!this._state.wsProps['Objects']);
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(!isCommentsVisible && !value || !!this._state.wsProps['Objects']);
},
textInserted: '<b>Inserted:</b>',

View file

@ -14,21 +14,35 @@ define([
var themes_map = {
'theme-light': {
text: locale.txtThemeLight || 'Light',
type: 'light'
type: 'light',
source: 'static',
},
'theme-classic-light': {
text: locale.txtThemeClassicLight || 'Classic Light',
type: 'light'
type: 'light',
source: 'static',
},
'theme-dark': {
text: locale.txtThemeDark || 'Dark',
type: 'dark'
type: 'dark',
source: 'static',
},
}
if ( !!window.currentLoaderTheme ) {
themes_map[currentLoaderTheme.id] = {};
window.currentLoaderTheme = undefined;
}
var is_dark_mode_allowed = true;
var id_default_light_theme = 'theme-classic-light',
id_default_dark_theme = 'theme-dark';
var name_colors = [
"toolbar-header-document",
"toolbar-header-spreadsheet",
"toolbar-header-presentation",
"background-normal",
"background-toolbar",
"background-toolbar-additional",
@ -38,6 +52,9 @@ define([
"background-notification-badge",
"background-scrim",
"background-loader",
"background-accent-button",
"background-contrast-popover",
"shadow-contrast-popover",
"highlight-button-hover",
"highlight-button-pressed",
@ -47,6 +64,8 @@ define([
"highlight-header-button-pressed",
"highlight-toolbar-tab-underline",
"highlight-text-select",
"highlight-accent-button-hover",
"highlight-accent-button-pressed",
"border-toolbar",
"border-divider",
@ -57,6 +76,7 @@ define([
"border-control-focus",
"border-color-shading",
"border-error",
"border-contrast-popover",
"text-normal",
"text-normal-pressed",
@ -69,6 +89,7 @@ define([
"text-inverse",
"text-toolbar-header",
"text-contrast-background",
"text-alt-key-hint",
"icon-normal",
"icon-normal-pressed",
@ -104,6 +125,8 @@ define([
"canvas-dark-cell-title-border",
"canvas-dark-cell-title-border-hover",
"canvas-dark-cell-title-border-selected",
"canvas-dark-content-background",
"canvas-dark-page-border",
"canvas-scroll-thumb",
"canvas-scroll-thumb-hover",
@ -153,10 +176,13 @@ define([
}
var parse_themes_object = function (obj) {
var curr_lang = Common.Locale.getCurrentLanguage(),
theme_label;
if ( !!obj.themes && obj.themes instanceof Array ) {
obj.themes.forEach(function (item) {
if ( !!item.id ) {
themes_map[item.id] = {text: item.name, type: item.type};
theme_label = !item.l10n || !item.l10n[curr_lang] ? item.name : item.l10n[curr_lang];
themes_map[item.id] = {text: theme_label, type: item.type};
write_theme_css(create_colors_css(item.id, item.colors));
} else
if ( typeof item == 'string' ) {
@ -165,39 +191,50 @@ define([
});
} else
if ( obj.id ) {
themes_map[obj.id] = {text: obj.name, type: obj.type};
theme_label = !obj.l10n || !obj.l10n[curr_lang] ? obj.name : obj.l10n[curr_lang];
themes_map[obj.id] = {text: theme_label, type: obj.type};
write_theme_css( create_colors_css(obj.id, obj.colors) );
}
}
var get_themes_config = function (url) {
fetch(url, {
method: 'get',
headers: {
'Accept': 'application/json',
},
}).then(function(response) {
if (!response.ok) {
throw new Error('server error');
Common.Utils.loadConfig(url,
function ( obj ) {
if ( obj != 'error' ) {
parse_themes_object(obj);
} else {
console.warn('failed to load/parse themes.json');
}
}
return response.json();
}).then(function(response) {
if ( response.then ) {
// return response.json();
} else {
parse_themes_object(response);
/* to break promises chain */
throw new Error('loaded');
}
}).catch(function(e) {
if ( e.message == 'loaded' ) {
} else console.log('fetch error: ' + e);
});
);
// fetch(url, {
// method: 'get',
// headers: {
// 'Accept': 'application/json',
// },
// }).then(function(response) {
// if (!response.ok) {
// throw new Error('server error');
// }
// return response.json();
// }).then(function(response) {
// if ( response.then ) {
// // return response.json();
// } else {
// parse_themes_object(response);
//
// /* to break promises chain */
// throw new Error('loaded');
// }
// }).catch(function(e) {
// if ( e.message == 'loaded' ) {
// } else console.log('fetch error: ' + e);
// });
}
var on_document_ready = function (el) {
// get_themes_config('../../common/main/resources/themes/themes.json')
// get_themes_config('../../common/main/resources/themes/themes.json');
get_themes_config('../../../../themes.json');
}
var get_ui_theme_name = function (objtheme) {
@ -213,13 +250,26 @@ define([
return objtheme;
}
var on_document_open = function (data) {
if ( !!this.api.asc_setContentDarkMode && this.isDarkTheme() ) {
this.api.asc_setContentDarkMode(this.isContentThemeDark());
}
};
return {
init: function (api) {
var me = this;
Common.Gateway.on('opendocument', on_document_open.bind(this));
$(window).on('storage', function (e) {
if ( e.key == 'ui-theme' || e.key == 'ui-theme-id' ) {
me.setTheme(e.originalEvent.newValue, true);
if ( !!e.originalEvent.newValue ) {
me.setTheme(e.originalEvent.newValue, true);
}
} else
if ( e.key == 'content-theme' ) {
me.setContentTheme(e.originalEvent.newValue, true);
console.log('changed content', e.originalEvent.newValue);
}
})
@ -235,11 +285,10 @@ define([
// Common.localStorage.setItem('ui-theme-id', theme_name);
var theme_obj = {
id: theme_name,
type: themes_map[theme_name].type,
type: themes_map[theme_name].type
};
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
}
});
}
@ -297,13 +346,53 @@ define([
return themes_map[this.currentThemeId()].type == 'dark';
},
isContentThemeDark: function () {
return Common.localStorage.getItem("content-theme") == 'dark';
},
setContentTheme: function (mode, force) {
var set_dark = mode == 'dark';
if ( set_dark && !this.isDarkTheme() )
return;
if ( set_dark != this.isContentThemeDark() || force ) {
if ( this.api.asc_setContentDarkMode )
this.api.asc_setContentDarkMode(set_dark);
if ( Common.localStorage.getItem('content-theme') != mode )
Common.localStorage.setItem('content-theme', mode);
Common.NotificationCenter.trigger('contenttheme:dark', set_dark);
}
},
toggleContentTheme: function () {
var is_current_dark = this.isContentThemeDark();
is_current_dark ? Common.localStorage.setItem('content-theme', 'light') : Common.localStorage.setItem('content-theme', 'dark');
if ( this.api.asc_setContentDarkMode )
this.api.asc_setContentDarkMode(!is_current_dark);
Common.NotificationCenter.trigger('contenttheme:dark', !is_current_dark);
},
setTheme: function (obj, force) {
if ( !obj ) return;
var id = get_ui_theme_name(obj);
if ( (this.currentThemeId() != id || force) && !!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);
if ( this.api ) {
if ( this.api.asc_setContentDarkMode && is_dark_mode_allowed )
if ( themes_map[id].type == 'light' ) {
this.api.asc_setContentDarkMode(false);
} else {
this.api.asc_setContentDarkMode(this.isContentThemeDark());
Common.NotificationCenter.trigger('contenttheme:dark', this.isContentThemeDark());
}
var obj = get_current_theme_colors(name_colors);
obj.type = themes_map[id].type;
obj.name = id;
@ -317,6 +406,10 @@ define([
type: obj.type,
};
if ( themes_map[id].source != 'static' ) {
theme_obj.colors = obj;
}
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
}

View file

@ -71,6 +71,14 @@
var key, handler, k, i, modifiersMatch, scope;
key = event.keyCode;
if (Common.UI.HintManager && Common.UI.HintManager.isHintVisible()) {
if (key === 112) {
Common.UI.HintManager.clearHints();
} else if (key !== 27) {
return;
}
}
if (index(_downKeys, key) == -1) {
_downKeys.push(key);
}

View file

@ -57,7 +57,7 @@ function onDropDownKeyDown(e) {
}
}
} else if ($this.hasClass('move-focus')) {
if (!(/^(27|13|9|32)/.test(e.keyCode) && !e.ctrlKey && !e.altKey)) {
if (!((/^(13|9|32)/.test(e.keyCode) || e.keyCode===27 && !$parent.hasClass('open')) && !e.ctrlKey && !e.altKey)) {
patchDropDownKeyDown.call(this, e);
e.preventDefault();
e.stopPropagation();

View file

@ -56,6 +56,7 @@ define([
guid : '',
userid : 0,
username : 'Guest',
parsedName : 'Guest',
usercolor : null,
date : undefined,
quote : '',
@ -65,6 +66,7 @@ define([
lockuserid : '',
unattached : false,
userdata : '',
position : -1,
id : Common.UI.getId(), // internal
time : 0,
@ -88,6 +90,7 @@ define([
time : 0, // acs
userid : 0,
username : 'Guest',
parsedName : 'Guest',
usercolor : null,
reply : '',
date : undefined,

View file

@ -210,6 +210,7 @@
currentPageX;
$scrollbarX.bind('mousedown' + eventClassName, function (e) {
Common.NotificationCenter.trigger('hints:clear');
currentPageX = e.pageX;
currentLeft = $scrollbarX.position().left;
$scrollbarXRail.addClass('in-scrolling');
@ -240,6 +241,7 @@
currentPageY;
$scrollbarY.bind('mousedown' + eventClassName, function (e) {
Common.NotificationCenter.trigger('hints:clear');
currentPageY = e.pageY;
currentTop = $scrollbarY.position().top;
$scrollbarYRail.addClass('in-scrolling');
@ -316,6 +318,7 @@
var shouldPrevent = false;
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
Common.NotificationCenter.trigger('hints:clear');
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;

View file

@ -68,7 +68,8 @@
</div>
<div class="padding-large">
<div class="padding-small" id="id-autocorrect-dialog-chk-quotes"></div>
<div id="id-autocorrect-dialog-chk-hyphens"></div>
<div class="padding-small" id="id-autocorrect-dialog-chk-hyphens"></div>
<div id="id-autocorrect-dialog-chk-hyperlink"></div>
</div>
<div class="padding-small">
<label class="header"><%= scope.textApplyText %></label>

View file

@ -7,8 +7,8 @@
</div>
<div id="chat-options" class="layout-item">
<div id="chat-options-ct">
<textarea id="chat-msg-text" class="user-select textarea-control" maxlength="<%=maxMsgLength%>"></textarea>
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>
<textarea id="chat-msg-text" class="user-select textarea-control" maxlength="<%=maxMsgLength%>" data-hint="1" data-hint-direction="left-top"></textarea>
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%=scope.textSend%></button>
</div>
</div>
</div>

View file

@ -4,7 +4,7 @@
<!-- comment block -->
<div class="user-name">
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(username) %>
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(parsedName) %>
</div>
<div class="user-date"><%=date%></div>
<% if (quote!==null && quote!=='') { %>
@ -31,7 +31,7 @@
<% } %>
<div class="reply-item-ct" <% if (scope.viewmode && index==replys.length-1) { %>style="padding-bottom: 0;" <% } %>;>
<div class="user-name">
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(item.get("parsedName")) %>
</div>
<div class="user-date"><%=item.get("date")%></div>
<% if (!item.get("editText")) { %>

View file

@ -1,13 +1,18 @@
<div id="comments-box" class="layout-ct vbox">
<div class="layout-item messages-ct"></div>
<div class="layout-item add-link-ct">
<label class="btn new"><%=textAddCommentToDoc%></label>
<label id="add-comment-doc" class="btn new" data-hint="1" data-hint-direction="bottom" data-hint-offset="medium"><%=textAddCommentToDoc%></label>
</div>
<div style="display: none;" class="layout-item new-comment-ct">
<div class="inner-ct">
<textarea id="comment-msg-new" class="user-select textarea-control" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>"></textarea>
<textarea id="comment-msg-new" class="user-select textarea-control" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>" data-hint="1" data-hint-direction="left-top"></textarea>
</div>
<button class="btn add normal dlg-btn primary"><%=textAddComment%></button>
<button class="btn cancel normal dlg-btn"><%=textCancel%></button>
<button class="btn add normal dlg-btn primary" data-hint="1" data-hint-direction="bottom" data-hint-offset="big" style="width: auto;min-width: 86px;"><%=textAddComment%></button>
<button class="btn cancel normal dlg-btn" data-hint="1" data-hint-direction="bottom" data-hint-offset="big" style="width: auto;min-width: 86px;"><%=textCancel%></button>
</div>
<div id="comments-header" class="">
<label><%=textComments%></label>
<div id="comments-btn-close" style="float:right;margin-left: 4px;"></div>
<div id="comments-btn-sort" style="float:right;"></div>
</div>
</div>

View file

@ -4,7 +4,7 @@
<!-- comment block -->
<div class="user-name">
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(username) %>
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(parsedName) %>
</div>
<div class="user-date"><%=date%></div>
<% if (!editTextInPopover || hint) { %>
@ -32,7 +32,7 @@
<% } %>
<div class="reply-item-ct">
<div class="user-name">
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(item.get("parsedName")) %>
</div>
<div class="user-date"><%=item.get("date")%></div>
<% if (!item.get("editTextInPopover")) { %>

View file

@ -14,8 +14,8 @@
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% } else if (editable) { %>
<div class="btn-accept img-commonctrl"></div>
<div class="btn-reject img-commonctrl"></div>
<div class="btn-accept"></div>
<div class="btn-reject tool "></div>
<% } %>
<% } %>
</div>

View file

@ -0,0 +1,22 @@
if ( window.AscDesktopEditor ) {
window.desktop = window.AscDesktopEditor;
desktop.features = {};
window.native_message_cmd = [];
window.on_native_message = function (cmd, param) {
if ( /window:features/.test(cmd) ) {
var obj = JSON.parse(param);
if ( obj.singlewindow !== undefined ) {
desktop.features.singlewindow = obj.singlewindow;
}
} else
window.native_message_cmd[cmd] = param;
}
if ( !!window.RendererProcessVariable ) {
desktop.theme = window.RendererProcessVariable.theme;
}
window.desktop.execCommand('webapps:entry', (window.features && JSON.stringify(window.features)) || '');
}

View file

@ -52,6 +52,23 @@ var checkLocalStorage = (function () {
}
})();
if ( window.desktop ) {
var theme = desktop.theme
if ( theme ) {
if ( !theme.id && !!theme.type ) {
if ( theme.type == 'dark' ) theme.id = 'theme-dark'; else
if ( theme.type == 'light' ) theme.id = 'theme-classic-light';
}
if ( theme.id ) {
// params.uitheme = undefined;
localStorage.setItem("ui-theme-id", theme.id);
localStorage.removeItem("ui-theme");
}
}
}
if ( !!params.uitheme && checkLocalStorage && !localStorage.getItem("ui-theme-id") ) {
// const _t = params.uitheme.match(/([\w-]+)/g);
@ -74,3 +91,13 @@ if ( !ui_theme_name ) {
if ( !!ui_theme_name ) {
document.body.classList.add(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) ) {
document.body.classList.add("content-theme-dark");
}
}
}

View file

@ -0,0 +1,28 @@
+function init_themes() {
var objtheme = localStorage.getItem("ui-theme");
if ( typeof(objtheme) == 'string' &&
objtheme.startsWith("{") && objtheme.endsWith("}") )
{
objtheme = JSON.parse(objtheme);
}
var ui_theme_name = objtheme && typeof(objtheme) == 'object' ? objtheme.id :
typeof(objtheme) == 'string' ? objtheme : localStorage.getItem("ui-theme-id");
if ( !!ui_theme_name ) {
if ( !!objtheme && !!objtheme.colors ) {
var colors = [];
for ( var c in objtheme.colors ) {
colors.push('--' + c + ':' + objtheme.colors[c]);
}
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = '.' + ui_theme_name + '{'+ colors.join(';') +';}';
document.getElementsByTagName('head')[0].appendChild(style);
window.currentLoaderTheme = objtheme;
}
}
}();

View file

@ -913,7 +913,7 @@ Common.Utils.lockControls = function(causes, lock, opts, defControls) {
});
};
Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, menu, toggle) {
Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, menu, toggle, dataHint, dataHintDirection, dataHintOffset, dataHintTitle) {
var btnsArr = createButtonSet();
btnsArr.setDisabled(true);
id = id || ("id-toolbar-" + iconCls);
@ -931,7 +931,11 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
menu: menu || false,
enableToggle: toggle || false,
lock: lock,
disabled: true
disabled: true,
dataHint: dataHint,
dataHintDirection: dataHintDirection,
dataHintOffset: dataHintOffset,
dataHintTitle: dataHintTitle
});
btnsArr.add(button);
@ -1068,3 +1072,12 @@ Common.Utils.UserInfoParser = new(function() {
}
}
})();
Common.Utils.getKeyByValue = function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
};

View file

@ -55,6 +55,10 @@ define([
this.txtVersionNum = '{{PRODUCT_VERSION}}';
!(/\s$/.test(this.txtAddress)) && (this.txtAddress += " ");
!(/\s$/.test(this.txtMail)) && (this.txtMail += " ");
!(/\s$/.test(this.txtTel)) && (this.txtTel += " ");
this.template = _.template([
'<table id="id-about-licensor-logo" cols="1" style="width: 100%; margin-top: 20px;">',
'<tr>',
@ -144,7 +148,7 @@ define([
'</tr>',
'<tr>',
'<td colspan="3" align="center">',
'<label class="asc-about-desc"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></label>',
'<a href="<%= publisherurl %>" target="_blank"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></a>',
'</td>',
'</tr>',
'</table>'
@ -195,7 +199,8 @@ define([
if ( !this.rendered ) {
this.licData = data || true;
} else {
if (data && typeof data == 'object' && typeof(data.customer)=='object') {
if (data && typeof data == 'object' && data.customer && typeof(data.customer)=='object') {
this.licData = data;
var customer = data.customer;
$('#id-about-licensor-logo').addClass('hidden');
@ -229,9 +234,11 @@ define([
this.lblCompanyLic.text(value) :
this.lblCompanyLic.parents('tr').addClass('hidden');
(value = customer.logo) && value.length ?
value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark);
value.length ?
this.divCompanyLogo.html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />') :
this.divCompanyLogo.parents('tr').addClass('hidden');
value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this));
} else {
this.cntLicenseeInfo.addClass('hidden');
this.cntLicensorInfo.addClass('margin-bottom');
@ -239,6 +246,15 @@ define([
}
},
changeLogo: function () {
if (!this.licData) return;
var customer = this.licData.customer;
if ( customer.logo && customer.logoDark && customer.logo !== customer.logoDark) {
this.divCompanyLogo.find('img').attr('src', Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark));
}
},
show: function () {
if ( !this.rendered ) this.render();

View file

@ -113,10 +113,11 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
var $window = this.getChild();
var me = this;
var panelAutoFormat = $window.find('#id-autocorrect-dialog-settings-' + (this.appPrefix=='pe-' ? 'de-' : this.appPrefix) + 'autoformat');
// Math correct
this.chReplaceType = new Common.UI.CheckBox({
el: $window.findById('#auto-correct-chb-replace-type'),
el: $window.find('#auto-correct-chb-replace-type'),
labelText: this.textReplaceType,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-math-correct-replace-type")
}).on('change', function(field, newValue, oldValue, eOpts){
@ -197,17 +198,17 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
this.btnReset = new Common.UI.Button({
el: $('#auto-correct-btn-reset')
el: $window.find('#auto-correct-btn-reset')
});
this.btnReset.on('click', _.bind(this.onResetToDefault, this));
this.btnEdit = new Common.UI.Button({
el: $('#auto-correct-btn-edit')
el: $window.find('#auto-correct-btn-edit')
});
this.btnEdit.on('click', _.bind(this.onEdit, this, false));
this.btnDelete = new Common.UI.Button({
el: $('#auto-correct-btn-delete')
el: $window.find('#auto-correct-btn-delete')
});
this.btnDelete.on('click', _.bind(this.onDelete, this, false));
@ -269,23 +270,23 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
});
this.btnResetRec = new Common.UI.Button({
el: $('#auto-correct-btn-rec-reset')
el: $window.find('#auto-correct-btn-rec-reset')
});
this.btnResetRec.on('click', _.bind(this.onResetRecToDefault, this));
this.btnAddRec = new Common.UI.Button({
el: $('#auto-correct-btn-rec-edit')
el: $window.find('#auto-correct-btn-rec-edit')
});
this.btnAddRec.on('click', _.bind(this.onAddRec, this, false));
this.btnDeleteRec = new Common.UI.Button({
el: $('#auto-correct-btn-rec-delete')
el: $window.find('#auto-correct-btn-rec-delete')
});
this.btnDeleteRec.on('click', _.bind(this.onDeleteRec, this, false));
if (this.appPrefix=='de-' || this.appPrefix=='pe-') {
this.chQuotes = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-quotes'),
el: $window.find('#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){
@ -295,7 +296,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.api.asc_SetAutoCorrectSmartQuotes(checked);
});
this.chHyphens = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-hyphens'),
el: $window.find('#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){
@ -305,7 +306,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
});
this.chBulleted = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-bulleted'),
el: $window.find('#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){
@ -315,7 +316,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.api.asc_SetAutomaticBulletedLists(checked);
});
this.chNumbered = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-numbered'),
el: $window.find('#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){
@ -326,7 +327,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
});
// AutoCorrect
this.chFLSentence = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-fl-sentence'),
el: $window.find('#id-autocorrect-dialog-chk-fl-sentence'),
labelText: this.textFLSentence,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-fl-sentence")
}).on('change', function(field, newValue, oldValue, eOpts){
@ -339,7 +340,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
this.btnsCategory[3].on('click', _.bind(this.onAutocorrectCategoryClick, this, false));
} else if (this.appPrefix=='sse-') {
this.chNewRows = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-new-rows'),
el: $window.find('#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){
@ -348,18 +349,17 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
me.api.asc_setIncludeNewRowColTable(checked);
});
this.chHyperlink = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-hyperlink'),
labelText: this.textHyperlink,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyperlink")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyperlink", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyperlink", checked);
me.api.asc_setAutoCorrectHyperlinks(checked);
});
}
this.chHyperlink = new Common.UI.CheckBox({
el: panelAutoFormat.find('#id-autocorrect-dialog-chk-hyperlink'),
labelText: this.textHyperlink,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyperlink")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyperlink", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyperlink", checked);
me.api.asc_SetAutoCorrectHyperlinks(checked);
});
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
@ -381,9 +381,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
var arr = [
this.chReplaceType, this.inputReplace, this.inputBy, this.mathList, this.btnReset, this.btnEdit, this.btnDelete, // 0 tab
this.inputRecFind, this.mathRecList, this.btnResetRec, this.btnAddRec, this.btnDeleteRec, // 1 tab
this.chFLSentence // 3 tab
this.chHyperlink // 2 tab
];
arr = arr.concat(this.chNewRows ? [this.chHyperlink, this.chNewRows] : [this.chQuotes, this.chHyphens, this.chBulleted, this.chNumbered]);
arr = arr.concat(this.chNewRows ? [this.chNewRows] : [this.chQuotes, this.chHyphens, this.chBulleted, this.chNumbered]);
arr = arr.concat(this.chFLSentence ? [this.chFLSentence] : []);
return arr;
},
@ -453,7 +453,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
onAutoformatCategoryClick: function(delay) {
var me = this;
_.delay(function(){
me.chHyperlink ? me.chHyperlink.focus() : me.chQuotes.focus();
(me.appPrefix=='sse-') ? me.chHyperlink.focus() : me.chQuotes.focus();
},delay ? 50 : 0);
},

View file

@ -156,7 +156,7 @@ define([
this._onBtnAddMessage(event);
}
} else
if (event.keyCode == Common.UI.Keys.ESC) {
if (event.keyCode == Common.UI.Keys.ESC && !Common.UI.HintManager.isHintVisible()) {
this.hide();
}
},

View file

@ -293,6 +293,9 @@ define([
Common.UI.BaseView.prototype.initialize.call(this, options);
this.store = this.options.store;
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
},
render: function () {
@ -304,7 +307,8 @@ define([
textAddComment: me.textAddComment,
textCancel: me.textCancel,
textEnterCommentHint: me.textEnterCommentHint,
maxCommLength: Asc.c_oAscMaxCellOrCommentLength
maxCommLength: Asc.c_oAscMaxCellOrCommentLength,
textComments: me.textComments
}));
this.buttonAddCommentToDoc = new Common.UI.Button({
@ -321,9 +325,75 @@ define([
enableToggle: false
});
this.buttonSort = new Common.UI.Button({
parentEl: $('#comments-btn-sort', this.$el),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-sorting',
hint: this.textSort,
menu: new Common.UI.Menu({
menuAlign: 'tr-br',
style: 'min-width: auto;',
items: [
{
caption: this.mniDateDesc,
value: 'date-desc',
checkable: true,
checked: (Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc') === 'date-desc',
toggleGroup: 'sortcomments'
},
{
caption: this.mniDateAsc,
value: 'date-asc',
checkable: true,
checked: (Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc') === 'date-asc',
toggleGroup: 'sortcomments'
},
{
caption: this.mniAuthorAsc,
value: 'author-asc',
checkable: true,
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'author-asc',
toggleGroup: 'sortcomments'
},
{
caption: this.mniAuthorDesc,
value: 'author-desc',
checkable: true,
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'author-desc',
toggleGroup: 'sortcomments'
},
{
caption: this.mniPositionAsc,
value: 'position-asc',
checkable: true,
visible: this.appPrefix==='de-',
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-asc',
toggleGroup: 'sortcomments'
},
{
caption: this.mniPositionDesc,
value: 'position-desc',
checkable: true,
visible: this.appPrefix==='de-',
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-desc',
toggleGroup: 'sortcomments'
}
]
})
});
this.buttonClose = new Common.UI.Button({
parentEl: $('#comments-btn-close', this.$el),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-close',
hint: this.textClosePanel
});
this.buttonAddCommentToDoc.on('click', _.bind(this.onClickShowBoxDocumentComment, this));
this.buttonAdd.on('click', _.bind(this.onClickAddDocumentComment, this));
this.buttonCancel.on('click', _.bind(this.onClickCancelDocumentComment, this));
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
this.buttonSort.menu.on('item:toggle', _.bind(this.onSortClick, this));
this.txtComment = $('#comment-msg-new', this.el);
this.txtComment.keydown(function (event) {
@ -658,6 +728,9 @@ define([
getUserName: function (username) {
return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
},
getEncodedName: function (username) {
return Common.Utils.String.htmlEncode(username);
},
pickLink: function (message) {
var arr = [], offset, len;
@ -730,6 +803,14 @@ define([
});
},
onSortClick: function(menu, item, state) {
state && this.fireEvent('comment:sort', [item.value]);
},
onClickClosePanel: function() {
Common.NotificationCenter.trigger('leftmenu:change', 'hide');
},
textComments : 'Comments',
textAnonym : 'Guest',
textAddCommentToDoc : 'Add Comment to Document',
@ -744,6 +825,14 @@ define([
textEdit : 'Edit',
textAdd : "Add",
textOpenAgain : "Open Again",
textHintAddComment : 'Add Comment'
textHintAddComment : 'Add Comment',
textSort: 'Sort comments',
mniPositionAsc: 'From top',
mniPositionDesc: 'From bottom',
mniAuthorAsc: 'Author A to Z',
mniAuthorDesc: 'Author Z to A',
mniDateDesc: 'Newest',
mniDateAsc: 'Oldest',
textClosePanel: 'Close comments'
}, Common.Views.Comments || {}))
});

View file

@ -126,7 +126,7 @@ define([
},
textTitle : 'Copy, Cut and Paste Actions',
textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:',
textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>To copy or paste to or from applications outside the editor tab use the following keyboard combinations:',
textToCopy : 'for Copy',
textToPaste : 'for Paste',
textToCut: 'for Cut',

View file

@ -62,8 +62,8 @@ define([
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer" style="text-align: center;">',
'<button id="id-btn-diagram-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
'<button id="id-btn-diagram-editor-cancel" class="btn normal dlg-btn" result="cancel">' + this.textClose + '</button>',
'<button id="id-btn-diagram-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
'<button id="id-btn-diagram-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
'</div>'
].join('');

View file

@ -85,7 +85,7 @@ define([
'<div class="hedset">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users">' +
'<div class="btn-users" data-hint="0" data-hint-direction="bottom" data-hint-offset="big">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'<label class="caption">&plus;</label>' +
'</div>' +
@ -97,6 +97,7 @@ define([
'</section>'+
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-mode"></div>' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-favorite"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
@ -386,6 +387,9 @@ define([
}
}
function onContentThemeChangedToDark(isdark) {
}
return {
options: {
branding: {},
@ -415,7 +419,10 @@ define([
id: 'btn-goback',
cls: 'btn-header',
iconCls: 'toolbar__icon icon--inverse btn-goback',
split: true
split: true,
dataHint: '0',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
storeUsers = this.options.storeUsers;
@ -428,7 +435,10 @@ define([
me.btnOptions = new Common.UI.Button({
cls: 'btn-header no-caret',
iconCls: 'toolbar__icon icon--inverse btn-ic-options',
menu: true
menu: true,
dataHint: '0',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
me.mnuZoom = {options: {value: 100}};
@ -436,7 +446,10 @@ define([
me.btnFavorite = new Common.UI.Button({
id: 'btn-favorite',
cls: 'btn-header',
iconCls: 'toolbar__icon icon--inverse btn-favorite'
iconCls: 'toolbar__icon icon--inverse btn-favorite',
dataHint: '0',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
Common.NotificationCenter.on({
@ -444,6 +457,8 @@ define([
'app:face': function(mode) {Common.Utils.asyncCall(onAppShowed, me, mode);}
});
Common.NotificationCenter.on('collaboration:sharingdeny', onLostEditRights);
Common.NotificationCenter.on('contenttheme:dark', onContentThemeChangedToDark.bind(this));
Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this));
},
render: function (el, role) {
@ -455,11 +470,15 @@ define([
getPanel: function (role, config) {
var me = this;
function createTitleButton(iconid, slot, disabled) {
function createTitleButton(iconid, slot, disabled, hintDirection, hintOffset, hintTitle) {
return (new Common.UI.Button({
cls: 'btn-header',
iconCls: iconid,
disabled: disabled === true
disabled: disabled === true,
dataHint:'0',
dataHintDirection: hintDirection ? hintDirection : (config.isDesktopApp ? 'right' : 'left'),
dataHintOffset: hintOffset ? hintOffset : (config.isDesktopApp ? '10, -10' : '10, 10'),
dataHintTitle: hintTitle
})).render(slot);
}
@ -467,8 +486,9 @@ define([
$html = $(templateLeftBox);
this.logo = $html.find('#header-logo');
if (this.branding && this.branding.logo && this.branding.logo.image && this.logo) {
this.logo.html('<img src="' + this.branding.logo.image + '" style="max-width:100px; max-height:20px; margin: 0;"/>');
if (this.branding && this.branding.logo && (this.branding.logo.image || this.branding.logo.imageDark) && this.logo) {
var image = Common.UI.Themes.isDarkTheme() ? (this.branding.logo.imageDark || this.branding.logo.image) : (this.branding.logo.image || this.branding.logo.imageDark);
this.logo.html('<img src="' + image + '" style="max-width:100px; max-height:20px; margin: 0;"/>');
this.logo.css({'background-image': 'none', width: 'auto'});
(this.branding.logo.url || this.branding.logo.url===undefined) && this.logo.addClass('link');
}
@ -510,19 +530,19 @@ define([
if ( !config.isEdit ) {
if ( (config.canDownload || config.canDownloadOrigin) && !config.isOffline )
this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'));
this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'), undefined, 'bottom', 'big');
if ( config.canPrint )
this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'));
this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'), undefined, 'bottom', 'big', 'P');
if ( config.canEdit && config.canRequestEditRights )
this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'));
this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'), undefined, 'bottom', 'big');
}
me.btnOptions.render($html.find('#slot-btn-options'));
if (!config.isEdit || config.customization && !!config.customization.compactHeader) {
if (config.user.guest && config.canRenameAnonymous)
me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'));
me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'), undefined, 'bottom', 'big' );
else {
me.elUserName = $html.find('.btn-current-user');
me.elUserName.removeClass('hidden');
@ -535,7 +555,6 @@ define([
$btnUsers = $html.find('.btn-users');
$panelUsers.hide();
return $html;
} else
if ( role == 'title' ) {
@ -549,12 +568,12 @@ define([
me.setUserName(me.options.userName);
if ( config.canPrint && config.isEdit ) {
me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true);
me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true, undefined, undefined, 'P');
}
me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true);
me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true);
me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true);
me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true, undefined, undefined, 'S');
me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true, undefined, undefined, 'Z');
me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true, undefined, undefined, 'Y');
if ( me.btnSave.$icon.is('svg') ) {
me.btnSave.$icon.addClass('icon-save btn-save');
@ -585,10 +604,11 @@ define([
this.branding = value;
if ( value ) {
if ( value.logo && value.logo.image ) {
if ( value.logo &&(value.logo.image || value.logo.imageDark)) {
var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image) : (value.logo.image || value.logo.imageDark);
element = $('#header-logo');
if (element) {
element.html('<img src="' + value.logo.image + '" style="max-width:100px; max-height:20px; margin: 0;"/>');
element.html('<img src="' + image + '" style="max-width:100px; max-height:20px; margin: 0;"/>');
element.css({'background-image': 'none', width: 'auto'});
(value.logo.url || value.logo.url===undefined) && element.addClass('link');
}
@ -596,6 +616,14 @@ define([
}
},
changeLogo: function () {
var value = this.branding;
if ( value && value.logo && value.logo.image && value.logo.imageDark && (value.logo.image !== value.logo.imageDark)) { // change logo when image and imageDark are different
var image = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image) : (value.logo.image || value.logo.imageDark);
$('#header-logo img').attr('src', image);
}
},
setDocumentCaption: function(value) {
!value && (value = '');
@ -694,7 +722,7 @@ define([
this.btnUserName.updateHint(name);
} else if (this.elUserName) {
this.elUserName.tooltip({
title: name,
title: Common.Utils.String.htmlEncode(name),
placement: 'cursor',
html: true
});
@ -716,7 +744,7 @@ define([
if ( alias == 'users' ) {
if ( lock )
$btnUsers.addClass('disabled').attr('disabled', 'disabled'); else
$btnUsers.removeClass('disabled').attr('disabled', '');
$btnUsers.removeClass('disabled').removeAttr('disabled');
} else if ( alias == 'rename-user' ) {
if (me.labelUserName) {
if ( lock ) {
@ -776,7 +804,7 @@ define([
tipUndo: 'Undo',
tipRedo: 'Redo',
textCompactView: 'Hide Toolbar',
textHideStatusBar: 'Hide Status Bar',
textHideStatusBar: 'Combine sheet and status bars',
textHideLines: 'Hide Rulers',
textZoom: 'Zoom',
textAdvSettings: 'Advanced Settings',

View file

@ -86,7 +86,7 @@ define([
'<div class="user-version">' + this.textVer + '<%=version%></div>',
'<% } %>',
'<% if (isRevision && hasChanges) { %>',
'<div class="revision-expand img-commonctrl ' + '<% if (isExpanded) { %>' + 'up' + '<% } %>' + '"></div>',
'<div class="revision-expand ' + '<% if (isExpanded) { %>' + 'up' + '<% } %>' + '"></div>',
'<% } %>',
'<div class="user-name">',
'<div class="color" style="display: inline-block; background-color:' + '<%=usercolor%>;' + '" >',

View file

@ -292,7 +292,9 @@ define([
parentEl: $window.find('#id-dlg-list-color'),
style: "width:45px;",
additionalAlign: this.menuAddAlign,
color: this.color
color: this.color,
cls: 'move-focus',
takeFocusOnClose: true
});
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
this.colors = this.btnColor.getPicker();
@ -321,7 +323,7 @@ define([
},
getFocusedComponents: function() {
return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart];
return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart, this.btnColor];
},
afterRender: function() {

View file

@ -91,13 +91,15 @@ define([
}, options);
this.txtOpenFile = options.txtOpenFile || this.txtOpenFile;
this.template = options.template || [
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
'<div class="content-panel" >',
'<% if (type == Common.Utils.importTextType.DRM) { %>',
'<% if (warning) { %>',
'<div>',
'<div class="icon img-commonctrl warn"></div>',
'<div class="icon warn"></div>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + (typeof _options.warningMsg=='string' ? _options.warningMsg : t.txtProtected) + '</div>',
'<label class="header" style="margin-top: 15px;">' + t.txtPassword + '</label>',
'<div id="id-password-txt" style="width: 290px;"></div></div>',
@ -200,20 +202,12 @@ define([
if (this.type == Common.Utils.importTextType.DRM) {
this.inputPwd = new Common.UI.InputField({
el: $('#id-password-txt'),
type: 'text',
type: 'password',
validateOnBlur: false,
validation : function(value) {
return me.txtIncorrectPwd;
}
});
this.$window.find('input').on('input', function(){
if ($(this).val() !== '') {
($(this).attr('type') !== 'password') && $(this).attr('type', 'password');
} else {
$(this).attr('type', 'text');
}
});
} else {
this.initCodePages();
if (this.preview) {

View file

@ -64,13 +64,15 @@ define([
}, options);
this.handler = options.handler;
this.template = options.template || [
'<div class="box">',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label>' + t.txtDescription + '</label>',
'</div>',
'<div class="input-row">',
'<label>' + t.txtPassword + '</label>',
'<label>' + t.txtPassword + (t.passwordOptional ? ' (' + t.txtOptional + ')': '') + '</label>',
'</div>',
'<div id="id-password-txt" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row">',
@ -81,9 +83,6 @@ define([
'</div>'
].join('');
this.handler = options.handler;
this.settings = options.settings;
_options.tpl = _.template(this.template)(_options);
Common.UI.Window.prototype.initialize.call(this, _options);

View file

@ -62,7 +62,7 @@ define([
'<div id="current-plugin-box" class="layout-ct vbox hidden">',
'<div id="current-plugin-header">',
'<label></label>',
'<div id="id-plugin-close" class="plugin-close img-commonctrl"></div>',
'<div id="id-plugin-close" class="tool close"></div>',
'</div>',
'<div id="current-plugin-frame" class="">',
'</div>',
@ -159,7 +159,10 @@ define([
menu: modes && modes.length > 1,
split: modes && modes.length > 1,
value: guid,
hint: model.get('name')
hint: model.get('name'),
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
@ -386,7 +389,10 @@ define([
menu: _menu_items.length > 1,
split: _menu_items.length > 1,
value: guid,
hint: model.get('name')
hint: model.get('name'),
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
if ( btn.split ) {

View file

@ -121,7 +121,10 @@ define([
this.btnAddPwd = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-protect',
caption: this.txtEncrypt
caption: this.txtEncrypt,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnsAddPwd.push(this.btnAddPwd);
@ -130,7 +133,10 @@ define([
iconCls: 'toolbar__icon btn-ic-protect',
caption: this.txtEncrypt,
menu: true,
visible: false
visible: false,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
if (this.appConfig.isSignatureSupport) {
@ -138,7 +144,10 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-signature',
caption: this.txtSignature,
menu: (this.appPrefix !== 'pe-')
menu: (this.appPrefix !== 'pe-'),
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
if (!this.btnSignature.menu)
this.btnsInvisibleSignature.push(this.btnSignature);
@ -228,7 +237,10 @@ define([
cls: 'btn-text-default',
style: 'width: 100%;',
caption: this.txtInvisibleSignature,
disabled: this._state.invisibleSignDisabled
disabled: this._state.invisibleSignDisabled,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'medium'
});
this.btnsInvisibleSignature.push(button);
if (this._isSetEvents) {
@ -243,7 +255,10 @@ define([
style: 'width: 100%;',
caption: this.txtAddPwd,
disabled: this._state.disabled || this._state.disabledPassword,
visible: !this._state.hasPassword
visible: !this._state.hasPassword,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'medium'
});
this.btnsAddPwd.push(button);
if (this._isSetEvents) {
@ -258,7 +273,10 @@ define([
style: 'width: 100%;',
caption: this.txtDeletePwd,
disabled: this._state.disabled || this._state.disabledPassword,
visible: this._state.hasPassword
visible: this._state.hasPassword,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'medium'
});
this.btnsDelPwd.push(button);
if (this._isSetEvents) {
@ -273,7 +291,10 @@ define([
style: 'width: 100%;',
caption: this.txtChangePwd,
disabled: this._state.disabled || this._state.disabledPassword,
visible: this._state.hasPassword
visible: this._state.hasPassword,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'medium'
});
this.btnsChangePwd.push(button);
if (this._isSetEvents) {

View file

@ -237,14 +237,20 @@ define([
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtAccept,
split: !this.appConfig.canUseReviewPermissions,
iconCls: 'toolbar__icon btn-review-save'
iconCls: 'toolbar__icon btn-review-save',
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnReject = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtReject,
split: !this.appConfig.canUseReviewPermissions,
iconCls: 'toolbar__icon btn-review-deny'
iconCls: 'toolbar__icon btn-review-deny',
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
if (this.appConfig.canFeatureComparison)
@ -252,7 +258,10 @@ define([
cls : 'btn-toolbar x-huge icon-top',
caption : this.txtCompare,
split : true,
iconCls: 'toolbar__icon btn-compare'
iconCls: 'toolbar__icon btn-compare',
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnTurnOn = new Common.UI.Button({
@ -260,7 +269,10 @@ define([
iconCls: 'toolbar__icon btn-ic-review',
caption: this.txtTurnon,
split: !this.appConfig.isReviewOnly,
enableToggle: true
enableToggle: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnsTurnReview = [this.btnTurnOn];
}
@ -268,13 +280,19 @@ define([
this.btnPrev = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-review-prev',
caption: this.txtPrev
caption: this.txtPrev,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnNext = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-review-next',
caption: this.txtNext
caption: this.txtNext,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
if (!this.appConfig.isRestrictedEdit && !(this.appConfig.customization && this.appConfig.customization.review && this.appConfig.customization.review.hideReviewDisplay)) {// hide Display mode option for fillForms and commenting mode
@ -296,7 +314,7 @@ define([
checked: true,
value: 'markup',
template: menuTemplate,
description: this.txtMarkup
description: Common.Utils.String.format(this.txtMarkup, !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit ? '' : '(' + this.txtEditing + ')')
},
{
caption: this.txtMarkupSimpleCap,
@ -305,7 +323,7 @@ define([
checked: false,
value: 'simple',
template: menuTemplate,
description: this.txtMarkupSimple
description: Common.Utils.String.format(this.txtMarkupSimple, !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit ? '' : '(' + this.txtEditing + ')')
},
{
caption: this.txtFinalCap,
@ -313,7 +331,7 @@ define([
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: this.txtFinal,
description: Common.Utils.String.format(this.txtFinal, !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit ? '' : '(' + this.txtPreview + ')'),
value: 'final'
},
{
@ -322,11 +340,14 @@ define([
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: this.txtOriginal,
description: Common.Utils.String.format(this.txtOriginal, !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit ? '' : '(' + this.txtPreview + ')'),
value: 'original'
}
]
})
}),
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
}
@ -335,7 +356,10 @@ define([
this.btnSharing = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-sharing',
caption: this.txtSharing
caption: this.txtSharing,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
@ -344,7 +368,10 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-coedit',
caption: this.txtCoAuthMode,
menu: true
menu: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
@ -355,7 +382,10 @@ define([
this.btnHistory = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-history',
caption: this.txtHistory
caption: this.txtHistory,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
@ -364,7 +394,10 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-chat',
caption: this.txtChat,
enableToggle: true
enableToggle: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
@ -373,13 +406,19 @@ define([
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtCommentRemove,
split: true,
iconCls: 'toolbar__icon btn-rem-comment'
iconCls: 'toolbar__icon btn-rem-comment',
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.btnCommentResolve = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtCommentResolve,
split: true,
iconCls: 'toolbar__icon btn-resolve-all'
iconCls: 'toolbar__icon btn-resolve-all',
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
}
@ -485,8 +524,8 @@ define([
me.btnCompare.updateHint(me.tipCompare);
}
me.btnAccept.setDisabled(config.isReviewOnly);
me.btnReject.setDisabled(config.isReviewOnly);
config.isReviewOnly && me.btnAccept.setDisabled(true);
config.isReviewOnly && me.btnReject.setDisabled(true);
}
if (me.appConfig.canViewReview) {
me.btnPrev.updateHint(me.hintPrev);
@ -678,7 +717,10 @@ define([
checkable: true,
toggleGroup: 'menuTurnReviewStb'
}
]})
]}),
dataHint: '0',
dataHintDirection: 'top',
dataHintOffset: '2, -16'
});
this.btnsTurnReview.push(button);
@ -691,7 +733,10 @@ define([
iconCls: 'toolbar__icon btn-ic-docspell',
hintAnchor : 'top',
hint: this.tipSetSpelling,
enableToggle: true
enableToggle: true,
dataHint: '0',
dataHintDirection: 'top',
dataHintOffset: 'small'
});
this.btnsSpelling.push(button);
@ -702,7 +747,10 @@ define([
iconCls: 'toolbar__icon btn-ic-doclang',
hintAnchor : 'top',
hint: this.tipSetDocLang,
disabled: true
disabled: true,
dataHint: '0',
dataHintDirection: 'top',
dataHintOffset: 'small'
});
this.btnsDocLang.push(button);
@ -765,7 +813,7 @@ define([
}
},
SetDisabled: function (state, langs) {
SetDisabled: function (state, langs, protectProps) {
this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
if ( button ) {
button.setDisabled(state);
@ -783,8 +831,8 @@ define([
}, this);
// this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
this.btnCommentResolve && this.btnCommentResolve.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment") || protectProps && protectProps.comments);
this.btnCommentResolve && this.btnCommentResolve.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment") || protectProps && protectProps.comments);
},
onLostEditRights: function() {
@ -814,9 +862,9 @@ define([
txtAcceptChanges: 'Accept Changes',
txtRejectChanges: 'Reject Changes',
txtView: 'Display Mode',
txtMarkup: 'Text with changes (Editing)',
txtFinal: 'All changes like accept (Preview)',
txtOriginal: 'Text without changes (Preview)',
txtMarkup: 'Text with changes {0}',
txtFinal: 'All changes like accept {0}',
txtOriginal: 'Text without changes {0}',
tipReviewView: 'Select the way you want the changes to be displayed',
tipAcceptCurrent: 'Accept current changes',
tipRejectCurrent: 'Reject current changes',
@ -862,7 +910,9 @@ define([
textWarnTrackChanges: 'Track Changes will be switched ON for all users with full access. The next time anyone opens the doc, Track Changes will remain enabled.',
textEnable: 'Enable',
txtMarkupSimpleCap: 'Simple Markup',
txtMarkupSimple: 'All changes (Editing)<br>Turn off balloons'
txtMarkupSimple: 'All changes {0}<br>Turn off balloons',
txtEditing: 'Editing',
txtPreview: 'Preview'
}
}()), Common.Views.ReviewChanges || {}));
@ -896,6 +946,9 @@ define([
this.popoverChanges = this.options.popoverChanges;
this.mode = this.options.mode;
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -922,7 +975,7 @@ define([
cls : 'btn-toolbar',
caption : this.txtAccept,
split : true,
disabled : this.mode.isReviewOnly,
disabled : this.mode.isReviewOnly || !!Common.Utils.InternalSettings.get(this.appPrefix + "accept-reject-lock"),
menu : this.mode.canUseReviewPermissions ? false : new Common.UI.Menu({
items: [
this.mnuAcceptCurrent = new Common.UI.MenuItem({
@ -942,7 +995,7 @@ define([
cls : 'btn-toolbar',
caption : this.txtReject,
split : true,
disabled : this.mode.isReviewOnly,
disabled : this.mode.isReviewOnly || !!Common.Utils.InternalSettings.get(this.appPrefix + "accept-reject-lock"),
menu : this.mode.canUseReviewPermissions ? false : new Common.UI.Menu({
items: [
this.mnuRejectCurrent = new Common.UI.MenuItem({

View file

@ -210,7 +210,7 @@ define([
parentView.autoScrollToEditButtons();
}
if (textBox && textBox.length) {
if (textBox && textBox.length && parentView.scroller) {
domTextBox = textBox.get(0);
if (domTextBox) {
@ -237,7 +237,6 @@ define([
} else {
this.commentsView = new CommentsPopoverDataView({
el: $('#id-comments-popover'),
store: me.commentsStore,
itemTemplate: _.template(replaceWords(commentsTemplate, {
textAddReply: me.textAddReply,
textAdd: me.textAdd,
@ -269,6 +268,16 @@ define([
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-edit');
btns.tooltip({title: me.txtEditTip, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-delete');
btns.tooltip({title: me.txtDeleteTip, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
view.tipsArray = arr;
this.autoHeightTextBox();
};
@ -286,6 +295,9 @@ define([
this.commentsView.on('item:change', addtooltip);
this.commentsView.cmpEl.on('mouseover', onCommentsViewMouseOver).on('mouseout', onCommentsViewMouseOut);
this.commentsView.setStore(me.commentsStore);
this.commentsView.onResetItems();
this.commentsView.on('item:click', function (picker, item, record, e) {
var btn, showEditBox, showReplyBox, commentId, replyId, hideAddReply;
@ -307,6 +319,9 @@ define([
}
if (btn.hasClass('btn-edit')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
if (!_.isUndefined(replyId)) {
me.fireEvent('comment:closeEditing', [commentId]);
me.fireEvent('comment:editReply', [commentId, replyId, true]);
@ -347,6 +362,9 @@ define([
}
}
} else if (btn.hasClass('btn-delete')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
if (!_.isUndefined(replyId)) {
me.fireEvent('comment:removeReply', [commentId, replyId]);
@ -518,7 +536,6 @@ define([
} else {
this.reviewChangesView = new ReviewPopoverDataView({
el: $('#id-review-popover'),
store: me.reviewStore,
itemTemplate: _.template(reviewTemplate)
});
@ -535,6 +552,16 @@ define([
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-accept');
btns.tooltip({title: me.txtAccept, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-reject');
btns.tooltip({title: me.txtReject, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
view.tipsArray = arr;
};
@ -546,8 +573,14 @@ define([
var btn = $(e.target);
if (btn) {
if (btn.hasClass('btn-accept')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
me.fireEvent('reviewchange:accept', [record.get('changedata')]);
} else if (btn.hasClass('btn-reject')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
me.fireEvent('reviewchange:reject', [record.get('changedata')]);
} else if (btn.hasClass('btn-delete')) {
me.fireEvent('reviewchange:delete', [record.get('changedata')]);
@ -559,6 +592,9 @@ define([
}
}
});
this.reviewChangesView.setStore(me.reviewStore);
this.reviewChangesView.onResetItems();
}
}
@ -738,7 +774,8 @@ define([
leftPos = Math.min(sdkBoundsLeft + posX + this.arrow.width, sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25);
leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth + this.arrow.width, leftPos);
arrowView.removeClass('right').addClass('left');
arrowView.removeClass('right top bottom').addClass('left');
arrowView.css({left: ''});
if (!_.isUndefined(leftX)) {
windowWidth = this.$window.outerWidth();
@ -805,6 +842,7 @@ define([
sdkPanelTop = '',
sdkPanelHeight = 0,
arrowPosY = 0,
arrowPosX = 0,
windowHeight = 0,
outerHeight = 0,
topPos = 0,
@ -842,8 +880,10 @@ define([
var movePos = this.isOverCursor();
if (movePos) {
var newTopDown = movePos[1] + sdkPanelHeight,// try move down
newTopUp = movePos[0] + sdkPanelHeight; // try move up
var leftPos = parseInt(this.$window.css('left')) - this.arrow.width,
newTopDown = movePos[1][1] + sdkPanelHeight + this.arrow.width,// try move down
newTopUp = movePos[0][1] + sdkPanelHeight - this.arrow.width, // try move up
isMoveDown = false;
if (newTopDown + outerHeight>sdkBoundsTop + sdkBoundsHeight) {
var diffDown = sdkBoundsTop + sdkBoundsHeight - newTopDown;
if (newTopUp - outerHeight<sdkBoundsTop) {
@ -859,14 +899,24 @@ define([
maxHeight: diffDown + 'px',
top: newTopDown + 'px'
});
isMoveDown = true;
commentsView.css({height: diffDown - 3 + 'px'});
}
} else
this.$window.css('top', newTopUp - outerHeight + 'px'); // move up
} else
} else {
isMoveDown = true;
this.$window.css('top', newTopDown + 'px'); // move down
arrowView.addClass('hidden');
}
leftPos -= this.arrow.height;
this.$window.css('left', leftPos + 'px');
arrowPosX = movePos[isMoveDown ? 1 : 0][0];
arrowPosX = Math.max(0, arrowPosX - leftPos - this.arrow.height/2);
arrowPosX = Math.min(arrowPosX, this.$window.outerWidth() - this.arrow.height);
arrowView.css({top: '', left: arrowPosX + 'px'});
arrowView.toggleClass('top', isMoveDown);
arrowView.toggleClass('bottom', !isMoveDown);
arrowView.removeClass('left right');
} else if (sdkBoundsHeight <= outerHeight) {
this.$window.css({
maxHeight: sdkBoundsHeight - sdkPanelHeight + 'px',
@ -878,8 +928,9 @@ define([
// arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - sdkPanelHeight - this.arrow.width);
arrowPosY = Math.min(arrowPosY, sdkBoundsHeight - (sdkPanelHeight + this.arrow.margin + this.arrow.height));
arrowView.css({top: arrowPosY + 'px'});
arrowView.removeClass('hidden');
arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
this.scroller.scrollTop(scrollPos);
} else {
@ -897,8 +948,9 @@ define([
arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - (sdkBoundsHeight - outerHeight) - this.arrow.height);
arrowPosY = Math.min(arrowPosY, outerHeight - this.arrow.margin - this.arrow.height);
arrowView.css({top: arrowPosY + 'px'});
arrowView.removeClass('hidden');
arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
}
}
}
@ -915,15 +967,22 @@ define([
if (!this.api.asc_GetSelectionBounds) return;
var p = this.api.asc_GetSelectionBounds(),
isCursor = Math.abs(p[0][0] - p[1][0])<0.1 && Math.abs(p[0][1] - p[1][1])<0.1 && Math.abs(p[2][0] - p[3][0])<0.1 && Math.abs(p[2][1] - p[3][1])<0.1;
var x0 = p[0][0], y0 = p[0][1],
x1 = p[isCursor ? 2 : 1][0], y1 = p[isCursor ? 2 : 1][1];
var leftPos = parseInt(this.$window.css('left'))-25,
windowWidth = this.$window.outerWidth();
if (x0>leftPos && x0<leftPos+windowWidth || x1>leftPos && x1<leftPos+windowWidth) {
var newTopDown = Math.max(y0, y1),// try move down
newTopUp = Math.min(y0, y1); // try move up
return [newTopUp, newTopDown];
isCursor = Math.abs(p[0][0] - p[1][0])<0.1 && Math.abs(p[0][1] - p[1][1])<0.1 && Math.abs(p[2][0] - p[3][0])<0.1 && Math.abs(p[2][1] - p[3][1])<0.1,
sdkPanelLeft = $('#id_panel_left'),
sdkPanelLeftWidth = 0;
if (sdkPanelLeft.length)
sdkPanelLeftWidth = (sdkPanelLeft.css('display') !== 'none') ? sdkPanelLeft.width() : 0;
var x0 = p[0][0] + sdkPanelLeftWidth, y0 = p[0][1],
x1 = p[isCursor ? 2 : 1][0] + sdkPanelLeftWidth, y1 = p[isCursor ? 2 : 1][1];
var leftPos = parseInt(this.$window.css('left')) - this.arrow.width,
windowWidth = this.$window.outerWidth() + this.arrow.width,
topPos = parseInt(this.$window.css('top')),
windowHeight = this.$window.outerHeight();
if (x0>leftPos && x0<leftPos+windowWidth && y0>topPos && y0<topPos+windowHeight ||
x1>leftPos && x1<leftPos+windowWidth && y1>topPos && y1<topPos+windowHeight) {
var newDown = (y0>y1) ? [x0, y0] : [x1, y1],// try move down
newUp = (y0<y1) ? [x0, y0] : [x1, y1]; // try move up
return [newUp, newDown];
}
},
@ -1226,6 +1285,10 @@ define([
textOpenAgain : "Open Again",
textFollowMove : 'Follow Move',
textMention : '+mention will provide access to the document and send an email',
textMentionNotify : '+mention will notify the user via email'
textMentionNotify : '+mention will notify the user via email',
txtAccept: 'Accept',
txtReject: 'Reject',
txtEditTip: 'Edit',
txtDeleteTip: 'Delete'
}, Common.Views.ReviewPopover || {}))
});

View file

@ -0,0 +1,4 @@
{
"en": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
"ru": ["а", "б", "в", "г", "д", "е", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "э", "ю", "я"]
}

View file

@ -0,0 +1,6 @@
{
"en": ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "z", "x", "c", "v", "b", "n", "m", ",", "."],
"ru": ["й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "я", "ч", "с", "м", "и", "т", "ь", "б", "ю"],
"de": ["q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "z", "x", "c", "v", "b", "n", "m"],
"fr": ["a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "w", "x", "c", "v", "b", "n"]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

@ -0,0 +1,26 @@
<svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
svg>g {display: none}
:target {display: inline}
</style>
<g id="attention" >
<path d="M3.25245 31.1904L18.366 4.94276C19.0898 3.68575 20.9102 3.68575 21.634 4.94275L36.7475 31.1904C37.4678 32.4412 36.5612 34 35.1136 34H4.88642C3.43881 34 2.53225 32.4412 3.25245 31.1904Z" fill="#FFD112"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21 25H19L18 18V12H22V18L21 25ZM22 31H18V27H22V31Z" fill="white"/>
</g>
<g id="done" >
<circle cx="20" cy="20" r="16" fill="#009900"/>
<path d="M12 20L18 26L29 15" stroke="white" stroke-width="4"/>
</g>
<g id="info">
<circle cx="20" cy="20" r="16" fill="#007DF1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 10H18V14H22V10ZM22 17H18V30H22V17Z" fill="white"/>
</g>
<g id="warning">
<circle cx="20" cy="20" r="16" fill="#F62211"/>
<rect x="10" y="17" width="20" height="6" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,10 +1,5 @@
<svg fill="none" height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-blank">
<clipPath id="a">
<path d="m0 0h96v96h-96z"/>
</clipPath>
<g clip-path="url(#a)">
<path d="m.499997 94 .000003-74c0-.8284.67157-1.5 1.5-1.5h92c.8284 0 1.5.6716 1.5 1.5v74c0 .8284-.6716 1.5-1.5 1.5h-92c-.82843 0-1.500003-.6716-1.500003-1.5z" fill="#fff" stroke="#bfbfbf"/>
</g>
<path d="M94 9.5C94.8284 9.5 95.5 10.1716 95.5 11L95.5 85C95.5 85.8284 94.8284 86.5 94 86.5L2 86.5C1.17157 86.5 0.499997 85.8284 0.499997 85L0.5 11C0.5 10.1716 1.17158 9.5 2 9.5L94 9.5Z" fill="white" stroke="#BFBFBF"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 370 B

View file

@ -0,0 +1,10 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-docm">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#214479"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M39.4824 109.635C39.4824 111.045 39.0801 112.125 38.2754 112.875C37.4746 113.625 36.3164 114 34.8008 114H32.375V105.434H35.0645C36.4629 105.434 37.5488 105.803 38.3223 106.541C39.0957 107.279 39.4824 108.311 39.4824 109.635ZM37.5957 109.682C37.5957 107.842 36.7832 106.922 35.1582 106.922H34.1914V112.5H34.9707C36.7207 112.5 37.5957 111.561 37.5957 109.682ZM49.0332 109.705C49.0332 111.123 48.6816 112.213 47.9785 112.975C47.2754 113.736 46.2676 114.117 44.9551 114.117C43.6426 114.117 42.6348 113.736 41.9316 112.975C41.2285 112.213 40.877 111.119 40.877 109.693C40.877 108.268 41.2285 107.18 41.9316 106.43C42.6387 105.676 43.6504 105.299 44.9668 105.299C46.2832 105.299 47.2891 105.678 47.9844 106.436C48.6836 107.193 49.0332 108.283 49.0332 109.705ZM42.7812 109.705C42.7812 110.662 42.9629 111.383 43.3262 111.867C43.6895 112.352 44.2324 112.594 44.9551 112.594C46.4043 112.594 47.1289 111.631 47.1289 109.705C47.1289 107.775 46.4082 106.811 44.9668 106.811C44.2441 106.811 43.6992 107.055 43.332 107.543C42.9648 108.027 42.7812 108.748 42.7812 109.705ZM54.4473 106.822C53.7637 106.822 53.2344 107.08 52.8594 107.596C52.4844 108.107 52.2969 108.822 52.2969 109.74C52.2969 111.65 53.0137 112.605 54.4473 112.605C55.0488 112.605 55.7773 112.455 56.6328 112.154V113.678C55.9297 113.971 55.1445 114.117 54.2773 114.117C53.0312 114.117 52.0781 113.74 51.418 112.986C50.7578 112.229 50.4277 111.143 50.4277 109.729C50.4277 108.838 50.5898 108.059 50.9141 107.391C51.2383 106.719 51.7031 106.205 52.3086 105.85C52.918 105.49 53.6309 105.311 54.4473 105.311C55.2793 105.311 56.1152 105.512 56.9551 105.914L56.3691 107.391C56.0488 107.238 55.7266 107.105 55.4023 106.992C55.0781 106.879 54.7598 106.822 54.4473 106.822ZM62.0879 114L60.0254 107.279H59.9727C60.0469 108.646 60.084 109.559 60.084 110.016V114H58.4609V105.434H60.9336L62.9609 111.984H62.9961L65.1465 105.434H67.6191V114H65.9258V109.945C65.9258 109.754 65.9277 109.533 65.9316 109.283C65.9395 109.033 65.9668 108.369 66.0137 107.291H65.9609L63.752 114H62.0879Z" fill="white"/>
<path d="M67.8 48L61.5 75L54.5 48H51.5H48.5L41.5 75L35.2 48H29.4L37.9 82H44.3L51.5 54.1L58.7 82H65.1L73.6 48H67.8Z" fill="white"/>
<path d="M15 17C15 15.8954 15.8954 15 17 15H29C30.1046 15 31 15.8954 31 17V26C31 27.1046 30.1046 28 29 28H17C15.8954 28 15 27.1046 15 26V17Z" fill="white"/>
<path d="M22.2969 26L19.8125 18.8457H19.7656C19.832 19.9082 19.8652 20.9043 19.8652 21.834V26H18.5938V17.4336H20.5684L22.9473 24.248H22.9824L25.4316 17.4336H27.4121V26H26.0645V21.7637C26.0645 21.3379 26.0742 20.7832 26.0938 20.0996C26.1172 19.416 26.1367 19.002 26.1523 18.8574H26.1055L23.5332 26H22.2969Z" fill="#214479"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,17 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-docxf">
<g>
<path id="Vector" d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#27ABA3"/>
<path id="Vector_2" opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<g id="DOCXF">
<path d="M38.3176 109.635C38.3176 111.045 37.9153 112.125 37.1106 112.875C36.3098 113.625 35.1516 114 33.636 114H31.2102V105.434H33.8997C35.2981 105.434 36.384 105.803 37.1575 106.541C37.9309 107.279 38.3176 108.311 38.3176 109.635ZM36.4309 109.682C36.4309 107.842 35.6184 106.922 33.9934 106.922H33.0266V112.5H33.8059C35.5559 112.5 36.4309 111.561 36.4309 109.682Z" fill="white"/>
<path d="M47.8684 109.705C47.8684 111.123 47.5168 112.213 46.8137 112.975C46.1106 113.736 45.1028 114.117 43.7903 114.117C42.4778 114.117 41.47 113.736 40.7668 112.975C40.0637 112.213 39.7122 111.119 39.7122 109.693C39.7122 108.268 40.0637 107.18 40.7668 106.43C41.4739 105.676 42.4856 105.299 43.802 105.299C45.1184 105.299 46.1243 105.678 46.8196 106.436C47.5188 107.193 47.8684 108.283 47.8684 109.705ZM41.6165 109.705C41.6165 110.662 41.7981 111.383 42.1614 111.867C42.5247 112.352 43.0676 112.594 43.7903 112.594C45.2395 112.594 45.9641 111.631 45.9641 109.705C45.9641 107.775 45.2434 106.811 43.802 106.811C43.0793 106.811 42.5344 107.055 42.1672 107.543C41.8 108.027 41.6165 108.748 41.6165 109.705Z" fill="white"/>
<path d="M53.2825 106.822C52.5989 106.822 52.0696 107.08 51.6946 107.596C51.3196 108.107 51.1321 108.822 51.1321 109.74C51.1321 111.65 51.8489 112.605 53.2825 112.605C53.884 112.605 54.6125 112.455 55.468 112.154V113.678C54.7649 113.971 53.9797 114.117 53.1125 114.117C51.8665 114.117 50.9133 113.74 50.2532 112.986C49.593 112.229 49.2629 111.143 49.2629 109.729C49.2629 108.838 49.425 108.059 49.7493 107.391C50.0735 106.719 50.5383 106.205 51.1438 105.85C51.7532 105.49 52.4661 105.311 53.2825 105.311C54.1145 105.311 54.9504 105.512 55.7903 105.914L55.2043 107.391C54.884 107.238 54.5618 107.105 54.2375 106.992C53.9133 106.879 53.595 106.822 53.2825 106.822Z" fill="white"/>
<path d="M64.2219 114H62.1477L60.1555 110.76L58.1633 114H56.218L59.0598 109.582L56.3997 105.434H58.4036L60.2493 108.516L62.0598 105.434H64.0168L61.3274 109.682L64.2219 114Z" fill="white"/>
<path d="M67.0872 114H65.3V105.434H70.2102V106.922H67.0872V109.131H69.9934V110.613H67.0872V114Z" fill="white"/>
</g>
<path id="Rectangle 381 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M22 58H78V44H22V58ZM20 42V60H80V42H20Z" fill="white"/>
<path id="Rectangle 387 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M22 82H78V68H22V82ZM20 66V84H80V66H20Z" fill="white"/>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,18 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-oform">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#2CA498"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M36.8535 109.705C36.8535 111.123 36.502 112.213 35.7988 112.975C35.0957 113.736 34.0879 114.117 32.7754 114.117C31.4629 114.117 30.4551 113.736 29.752 112.975C29.0488 112.213 28.6973 111.119 28.6973 109.693C28.6973 108.268 29.0488 107.18 29.752 106.43C30.459 105.676 31.4707 105.299 32.7871 105.299C34.1035 105.299 35.1094 105.678 35.8047 106.436C36.5039 107.193 36.8535 108.283 36.8535 109.705ZM30.6016 109.705C30.6016 110.662 30.7832 111.383 31.1465 111.867C31.5098 112.352 32.0527 112.594 32.7754 112.594C34.2246 112.594 34.9492 111.631 34.9492 109.705C34.9492 107.775 34.2285 106.811 32.7871 106.811C32.0645 106.811 31.5195 107.055 31.1523 107.543C30.7852 108.027 30.6016 108.748 30.6016 109.705Z" fill="white"/>
<path d="M40.416 114H38.6289V105.434H43.5391V106.922H40.416V109.131H43.3223V110.613H40.416V114Z" fill="white"/>
<path d="M52.9902 109.705C52.9902 111.123 52.6387 112.213 51.9355 112.975C51.2324 113.736 50.2246 114.117 48.9121 114.117C47.5996 114.117 46.5918 113.736 45.8887 112.975C45.1855 112.213 44.834 111.119 44.834 109.693C44.834 108.268 45.1855 107.18 45.8887 106.43C46.5957 105.676 47.6074 105.299 48.9238 105.299C50.2402 105.299 51.2461 105.678 51.9414 106.436C52.6406 107.193 52.9902 108.283 52.9902 109.705ZM46.7383 109.705C46.7383 110.662 46.9199 111.383 47.2832 111.867C47.6465 112.352 48.1895 112.594 48.9121 112.594C50.3613 112.594 51.0859 111.631 51.0859 109.705C51.0859 107.775 50.3652 106.811 48.9238 106.811C48.2012 106.811 47.6562 107.055 47.2891 107.543C46.9219 108.027 46.7383 108.748 46.7383 109.705Z" fill="white"/>
<path d="M56.582 109.236H57.168C57.7422 109.236 58.166 109.141 58.4395 108.949C58.7129 108.758 58.8496 108.457 58.8496 108.047C58.8496 107.641 58.709 107.352 58.4277 107.18C58.1504 107.008 57.7188 106.922 57.1328 106.922H56.582V109.236ZM56.582 110.713V114H54.7656V105.434H57.2617C58.4258 105.434 59.2871 105.646 59.8457 106.072C60.4043 106.494 60.6836 107.137 60.6836 108C60.6836 108.504 60.5449 108.953 60.2676 109.348C59.9902 109.738 59.5977 110.045 59.0898 110.268C60.3789 112.193 61.2188 113.438 61.6094 114H59.5938L57.5488 110.713H56.582Z" fill="white"/>
<path d="M66.3145 114L64.252 107.279H64.1992C64.2734 108.646 64.3105 109.559 64.3105 110.016V114H62.6875V105.434H65.1602L67.1875 111.984H67.2227L69.373 105.434H71.8457V114H70.1523V109.945C70.1523 109.754 70.1543 109.533 70.1582 109.283C70.166 109.033 70.1934 108.369 70.2402 107.291H70.1875L67.9785 114H66.3145Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 85H81V41H19V85ZM17 39V87H83V39H17Z" fill="white"/>
<rect x="19" y="41" width="62" height="44" fill="#41ADA2"/>
<rect x="29" y="50" width="5" height="2" fill="white"/>
<rect x="36" y="50" width="5" height="2" fill="white"/>
<rect x="29" y="74" width="5" height="2" fill="white"/>
<rect x="36" y="74" width="5" height="2" fill="white"/>
<rect width="22" height="2" transform="matrix(-4.37114e-08 1 1 4.37114e-08 34 52)" fill="white"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,14 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-pptm">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#DD682B"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M37.2146 109.465H37.8123C38.3708 109.465 38.7888 109.355 39.0662 109.137C39.3435 108.914 39.4822 108.592 39.4822 108.17C39.4822 107.744 39.365 107.43 39.1306 107.227C38.9001 107.023 38.5369 106.922 38.0408 106.922H37.2146V109.465ZM41.3162 108.105C41.3162 109.027 41.0271 109.732 40.449 110.221C39.8748 110.709 39.0564 110.953 37.9939 110.953H37.2146V114H35.3982V105.434H38.1345C39.1736 105.434 39.9626 105.658 40.5017 106.107C41.0447 106.553 41.3162 107.219 41.3162 108.105ZM44.7498 109.465H45.3474C45.906 109.465 46.324 109.355 46.6013 109.137C46.8787 108.914 47.0173 108.592 47.0173 108.17C47.0173 107.744 46.9001 107.43 46.6658 107.227C46.4353 107.023 46.072 106.922 45.5759 106.922H44.7498V109.465ZM48.8513 108.105C48.8513 109.027 48.5623 109.732 47.9841 110.221C47.4099 110.709 46.5916 110.953 45.5291 110.953H44.7498V114H42.9333V105.434H45.6697C46.7087 105.434 47.4978 105.658 48.0369 106.107C48.5798 106.553 48.8513 107.219 48.8513 108.105ZM53.7732 114H51.9568V106.945H49.6306V105.434H56.0994V106.945H53.7732V114ZM61.0447 114L58.9822 107.279H58.9294C59.0037 108.646 59.0408 109.559 59.0408 110.016V114H57.4177V105.434H59.8904L61.9177 111.984H61.9529L64.1033 105.434H66.5759V114H64.8826V109.945C64.8826 109.754 64.8845 109.533 64.8884 109.283C64.8962 109.033 64.9236 108.369 64.9705 107.291H64.9177L62.7087 114H61.0447Z" fill="white"/>
<path d="M50 69C54.2435 69 58.3131 67.3143 61.3137 64.3137C64.3143 61.3131 66 57.2435 66 53H50V37C45.7565 37 41.6869 38.6857 38.6863 41.6863C35.6857 44.6869 34 48.7565 34 53C34 57.2435 35.6857 61.3131 38.6863 64.3137C41.6869 67.3143 45.7565 69 50 69Z" fill="white"/>
<path d="M53 34V50H69C69 45.7565 67.3143 41.6869 64.3137 38.6863C61.3131 35.6857 57.2435 34 53 34Z" fill="white"/>
<path d="M75 89H25V91H75V89Z" fill="white"/>
<path d="M75 83H25V85H75V83Z" fill="white"/>
<path d="M75 77H25V79H75V77Z" fill="white"/>
<path d="M15 17C15 15.8954 15.8954 15 17 15H29C30.1046 15 31 15.8954 31 17V26C31 27.1046 30.1046 28 29 28H17C15.8954 28 15 27.1046 15 26V17Z" fill="white"/>
<path d="M22.2969 26L19.8125 18.8457H19.7656C19.832 19.9082 19.8652 20.9043 19.8652 21.834V26H18.5938V17.4336H20.5684L22.9473 24.248H22.9824L25.4316 17.4336H27.4121V26H26.0645V21.7637C26.0645 21.3379 26.0742 20.7832 26.0938 20.0996C26.1172 19.416 26.1367 19.002 26.1523 18.8574H26.1055L23.5332 26H22.2969Z" fill="#DD682B"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,10 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-xlsm">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#1F7244"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M42.4446 114H40.3704L38.3782 110.76L36.386 114H34.4407L37.2825 109.582L34.6223 105.434H36.6262L38.4719 108.516L40.2825 105.434H42.2395L39.55 109.682L42.4446 114ZM43.5227 114V105.434H45.3391V112.5H48.8137V114H43.5227ZM55.3645 111.621C55.3645 112.395 55.0852 113.004 54.5266 113.449C53.9719 113.895 53.1985 114.117 52.2063 114.117C51.2922 114.117 50.4836 113.945 49.7805 113.602V111.914C50.3586 112.172 50.8469 112.354 51.2454 112.459C51.6477 112.564 52.0149 112.617 52.3469 112.617C52.7454 112.617 53.05 112.541 53.261 112.389C53.4758 112.236 53.5833 112.01 53.5833 111.709C53.5833 111.541 53.5364 111.393 53.4426 111.264C53.3489 111.131 53.2102 111.004 53.0266 110.883C52.8469 110.762 52.4778 110.568 51.9192 110.303C51.3958 110.057 51.0032 109.82 50.7415 109.594C50.4797 109.367 50.2708 109.104 50.1145 108.803C49.9583 108.502 49.8801 108.15 49.8801 107.748C49.8801 106.99 50.136 106.395 50.6477 105.961C51.1633 105.527 51.8743 105.311 52.7805 105.311C53.2258 105.311 53.6497 105.363 54.052 105.469C54.4583 105.574 54.8821 105.723 55.3235 105.914L54.7375 107.326C54.2805 107.139 53.9016 107.008 53.6008 106.934C53.304 106.859 53.011 106.822 52.7219 106.822C52.3782 106.822 52.1145 106.902 51.9309 107.062C51.7473 107.223 51.6555 107.432 51.6555 107.689C51.6555 107.85 51.6926 107.99 51.7668 108.111C51.8411 108.229 51.9583 108.344 52.1184 108.457C52.2825 108.566 52.6672 108.766 53.2727 109.055C54.0735 109.438 54.6223 109.822 54.9192 110.209C55.2161 110.592 55.3645 111.062 55.3645 111.621ZM60.5442 114L58.4817 107.279H58.429C58.5032 108.646 58.5403 109.559 58.5403 110.016V114H56.9172V105.434H59.3899L61.4172 111.984H61.4524L63.6028 105.434H66.0754V114H64.3821V109.945C64.3821 109.754 64.384 109.533 64.3879 109.283C64.3958 109.033 64.4231 108.369 64.47 107.291H64.4172L62.2083 114H60.5442Z" fill="white"/>
<path d="M52.75 61.63L64 45H58.5L50 57.56L41.5 45H36L47.25 61.63L35.5 79H41L50 65.7L59 79H64.5L52.75 61.63Z" fill="white"/>
<path d="M15 15C15 13.8954 15.8954 13 17 13H29C30.1046 13 31 13.8954 31 15V24C31 25.1046 30.1046 26 29 26H17C15.8954 26 15 25.1046 15 24V15Z" fill="white"/>
<path d="M22.2969 24L19.8125 16.8457H19.7656C19.832 17.9082 19.8652 18.9043 19.8652 19.834V24H18.5938V15.4336H20.5684L22.9473 22.248H22.9824L25.4316 15.4336H27.4121V24H26.0645V19.7637C26.0645 19.3379 26.0742 18.7832 26.0938 18.0996C26.1172 17.416 26.1367 17.002 26.1523 16.8574H26.1055L23.5332 24H22.2969Z" fill="#1F7244"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Some files were not shown because too many files have changed in this diff Show more