Merge branch 'develop' into feature/sse-conditional-formatting

This commit is contained in:
Julia Radzhabova 2021-02-20 19:15:44 +03:00
commit 0075983c9f
8476 changed files with 170511 additions and 19891 deletions

15
.github/workflows/check.yml vendored Normal file
View file

@ -0,0 +1,15 @@
name: check
on: [push]
jobs:
project-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Build using grunt
run: |
npm install --prefix build
grunt --level=ADVANCED --base build --gruntfile build/Gruntfile.js

View file

@ -1,9 +0,0 @@
language: node_js
node_js:
- '12'
before_install: npm install -g grunt-cli
before_script:
- cd build
script:
- npm install
- grunt --level=ADVANCED

View file

@ -11,10 +11,11 @@
# Full #
config = {
type: 'desktop or mobile',
type: 'desktop or mobile or embedded',
width: '100% by default',
height: '100% by default',
documentType: 'text' | 'spreadsheet' | 'presentation',
documentType: 'word' | 'cell' | 'slide',// deprecate 'text' | 'spreadsheet' | 'presentation',
token: <string> encrypted signature
document: {
title: 'document title',
url: 'document url'
@ -23,10 +24,8 @@
key: 'key',
vkey: 'vkey',
info: {
author: 'author name', // must be deprecated, use owner instead
owner: 'owner name',
folder: 'path to document',
created: '<creation date>', // must be deprecated, use uploaded instead
uploaded: '<uploaded date>',
sharingSettings: [
{
@ -35,7 +34,8 @@
isLink: false
},
...
]
],
favorite: '<file is favorite>' // true/false/undefined (undefined - don't show fav. button)
},
permissions: {
edit: <can edit>, // default = true
@ -43,15 +43,23 @@
reader: <can view in readable mode>,
review: <can review>, // default = edit
print: <can print>, // default = true
rename: <can rename>, // default = false
changeHistory: <can change history>, // default = false // must be deprecated, check onRequestRestore event instead
comment: <can comment in view mode> // default = edit,
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
modifyContentControl: <can modify content controls in documenteditor> // default = true
fillForms: <can edit forms in view mode> // default = edit || review
fillForms: <can edit forms in view mode> // default = edit || review,
copy: <can copy data> // default = true,
editCommentAuthorOnly: <can edit your own comments only> // default = false
deleteCommentAuthorOnly: <can delete your own comments only> // default = false,
reviewGroups: ["Group1", ""] // current user can accept/reject review changes made by users from Group1 and users without a group. [] - use groups, but can't change any group's changes
}
},
editorConfig: {
actionLink: { // open file and scroll to data, used with onMakeActionLink or the onRequestSendNotify event
action: {
type: "bookmark", // or type="comment"
data: <bookmark name> // or comment id
}
},
mode: 'view or edit',
lang: <language code>,
location: <location>,
@ -69,7 +77,8 @@
user: {
id: 'user id',
name: 'user name'
name: 'user name',
group: 'group name' // for customization.reviewPermissions parameter
},
recent: [
{
@ -112,6 +121,15 @@
blank: true,
requestClose: false // if true - goback send onRequestClose event instead opening url
},
reviewPermissions: {
"Group1": ["Group2"], // users from Group1 can accept/reject review changes made by users from Group2
"Group2": ["Group1", "Group2"] // users from Group2 can accept/reject review changes made by users from Group1 and Group2
"Group3": [""] // users from Group3 can accept/reject review changes made by users without a group
},
anonymous: { // set name for anonymous user
request: bool (default: true), // enable set name
label: string (default: "Guest") // postfix for user name
}
chat: true,
comments: true,
zoom: 100,
@ -123,7 +141,7 @@
statusBar: true,
autosave: true,
forcesave: false,
commentAuthorOnly: false,
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
showReviewChanges: false,
help: true,
compactHeader: false,
@ -136,7 +154,9 @@
mentionShare : true // customize tooltip for mention,
macros: true // can run macros in document
plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn'
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off,
hideRulers: false, // hide or show rulers on first loading (presentation or document editor)
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
@ -150,9 +170,30 @@
},
events: {
'onAppReady': <application ready callback>,
'onBack': <back to folder callback>,
'onDocumentStateChange': <document state changed callback>
'onDocumentReady': <document ready callback>
'onRequestEditRights': <request rights for switching from view to edit>,
'onRequestHistory': <request version history>,// must call refreshHistory method
'onRequestHistoryData': <request version data>,// must call setHistoryData method
'onRequestRestore': <try to restore selected version>,
'onRequestHistoryClose': <request closing history>,
'onError': <error callback>,
'onWarning': <warning callback>,
'onInfo': <document open callback>,// send view or edit mode
'onOutdatedVersion': <outdated version callback>,// send when previous version is opened
'onDownloadAs': <download as callback>,// send url of downloaded file as a response for downloadAs method
'onRequestSaveAs': <try to save copy of the document>,
'onCollaborativeChanges': <co-editing changes callback>,// send when other user co-edit document
'onRequestRename': <try to rename document>,
'onMetaChange': // send when meta information changed
'onRequestClose': <request close editor>,
'onMakeActionLink': <request link to document with bookmark, comment...>,// must call setActionLink method
'onRequestUsers': <request users list for mentions>,// must call setUsers method
'onRequestSendNotify': //send when user is mentioned in a comment,
'onRequestInsertImage': <try to insert image>,// must call insertImage method
'onRequestCompareFile': <request file to compare>,// must call setRevisedFile method
'onRequestSharingSettings': <request sharing settings>,// must call setSharingSettings method
'onRequestCreateNew': <try to create document>,
}
}
@ -162,7 +203,7 @@
type: 'embedded',
width: '100% by default',
height: '100% by default',
documentType: 'text' | 'spreadsheet' | 'presentation',
documentType: 'word' | 'cell' | 'slide',// deprecate 'text' | 'spreadsheet' | 'presentation',
document: {
title: 'document title',
url: 'document url',
@ -298,6 +339,8 @@
if ( msg ) {
if ( msg.type === "onExternalPluginMessage" ) {
_sendCommand(msg);
} else if (msg.type === "onExternalPluginMessageCallback") {
postMessage(window.parent, msg);
} else
if ( msg.frameEditorId == placeholderId ) {
var events = _config.events || {},
@ -333,9 +376,15 @@
'text': 'docx',
'text-pdf': 'pdf',
'spreadsheet': 'xlsx',
'presentation': 'pptx'
'presentation': 'pptx',
'word': 'docx',
'cell': 'xlsx',
'slide': 'pptx'
}, app;
if (_config.documentType=='text' || _config.documentType=='spreadsheet' ||_config.documentType=='presentation')
console.warn("The \"documentType\" parameter for the config object must take one of the values word/cell/slide.");
if (typeof _config.documentType === 'string' && _config.documentType != '') {
app = appMap[_config.documentType.toLowerCase()];
if (!app) {
@ -347,15 +396,16 @@
}
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
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))$/
_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))$/
.exec(_config.document.fileType);
if (!type) {
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
return false;
} else if (typeof _config.documentType !== 'string' || _config.documentType == ''){
if (typeof type[1] === 'string') _config.documentType = 'spreadsheet'; else
if (typeof type[2] === 'string') _config.documentType = 'presentation'; else
if (typeof type[3] === 'string') _config.documentType = 'text';
if (typeof type[1] === 'string') _config.documentType = 'cell'; else
if (typeof type[2] === 'string') _config.documentType = 'slide'; else
if (typeof type[3] === 'string') _config.documentType = 'word';
}
}
@ -374,6 +424,11 @@
return false;
}
if (_config.editorConfig.user && _config.editorConfig.user.id && (typeof _config.editorConfig.user.id == 'number')) {
_config.editorConfig.user.id = _config.editorConfig.user.id.toString();
console.warn("The \"id\" parameter for the editorConfig.user object must be a string.");
}
_config.document.token = _config.token;
}
@ -595,6 +650,13 @@
});
};
var _setFavorite = function(data) {
_sendCommand({
command: 'setFavorite',
data: data
});
};
var _processMouse = function(evt) {
var r = iframe.getBoundingClientRect();
var data = {
@ -640,7 +702,8 @@
setSharingSettings : _setSharingSettings,
insertImage : _insertImage,
setMailMergeRecipients: _setMailMergeRecipients,
setRevisedFile : _setRevisedFile
setRevisedFile : _setRevisedFile,
setFavorite : _setFavorite
}
};
@ -735,9 +798,12 @@
'text': 'documenteditor',
'text-pdf': 'documenteditor',
'spreadsheet': 'spreadsheeteditor',
'presentation': 'presentationeditor'
'presentation': 'presentationeditor',
'word': 'documenteditor',
'cell': 'spreadsheeteditor',
'slide': 'presentationeditor'
},
app = appMap['text'];
app = appMap['word'];
if (typeof config.documentType === 'string') {
app = appMap[config.documentType.toLowerCase()];
@ -746,8 +812,8 @@
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))$/
.exec(config.document.fileType);
if (type) {
if (typeof type[1] === 'string') app = appMap['spreadsheet']; else
if (typeof type[2] === 'string') app = appMap['presentation'];
if (typeof type[1] === 'string') app = appMap['cell']; else
if (typeof type[2] === 'string') app = appMap['slide'];
}
}
@ -770,7 +836,9 @@
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')
index = "/index_internal.html";
}
path += index;
return path;
@ -812,10 +880,15 @@
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
params += "&toolbar=false";
else if (config.document && config.document.permissions && (config.document.permissions.edit === false && config.document.permissions.fillForms ))
params += "&toolbar=true";
if (config.parentOrigin)
params += "&parentOrigin=" + config.parentOrigin;
if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.uiTheme )
params += "&uitheme=" + config.editorConfig.customization.uiTheme;
return params;
}
@ -831,7 +904,7 @@
iframe.allowFullscreen = true;
iframe.setAttribute("allowfullscreen",""); // for IE11
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
iframe.setAttribute("allow", "autoplay");
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture");
if (config.type == "mobile")
{

View file

@ -53,7 +53,7 @@
type: urlParams['type'],
width: '100%',
height: '100%',
documentType: urlParams['doctype'] || 'text',
documentType: urlParams['doctype'] || 'word',
document: doc,
editorConfig: cfg,
events: {
@ -80,7 +80,7 @@
}
function getDocumentData(urlParams) {
return {
let docparams = {
key: urlParams["key"],
url: urlParams["url"] || '_offline_',
title: urlParams["title"],
@ -91,12 +91,20 @@
download: true
}
};
if (urlParams['mode'] == 'review')
docparams.permissions.edit = !(docparams.permissions.review = true);
return docparams;
}
function getEditorConfig(urlParams) {
return {
customization : {
goback: { url: "onlyoffice.com" }
, feedback: {
url: "https://helpdesk.onlyoffice.com/?desktop=true"
}
},
mode : urlParams["mode"] || 'edit',
lang : urlParams["lang"] || 'en',

View file

@ -122,6 +122,10 @@ if (Common === undefined) {
'setRevisedFile': function(data) {
$me.trigger('setrevisedfile', data);
},
'setFavorite': function(data) {
$me.trigger('setfavorite', data);
}
};
@ -135,7 +139,7 @@ if (Common === undefined) {
var _onMessage = function(msg) {
// TODO: check message origin
if (msg.origin !== window.parentOrigin) return;
if (msg.origin !== window.parentOrigin && msg.origin !== window.location.origin) return;
var data = msg.data;
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {

View file

@ -68,10 +68,6 @@
!!appConfig.docTitle && (_url += encodeURIComponent('&text=' + appConfig.docTitle));
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
break;
case 'gplus':
_url = 'https://plus.google.com/share?url=' + appConfig.shareUrl;
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes');
break;
case 'email':
window.open(_mailto, '_self');
break;

View file

@ -55,7 +55,6 @@ common.view.modals = new(function() {
'<div class="share-buttons">' +
'<span class="svg big-facebook" data-name="facebook"></span>' +
'<span class="svg big-twitter" data-name="twitter"></span>' +
'<span class="svg big-gplus" data-name="gplus"></span>' +
'<span class="svg big-email" data-name="email"></span>' +
'<div class="autotest" id="email" style="display: none"></div>' +
'</div>';

View file

@ -1 +1,80 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="88 -11 242 44"><style>.st0{fill:#fff;} .st2{fill-rule:evenodd;clip-rule:evenodd;}</style><g id="XMLID_7_"><path id="XMLID_9_" d="M128 6h-14c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z"/><path id="XMLID_8_" d="M120.1 3.6c.1.1.2.2.4.2.1.1.3.1.5.1s.3-.1.5-.1c.1 0 .3-.1.4-.2l3.5-3.5c.4-.4.4-1 0-1.4s-1-.4-1.4 0l-2 2V-7c0-.6-.4-1-1-1s-1 .4-1 1V.7l-2-2c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l3.5 3.5z"/></g><path id="XMLID_14_" d="M147.3 3c-.8 0-1.5.3-2.1.8l-4.7-2.7c.1-.3.2-.7.2-1.1s-.1-.8-.2-1.1l4.7-2.7c.6.5 1.3.8 2.1.8 1.7 0 3.1-1.4 3.1-3.1s-1.4-3.1-3.1-3.1-3.1 1.4-3.1 3.1c0 .3 0 .5.1.8l-4.9 2.8c-.5-.4-1.1-.6-1.8-.6-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1c.7 0 1.3-.2 1.8-.6l4.8 2.8c-.1.3-.1.5-.1.8 0 1.7 1.4 3.1 3.1 3.1 1.7 0 3.1-1.4 3.1-3.1.1-1.7-1.3-3.1-3-3.1z"/><path d="M159.3 0l4-4c.5-.5.5-1.2 0-1.7s-1.2-.5-1.7 0l-4.4 4.4c-.2 0-.4.1-.6.3-.3.3-.4.7-.3 1 0 .3.1.7.3 1 .2.2.4.3.6.3l4.4 4.4c.5.5 1.2.5 1.7 0s.5-1.2 0-1.7l-4-4zm14.1-1c-.2-.2-.4-.3-.6-.3l-4.4-4.4c-.5-.5-1.2-.5-1.7 0s-.5 1.2 0 1.7l4 4-4 4c-.5.5-.5 1.2 0 1.7s1.2.5 1.7 0l4.4-4.4c.2 0 .4-.1.6-.3.3-.3.4-.7.3-1 .1-.3 0-.7-.3-1z"/><g id="XMLID_4_"><path id="XMLID_21_" d="M194.9-7.3c0-.1-.1-.2-.2-.3-.1-.1-.2-.2-.3-.2-.2-.2-.3-.2-.4-.2h-4.2c-.5 0-.8.4-.8.8 0 .5 1 1.2 1 1.2l.8.8-2.6 2.6c-.4.4-.4 1 0 1.4s1 .4 1.4 0l2.6-2.6 1.3 1.4c.1.2.4.4.7.4.5 0 .8-.4.8-.8V-7c0-.1 0-.2-.1-.3z"/><path id="XMLID_22_" d="M184.4 1.2l-2.6 2.6-1.3-1.4c-.1-.2-.4-.4-.7-.4-.5 0-.8.4-.8.8V7c0 .1 0 .3.1.4 0 .1.1.2.2.3.1.1.2.2.3.2.2.1.3.1.4.1h4.2c.5 0 .8-.4.8-.8S184 6 184 6l-.8-.8 2.6-2.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0z"/></g><path id="imgtools" d="M90-6v2h18v-2H90zm0 7h18v-2H90v2zm0 5h18V4H90v2z"/><path id="imgplus" d="M210-8h-2v7h-7v2h7v7h2V1h7v-2h-7v-7z"/><path id="imgminus" d="M223-1h16v2h-16z"/><path id="play" d="M305 0l-16-7V6.9L305 0z"/><path id="rmove" class="st2" d="M279.9-.2L272.1-8 270-5.9l5.8 5.8-5.8 5.9 2.1 2.1 7.8-7.8.1-.2z"/><path id="lmove" class="st2" d="M258-5.8l-2.1-2.1-7.8 7.8-.1.2.1.1 7.8 7.8 2.1-2.1-5.8-5.8z"/><path d="M313-7h4V7h-4zm8 0h4V7h-4z" id="pause"/><use xlink:href="#imgtools" class="st0" y="22"/><use xlink:href="#imgplus" class="st0" y="22"/><use xlink:href="#imgminus" class="st0" y="22"/><use xlink:href="#play" class="st0" y="22" x="2"/><use xlink:href="#pause" class="st0" y="22"/><use xlink:href="#rmove" class="st0" x="1" y="22"/><use xlink:href="#lmove" class="st0" x="-1" y="22"/></svg>
<svg width="260" height="40" viewBox="0 0 260 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon-menu-sprite">
<g id="view-settings">
<path d="M17 26H3V27H17V26Z" fill="white"/>
<path d="M17 30H3V31H17V30Z" fill="white"/>
<path d="M3 34H17V35H3V34Z" fill="white"/>
</g>
<g id="download">
<path d="M30 22H31V33.2929L35.6464 28.6464L36.3535 29.3536L30.5 35.2071L24.6464 29.3536L25.3535 28.6464L30 33.2929V22Z" fill="white"/>
<path d="M37 36H24V37H37V36Z" fill="white"/>
</g>
<path id="share" 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 id="embed ">
<path d="M67.8536 25.3536L67.1465 24.6465L62.2929 29.5L67.1465 34.3536L67.8536 33.6465L63.7071 29.5L67.8536 25.3536Z" fill="white"/>
<path d="M72.1465 25.3536L72.8536 24.6465L77.7071 29.5L72.8536 34.3536L72.1465 33.6465L76.2929 29.5L72.1465 25.3536Z" fill="white"/>
</g>
<g id="full-screen">
<path d="M97 23V26H96V24L94 24V23L97 23Z" fill="white"/>
<path d="M86 23H83V26H84V24H86V23Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M86 26V34H94V26H86ZM93 27H87V33H93V27Z" fill="white"/>
<path d="M94 37H97V34H96V36H94V37Z" fill="white"/>
<path d="M83 37L83 34H84L84 36H86V37H83Z" fill="white"/>
</g>
<path id="zoom-in" fill-rule="evenodd" clip-rule="evenodd" d="M111 25H110V30H105V31H110V36H111V31H116V30H111V25Z" fill="white"/>
<rect id="zoom-out" x="135" y="30" width="1" height="10" transform="rotate(90 135 30)" fill="white"/>
<g id="scroll-to-first-sheet">
<path d="M146 25H145V35H146V25Z" fill="white"/>
<path d="M147 30L155 25V35L147 30Z" fill="white"/>
</g>
<g id="scroll-to-last-sheet">
<path d="M173 30L165 35V25L173 30Z" fill="white"/>
<path d="M175 35H174V25H175V35Z" fill="white"/>
</g>
<path id="play" fill-rule="evenodd" clip-rule="evenodd" d="M185 23L198 30L185 37V23Z" fill="white"/>
<g id="pause">
<path d="M205 35V25H209V35H205Z" fill="white"/>
<path d="M211 35V25H215V35H211Z" fill="white"/>
</g>
<path id="print" 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"/>
<path id="close" fill-rule="evenodd" clip-rule="evenodd" d="M249.439 29.5L245.47 25.5303L246.53 24.4697L250.5 28.4393L254.47 24.4697L255.53 25.5303L251.561 29.5L255.53 33.4697L254.47 34.5303L250.5 30.5607L246.53 34.5303L245.47 33.4697L249.439 29.5Z" fill="white"/>
<g id="view-settings_2">
<path d="M17 6H3V7H17V6Z" fill="black"/>
<path d="M17 10H3V11H17V10Z" fill="black"/>
<path d="M3 14H17V15H3V14Z" fill="black"/>
</g>
<g id="download_2">
<path d="M30 2H31V13.2929L35.6464 8.64645L36.3535 9.35355L30.5 15.2071L24.6464 9.35355L25.3535 8.64645L30 13.2929V2Z" fill="black"/>
<path d="M37 16H24V17H37V16Z" fill="black"/>
</g>
<path id="Union" 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 id="embed _2">
<path d="M67.8536 5.35359L67.1465 4.64648L62.2929 9.50004L67.1465 14.3536L67.8536 13.6465L63.7071 9.50004L67.8536 5.35359Z" fill="black"/>
<path d="M72.1465 5.35359L72.8536 4.64648L77.7071 9.50004L72.8536 14.3536L72.1465 13.6465L76.2929 9.50004L72.1465 5.35359Z" fill="black"/>
</g>
<g id="full-screen_2">
<path d="M97 3V6H96V4L94 4V3L97 3Z" fill="black"/>
<path d="M86 3H83V6H84V4H86V3Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M86 6V14H94V6H86ZM93 7H87V13H93V7Z" fill="black"/>
<path d="M94 17H97V14H96V16H94V17Z" fill="black"/>
<path d="M83 17L83 14H84L84 16H86V17H83Z" fill="black"/>
</g>
<path id="zoom-in_2" fill-rule="evenodd" clip-rule="evenodd" d="M111 5H110V10H105V11H110V16H111V11H116V10H111V5Z" fill="black"/>
<rect id="zoom-out_2" x="135" y="10" width="1" height="10" transform="rotate(90 135 10)" fill="black"/>
<g id="scroll-to-first-sheet_2">
<path d="M146 5H145V15H146V5Z" fill="black"/>
<path d="M147 10L155 5V15L147 10Z" fill="black"/>
</g>
<g id="scroll-to-last-sheet_2">
<path d="M173 10L165 15V5L173 10Z" fill="black"/>
<path d="M175 15H174V5H175V15Z" fill="black"/>
</g>
<path id="play_2" fill-rule="evenodd" clip-rule="evenodd" d="M185 3L198 10L185 17V3Z" fill="black"/>
<g id="pause_2">
<path d="M205 15V5H209V15H205Z" fill="black"/>
<path d="M211 15V5H215V15H211Z" fill="black"/>
</g>
<path id="print_2" 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"/>
<path id="close_2" fill-rule="evenodd" clip-rule="evenodd" d="M249.439 9.5L245.47 5.53033L246.53 4.46967L250.5 8.43934L254.47 4.46967L255.53 5.53033L251.561 9.5L255.53 13.4697L254.47 14.5303L250.5 10.5607L246.53 14.5303L245.47 13.4697L249.439 9.5Z" fill="black"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -285,6 +285,9 @@
outline: none;
opacity: 0.3;
background-origin: content-box;
padding: 1px 0 0 1px;
-webkit-box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
-moz-box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
@ -428,50 +431,56 @@
&.big-email { .socnet-btn(3); }
}
@icon-width: 20px;
@icon-height: 20px;
.svg-icon {
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
background-size: 22px*11 22px*2;
background-size: @icon-width*13 @icon-height*2;
&.download {
background-position: -22px 0;
background-position: -@icon-width 0;
}
&.share {
background-position: -22px*2 0;
background-position: -@icon-width*2 0;
}
&.embed {
background-position: -22px*3 0;
background-position: -@icon-width*3 0;
}
&.fullscr {
background-position: -22px*4 0;
background-position: -@icon-width*4 0;
}
&.zoom-up {
background-position: -22px*5 -22px;
background-position: -@icon-width*5 -@icon-height;
}
&.zoom-down {
background-position: -22px*6 -22px;
background-position: -@icon-width*6 -@icon-height;
}
&.slide-prev {
background-position: -22px*7 -22px;
background-position: -@icon-width*7 -@icon-height;
}
&.slide-next {
background-position: -22px*8 -22px;
background-position: -@icon-width*8 -@icon-height;
}
&.play {
background-position: -22px*9 -22px;
background-position: -@icon-width*9 -@icon-height;
}
&.pause {
background-position: -22px*10 -22px;
background-position: -@icon-width*10 -@icon-height;
}
&.print {
background-position: -@icon-width*11 0;
}
}
.mi-icon {
width: 22px;
height: 22px;
width: @icon-width;
height: @icon-height;
//display: inline-block;
float: left;
margin: -1px 15px 0 -15px;
margin: 0 15px 0 -15px;
}
.btn, button {
@ -550,7 +559,7 @@
&.open {
> button {
background-color: @btnActiveColor;
background-position: 0 -22px;
background-position: 0 -@icon-height;
}
}
}
@ -559,9 +568,11 @@
button {
width: 24px;
height: 22px;
background-origin: content-box;
padding: 0 1px;
&:active {
background-position: 0 -22px;
background-position: 0 -@icon-height;
}
}
@ -611,4 +622,4 @@
-webkit-box-shadow: none;
box-shadow: none;
}
}
}

View file

@ -211,7 +211,7 @@ define([
'</div>' +
'<div class="inner-box-caption">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</div>' +
'</button>' +
'</div>';
@ -226,7 +226,7 @@ define([
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
'<span class="btn-fixflex-vcenter">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</span>' +
'</button>' +
'</div>';
@ -271,7 +271,7 @@ define([
'<% applyicon() %>',
'<span class="caption"><%= caption %></span>',
'<span class="inner-box-caret">' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</span>',
'</button>',
'</div>',
@ -282,7 +282,7 @@ define([
'<span class="caption"><%= caption %></span>',
'</button>',
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">',
'<i class="caret img-commonctrl"></i>',
'<i class="caret"></i>',
'<span class="sr-only"></span>',
'</button>',
'</div>',
@ -659,7 +659,7 @@ define([
changeIcon: function(opts) {
var me = this;
if ( opts && (opts.curr || opts.next)) {
if ( opts && (opts.curr || opts.next) && me.$icon) {
!!opts.curr && (me.$icon.removeClass(opts.curr));
!!opts.next && !me.$icon.hasClass(opts.next) && (me.$icon.addClass(opts.next));

View file

@ -237,7 +237,7 @@ define([
me.yearPicker.store.reset(arrYears);
me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus();
me.monthPicker.focus();
}, 10);
},
@ -312,7 +312,7 @@ define([
me.monthsPicker.store.reset(arrMonths);
me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus();
me.monthPicker.focus();
}, 10);
},
@ -435,7 +435,7 @@ define([
me.monthPicker.store.reset(arrDays);
me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus();
me.monthPicker.focus();
}, 10);
},

View file

@ -41,16 +41,28 @@ define([
Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
options : {
hint: false,
enableToggle: false,
visible: true
id : null,
hint : false,
enableToggle : false,
allowDepress : false,
toggleGroup : null,
cls : '',
iconCls : '',
caption : '',
menu : null,
disabled : false,
pressed : false,
split : false,
visible : true
},
template: _.template([
'<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<span>&nbsp;</span>',
'<span class="inner-box-caret"><i class="caret img-commonctrl"></i></span>',
'<span class="inner-box-caret">',
'<i class="caret"></i>',
'</span>',
'</button>',
'</div>'
].join('')),
@ -61,7 +73,7 @@ define([
var me = this;
options.menu = me.getMenu(options);
me.on('render:after', function(btn) {
me.getPicker(options.color);
me.getPicker(options.color, options.colors);
});
}
@ -71,16 +83,22 @@ define([
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
if (this.options.auto)
this.autocolor = (typeof this.options.auto == 'object') ? this.options.auto.color || '000000' : '000000';
if (this.options.color!==undefined)
this.setColor(this.options.color);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.setAutoColor(false);
this.trigger('color:select', this, color);
},
setColor: function(color) {
if (color == 'auto' && this.options.auto)
color = this.autocolor;
var span = $(this.cmpEl).find('button span:nth-child(1)');
this.color = color;
@ -88,15 +106,21 @@ define([
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
},
getPicker: function(color) {
getPicker: function(color, colors) {
if (!this.colorPicker) {
this.colorPicker = new Common.UI.ThemeColorPalette({
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color
value: color,
colors: colors
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
if (this.options.auto) {
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
(color == 'auto') && this.setAutoColor(true);
}
}
return this.colorPicker;
},
@ -104,13 +128,26 @@ define([
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var id = Common.UI.getId(),
menu = new Common.UI.Menu({
var height = options.paletteHeight || 216,
id = Common.UI.getId(),
auto = [];
if (options.auto) {
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
auto.push({
id: id + '-color-auto',
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
});
auto.push({caption: '--'});
}
var menu = new Common.UI.Menu({
id: id,
cls: 'shifted-left',
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="' + id + '-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
])
});
return menu;
@ -121,14 +158,53 @@ define([
setMenu: function (m) {
m = m || this.getMenu();
Common.UI.Button.prototype.setMenu.call(this, m);
this.getPicker(this.options.color);
this.getPicker(this.options.color, this.options.colors);
},
addNewColor: function() {
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
},
textNewColor: 'Add New Custom Color'
onAutoColorSelect: function() {
this.setColor('auto');
this.setAutoColor(true);
this.colorPicker && this.colorPicker.clearSelection();
this.trigger('auto:select', this, this.autocolor);
},
setAutoColor: function(selected) {
if (!this.colorAuto) return;
if (selected && !this.colorAuto.hasClass('selected'))
this.colorAuto.addClass('selected');
else if (!selected && this.colorAuto.hasClass('selected'))
this.colorAuto.removeClass('selected');
},
isAutoColor: function() {
return this.colorAuto && this.colorAuto.hasClass('selected');
},
textNewColor: 'Add New Custom Color',
textAutoColor: 'Automatic'
}, Common.UI.ColorButton || {}));
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
this.colorEl = this.cmpEl.find('.btn-color-value-line');
},
setColor: function(color) {
if (this.colorEl) {
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
this.colorEl.toggleClass('bordered', color=='transparent');
}
}
}, Common.UI.ButtonColored || {}));
});

View file

@ -77,9 +77,14 @@ define([
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="padding-top:2px; <%= style %>"></div>',
'<div class="form-control" style="<%= style %>">',
'<i class="image"></i>',
'<span class="text"></span>',
'</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
@ -138,14 +143,15 @@ define([
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
var image = formcontrol.find('> .image');
var text = formcontrol.find('> .text');
if (record.get('value')>0) {
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
image.css('background-position', '10px -' + record.get('offsety') + 'px').show();
text.hide();
} else {
formcontrol[0].innerHTML = this.txtNoBorders;
formcontrol.removeClass('image').addClass('text');
image.hide();
text.text(this.txtNoBorders).show();
}
},
@ -162,9 +168,7 @@ define([
this.updateFormControl(this._selectedItem);
$('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
} else {
var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = '';
formcontrol.removeClass('image').addClass('text');
$(this.el).find('.form-control > .text').text("").show();
}
},
@ -175,7 +179,9 @@ define([
template: _.template([
'<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control text">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
@ -224,9 +230,13 @@ define([
Common.UI.ComboBorderType = Common.UI.ComboBorderSize.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="<%= style %>"></div>',
'<div class="form-control" style="<%= style %>">',
'<i class="image"></i>',
'</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem" style="padding: 2px 0 2px 10px;">',
@ -262,10 +272,8 @@ define([
},
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
$(this.el).find('.form-control > .image')
.css('background-position', '10px -' + record.get('offsety') + 'px');
}
}, Common.UI.ComboBorderType || {}));
@ -275,7 +283,9 @@ define([
'<div class="form-control" style="padding:2px 14px 2px 3px; <%= style %> display: block;">',
'<div style="display: inline-block;overflow: hidden;width: 100%;height: 100%;"></div>',
'</div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<% if (item.value==-1) { %>',

View file

@ -86,13 +86,16 @@ define([
displayField: 'displayValue',
valueField : 'value',
search : false,
scrollAlwaysVisible: false
scrollAlwaysVisible: false,
takeFocusOnClose: false
},
template: _.template([
'<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
@ -302,6 +305,9 @@ define([
if ($list.hasClass('menu-absolute')) {
var offset = this.cmpEl.offset();
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
} else if ($list.hasClass('menu-aligned')) {
var offset = this.cmpEl.offset();
$list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight());
}
},
@ -320,6 +326,9 @@ define([
$list.scrollTop(height);
}
setTimeout(function(){$selected.find('a').focus();}, 1);
} else {
var me = this;
setTimeout(function(){me.cmpEl.find('ul li:first a').focus();}, 1);
}
if (this.scroller)
@ -340,19 +349,28 @@ define([
this.cmpEl.find('.dropdown-toggle').blur();
this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
if (this.options.takeFocusOnClose) {
var me = this;
setTimeout(function(){me.focus();}, 1);
}
},
onAfterKeydownMenu: function(e) {
if (e.keyCode == Common.UI.Keys.RETURN) {
if (e.keyCode == Common.UI.Keys.DOWN && !this.editable && !this.isMenuOpen()) {
this.openMenu();
this.onAfterShowMenu();
return false;
}
else if (e.keyCode == Common.UI.Keys.RETURN && (this.editable || this.isMenuOpen())) {
var isopen = this.isMenuOpen();
$(e.target).click();
var me = this;
if (this.rendered) {
if (Common.Utils.isIE)
this._input.trigger('change', { onkeydown: true });
else
this._input.blur();
}
return false;
return !isopen;
}
else if (e.keyCode == Common.UI.Keys.ESC && this.isMenuOpen()) {
this._input.val(this.lastValue);
@ -663,6 +681,10 @@ define([
wheelSpeed: 10,
alwaysVisibleY: this.scrollAlwaysVisible
}, this.options.scroller));
},
focus: function() {
this._input && this._input.focus();
}
}
})());
@ -684,6 +706,10 @@ define([
Common.UI.ComboBox.prototype.selectRecord.call(this, record);
if (this.options.updateFormControl)
this.options.updateFormControl.call(this, this._selectedItem);
},
focus: function() {
this.cmpEl && this.cmpEl.find('.form-control').focus();
}
}, Common.UI.ComboBoxCustom || {}));
});

View file

@ -56,7 +56,8 @@ define([
thumbContext = thumbCanvas.getContext('2d'),
thumbPath = '../../../../sdkjs/common/Images/fonts_thumbnail.png',
thumbPath2x = '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png',
listItemHeight = 26;
listItemHeight = 26,
spriteCols = 1;
if (typeof window['AscDesktopEditor'] === 'object') {
thumbPath = window['AscDesktopEditor'].getFontsSprite();
@ -71,7 +72,7 @@ define([
'<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false"> ',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<li class="divider">',
'<% _.each(items, function(item) { %>',
@ -104,14 +105,17 @@ define([
render : function(parentEl) {
var oldRawValue = null;
var oldTabindex = '';
if (!_.isUndefined(this._input)) {
oldRawValue = this._input.val();
oldTabindex = this._input.attr('tabindex');
}
Common.UI.ComboBox.prototype.render.call(this, parentEl);
this.setRawValue(oldRawValue);
this._input.attr('tabindex', oldTabindex);
this._input.on('keyup', _.bind(this.onInputKeyUp, this));
this._input.on('keydown', _.bind(this.onInputKeyDown, this));
@ -127,6 +131,8 @@ define([
if ($(e.target).closest('input').length) { // enter in input field
if (this.lastValue !== this._input.val())
this._input.trigger('change');
else
return true;
} else { // enter in dropdown list
$(e.target).click();
if (this.rendered) {
@ -135,7 +141,7 @@ define([
else
this._input.blur();
}
}
}
return false;
} else if (e.keyCode == Common.UI.Keys.ESC && this.isMenuOpen()) {
this._input.val(this.lastValue);
@ -198,7 +204,7 @@ define([
me.closeMenu();
me.onAfterHideMenu(e);
}, 10);
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT){
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT && e.keyCode != Common.UI.Keys.TAB){
if (!this.isMenuOpen() && !e.ctrlKey)
this.openMenu();
@ -275,10 +281,10 @@ define([
if (isRetina) {
thumbContext.clearRect(0, 0, iconWidth * 2, iconHeight * 2);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * 2 * opts.imgidx);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * 2 * Math.floor(opts.imgidx/spriteCols));
} else {
thumbContext.clearRect(0, 0, iconWidth, iconHeight);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * opts.imgidx);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * Math.floor(opts.imgidx/spriteCols));
}
return thumbCanvas.toDataURL();
@ -300,7 +306,7 @@ define([
if (callback) {
this.spriteThumbs = new Image();
this.spriteThumbs.onload = callback;
this.spriteThumbs.src = (window.devicePixelRatio > 1) ? thumbPath2x : thumbPath;
this.spriteThumbs.src = isRetina ? thumbPath2x : thumbPath;
}
},
@ -308,6 +314,7 @@ define([
var me = this;
this.loadSprite(function() {
spriteCols = Math.floor(me.spriteThumbs.width / (isRetina ? iconWidth * 2 : iconWidth)) || 1;
me.store.set(store.toJSON());
me.rendered = false;
@ -336,16 +343,21 @@ define([
onApiChangeFont: function(font) {
var me = this;
setTimeout(function () {
me.onApiChangeFontInternal(font);
}, 100);
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
if (this.__name !== name) {
if (!this.__nameId) {
this.__nameId = setTimeout(function () {
me.onApiChangeFontInternal(name);
me.__nameId = null;
}, 100);
}
}
},
onApiChangeFontInternal: function(font) {
onApiChangeFontInternal: function(name) {
if (this.inFormControl) return;
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
this.__name = name;
if (this.getRawValue() !== name) {
var record = this.store.findWhere({
name: name
@ -370,6 +382,12 @@ define([
},
itemClicked: function (e) {
this.__name = undefined;
if (this.__nameId) {
clearTimeout(this.__nameId);
this.__nameId = undefined;
}
Common.UI.ComboBox.prototype.itemClicked.apply(this, arguments);
var el = $(e.target).closest('li');
@ -522,7 +540,7 @@ define([
fontImage.style.width = iconWidth + 'px';
fontImage.style.height = iconHeight + 'px';
index = me.store.at(j).get('imgidx');
index = Math.floor(me.store.at(j).get('imgidx')/spriteCols);
if (isRetina) {
context.clearRect(0, 0, iconWidth * 2, iconHeight * 2);

View file

@ -459,6 +459,13 @@ define([
this.menuPicker.selectByIndex(index);
},
selectRecord: function(record) {
if (!record)
this.fieldPicker.deselectAll();
this.menuPicker.selectRecord(record);
},
setItemWidth: function(width) {
if (this.itemWidth != width)
this.itemWidth = window.devicePixelRatio > 1 ? width / 2 : width;

View file

@ -200,11 +200,12 @@ define([
allowScrollbar: true,
scrollAlwaysVisible: false,
showLast: true,
useBSKeydown: false
useBSKeydown: false,
cls: ''
},
template: _.template([
'<div class="dataview inner" style="<%= style %>">',
'<div class="dataview inner <%= cls %>" style="<%= style %>">',
'<% _.each(groups, function(group) { %>',
'<% if (group.headername !== undefined) { %>',
'<div class="header-name"><%= group.headername %></div>',
@ -238,10 +239,12 @@ define([
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
me.showLast = me.options.showLast;
me.style = me.options.style || '';
me.cls = me.options.cls || '';
me.emptyText = me.options.emptyText || '';
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0;
if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false;
@ -266,7 +269,8 @@ define([
this.setElement(parentEl, false);
this.cmpEl = $(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style
style: me.style,
cls: me.cls
}));
parentEl.html(this.cmpEl);
@ -274,7 +278,8 @@ define([
this.cmpEl = me.$el || $(this.el);
this.cmpEl.html(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style
style: me.style,
cls: me.cls
}));
}
@ -453,7 +458,8 @@ define([
$(this.el).html(this.template({
groups: this.groups ? this.groups.toJSON() : null,
style: this.style
style: this.style,
cls: this.cls
}));
if (!_.isUndefined(this.scroller)) {
@ -565,7 +571,7 @@ define([
}
},
scrollToRecord: function (record) {
scrollToRecord: function (record, force) {
if (!record) return;
var innerEl = $(this.el).find('.inner'),
inner_top = innerEl.offset().top,
@ -576,7 +582,7 @@ define([
var div_top = div.offset().top,
div_first = $(this.dataViewItems[0].el),
div_first_top = (div_first.length>0) ? div_first[0].clientTop : 0;
if (div_top < inner_top + div_first_top || div_top+div.outerHeight()*0.9 > inner_top + div_first_top + innerEl.height()) {
if (force || div_top < inner_top + div_first_top || div_top+div.outerHeight()*0.9 > inner_top + div_first_top + innerEl.height()) {
if (this.scroller && this.allowScrollbar) {
this.scroller.scrollTop(innerEl.scrollTop() + div_top - inner_top - div_first_top, 0);
} else {
@ -665,8 +671,8 @@ define([
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
this._fromKeyDown = false;
}
}
} else {
@ -678,7 +684,7 @@ define([
if (this.enableKeyEvents && this.handleSelect) {
var el = $(this.el).find('.inner').addBack().filter('.inner');
el.addClass('canfocused');
el.attr('tabindex', '0');
el.attr('tabindex', this.tabindex.toString());
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
}
},
@ -763,6 +769,10 @@ define([
onResize: function() {
this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
}
});
@ -798,6 +808,8 @@ define([
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
me.style = me.options.style || '';
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0;
if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false;
@ -1107,8 +1119,8 @@ define([
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
this._fromKeyDown = false;
}
}
} else {
@ -1120,7 +1132,7 @@ define([
if (this.enableKeyEvents && this.handleSelect) {
var el = $(this.el).find('.inner').addBack().filter('.inner');
el.addClass('canfocused');
el.attr('tabindex', '0');
el.attr('tabindex', this.tabindex.toString());
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
}
},
@ -1192,6 +1204,10 @@ define([
onResize: function() {
this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
}
});

View file

@ -0,0 +1,176 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* FocusManager.js
*
* Created by Julia Radzhabova on 24.09.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
if (Common.UI === undefined) {
Common.UI = {};
}
Common.UI.FocusManager = new(function() {
var _tabindex = 1,
_windows = [],
_count = 0;
var register = function(fields) {
var arr = [];
if (!fields.forEach) {
fields = [fields];
}
fields.forEach(function(field) {
if (field) {
var item = (field.cmp && typeof field.selector == 'string') ? field : {cmp: field, selector: '.form-control'};
item.el = (item.cmp.$el || $(item.cmp.el || item.cmp)).find(item.selector).addBack().filter(item.selector);
item.el && item.el.attr && item.el.attr('tabindex', _tabindex.toString());
arr.push(item);
}
});
return arr;
};
var addTraps = function(current) {
if (!current || current.traps || !current.fields || current.fields.length<1) return;
var trapFirst = $('<span aria-hidden="true" tabindex="' + _tabindex + '"></span>');
trapFirst.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=fields.length-1; i>=0; i--) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el && setTimeout(function(){ el.focus(); }, 10);
break;
}
}
});
current.parent.$window.prepend(trapFirst);
var trapLast = $('<span aria-hidden="true" tabindex="' + (_tabindex+1) + '"></span>');
trapLast.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=0; i<fields.length; i++) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el && setTimeout(function(){ el.focus(); }, 10);
break;
}
}
});
current.parent.$window.append(trapLast);
current.traps = [trapFirst, trapLast];
};
var updateTabIndexes = function(increment) {
var step = increment ? 1 : -1;
for (var cid in _windows) {
if (_windows.hasOwnProperty(cid)) {
var item = _windows[cid];
if (item && item.index < _count-1 && item.traps)
item.traps[1].attr('tabindex', (parseInt(item.traps[1].attr('tabindex')) + step).toString());
}
}
};
var _add = function(e, fields) {
if (e && e.cid) {
if (_windows[e.cid]) {
_windows[e.cid].fields = (_windows[e.cid].fields || []).concat(register(fields));
} else {
_windows[e.cid] = {
parent: e,
fields: register(fields),
hidden: false,
index: _count++
};
}
addTraps(_windows[e.cid]);
}
};
var _init = function() {
Common.NotificationCenter.on({
'modal:show': function(e){
if (e && e.cid) {
if (_windows[e.cid]) {
_windows[e.cid].hidden = false;
} else {
_windows[e.cid] = {
parent: e,
hidden: false,
index: _count++
};
updateTabIndexes(true);
}
}
},
'window:show': function(e){
if (e && e.cid && _windows[e.cid] && !_windows[e.cid].fields) {
_windows[e.cid].fields = register(e.getFocusedComponents());
addTraps(_windows[e.cid]);
}
var el = e ? e.getDefaultFocusableComponent() : null;
el && setTimeout(function(){ el.focus(); }, 100);
},
'modal:close': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
updateTabIndexes(false);
delete _windows[e.cid];
_count--;
}
},
'modal:hide': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
_windows[e.cid].hidden = true;
}
}
});
};
return {
init: _init,
add: _add
}
})();

View file

@ -246,6 +246,10 @@ define([
if (e.keyCode === Common.UI.Keys.RETURN)
this._doChange(e);
if (e.keyCode == Common.UI.Keys.ESC)
this.setValue(this.value);
if (e.keyCode==Common.UI.Keys.RETURN || e.keyCode==Common.UI.Keys.ESC)
this.trigger('inputleave', this);
},
onKeyUp: function(e) {
@ -300,7 +304,7 @@ define([
},
focus: function() {
this._input.focus();
this._input && this._input.focus();
},
checkValidate: function() {
@ -354,10 +358,10 @@ define([
return true;
},
showError: function(errors) {
showError: function(errors, isWarning) {
var me = this;
if (!_.isEmpty(errors)) {
me.cmpEl.addClass('error');
me.cmpEl.addClass(isWarning ? 'warning' : 'error');
var errorBadge = me.cmpEl.find('.input-error'),
modalParents = errorBadge.closest('.asc-window'),
@ -376,7 +380,12 @@ define([
}
} else {
me.cmpEl.removeClass('error');
me.cmpEl.removeClass('warning');
}
},
showWarning: function(errors) {
this.showError(errors, true);
}
}
})());

View file

@ -167,7 +167,8 @@ define([
fmax : panel.resize.fmax,
behaviour : panel.behaviour,
index : this.splitters.length,
offset : panel.resize.offset || 0
offset : panel.resize.offset || 0,
multiply : panel.resize.multiply
};
if (!stretch) {
@ -264,6 +265,7 @@ define([
this.resize.fmin = panel.fmin;
this.resize.fmax = panel.fmax;
this.resize.behaviour = panel.behaviour;
this.resize.multiply = panel.multiply;
this.resize.$el.addClass('move');
@ -274,9 +276,11 @@ define([
} else
if (e.data.type == 'horizontal') {
this.resize.width = parseInt(this.resize.$el.css('width'));
this.resize.max = (panel.maxpos > 0 ? panel.maxpos : this.resize.$el.parent().height() + panel.maxpos) - this.resize.width;
this.resize.max = (panel.maxpos > 0 ? panel.maxpos : this.resize.$el.parent().width() + panel.maxpos) - this.resize.width;
this.resize.initx = e.pageX*Common.Utils.zoom() - parseInt(e.currentTarget.style.left);
}
if (this.resize.multiply && this.resize.multiply.koeff)
this.resize.max = Math.floor(this.resize.max/this.resize.multiply.koeff) * this.resize.multiply.koeff + (this.resize.multiply.offset || 0);
Common.NotificationCenter.trigger('layout:resizestart');
},
@ -290,7 +294,13 @@ define([
prop = 'left';
value = e.pageX*zoom - this.resize.initx;
}
if (this.resize.multiply && this.resize.multiply.koeff) {
var m = this.resize.multiply.koeff,
val = value/m,
vfloor = Math.floor(val) * m + (this.resize.multiply.offset || 0),
vceil = Math.ceil(val) * m + (this.resize.multiply.offset || 0);
value = (value>vfloor+m/2) ? vceil : vfloor;
}
if (this.resize.fmin && this.resize.fmax) {
if (!(value < this.resize.fmin()) && !(value > this.resize.fmax())) {
this.resize.$el[0].style[prop] = value + 'px';
@ -332,7 +342,13 @@ define([
prop = 'width';
value = e.pageX*zoom - this.resize.initx;
}
if (this.resize.multiply && this.resize.multiply.koeff) {
var m = this.resize.multiply.koeff,
val = value/m,
vfloor = Math.floor(val) * m + (this.resize.multiply.offset || 0),
vceil = Math.ceil(val) * m + (this.resize.multiply.offset || 0);
value = (value>vfloor+m/2) ? vceil : vfloor;
}
if (this.resize.fmin && this.resize.fmax) {
value < this.resize.fmin() && (value = this.resize.fmin());
value > this.resize.fmax() && (value = this.resize.fmax());

View file

@ -115,6 +115,41 @@ define([
if (!this.isSuspendEvents)
this.trigger('item:add', this, view, record);
}
},
focus: function() {
this.cmpEl && this.cmpEl.find('.listview').focus();
},
scrollToRecord: function (record, force) {
if (!this._fromKeyDown) {
Common.UI.DataView.prototype.scrollToRecord.call(this, record, force);
return;
}
if (!record) return;
var innerEl = $(this.el).find('.inner'),
innerHeight = innerEl.innerHeight(),
idx = _.indexOf(this.store.models, record),
div = (idx>=0 && this.dataViewItems.length>idx) ? $(this.dataViewItems[idx].el) : innerEl.find('#' + record.get('id'));
if (div.length<=0) return;
var div_top = div.position().top,
div_height = div.outerHeight(),
newpos;
if (force || div_top<0)
newpos = innerEl.scrollTop() + div_top;
else if (div_top+div_height>innerHeight)
newpos = innerEl.scrollTop() + div_top + div_height - innerHeight;
if (newpos!==undefined) {
if (this.scroller && this.allowScrollbar) {
this.scroller.scrollTop(newpos, 0);
} else {
innerEl.scrollTop(newpos);
}
}
}
}
})());

View file

@ -68,12 +68,6 @@ define([
'use strict';
Common.UI.LoadMask = Common.UI.BaseView.extend((function() {
var ownerEl,
maskeEl,
loaderEl;
var timerId = 0;
maskeEl = $('<div class="asc-loadmask"></div>');
return {
options : {
cls : '',
@ -84,8 +78,8 @@ define([
template: _.template([
'<div id="<%= id %>" class="asc-loadmask-body <%= cls %>" role="presentation" tabindex="-1">',
'<div class="asc-loadmask-image"></div>',
'<div class="asc-loadmask-title"><%= title %></div>',
'<i id="loadmask-spinner" class="asc-loadmask-image"></i>',
'<div class="asc-loadmask-title"><%= title %></div>',
'</div>'
].join('')),
@ -95,13 +89,15 @@ define([
this.template = this.options.template || this.template;
this.title = this.options.title;
ownerEl = (this.options.owner instanceof Common.UI.BaseView) ? $(this.options.owner.el) : $(this.options.owner);
loaderEl = $(this.template({
this.ownerEl = (this.options.owner instanceof Common.UI.BaseView) ? $(this.options.owner.el) : $(this.options.owner);
this.loaderEl = $(this.template({
id : this.id,
cls : this.options.cls,
style : this.options.style,
title : this.title
}));
this.maskeEl = $('<div class="asc-loadmask"></div>');
this.timerId = 0;
},
render: function() {
@ -113,6 +109,9 @@ define([
// return;
// The owner is already masked
var ownerEl = this.ownerEl,
loaderEl = this.loaderEl,
maskeEl = this.maskeEl;
if (!!ownerEl.ismasked)
return this;
@ -125,14 +124,10 @@ define([
}
// show mask after 500 ms if it wont be hided
timerId = setTimeout(function () {
me.timerId = setTimeout(function () {
ownerEl.append(maskeEl);
ownerEl.append(loaderEl);
loaderEl.css({
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'
});
// if (ownerEl.height()<1 || ownerEl.width()<1)
// loaderEl.css({visibility: 'hidden'});
@ -144,16 +139,17 @@ define([
},
hide: function() {
if (timerId) {
clearTimeout(timerId);
timerId = 0;
var ownerEl = this.ownerEl;
if (this.timerId) {
clearTimeout(this.timerId);
this.timerId = 0;
}
if (ownerEl && ownerEl.ismasked) {
if (ownerEl.closest('.asc-window.modal').length==0)
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
Common.util.Shortcuts.resumeEvents();
maskeEl && maskeEl.remove();
loaderEl && loaderEl.remove();
this.maskeEl && this.maskeEl.remove();
this.loaderEl && this.loaderEl.remove();
}
delete ownerEl.ismasked;
},
@ -161,16 +157,18 @@ define([
setTitle: function(title) {
this.title = title;
if (ownerEl && ownerEl.ismasked && loaderEl){
$('.asc-loadmask-title', loaderEl).html(title);
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){
$('.asc-loadmask-title', this.loaderEl).html(title);
}
},
isVisible: function() {
return !!ownerEl.ismasked;
return !!this.ownerEl.ismasked;
},
updatePosition: function() {
var ownerEl = this.ownerEl,
loaderEl = this.loaderEl;
if (ownerEl && ownerEl.ismasked && loaderEl){
loaderEl.css({
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',

View file

@ -573,7 +573,7 @@ define([
} else {
var cg = Common.Utils.croppedGeometry();
docH = cg.height - 10;
if (top + menuH > docH) {
if (top + menuH > docH + cg.top) {
if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height
m = fixedAlign.match(/^([a-z]+)-([a-z]+)/);
top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1] + (fixedOffset || 0);

View file

@ -238,6 +238,16 @@ define([
this.cmpEl.find('a').contents().last()[0].textContent = (noencoding) ? caption : Common.Utils.String.htmlEncode(caption);
},
setIconCls: function(iconCls) {
if (this.rendered && !_.isEmpty(this.iconCls)) {
var firstChild = this.cmpEl.children(':first');
if (firstChild) {
firstChild.find('.menu-item-icon').removeClass(this.iconCls).addClass(iconCls);
}
}
this.iconCls = iconCls;
},
setChecked: function(check, suppressEvent) {
this.toggle(check, suppressEvent);
},

View file

@ -120,8 +120,8 @@ define([
template :
'<input type="text" class="form-control" spellcheck="false">' +
'<div class="spinner-buttons">' +
'<button type="button" class="spinner-up"><i class="img-commonctrl"></i></button>' +
'<button type="button" class="spinner-down"><i class="img-commonctrl"></i></button>' +
'<button type="button" class="spinner-up"><i class="arrow"></i></button>' +
'<button type="button" class="spinner-down"><i class="arrow"></i></button>' +
'</div>',
initialize : function(options) {
@ -234,10 +234,7 @@ define([
},
getNumberValue: function(){
if (this.options.allowAuto && this.value==this.options.autoText)
return -1;
else
return parseFloat(this.value);
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
},
getUnitValue: function(){
@ -262,7 +259,7 @@ define([
this.lastValue = this.value;
if ( typeof value === 'undefined' || value === ''){
this.value = '';
} else if (this.options.allowAuto && (Math.abs(Common.Utils.String.parseFloat(value)+1.)<0.0001 || value==this.options.autoText)) {
} else if (this.options.allowAuto && (Math.abs(Common.Utils.String.parseFloat(value)+1.)<0.0001 || this.checkAutoText(value))) {
this.value = this.options.autoText;
} else {
var number = this._add(Common.Utils.String.parseFloat(value), 0, (this.options.allowDecimal) ? 3 : 0);
@ -450,8 +447,8 @@ define([
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
val = me.options.minValue-me.options.step;
if (me.checkAutoText(me.getValue())) {
val = me.options.defaultValue-me.options.step;
} else
val = Common.Utils.String.parseFloat(me.getValue());
if (isNaN(val))
@ -471,7 +468,7 @@ define([
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
if (me.checkAutoText(me.getValue())) {
val = me.options.minValue;
} else
val = Common.Utils.String.parseFloat(me.getValue());
@ -537,6 +534,22 @@ define([
v_out = parseFloat((v_out * 6.0 / 25.4).toFixed(6));
return v_out;
},
focus: function() {
if (this.$input) this.$input.focus();
},
setDefaultValue: function(value) {
this.options.defaultValue = value;
},
checkAutoText: function(value) {
if (this.options.allowAuto && typeof value == 'string') {
var val = value.toLowerCase();
return (val==this.options.autoText.toLowerCase() || val=='auto');
}
return false;
}
});

View file

@ -61,9 +61,11 @@ define([
};
function onTabDblclick(e) {
var tab = $(e.target).data('tab');
if ( this.dblclick_el == tab )
var tab = $(e.currentTarget).find('> a[data-tab]').data('tab');
if ( this.dblclick_el == tab ) {
this.fireEvent('change:compact', [tab]);
this.dblclick_el = undefined;
}
}
function onShowFullviewPanel(state) {
@ -94,11 +96,13 @@ define([
'<a class="scroll left"></a>' +
'<ul>' +
'<% for(var i in items) { %>' +
'<% if (typeof items[i] == "object") { %>' +
'<li class="ribtab' +
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>">' +
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>"><%= items[i].caption %></a>' +
'</li>' +
'<% } %>' +
'<% } %>' +
'</ul>' +
'<a class="scroll right"></a>' +
@ -235,25 +239,36 @@ define([
onTabClick: function (e) {
var me = this;
var $target = $(e.currentTarget);
var tab = $target.find('> a[data-tab]').data('tab');
var islone = $target.hasClass('x-lone');
if ( me.isFolded ) {
if ( $target.hasClass('x-lone') ) {
me.collapse();
// me.fireEvent('')
} else
if ( $target.hasClass('active') ) {
me.collapse();
} else {
me.setTab(tab);
me.processPanelVisible(null, true);
}
if ($target.hasClass('x-lone')) {
me.isFolded && me.collapse();
} else {
if ( !$target.hasClass('active') && !islone ) {
if ( $target.hasClass('active') ) {
if (!me._timerSetTab) {
me.dblclick_el = tab;
if ( me.isFolded ) {
me.collapse();
setTimeout(function(){
me.dblclick_el = undefined;
}, 500);
}
}
} else {
me._timerSetTab = true;
setTimeout(function(){
me._timerSetTab = false;
}, 500);
me.setTab(tab);
me.processPanelVisible(null, true);
if ( !me.isFolded ) {
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
me.dblclick_timer = setTimeout(function () {
me.dblclick_el = tab;
delete me.dblclick_timer;
},500);
} else
me.dblclick_el = tab;
}
}
},
@ -289,12 +304,6 @@ define([
$tp.addClass('active');
}
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
me.dblclick_timer = setTimeout(function () {
me.dblclick_el = tab;
delete me.dblclick_timer;
},300);
this.fireEvent('tab:active', [tab]);
}
},
@ -391,7 +400,8 @@ define([
if (!_flex) {
_flex = [];
_.each($active.find('.group.flex'), function(item) {
_flex.push($(item));
var el = $(item);
_flex.push({el: el, width: el.attr('data-group-width') || el.attr('max-width')}); //save flex element and it's initial width
});
data.flex = _flex;
}
@ -399,7 +409,7 @@ define([
if ( _rightedge > _maxright) {
if (_flex.length>0) {
for (var i=0; i<_flex.length; i++) {
var item = _flex[i];
var item = _flex[i].el;
if (item.outerWidth() > parseInt(item.css('min-width')))
return;
else
@ -433,7 +443,7 @@ define([
if (_flex.length>0 && $active.find('.btn-slot.compactwidth').length<1) {
for (var i=0; i<_flex.length; i++) {
var item = _flex[i];
item.css('width', item.css('max-width'));
item.el.css('width', item.width);
}
}
}
@ -462,8 +472,10 @@ define([
},
setVisible: function (tab, visible) {
if ( tab && this.$tabs )
if ( tab && this.$tabs ) {
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
this.onResize();
}
}
};
}()));

View file

@ -56,8 +56,8 @@ define([
colorValues: ['#000000', '#ffffff'],
currentThumb: 0,
thumbTemplate: '<div class="thumb img-commonctrl" style="">' +
'<div class="thumb-top"></div>' +
'<div class="thumb-bottom"></div>' +
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +
'</div>'
},
@ -146,6 +146,43 @@ define([
return recalc_indexes;
},
findLeftThumb: function(pos) {
var me = this,
leftThumb = 100,
index = 0,
len = this.thumbs.length,
dist;
for (var i=0; i<len; i++) {
dist = pos - me.thumbs[i].position;
if (dist > 0 && dist <= leftThumb) {
var above = me.thumbs[i + 1];
var below = me.thumbs[i - 1];
if (below !== undefined && pos < below.position) {
continue;
}
if (above !== undefined && pos > above.position) {
continue;
}
index = i;
leftThumb = dist;
}
}
return index;
},
calculationNewColor: function(color1, color2, ratio) {
var w1 = ratio ? ratio/100 : 0.5;
var w2 = 1 - w1;
var rgbColor1 = Common.Utils.ThemeColor.getRgbColor(color1),
rgbColor2 = Common.Utils.ThemeColor.getRgbColor(color2);
var rgb = [Math.round(rgbColor1.get_r() * w2 + rgbColor2.get_r() * w1),
Math.round(rgbColor1.get_g() * w2 + rgbColor2.get_g() * w1),
Math.round(rgbColor1.get_b() * w2 + rgbColor2.get_b() * w1)];
return Common.Utils.ThemeColor.getHexColor(rgb[0], rgb[1], rgb[2]);
},
addThumb: function() {
Common.UI.MultiSlider.prototype.addThumb.call(this);
@ -159,13 +196,29 @@ define([
me.changeSliderStyle();
},
addNewThumb: function(index, color) {
var me = this;
addNewThumb: function(index, pos, curIndex) {
var me = this,
indexLeftThumb = this.findLeftThumb(pos),
index = index,
color;
if (!_.isUndefined(curIndex)) {
this.addThumb();
index = this.thumbs.length - 1;
color = this.calculationNewColor(this.thumbs[indexLeftThumb].colorValue, this.thumbs[indexLeftThumb === index - 1 ? indexLeftThumb : indexLeftThumb + 1].colorValue);
this.setThumbPosition(index, pos);
var value = pos/this.delta + this.minValue;
this.thumbs[index].value = value;
} else {
var ratio = (pos - this.thumbs[indexLeftThumb].value) * 100 / (this.thumbs[indexLeftThumb + 1].value - this.thumbs[indexLeftThumb].value);
color = ratio < 0 ? this.thumbs[indexLeftThumb].colorValue : this.calculationNewColor(this.thumbs[indexLeftThumb].colorValue, this.thumbs[indexLeftThumb === index - 1 ? indexLeftThumb : indexLeftThumb + 1].colorValue, ratio);
}
me.thumbs[index].thumbcolor = me.thumbs[index].thumb.find('> div');
(index>0) && this.setColorValue(color, index);
(index>0) && this.setColorValue('#' + color, index);
me.sortThumbs();
me.changeSliderStyle();
me.changeGradientStyle();
return color;
},
removeThumb: function(index) {

View file

@ -432,7 +432,7 @@ define([
var index = me.thumbs.length - 1;
me.setThumbPosition(index, pos);
me.thumbs[index].value = value;
me.trigger('addthumb', me, index, nearIndex, thumbColor);
me.trigger('addthumb', me, index, pos);
me.trigger('change', me);
me.trigger('changecomplete', me);

View file

@ -43,7 +43,7 @@ define([
options : {
target : $(document.body),
text : '',
placement: 'right',
placement: 'right-bottom',
showLink: true
},
@ -53,7 +53,7 @@ define([
'<div class="tip-arrow <%= scope.placement %>"></div>',
'<div>',
'<div class="tip-text"><%= scope.text %></div>',
'<div class="close img-commonctrl"></div>',
'<div class="close"></div>',
'</div>',
'<% if ( scope.showLink ) { %>',
'<div class="show-link"><label><%= scope.textLink %></label></div>',
@ -96,6 +96,7 @@ define([
hide: function() {
if (this.cmpEl) this.cmpEl.hide();
this.trigger('hide');
},
close: function() {
@ -103,23 +104,45 @@ define([
},
applyPlacement: function () {
var showxy = this.target.offset(),
innerHeight = Common.Utils.innerHeight();
var showxy = this.target.offset();
if (this.placement=='target') {
this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'});
return;
}
if (this.placement == 'document') {
// this.cmpEl.css('top', $('#editor_sdk').offset().top);
} else
if (this.placement == 'top')
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
else {// left or right
var top = showxy.top + this.target.height()/2,
height = this.cmpEl.height();
if (top+height>innerHeight)
top = innerHeight - height;
if (this.placement == 'left')
this.cmpEl.css({top : top + 'px', right: Common.Utils.innerWidth() - showxy.left - 5 + 'px'});
else
this.cmpEl.css({top : top + 'px', left: showxy.left + this.target.width() + 'px'});
var placement = this.placement.split('-');
if (placement.length>0) {
var top, left, bottom, right;
var pos = placement[0];
if (pos=='top') {
bottom = Common.Utils.innerHeight() - showxy.top;
} else if (pos == 'bottom') {
top = showxy.top + this.target.height();
} else if (pos == 'left') {
right = Common.Utils.innerWidth() - showxy.left;
} else if (pos == 'right') {
left = showxy.left + this.target.width();
}
pos = placement[1];
if (pos=='top') {
bottom = Common.Utils.innerHeight() - showxy.top - this.target.height()/2;
} else if (pos == 'bottom') {
top = showxy.top + this.target.height()/2;
} else if (pos == 'left') {
right = Common.Utils.innerWidth() - showxy.left - this.target.width()/2;
} else if (pos == 'right') {
left = showxy.left + this.target.width()/2;
} else {
if (bottom!==undefined || top!==undefined)
left = showxy.left + (this.target.width() - this.cmpEl.width())/2;
else
top = showxy.top + (this.target.height() - this.cmpEl.height())/2;
}
top = (top!==undefined) ? (top + 'px') : 'auto';
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
left = (left!==undefined) ? (left + 'px') : 'auto';
right = (right!==undefined) ? (right + 'px') : 'auto';
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
}
},

View file

@ -51,9 +51,15 @@ define([
this.active = false;
this.label = 'Tab';
this.cls = '';
this.iconCls = '';
this.iconVisible = false;
this.iconTitle = '';
this.index = -1;
this.template = _.template(['<li class="<% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%- label %>">',
'<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>"><%- label %></span>',
this.template = _.template(['<li class="list-item <% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%><% if(iconVisible){%> icon-visible <%}%>" data-label="<%- label %>">',
'<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>">',
'<div class="toolbar__icon <% if(iconCls.length){%><%= iconCls %><%}%>" title="<% if(iconTitle.length){%><%=iconTitle%><%}%>"></div>',
'<%- label %>',
'</span>',
'</li>'].join(''));
this.initialize.call(this, opts);
@ -126,6 +132,16 @@ define([
setCaption: function(text) {
this.$el.find('> span').text(text);
},
changeIconState: function(visible, title) {
if (this.iconCls.length) {
this.iconVisible = visible;
this.iconTitle = title || '';
this[visible ? 'addClass' : 'removeClass']('icon-visible');
if (title)
this.$el.find('.' + this.iconCls).attr('title', title);
}
}
});

View file

@ -222,6 +222,12 @@ define([
this.bar.trigger('tab:manual', this.bar, this.bar.tabs.indexOf(tab), tab);
} else {
tab.changeState();
if (this.bar.isEditFormula)
setTimeout(function(){
$('#ce-cell-content').focus();
var $cellContent = $('#ce-cell-content')[0];
$cellContent.selectionStart = $cellContent.selectionEnd = $cellContent.value.length;
}, 500);
}
}
}
@ -241,7 +247,7 @@ define([
lockDrag = true;
}
});
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1) {
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1 || this.bar.isEditFormula) {
lockDrag = true;
}
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
@ -250,7 +256,14 @@ define([
} else {
this.bar.$el.find('ul > li > span').attr('draggable', 'false');
}
this.bar.trigger('tab:drag', this.bar.selectTabs);
if ($('#ce-cell-content').is(':focus'))
if (!this.bar.isEditFormula) {
$('#ce-cell-content').blur();
} else {
setTimeout(function () {
$('#ce-cell-content').focus();
}, 500)
}
}, this)
});
tab.$el.children().on(
@ -262,19 +275,27 @@ define([
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
}, this),
dragenter: $.proxy(function (e) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
var event = e.originalEvent;
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = data ? 'move' : 'none';
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = data ? 'move' : 'none';
} else {
event.dataTransfer.dropEffect = 'none';
}
}, this),
dragover: $.proxy(function (e) {
var event = e.originalEvent;
if (event.preventDefault) {
event.preventDefault(); // Necessary. Allows us to drop.
}
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
} else {
event.dataTransfer.dropEffect = 'none';
}
return false;
}, this),
dragleave: $.proxy(function (e) {
@ -336,14 +357,14 @@ define([
}, this));
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = data ? 'move' : 'none';
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
}, this));
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
if (event.preventDefault) {
event.preventDefault(); // Necessary. Allows us to drop.
}
event.dataTransfer.dropEffect = 'move';
this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
event.dataTransfer.dropEffect = !this.isEditFormula ? 'move' : 'none';
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
return false;
}, this));
addEvent(this.$bar[0], 'dragleave', _.bind(function (event) {
@ -351,10 +372,9 @@ define([
this.tabs[this.tabs.length - 1].$el.removeClass('mousemove right');
}, this));
addEvent(this.$bar[0], 'drop', _.bind(function (event) {
var index = this.tabs.length;
this.$el.find('.mousemove').removeClass('mousemove right');
if (this.isDrop === undefined) {
this.trigger('tab:drop', event.dataTransfer, index);
this.trigger('tab:drop', event.dataTransfer, 'last');
} else {
this.isDrop = undefined;
}
@ -374,7 +394,7 @@ define([
_onMouseWheel: function(e) {
var hidden = this.checkInvisible(true),
forward = ((e.detail && -e.detail) || e.wheelDelta) > 0;
forward = ((e.detail && -e.detail) || e.wheelDelta) < 0;
if (forward) {
if (hidden.last) {
@ -543,12 +563,17 @@ define([
this.checkInvisible(suppress);
} else if ( index >= (this.tabs.length - 1) || index == 'last') {
var tab = this.tabs[this.tabs.length-1].$el;
if (this.$bar.find('.separator-item').length === 0) {
this.$bar.append('<li class="separator-item"><span></span></li>');
}
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress);
} else {
if (!this.isTabVisible(this.tabs.length - 1) && this.$bar.find('.separator-item').length === 0) {
this.$bar.append('<li class="separator-item"><span></span></li>');
}
var rightbound = this.$bar.width(),
tab, right, left;
if (index == 'forward') {
for (var i = 0; i < this.tabs.length; i++) {
tab = this.tabs[i].$el;
@ -624,7 +649,7 @@ define([
//left = tab.position().left;
//right = left + tab.width();
return !(left < leftbound) && !(right - rightbound > 0.1);
return !(left < leftbound) && !(right - rightbound > 0.5);
}
return false;

View file

@ -0,0 +1,202 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* TextareaField.js
*
* Created by Julia Radzhabova on 29/09/20
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/component/BaseView',
'common/main/lib/component/Tooltip'
], function () { 'use strict';
Common.UI.TextareaField = Common.UI.BaseView.extend((function() {
return {
options : {
id : null,
cls : '',
style : '',
value : '',
maxlength : undefined,
placeHolder : '',
spellcheck : false,
disabled: false
},
template: _.template([
'<div class="textarea-field" style="<%= style %>">',
'<textarea ',
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
'placeholder="<%= placeHolder %>" ',
'></textarea>',
'</div>'
].join('')),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
var me = this;
this.id = me.options.id || Common.UI.getId();
this.cls = me.options.cls;
this.style = me.options.style;
this.value = me.options.value;
this.placeHolder = me.options.placeHolder;
this.template = me.options.template || me.template;
this.disabled = me.options.disabled;
this.spellcheck = me.options.spellcheck;
this.maxLength = me.options.maxLength;
me.rendered = me.options.rendered || false;
if (me.options.el) {
me.render();
}
},
render : function(parentEl) {
var me = this;
if (!me.rendered) {
this.cmpEl = $(this.template({
id : this.id,
cls : this.cls,
style : this.style,
placeHolder : this.placeHolder,
spellcheck : this.spellcheck,
scope : me
}));
if (parentEl) {
this.setElement(parentEl, false);
parentEl.html(this.cmpEl);
} else {
this.$el.html(this.cmpEl);
}
} else {
this.cmpEl = this.$el;
}
if (!me.rendered) {
var el = this.cmpEl;
this._input = this.cmpEl.find('textarea').addBack().filter('textarea');
this._input.on('blur', _.bind(this.onInputChanged, this));
this._input.on('keydown', _.bind(this.onKeyDown, this));
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
if (this.disabled)
this.setDisabled(this.disabled);
}
me.rendered = true;
return this;
},
_doChange: function(e, extra) {
// skip processing for internally-generated synthetic event
// to avoid double processing
if (extra && extra.synthetic)
return;
var newValue = $(e.target).val(),
oldValue = this.value;
this.trigger('changed:before', this, newValue, oldValue, e);
if (e.isDefaultPrevented())
return;
this.value = newValue;
// trigger changed event
this.trigger('changed:after', this, newValue, oldValue, e);
},
onInputChanged: function(e, extra) {
this._doChange(e, extra);
},
onKeyDown: function(e) {
this.trigger('keydown:before', this, e);
if (e.isDefaultPrevented())
return;
if (e.keyCode === Common.UI.Keys.RETURN) {
e.stopPropagation();
}
if (e.keyCode == Common.UI.Keys.ESC)
this.setValue(this.value);
if (e.keyCode==Common.UI.Keys.ESC)
this.trigger('inputleave', this);
},
setDisabled: function(disabled) {
this.disabled = disabled;
$(this.el).toggleClass('disabled', disabled);
disabled
? this._input.attr('disabled', true)
: this._input.removeAttr('disabled');
},
isDisabled: function() {
return this.disabled;
},
setValue: function(value) {
this.value = value;
if (this.rendered){
this._input.val(value);
}
},
getValue: function() {
return this.value;
},
focus: function() {
this._input.focus();
}
}
})());
});

View file

@ -60,7 +60,7 @@ define([
template :
_.template(
'<div style="padding: 12px;">' +
'<div style="padding: 8px 12px 12px;">' +
'<% var me = this; %>' +
'<% $(colors).each(function(num, item) { %>' +
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +

View file

@ -159,11 +159,12 @@ define([
showLast: true,
allowScrollbar: true,
scrollAlwaysVisible: true,
emptyItemText: ''
emptyItemText: '',
keyMoveDirection: 'both'
},
template: _.template([
'<div class="treeview inner"></div>'
'<div class="treeview inner" style="<%= style %>"></div>'
].join('')),
initialize : function(options) {
@ -280,6 +281,86 @@ define([
this.store.collapseSubItems(record);
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
}
},
onKeyDown: function (e, data) {
if ( this.disabled ) return;
if (data===undefined) data = e;
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
data.preventDefault();
data.stopPropagation();
var rec = this.getSelectedRec();
if (this.lastSelectedRec===null)
this.lastSelectedRec = rec;
if (data.keyCode==Common.UI.Keys.RETURN) {
this.lastSelectedRec = null;
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
rec = this.selectedBeforeHideRec;
this.trigger('item:click', this, this, rec, e);
this.trigger('item:select', this, this, rec, e);
this.trigger('entervalue', this, rec, e);
if (this.parentMenu)
this.parentMenu.hide();
} else {
var idx = _.indexOf(this.store.models, rec);
if (idx<0) {
if (data.keyCode==Common.UI.Keys.LEFT) {
var target = $(e.target).closest('.dropdown-submenu.over');
if (target.length>0) {
target.removeClass('over');
target.find('> a').focus();
} else
idx = 0;
} else
idx = 0;
} else if (this.options.keyMoveDirection == 'both') {
var hasSubItems = rec.get('hasSubItems');
var hasParent = rec.get('hasParent');
var isExpanded = rec.get('isExpanded');
if (data.keyCode==Common.UI.Keys.LEFT) {
if (hasSubItems && isExpanded)
this.collapseRecord(rec);
} else if (data.keyCode==Common.UI.Keys.RIGHT) {
if (hasSubItems && !isExpanded)
this.expandRecord(rec);
} else {
if (data.keyCode==Common.UI.Keys.DOWN) {
for (var i=idx+1; i<this.store.length; i++) {
if (this.store.at(i).get('isVisible')) {
idx=i;
break;
}
}
} else if (data.keyCode==Common.UI.Keys.UP) {
for (var i=idx-1; i>=0; i--) {
if (this.store.at(i).get('isVisible')) {
idx=i;
break;
}
}
}
}
} else {
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
? Math.max(0, idx-1)
: Math.min(this.store.length - 1, idx + 1) ;
}
if (idx !== undefined && idx>=0) rec = this.store.at(idx);
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
}
}
} else {
this.trigger('item:keydown', this, rec, e);
}
},
focus: function() {
this.cmpEl && this.cmpEl.find('.treeview').focus();
}
}
})());

View file

@ -137,7 +137,8 @@
define([
'common/main/lib/component/BaseView',
'common/main/lib/component/CheckBox'
'common/main/lib/component/CheckBox',
'common/main/lib/component/FocusManager'
], function () {
'use strict';
@ -152,6 +153,7 @@ define([
alias: 'Window',
cls: '',
toolclose: 'close',
help: false,
maxwidth: undefined,
maxheight: undefined,
minwidth: 0,
@ -162,9 +164,14 @@ define([
var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' +
'<% if (header==true) { %>' +
'<div class="header">' +
'<div class="tools">' +
'<% if (closable!==false) %>' +
'<div class="tool close img-commonctrl"></div>' +
'<div class="tool close"></div>' +
'<% %>' +
'<% if (help===true) %>' +
'<div class="tool help">?</div>' +
'<% %>' +
'</div>' +
'<div class="title"><%= title %></div> ' +
'</div>' +
'<% } %>' +
@ -232,6 +239,14 @@ define([
return {width: width, height: height, top: Common.Utils.InternalSettings.get('window-inactive-area-top')};
}
function _autoSize() {
if (this.initConfig.height == 'auto') {
var height = parseInt(this.$window.find('> .body').css('height'));
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
this.$window.height(height);
}
}
function _centre() {
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
@ -284,7 +299,7 @@ define([
/* window drag's functions */
function _dragstart(event) {
if ( $(event.target).hasClass('close') ) return;
if ( $(event.target).hasClass('close') || $(event.target).hasClass('help') ) return;
Common.UI.Menu.Manager.hideAll();
var zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1;
this.dragging.enabled = true;
@ -440,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 <%= iconCls %>"></div><% } %>' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl img-no-theme-filter <%= 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>' +
@ -591,7 +606,7 @@ define([
if (b.value !== undefined)
newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')};
} else {
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''};
if (b=='custom')
newBtns[b].cls += ' custom';
}
@ -635,8 +650,13 @@ define([
else
(this.initConfig.toolclose=='hide') ? this.hide() : this.close();
};
var dohelp = function() {
if ( this.$window.find('.tool.help').hasClass('disabled') ) return;
this.fireEvent('help',this);
};
this.$window.find('.header').on('mousedown', this.binding.dragStart);
this.$window.find('.tool.close').on('click', _.bind(doclose, this));
this.$window.find('.tool.help').on('click', _.bind(dohelp, this));
if (!this.initConfig.modal)
Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this));
@ -647,11 +667,7 @@ define([
});
}
if (this.initConfig.height == 'auto') {
var height = parseInt(this.$window.find('> .body').css('height'));
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
this.$window.height(height);
} else {
if (this.initConfig.height !== 'auto') {
this.$window.css('height',this.initConfig.height);
}
@ -693,13 +709,14 @@ define([
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
} else {
var opacity = mask.css('opacity');
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css('opacity', 0);
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
setTimeout(function () {
mask.css(_getTransformation(opacity));
mask.css(_getTransformation(maskOpacity));
}, 1);
}
@ -709,6 +726,7 @@ define([
if (!this.$window) {
this.render();
_autoSize.call(this);
if (_.isNumber(x) && _.isNumber(y)) {
this.$window.css('left',Math.floor(x));
@ -763,7 +781,7 @@ define([
this.fireEvent('show', this);
}
Common.NotificationCenter.trigger('window:show');
Common.NotificationCenter.trigger('window:show', this);
},
close: function(suppressevent) {
@ -785,12 +803,12 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', maskOpacity);
mask.hide();
mask.attr('counter', 0);
}
@ -803,7 +821,7 @@ define([
}
}
Common.NotificationCenter.trigger('modal:close', this);
Common.NotificationCenter.trigger('modal:close', this, hide_mask && (parseInt(mask.attr('counter'))<1));
}
this.$window.remove();
@ -826,12 +844,12 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', maskOpacity);
mask.hide();
mask.attr('counter', 0);
}
@ -843,7 +861,7 @@ define([
}
}
}
Common.NotificationCenter.trigger('modal:hide', this);
Common.NotificationCenter.trigger('modal:hide', this, hide_mask && (parseInt(mask.attr('counter'))<1));
}
this.$window.hide();
this.$window.removeClass('notransform');
@ -951,6 +969,13 @@ define([
this.$window.find('.resize-border').remove();
}
this.resizable = resizable;
} else {
if (resizable) {
(minSize && minSize.length>1) && (this.initConfig.minwidth = minSize[0]);
(minSize && minSize.length>1) && (this.initConfig.minheight = minSize[1]);
(maxSize && maxSize.length>1) && (this.initConfig.maxwidth = maxSize[0]);
(maxSize && maxSize.length>1) && (this.initConfig.maxheight = maxSize[1]);
}
}
},
@ -964,6 +989,13 @@ define([
onPrimary: function() {},
getFocusedComponents: function() {
return [];
},
getDefaultFocusableComponent: function() {
},
cancelButtonText: 'Cancel',
okButtonText: 'OK',
yesButtonText: 'Yes',

View file

@ -169,6 +169,7 @@ define([
}));
} else {
user.set({online: change.asc_getState()});
user.set({username: change.asc_getUserName()});
}
}
},

View file

@ -169,7 +169,6 @@ define([
if (data) {
this.currentUserId = data.config.user.id;
this.currentUserName = data.config.user.fullname;
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
this.hintmode = data['hintmode'] || false;
this.viewmode = data['viewmode'] || false;
@ -217,7 +216,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(this.currentUserName);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag)) {
@ -238,7 +237,7 @@ define([
},
onRemoveComments: function (type) {
if (this.api) {
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canEditComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canDeleteComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
}
},
onResolveComment: function (uid) {
@ -261,6 +260,7 @@ define([
ascComment.asc_putUserName(comment.get('username'));
ascComment.asc_putSolved(!comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
if (!_.isUndefined(ascComment.asc_putDocumentFlag)) {
ascComment.asc_putDocumentFlag(comment.get('unattached'));
@ -276,6 +276,7 @@ define([
addReply.asc_putOnlyOfficeTime(t.ooDateToString(new Date(reply.get('time'))));
addReply.asc_putUserId(reply.get('userid'));
addReply.asc_putUserName(reply.get('username'));
addReply.asc_putUserData(reply.get('userdata'));
ascComment.asc_addReply(addReply);
}
@ -289,7 +290,7 @@ define([
return false;
},
onShowComment: function (id, selected) {
onShowComment: function (id, selected, fromLeftPanelSelection) {
var comment = this.findComment(id);
if (comment) {
if (null !== comment.get('quote')) {
@ -317,9 +318,11 @@ define([
this.isSelectedComment = selected;
}
this.api.asc_selectComment(id);
this._dontScrollToComment = true;
this.api.asc_showComment(id,false);
if (!fromLeftPanelSelection || !((0 === _.difference(this.uids, [id]).length) && (0 === _.difference([id], this.uids).length))) {
this.api.asc_selectComment(id);
this._dontScrollToComment = true;
this.api.asc_showComment(id,false);
}
}
} else {
@ -351,9 +354,10 @@ define([
ascComment.asc_putTime(t.utcDateToString(new Date(comment.get('time'))));
ascComment.asc_putOnlyOfficeTime(t.ooDateToString(new Date(comment.get('time'))));
ascComment.asc_putUserId(t.currentUserId);
ascComment.asc_putUserName(t.currentUserName);
ascComment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
if (!_.isUndefined(ascComment.asc_putDocumentFlag)) {
ascComment.asc_putDocumentFlag(comment.get('unattached'));
@ -380,6 +384,7 @@ define([
addReply.asc_putOnlyOfficeTime(t.ooDateToString(new Date(reply.get('time'))));
addReply.asc_putUserId(reply.get('userid'));
addReply.asc_putUserName(reply.get('username'));
addReply.asc_putUserData(reply.get('userdata'));
ascComment.asc_addReply(addReply);
}
@ -411,6 +416,7 @@ define([
ascComment.asc_putUserName(comment.get('username'));
ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
if (!_.isUndefined(ascComment.asc_putDocumentFlag)) {
ascComment.asc_putDocumentFlag(comment.get('unattached'));
@ -425,7 +431,7 @@ define([
if (reply.get('id') === replyId && !_.isUndefined(replyVal)) {
addReply.asc_putText(replyVal);
addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(me.currentUserName);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
} else {
addReply.asc_putText(reply.get('reply'));
addReply.asc_putUserId(reply.get('userid'));
@ -434,6 +440,7 @@ define([
addReply.asc_putTime(me.utcDateToString(new Date(reply.get('time'))));
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date(reply.get('time'))));
addReply.asc_putUserData(reply.get('userdata'));
ascComment.asc_addReply(addReply);
}
@ -474,6 +481,7 @@ define([
ascComment.asc_putUserName(comment.get('username'));
ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
if (!_.isUndefined(ascComment.asc_putDocumentFlag)) {
ascComment.asc_putDocumentFlag(comment.get('unattached'));
@ -490,6 +498,7 @@ define([
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date(reply.get('time'))));
addReply.asc_putUserId(reply.get('userid'));
addReply.asc_putUserName(reply.get('username'));
addReply.asc_putUserData(reply.get('userdata'));
ascComment.asc_addReply(addReply);
}
@ -502,7 +511,7 @@ define([
addReply.asc_putTime(me.utcDateToString(new Date()));
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date()));
addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(me.currentUserName);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
ascComment.asc_addReply(addReply);
@ -533,6 +542,7 @@ define([
ascComment.asc_putUserName(comment.get('username'));
ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
if (!_.isUndefined(ascComment.asc_putDocumentFlag)) {
ascComment.asc_putDocumentFlag(comment.get('unattached'));
@ -549,6 +559,7 @@ define([
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date(reply.get('time'))));
addReply.asc_putUserId(reply.get('userid'));
addReply.asc_putUserName(reply.get('username'));
addReply.asc_putUserData(reply.get('userdata'));
ascComment.asc_addReply(addReply);
}
@ -762,8 +773,11 @@ define([
comment.set('usercolor', (user) ? user.get('color') : null);
comment.set('resolved', data.asc_getSolved());
comment.set('quote', data.asc_getQuoteText());
comment.set('userdata', data.asc_getUserData());
comment.set('time', date.getTime());
comment.set('date', t.dateToLocaleTimeString(date));
comment.set('editable', t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId));
comment.set('removable', t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId));
replies = _.clone(comment.get('replys'));
@ -783,12 +797,14 @@ define([
usercolor : (user) ? user.get('color') : null,
date : t.dateToLocaleTimeString(dateReply),
reply : data.asc_getReply(i).asc_getText(),
userdata : data.asc_getReply(i).asc_getUserData(),
time : dateReply.getTime(),
editText : false,
editTextInPopover : false,
showReplyInPopover : false,
scope : t.view,
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId),
removable : t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
}));
}
@ -1217,6 +1233,7 @@ define([
comment : data.asc_getText(),
resolved : data.asc_getSolved(),
unattached : !_.isUndefined(data.asc_getDocumentFlag) ? data.asc_getDocumentFlag() : false,
userdata : data.asc_getUserData(),
id : Common.UI.getId(),
time : date.getTime(),
showReply : false,
@ -1227,6 +1244,7 @@ define([
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId),
removable : this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId),
hint : !this.mode.canComments,
groupName : (groupname && groupname.length>1) ? groupname[1] : null
});
@ -1257,12 +1275,14 @@ define([
usercolor : (user) ? user.get('color') : null,
date : this.dateToLocaleTimeString(date),
reply : data.asc_getReply(i).asc_getText(),
userdata : data.asc_getReply(i).asc_getUserData(),
time : date.getTime(),
editText : false,
editTextInPopover : false,
showReplyInPopover : false,
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId),
removable : this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
}));
}
}
@ -1292,7 +1312,7 @@ define([
time: date.getTime(),
date: this.dateToLocaleTimeString(date),
userid: this.currentUserId,
username: this.currentUserName,
username: Common.Utils.UserInfoParser.getCurrentName(),
usercolor: (user) ? user.get('color') : null,
editTextInPopover: true,
showReplyInPopover: false,
@ -1356,7 +1376,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(this.currentUserName);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag))
@ -1423,7 +1443,7 @@ define([
for (i = 0; i < comments.length; ++i) {
comment = this.findComment(comments[i].asc_getId());
if (comment) {
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true
comment.set('hint', false);
this.popoverComments.push(comment);
}

View file

@ -78,16 +78,6 @@ define([
} else
if (/window:features/.test(cmd)) {
var obj = JSON.parse(param);
if ( obj.canUndock == 'true' ) {
if ( !config.canUndock ) {
config.canUndock = true;
if ( !_.isEmpty(config) )
Common.NotificationCenter.trigger('app:config', {canUndock:true});
}
}
if (_.isNumber(obj.skiptoparea)) {
if ( $('.asc-window.modal').length && $('.asc-window.modal').position().top < obj.skiptoparea )
$('.asc-window.modal').css('top', obj.skiptoparea);
@ -95,13 +85,6 @@ define([
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
}
} else
if (/window:status/.test(cmd)) {
var obj = JSON.parse(param);
if ( obj.action == 'undocking' ) {
Common.NotificationCenter.trigger('undock:status', {status:obj.status=='undocked'?'undocked':'docked'});
}
} else
if (/editor:config/.test(cmd)) {
if ( param == 'request' ) {
if ( !!titlebuttons ) {
@ -128,7 +111,7 @@ define([
} else
if (/button:click/.test(cmd)) {
var obj = JSON.parse(param);
if ( !!obj.action ) {
if ( !!obj.action && !!titlebuttons[obj.action] ) {
titlebuttons[obj.action].btn.click();
}
} else
@ -209,20 +192,12 @@ define([
}
});
Common.NotificationCenter.on('action:undocking', function (opts) {
native.execCommand('editor:event', JSON.stringify({action:'undocking', state: opts == 'dock' ? 'dock' : 'undock'}));
});
Common.NotificationCenter.on('app:face', function (mode) {
if ( config.canUndock ) {
Common.NotificationCenter.trigger('app:config', {canUndock: true});
}
native.execCommand('webapps:features', JSON.stringify(
{version: config.version, eventloading:true, titlebuttons:true, viewmode:!mode.isEdit, crypted:mode.isCrypted} ));
titlebuttons = {};
if ( !mode.isEdit ) {
native.execCommand('webapps:features', JSON.stringify(
{version: config.version, eventloading:true, titlebuttons:true, viewmode:true} ));
} else {
if ( mode.isEdit ) {
var header = webapp.getController('Viewport').getView('Common.Views.Header');
if (!!header.btnSave) {
titlebuttons['save'] = {btn: header.btnSave};

View file

@ -56,10 +56,11 @@ define([
var createExternalEditor = function() {
!!customization && (customization.uiTheme = Common.localStorage.getItem("ui-theme", "theme-light"));
externalEditor = new DocsAPI.DocEditor('id-diagram-editor-placeholder', {
width : '100%',
height : '100%',
documentType: 'spreadsheet',
documentType: 'cell',
document : {
url : '_chart_',
permissions : {
@ -242,6 +243,15 @@ define([
}
},
showExternalEditor: function () {
if ( externalEditor ) {
var value = Common.localStorage.getItem("ui-theme", "theme-light");
externalEditor.serviceCommand('theme:change', value);
}
this.diagramEditorView.show();
},
warningTitle: 'Warning',
warningText: 'The object is disabled because of editing by another user.',
textClose: 'Close',

View file

@ -58,7 +58,7 @@ define([
externalEditor = new DocsAPI.DocEditor('id-merge-editor-placeholder', {
width : '100%',
height : '100%',
documentType: 'spreadsheet',
documentType: 'cell',
document : {
url : '_chart_',
permissions : {

View file

@ -139,6 +139,12 @@ define([
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
}, 10);
} else {
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var urlDiff = record.get('urlDiff'),
token = record.get('token'),
hist = new Asc.asc_CVersionHistory();
@ -152,11 +158,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();
@ -175,6 +176,12 @@ define([
};
Common.UI.alert(config);
} else {
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var data = opts.data;
var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions');
if (historyStore && data!==null) {
@ -210,11 +217,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();

View file

@ -225,6 +225,7 @@ define([
variation.set_Size(itemVar.get('size'));
variation.set_InitOnSelectionChanged(itemVar.get('initOnSelectionChanged'));
variation.set_Events(itemVar.get('events'));
variation.set_Help(itemVar.get('help'));
variationsArr.push(variation);
});
@ -245,7 +246,7 @@ define([
if (!btn) return;
var _group = $('> .group', me.$toolbarPanelPlugins);
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
}
},
@ -270,7 +271,7 @@ define([
var btn = me.panelPlugins.createPluginButton(model);
if (btn) {
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
rank_plugins++;
}
@ -380,6 +381,7 @@ define([
});
}
var help = variation.get_Help();
me.pluginDlg = new Common.Views.PluginDlg({
cls: isCustomWindow ? 'plain' : '',
header: !isCustomWindow,
@ -389,7 +391,8 @@ define([
url: url,
frameId : frameId,
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this)
toolcallback: _.bind(this.onToolClose, this),
help: !!help
});
me.pluginDlg.on({
'render:after': function(obj){
@ -404,6 +407,9 @@ define([
},
'resize': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start');
},
'help': function(){
help && window.open(help, '_blank');
}
});
@ -535,7 +541,8 @@ define([
url: itemVar.url,
icons: itemVar.icons,
buttons: itemVar.buttons,
visible: visible
visible: visible,
help: itemVar.help
});
variationsArr.push(model);
@ -637,23 +644,23 @@ define([
arr = [],
plugins = this.configPlugins,
warn = false;
if (plugins.plugins && plugins.plugins.length>0) {
if (plugins.plugins && plugins.plugins.length>0)
arr = plugins.plugins;
var val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
warn = !!plugins.config.autoStartGuid;
autostart = val || [];
}
var val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
warn = !!plugins.config.autoStartGuid;
autostart = val || [];
plugins = this.serverPlugins;
if (plugins.plugins && plugins.plugins.length>0) {
if (plugins.plugins && plugins.plugins.length>0)
arr = arr.concat(plugins.plugins);
var val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
(warn || plugins.config.autoStartGuid) && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration.");
autostart = autostart.concat(val || []);
}
val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
(warn || plugins.config.autoStartGuid) && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration.");
autostart = autostart.concat(val || []);
this.autostart = autostart;
this.parsePlugins(arr, false);
}

View file

@ -48,7 +48,8 @@ define([
'common/main/lib/collection/ReviewChanges',
'common/main/lib/view/ReviewChanges',
'common/main/lib/view/ReviewPopover',
'common/main/lib/view/LanguageDialog'
'common/main/lib/view/LanguageDialog',
'common/main/lib/view/OptionsDialog'
], function () {
'use strict';
@ -131,6 +132,8 @@ define([
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
}
if (this.appConfig.canReview && !this.appConfig.isReviewOnly)
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
this.api.asc_registerCallback('asc_onAcceptChangesBeforeCompare',_.bind(this.onAcceptChangesBeforeCompare, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
@ -183,7 +186,8 @@ define([
posY = sdkchange[0].get_Y(),
animate = ( Math.abs(this._state.posx-posX)>0.001 || Math.abs(this._state.posy-posY)>0.001) || (sdkchange.length !== this._state.changes_length),
lock = (sdkchange[0].get_LockUserId()!==null),
lockUser = this.getUserName(sdkchange[0].get_LockUserId());
lockUser = this.getUserName(sdkchange[0].get_LockUserId()),
editable = changes[0].get('editable');
this.getPopover().hideTips();
this.popoverChanges.reset(changes);
@ -195,14 +199,15 @@ define([
this.getPopover().showReview(animate, lock, lockUser);
if (this.appConfig.canReview && !this.appConfig.isReviewOnly && this._state.lock !== lock) {
this.view.btnAccept.setDisabled(lock==true);
this.view.btnReject.setDisabled(lock==true);
var btnlock = lock || !editable;
if (this.appConfig.canReview && !this.appConfig.isReviewOnly && this._state.lock !== btnlock) {
this.view.btnAccept.setDisabled(btnlock);
this.view.btnReject.setDisabled(btnlock);
if (this.dlgChanges) {
this.dlgChanges.btnAccept.setDisabled(lock==true);
this.dlgChanges.btnReject.setDisabled(lock==true);
this.dlgChanges.btnAccept.setDisabled(btnlock);
this.dlgChanges.btnReject.setDisabled(btnlock);
}
this._state.lock = lock;
this._state.lock = btnlock;
}
this._state.posx = posX;
this._state.posy = posY;
@ -459,7 +464,7 @@ define([
scope : me.view,
hint : !me.appConfig.canReview,
goto : (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom),
editable : (item.get_UserId() == me.currentUserId)
editable : me.appConfig.isReviewOnly && (item.get_UserId() == me.currentUserId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || me.checkUserGroups(item.get_UserName()))
});
arr.push(change);
@ -467,10 +472,15 @@ define([
return arr;
},
checkUserGroups: function(username) {
var groups = Common.Utils.UserInfoParser.getParsedGroups(username);
return Common.Utils.UserInfoParser.getCurrentGroups() && groups && (_.intersection(Common.Utils.UserInfoParser.getCurrentGroups(), (groups.length>0) ? groups : [""]).length>0);
},
getUserName: function(id){
if (this.userCollection && id!==null){
var rec = this.userCollection.findUser(id);
if (rec) return rec.get('username');
if (rec) return Common.Utils.UserInfoParser.getParsedName(rec.get('username'));
}
return '';
},
@ -547,17 +557,29 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onTurnPreview: function(state) {
onTurnPreview: function(state, global, fromApi) {
if ( this.appConfig.isReviewOnly ) {
this.view.turnChanges(true);
} else
if ( this.appConfig.canReview ) {
state = (state == 'on');
var sendMessage = !fromApi;
var saveToFile = !!global; // save track changes flag (state) to file
this.api.asc_SetTrackRevisions(!!state, saveToFile, sendMessage);
Common.Utils.InternalSettings.set(this.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
this.view.turnChanges(state, global);
}
},
this.api.asc_SetTrackRevisions(state);
Common.localStorage.setItem(this.view.appPrefix + "track-changes-" + (this.appConfig.fileKey || ''), state ? 1 : 0);
this.view.turnChanges(state);
onApiTrackRevisionsChange: function(state, global, userId) {
// change local or global state
if (userId && this.getUserName(userId)) {
if (state)
this.showTips(Common.Utils.String.format(global ? this.textOnGlobal : this.textOn, this.getUserName(userId)));
else
this.showTips(Common.Utils.String.format(global ? this.textOffGlobal : this.textOff, this.getUserName(userId)));
}
if (global && Common.Utils.InternalSettings.get(this.view.appPrefix + "track-changes")>1) {
Common.NotificationCenter.trigger('reviewchanges:turn', state, global, true);
}
},
@ -613,13 +635,19 @@ define([
}).show();
}
} else if (item === 'settings') {
(new DE.Views.CompareSettingsDialog({
props: me._state.compareSettings,
handler: function(result, value) {
if (result == 'ok') {
me._state.compareSettings = value;
var value = me._state.compareSettings ? me._state.compareSettings.getWords() : true;
(new Common.Views.OptionsDialog({
title: me.textTitleComparison,
items: [
{caption: me.textChar, value: false, checked: (value===false)},
{caption: me.textWord, value: true, checked: (value!==false)}
],
label: me.textShow,
handler: function (dlg, result) {
if (result=='ok') {
me._state.compareSettings = new AscCommonWord.ComparisonOptions();
me._state.compareSettings.putWords(dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
})).show();
@ -722,7 +750,7 @@ define([
leftMenu.setPreviewMode(disable);
if (this.view) {
this.view.$el.find('.no-group-mask').css('opacity', 1);
this.view.$el.find('.no-group-mask.review').css('opacity', 1);
this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
if ( button ) {
@ -750,14 +778,18 @@ define([
(new Promise(function (resolve) {
resolve();
})).then(function () {
function _setReviewStatus(state) {
me.view.turnChanges(state);
function _setReviewStatus(state, global) {
me.view.turnChanges(state, global);
me.api.asc_SetTrackRevisions(state);
Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
};
var state = config.isReviewOnly || Common.localStorage.getBool(me.view.appPrefix + "track-changes-" + (config.fileKey || ''));
var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined,
state = config.isReviewOnly || trackChanges===true || (trackChanges!==false) && me.api.asc_IsTrackRevisions(),
global = !config.isReviewOnly && (trackChanges===undefined);
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
_setReviewStatus(state);
_setReviewStatus(state, global);
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
@ -791,6 +823,39 @@ define([
}
},
showTips: function(strings) {
var me = this;
if (!strings.length) return;
if (typeof(strings)!='object') strings = [strings];
function showNextTip() {
var str_tip = strings.shift();
if (str_tip) {
me.tooltip.setTitle(str_tip);
me.tooltip.show();
me.tipTimeout = setTimeout(function () {
me.tooltip.hide();
}, 5000);
}
}
if (!this.tooltip) {
this.tooltip = new Common.UI.Tooltip({
owner: this.getApplication().getController('Toolbar').getView(),
hideonclick: true,
placement: 'bottom',
cls: 'main-info',
offset: 30
});
this.tooltip.on('tooltip:hide', function(cmp){
clearTimeout(me.tipTimeout);
(cmp==me.tooltip) && setTimeout(showNextTip, 300);
});
}
showNextTip();
},
applySettings: function(menu) {
this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
@ -947,6 +1012,15 @@ define([
textParaMoveFromUp: '<b>Moved Up:</b>',
textParaMoveFromDown: '<b>Moved Down:</b>',
textUrl: 'Paste a document URL',
textAcceptBeforeCompare: 'In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?'
textAcceptBeforeCompare: 'In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?',
textTitleComparison: 'Comparison Settings',
textShow: 'Show changes at',
textChar: 'Character level',
textWord: 'Word level',
textOnGlobal: '{0} enabled Track Changes for everyone.',
textOffGlobal: '{0} disabled Track Changes for everyone.',
textOn: '{0} is now using Track Changes.',
textOff: '{0} is no longer using Track Changes.'
}, Common.Controllers.ReviewChanges || {}));
});

View file

@ -0,0 +1,88 @@
/**
* Created by Maxim.Kadushkin on 2/5/2021.
*/
define([
'core'
], function () {
'use strict';
Common.UI.Themes = new (function() {
var sdk_themes_relation = {
'theme-light': 'flat',
'theme-dark': 'flatDark'
};
sdk_themes_relation.contains = function (name) {
return !!this[name];
}
return {
init: function (api) {
var me = this;
$(window).on('storage', function (e) {
if ( e.key == 'ui-theme' ) {
me.setTheme(e.originalEvent.newValue);
}
})
this.api = api;
var theme_name = Common.localStorage.getItem('ui-theme', 'theme-light');
api.asc_setSkin(sdk_themes_relation[theme_name]);
if ( !$('body').hasClass(theme_name) ) {
$('body').addClass(theme_name);
}
// app.eventbus.addListeners({
// 'FileMenu': {
// 'settings:apply': function (menu) {
// }
// }
// }, {id: 'Themes'});
// getComputedStyle(document.documentElement).getPropertyValue('--background-normal');
},
available: function () {
return !Common.Utils.isIE;
},
current: function () {
return Common.localStorage.getItem('ui-theme', 'theme-light');
},
isDarkTheme: function () {
return this.current() == 'theme-dark';
},
setTheme: function (name) {
if ( sdk_themes_relation.contains(name) ) {
var classname = document.documentElement.className.replace(/theme-\w+\s?/, '');
document.body.className = classname;
$('body').addClass(name);
this.api.asc_setSkin(sdk_themes_relation[name]);
var style = getComputedStyle(document.body);
if ( !!window.DE ) {
var color_background_normal = style.getPropertyValue('--background-normal');
this.api.asc_setSkin({
"RulerOutline": style.getPropertyValue('--border-toolbar')
, "RulerMarkersFillColor": color_background_normal
, "RulerMarkersFillColorOld": color_background_normal
, "RulerTableColor1": color_background_normal
});
}
Common.localStorage.setItem('ui-theme', name);
Common.NotificationCenter.trigger('uitheme:change', name);
}
},
toggleTheme: function () {
this.setTheme(this.current() == 'theme-dark' ? 'theme-light' : 'theme-dark');
}
}
})();
});

View file

@ -29,7 +29,8 @@
',': 188, '.': 190, '/': 191,
'`': 192, '-': 189, '=': 187,
';': 186, '\'': 222,
'[': 219, ']': 221, '\\': 220
'[': 219, ']': 221, '\\': 220,
'ff-': 173, 'ff=': 61
},
code = function(x){
return _MAP[x] || x.toUpperCase().charCodeAt(0);

View file

@ -65,6 +65,17 @@ function onDropDownKeyDown(e) {
$parent.trigger(afterEvent);
}
function checkFocusedItem(cmp, item) {
var innerHeight = cmp.innerHeight(),
padding = (innerHeight - cmp.height())/2,
pos = item.position().top,
itemHeight = item.outerHeight();
if (pos<0)
cmp.scrollTop(cmp.scrollTop() + pos - padding);
else if (pos+itemHeight>innerHeight)
cmp.scrollTop(cmp.scrollTop() + pos + itemHeight - innerHeight + padding);
}
function patchDropDownKeyDown(e) {
if (!/(38|40|27|37|39)/.test(e.keyCode)) return;
@ -128,6 +139,8 @@ function patchDropDownKeyDown(e) {
if ($parent.hasClass('dropdown-submenu') && $parent.hasClass('over'))
$parent.addClass('focused-submenu'); // for Safari. When focus go from parent menuItem to it's submenu don't hide this submenu
checkFocusedItem($this, $items.eq(index));
$items.eq(index).focus();
}
}

View file

@ -64,6 +64,7 @@ define([
lock : false,
lockuserid : '',
unattached : false,
userdata : '',
id : Common.UI.getId(), // internal
time : 0,
@ -78,7 +79,8 @@ define([
hide : false,
hint : false,
dummy : undefined,
editable : true
editable : true,
removable : true
}
});
Common.Models.Reply = Backbone.Model.extend({
@ -89,12 +91,14 @@ define([
usercolor : null,
reply : '',
date : undefined,
userdata : '',
id : Common.UI.getId(), // internal
editText : false,
editTextInPopover : false,
scope : null,
editable : true
editable : true,
removable : true
}
});
});

View file

@ -0,0 +1,91 @@
<div id="id-autocorrect-dialog-settings-math" class="settings-panel active">
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td style="padding-bottom: 8px;">
<div id="auto-correct-chb-replace-type"></div>
</td>
</tr>
<tr>
<td>
<label style="width: 117px;"><%= scope.textReplace %>:</label>
<label><%= scope.textBy %>:</label>
</td>
</tr>
<tr>
<td>
<div id="auto-correct-replace" style="height:22px;width: 115px;margin-right: 2px;display: inline-block;"></div>
<div id="auto-correct-by" style="height:22px;width: 234px;display: inline-block;"></div>
</td>
</tr>
<tr>
<td style="padding-bottom: 8px;">
<div id="auto-correct-math-list" class="" style="width:100%; height: 208px;"></div>
</td>
</tr>
<tr>
<td style="padding-bottom: 8px;">
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-reset" style="min-width: 80px;"><%= scope.textResetAll %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 80px;float: right;"><%= scope.textDelete %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 80px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
</td>
</tr>
</table>
</div>
</div>
<div id="id-autocorrect-dialog-settings-recognized" class="settings-panel">
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td style="padding-bottom: 8px;">
<label><%= scope.textRecognizedDesc %></label>
</td>
</tr>
<tr>
<td>
<div id="auto-correct-rec-find" style="height:22px;width: 100%;margin-bottom: 4px;"></div>
</td>
</tr>
<tr>
<td style="padding-bottom: 8px;">
<div id="auto-correct-recognized-list" class="" style="width:100%; height: 208px;"></div>
</td>
</tr>
<tr>
<td style="padding-bottom: 8px;">
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-rec-reset" style="min-width: 86px;"><%= scope.textResetAll %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-rec-delete" style="min-width: 86px;float: right;"><%= scope.textDelete %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-rec-edit" style="min-width: 86px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
</td>
</tr>
</table>
</div>
</div>
<div id="id-autocorrect-dialog-settings-de-autoformat" class="settings-panel">
<div class="inner-content" style="width: 100%;">
<div class="padding-small">
<label class="header"><%= scope.textReplaceText %></label>
</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>
<div class="padding-small">
<label class="header"><%= scope.textApplyText %></label>
</div>
<div class="padding-large">
<div class="padding-small" id="id-autocorrect-dialog-chk-bulleted"></div>
<div id="id-autocorrect-dialog-chk-numbered"></div>
</div>
</div>
</div>
<div id="id-autocorrect-dialog-settings-sse-autoformat" class="settings-panel">
<div class="inner-content" style="width: 100%;">
<div class="padding-small">
<label class="header"><%= scope.textApplyAsWork %></label>
</div>
<div class="padding-large">
<div id="id-autocorrect-dialog-chk-new-rows"></div>
</div>
</div>
</div>

View file

@ -11,7 +11,7 @@
<div class="user-quote"><%=scope.getFixedQuote(quote)%></div>
<% } %>
<% if (!editText || scope.viewmode) { %>
<div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(comment)%></div>
<% } else { %>
<div class="inner-edit-ct">
<textarea class="msg-reply user-select textarea-control" maxlength="maxCommLength"><%=comment%></textarea>
@ -31,11 +31,13 @@
</div>
<div class="user-date"><%=item.get("date")%></div>
<% if (!item.get("editText")) { %>
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(item.get("reply"))%></div>
<% if (!scope.viewmode) { %>
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
<% if (item.get("removable")) { %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
</div>
@ -67,13 +69,11 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>
<div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
</div>
<% } %>

View file

@ -36,7 +36,9 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
<% if (item.get("removable")) { %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
</div>
<%}%>
@ -68,13 +70,11 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>
<div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
</div>
<% } %>

View file

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

View file

@ -98,12 +98,19 @@ define(['gateway'], function () {
var value = _getItem(name);
defValue = defValue || false;
return (value!==null) ? (parseInt(value) != 0) : defValue;
}
};
var _getItemExists = function (name) {
var value = _getItem(name);
return value !== null;
}
};
var _removeItem = function(name) {
if (_lsAllowed)
localStorage.removeItem(name);
else
delete _store[name];
};
try {
var _lsAllowed = !!window.localStorage;
@ -122,6 +129,7 @@ define(['gateway'], function () {
getBool: _getItemAsBool,
setBool: _setItemAsBool,
setItem: _setItem,
removeItem: _removeItem,
setKeysFilter: function(value) {
_filter = value;
},

View file

@ -99,11 +99,11 @@ Common.util = Common.util||{};
'modal:show': function(e){
window.key.suspend();
},
'modal:close': function(e) {
window.key.resume();
'modal:close': function(e, last) {
last && window.key.resume();
},
'modal:hide': function(e) {
window.key.resume();
'modal:hide': function(e, last) {
last && window.key.resume();
}
});
},

View file

@ -430,6 +430,39 @@ define(function(){ 'use strict';
textLineSpark: 'Line',
textColumnSpark: 'Column',
textWinLossSpark: 'Win/Loss',
textCombo: 'Combo',
textBarNormal: 'Clustered column',
textBarStacked: 'Stacked column',
textBarStackedPer: '100% Stacked column',
textBarNormal3d: '3-D Clustered column',
textBarStacked3d: '3-D Stacked column',
textBarStackedPer3d: '3-D 100% Stacked column',
textBarNormal3dPerspective: '3-D column',
textLineStacked: 'Stacked line',
textLineStackedPer: '100% Stacked line',
textLineMarker: 'Line with markers',
textLineStackedMarker: 'Stacked line with markers',
textLineStackedPerMarker: '100% Stacked line with markers',
textLine3d: '3-D line',
textDoughnut: 'Doughnut',
textPie3d: '3-D pie',
textHBarNormal: 'Clustered bar',
textHBarStacked: 'Stacked bar',
textHBarStackedPer: '100% Stacked bar',
textHBarNormal3d: '3-D Clustered bar',
textHBarStacked3d: '3-D Stacked bar',
textHBarStackedPer3d: '3-D 100% Stacked bar',
textAreaStacked: 'Stacked area',
textAreaStackedPer: '100% Stacked area',
textScatter: 'Scatter',
textScatterSmoothMarker: 'Scatter with smooth lines and markers',
textScatterSmooth: 'Scatter with smooth lines',
textScatterLineMarker: 'Scatter with straight lines and markers',
textScatterLine: 'Scatter with straight lines',
textComboBarLine: 'Clustered column - line',
textComboBarLineSecondary: 'Clustered column - line on secondary axis',
textComboAreaBar: 'Stacked area - clustered column',
textComboCustom: 'Custom combination',
getChartGroupData: function(headername) {
return [
@ -438,39 +471,51 @@ define(function(){ 'use strict';
{id: 'menu-chart-group-pie', caption: this.textPie},
{id: 'menu-chart-group-hbar', caption: this.textBar},
{id: 'menu-chart-group-area', caption: this.textArea, inline: true},
{id: 'menu-chart-group-scatter', caption: this.textPoint, inline: true},
{id: 'menu-chart-group-stock', caption: this.textStock, inline: true}
{id: 'menu-chart-group-stock', caption: this.textStock, inline: true},
{id: 'menu-chart-group-scatter', caption: this.textPoint},
{id: 'menu-chart-group-combo', caption: this.textCombo}
// {id: 'menu-chart-group-surface', caption: this.textSurface}
];
},
getChartData: function() {
return [
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal', tip: this.textBarNormal},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack', tip: this.textBarStacked},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack', tip: this.textBarStackedPer},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal', tip: this.textBarNormal3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack', tip: this.textBarStacked3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack', tip: this.textBarStackedPer3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per', tip: this.textBarNormal3dPerspective, is3d: true},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal', tip: this.textLine},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack', tip: this.textLineStacked},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack', tip: this.textLineStackedPer},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormalMarker, iconCls: 'line-normal-marker', tip: this.textLineMarker},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedMarker, iconCls: 'line-stack-marker', tip: this.textLineStackedMarker},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPerMarker,iconCls: 'line-pstack-marker', tip: this.textLineStackedPerMarker},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d', tip: this.textLine3d, is3d: true},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal', tip: this.textPie},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut', tip: this.textDoughnut},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal', tip: this.textPie3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal', tip: this.textHBarNormal},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack', tip: this.textHBarStacked},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack', tip: this.textHBarStackedPer},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal', tip: this.textHBarNormal3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack', tip: this.textHBarStacked3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack', tip: this.textHBarStackedPer3d, is3d: true},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal', tip: this.textArea},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack', tip: this.textAreaStacked},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack', tip: this.textAreaStackedPer},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal', tip: this.textScatter},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterSmoothMarker,iconCls: 'point-smooth-marker', tip: this.textScatterSmoothMarker},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterSmooth, iconCls: 'point-smooth', tip: this.textScatterSmooth},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterLineMarker, iconCls: 'point-line-marker', tip: this.textScatterLineMarker},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterLine, iconCls: 'point-line', tip: this.textScatterLine},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal', tip: this.textStock},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboBarLine, iconCls: 'combo-bar-line', tip: this.textComboBarLine},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboBarLineSecondary, iconCls: 'combo-bar-line-sec', tip: this.textComboBarLineSecondary},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboAreaBar, iconCls: 'combo-area-bar', tip: this.textComboAreaBar},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboCustom, iconCls: 'combo-custom', tip: this.textComboCustom}
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceNormal, iconCls: 'surface-normal'},
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceWireframe, iconCls: 'surface-wireframe'},
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourNormal, iconCls: 'contour-normal'},

View file

@ -0,0 +1,34 @@
if ( !window.fetch ) {
var element = document.createElement('script');
element['src'] = '../../../vendor/fetch/fetch.umd.js';
document.getElementsByTagName('head')[0].appendChild(element);
if ( !window.Promise ) {
element = document.createElement('script');
element['src'] = '../../../vendor/es6-promise/es6-promise.auto.min.js';
document.getElementsByTagName('head')[0].appendChild(element);
}
if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
}

View file

@ -0,0 +1,38 @@
function checkScaling() {
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
if ( window.matchMedia(str_mq_150).matches ) {
document.body.classList.add('pixel-ratio__1_5');
}
if ( !window.matchMedia("screen and (-webkit-device-pixel-ratio: 1.5)," +
"screen and (-webkit-device-pixel-ratio: 1)," +
"screen and (-webkit-device-pixel-ratio: 2)").matches )
{
// don't add zoom for mobile devices
if (!(/android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera)))
document.getElementsByTagName('html')[0].setAttribute('style', 'zoom: ' + (1 / window.devicePixelRatio) + ';');
}
}
checkScaling();
var params = (function() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
})();
var ui_theme_name = params.uitheme || localStorage.getItem("ui-theme");
if ( !!ui_theme_name ) {
document.body.classList.add(ui_theme_name);
}

View file

@ -106,7 +106,8 @@ Common.Utils = _.extend(new(function() {
Signature : 9,
Pivot : 10,
Cell : 11,
Slicer : 12
Slicer : 12,
Form : 13
},
importTextType = {
DRM: 0,
@ -118,37 +119,48 @@ Common.Utils = _.extend(new(function() {
isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera),
me = this,
checkSize = function() {
me.zoom = 1;
if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body) {
// делаем простую проверку
// считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
if (window.devicePixelRatio > 0.1) {
if (window.devicePixelRatio < 1.99)
{
var _devicePixelRatio = 1;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
else
{
var _devicePixelRatio = 2;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
//document.firstElementChild.style.zoom = "reset";
document.firstElementChild.style.zoom = 1.0 / me.zoom; }
else
document.firstElementChild.style.zoom = "normal";
var scale = {};
if ( !!window.AscCommon )
scale = window.AscCommon.checkDeviceScale();
else {
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
var str_mq_200 = "screen and (-webkit-min-device-pixel-ratio: 2), " +
"screen and (min-resolution: 2dppx), screen and (min-resolution: 192dpi)";
if ( window.matchMedia(str_mq_150).matches ) {
scale.devicePixelRatio = 1.5;
} else
if ( window.matchMedia(str_mq_200).matches )
scale.devicePixelRatio = 2;
else scale.devicePixelRatio = 1;
}
var $root = $(document.body);
if ( scale.devicePixelRatio < 1.5 ) {
$root.removeClass('pixel-ratio__1_5 pixel-ratio__2');
} else
if ( !(scale.devicePixelRatio < 1.5) && !(scale.devicePixelRatio > 2) ) {
$root.removeClass('pixel-ratio__2');
$root.addClass('pixel-ratio__1_5');
} else {
$root.addClass('pixel-ratio__2');
$root.removeClass('pixel-ratio__1_5');
}
me.zoom = scale.correct ? scale.zoom : 1;
me.innerWidth = window.innerWidth * me.zoom;
me.innerHeight = window.innerHeight * me.zoom;
};
me.zoom = 1;
me.innerWidth = window.innerWidth;
me.innerHeight = window.innerHeight;
checkSize();
$(window).on('resize', checkSize);
if ( isIE )
$(document.body).addClass('ie');
else {
checkSize();
$(window).on('resize', checkSize);
}
return {
checkSize: checkSize,
@ -594,6 +606,20 @@ Common.Utils.String = new (function() {
parseFloat: function(string) {
(typeof string === 'string') && (string = string.replace(',', '.'));
return parseFloat(string)
},
encodeSurrogateChar: function(nUnicode) {
if (nUnicode < 0x10000)
{
return String.fromCharCode(nUnicode);
}
else
{
nUnicode = nUnicode - 0x10000;
var nLeadingChar = 0xD800 | (nUnicode >> 10);
var nTrailingChar = 0xDC00 | (nUnicode & 0x3FF);
return String.fromCharCode(nLeadingChar) + String.fromCharCode(nTrailingChar);
}
}
}
})();
@ -698,6 +724,8 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_user.fullname = _.isEmpty(_user.name) ? defname : _user.name;
_user.group && (_user.fullname = (_user.group).toString() + Common.Utils.UserInfoParser.getSeparator() + _user.fullname);
_user.guest = _.isEmpty(_user.name);
return _user;
};
@ -748,6 +776,8 @@ Common.Utils.loadConfig = function(url, callback) {
else return 'error';
}).then(function(json){
callback(json);
}).catch(function(e) {
callback('error');
});
};
@ -861,23 +891,24 @@ Common.Utils.warningDocumentIsLocked = function (opts) {
opts.disablefunc(true);
var app = window.DE || window.PE || window.SSE;
var tip = new Common.UI.SynchronizeTip({
extCls : 'simple',
text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
placement : 'document'
});
tip.on({
'dontshowclick': function() {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
Common.UI.warning({
msg: Common.Locale.get("warnFileLocked",{name:"Common.Translation", default: "You can't edit this file. Document is in use by another application."}),
buttons: [{
value: 'view',
caption: Common.Locale.get("warnFileLockedBtnView",{name:"Common.Translation", default: "Open for viewing"})
}, {
value: 'edit',
caption: Common.Locale.get("warnFileLockedBtnEdit",{name:"Common.Translation", default: "Create a copy"})
}],
primary: 'view',
callback: function(btn){
if (btn == 'edit') {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
}
}
});
tip.show();
};
jQuery.fn.extend({
@ -945,4 +976,70 @@ Common.Utils.ModalWindow = new(function() {
return count>0;
}
}
})();
Common.Utils.UserInfoParser = new(function() {
var parse = false,
separator = String.fromCharCode(160),
username = '',
usergroups,
reviewPermissions,
reviewGroups;
return {
setParser: function(value) {
parse = !!value;
},
getSeparator: function() {
return separator;
},
getParsedName: function(username) {
if (parse && username) {
return username.substring(username.indexOf(separator)+1);
} else
return username;
},
getParsedGroups: function(username) {
if (parse && username) {
var idx = username.indexOf(separator),
groups = (idx>-1) ? username.substring(0, idx).split(',') : [];
for (var i=0; i<groups.length; i++)
groups[i] = groups[i].trim();
return groups;
} else
return undefined;
},
setCurrentName: function(name) {
username = name;
this.setReviewPermissions(reviewGroups, reviewPermissions);
},
getCurrentName: function() {
return username;
},
setReviewPermissions: function(groups, permissions) {
if (groups) {
if (typeof groups == 'object' && groups.length>0)
usergroups = groups;
reviewGroups = groups;
} else if (permissions) {
var arr = [],
arrgroups = this.getParsedGroups(username);
arrgroups && arrgroups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
});
usergroups = arr;
reviewPermissions = permissions;
}
},
getCurrentGroups: function() {
return usergroups;
}
}
})();

View file

@ -96,7 +96,7 @@ define([
allowDepress: false,
contentTarget: btnEl.attr('content-target')
});
btn.on('click', _.bind(me.onCategoryClick, me));
btn.on('click', _.bind(me.onCategoryClick, me, btn, index));
me.btnsCategory.push(btn);
});
var cnt_panel = $window.find('.content-panel'),
@ -125,7 +125,7 @@ define([
this.close();
},
onCategoryClick: function(btn, event) {
onCategoryClick: function(btn, index) {
this.content_panels.filter('.active').removeClass('active');
$("#" + btn.options.contentTarget).addClass("active");
},
@ -144,19 +144,21 @@ define([
setActiveCategory: function(index) {
if (this.btnsCategory.length<1) return;
var btnActive = this.btnsCategory[(index>=0 && index<this.btnsCategory.length) ? index : 0];
index = (index>=0 && index<this.btnsCategory.length) ? index : 0;
var btnActive = this.btnsCategory[index];
if (!btnActive.isVisible() || btnActive.isDisabled()) {
for (var i = 0; i<this.btnsCategory.length; i++){
var btn = this.btnsCategory[i];
if (btn.isVisible() && !btn.isDisabled()) {
btnActive = btn;
index = i;
break;
}
}
}
btnActive.toggle(true);
this.onCategoryClick(btnActive);
this.onCategoryClick(btnActive, index);
},
getActiveCategory: function() {

View file

@ -0,0 +1,785 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AutoCorrectDialog.js
*
* Created by Julia Radzhabova on 03.07.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
'common/main/lib/component/ListView',
'common/main/lib/component/Window',
'common/main/lib/component/CheckBox'
], function (contentTemplate) { 'use strict';
var _mathStore = new Common.UI.DataViewStore();
var _functionsStore = new Common.UI.DataViewStore();
Common.Views.AutoCorrectDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
options: {
contentWidth: 375,
height: 430,
buttons: null,
toggleGroup: 'autocorrect-dialog-group'
},
initialize : function(options) {
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
var items = [
{panelId: 'id-autocorrect-dialog-settings-math', panelCaption: this.textMathCorrect},
{panelId: 'id-autocorrect-dialog-settings-recognized', panelCaption: this.textRecognized}
];
if (this.appPrefix=='de-' || this.appPrefix=='pe-')
items.push({panelId: 'id-autocorrect-dialog-settings-de-autoformat', panelCaption: this.textAutoFormat});
else if (this.appPrefix=='sse-')
items.push({panelId: 'id-autocorrect-dialog-settings-sse-autoformat', panelCaption: this.textAutoFormat});
_.extend(this.options, {
title: this.textTitle,
storageName: this.appPrefix + 'autocorrect-dialog-category',
items: items,
template: [
'<div class="box" style="height:' + (this.options.height-85) + 'px;">',
'<div class="menu-panel" style="overflow: hidden;">',
'<% _.each(items, function(item) { %>',
'<button class="btn btn-category" content-target="<%= item.panelId %>"><span class=""><%= item.panelCaption %></span></button>',
'<% }); %>',
'</div>',
'<div class="separator"></div>',
'<div class="content-panel">' + _.template(contentTemplate)({scope: this}) + '</div>',
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>',
'</div>'
].join('')
}, options || {});
this.api = this.options.api;
var path = this.appPrefix + "settings-math-correct";
var value = Common.Utils.InternalSettings.get(path + "-add");
this.arrAdd = value ? JSON.parse(value) : [];
value = Common.Utils.InternalSettings.get(path + "-rem");
this.arrRem = value ? JSON.parse(value) : [];
path = this.appPrefix + "settings-rec-functions";
value = Common.Utils.InternalSettings.get(path + "-add");
this.arrAddRec = value ? JSON.parse(value) : [];
value = Common.Utils.InternalSettings.get(path + "-rem");
this.arrRemRec = value ? JSON.parse(value) : [];
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
render: function() {
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
var $window = this.getChild();
var me = this;
// Math correct
this.chReplaceType = new Common.UI.CheckBox({
el: $window.findById('#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){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-math-correct-replace-type", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-math-correct-replace-type", checked);
me.api.asc_updateFlagAutoCorrectMathSymbols(checked);
});
this.onInitList();
this.mathList = new Common.UI.ListView({
el: $window.find('#auto-correct-math-list'),
store: new Common.UI.DataViewStore(_mathStore.slice(0, 9)),
simpleAddMode: false,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div style="width:110px;padding-right: 5px;overflow: hidden;text-overflow: ellipsis;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
'<div style="width:230px;overflow: hidden;text-overflow: ellipsis;flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
'</div>'
].join('')),
scrollAlwaysVisible: true,
tabindex: 1
});
this.mathList.on('item:select', _.bind(this.onSelectMathItem, this));
this.inputReplace = new Common.UI.InputField({
el : $window.find('#auto-correct-replace'),
allowBlank : true,
validateOnChange : true,
maxLength : 31,
validation : function () { return true; }
}).on ('changing', function (input, value) {
var _selectedItem;
if (value.length) {
var store = me.mathList.store;
_selectedItem = store.find(function(item) {
if ( item.get('replaced').indexOf(value) == 0) {
return true;
}
});
if (_selectedItem) {
me.mathList.scrollToRecord(_selectedItem, true);
if (_selectedItem.get('replaced') == value)
me.mathList.selectRecord(_selectedItem, true);
else
_selectedItem = null;
}
}
(!_selectedItem) && me.mathList.deselectAll();
me.updateControls(_selectedItem);
});
this.inputReplace.cmpEl.find('input').on('keydown', function(event){
if (event.key == 'ArrowDown') {
var _selectedItem = me.mathList.getSelectedRec() || me.mathList.store.at(0);
if (_selectedItem) {
me.mathList.selectRecord(_selectedItem);
me.mathList.scrollToRecord(_selectedItem);
}
_.delay(function(){
me.mathList.focus();
},10);
}
});
this.inputBy = new Common.UI.InputField({
el : $window.find('#auto-correct-by'),
allowBlank : true,
validateOnChange : true,
maxLength : 255,
validation : function () { return true; }
}).on ('changing', function (input, value) {
me.updateControls();
});
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
this.btnReset = new Common.UI.Button({
el: $('#auto-correct-btn-reset')
});
this.btnReset.on('click', _.bind(this.onResetToDefault, this));
this.btnEdit = new Common.UI.Button({
el: $('#auto-correct-btn-edit')
});
this.btnEdit.on('click', _.bind(this.onEdit, this, false));
this.btnDelete = new Common.UI.Button({
el: $('#auto-correct-btn-delete')
});
this.btnDelete.on('click', _.bind(this.onDelete, this, false));
// Recognized functions
this.onInitRecList();
this.mathRecList = new Common.UI.ListView({
el: $window.find('#auto-correct-recognized-list'),
store: new Common.UI.DataViewStore(_functionsStore.slice(0, 9)),
simpleAddMode: false,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="width: 340px;text-overflow: ellipsis;overflow: hidden;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
].join('')),
scrollAlwaysVisible: true,
tabindex: 1
});
this.mathRecList.on('item:select', _.bind(this.onSelectRecItem, this));
this.inputRecFind = new Common.UI.InputField({
el : $window.find('#auto-correct-rec-find'),
allowBlank : true,
validateOnChange : true,
maxLength : 255,
validation : function () { return true; }
}).on ('changing', function (input, value) {
var _selectedItem;
if (value.length) {
var store = me.mathRecList.store;
_selectedItem = store.find(function(item) {
if ( item.get('value').indexOf(value) == 0) {
return true;
}
});
if (_selectedItem) {
me.mathRecList.scrollToRecord(_selectedItem, true);
if (_selectedItem.get('value') == value)
me.mathRecList.selectRecord(_selectedItem, true);
else
_selectedItem = null;
}
}
(!_selectedItem) && me.mathRecList.deselectAll();
me.updateRecControls(_selectedItem);
});
this.inputRecFind.cmpEl.find('input').on('keydown', function(event){
if (event.key == 'ArrowDown') {
var _selectedItem = me.mathRecList.getSelectedRec() || me.mathRecList.store.at(0);
if (_selectedItem) {
me.mathRecList.selectRecord(_selectedItem);
me.mathRecList.scrollToRecord(_selectedItem);
}
_.delay(function(){
me.mathRecList.focus();
},10);
}
});
this.btnResetRec = new Common.UI.Button({
el: $('#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')
});
this.btnAddRec.on('click', _.bind(this.onAddRec, this, false));
this.btnDeleteRec = new Common.UI.Button({
el: $('#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'),
labelText: this.textQuotes,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-smart-quotes")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-smart-quotes", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-smart-quotes", checked);
me.api.asc_SetAutoCorrectSmartQuotes(checked);
});
this.chHyphens = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-hyphens'),
labelText: this.textHyphens,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyphens")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyphens", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyphens", checked);
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
});
this.chBulleted = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-bulleted'),
labelText: this.textBulleted,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-bulleted")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-bulleted", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-bulleted", checked);
me.api.asc_SetAutomaticBulletedLists(checked);
});
this.chNumbered = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-numbered'),
labelText: this.textNumbered,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-numbered", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
me.api.asc_SetAutomaticNumberedLists(checked);
});
} else if (this.appPrefix=='sse-') {
this.chNewRows = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-new-rows'),
labelText: this.textNewRowCol,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
}).on('change', function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-new-rows", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
me.api.asc_setIncludeNewRowColTable(checked);
});
}
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
this.afterRender();
},
afterRender: function() {
this.updateControls();
this.updateRecControls();
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
getFocusedComponents: function() {
return [
this.inputReplace, this.inputBy, {cmp: this.mathList, selector: '.listview'}, // 0 tab
this.inputRecFind, {cmp: this.mathRecList, selector: '.listview'} // 1 tab
];
},
getSettings: function() {
return;
},
onSelectMathItem: function(lisvView, itemView, record) {
if (record) {
this.inputReplace.setValue(record.get('replaced'));
this.inputBy.setValue(record.get('by'));
}
this.updateControls(record);
},
updateControls: function(rec) {
if (!this.mathList) return;
rec = rec || this.mathList.getSelectedRec();
var inputBy = this.inputBy.getValue(),
inputReplace = this.inputReplace.getValue();
if (rec) {
var disabled = rec.get('defaultDisabled'),
defChanged = rec.get('defaultValue') && (rec.get('defaultValueStr')!==rec.get('by'));
this.btnDelete.setCaption(disabled ? this.textRestore : this.textDelete);
this.btnEdit.setDisabled(disabled || inputBy === rec.get('by') && !defChanged || !inputBy || !inputReplace);
this.btnEdit.setCaption(defChanged && (inputBy === rec.get('by')) ? this.textReset : this.textReplace);
} else {
this.btnDelete.setCaption(this.textDelete);
this.btnEdit.setDisabled(!inputBy || !inputReplace);
this.btnEdit.setCaption(this.textAdd);
}
this.btnDelete.setDisabled(!rec);
},
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
var value = this.getActiveCategory();
if (value==0) this.onMathCategoryClick(true);
else if (value==1) this.onRecCategoryClick(true);
},
close: function() {
Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments);
this.mathList && this.mathList.deselectAll();
this.mathRecList && this.mathRecList.deselectAll();
},
onMathCategoryClick: function(delay) {
var me = this;
_.delay(function(){
$('input', me.inputReplace.cmpEl).select().focus();
},delay ? 50 : 0);
if (me.mathList.store.length < _mathStore.length) {
_.delay(function(){
me.mathList.setStore(_mathStore);
me.mathList.onResetItems();
},delay ? 100 : 10);
}
},
onDelete: function() {
var rec = this.mathList.getSelectedRec();
if (rec) {
if (rec.get('defaultValue')) {
var path = this.appPrefix + "settings-math-correct-rem";
var disabled = !rec.get('defaultDisabled');
rec.set('defaultDisabled', disabled);
if (disabled)
this.arrRem.push(rec.get('replaced'));
else
this.arrRem.splice(this.arrRem.indexOf(rec.get('replaced')), 1);
var val = JSON.stringify(this.arrRem);
Common.Utils.InternalSettings.set(path, val);
Common.localStorage.setItem(path, val);
this.btnDelete.setCaption(disabled ? this.textRestore : this.textDelete);
disabled ? this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced')) : this.api.asc_AddOrEditFromAutoCorrectMathSymbols(rec.get('replaced'), rec.get('defaultValue'));
} else {
_mathStore.remove(rec);
this.mathList.scroller && this.mathList.scroller.update({});
this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced'));
}
this.updateControls();
}
},
onEdit: function() {
var rec = this.mathList.getSelectedRec(),
by = '',
me = this,
applySettings = function(record, by) {
var path = me.appPrefix + "settings-math-correct-add";
var val = JSON.stringify(me.arrAdd);
Common.Utils.InternalSettings.set(path, val);
Common.localStorage.setItem(path, val);
me.api.asc_AddOrEditFromAutoCorrectMathSymbols(record.get('replaced'), by);
me.mathList.selectRecord(record);
me.mathList.scrollToRecord(record);
};
if (!rec) {
rec = _mathStore.findWhere({replaced: this.inputReplace.getValue()})
}
if (rec) {
var idx = _.findIndex(this.arrAdd, function(item){return (item[0]==rec.get('replaced'));});
var restore = rec.get('defaultValue') && (rec.get('defaultValueStr')!==rec.get('by')) && (this.inputBy.getValue() === rec.get('by'));
Common.UI.warning({
maxwidth: 500,
msg: restore ? this.warnRestore.replace('%1', rec.get('replaced')) : this.warnReplace.replace('%1', rec.get('replaced')),
buttons: ['yes', 'no'],
primary: 'yes',
callback: _.bind(function(btn, dontshow){
if (btn == 'yes') {
if (restore) {// reset to default
by = rec.get('defaultValue');
rec.set('by', rec.get('defaultValueStr'));
(idx>=0) && this.arrAdd.splice(idx, 1);
} else { // replace
by = this.inputBy.getValue();
rec.set('by', by);
if (idx<0)
this.arrAdd.push([rec.get('replaced'), by]);
else
this.arrAdd[idx][1] = by;
}
applySettings(rec, by);
}
}, this)
});
} else {
rec = _mathStore.add({
replaced: this.inputReplace.getValue(),
by: this.inputBy.getValue(),
defaultDisabled: false
});
by = rec.get('by');
this.arrAdd.push([rec.get('replaced'), by]);
applySettings(rec, by);
}
},
onResetToDefault: function() {
Common.UI.warning({
maxwidth: 500,
msg: this.warnReset,
buttons: ['yes', 'no'],
primary: 'yes',
callback: _.bind(function(btn, dontshow){
if (btn == 'yes') {
this.api.asc_resetToDefaultAutoCorrectMathSymbols();
this.onResetList();
}
}, this)
});
},
onResetList: function() {
// remove storage data
var path = this.appPrefix + "settings-math-correct";
var val = JSON.stringify([]);
Common.Utils.InternalSettings.set(path + "-add", val);
Common.localStorage.setItem(path + "-add", val);
Common.Utils.InternalSettings.set(path + "-rem", val);
Common.localStorage.setItem(path + "-rem", val);
this.arrAdd = [];
this.arrRem = [];
_mathStore.remove(_mathStore.where({defaultValue: undefined}));
_mathStore.each(function(item, index){
item.set('by', item.get('defaultValueStr'));
item.set('defaultDisabled', false);
});
this.mathList.deselectAll();
if (this.mathList.scroller) {
this.mathList.scroller.update();
this.mathList.scroller.scrollTop(0);
}
this.updateControls();
},
onInitList: function() {
if (_mathStore.length>0) return;
_mathStore.comparator = function(item1, item2) {
var n1 = item1.get('replaced').toLowerCase(),
n2 = item2.get('replaced').toLowerCase();
if (n1==n2) return 0;
return (n1<n2) ? -1 : 1;
};
var arrAdd = this.arrAdd,
arrRem = this.arrRem;
var arr = (this.api) ? this.api.asc_getAutoCorrectMathSymbols() : [],
data = [];
_.each(arr, function(item, index){
var itm = {
replaced: item[0],
defaultValue: item[1],
defaultDisabled: arrRem.indexOf(item[0])>-1
};
if (typeof item[1]=='object') {
itm.defaultValueStr = '';
_.each(item[1], function(ch){
itm.defaultValueStr += Common.Utils.String.encodeSurrogateChar(ch);
});
itm.by = itm.defaultValueStr;
} else {
itm.by = itm.defaultValueStr = Common.Utils.String.encodeSurrogateChar(item[1]);
}
data.push(itm);
});
var dataAdd = [];
_.each(arrAdd, function(item, index){
var idx = _.findIndex(data, {replaced: item[0]});
if (idx<0) {
dataAdd.push({
replaced: item[0],
by: item[1],
defaultDisabled: false
});
} else {
var changed = data[idx];
changed.by = item[1];
}
});
_mathStore.reset(data.concat(dataAdd));
this.updateControls();
},
onInitRecList: function() {
if (_functionsStore.length>0) return;
_functionsStore.comparator = function(item1, item2) {
var n1 = item1.get('value').toLowerCase(),
n2 = item2.get('value').toLowerCase();
if (n1==n2) return 0;
return (n1<n2) ? -1 : 1;
};
var arrAdd = this.arrAddRec,
arrRem = this.arrRemRec;
var arr = (this.api) ? this.api.asc_getAutoCorrectMathFunctions() : [],
data = [];
_.each(arr, function(item, index){
data.push({
value: item,
defaultValue: true,
defaultDisabled: arrRem.indexOf(item)>-1
});
});
var dataAdd = [];
_.each(arrAdd, function(item, index){
if (_.findIndex(data, {value: item})<0) {
dataAdd.push({
value: item,
defaultValue: false,
defaultDisabled: false
});
}
});
_functionsStore.reset(data.concat(dataAdd));
this.updateRecControls();
},
onResetRecToDefault: function() {
Common.UI.warning({
maxwidth: 500,
msg: this.textWarnResetRec,
buttons: ['yes', 'no'],
primary: 'yes',
callback: _.bind(function(btn, dontshow){
if (btn == 'yes') {
this.api.asc_resetToDefaultAutoCorrectMathFunctions();
this.onResetRecList();
}
}, this)
});
},
onResetRecList: function() {
// remove storage data
var path = this.appPrefix + "settings-rec-functions";
var val = JSON.stringify([]);
Common.Utils.InternalSettings.set(path + "-add", val);
Common.localStorage.setItem(path + "-add", val);
Common.Utils.InternalSettings.set(path + "-rem", val);
Common.localStorage.setItem(path + "-rem", val);
this.arrAddRec = [];
this.arrRemRec = [];
_functionsStore.remove(_functionsStore.where({defaultValue: false}));
_functionsStore.each(function(item, index){
item.set('defaultDisabled', false);
});
this.mathRecList.deselectAll();
if (this.mathRecList.scroller) {
this.mathRecList.scroller.update();
this.mathRecList.scroller.scrollTop(0);
}
this.updateRecControls();
},
onRecCategoryClick: function(delay) {
var me = this;
_.delay(function(){
$('input', me.inputRecFind.cmpEl).select().focus();
},delay ? 50 : 0);
if (me.mathRecList.store.length < _functionsStore.length) {
_.delay(function(){
me.mathRecList.setStore(_functionsStore);
me.mathRecList.onResetItems();
},delay ? 100 : 10);
}
},
onDeleteRec: function() {
var rec = this.mathRecList.getSelectedRec();
if (rec) {
if (rec.get('defaultValue')) {
var path = this.appPrefix + "settings-rec-functions-rem";
var disabled = !rec.get('defaultDisabled');
rec.set('defaultDisabled', disabled);
if (disabled)
this.arrRemRec.push(rec.get('value'));
else
this.arrRemRec.splice(this.arrRemRec.indexOf(rec.get('value')), 1);
var val = JSON.stringify(this.arrRemRec);
Common.Utils.InternalSettings.set(path, val);
Common.localStorage.setItem(path, val);
this.btnDeleteRec.setCaption(disabled ? this.textRestore : this.textDelete);
disabled ? this.api.asc_deleteFromAutoCorrectMathFunctions(rec.get('value')) : this.api.asc_AddFromAutoCorrectMathFunctions(rec.get('value'));
} else {
_functionsStore.remove(rec);
this.mathRecList.scroller && this.mathRecList.scroller.update({});
this.api.asc_deleteFromAutoCorrectMathFunctions(rec.get('value'));
}
this.updateRecControls();
}
},
onAddRec: function() {
var rec = this.mathRecList.getSelectedRec(),
me = this,
applySettings = function(record) {
var path = me.appPrefix + "settings-rec-functions-add";
var val = JSON.stringify(me.arrAddRec);
Common.Utils.InternalSettings.set(path, val);
Common.localStorage.setItem(path, val);
me.api.asc_AddFromAutoCorrectMathFunctions(record.get('value'));
me.mathRecList.selectRecord(record);
me.mathRecList.scrollToRecord(record);
};
if (!rec) {
rec = _functionsStore.findWhere({value: this.inputRecFind.getValue()})
}
if (!rec) {
if (/^[A-Z]+$/i.test(this.inputRecFind.getValue())) {
rec = _functionsStore.add({
value: this.inputRecFind.getValue(),
defaultValue: false,
defaultDisabled: false
});
this.arrAddRec.push(rec.get('value'));
applySettings(rec);
} else
Common.UI.warning({
maxwidth: 500,
msg: this.textWarnAddRec
});
} else {
me.mathRecList.selectRecord(rec);
me.mathRecList.scrollToRecord(rec);
}
},
onSelectRecItem: function(lisvView, itemView, record) {
if (record) {
this.inputRecFind.setValue(record.get('value'));
}
this.updateRecControls(record);
},
updateRecControls: function(rec) {
if (!this.mathRecList) return;
rec = rec || this.mathRecList.getSelectedRec();
var value = this.inputRecFind.getValue();
this.btnDeleteRec.setCaption(rec && rec.get('defaultDisabled') ? this.textRestore : this.textDelete);
this.btnDeleteRec.setDisabled(!rec);
this.btnAddRec.setDisabled(!!rec || !value);
},
textTitle: 'AutoCorrect',
textMathCorrect: 'Math AutoCorrect',
textReplace: 'Replace',
textBy: 'By',
textResetAll: 'Reset to default',
textAdd: 'Add',
textDelete: 'Delete',
textRestore: 'Restore',
textReset: 'Reset',
textReplaceType: 'Replace text as you type',
warnReset: 'Any autocorrect you added will be removed and the changed ones will be restored to their original values. Do you want to continue?',
warnReplace: 'The autocorrect entry for %1 already exists. Do you want to replace it?',
warnRestore: 'The autocorrect entry for %1 will be reset to its original value. Do you want to continue?',
textRecognized: 'Recognized Functions',
textRecognizedDesc: 'The following expressions are recognized math expressions. They will not be automatically italicized.',
textWarnAddRec: 'Recognized functions must contain only the letters A through Z, uppercase or lowercase.',
textWarnResetRec: 'Any expression you added will be removed and the removed ones will be restored. Do you want to continue?',
textAutoFormat: 'AutoFormat As You Type',
textReplaceText: 'Replace As You Type',
textApplyText: 'Apply As You Type',
textQuotes: '"Straight quotes" with "smart quotes"',
textHyphens: 'Hyphens (--) with dash (—)',
textBulleted: 'Automatic bulleted lists',
textNumbered: 'Automatic numbered lists',
textApplyAsWork: 'Apply as you work',
textNewRowCol: 'Include new rows and columns in table'
}, Common.Views.AutoCorrectDialog || {}))
});

View file

@ -267,7 +267,7 @@ define([
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
hide: function () {

View file

@ -283,7 +283,16 @@ define([
} else if (!btn.hasClass('msg-reply') &&
!btn.hasClass('btn-resolve-check') &&
!btn.hasClass('btn-resolve')) {
me.fireEvent('comment:show', [commentId, false]);
var isTextSelected = false;
if (btn.hasClass('user-message')) {
if (window.getSelection) {
var selection = window.getSelection();
isTextSelected = (selection.toString()!=='')
} else if (document.selection) {
isTextSelected = document.selection;
}
}
me.fireEvent('comment:show', [commentId, false, isTextSelected]);
}
}
},
@ -655,7 +664,7 @@ define([
return Common.Utils.String.ellipsis(Common.Utils.String.htmlEncode(quote), 120, true);
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
pickLink: function (message) {

View file

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -29,40 +29,37 @@
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
*/
/**
* CellsRemoveDialog.js
* EditNameDialog.js
*
* Created by Julia Radzhabova on 05.09.2019
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
* Created by Julia Radzhabova on 10.07.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/component/Window',
'common/main/lib/component/RadioBox'
'common/main/lib/component/InputField'
], function () { 'use strict';
DE.Views.CellsRemoveDialog = Common.UI.Window.extend(_.extend({
Common.Views.EditNameDialog = Common.UI.Window.extend(_.extend({
options: {
width: 214,
header: true,
style: 'min-width: 214px;',
width: 330,
header: false,
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
_.extend(this.options, options || {});
this.template = [
'<div class="box">',
'<div id="table-radio-cells-left" style="padding-bottom: 8px;"></div>',
'<div id="table-radio-cells-row" style="padding-bottom: 8px;"></div>',
'<div id="table-radio-cells-col" style="padding-bottom: 8px;"></div>',
'<div class="input-row">',
'<label>' + (this.options.label ? this.options.label : this.textLabel) + '</label>',
'</div>',
'<div id="id-dlg-label-caption" class="input-row"></div>',
'</div>'
].join('');
@ -74,54 +71,57 @@ define([
render: function() {
Common.UI.Window.prototype.render.call(this);
this.radioLeft = new Common.UI.RadioBox({
el: $('#table-radio-cells-left'),
labelText: this.textLeft,
name: 'asc-radio-table-cells-rem',
checked: true
});
this.radioRow = new Common.UI.RadioBox({
el: $('#table-radio-cells-row'),
labelText: this.textRow,
name: 'asc-radio-table-cells-rem'
});
this.radioCol = new Common.UI.RadioBox({
el: $('#table-radio-cells-col'),
labelText: this.textCol,
name: 'asc-radio-table-cells-rem'
var me = this;
me.inputLabel = new Common.UI.InputField({
el : $('#id-dlg-label-caption'),
allowBlank : false,
blankError : me.options.error ? me.options.error : me.textLabelError,
style : 'width: 100%;',
validateOnBlur: false,
validation : me.options.validation || function(value) {
return value ? true : '';
}
});
me.inputLabel.setValue(this.options.value || '' );
var $window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
},
_handleInput: function(state) {
if (this.options.handler) {
this.options.handler.call(this, state, this.getSettings());
}
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
this.close();
var me = this;
_.delay(function(){
me.getChild('input').focus();
},50);
},
onPrimary: function(event) {
this._handleInput('ok');
return false;
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
getSettings: function() {
return this.radioRow.getValue() ? 'row' : (this.radioCol.getValue() ? 'col' : 'left') ;
_handleInput: function(state) {
if (this.options.handler) {
if (state == 'ok') {
if (this.inputLabel.checkValidate() !== true) {
this.inputLabel.cmpEl.find('input').focus();
return;
}
}
this.options.handler.call(this, state, this.inputLabel.getValue());
}
this.close();
},
onPrimary: function() {
this._handleInput('ok');
return false;
},
textTitle: 'Delete Cells',
textLeft: 'Shift cells left',
textRow: 'Delete entire row',
textCol: 'Delete entire column'
}, DE.Views.CellsRemoveDialog || {}))
textLabel: 'Label:',
textLabelError: 'Label must not be empty.'
}, Common.Views.EditNameDialog || {}));
});

View file

@ -85,7 +85,6 @@ define([
defaultUnit : "",
maxValue: 255,
minValue: 0,
tabindex: 1,
maskExp: /[0-9]/,
allowDecimal: false
});
@ -98,7 +97,6 @@ define([
defaultUnit : "",
maxValue: 255,
minValue: 0,
tabindex: 2,
maskExp: /[0-9]/,
allowDecimal: false
});
@ -111,7 +109,6 @@ define([
defaultUnit : "",
maxValue: 255,
minValue: 0,
tabindex: 3,
maskExp: /[0-9]/,
allowDecimal: false
});
@ -128,7 +125,9 @@ define([
this.spinB.on('change', _.bind(this.showColor, this, null, true)).on('changing', _.bind(this.onChangingRGB, this, 3));
this.textColor.on('change', _.bind(this.onChangeMaskedField, this));
this.textColor.on('changed', _.bind(this.onChangedMaskedField, this));
this.textColor.$el.attr('tabindex', 4);
this.textColor.$el.on('focus', function() {
setTimeout(function(){me.textColor.$el && me.textColor.$el.select();}, 1);
});
this.spinR.$el.find('input').attr('maxlength', 3);
this.spinG.$el.find('input').attr('maxlength', 3);
this.spinB.$el.find('input').attr('maxlength', 3);
@ -146,9 +145,18 @@ define([
this.rendered = true;
if (this.color!==undefined)
this.setColor(this.color);
return this;
},
getFocusedComponents: function() {
return [this.spinR, this.spinG, this.spinB, {cmp: this.textColor, selector: 'input'}];
},
getDefaultFocusableComponent: function () {
return this.getChild('#extended-text-color');
},
onChangeColor: function(o, color) {
this.colorNew.css({'background-color' : color});
@ -271,15 +279,6 @@ define([
me.stopevents = false;
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.getChild('#extended-text-color').focus();
},50);
},
onPrimary: function() {
this.trigger('onmodalresult', 1);
this.close(true);

View file

@ -53,7 +53,6 @@ define([
Common.Views.Header = Backbone.View.extend(_.extend(function(){
var storeUsers, appConfig;
var $userList, $panelUsers, $btnUsers;
var $saveStatus;
var _readonlyRights = false;
var templateUserItem =
@ -74,33 +73,41 @@ define([
var templateRightBox = '<section>' +
'<section id="box-doc-name">' +
'<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
// '<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<label id="rib-doc-name" />' +
'</section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' +
'<div class="hedset">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'<label class="caption">&plus;</label>' +
'<section style="display: inherit;">' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' +
'<div class="hedset">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'<label class="caption">&plus;</label>' +
'</div>' +
'<div class="cousers-menu dropdown-menu">' +
'<label id="tlb-users-menu-descr"><%= tipUsers %></label>' +
'<div class="cousers-list"></div>' +
'<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' +
'</div>' +
'</section>'+
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-favorite"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-user-name"></div>' +
'<div class="btn-current-user hidden">' +
'<i class="icon toolbar__icon icon--inverse btn-user"></i>' +
'</div>' +
'<div class="cousers-menu dropdown-menu">' +
'<label id="tlb-users-menu-descr"><%= tipUsers %></label>' +
'<div class="cousers-list"></div>' +
'<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' +
'</div>' +
'</section>'+
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-undock"></div>' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'</div>' +
'</section>' +
'</section>';
var templateLeftBox = '<section class="logo">' +
@ -109,16 +116,16 @@ define([
var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' +
'<div class="hedset" id="header-tools">' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' +
'<div class="lr-separator">' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<div class="lr-separator" id="id-box-doc-name">' +
'<label id="title-doc-name" />' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' +
'<label id="title-user-name"></label>' +
'</section>';
function onResetUsers(collection, opts) {
@ -128,7 +135,9 @@ define([
$userList.html(templateUserList({
users: collection.chain().filter(function(item){return item.get('online') && !item.get('view')}).groupBy(function(item) {return item.get('idOriginal');}).value(),
usertpl: _.template(templateUserItem),
fnEncode: Common.Utils.String.htmlEncode
fnEncode: function(username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
}
}));
$userList.scroller = new Common.UI.Scroller({
@ -204,16 +213,21 @@ define([
}
function onAppShowed(config) {
if ( this.labelDocName && this.labelDocName.get(0).id == 'title-doc-name'
&& this.labelDocName.is(':visible') )
{
var $tools = this.btnSave.$el.parent('#header-tools');
var _left_width = $tools.prev().outerWidth() + $tools.outerWidth();
var _right_width = this.labelUserName.outerWidth();
if ( this.labelDocName ) {
if ( config.isCrypted ) {
this.labelDocName.before(
'<div class="inner-box-icon crypted">' +
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>');
}
var $parent = this.labelDocName.parent();
var _left_width = $parent.position().left,
_right_width = $parent.next().outerWidth();
if ( _left_width < _right_width )
this.labelDocName.css('padding-left', _right_width - _left_width);
else this.labelDocName.css('padding-right', _left_width - _right_width);
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
}
}
@ -225,6 +239,14 @@ define([
Common.NotificationCenter.trigger('goback');
});
me.btnFavorite.on('click', function (e) {
// wait for setFavorite method
// me.options.favorite = !me.options.favorite;
// me.btnFavorite.changeIcon(me.options.favorite ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
// me.btnFavorite.updateHint(!me.options.favorite ? me.textAddFavorite : me.textRemoveFavorite);
Common.NotificationCenter.trigger('markfavorite', !me.options.favorite);
});
if ( me.logo )
me.logo.children(0).on('click', function (e) {
var _url = !!me.branding && !!me.branding.logo && (me.branding.logo.url!==undefined) ?
@ -235,43 +257,48 @@ define([
}
});
onResetUsers(storeUsers);
if ( $panelUsers ) {
onResetUsers(storeUsers);
$panelUsers.on('shown.bs.dropdown', function () {
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
});
$panelUsers.on('shown.bs.dropdown', function () {
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
});
$panelUsers.find('.cousers-menu')
.on('click', function(e) { return false; });
$panelUsers.find('.cousers-menu')
.on('click', function(e) { return false; });
var editingUsers = storeUsers.getEditingCount();
$btnUsers.tooltip({
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights,
titleNorm: me.tipAccessRights,
titleExt: me.tipViewUsers,
placement: 'bottom',
html: true
});
var editingUsers = storeUsers.getEditingCount();
$btnUsers.tooltip({
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights,
titleNorm: me.tipAccessRights,
titleExt: me.tipViewUsers,
placement: 'bottom',
html: true
});
$btnUsers.on('click', onUsersClick.bind(me));
$btnUsers.on('click', onUsersClick.bind(me));
var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
$labelChangeRights.on('click', function(e) {
$panelUsers.removeClass('open');
Common.NotificationCenter.trigger('collaboration:sharing');
});
var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
$labelChangeRights.on('click', function(e) {
$panelUsers.removeClass('open');
Common.NotificationCenter.trigger('collaboration:sharing');
});
$labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
$labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
}
if ( $saveStatus ) {
$saveStatus.attr('data-width', me.textSaveExpander);
if (appConfig.canUseHistory) {
// $saveStatus.on('click', function(e) {
// me.fireEvent('history:show', ['header']);
// });
} else {
$saveStatus.addClass('locked');
if (appConfig.user.guest && appConfig.canRenameAnonymous) {
if (me.labelUserName) {
me.labelUserName.addClass('clickable');
me.labelUserName.on('click', function (e) {
Common.NotificationCenter.trigger('user:rename');
});
} else if (me.btnUserName) {
me.btnUserName.on('click', function (e) {
Common.NotificationCenter.trigger('user:rename');
});
}
}
@ -323,24 +350,6 @@ define([
me.btnOptions.updateHint(me.tipViewSettings);
}
function onAppConfig(config) {
var me = this;
if ( config.canUndock ) {
me.btnUndock = new Common.UI.Button({
cls: 'btn-header no-caret',
iconCls: 'svgicon svg-btn-undock',
hint: me.tipUndock,
split: true
});
me.btnUndock.on('click', function (e) {
Common.NotificationCenter.trigger('action:undocking', 'undock');
});
me.btnUndock.render($('#toolbar .box-tabs #slot-btn-undock'));
}
}
function onDocNameKeyDown(e) {
var me = this;
@ -375,13 +384,6 @@ define([
}
}
function onAppUndocked(c) {
var me = this;
if ( me.btnUndock ) {
c.status == 'undocked' ? me.btnUndock.hide() : me.btnUndock.show();
}
}
return {
options: {
branding: {},
@ -429,11 +431,15 @@ define([
me.mnuZoom = {options: {value: 100}};
me.btnFavorite = new Common.UI.Button({
id: 'btn-favorite',
cls: 'btn-header',
iconCls: 'toolbar__icon icon--inverse btn-favorite'
});
Common.NotificationCenter.on({
'app:ready': function(mode) {Common.Utils.asyncCall(onAppReady, me, mode);},
'app:face': function(mode) {Common.Utils.asyncCall(onAppShowed, me, mode);},
'app:config' : function (c) {Common.Utils.asyncCall(onAppConfig, me, c);},
'undock:status': onAppUndocked.bind(this)
'app:face': function(mode) {Common.Utils.asyncCall(onAppShowed, me, mode);}
});
Common.NotificationCenter.on('collaboration:sharingdeny', onLostEditRights);
},
@ -470,17 +476,11 @@ define([
if ( role == 'right' ) {
var $html = $(_.template(templateRightBox)({
tipUsers: this.labelCoUsersDescr,
txtAccessRights: this.txtAccessRights,
textSaveEnd: this.textSaveEnd
txtAccessRights: this.txtAccessRights
}));
if ( !me.labelDocName ) {
me.labelDocName = $html.find('#rib-doc-name');
// this.labelDocName.attr('maxlength', 50);
me.labelDocName.text = function (text) {
this.val(text).attr('size', text.length);
}
if ( me.documentCaption ) {
me.labelDocName.text(me.documentCaption);
}
@ -492,16 +492,20 @@ define([
this.setCanRename(this.options.canRename);
}
// $saveStatus = $html.find('#rib-save-status');
$html.find('#rib-save-status').hide();
// if ( config.isOffline ) $saveStatus = false;
if ( this.options.canBack === true ) {
me.btnGoBack.render($html.find('#slot-btn-back'));
} else {
$html.find('#slot-btn-back').hide();
}
if ( this.options.favorite !== undefined && this.options.favorite!==null) {
me.btnFavorite.render($html.find('#slot-btn-favorite'));
me.btnFavorite.changeIcon(!!me.options.favorite ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
me.btnFavorite.updateHint(!me.options.favorite ? me.textAddFavorite : me.textRemoveFavorite);
} else {
$html.find('#slot-btn-favorite').hide();
}
if ( !config.isEdit ) {
if ( (config.canDownload || config.canDownloadOrigin) && !config.isOffline )
this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'));
@ -514,6 +518,16 @@ define([
}
me.btnOptions.render($html.find('#slot-btn-options'));
if (!config.isEdit || config.customization && !!config.customization.compactHeader) {
if (config.user.guest && config.canRenameAnonymous)
me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'));
else {
me.elUserName = $html.find('.btn-current-user');
me.elUserName.removeClass('hidden');
}
me.setUserName(me.options.userName);
}
$userList = $html.find('.cousers-list');
$panelUsers = $html.find('.box-cousers');
$btnUsers = $html.find('.btn-users');
@ -527,7 +541,6 @@ define([
!!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box
me.labelDocName = $html.find('#title-doc-name');
me.labelDocName.text = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option
me.labelDocName.text( me.documentCaption );
me.labelUserName = $('> #title-user-name', $html);
@ -622,6 +635,19 @@ define([
return this.options.canBack;
},
setFavorite: function (value) {
this.options.favorite = value;
this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide']();
this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite);
return this;
},
getFavorite: function () {
return this.options.favorite;
},
setCanRename: function (rename) {
rename = false;
@ -655,21 +681,6 @@ define([
}
},
setSaveStatus: function (status) {
if ( $saveStatus ) {
if ( $saveStatus.is(':hidden') ) $saveStatus.show();
var _text;
switch ( status ) {
case 'begin': _text = this.textSaveBegin; break;
case 'changed': _text = this.textSaveChanged; break;
default: _text = this.textSaveEnd;
}
$saveStatus.text( _text );
}
},
setUserName: function(name) {
if ( !!this.labelUserName ) {
if ( !!name ) {
@ -677,6 +688,15 @@ define([
} else this.labelUserName.hide();
} else {
this.options.userName = name;
if ( this.btnUserName ) {
this.btnUserName.updateHint(name);
} else if (this.elUserName) {
this.elUserName.tooltip({
title: name,
placement: 'cursor',
html: true
});
}
}
return this;
@ -685,6 +705,8 @@ define([
getButton: function(type) {
if (type == 'save')
return this.btnSave;
else if (type == 'users')
return $panelUsers;
},
lockHeaderBtns: function (alias, lock) {
@ -719,18 +741,16 @@ define([
fakeMenuItem: function() {
return {
conf: {checked: false},
conf: {checked: false, disabled: false},
setChecked: function (val) { this.conf.checked = val; },
isChecked: function () { return this.conf.checked; }
isChecked: function () { return this.conf.checked; },
setDisabled: function (val) { this.conf.disabled = val; },
isDisabled: function () { return this.conf.disabled; }
};
},
textBack: 'Go to Documents',
txtRename: 'Rename',
textSaveBegin: 'Saving...',
textSaveEnd: 'All changes saved',
textSaveChanged: 'Modified',
textSaveExpander: 'All changes saved',
txtAccessRights: 'Change access rights',
tipAccessRights: 'Manage document access rights',
labelCoUsersDescr: 'Document is currently being edited by several users.',
@ -741,13 +761,15 @@ define([
tipSave: 'Save',
tipUndo: 'Undo',
tipRedo: 'Redo',
tipUndock: 'Undock',
textCompactView: 'Hide Toolbar',
textHideStatusBar: 'Hide Status Bar',
textHideLines: 'Hide Rulers',
textZoom: 'Zoom',
textAdvSettings: 'Advanced Settings',
tipViewSettings: 'View Settings'
tipViewSettings: 'View Settings',
textRemoveFavorite: 'Remove from Favorites',
textDarkTheme: 'Dark theme',
textAddFavorite: 'Mark as favorite'
}
}(), Common.Views.Header || {}))
});

View file

@ -90,7 +90,7 @@ define([
'<% } %>',
'<div class="user-name">',
'<div class="color" style="display: inline-block; background-color:' + '<%=usercolor%>;' + '" >',
'</div><%= Common.Utils.String.htmlEncode(username) %>',
'</div><%= Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)) %>',
'</div>',
'<% if (canRestore && selected) { %>',
'<label class="revision-restore" role="presentation" tabindex="-1">' + this.textRestore + '</label>',

View file

@ -107,6 +107,14 @@ define([
// this.udRows.on('entervalue', _.bind(this.onPrimary, this));
},
getFocusedComponents: function() {
return [this.udColumns, this.udRows];
},
getDefaultFocusableComponent: function () {
return this.udColumns;
},
onBtnClick: function(event) {
if (this.options.handler) {
this.options.handler.call(this, event.currentTarget.attributes['result'].value, {

View file

@ -87,7 +87,9 @@ define([
'<span class="input-group combobox <%= cls %> combo-langs" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control">',
'<span class="icon input-icon spellcheck-lang toolbar__icon btn-ic-docspell"></span>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret" />',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>">',
@ -101,7 +103,9 @@ define([
'</span>'
].join('')),
data: this.options.languages,
search: true
takeFocusOnClose: true,
search: true,
scrollAlwaysVisible: true
});
if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true});
@ -109,6 +113,11 @@ define([
var langname = Common.util.LanguageInfo.getLocalLanguageName(this.options.current);
this.cmbLanguage.setValue(langname[0], langname[1]);
this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord());
var me = this;
setTimeout(function(){
me.cmbLanguage.focus();
}, 100);
},
close: function(suppressevent) {

View file

@ -53,8 +53,8 @@ define([
Common.Views.ListSettingsDialog = Common.UI.Window.extend(_.extend({
options: {
type: 0, // 0 - markers, 1 - numbers
width: 230,
height: 200,
width: 280,
height: 255,
style: 'min-width: 240px;',
cls: 'modal-dlg',
split: false,
@ -70,28 +70,59 @@ define([
this.template = [
'<div class="box">',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtSize + '</label><div id="id-dlg-list-size"></div><label class="text" style="margin-left: 10px;">' + this.txtOfText + '</label>',
'<div style="margin-bottom: 16px;">',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-list-bullet" style="border-top-right-radius: 0;border-bottom-right-radius: 0;">', this.textBulleted,'</button>',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-list-numbering" style="border-top-left-radius: 0;border-bottom-left-radius: 0;border-left-width: 0;margin-left: -1px;">', this.textNumbering,'</button>',
'</div>',
'<div style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtColor + '</label><div id="id-dlg-list-color" style="display: inline-block;"></div>',
'<div style="height:120px;">',
'<table cols="3">',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtType + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-numbering-format" class="input-group-nr" style="width: 100px;"></div>',
'<div id="id-dlg-list-bullet-format" class="input-group-nr" style="width: 100px;"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtSize + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-size"></div>',
'</td>',
'<td style="padding-bottom: 8px;">',
'<label class="text" style="white-space: nowrap;">' + this.txtOfText + '</label>',
'</td>',
'</tr>',
'<tr class="numbering">',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text" style="white-space: nowrap;">' + this.txtStart + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-start"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtColor + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-color"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'</table>',
'</div>',
'<% if (type == 0) { %>',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;vertical-align: top;">' + this.txtBullet + '</label>',
'<button type="button" class="btn btn-text-default" id="id-dlg-list-edit" style="width:53px;display: inline-block;vertical-align: top;"></button>',
'</div>',
'<% } %>',
'<% if (type == 1) { %>',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtStart + '</label><div id="id-dlg-list-start"></div>',
'</div>',
'<% } %>',
'</div>'
].join('');
this.props = options.props;
this.options.tpl = _.template(this.template)(this.options);
this.color = '000000';
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -103,10 +134,149 @@ define([
$window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
me.btnBullet = new Common.UI.Button({
el: $('#id-dlg-list-bullet'),
enableToggle: true,
toggleGroup: 'list-type',
allowDepress: false,
pressed: true
});
me.btnBullet.on('click', _.bind(me.onListTypeClick, me, 0));
me.btnNumbering = new Common.UI.Button({
el: $('#id-dlg-list-numbering'),
enableToggle: true,
toggleGroup: 'list-type',
allowDepress: false
});
me.btnNumbering.on('click', _.bind(me.onListTypeClick, me, 1));
this.cmbNumFormat = new Common.UI.ComboBox({
el : $('#id-dlg-list-numbering-format'),
menuStyle : 'min-width: 100%;max-height: 183px;',
editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr',
data : [
{ displayValue: this.txtNone, value: -1 },
{ displayValue: 'A, B, C,...', value: 4 },
{ displayValue: 'a), b), c),...', value: 5 },
{ displayValue: 'a, b, c,...', value: 6 },
{ displayValue: '1, 2, 3,...', value: 1 },
{ displayValue: '1), 2), 3),...', value: 2 },
{ displayValue: 'I, II, III,...', value: 3 },
{ displayValue: 'i, ii, iii,...', value: 7 }
]
});
this.cmbNumFormat.on('selected', _.bind(function (combo, record) {
if (this._changedProps) {
this._changedProps.asc_putListType(1, record.value);
}
}, this));
this.cmbNumFormat.setValue(1);
var itemsTemplate =
[
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
'<%= item.displayValue %><% if (item.value === 0) { %><span style="font-family:<%=item.font%>;"><%=item.symbol%></span><% } %>',
'</a></li>',
'<% }); %>'
];
var template = [
'<div class="input-group combobox input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="padding-top:3px; line-height: 14px; cursor: pointer; <%= style %>"></div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">'].concat(itemsTemplate).concat([
'</ul>',
'</div>'
]);
this.cmbBulletFormat = new Common.UI.ComboBoxCustom({
el : $('#id-dlg-list-bullet-format'),
menuStyle : 'min-width: 100%;max-height: 183px;',
style : "width: 100px;",
editable : false,
takeFocusOnClose: true,
template : _.template(template.join('')),
itemsTemplate: _.template(itemsTemplate.join('')),
data : [
{ displayValue: this.txtNone, value: -1 },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "•", font: 'Arial' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "o", font: 'Courier New' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "§", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "v", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "Ø", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "ü", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "w", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "", font: 'Arial' },
{ displayValue: this.txtNewBullet, value: 1 }
],
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
if (record) {
if (record.get('value')==0)
formcontrol[0].innerHTML = record.get('displayValue') + '<span style="font-family:' + (record.get('font') || 'Arial') + '">' + record.get('symbol') + '</span>';
else
formcontrol[0].innerHTML = record.get('displayValue');
} else
formcontrol[0].innerHTML = '';
}
});
var rec = this.cmbBulletFormat.store.at(1);
this.cmbBulletFormat.selectRecord(rec);
this.bulletProps = {symbol: rec.get('symbol'), font: rec.get('font')};
this.cmbBulletFormat.on('selected', _.bind(function (combo, record) {
if (record.value === 1) {
var me = this,
props = me.bulletProps,
handler = function(dlg, result, settings) {
if (result == 'ok') {
props.changed = true;
props.code = settings.code;
props.font = settings.font;
props.symbol = settings.symbol;
if (me._changedProps) {
me._changedProps.asc_putFont(props.font);
me._changedProps.asc_putSymbol(props.symbol);
}
}
var store = combo.store;
if (!store.findWhere({value: 0, symbol: props.symbol, font: props.font}))
store.add({ displayValue: me.txtSymbol + ': ', value: 0, symbol: props.symbol, font: props.font }, {at: store.length-1});
combo.setData(store.models);
combo.selectRecord(combo.store.findWhere({value: 0, symbol: props.symbol, font: props.font}));
},
win = new Common.Views.SymbolTableDialog({
api: me.options.api,
lang: me.options.interfaceLang,
modal: true,
type: 0,
font: props.font,
symbol: props.symbol,
handler: handler
});
win.show();
win.on('symbol:dblclick', handler);
} else if (record.value == -1) {
if (this._changedProps)
this._changedProps.asc_putListType(0, record.value);
} else {
this.bulletProps.changed = true;
this.bulletProps.code = record.code;
this.bulletProps.font = record.font;
this.bulletProps.symbol = record.symbol;
if (this._changedProps) {
this._changedProps.asc_putFont(this.bulletProps.font);
this._changedProps.asc_putSymbol(this.bulletProps.symbol);
}
}
}, this));
this.spnSize = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-size'),
step : 1,
width : 53,
width : 100,
value : 100,
defaultUnit : '',
maxValue : 400,
@ -114,14 +284,15 @@ define([
allowDecimal: false
}).on('change', function(field, newValue, oldValue, eOpts){
if (me._changedProps) {
me._changedProps.asc_putBulletSize(field.getNumberValue());
me._changedProps.asc_putSize(field.getNumberValue());
}
});
this.btnColor = new Common.UI.ColorButton({
parentEl: $window.find('#id-dlg-list-color'),
style: "width:53px;",
additionalAlign: this.menuAddAlign
style: "width:45px;",
additionalAlign: this.menuAddAlign,
color: this.color
});
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
this.colors = this.btnColor.getPicker();
@ -129,7 +300,7 @@ define([
this.spnStart = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-start'),
step : 1,
width : 53,
width : 100,
value : 1,
defaultUnit : '',
maxValue : 32767,
@ -137,20 +308,22 @@ define([
allowDecimal: false
}).on('change', function(field, newValue, oldValue, eOpts){
if (me._changedProps) {
me._changedProps.put_NumStartAt(field.getNumberValue());
me._changedProps.asc_putNumStartAt(field.getNumberValue());
}
});
this.btnEdit = new Common.UI.Button({
el: $window.find('#id-dlg-list-edit'),
hint: this.tipChange
});
this.btnEdit.on('click', _.bind(this.onEditBullet, this));
this.btnEdit.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
me.numberingControls = $window.find('.numbering');
var el = $window.find('table tr:first() td:first()');
el.width(Math.max($window.find('.numbering .text').width(), el.width()));
this.afterRender();
},
getFocusedComponents: function() {
return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart];
},
afterRender: function() {
this.updateThemeColors();
this._setDefaults(this.props);
@ -161,43 +334,53 @@ define([
},
onColorsSelect: function(btn, color) {
this.color = color;
if (this._changedProps) {
this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(color));
}
},
onEditBullet: function() {
var me = this,
props = me.bulletProps,
handler = function(dlg, result, settings) {
if (result == 'ok') {
props.changed = true;
props.code = settings.code;
props.font = settings.font;
props.symbol = settings.symbol;
props.font && me.btnEdit.cmpEl.css('font-family', props.font);
settings.symbol && me.btnEdit.setCaption(settings.symbol);
if (me._changedProps) {
me._changedProps.asc_putBulletFont(props.font);
me._changedProps.asc_putBulletSymbol(props.symbol);
}
}
},
win = new Common.Views.SymbolTableDialog({
api: me.options.api,
lang: me.options.interfaceLang,
modal: true,
type: 0,
font: props.font,
symbol: props.symbol,
handler: handler
});
win.show();
win.on('symbol:dblclick', handler);
onListTypeClick: function(type, btn, event) {
this.ShowHideElem(type);
},
ShowHideElem: function(value) {
this.numberingControls.toggleClass('hidden', value==0);
this.cmbNumFormat.setVisible(value==1);
this.cmbBulletFormat.setVisible(value==0);
var me = this;
_.delay(function(){
if (value)
me.cmbNumFormat.focus();
else
me.cmbBulletFormat.focus();
},50);
},
_handleInput: function(state) {
if (this.options.handler) {
if (this.options.handler)
{
var type = this.btnBullet.pressed ? 0 : 1;
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) {
this._changedProps = new Asc.asc_CBullet();
this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.color));
this._changedProps.asc_putSize(this.spnSize.getNumberValue());
}
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE ||
this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR && type==1 || this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM && type==0) { // changed list type
if (type==0) {//markers
if (this.cmbBulletFormat.getValue()==-1) {
this._changedProps.asc_putListType(0, -1);
} else {
this._changedProps.asc_putFont(this.bulletProps.font);
this._changedProps.asc_putSymbol(this.bulletProps.symbol);
}
} else {
this._changedProps.asc_putListType(1, this.cmbNumFormat.getValue());
this._changedProps.asc_putNumStartAt(this.spnStart.getNumberValue());
}
}
this.options.handler.call(this, state, this._changedProps);
}
this.close();
@ -214,40 +397,73 @@ define([
_setDefaults: function (props) {
if (props) {
this.spnSize.setValue(props.asc_getBulletSize() || '', true);
var value = props.get_NumStartAt();
this.spnStart.setValue(value || '', true);
this.spnStart.setDisabled(value===null);
var color = props.asc_getBulletColor();
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
} else {
color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
color = 'transparent';
this.btnColor.setColor(color);
if ( typeof(color) == 'object' ) {
var isselected = false;
for (var i=0; i<10; i++) {
if ( Common.Utils.ThemeColor.ThemeValues[i] == color.effectValue ) {
this.colors.select(color,true);
isselected = true;
break;
}
}
if (!isselected) this.colors.clearSelection();
} else
this.colors.select(color,true);
var type = 0;
var bullet = props.asc_getBullet();
if (bullet) {
this.originalType = bullet.asc_getType();
if (this.type==0) {
this.bulletProps = {symbol: props.asc_getBulletSymbol(), font: props.asc_getBulletFont()};
this.bulletProps.font && this.btnEdit.cmpEl.css('font-family', this.bulletProps.font);
this.bulletProps.symbol && this.btnEdit.setCaption(this.bulletProps.symbol);
this.spnSize.setValue(bullet.asc_getSize() || '', true);
var color = bullet.asc_getColor();
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
} else {
color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
color = 'transparent';
this.color = Common.Utils.ThemeColor.colorValue2EffectId(color);
this.btnColor.setColor(color);
if ( typeof(color) == 'object' ) {
var isselected = false;
for (var i=0; i<10; i++) {
if ( Common.Utils.ThemeColor.ThemeValues[i] == color.effectValue ) {
this.colors.select(color,true);
isselected = true;
break;
}
}
if (!isselected) this.colors.clearSelection();
} else
this.colors.select(color,true);
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) {
this.cmbNumFormat.setValue(-1);
this.cmbBulletFormat.setValue(-1);
type = this.type;
} else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR) {
var symbol = bullet.asc_getSymbol();
if (symbol) {
this.bulletProps = {symbol: symbol, font: bullet.asc_getFont()};
if (!this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font}))
this.cmbBulletFormat.store.add({ displayValue: this.txtSymbol + ': ', value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbBulletFormat.store.length-1});
this.cmbBulletFormat.setData(this.cmbBulletFormat.store.models);
this.cmbBulletFormat.selectRecord(this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font}));
} else
this.cmbBulletFormat.setValue('');
this._changedProps = bullet;
type = 0;
} else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM) {
var autonum = bullet.asc_getAutoNumType();
this.cmbNumFormat.setValue(autonum, '');
var value = bullet.asc_getNumStartAt();
this.spnStart.setValue(value || '', true);
this.spnStart.setDisabled(value===null);
this._changedProps = bullet;
type = 1;
}
} else {// different bullet types
this.cmbNumFormat.setValue(-1);
this.cmbBulletFormat.setValue(-1);
this._changedProps = new Asc.asc_CBullet();
type = this.type;
}
}
this._changedProps = new Asc.asc_CParagraphProperty();
(type == 1) ? this.btnNumbering.toggle(true) : this.btnBullet.toggle(true);
this.ShowHideElem(type);
},
txtTitle: 'List Settings',
@ -255,7 +471,11 @@ define([
txtColor: 'Color',
txtOfText: '% of text',
txtStart: 'Start at',
txtBullet: 'Bullet',
tipChange: 'Change bullet'
textBulleted: 'Bulleted',
textNumbering: 'Numbered',
txtType: 'Type',
txtNone: 'None',
txtNewBullet: 'New bullet',
txtSymbol: 'Symbol'
}, Common.Views.ListSettingsDialog || {}))
});

View file

@ -68,6 +68,7 @@ define([
preview : options.preview,
warning : options.warning,
codepages : options.codepages,
warningMsg : options.warningMsg,
width : width,
height : height,
header : true,
@ -85,7 +86,7 @@ define([
'<% if (warning) { %>',
'<div>',
'<div class="icon img-commonctrl warn"></div>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + t.txtProtected+ '</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>',
'</div>',
@ -104,7 +105,7 @@ define([
'</div>',
'</div>',
'<% } %>',
'<% if (type == Common.Utils.importTextType.CSV || type == Common.Utils.importTextType.Paste || type == Common.Utils.importTextType.Columns) { %>',
'<% if (type == Common.Utils.importTextType.CSV) { %>',
'<div style="display: inline-block; margin-bottom:15px;">',
'<label class="header">' + t.txtDelimiter + '</label>',
'<div>',
@ -113,6 +114,16 @@ define([
'</div>',
'</div>',
'<% } %>',
'<% if (type == Common.Utils.importTextType.Paste || type == Common.Utils.importTextType.Columns) { %>',
'<div style="display: inline-block; margin-bottom:15px;width: 100%;">',
'<label class="header">' + t.txtDelimiter + '</label>',
'<div>',
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 100px;display: inline-block; vertical-align: middle;"></div>',
'<div id="id-delimiter-other" class="input-row" style="display: inline-block; vertical-align: middle;margin-left: 10px;"></div>',
'<button type="button" class="btn btn-text-default" id="id-delimiters-advanced" style="min-width:100px; display: inline-block;float:right;">' + t.txtAdvanced + '</button>',
'</div>',
'</div>',
'<% } %>',
'<% if (!!preview) { %>',
'<div style="">',
'<label class="header">' + t.txtPreview + '</label>',
@ -234,7 +245,10 @@ define([
if (!this.closable && this.type == Common.Utils.importTextType.TXT) { //save last encoding only for opening txt files
Common.localStorage.setItem("de-settings-open-encoding", encoding);
}
this.handler.call(this, state, encoding, delimiter, delimiterChar);
var decimal = this.separatorOptions ? this.separatorOptions.decimal : undefined,
thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined;
this.handler.call(this, state, encoding, delimiter, delimiterChar, decimal, thousands);
}
}
@ -336,6 +350,13 @@ define([
this.inputDelimiter.setVisible(false);
if (this.preview)
this.inputDelimiter.on ('changing', _.bind(this.updatePreview, this));
if (this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns) {
this.btnAdvanced = new Common.UI.Button({
el: $('#id-delimiters-advanced')
});
this.btnAdvanced.on('click', _.bind(this.onAdvancedClick, this));
}
}
},
@ -355,7 +376,12 @@ define([
break;
case Common.Utils.importTextType.Paste:
case Common.Utils.importTextType.Columns:
this.api.asc_TextImport(new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
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;
}
},
@ -444,6 +470,28 @@ define([
this.updatePreview();
},
onAdvancedClick: function() {
if (!SSE) return;
var me = this,
decimal = this.api.asc_getDecimalSeparator(),
thousands = this.api.asc_getGroupSeparator();
(new SSE.Views.AdvancedSeparatorDialog({
props: {
decimal: decimal,
thousands: thousands
},
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
};
}
}
})).show();
},
txtDelimiter : "Delimiter",
txtEncoding : "Encoding ",
txtSpace : "Space",
@ -458,7 +506,8 @@ define([
txtComma: 'Comma',
txtColon: 'Colon',
txtSemicolon: 'Semicolon',
txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.'
txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.',
txtAdvanced: 'Advanced'
}, Common.Views.OpenDialog || {}));
});

View file

@ -31,9 +31,9 @@
*
*/
/**
* CellsAddDialog.js
* OptionsDialog.js
*
* Created by Julia Radzhabova on 08.05.2020
* Created by Julia Radzhabova on 15.10.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
@ -42,13 +42,13 @@ define([
'common/main/lib/component/RadioBox'
], function () { 'use strict';
SSE.Views.CellsAddDialog = Common.UI.Window.extend(_.extend({
Common.Views.OptionsDialog = Common.UI.Window.extend(_.extend({
options: {
width: 214,
height: 195,
header: true,
style: 'min-width: 214px;',
cls: 'modal-dlg',
items: [],
buttons: ['ok', 'cancel']
},
@ -57,14 +57,18 @@ define([
this.template = [
'<div class="box">',
'<div id="cell-ins-radio-1" style="margin-bottom: 10px;"></div>',
'<div id="cell-ins-radio-2" style="margin-bottom: 10px;"></div>',
'<div id="cell-ins-radio-3" style="margin-bottom: 10px;"></div>',
'<div id="cell-ins-radio-4" style="margin-bottom: 2px;"></div>',
'<% if (typeof label !== "undefined" && label !=="") { %>',
'<label style="margin-bottom: 10px;"><%= label %></label>',
'<% } %>',
'<% _.each(items, function(item, index) { %>',
'<% if (!item.id) item.id = Common.UI.getId(); %>',
'<div id="<%= item.id %>" style="margin-bottom: 10px;"></div>',
'<% }) %>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.radio = [];
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -73,30 +77,32 @@ define([
Common.UI.Window.prototype.render.call(this);
var me = this,
$window = me.getChild(),
items = this.options.items,
checked = true;
checked = true,
checkedIndex = -1;
if (items) {
for (var i=0; i<4; i++) {
var radio = new Common.UI.RadioBox({
el: $('#cell-ins-radio-' + (i+1)),
labelText: items[i].caption,
name: 'asc-radio-cell-ins',
value: items[i].value,
disabled: items[i].disabled,
checked: checked && !items[i].disabled
for (var i=0; i<items.length; i++) {
var item = items[i];
this.radio.push(new Common.UI.RadioBox({
el: $window.find('#' + item.id),
labelText: item.caption || '',
name: 'asc-radio-opt-dlg',
value: item.value,
disabled: !!item.disabled,
checked: checked && !item.disabled
}).on('change', function(field, newValue, eOpts) {
if (newValue) {
me.currentCell = field.options.value;
}
});
if (checked && !items[i].disabled) {
}));
if ((checked || item.checked)&& !item.disabled) {
checked = false;
me.currentCell = items[i].value;
checkedIndex = i;
}
}
(checkedIndex>=0) && this.radio[checkedIndex].setValue(true);
}
var $window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
@ -121,5 +127,5 @@ define([
return false;
}
}, SSE.Views.CellsAddDialog || {}))
}, Common.Views.OptionsDialog || {}))
});

View file

@ -162,7 +162,7 @@ define([
hint: model.get('name')
});
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
model.set('button', btn);
@ -210,6 +210,7 @@ define([
this.iframePlugin.align = "top";
this.iframePlugin.frameBorder = 0;
this.iframePlugin.scrolling = "no";
this.iframePlugin.allow = "camera; microphone; display-capture";
this.iframePlugin.onload = _.bind(this._onLoad,this);
this.currentPluginFrame.append(this.iframePlugin);
@ -393,6 +394,7 @@ define([
iframe.align = "top";
iframe.frameBorder = 0;
iframe.scrolling = "no";
iframe.allow = "camera; microphone; display-capture";
iframe.onload = _.bind(this._onLoad,this);
var me = this;

View file

@ -57,7 +57,7 @@ define([
Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){
var template =
'<section id="review-changes-panel" class="panel" data-tab="review">' +
'<div class="group no-group-mask">' +
'<div class="group no-group-mask review">' +
'<span id="slot-btn-sharing" class="btn-slot text x-huge"></span>' +
'<span id="slot-btn-coauthmode" class="btn-slot text x-huge"></span>' +
'</div>' +
@ -70,7 +70,7 @@ define([
'<div class="group">' +
'<span id="btn-review-on" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="group no-group-mask" style="padding-left: 0;">' +
'<div class="group no-group-mask review" style="padding-left: 0;">' +
'<span id="btn-review-view" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="group move-changes" style="padding-left: 0;">' +
@ -84,22 +84,15 @@ define([
'<span id="btn-compare" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long compare"></div>' +
'<div class="group no-group-mask">' +
'<div class="group no-group-mask review form-view">' +
'<span id="slot-btn-chat" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long chat"></div>' +
'<div class="group no-group-mask">' +
'<div class="group no-group-mask review form-view">' +
'<span id="slot-btn-history" class="btn-slot text x-huge"></span>' +
'</div>' +
'</section>';
function _click_turnpreview(btn, e) {
if (this.appConfig.canReview) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed ? 'on' : 'off');
Common.NotificationCenter.trigger('edit:complete');
}
};
function setEvents() {
var me = this;
@ -108,7 +101,7 @@ define([
me.fireEvent('reviewchange:accept', [me.btnAccept, 'current']);
});
this.btnAccept.menu.on('item:click', function (menu, item, e) {
this.btnAccept.menu && this.btnAccept.menu.on('item:click', function (menu, item, e) {
me.fireEvent('reviewchange:accept', [menu, item]);
});
@ -116,7 +109,7 @@ define([
me.fireEvent('reviewchange:reject', [me.btnReject, 'current']);
});
this.btnReject.menu.on('item:click', function (menu, item, e) {
this.btnReject.menu && this.btnReject.menu.on('item:click', function (menu, item, e) {
me.fireEvent('reviewchange:reject', [menu, item]);
});
@ -131,7 +124,36 @@ define([
}
this.btnsTurnReview.forEach(function (button) {
button.on('click', _click_turnpreview.bind(me));
button.on('click', function (btn, e) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed);
Common.NotificationCenter.trigger('edit:complete');
});
!me.appConfig.isReviewOnly && button.menu.on('item:toggle', function (menu, item, state, e) {
if (!!state) {
if (item.value==2) // ON track changes for everyone
Common.UI.warning({
title: me.textWarnTrackChangesTitle,
msg: me.textWarnTrackChanges,
maxwidth: 600,
buttons: [{
value: 'enable',
caption: me.textEnable
}, 'cancel'],
primary: 'enable',
callback: function(btn){
if (btn == 'enable') {
Common.NotificationCenter.trigger('reviewchanges:turn', item.value==0 || item.value==2, item.value>1);
} else {
var old = Common.Utils.InternalSettings.get(me.appPrefix + "track-changes");
me.turnChanges(old==0 || old==2, old>1);
}
Common.NotificationCenter.trigger('edit:complete');
}
});
else
Common.NotificationCenter.trigger('reviewchanges:turn', item.value==0 || item.value==2, item.value>1);
}
});
});
}
if (this.appConfig.canViewReview) {
@ -202,14 +224,14 @@ define([
this.btnAccept = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtAccept,
split: true,
split: !this.appConfig.canUseReviewPermissions,
iconCls: 'toolbar__icon btn-review-save'
});
this.btnReject = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtReject,
split: true,
split: !this.appConfig.canUseReviewPermissions,
iconCls: 'toolbar__icon btn-review-deny'
});
@ -225,6 +247,7 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-review',
caption: this.txtTurnon,
split: !this.appConfig.isReviewOnly,
enableToggle: true
});
this.btnsTurnReview = [this.btnTurnOn];
@ -356,38 +379,72 @@ define([
'<% } %></a>');
if ( config.canReview ) {
var idx = Common.Utils.InternalSettings.get(me.appPrefix + "track-changes");
!config.isReviewOnly && me.btnTurnOn.setMenu(
new Common.UI.Menu({items: [
{
caption: me.txtOn,
value: 0,
checkable: true,
checked: idx==0,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOff,
value: 1,
checkable: true,
checked: idx==1,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOnGlobal,
value: 2,
checkable: true,
checked: idx==2,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOffGlobal,
value: 3,
checkable: true,
checked: idx==3,
toggleGroup: 'menuTurnReviewTlb'
}
]})
);
me.btnTurnOn.updateHint(me.tipReview);
me.btnAccept.setMenu(
new Common.UI.Menu({
items: [
{
caption: me.txtAcceptCurrent,
value: 'current'
},
{
caption: me.txtAcceptAll,
value: 'all'
}
]
})
);
if (!me.appConfig.canUseReviewPermissions) {
me.btnAccept.setMenu(
new Common.UI.Menu({
items: [
{
caption: me.txtAcceptCurrent,
value: 'current'
},
{
caption: me.txtAcceptAll,
value: 'all'
}
]
})
);
me.btnReject.setMenu(
new Common.UI.Menu({
items: [
{
caption: me.txtRejectCurrent,
value: 'current'
},
{
caption: me.txtRejectAll,
value: 'all'
}
]
})
);
}
me.btnAccept.updateHint([me.tipAcceptCurrent, me.txtAcceptChanges]);
me.btnReject.setMenu(
new Common.UI.Menu({
items: [
{
caption: me.txtRejectCurrent,
value: 'current'
},
{
caption: me.txtRejectAll,
value: 'all'
}
]
})
);
me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]);
if (config.canFeatureComparison) {
@ -456,7 +513,7 @@ define([
if (me.btnCommentRemove) {
var items = [
{
caption: config.canEditComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
caption: config.canDeleteComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
value: 'current'
},
{
@ -464,7 +521,7 @@ define([
value: 'my'
}
];
if (config.canEditComments)
if (config.canDeleteComments)
items.push({
caption: me.txtCommentRemAll,
value: 'all'
@ -550,7 +607,37 @@ define([
iconCls : 'toolbar__icon btn-ic-review',
hintAnchor : 'top',
hint : this.tipReview,
enableToggle: true
split : !this.appConfig.isReviewOnly,
enableToggle: true,
menu: this.appConfig.isReviewOnly ? false : new Common.UI.Menu({
menuAlign: 'bl-tl',
style: 'margin-top:-5px;',
items: [
{
caption: this.txtOn,
value: 0,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOff,
value: 1,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOnGlobal,
value: 2,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOffGlobal,
value: 3,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
}
]})
});
this.btnsTurnReview.push(button);
@ -583,14 +670,20 @@ define([
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
turnChanges: function(state) {
turnChanges: function(state, global) {
this.btnsTurnReview.forEach(function(button) {
if ( button && button.pressed != state ) {
button.toggle(state, true);
}
if (button.menu) {
button.menu.items[0].setChecked(state && !global, true);
button.menu.items[1].setChecked(!state && !global, true);
button.menu.items[2].setChecked(state && !!global, true);
button.menu.items[3].setChecked(!state && !!global, true);
}
}, this);
},
@ -646,7 +739,7 @@ define([
button.setDisabled(state);
}
}, this);
this.btnChat && this.btnChat.setDisabled(state);
// this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
},
@ -710,7 +803,14 @@ define([
txtCommentRemCurrent: 'Remove Current Comments',
txtCommentRemMyCurrent: 'Remove My Current Comments',
txtCommentRemMy: 'Remove My Comments',
txtCommentRemAll: 'Remove All Comments'
txtCommentRemAll: 'Remove All Comments',
txtOnGlobal: 'ON for me and everyone',
txtOffGlobal: 'OFF for me and everyone',
txtOn: 'ON for me',
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'
}
}()), Common.Views.ReviewChanges || {}));
@ -771,7 +871,7 @@ define([
caption : this.txtAccept,
split : true,
disabled : this.mode.isReviewOnly,
menu : new Common.UI.Menu({
menu : this.mode.canUseReviewPermissions ? false : new Common.UI.Menu({
items: [
this.mnuAcceptCurrent = new Common.UI.MenuItem({
caption: this.txtAcceptCurrent,
@ -791,7 +891,7 @@ define([
caption : this.txtReject,
split : true,
disabled : this.mode.isReviewOnly,
menu : new Common.UI.Menu({
menu : this.mode.canUseReviewPermissions ? false : new Common.UI.Menu({
items: [
this.mnuRejectCurrent = new Common.UI.MenuItem({
caption: this.txtRejectCurrent,
@ -819,7 +919,7 @@ define([
me.fireEvent('reviewchange:accept', [me.btnAccept, 'current']);
});
this.btnAccept.menu.on('item:click', function (menu, item, e) {
this.btnAccept.menu && this.btnAccept.menu.on('item:click', function (menu, item, e) {
me.fireEvent('reviewchange:accept', [menu, item]);
});
@ -827,7 +927,7 @@ define([
me.fireEvent('reviewchange:reject', [me.btnReject, 'current']);
});
this.btnReject.menu.on('item:click', function (menu, item, e) {
this.btnReject.menu && this.btnReject.menu.on('item:click', function (menu, item, e) {
me.fireEvent('reviewchange:reject', [menu, item]);
});

View file

@ -489,9 +489,18 @@ define([
var init = (aFontSelects.length<1);
init && this.initFonts();
//fill recents
this.fillRecentSymbols();
var lastfont;
if (options.font) {
lastfont = options.font;
} else if (aRecents.length>0) {
lastfont = aRecents[0].font;
}
if (lastfont) {
for(var i = 0; i < aFontSelects.length; ++i){
if(aFontSelects[i].displayValue === options.font){
if(aFontSelects[i].displayValue === lastfont){
nCurrentFont = i;
break;
}
@ -526,6 +535,8 @@ define([
nCurrentSymbol = options.code;
} else if (options.symbol) {
nCurrentSymbol = this.fixedCharCodeAt(options.symbol, 0);
} else if (aRecents.length>0) {
nCurrentSymbol = aRecents[0].symbol;
}
if (init && this.options.lang && this.options.lang != 'en') {
@ -539,6 +550,8 @@ define([
this.on('resizing', _.bind(this.onWindowResizing, this));
this.on('resize', _.bind(this.onWindowResize, this));
bMainFocus = true;
},
initFonts: function() {
@ -705,9 +718,6 @@ define([
me.updateInput();
});
//fill recents
this.fillRecentSymbols();
this.symbolTablePanel = $window.find('#symbol-table-scrollable-div');
this.previewPanel = $window.find('#id-preview-data');
this.previewParent = this.previewPanel.parent();
@ -721,18 +731,18 @@ define([
// special
var data = [{symbol: '—', description: this.textEmDash, shortcutKey: 'Alt+Ctrl+Num -', code: '2014'},
{symbol: '', description: this.textEnDash, shortcutKey: '', code: '2013'},
{symbol: '', description: this.textNBHyphen, shortcutKey: 'Ctrl+Shift+_', code: '2011'},
{symbol: '', description: this.textSHyphen, shortcutKey: 'Alt+-', code: '00AD'},
{symbol: '', description: this.textNBHyphen, shortcutKey: 'Ctrl+Shift+_', code: '002D', special: {"NonBreakingHyphen":true}},
// {symbol: '', description: this.textSHyphen, shortcutKey: 'Alt+-', code: '00AD'},
{symbol: '', description: this.textEmSpace, shortcutKey: '', code: '2003'},
{symbol: '', description: this.textEnSpace, shortcutKey: '', code: '2002'},
{symbol: '', description: this.textQEmSpace, shortcutKey: '', code: '2005'},
{symbol: '°', description: this.textNBSpace, shortcutKey: 'Ctrl+Shift+Space', code: '00A0'},
{symbol: '©', description: this.textCopyright, shortcutKey: 'Alt+Ctrl+C', code: '00A9'},
{symbol: '®', description: this.textRegistered, shortcutKey: 'Alt+Ctrl+R', code: '00AE'},
{symbol: '™', description: this.textTradeMark, shortcutKey: 'Alt+Ctrl+T', code: '2122'},
{symbol: '©', description: this.textCopyright, shortcutKey: '', code: '00A9'},
{symbol: '®', description: this.textRegistered, shortcutKey: '', code: '00AE'},
{symbol: '™', description: this.textTradeMark, shortcutKey: '', code: '2122'},
{symbol: '§', description: this.textSection, shortcutKey: '', code: '00A7'},
{symbol: '¶', description: this.textPilcrow, shortcutKey: '', code: '00B6'},
{symbol: '…', description: this.textEllipsis, shortcutKey: 'Alt+Ctrl+.', code: '2026'},
{symbol: '…', description: this.textEllipsis, shortcutKey: '', code: '2026'},
{symbol: '', description: this.textSOQuote, shortcutKey: '', code: '2018'},
{symbol: '', description: this.textSCQuote, shortcutKey: '', code: '2019'},
{symbol: '‟', description: this.textDOQuote, shortcutKey: '', code: '201C'},
@ -790,24 +800,27 @@ define([
},
getPasteSymbol: function(cellId) {
var bUpdateRecents = cellId[0] === 'c';
var bUpdateRecents = false;
var sFont;
if(bUpdateRecents){
sFont = aFontSelects[nCurrentFont].displayValue;
} else {
var nFontId = parseInt(cellId.split('_')[2]);
sFont = aFontSelects[nFontId].displayValue;
if (cellId && cellId.length>0) {
bUpdateRecents = (cellId[0] === 'c');
if(bUpdateRecents){
sFont = aFontSelects[nCurrentFont].displayValue;
} else {
var nFontId = parseInt(cellId.split('_')[2]);
sFont = aFontSelects[nFontId].displayValue;
}
}
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents};
},
getSpecialSymbol: function() {
var rec = this.specialList.getSelectedRec();
return {font: undefined, symbol: this.encodeSurrogateChar(rec.get('code')), code: parseInt(rec.get('code'), 16)};
return {font: undefined, symbol: this.encodeSurrogateChar(rec.get('code')), code: parseInt(rec.get('code'), 16), special: rec.get('special')};
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
this._handleInput(event.currentTarget.attributes['result'].value, true);
},
onPrimary: function(event) {
@ -815,14 +828,18 @@ define([
return false;
},
_handleInput: function(state) {
_handleInput: function(state, fromButton) {
if(!fromButton && document.activeElement && document.activeElement.localName == 'textarea' && /area_id/.test(document.activeElement.id)){
return;
}
var special = this.btnSpecial.isActive();
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
var settings = (state=='ok') ? (special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'))) : {};
if (this.options.handler) {
this.options.handler.call(this, this, state, settings);
}
if (state=='ok') {
!special && settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
!special && this.checkRecent(nCurrentSymbol, settings.font);
!special && settings.updateRecents && this.updateRecents();
if (this.type)
return;
@ -1050,7 +1067,7 @@ define([
this._handleInput('ok');
else {
var settings = this.getPasteSymbol($(e.target).attr('id'));
settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
this.checkRecent(nCurrentSymbol, settings.font);
settings.updateRecents && this.updateView(false, undefined, undefined, true);
this.fireEvent('symbol:dblclick', this, 'ok', settings);
}
@ -1472,7 +1489,7 @@ define([
this.specialPanel.toggleClass('hidden', !special);
var me = this;
_.delay(function(){
special ? me.specialList.cmpEl.find('.listview').focus() : me.previewPanel.focus();
special ? me.specialList.focus() : me.previewPanel.focus();
},50);
},

View file

@ -0,0 +1,134 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* UserNameDialog.js
*
* Created by Julia Radzhabova on 09.12.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/component/Window',
'common/main/lib/component/InputField'
], function () { 'use strict';
Common.Views.UserNameDialog = Common.UI.Window.extend(_.extend({
options: {
width: 330,
header: false,
modal : false,
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
},
initialize : function(options) {
_.extend(this.options, options || {});
this.template = [
'<div class="box">',
'<div style="margin-bottom: 2px;">' + (this.options.label ? this.options.label : this.textLabel) + '</div>',
'<div id="id-dlg-username-caption" class="input-row"></div>',
'<div id="id-dlg-username-chk-use" class="" style="margin-top: 10px;"></div>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var me = this;
me.inputLabel = new Common.UI.InputField({
el : $('#id-dlg-username-caption'),
allowBlank : true,
style : 'width: 100%;',
maxLength : 128,
validateOnBlur: false,
validation : me.options.validation || function(value) {
return value ? true : '';
}
});
me.inputLabel.setValue(this.options.value || '' );
me.chDontShow = new Common.UI.CheckBox({
el: $('#id-dlg-username-chk-use'),
labelText: this.textDontShow,
value: this.options.check
});
var $window = this.getChild();
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.getChild('input').focus();
},50);
},
onPrimary: function(event) {
this._handleInput('ok');
return false;
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
_handleInput: function(state) {
if (this.options.handler) {
if (state == 'ok') {
if (this.inputLabel.checkValidate() !== true) {
this.inputLabel.cmpEl.find('input').focus();
return;
}
}
this.options.handler.call(this, state, {input: this.inputLabel.getValue(), checkbox: this.chDontShow.getValue()=='checked'});
}
this.close();
},
textLabel: 'Label:',
textLabelError: 'Label must not be empty.',
textDontShow: 'Don\'t ask me again'
}, Common.Views.UserNameDialog || {}));
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -1,15 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<svg fill="none" height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-blank">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="white"/>
<path opacity="0.2" d="M77 5H8C7.20435 5 6.44129 5.31607 5.87868 5.87868C5.31607 6.44129 5 7.20435 5 8V119C5 119.796 5.31607 120.559 5.87868 121.121C6.44129 121.684 7.20435 122 8 122H92C92.7956 122 93.5587 121.684 94.1213 121.121C94.6839 120.559 95 119.796 95 119V23L77 5ZM94 119C94 119.53 93.7893 120.039 93.4142 120.414C93.0391 120.789 92.5304 121 92 121H8C7.46957 121 6.96086 120.789 6.58579 120.414C6.21071 120.039 6 119.53 6 119V8C6 7.46957 6.21071 6.96086 6.58579 6.58579C6.96086 6.21071 7.46957 6 8 6H76.59L77 6.41V20C77 20.7956 77.3161 21.5587 77.8787 22.1213C78.4413 22.6839 79.2044 23 80 23H93.59L94 23.41V119Z" fill="black"/>
<g opacity="0.2">
<path opacity="0.2" d="M75 86H50V88H75V86Z" fill="black"/>
<path opacity="0.2" d="M75 80H25V82H75V80Z" fill="black"/>
<path opacity="0.2" d="M75 74H25V76H75V74Z" fill="black"/>
<path opacity="0.2" d="M75 68H25V70H75V68Z" fill="black"/>
<path opacity="0.2" d="M75 62H25V64H75V62Z" fill="black"/>
<path opacity="0.2" d="M49 43H25V45H49V43Z" fill="black"/>
<path opacity="0.2" d="M44 37H25V39H44V37Z" fill="black"/>
</g>
<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>
</symbol>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 440 B

View file

@ -1,8 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-epub">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#5892B6"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M40.3218 114H35.3882V105.434H40.3218V106.922H37.2046V108.803H40.105V110.291H37.2046V112.5H40.3218V114ZM43.9312 109.465H44.5288C45.0874 109.465 45.5054 109.355 45.7827 109.137C46.0601 108.914 46.1987 108.592 46.1987 108.17C46.1987 107.744 46.0815 107.43 45.8472 107.227C45.6167 107.023 45.2534 106.922 44.7573 106.922H43.9312V109.465ZM48.0327 108.105C48.0327 109.027 47.7437 109.732 47.1655 110.221C46.5913 110.709 45.7729 110.953 44.7104 110.953H43.9312V114H42.1147V105.434H44.8511C45.8901 105.434 46.6792 105.658 47.2183 106.107C47.7612 106.553 48.0327 107.219 48.0327 108.105ZM56.6226 105.434V110.977C56.6226 111.609 56.48 112.164 56.1948 112.641C55.9136 113.117 55.5054 113.482 54.9702 113.736C54.4351 113.99 53.8022 114.117 53.0718 114.117C51.9702 114.117 51.1147 113.836 50.5054 113.273C49.896 112.707 49.5913 111.934 49.5913 110.953V105.434H51.4019V110.678C51.4019 111.338 51.5347 111.822 51.8003 112.131C52.0659 112.439 52.5054 112.594 53.1187 112.594C53.7124 112.594 54.1421 112.439 54.4077 112.131C54.6772 111.818 54.812 111.33 54.812 110.666V105.434H56.6226ZM58.7202 105.434H61.3862C62.6011 105.434 63.4819 105.607 64.0288 105.955C64.5796 106.299 64.855 106.848 64.855 107.602C64.855 108.113 64.7339 108.533 64.4917 108.861C64.2534 109.189 63.9351 109.387 63.5366 109.453V109.512C64.0796 109.633 64.4702 109.859 64.7085 110.191C64.9507 110.523 65.0718 110.965 65.0718 111.516C65.0718 112.297 64.7886 112.906 64.2222 113.344C63.6597 113.781 62.894 114 61.9253 114H58.7202V105.434ZM60.5366 108.826H61.5913C62.0835 108.826 62.439 108.75 62.6577 108.598C62.8804 108.445 62.9917 108.193 62.9917 107.842C62.9917 107.514 62.8706 107.279 62.6284 107.139C62.3901 106.994 62.0112 106.922 61.4917 106.922H60.5366V108.826ZM60.5366 110.268V112.5H61.7202C62.2202 112.5 62.5894 112.404 62.8276 112.213C63.0659 112.021 63.1851 111.729 63.1851 111.334C63.1851 110.623 62.6772 110.268 61.6616 110.268H60.5366Z" fill="white"/>
<path d="M40.3217 114H35.3881V105.434H40.3217V106.922H37.2045V108.803H40.1049V110.291H37.2045V112.5H40.3217V114ZM43.9311 109.465H44.5287C45.0873 109.465 45.5053 109.355 45.7827 109.137C46.06 108.914 46.1987 108.592 46.1987 108.17C46.1987 107.744 46.0815 107.43 45.8471 107.227C45.6166 107.023 45.2534 106.922 44.7573 106.922H43.9311V109.465ZM48.0327 108.105C48.0327 109.027 47.7436 109.732 47.1655 110.221C46.5912 110.709 45.7729 110.953 44.7104 110.953H43.9311V114H42.1147V105.434H44.851C45.8901 105.434 46.6791 105.658 47.2182 106.107C47.7612 106.553 48.0327 107.219 48.0327 108.105ZM56.6225 105.434V110.977C56.6225 111.609 56.4799 112.164 56.1948 112.641C55.9135 113.117 55.5053 113.482 54.9702 113.736C54.435 113.99 53.8022 114.117 53.0717 114.117C51.9702 114.117 51.1147 113.836 50.5053 113.273C49.8959 112.707 49.5912 111.934 49.5912 110.953V105.434H51.4018V110.678C51.4018 111.338 51.5346 111.822 51.8002 112.131C52.0659 112.439 52.5053 112.594 53.1186 112.594C53.7123 112.594 54.142 112.439 54.4077 112.131C54.6772 111.818 54.812 111.33 54.812 110.666V105.434H56.6225ZM58.7202 105.434H61.3862C62.601 105.434 63.4819 105.607 64.0287 105.955C64.5795 106.299 64.8549 106.848 64.8549 107.602C64.8549 108.113 64.7338 108.533 64.4916 108.861C64.2534 109.189 63.935 109.387 63.5366 109.453V109.512C64.0795 109.633 64.4702 109.859 64.7084 110.191C64.9506 110.523 65.0717 110.965 65.0717 111.516C65.0717 112.297 64.7885 112.906 64.2221 113.344C63.6596 113.781 62.894 114 61.9252 114H58.7202V105.434ZM60.5366 108.826H61.5912C62.0834 108.826 62.4389 108.75 62.6577 108.598C62.8803 108.445 62.9916 108.193 62.9916 107.842C62.9916 107.514 62.8705 107.279 62.6284 107.139C62.3901 106.994 62.0112 106.922 61.4916 106.922H60.5366V108.826ZM60.5366 110.268V112.5H61.7202C62.2202 112.5 62.5893 112.404 62.8276 112.213C63.0659 112.021 63.185 111.729 63.185 111.334C63.185 110.623 62.6772 110.268 61.6616 110.268H60.5366Z" fill="white"/>
<path d="M49 84V49C49 49 40 43 25 42V75C25 75 42 76 49 84Z" fill="white"/>
<path d="M75 75V42C60 43 51 49 51 49V84C58 76 75 75 75 75Z" fill="white"/>
<path d="M77 47V79C77 79 62 79 50 87.3C38 79 23 79 23 79V47H20V82C20 82 33 80 50 88C67 80 80 82 80 82V47H77Z" fill="white"/>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,10 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-fb2">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#B07408"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M41.8652 114H40.0781V105.434H44.9883V106.922H41.8652V109.131H44.7715V110.613H41.8652V114ZM46.6641 105.434H49.3301C50.5449 105.434 51.4258 105.607 51.9727 105.955C52.5234 106.299 52.7988 106.848 52.7988 107.602C52.7988 108.113 52.6777 108.533 52.4355 108.861C52.1973 109.189 51.8789 109.387 51.4805 109.453V109.512C52.0234 109.633 52.4141 109.859 52.6523 110.191C52.8945 110.523 53.0156 110.965 53.0156 111.516C53.0156 112.297 52.7324 112.906 52.166 113.344C51.6035 113.781 50.8379 114 49.8691 114H46.6641V105.434ZM48.4805 108.826H49.5352C50.0273 108.826 50.3828 108.75 50.6016 108.598C50.8242 108.445 50.9355 108.193 50.9355 107.842C50.9355 107.514 50.8145 107.279 50.5723 107.139C50.334 106.994 49.9551 106.922 49.4355 106.922H48.4805V108.826ZM48.4805 110.268V112.5H49.6641C50.1641 112.5 50.5332 112.404 50.7715 112.213C51.0098 112.021 51.1289 111.729 51.1289 111.334C51.1289 110.623 50.6211 110.268 49.6055 110.268H48.4805ZM60.1172 114H54.1289V112.74L56.2793 110.566C56.916 109.914 57.332 109.463 57.5273 109.213C57.7227 108.959 57.8633 108.725 57.9492 108.51C58.0352 108.295 58.0781 108.072 58.0781 107.842C58.0781 107.498 57.9824 107.242 57.791 107.074C57.6035 106.906 57.3516 106.822 57.0352 106.822C56.7031 106.822 56.3809 106.898 56.0684 107.051C55.7559 107.203 55.4297 107.42 55.0898 107.701L54.1055 106.535C54.5273 106.176 54.877 105.922 55.1543 105.773C55.4316 105.625 55.7344 105.512 56.0625 105.434C56.3906 105.352 56.7578 105.311 57.1641 105.311C57.6992 105.311 58.1719 105.408 58.582 105.604C58.9922 105.799 59.3105 106.072 59.5371 106.424C59.7637 106.775 59.877 107.178 59.877 107.631C59.877 108.025 59.8066 108.396 59.666 108.744C59.5293 109.088 59.3145 109.441 59.0215 109.805C58.7324 110.168 58.2207 110.686 57.4863 111.357L56.3848 112.395V112.477H60.1172V114Z" fill="white"/>
<path d="M49 84V49C49 49 40 43 25 42V75C25 75 42 76 49 84Z" fill="white"/>
<path d="M75 75V42C60 43 51 49 51 49V84C58 76 75 75 75 75Z" fill="white"/>
<path d="M77 47V79C77 79 62 79 50 87.3C38 79 23 79 23 79V47H20V82C20 82 33 80 50 88C67 80 80 82 80 82V47H77Z" fill="white"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -1,10 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<symbol id="svg-format-html">
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-html">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#7C9A34"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M40.9877 114H39.1771V110.303H35.7845V114H33.9681V105.434H35.7845V108.791H39.1771V105.434H40.9877V114ZM46.4603 114H44.6439V106.945H42.3177V105.434H48.7865V106.945H46.4603V114ZM53.7318 114L51.6693 107.279H51.6166C51.6908 108.646 51.7279 109.559 51.7279 110.016V114H50.1049V105.434H52.5775L54.6049 111.984H54.64L56.7904 105.434H59.2631V114H57.5697V109.945C57.5697 109.754 57.5717 109.533 57.5756 109.283C57.5834 109.033 57.6107 108.369 57.6576 107.291H57.6049L55.3959 114H53.7318ZM61.4252 114V105.434H63.2416V112.5H66.7162V114H61.4252Z" fill="white"/>
<path d="M62 53V57.8L75.5 62.5L62 67.2V72L80 64.2V60.8L62 53Z" fill="white"/>
<path d="M40 75H45.5L59.5 50H54L40 75Z" fill="white"/>
<path d="M19 64.2L37 72V67.2L23.5 62.5L37 57.8V53L19 60.8V64.2Z" fill="white"/>
</symbol>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -61,12 +61,6 @@
<rect x="3" y="10" width="14" height="1"/>
<rect x="3" y="14" width="14" height="1"/>
</symbol>
<symbol id="svg-btn-undock" viewBox="0 0 20 20">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 7H6V8V9H3V16H12V14H13V16C13 16.5523 12.5523 17 12 17H3C2.44772 17 2 16.5523 2 16V8C2 7.44769 2.44772 7 3 7Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 5H8L8 12H17V5ZM7 4C7 3.44772 7.44772 3 8 3H17C17.5523 3 18 3.44772 18 4V12C18 12.5523 17.5523 13 17 13H8C7.44771 13 7 12.5523 7 12V4Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.64645 10.6464L14.1464 6.14642L14.8536 6.85353L10.3536 11.3535L9.64645 10.6464Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 6H11V7H14L14 10H15V7V6H14Z"/>
</symbol>
<symbol id="svg-btn-align-left" viewBox="0 0 20 20">
<path d="M16 5H4V6H16V5Z"/>
<path d="M11 7H4V8H11V7Z"/>
@ -181,4 +175,7 @@
<path d="M22 3V12H6V3H5V12C5 12.6 5.4 13 6 13H22C22.6 13 23 12.6 23 12V3H22Z"/>
<path d="M6 19H22V25H23V19C23 18.4 22.6 18 22 18H6C5.4 18 5 18.4 5 19V25H6V19Z"/>
</symbol>
<symbol id="svg-icon-crypted" viewBox="0 0 20 20">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 3.00049C6.99987 4.99948 4 5.00023 4 5.00023V8.50023C4 10.5001 4.56284 15.9767 9.99961 17.0001C15.4364 15.9767 16 10.5001 16 8.50023V5.00023C16 5.00023 13.0001 4.99948 10 3.00049ZM14.0232 7.96528L12.9768 7.03517L9.42726 11.0284L6.94813 8.96247L6.05187 10.038L9.57274 12.972L14.0232 7.96528Z" fill="white"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
use {display: none}
use:target {display: inline}
</style>
<symbol id="symb-middle" viewBox="0 0 28 28">
<circle cx="14" cy="14" fill="none" stroke="#fff" stroke-width="1.5" r="10.25" stroke-dasharray="160%, 40%" />
</symbol>
<symbol id="symb-small1" viewBox="0 0 20 20">
<circle cx="10" cy="10" fill="none" stroke="#444" stroke-width="1.5" r="7.25" stroke-dasharray="160%, 40%" />
</symbol>
<use id="middle" href="#symb-middle" />
<use id="small" href="#symb-small" />
</svg>

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

View file

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View file

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View file

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

View file

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

@ -10,4 +10,9 @@
}
}
}
.toolbar__icon.toolbar__icon-big {
background-size: 56px auto;
background-size: var(--big-icon-background-image-width) auto;
}
{{/spritesheet}}

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