Merge branch 'develop' into feature/de-page-thumbnails

This commit is contained in:
JuliaSvinareva 2021-10-15 11:43:49 +03:00 committed by GitHub
commit 7f34e30e6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1275 changed files with 96758 additions and 17840 deletions

View file

@ -16,9 +16,9 @@ Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONL
## User feedback and support
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum: [forum.onlyoffice.com][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
[1]: http://dev.onlyoffice.org
[1]: https://forum.onlyoffice.com
[2]: https://github.com/ONLYOFFICE/DocumentServer
[3]: http://stackoverflow.com/questions/tagged/onlyoffice

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,7 @@
customization: {
logo: {
image: url,
imageEmbedded: url,
imageEmbedded: url, // deprecated, use image instead
url: http://...
},
customer: {
@ -136,9 +137,10 @@
label: string (default: "Guest") // postfix for user name
},
review: {
hideReviewDisplay: false // hide button Review mode,
hideReviewDisplay: false, // hide button Review mode
hoverMode: false, // true - show review balloons on mouse move, not on click on text
showReviewChanges: false,
reviewDisplay: 'original',
reviewDisplay: 'original', // original for viewer, markup for editor
trackChanges: undefined // true/false - open editor with track changes mode on/off,
},
chat: true,
@ -417,7 +419,7 @@
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
_config.document.fileType = _config.document.fileType.toLowerCase();
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|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))$/
.exec(_config.document.fileType);
if (!type) {
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
@ -429,7 +431,7 @@
}
}
var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType);
var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(_config.document.fileType);
if (type && typeof type[1] === 'string') {
_config.editorConfig.canUseHistory = false;
}
@ -837,9 +839,24 @@
return extensionParams["url"] + "apps/";
}
function getTestPath() {
var scripts = document.getElementsByTagName('script'),
match;
for (var i = scripts.length - 1; i >= 0; i--) {
match = scripts[i].src.match(/(.*)apps\/api\/documents\/api.js/i);
if (match) {
return match[1] + "test/";
}
}
return "";
}
function getAppPath(config) {
var extensionPath = getExtensionPath(),
path = extensionPath ? extensionPath : getBasePath(),
path = extensionPath ? extensionPath : (config.type=="test" ? getTestPath() : getBasePath()),
appMap = {
'text': 'documenteditor',
'text-pdf': 'documenteditor',
@ -867,23 +884,34 @@
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" || (app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
? "embed"
: "main";
if (config.document && typeof config.document.fileType === 'string' && config.document.fileType.toLowerCase() === 'oform') {
if (config.document.permissions) {
(config.document.permissions.fillForms===undefined) && (config.document.permissions.fillForms = (config.document.permissions.edit !== false));
config.document.permissions.edit = config.document.permissions.review = config.document.permissions.comment = false;
}
path_type = (config.type === "mobile" || isSafari_mobile)
? "mobile" : config.document.permissions && (config.document.permissions.fillForms === true) && (config.editorConfig.mode !== 'view')
? "forms" : "embed";
} else {
path_type = (config.type === "mobile" || isSafari_mobile)
? "mobile" : ((app==='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
? "forms" : (config.type === "embedded")
? "embed" : "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";
}
@ -905,8 +933,8 @@
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);
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)
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image);
}

View file

@ -91,7 +91,7 @@ div {
<div id="iframeEditor">
</div>
</div>
<script type="text/javascript" src="../../web-apps/apps/api/documents/api.js"></script>
<script type="text/javascript" src="../../../web-apps/apps/api/documents/api.js"></script>
<script type="text/javascript" language="javascript">
var docEditor;
@ -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);
@ -236,6 +248,7 @@ div {
fileInfo = <%- JSON.stringify(fileInfo) %>;
var key = "<%- key %>";
var documentType = "<%- documentType %>";
var userAuth = <%- JSON.stringify(userAuth) %>;
var token = "<%- token %>";
var queryParams = <%- JSON.stringify(queryParams) %>;
@ -250,7 +263,7 @@ div {
"width": "100%",
"height": "100%",
"type": "desktop",
"documentType": queryParams.documenttype,
"documentType": documentType,
"token": token,
"document": {
"title": fileInfo.BreadcrumbDocName || fileInfo.BaseFileName,
@ -268,7 +281,7 @@ div {
}
},
"editorConfig": {
"mode": queryParams.mode,
"mode": userAuth.mode,
"lang": queryParams.lang || queryParams.ui || "en-US",
"region": queryParams.rs,
"callbackUrl": JSON.stringify(userAuth),
@ -304,11 +317,12 @@ 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
}
};
postMessageOrigin = fileInfo.PostMessageOrigin;
postMessageOrigin = fileInfo.PostMessageOrigin || "*";
if (postMessageOrigin && (typeof postMessageOrigin === 'string') && postMessageOrigin.charAt(postMessageOrigin.length-1)=='/')
postMessageOrigin = postMessageOrigin.substring(0, postMessageOrigin.length - 1);
lang = config.editorConfig.lang;

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;
@ -225,6 +225,12 @@
.margin-right-large {
margin-right: 12px;
}
.margin-left-small {
margin-left: 8px;
}
.margin-left-large {
margin-left: 12px;
}
}
// Logo
@ -232,7 +238,7 @@
.brand-logo {
display: block;
width: 100px;
height: 24px;
height: 20px;
background: data-uri('../../../../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,152 @@
<svg width="380" height="40" viewBox="0 0 380 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>
</svg>

After

Width:  |  Height:  |  Size: 12 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,640 @@
@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/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";
@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 {
&.colored {
padding: 0 16px;
height: 28px;
background-color: @background-accent-button;
border: 1px solid transparent;
border-radius: 3px;
color: @text-contrast-background !important;
font-weight: 700;
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @highlight-accent-button-hover !important;
}
&:active:not(.disabled),
&.active:not(.disabled) {
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*19 @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;
}
}
.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;
}
#page-number {
.masked {
cursor: pointer;
}
}
.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;
}
.synch-tip-root {
&.colored {
@tip-width: 240px;
width: @tip-width;
.tip-text {
width: @tip-width - 40px;
}
.asc-synchronizetip {
background-color: @background-contrast-popover;
color: @text-contrast-background;
.close {
&:before, &:after {
background-color: @text-contrast-background;
}
}
}
.tip-arrow:after {
background-color: @background-contrast-popover;
}
.btn-div {
display: inline-block;
border: 1px solid @border-regular-control-ie;
border: 1px solid @border-regular-control;
border-radius: 2px;
padding: 3px 12px;
margin-top: 10px;
}
}
}
.font-size-small {
.fontsize(@font-size-small);
}
.font-size-normal {
.fontsize(@font-size-base);
}
.font-size-large {
.fontsize(@font-size-large);
}

View file

@ -48,12 +48,6 @@ define([
'common/main/lib/model/Font'
], function(Backbone){ 'use strict';
Common.Collections.Fonts = Backbone.Collection.extend({
model: Common.Models.Font,
comparator: function(item1, item2) {
var n1 = item1.get('name').toLowerCase(),
n2 = item2.get('name').toLowerCase();
if (n1==n2) return 0;
return (n1<n2) ? -1 : 1;
}
model: Common.Models.Font
});
});

View file

@ -59,8 +59,7 @@ define([
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color,
colors: colors,
parentButton: this
colors: colors
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
@ -69,6 +68,7 @@ define([
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
(color == 'auto') && this.setAutoColor(true);
}
this.initInnerMenu();
}
return this.colorPicker;
},
@ -105,7 +105,7 @@ define([
}
])
});
this.colorPicker && (this.colorPicker.parentButton = menu);
this.initInnerMenu();
var me = this;
menu.on('keydown:before', _.bind(this.onBeforeKeyDown, this));
menu.on('show:after', function(menu) {
@ -123,6 +123,14 @@ define([
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);
@ -174,49 +182,12 @@ define([
$('button', this.cmpEl).click();
return false;
}
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)) {
var $items = $('> [role=menu] > li:not(.divider):not(.disabled):visible', menu.$el).find('> a');
if (!$items.length) return;
var index = $items.index($items.filter(':focus')),
me = this,
pickerIndex = $items.length-1 ;
if (e.keyCode == Common.UI.Keys.DOWN && (index==pickerIndex-1 || pickerIndex==0) || e.keyCode == Common.UI.Keys.UP && index==pickerIndex) {
e.preventDefault();
e.stopPropagation();
_.delay(function() {
me.focusInner(e);
}, 10);
}
}
},
isMenuOpen: function() {
return this.cmpEl.hasClass('open');
},
focusInner: function(e) {
if (!this.colorPicker) return;
this.colorPicker.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
},
focusOuter: function(e) {
if (!this.menu) return;
var $items = $('> [role=menu] > li:not(.divider):not(.disabled):visible', this.menu.$el).find('> a');
if (!$items.length) return;
$items.eq(e.keyCode == Common.UI.Keys.UP ? $items.length-2 : $items.length-1).focus();
},
textNewColor: 'Add New Custom Color',
textAutoColor: 'Automatic'

View file

@ -190,6 +190,7 @@ define([
el.on('click', '.form-control', _.bind(this.onInputClick, this));
this._input.attr('readonly', 'readonly');
this._input.attr('data-can-copy', false);
this._input.on('mousedown',function (e){e.preventDefault();})
}
if (me.options.hint) {

View file

@ -49,24 +49,29 @@ define([
'use strict';
Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() {
var iconWidth = 302,
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 26,
var iconWidth = 300,
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 28,
thumbCanvas = document.createElement('canvas'),
thumbContext = thumbCanvas.getContext('2d'),
postfix = (/^(zh|ja|ko)$/i.test(Common.Locale.getCurrentLanguage())) ? '_ea' : '',
thumbs = [
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight},
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2}
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '.png', width: iconWidth, height: iconHeight},
{ratio: 1.25, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.25x.png', width: iconWidth * 1.25, height: iconHeight * 1.25},
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
{ratio: 1.75, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.75x.png', width: iconWidth * 1.75, height: iconHeight * 1.75},
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@2x.png', width: iconWidth * 2, height: iconHeight * 2}
],
thumbIdx = 0,
listItemHeight = 26,
listItemHeight = 28,
spriteCols = 1,
applicationPixelRatio = Common.Utils.applicationPixelRatio();
if (typeof window['AscDesktopEditor'] === 'object') {
thumbs[0].path = window['AscDesktopEditor'].getFontsSprite('');
thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.5x');
thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@2x');
thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.25x');
thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@1.5x');
thumbs[3].path = window['AscDesktopEditor'].getFontsSprite('@1.75x');
thumbs[4].path = window['AscDesktopEditor'].getFontsSprite('@2x');
}
var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio);

View file

@ -91,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',
@ -102,7 +103,8 @@ define([
'<span class="title"><%= title %></span>',
'<% } %>',
'</div>'
].join(''))
].join('')),
delayRenderTips: this.delayRenderTips
});
this.openButton = new Common.UI.Button({
@ -112,20 +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,
@ -137,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);
@ -244,9 +248,10 @@ define([
onResize: function() {
if (this.openButton) {
var button = $('button', this.openButton.cmpEl);
button && button.css({
width : $('.button', this.cmpEl).width(),
height: $('.button', this.cmpEl).height()
var cntButton = $('.button', this.cmpEl);
button && cntButton.width() > 0 && button.css({
width : cntButton.width(),
height: cntButton.height()
});
this.openButton.menu.hide();

View file

@ -0,0 +1,456 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* ComboDataView.js
*
* Created by Julia Svinareva on 6/10/21
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/component/BaseView',
'common/main/lib/component/DataView'
], function () {
'use strict';
Common.UI.ComboDataViewShape = Common.UI.BaseView.extend({
options : {
id : null,
cls : '',
style : '',
hint : false,
itemWidth : 80,
itemHeight : 40,
menuMaxHeight : 300,
enableKeyEvents : false,
additionalMenuItems : null,
minWidth: -1,
dataHint: '',
dataHintDirection: '',
dataHintOffset: ''
},
template: _.template([
'<div id="<%= id %>" class="combo-dataview <%= cls %>" style="<%= style %>">',
'<div class="view"></div> ',
'<div class="button"></div> ',
'</div>'
].join('')),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
this.id = this.options.id || Common.UI.getId();
this.cls = this.options.cls;
this.style = this.options.style;
this.hint = this.options.hint;
this.store = this.options.store || new Common.UI.DataViewStore();
this.itemWidth = this.options.itemWidth;
this.itemHeight = this.options.itemHeight;
this.menuMaxHeight = this.options.menuMaxHeight;
this.menuWidth = this.options.menuWidth;
this.rootWidth = 0;
this.rootHeight = 0;
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',
allowScrollbar: false,
itemTemplate: _.template('<div class="item-shape" id="<%= id %>" data-shape="<%= data.shapeType %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
delayRenderTips: this.delayRenderTips
});
this.openButton = new Common.UI.Button({
cls: 'open-menu',
menu: new Common.UI.Menu({
cls: 'menu-insert-shape',
menuAlign: 'tl-tl',
offset: [0, 3],
items: [
{template: _.template('<div class="menu-picker-container"></div>')}
]
}),
dataHint: this.options.dataHint,
dataHintDirection: this.options.dataHintDirection,
dataHintOffset: this.options.dataHintOffset
});
// Handle resize
setInterval(_.bind(this.checkSize, this), 500);
if (this.options.el) {
this.render();
}
},
fillComboView: function (collection) {
var groups = collection.toJSON(),
recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes');
recents = recents ? JSON.parse(recents) : [];
if (recents.length < 12) {
var count = 12 - recents.length;
var addItem = function (rec) {
var item = rec.toJSON(),
model = {
data: item.data,
tip: item.tip,
allowSelected: item.allowSelected,
selected: false
};
recents.push(model);
};
for (var j = 0; j < groups.length && count > 0; j++) {
var groupStore = groups[j].groupStore;
if (j === 0) {
addItem(groupStore.at(1));
count--;
if (count > 0) {
addItem(groupStore.at(2));
count--;
}
} else if (j !== 3 && j !== 6 && j !== 7) {
addItem(groupStore.at(0));
count--;
if (count > 0) {
addItem(groupStore.at(1));
count--;
}
}
}
}
this.fieldPicker.store.reset(recents);
this.fieldPicker.on('item:select', _.bind(this.onFieldPickerSelect, this));
this.fieldPicker.on('item:click', _.bind(this.onFieldPickerClick, this));
this.fieldPicker.on('item:contextmenu', _.bind(this.onPickerItemContextMenu, this));
this.fieldPicker.el.addEventListener('contextmenu', _.bind(this.onPickerComboContextMenu, this), false);
},
setMenuPicker: function (collection, recent, text) {
this.menuPicker = new Common.UI.DataViewShape({
el: this.cmpEl.find('.menu-picker-container'),
cls: 'menu-picker',
parentMenu: this.openButton.menu,
restoreHeight: this.menuMaxHeight,
style: 'max-height: '+this.menuMaxHeight+'px;',
itemTemplate : _.template('<div class="item-shape" id="<%= id %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
groups: collection,
textRecentlyUsed: text,
recentShapes: recent
});
this.menuPicker.on('item:select', _.bind(this.onMenuPickerSelect, this));
this.menuPicker.on('item:click', _.bind(this.onMenuPickerClick, this));
this.menuPicker.on('item:contextmenu', _.bind(this.onPickerItemContextMenu, this));
this.menuPicker.el.addEventListener('contextmenu', _.bind(this.onPickerComboContextMenu, this), false);
this.onResize();
},
render: function(parentEl) {
if (!this.rendered) {
var me = this;
me.trigger('render:before', me);
me.cmpEl = me.$el || $(me.el);
var templateEl = me.template({
id : me.id,
cls : me.cls,
style : me.style
});
if (parentEl) {
me.setElement(parentEl, false);
me.cmpEl = $(templateEl);
parentEl.html(me.cmpEl);
} else {
me.cmpEl.html(templateEl);
}
me.rootWidth = me.cmpEl.width();
me.rootHeight = me.cmpEl.height();
me.fieldPicker.render($('.view', me.cmpEl));
me.openButton.render($('.button', me.cmpEl));
//me.menuPicker.render($('.menu-picker-container', me.cmpEl));
if (me.openButton.menu.cmpEl) {
if (me.openButton.menu.cmpEl) {
me.openButton.menu.menuAlignEl = me.cmpEl;
me.openButton.menu.cmpEl.css('min-width', me.itemWidth);
me.openButton.menu.on('show:before', _.bind(me.onBeforeShowMenu, me));
me.openButton.menu.on('show:after', _.bind(me.onAfterShowMenu, me));
me.openButton.cmpEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
me.openButton.cmpEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me));
}
}
if (me.options.hint) {
me.cmpEl.attr('data-toggle', 'tooltip');
me.cmpEl.tooltip({
title : me.options.hint,
placement : me.options.hintAnchor || 'cursor'
});
}
//me.onResize();
me.rendered = true;
me.trigger('render:after', me);
}
if (this.disabled) {
this.setDisabled(!!this.disabled);
}
return this;
},
updateComboView: function (record) {
var store = this.fieldPicker.store,
type = record.get('data').shapeType,
model = null;
for (var i = 0; i < store.length; i++) {
if (store.at(i).get('data').shapeType === type) {
model = store.at(i);
break;
}
}
if (!model) {
store.pop();
store.unshift([record]);
}
},
activateRecord: function (record) {
var type = record.get('data').shapeType;
if (this.isRecordActive)
this.deactivateRecords();
$(this.cmpEl.find("[data-shape='" + type + "']")).parent().addClass('active');
this.isRecordActive = true;
},
deactivateRecords: function () {
$(this.cmpEl.find('.field-picker .item')).removeClass('active');
},
isComboViewRecActive: function () {
return this.isRecordActive;
},
checkSize: function() {
if (this.cmpEl && this.cmpEl.is(':visible')) {
var me = this,
width = this.cmpEl.width(),
height = this.cmpEl.height();
if (width < this.minWidth) return;
if (this.rootWidth != width || this.rootHeight != height) {
this.rootWidth = width;
this.rootHeight = height;
setTimeout(function() {
me.openButton.menu.cmpEl.outerWidth();
me.rootWidth = me.cmpEl.width();
}, 10);
this.onResize();
}
}
},
onResize: function() {
if (this.openButton) {
var button = $('button', this.openButton.cmpEl);
var cntButton = $('.button', this.cmpEl);
button && cntButton.width() > 0 && button.css({
width : cntButton.width(),
height: cntButton.height()
});
this.openButton.menu.hide();
/*var picker = this.menuPicker;
if (picker) {
var record = picker.getSelectedRec();
this.fillComboView(record || picker.store.at(0), !!record, true);
picker.onResize();
}*/
}
if (!this.isSuspendEvents)
this.trigger('resize', this);
},
onBeforeShowMenu: function(e) {
var menu = this.openButton.menu;
if (menu.cmpEl) {
menu.menuAlignEl = this.cmpEl;
var offset = this.cmpEl.width() - this.openButton.$el.width() - this.menuWidth + 1;
menu.setOffset(Math.min(offset, 0));
}
if (this.options.hint) {
var tip = this.cmpEl.data('bs.tooltip');
if (tip) {
if (tip.dontShow===undefined)
tip.dontShow = true;
tip.hide();
}
}
},
onBeforeHideMenu: function(e) {
this.trigger('hide:before', this, e);
if (Common.UI.Scroller.isMouseCapture())
e.preventDefault();
if (this.isStylesNotClosable)
return false;
},
onAfterShowMenu: function(e) {
var me = this;
if (me.menuPicker.scroller) {
me.menuPicker.scroller.update({
includePadding: true,
suppressScrollX: true,
alwaysVisibleY: true
});
}
},
onAfterHideMenu: function(e, isFromInputControl) {
this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec(); // for DataView - onKeyDown - Return key
this.menuPicker.deselectAll();
this.trigger('hide:after', this, e, isFromInputControl);
},
onFieldPickerSelect: function(picker, item, record) {
//
},
onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
this.needFillComboView = this.disabled;
if (this.disabled || fromKeyDown===true) return;
/*this.fillComboView(record, false);
if (record && !this.isSuspendEvents)
this.trigger('select', this, record);*/
},
onFieldPickerClick: function(dataView, item, record) {
if (this.disabled) return;
var isActive = item.$el.hasClass('active');
if (!this.isSuspendEvents)
this.trigger('click', this, record, isActive);
if (this.options.hint) {
var tip = this.cmpEl.data('bs.tooltip');
if (tip) {
if (tip.dontShow===undefined)
tip.dontShow = true;
tip.hide();
}
}
if (!isActive) {
this.activateRecord(record);
}
},
onMenuPickerClick: function(dataView, itemView, record) {
if (this.disabled) return;
if (!this.isSuspendEvents)
this.trigger('click', this, record);
this.activateRecord(record);
},
onPickerItemContextMenu: function(dataView, itemView, record, e) {
if (this.disabled) return;
if (!this.isSuspendEvents) {
this.trigger('contextmenu', this, record, e);
}
e.preventDefault();
e.stopPropagation();
return false;
},
onPickerComboContextMenu: function(mouseEvent) {
if (this.disabled) return;
if (!this.isSuspendEvents) {
this.trigger('contextmenu', this, undefined, mouseEvent);
}
},
setDisabled: function(disabled) {
this.disabled = disabled;
if (!this.rendered)
return;
this.cmpEl.toggleClass('disabled', disabled);
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
this.fieldPicker.setDisabled(disabled);
},
isDisabled: function() {
return this.disabled;
}
})
});

View file

@ -262,6 +262,7 @@ define([
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;
@ -272,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;
@ -454,14 +456,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);
@ -683,17 +699,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)
@ -805,8 +831,24 @@ define([
this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
focus: function(index) {
$(this.el).find('.inner').addBack().filter('.inner').focus();
var rec;
if (typeof index == 'string') {
if (index == 'first') {
rec = this.selectByIndex(0, true);
} else if (index == 'last') {
if (this._layoutParams === undefined)
this.fillIndexesArray();
rec = this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true);
}
} else if (index !== undefined)
rec = this.selectByIndex(index, true);
this.scrollToRecord(rec);
},
focusInner: function(e) {
this.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
}
});
@ -874,7 +916,8 @@ define([
this.cmpEl.html(this.template({
items: me.store.toJSON(),
itemTemplate: me.itemTemplate,
style: me.style
style: me.style,
options: me.options
}));
}
var modalParents = this.cmpEl.closest('.asc-window');
@ -1088,6 +1131,8 @@ define([
if (data.keyCode==Common.UI.Keys.RETURN) {
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
rec = this.selectedBeforeHideRec;
if (this.canAddRecents) // only for DaraViewShape
this.addRecentItem(rec);
this.trigger('item:click', this, this, rec, e);
if (this.parentMenu)
this.parentMenu.hide();
@ -1131,17 +1176,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)
@ -1257,4 +1312,266 @@ define([
}
}, 100);
});
Common.UI.DataViewShape = Common.UI.DataViewSimple.extend(_.extend({
template: _.template([
'<div class="dataview inner" style="<%= style %>">',
'<% _.each(options.groupsWithRecent, function(group, index) { %>',
'<div class="grouped-data <% if (index === 0) { %> recent-group <% } %> " id="<%= group.id %>" >',
'<% if (!_.isEmpty(group.groupName)) { %>',
'<div class="group-description">',
'<span><%= group.groupName %></span>',
'</div>',
'<% } %>',
'<div class="group-items-container <% if (index === 0) { %> recent-items <% } %>">',
'<% _.each(group.groupStore.toJSON(), function(item) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>',
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
'<% }); %>',
'</div>',
'</div>',
'<% }); %>',
'</div>'
].join('')),
initialize : function(options) {
var me = this;
this.canAddRecents = true;
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
me.groups = options.groups.toJSON();
if (options.isFromImage) {
var store = me.groups[0].groupStore.clone();
store.shift();
me.groups[0].groupStore = store;
}
// add recent shapes to store
var recentStore = new Common.UI.DataViewGroupStore,
recentArr = options.recentShapes || [],
cols = (recentArr.length) > 18 ? 7 : 6,
height = Math.ceil(recentArr.length/cols) * 35 + 3,
width = 30 * cols;
me.recentShapes = recentArr;
// Add default recent
if (me.recentShapes.length < 12) {
var count = 12 - me.recentShapes.length,
defaultArr = [];
var addItem = function (rec) {
var item = rec.toJSON(),
model = {
data: item.data,
tip: item.tip,
allowSelected: item.allowSelected,
selected: false
};
defaultArr.push(model);
};
for (var i = 0; i < me.groups.length && count > 0; i++) {
var groupStore = me.groups[i].groupStore;
if (i === 0) {
addItem(groupStore.at(1));
count--;
if (count > 0) {
addItem(groupStore.at(2));
count--;
}
} else if (i !== 3 && i !== 6 && i !== 7) {
addItem(groupStore.at(0));
count--;
if (count > 0) {
addItem(groupStore.at(1));
count--;
}
}
}
me.recentShapes = me.recentShapes.concat(defaultArr);
}
recentStore.add(me.recentShapes);
me.groups.unshift({
groupName : options.textRecentlyUsed,
groupStore : recentStore,
groupWidth : width,
groupHeight : height
});
me.options.groupsWithRecent = me.groups;
var store = new Common.UI.DataViewStore();
_.each(me.groups, function (group) {
store.add(group.groupStore.models);
});
options.store = store;
Common.UI.DataViewSimple.prototype.initialize.call(this, options);
me.parentMenu.on('show:before', function() { me.updateRecents(); });
},
onAfterShowMenu: function(e) {
var me = this;
if (!me.dataViewItems) {
me.dataViewItems = [];
_.each(me.cmpEl.find('div.grouped-data'), function (group, indexGroup) {
_.each($(group).find('div.item'), function (item, index) {
var $item = $(item),
rec = me.groups[indexGroup].groupStore.at(index);
me.dataViewItems.push({el: $item, groupIndex: indexGroup, index: index});
var tip = rec.get('tip');
if (tip) {
$item.one('mouseenter', function(){ // hide tooltip when mouse is over menu
$item.attr('data-toggle', 'tooltip');
$item.tooltip({
title : tip,
placement : 'cursor',
zIndex : me.tipZIndex
});
$item.mouseenter();
});
}
});
});
}
if (me.updateDataViewItems && me.cmpEl.is(':visible')) {
// add recent item in dataViewItems
var recent = _.where(me.dataViewItems, {groupIndex: 0});
var len = recent ? recent.length : 0;
for (var i = 0; i < len; i++) {
var tip = me.dataViewItems[i].el.data('bs.tooltip');
if (tip) {
if (tip.dontShow===undefined)
tip.dontShow = true;
(tip.tip()).remove();
}
}
me.dataViewItems = me.dataViewItems.slice(len);
var recentViewItems = [];
_.each(me.cmpEl.find('.recent-group div.item'), function (item, index) {
var $item = $(item),
rec = me.recentShapes[index];
recentViewItems.push({el: $item, groupIndex: 0, index: index});
var tip = rec.tip;
if (tip) {
$item.one('mouseenter', function(){ // hide tooltip when mouse is over menu
$item.attr('data-toggle', 'tooltip');
$item.tooltip({
title: tip,
placement: 'cursor',
zIndex : me.tipZIndex
});
$item.mouseenter();
});
}
});
me.dataViewItems = recentViewItems.concat(me.dataViewItems);
me.fillIndexesArray();
if (me.recentShapes.length === 1) {
$('.recent-group').show();
}
me.updateDataViewItems = false;
}
},
onClickItem: function(e) {
if ( this.disabled ) return;
window._event = e; // for FireFox only
var groupIndex = $(e.currentTarget).closest('div.grouped-data').index(),
itemIndex = $(e.currentTarget).closest('div.item').index();
var index = _.findIndex(this.dataViewItems, function (item) {
return (item.groupIndex === groupIndex && item.index === itemIndex);
});
var record = (index>=0) ? this.store.at(index) : null,
view = (index>=0) ? this.dataViewItems[index] : null;
if (!record || !view) return;
record.set({selected: true});
var tip = view.el.data('bs.tooltip');
if (tip) (tip.tip()).remove();
if (!this.isSuspendEvents) {
this.trigger('item:click', this, view.el, record, e);
}
this.addRecentItem(record);
},
addRecentItem: function (rec) {
var me = this,
exist = false,
type = rec.get('data').shapeType;
for (var i = 0; i < me.recentShapes.length; i++) {
if (me.recentShapes[i].data.shapeType === type) {
exist = true;
break;
}
}
if (exist) return;
var item = rec.toJSON(),
model = {
data: item.data,
tip: item.tip,
allowSelected: item.allowSelected,
selected: false
};
me.recentShapes.unshift(model);
if (me.recentShapes.length > 12) {
me.recentShapes.splice(12, 1);
}
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes));
me.recentShapes = undefined;
},
updateRecents: function () {
var me = this,
recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes');
recents = recents ? JSON.parse(recents) : [];
var diff = false;
if (me.recentShapes) {
for (var i = 0; i < recents.length; i++) {
if (!me.recentShapes[i] || (me.recentShapes[i] && recents[i].tip !== me.recentShapes[i].tip)) {
diff = true;
}
}
} else {
diff = true;
}
if (recents.length > 0 && diff) {
me.recentShapes = recents;
me.groups[0].groupStore.reset(me.recentShapes);
var store = new Common.UI.DataViewStore();
_.each(me.groups, function (group) {
store.add(group.groupStore.models);
});
me.store = store;
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>',
'<% }) %>'
].join(''));
me.cmpEl && me.cmpEl.find('.recent-items').html(template({
items: me.recentShapes,
itemTemplate: this.itemTemplate,
style : this.style
}));
me.updateDataViewItems = true;
}
}
}));
});

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

@ -252,7 +252,7 @@ Common.UI.HintManager = new(function() {
var _getHints = function() {
var docH = Common.Utils.innerHeight() - 20,
docW = Common.Utils.innerWidth() - 20,
docW = Common.Utils.innerWidth(),
topSection = _currentLevel !== 0 && $(_currentSection).length > 0 ? $(_currentSection).offset().top : 0,
bottomSection = _currentLevel !== 0 && $(_currentSection).length > 0 ? topSection + $(_currentSection).height() : docH;
@ -368,8 +368,8 @@ Common.UI.HintManager = new(function() {
_api = api;
Common.NotificationCenter.on({
'app:ready': function (mode) {
_lang = mode.lang;
_getAlphabetLetters();
var lang = mode.lang ? mode.lang.toLowerCase() : 'en';
_getAlphabetLetters(lang);
},
'hints:clear': _clearHints,
'window:resize': _clearHints
@ -492,10 +492,14 @@ Common.UI.HintManager = new(function() {
});
};
var _getAlphabetLetters = function () {
var _getAlphabetLetters = function (lng) {
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/alphabetletters.json', function (langsJson) {
_arrAlphabet = langsJson[_lang];
_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];

View file

@ -81,12 +81,11 @@ 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 %>"',
@ -165,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);
}
@ -183,9 +184,21 @@ define([
me.rendered = true;
if (me.value)
me.setValue(me.value);
return this;
},
checkPasswordType: function(){
if(this.type == 'text') return;
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
@ -303,6 +316,8 @@ define([
if (this.rendered){
this._input.val(value);
}
(this.type=='password') && this.checkPasswordType();
},
getValue: function() {
@ -422,7 +437,7 @@ define([
template: _.template([
'<div class="input-field input-field-btn" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'type="text" ',
'name="<%= name %>" ',
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
@ -468,6 +483,7 @@ define([
this._button = new Common.UI.Button({
el: this.cmpEl.find('button'),
iconCls: this.options.iconCls,
hint: this.options.btnHint || ''
});
this._button.on('click', _.bind(this.onButtonClick, this));
@ -498,6 +514,8 @@ define([
}
me.rendered = true;
if (me.value)
me.setValue(me.value);
return this;
},
@ -527,4 +545,106 @@ define([
}
}
})());
Common.UI.InputFieldBtnPassword = Common.UI.InputFieldBtn.extend(_.extend((function() {
return {
options: {
id: null,
cls: '',
style: '',
value: '',
name: '',
validation: null,
allowBlank: true,
placeHolder: '',
blankError: null,
spellcheck: false,
maskExp: '',
validateOnChange: false,
validateOnBlur: true,
disabled: false,
editable: true,
iconCls: 'btn-sheet-view',
btnHint: '',
repeatInput: null,
showPwdOnClick: true
},
initialize : function(options) {
options = options || {};
options.btnHint = options.btnHint || this.textHintShowPwd;
Common.UI.InputFieldBtn.prototype.initialize.call(this, options);
this.hidePwd = true;
this.repeatInput= this.options.repeatInput;
},
render: function (parentEl) {
Common.UI.InputFieldBtn.prototype.render.call(this, parentEl);
this._btnElm = this._button.$el;
this._input.on('input', _.bind(this.checkPasswordType, this));
if(this.options.showPwdOnClick)
this._button.on('click', _.bind(this.passwordClick, this));
else
this._btnElm.on('mousedown', _.bind(this.passwordShow, this));
return this;
},
passwordClick: function (e)
{
if(this.hidePwd) {
this.passwordShow(e);
this.hidePwd = false;
}
else {
this.passwordHide(e);
this.hidePwd = true;
}
},
passwordShow: function (e) {
if (this.disabled) return;
this._button.setIconCls('hide-password');
this.type = 'text';
this._input.attr('type', this.type);
if(this.repeatInput) {
this.repeatInput.type = this.type;
this.repeatInput._input.attr('type', this.type);
}
if(this.options.showPwdOnClick) {
this._button.updateHint(this.textHintHidePwd);
}
else {
this._btnElm.on('mouseup', _.bind(this.passwordHide, this));
this._btnElm.on('mouseout', _.bind(this.passwordHide, this));
}
},
passwordHide: function (e) {
this._button.setIconCls('btn-sheet-view');
this.type = 'password';
(this._input.val() !== '') && this._input.attr('type', this.type);
if(this.repeatInput) {
this.repeatInput.type = this.type;
(this.repeatInput._input.val() !== '') && this.repeatInput._input.attr('type', this.type);
}
if(this.options.showPwdOnClick) {
this._button.updateHint(this.textHintShowPwd);
}
else {
this._btnElm.off('mouseup', this.passwordHide);
this._btnElm.off('mouseout', this.passwordHide);
}
},
textHintShowPwd: 'Show password',
textHintHidePwd: 'Hide password'
}
})(), Common.UI.InputFieldBtnPassword || {}));
});

View file

@ -104,22 +104,29 @@ define([
return this;
},
internalShow: function() {
this.ownerEl.append(this.maskeEl);
internalShowLoader: function() {
this.ownerEl.append(this.loaderEl);
this.loaderEl.css('min-width', $('.asc-loadmask-title', this.loaderEl).width() + 105);
if (this.ownerEl && this.ownerEl.closest('.asc-window.modal').length==0)
Common.util.Shortcuts.suspendEvents();
},
show: function(immediately){
// The owner is already masked
if (!!this.ownerEl.ismasked)
return this;
internalShowMask: function() {
if (!!this.ownerEl.ismasked) return;
this.ownerEl.ismasked = true;
this.ownerEl.append(this.maskeEl);
},
show: function(immediately){
this.internalShowMask();
// The owner is already masked
if (!!this.ownerEl.hasloader)
return this;
this.ownerEl.hasloader = true;
var me = this;
if (me.title != me.options.title) {
@ -128,11 +135,11 @@ define([
}
if (immediately) {
me.internalShow();
me.internalShowLoader();
} else if (!me.timerId) {
// show mask after 500 ms if it wont be hided
me.timerId = setTimeout(function () {
me.internalShow();
me.internalShowLoader();
},500);
}
@ -145,20 +152,23 @@ define([
clearTimeout(this.timerId);
this.timerId = 0;
}
if (ownerEl && ownerEl.ismasked) {
ownerEl && ownerEl.ismasked && this.maskeEl && this.maskeEl.remove();
delete ownerEl.ismasked;
if (ownerEl && ownerEl.hasloader) {
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
Common.util.Shortcuts.resumeEvents();
this.maskeEl && this.maskeEl.remove();
this.loaderEl && this.loaderEl.remove();
}
delete ownerEl.ismasked;
delete ownerEl.hasloader;
},
setTitle: function(title) {
this.title = title;
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){
if (this.ownerEl && this.ownerEl.hasloader && this.loaderEl){
var el = $('.asc-loadmask-title', this.loaderEl);
el.html(title);
this.loaderEl.css('min-width', el.width() + 105);
@ -172,7 +182,7 @@ define([
updatePosition: function() {
var ownerEl = this.ownerEl,
loaderEl = this.loaderEl;
if (ownerEl && ownerEl.ismasked && loaderEl){
if (ownerEl && ownerEl.hasloader && loaderEl){
loaderEl.css({
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'

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) {
@ -588,7 +685,7 @@ define([
if (this.options.additionalAlign)
this.options.additionalAlign.call(this, menuRoot, left, top);
else {
var _css = {left: Math.ceil(left), top: Math.ceil(top)};
var _css = {left: left, top: top};
if (!(menuH < docH)) _css['margin-top'] = 0;
menuRoot.css(_css);

View file

@ -216,6 +216,9 @@ define([
});
}
if (this.cls)
el.addClass(this.cls);
if (this.disabled)
el.toggleClass('disabled', this.disabled);

View file

@ -242,6 +242,14 @@ define([
this.options.step = step;
},
getMinValue: function(){
return this.options.minValue;
},
getMaxValue: function(){
return this.options.maxValue;
},
getNumberValue: function(){
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
},

View file

@ -386,14 +386,11 @@ define([
need_sort = position < minValue || position > maxValue,
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);
$(document).off('mousemove', me.binding.onMouseMove);
me._dragstart = undefined;
return;
}
if (me.isRemoveThumb) {
me.trigger('removethumb', me, _.findIndex(me.thumbs, {index: index}));
me.trigger('change', me, value, lastValue);
me.trigger('changecomplete', me, value, lastValue);
@ -407,7 +404,6 @@ define([
$(document).off('mouseup', me.binding.onMouseUp);
$(document).off('mousemove', me.binding.onMouseMove);
me._dragstart = undefined;
!me.isRemoveThumb && me.trigger('changecomplete', me, value, lastValue);
me.isRemoveThumb = undefined;

View file

@ -44,7 +44,8 @@ define([
target : $(document.body),
text : '',
placement: 'right-bottom',
showLink: true
showLink: true,
showButton: false
},
template: _.template([
@ -58,6 +59,9 @@ define([
'<% 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 +75,8 @@ 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.textButton = this.options.textButton || '';
},
render: function() {
@ -79,6 +85,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();

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,7 +170,7 @@ 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) {
@ -251,8 +181,9 @@ define([
lockDrag = true;
}
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 +200,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 +216,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.metaKey || event.ctrlKey ? 'copy' : 'move';
} else {
event.dataTransfer.dropEffect = 'none';
}
@ -305,6 +229,7 @@ define([
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
event.dataTransfer.dropEffect = event.metaKey || event.ctrlKey ? 'copy' : 'move';
} else {
event.dataTransfer.dropEffect = 'none';
}
@ -315,7 +240,7 @@ define([
}, this),
dragend: $.proxy(function (e) {
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);
@ -326,7 +251,7 @@ define([
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 || event.metaKey);
this.bar.isDrop = true;
}, this)
});
@ -365,23 +290,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.metaKey || event.ctrlKey ? '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.metaKey || event.ctrlKey ? 'copy' : 'move') : 'none';
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
return false;
}, this));
@ -392,7 +314,7 @@ 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');
this.trigger('tab:drop', event.dataTransfer, 'last', event.ctrlKey || event.metaKey);
} else {
this.isDrop = undefined;
}

View file

@ -370,8 +370,8 @@ define([
template: _.template([
'<div id="<%=scope.id%>" class="table-styler" style="position: relative; width: <%=scope.width%>px; height:<%=scope.height%>px;">',
'<div style="position: absolute; left: 0; top: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-bottom: 1px dotted gray; border-right: 1px dotted gray;"></div>',
'<div style="position: absolute; left: <%=scope.tablePadding%>px; top: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
'<div class="ts-preview-box ts-preview-box--lt" style="left: 0; top: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
'<div class="ts-preview-box ts-preview-box--mt" style="left: <%=scope.tablePadding%>px; top: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
'<div id="<%=scope.id%>-table-top-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; top: <%=scope.tablePadding * .5%>px;">',
'<table width="100%" height="100%">',
'<tr>',
@ -383,9 +383,9 @@ define([
'</table>',
'</div>',
'</div>',
'<div style="position: absolute; top: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-bottom: 1px dotted gray; border-left: 1px dotted gray;"></div>',
'<div class="ts-preview-box ts-preview-box--rt" style="top: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
'<div style="position: absolute; left: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
'<div class="ts-preview-box ts-preview-box--lm" style="left: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
'<div id="<%=scope.id%>-table-left-border-selector" style="position: absolute; z-index: 1; left: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
'<table width="100%" height="100%">',
'<tr>',
@ -395,7 +395,7 @@ define([
'</table>',
'</div>',
'</div>',
'<div style="position: absolute; left: <%=scope.tablePadding%>px; top: <%=scope.tablePadding%>px; right: <%=scope.tablePadding%>px; bottom: <%=scope.tablePadding%>px;">',
'<div class="ts-preview-box ts-preview-box--mm" style="left: <%=scope.tablePadding%>px; top: <%=scope.tablePadding%>px; right: <%=scope.tablePadding%>px; bottom: <%=scope.tablePadding%>px;">',
'<table id="<%=scope.id%>-table-content" cols="<%=scope.columns%>" width="100%" height="100%" style="border-collapse: inherit; border-spacing: <%= scope.spacingMode ? scope.cellPadding : 0 %>px;">',
'<% for (var row = 0; row < scope.rows; row++) { %>',
'<tr>',
@ -406,7 +406,7 @@ define([
'<% } %>',
'</table>',
'</div>',
'<div style="position: absolute; right: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
'<div class="ts-preview-box ts-preview-box--rm" style="right: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
'<div id="<%=scope.id%>-table-right-border-selector" style="position: absolute; z-index: 1; right: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
'<table width="100%" height="100%">',
'<tr>',
@ -417,8 +417,8 @@ define([
'</div>',
'</div>',
'<div style="position: absolute; left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-right: 1px dotted gray;"></div>',
'<div style="position: absolute; left: <%=scope.tablePadding%>px; bottom: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
'<div class="ts-preview-box ts-preview-box--lb" style="left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
'<div class="ts-preview-box ts-preview-box--mb" style="left: <%=scope.tablePadding%>px; bottom: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
'<div id="<%=scope.id%>-table-bottom-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; bottom: <%=scope.tablePadding * .5%>px;">',
'<table width="100%" height="100%">',
'<tr>',
@ -430,7 +430,7 @@ define([
'</table>',
'</div>',
'</div>',
'<div style="position: absolute; bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-left: 1px dotted gray;"></div>',
'<div class="ts-preview-box ts-preview-box--rb" style="bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
'</div>'
].join('')),

View file

@ -105,7 +105,7 @@ define([
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.parentButton = me.options.parentButton;
this.outerMenu = me.options.outerMenu;
this.lastSelectedIdx = -1;
me.colorItems = [];
@ -516,8 +516,8 @@ define([
var rec = this.getSelectedColor();
if (data.keyCode==Common.UI.Keys.RETURN) {
rec && this.selectByIndex(rec.index);
if (this.parentButton && this.parentButton.menu)
this.parentButton.menu.hide();
if (this.outerMenu && this.outerMenu.menu)
this.outerMenu.menu.hide();
} else {
var idx = rec ? rec.index : -1;
if (idx<0) {
@ -544,9 +544,9 @@ define([
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else if (data.keyCode==Common.UI.Keys.UP) {
if (topIdx==0 && this.parentButton) {
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
this.clearSelection(true);
this.parentButton.focusOuter(data);
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
} else
while (idx===undefined) {
topIdx--;
@ -554,9 +554,9 @@ define([
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
}
} else {
if (topIdx==this._layoutParams.rows-1 && this.parentButton) {
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
this.clearSelection(true);
this.parentButton.focusOuter(data);
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
} else
while (idx===undefined) {
topIdx++;
@ -635,6 +635,10 @@ define([
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

@ -903,8 +903,6 @@ define([
// хотим показать тот же коментарий что был и выбран
return;
}
if (this.mode && !this.mode.canComments)
hint = true;
var popover = this.getPopover();
if (popover) {
@ -1222,7 +1220,8 @@ define([
renderTo : this.sdkViewName,
canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined,
canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined,
mentionShare: (this.mode) ? this.mode.mentionShare : true
mentionShare: (this.mode) ? this.mode.mentionShare : true,
api: this.api
});
this.popover.setCommentsStore(this.popoverComments);
}

View file

@ -120,11 +120,7 @@ define([
});
var store = this.getCollection('Common.Collections.Fonts');
if (store) {
store.add(fontsArray);
store.sort();
}
store && store.add(fontsArray);
Common.NotificationCenter.trigger('fonts:load', store, select);
}

View file

@ -202,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;
@ -217,7 +218,7 @@ define([
rev.set('docIdPrev', docIdPrev, {silent: true});
}
rev.set('token', token, {silent: true});
opts.data.fileType && rev.set('fileType', opts.data.fileType, {silent: true});
fileType && rev.set('fileType', fileType, {silent: true});
}
}
var hist = new Asc.asc_CVersionHistory();

View file

@ -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

@ -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));
@ -132,8 +132,7 @@ define([
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onBeginViewModeInReview', _.bind(this.onBeginViewModeInReview, this));
this.api.asc_registerCallback('asc_onEndViewModeInReview', _.bind(this.onEndViewModeInReview, this));
this.api.asc_registerCallback('asc_onChangeDisplayModeInReview', _.bind(this.onChangeDisplayModeInReview, this));
}
if (this.appConfig.canReview)
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
@ -182,7 +181,7 @@ define([
onApiShowChange: function (sdkchange) {
if (this.getPopover()) {
if (sdkchange && sdkchange.length>0) {
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0) {
var i = 0,
changes = this.readSDKChange(sdkchange),
posX = sdkchange[0].get_X(),
@ -257,7 +256,8 @@ define([
if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) {
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
reviewStore : this.popoverChanges,
renderTo : this.sdkViewName
renderTo : this.sdkViewName,
api: this.api
});
this.popover.setReviewStore(this.popoverChanges);
}
@ -596,7 +596,10 @@ define([
onReviewViewClick: function(menu, item, e) {
this.turnDisplayMode(item.value);
!this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value);
if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit)
Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); // for viewer
else if (item.value=='markup' || item.value=='simple')
Common.localStorage.setItem(this.view.appPrefix + "review-mode-editor", item.value); // for editor save only markup modes
Common.NotificationCenter.trigger('edit:complete', this.view);
},
@ -686,27 +689,40 @@ define([
turnDisplayMode: function(mode) {
if (this.api) {
if (mode === 'final')
this.api.asc_BeginViewModeInReview(true);
else if (mode === 'original')
this.api.asc_BeginViewModeInReview(false);
else
this.api.asc_EndViewModeInReview();
var type = Asc.c_oAscDisplayModeInReview.Edit;
switch (mode) {
case 'final':
type = Asc.c_oAscDisplayModeInReview.Final;
break;
case 'original':
type = Asc.c_oAscDisplayModeInReview.Original;
break;
case 'simple':
type = Asc.c_oAscDisplayModeInReview.Simple;
break;
}
this.api.asc_SetDisplayModeInReview(type);
}
this.disableEditing(mode == 'final' || mode == 'original');
this._state.previewMode = (mode == 'final' || mode == 'original');
},
onBeginViewModeInReview: function(mode) {
this.disableEditing(true);
this.view && this.view.turnDisplayMode(mode ? 'final' : 'original');
this._state.previewMode = true;
},
onEndViewModeInReview: function() {
this.disableEditing(false);
this.view && this.view.turnDisplayMode('markup');
this._state.previewMode = false;
onChangeDisplayModeInReview: function(type) {
this.disableEditing(type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
var mode = 'markup';
switch (type) {
case Asc.c_oAscDisplayModeInReview.Final:
mode = 'final';
break;
case Asc.c_oAscDisplayModeInReview.Original:
mode = 'original';
break;
case Asc.c_oAscDisplayModeInReview.Simple:
mode = 'simple';
break;
}
this.view && this.view.turnDisplayMode(mode);
this._state.previewMode = (type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
},
isPreviewChangesMode: function() {
@ -808,7 +824,15 @@ define([
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
// _setReviewStatus(state, global);
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor");
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.review && me.appConfig.customization.review.showReviewChanges==true ||
(!me.appConfig.customization.review || me.appConfig.customization.review.showReviewChanges===undefined) && me.appConfig.customization.showReviewChanges==true) ) {
@ -824,14 +848,14 @@ define([
} else if (config.canViewReview) {
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 + "review-mode");
var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "review-mode"));
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)$/i.test(val) ? val.toLocaleLowerCase() : 'original';
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
}
me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer
me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val);
me.turnDisplayMode(val);
me.view.turnDisplayMode(val);
}
}
@ -846,6 +870,14 @@ define([
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");
if (val === null) {
val = me.appConfig.customization && me.appConfig.customization.review ? !!me.appConfig.customization.review.hoverMode : false;
} else
val = !!parseInt(val);
Common.Utils.InternalSettings.set(me.view.appPrefix + "settings-review-hover-mode", val);
me.appConfig.reviewHoverMode = val;
},
showTips: function(strings) {
@ -985,7 +1017,7 @@ define([
var wbprotect = this.getApplication().getController('WBProtection');
props = wbprotect ? wbprotect.getWSProps() : null;
}
this._state.wsProps = props ? props.wsProps : {};
this._state.wsProps = props ? props.wsProps : [];
this._state.wsLock = props ? props.wsLock : false;
if (!this.view) return;

View file

@ -82,6 +82,7 @@ define([
"text-inverse",
"text-toolbar-header",
"text-contrast-background",
"text-alt-key-hint",
"icon-normal",
"icon-normal-pressed",
@ -117,6 +118,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",
@ -188,6 +191,8 @@ define([
function ( obj ) {
if ( obj != 'error' ) {
parse_themes_object(obj);
} else {
console.warn('failed to load/parse themes.json');
}
}
);
@ -245,6 +250,23 @@ define([
this.api = api;
var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme'));
if ( !theme_name ) {
if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) )
document.body.classList.forEach(function (classname, i, o) {
if ( !theme_name && classname.startsWith('theme-') &&
!classname.startsWith('theme-type-') && themes_map[classname] )
{
theme_name = classname;
var theme_obj = {
id: theme_name,
type: themes_map[theme_name].type
};
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
}
});
}
if ( !themes_map[theme_name] )
theme_name = id_default_light_theme;

View file

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

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>
@ -97,8 +98,11 @@
</div>
<div id="id-autocorrect-dialog-settings-autocorrect" class="settings-panel">
<div class="inner-content" style="width: 100%;">
<div class="padding-large">
<div class="padding-small">
<div id="id-autocorrect-dialog-chk-fl-sentence"></div>
</div>
<div class="padding-large">
<div id="id-autocorrect-dialog-chk-fl-cells"></div>
</div>
</div>
</div>

View file

@ -70,16 +70,20 @@
<!-- edit buttons -->
<% if (!editText && !lock && !scope.viewmode) { %>
<% if (!editText && !lock) { %>
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% if (!scope.viewmode) { %>
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (editable) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% if (editable && !scope.viewmode) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% } else if ((!editable || scope.viewmode) && resolved) { %>
<div class="icon-resolve i-comment-resolved" data-toggle="tooltip"></div>
<% } %>
</div>
<% } %>

View file

@ -7,7 +7,7 @@
<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) { %>
<% if (!editTextInPopover || hint || scope.viewmode) { %>
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(comment)%></div>
<% } else { %>
<div class="inner-edit-ct">
@ -37,7 +37,7 @@
<div class="user-date"><%=item.get("date")%></div>
<% if (!item.get("editTextInPopover")) { %>
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(item.get("reply"))%></div>
<% if (!hint) { %>
<% if (!hint && !scope.viewmode) { %>
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
@ -61,7 +61,7 @@
<!-- add reply button -->
<% if (!showReplyInPopover && !hideAddReply && !hint) { %>
<% if (!showReplyInPopover && !hideAddReply && !hint && !scope.viewmode) { %>
<% if (replys.length && !add_arrow) { %>
<label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>
<% } else { %>
@ -71,16 +71,20 @@
<!-- edit buttons -->
<% if (!editTextInPopover && !lock && !hint) { %>
<% if (!editTextInPopover && !lock) { %>
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% if (!hint && !scope.viewmode) { %>
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (editable) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% if (editable && !hint && !scope.viewmode) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% } else if (!hint && (!editable || scope.viewmode) && resolved) { %>
<div class="icon-resolve i-comment-resolved" data-toggle="tooltip"></div>
<% } %>
</div>
<% } %>

View file

@ -42,7 +42,28 @@ var params = (function() {
return urlParams;
})();
if ( !!params.uitheme && !localStorage.getItem("ui-theme-id") ) {
var checkLocalStorage = (function () {
try {
var storage = window['localStorage'];
return true;
}
catch(e) {
return false;
}
})();
if ( window.desktop && window.desktop.theme ) {
if ( window.desktop.theme.id ) {
// params.uitheme = undefined;
localStorage.setItem("ui-theme-id", window.desktop.theme.id);
} else
if ( window.desktop.theme.type ) {
if ( window.desktop.theme.type == 'dark' ) params.uitheme == 'default-dark'; else
if ( window.desktop.theme.type == 'light' ) params.uitheme == 'default-light';
}
}
if ( !!params.uitheme && checkLocalStorage && !localStorage.getItem("ui-theme-id") ) {
// const _t = params.uitheme.match(/([\w-]+)/g);
if ( params.uitheme == 'default-dark' )
@ -51,14 +72,14 @@ if ( !!params.uitheme && !localStorage.getItem("ui-theme-id") ) {
if ( params.uitheme == 'default-light' )
params.uitheme = 'theme-classic-light';
localStorage.setItem("ui-theme-id", params.uitheme);
localStorage.removeItem("ui-theme");
}
var ui_theme_name = localStorage.getItem("ui-theme-id");
var ui_theme_name = checkLocalStorage && localStorage.getItem("ui-theme-id") ? localStorage.getItem("ui-theme-id") : params.uitheme;
if ( !ui_theme_name ) {
if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) {
ui_theme_name = 'theme-dark';
localStorage.setItem("ui-theme-id", ui_theme_name);
checkLocalStorage && localStorage.removeItem("ui-theme");
}
}
if ( !!ui_theme_name ) {

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){
@ -336,10 +337,21 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.api.asc_SetAutoCorrectFirstLetterOfSentences && me.api.asc_SetAutoCorrectFirstLetterOfSentences(checked);
});
this.chFLCells = new Common.UI.CheckBox({
el: $window.find('#id-autocorrect-dialog-chk-fl-cells'),
labelText: this.textFLCells,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-fl-cells")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-fl-cells", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-fl-cells", checked);
me.api.asc_SetAutoCorrectFirstLetterOfCells && me.api.asc_SetAutoCorrectFirstLetterOfCells(checked);
});
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 +360,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,10 +392,10 @@ 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.chFLSentence ? [this.chFLSentence] : []);
arr = arr.concat(this.chNewRows ? [this.chNewRows] : [this.chQuotes, this.chHyphens, this.chBulleted, this.chNumbered]);
arr = arr.concat(this.chFLSentence ? [this.chFLSentence, this.chFLCells] : []);
return arr;
},
@ -453,7 +464,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);
},
@ -829,7 +840,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
textNewRowCol: 'Include new rows and columns in table',
textAutoCorrect: 'AutoCorrect',
textFLSentence: 'Capitalize first letter of sentences',
textHyperlink: 'Internet and network paths with hyperlinks'
textHyperlink: 'Internet and network paths with hyperlinks',
textFLCells: 'Capitalize first letter of table cells'
}, Common.Views.AutoCorrectDialog || {}))
});

View file

@ -447,6 +447,11 @@ define([
btns.each(function(idx, item){
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.i-comment-resolved');
btns.tooltip({title: me.textViewResolved, placement: 'cursor'});
btns.each(function(idx, item){
arr.push($(item).data('bs.tooltip').tip());
});
view.tipsArray = arr;
};
@ -831,6 +836,7 @@ define([
mniAuthorDesc: 'Author Z to A',
mniDateDesc: 'Newest',
mniDateAsc: 'Oldest',
textClosePanel: 'Close comments'
textClosePanel: 'Close comments',
textViewResolved: 'You have not permission for reopen comment'
}, Common.Views.Comments || {}))
});

View file

@ -95,7 +95,7 @@ define([
labelText: this.textDontShow
});
this.getChild().find('.btn').on('click', _.bind(this.onBtnClick, this));
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.autoSize();
},

View file

@ -85,7 +85,7 @@ define([
me.inputLabel.setValue(this.options.value || '' );
var $window = this.getChild();
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
show: function() {

View file

@ -83,7 +83,7 @@ define([
});
var $window = this.getChild();
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
show: function() {

View file

@ -99,7 +99,7 @@ define([
'<% 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>',
@ -162,10 +162,10 @@ define([
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok">' + t.okButtonText + '</button>',
'<% if (closeFile) { %>',
'<button class="btn normal dlg-btn" result="cancel" style="margin-left:10px;">' + t.closeButtonText + '</button>',
'<button class="btn normal dlg-btn custom" result="cancel" style="margin-left:10px;">' + t.closeButtonText + '</button>',
'<% } %>',
'<% if (closable) { %>',
'<button class="btn normal dlg-btn" result="cancel" style="margin-left:10px;">' + t.cancelButtonText + '</button>',
'<button class="btn normal dlg-btn custom" result="cancel" style="margin-left:10px;">' + t.cancelButtonText + '</button>',
'<% } %>',
'</div>'
].join('');
@ -200,22 +200,15 @@ define([
this.previewInner = this.previewScrolled.find('div:first-child');
if (this.type == Common.Utils.importTextType.DRM) {
this.inputPwd = new Common.UI.InputField({
this.inputPwd = new Common.UI.InputFieldBtnPassword({
el: $('#id-password-txt'),
type: 'text',
type: 'password',
validateOnBlur: false,
showPwdOnClick: true,
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) {
@ -299,10 +292,12 @@ define([
}
var decimal = this.separatorOptions ? this.separatorOptions.decimal : undefined,
thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined;
thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined,
qualifier = this.separatorOptions ? this.separatorOptions.qualifier : '"';
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
decimal && options.asc_setNumberDecimalSeparator(decimal);
thousands && options.asc_setNumberGroupSeparator(thousands);
qualifier && options.asc_setTextQualifier(qualifier);
this.handler.call(this, state, {
textOptions: options,
range: this.txtDestRange ? this.txtDestRange.getValue() : '',
@ -428,30 +423,23 @@ define([
delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
(delimiter == -1) && (delimiter = null);
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
options.asc_setTextQualifier(this.separatorOptions.qualifier);
}
switch (this.type) {
case Common.Utils.importTextType.CSV:
this.api.asc_decodeBuffer(this.preview, new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this));
break;
case Common.Utils.importTextType.TXT:
this.api.asc_decodeBuffer(this.preview, new Asc.asc_CTextOptions(encoding), _.bind(this.previewCallback, this));
case Common.Utils.importTextType.Data:
this.api.asc_decodeBuffer(this.preview, options, _.bind(this.previewCallback, this));
break;
case Common.Utils.importTextType.Paste:
case Common.Utils.importTextType.Columns:
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
}
this.api.asc_TextImport(options, _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
break;
case Common.Utils.importTextType.Data:
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
}
this.api.asc_decodeBuffer(this.preview, options, _.bind(this.previewCallback, this));
break;
}
},
@ -543,19 +531,23 @@ define([
if (!SSE) return;
var me = this,
decimal = this.api.asc_getDecimalSeparator(),
thousands = this.api.asc_getGroupSeparator();
decimal = this.separatorOptions ? this.separatorOptions.decimal : this.api.asc_getDecimalSeparator(),
thousands = this.separatorOptions ? this.separatorOptions.thousands : this.api.asc_getGroupSeparator(),
qualifier = this.separatorOptions ? this.separatorOptions.qualifier : (this.settings || (new Asc.asc_CTextOptions())).asc_getTextQualifier();
(new SSE.Views.AdvancedSeparatorDialog({
props: {
decimal: decimal,
thousands: thousands
thousands: thousands,
qualifier: qualifier
},
handler: function(result, value) {
if (result == 'ok') {
me.separatorOptions = {
decimal: (value.decimal.length > 0) ? value.decimal : decimal,
thousands: (value.thousands.length > 0) ? value.thousands : thousands
thousands: (value.thousands.length > 0) ? value.thousands : thousands,
qualifier: value.qualifier
};
me.preview && me.updatePreview();
}
}
})).show();

View file

@ -93,14 +93,7 @@ define([
if (this.$window) {
var me = this;
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.inputPwd = new Common.UI.InputField({
el: $('#id-password-txt'),
type: 'password',
allowBlank : false,
style : 'width: 100%;',
maxLength: 255,
validateOnBlur: false
});
this.repeatPwd = new Common.UI.InputField({
el: $('#id-repeat-txt'),
type: 'password',
@ -112,6 +105,15 @@ define([
return me.txtIncorrectPwd;
}
});
this.inputPwd = new Common.UI.InputFieldBtnPassword({
el: $('#id-password-txt'),
type: 'password',
allowBlank : false,
style : 'width: 100%;',
maxLength: 255,
validateOnBlur: false,
repeatInput: this.repeatPwd
});
}
},

View file

@ -314,7 +314,16 @@ 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,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
value: 'simple',
template: menuTemplate,
description: Common.Utils.String.format(this.txtMarkupSimple, !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit ? '' : '(' + this.txtEditing + ')')
},
{
caption: this.txtFinalCap,
@ -322,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'
},
{
@ -331,7 +340,7 @@ 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'
}
]
@ -798,8 +807,9 @@ define([
turnDisplayMode: function(mode) {
if (this.btnReviewView) {
this.btnReviewView.menu.items[0].setChecked(mode=='markup', true);
this.btnReviewView.menu.items[1].setChecked(mode=='final', true);
this.btnReviewView.menu.items[2].setChecked(mode=='original', true);
this.btnReviewView.menu.items[1].setChecked(mode=='simple', true);
this.btnReviewView.menu.items[2].setChecked(mode=='final', true);
this.btnReviewView.menu.items[3].setChecked(mode=='original', true);
}
},
@ -852,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',
@ -898,7 +908,11 @@ define([
txtOff: 'OFF for me',
textWarnTrackChangesTitle: 'Enable Track Changes for everyone?',
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'
textEnable: 'Enable',
txtMarkupSimpleCap: 'Simple Markup',
txtMarkupSimple: 'All changes {0}<br>Turn off balloons',
txtEditing: 'Editing',
txtPreview: 'Preview'
}
}()), Common.Views.ReviewChanges || {}));

View file

@ -103,6 +103,7 @@ define([
this.canRequestUsers = options.canRequestUsers;
this.canRequestSendNotify = options.canRequestSendNotify;
this.mentionShare = options.mentionShare;
this.api = options.api;
this.externalUsers = [];
this._state = {commentsVisible: false, reviewVisible: false};
@ -268,6 +269,11 @@ define([
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.i-comment-resolved');
btns.tooltip({title: me.textViewResolved, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
view.tipsArray = arr;
this.autoHeightTextBox();
};
@ -737,7 +743,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();
@ -784,7 +791,7 @@ define([
}
}
}
if (!retainContent)
if (!retainContent || this.isOverCursor())
this.calculateSizeOfContent();
},
calculateSizeOfContent: function (testVisible) {
@ -804,6 +811,7 @@ define([
sdkPanelTop = '',
sdkPanelHeight = 0,
arrowPosY = 0,
arrowPosX = 0,
windowHeight = 0,
outerHeight = 0,
topPos = 0,
@ -839,7 +847,46 @@ define([
outerHeight = Math.max(commentsView.outerHeight(), this.$window.outerHeight());
if (sdkBoundsHeight <= outerHeight) {
var movePos = this.isOverCursor();
if (movePos) {
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) {
var diffUp = newTopUp - sdkBoundsTop;
if (diffDown < diffUp * 0.9) {// magic)
this.$window.css({
maxHeight: diffUp + 'px',
top: sdkBoundsTop + 'px'
});
commentsView.css({height: diffUp - 3 + 'px'});
} else {
this.$window.css({
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 {
isMoveDown = true;
this.$window.css('top', newTopDown + 'px'); // move down
}
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',
top: sdkBoundsTop + sdkPanelHeight + 'px'
@ -850,7 +897,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.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
this.scroller.scrollTop(scrollPos);
} else {
@ -868,7 +917,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.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
}
}
}
@ -880,6 +931,30 @@ define([
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
}
},
isOverCursor: function() {
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,
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];
}
},
saveText: function (clear) {
if (this.commentsView && this.commentsView.cmpEl.find('.lock-area').length < 1) {
this.textVal = undefined;
@ -1179,6 +1254,7 @@ 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',
textViewResolved : 'You have not permission for reopen comment'
}, Common.Views.ReviewPopover || {}))
});

View file

@ -87,10 +87,10 @@
'<div class="box">',
'<div class="input-row">',
'<span class="btn-placeholder" id="search-placeholder-btn-options"></span>',
'<input type="text" id="sd-text-search" class="input-field form-control" maxlength="255" placeholder="'+this.textSearchStart+'">',
'<input type="text" id="sd-text-search" class="input-field form-control" maxlength="255" placeholder="'+this.textSearchStart+'" autocomplete="off">',
'</div>',
'<div class="input-row">',
'<input type="text" id="sd-text-replace" class="input-field form-control" maxlength="255" placeholder="'+this.textReplaceDef+'">',
'<input type="text" id="sd-text-replace" class="input-field form-control" maxlength="255" placeholder="'+this.textReplaceDef+'" autocomplete="off">',
'</div>',
'<div class="input-row">',
'<label class="link" id="search-label-replace" result="replaceshow">'+this.txtBtnReplace+'</label>',

View file

@ -91,7 +91,7 @@ define([
});
var $window = this.getChild();
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
show: function() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 101 B

View file

@ -1,10 +1,12 @@
<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>
<g clip-path="url(#clip0)">
<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"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="96" height="96" fill="white"/>
</clipPath>
</defs>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 534 B

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.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -4,7 +4,7 @@
(min-resolution: 1.25dppx) and (max-resolution: 1.4dppx),
(min-resolution: 120dpi) and (max-resolution: 143dpi)
{
.x-huge .toolbar__icon {
.x-huge .toolbar__icon, .toolbar__icon.toolbar__icon-big {
background-image: url(resources/{{{escaped_image}}});
background-size: {{scaled width 1.25}}px auto;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 234 B

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.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

View file

@ -1,6 +1,9 @@
{{#spritesheet}}
.options__icon.options__icon-huge {
background-size: 80px auto;
background-size: var(--huge-icon-background-image-width) auto;
.pixel-ratio__1_25 {
.options__icon.options__icon-huge {
background-image: url(resources/{{{escaped_image}}});
background-size: 80px auto;
background-size: var(--huge-icon-background-image-width) auto;
}
}
{{/spritesheet}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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