Merge branch 'develop' into feature/Bug_45361

# Conflicts:
#	apps/common/main/lib/component/ColorButton.js
#	apps/common/main/lib/component/Menu.js
#	apps/common/main/resources/less/header.less
#	apps/documenteditor/main/app/view/Toolbar.js
#	apps/presentationeditor/main/app/view/FileMenuPanels.js
#	apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
#	apps/spreadsheeteditor/main/app/view/FormulaWizard.js
This commit is contained in:
JuliaSvinareva 2020-09-22 16:40:22 +03:00
commit 79e931df10
3185 changed files with 45194 additions and 8111 deletions

View file

@ -14,7 +14,7 @@
type: 'desktop or mobile',
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'
@ -43,12 +43,11 @@
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
}
},
editorConfig: {
@ -69,12 +68,12 @@
user: {
id: 'user id',
name: 'user name'
name: 'user name',
group: 'group name' // for customization.reviewPermissions parameter
},
recent: [
{
title: 'document title',
image: 'recent icon url',
url: 'document url',
folder: 'path to document',
},
@ -113,6 +112,11 @@
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
},
chat: true,
comments: true,
zoom: 100,
@ -163,7 +167,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',
@ -216,6 +220,7 @@
_config.editorConfig.canRequestMailMergeRecipients = _config.events && !!_config.events.onRequestMailMergeRecipients;
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
_config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings;
_config.editorConfig.canRequestCreateNew = _config.events && !!_config.events.onRequestCreateNew;
_config.frameEditorId = placeholderId;
_config.parentOrigin = window.location.origin;
@ -333,9 +338,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 +358,16 @@
}
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
_config.document.fileType = _config.document.fileType.toLowerCase();
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott))$/
.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';
}
}
@ -735,9 +747,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 +761,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 +785,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;

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: {

View file

@ -135,7 +135,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) {
@ -322,6 +322,10 @@ if (Common === undefined) {
_postMessage({event:'onRequestSharingSettings'});
},
requestCreateNew: function () {
_postMessage({event:'onRequestCreateNew'});
},
on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)

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

@ -107,10 +107,11 @@ define([
var id = Common.UI.getId(),
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>'), clsDropdownItem: false },
{ template: _.template('<a id="' + id + '-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
])
});
return menu;

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();
@ -275,10 +276,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();
@ -308,6 +309,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;
@ -522,7 +524,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

@ -565,7 +565,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 +576,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 {

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

@ -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 : '',
@ -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,7 +124,7 @@ define([
}
// show mask after 500 ms if it wont be hided
timerId = setTimeout(function () {
me.timerId = setTimeout(function () {
ownerEl.append(maskeEl);
ownerEl.append(loaderEl);
@ -144,16 +143,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 +161,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

@ -566,7 +566,9 @@ define([
} else {
var cg = Common.Utils.croppedGeometry();
docH = cg.height - 10;
var newTop = top;
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]+)/);

View file

@ -242,6 +242,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

@ -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) {
@ -235,25 +237,35 @@ 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);
}
}
}
},
@ -289,12 +301,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 +397,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 +406,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 +440,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 +469,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

@ -52,7 +52,7 @@ define([
this.label = 'Tab';
this.cls = '';
this.index = -1;
this.template = _.template(['<li class="<% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%- label %>">',
this.template = _.template(['<li class="list-item <% 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>',
'</li>'].join(''));

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

@ -152,6 +152,7 @@ define([
alias: 'Window',
cls: '',
toolclose: 'close',
help: false,
maxwidth: undefined,
maxheight: undefined,
minwidth: 0,
@ -162,9 +163,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>' +
'<% %>' +
'<% if (help===true) %>' +
'<div class="tool help">?</div>' +
'<% %>' +
'</div>' +
'<div class="title"><%= title %></div> ' +
'</div>' +
'<% } %>' +
@ -284,7 +290,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;
@ -635,8 +641,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));
@ -693,13 +704,12 @@ define([
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
} else {
var opacity = mask.css('opacity');
mask.css('opacity', 0);
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
setTimeout(function () {
mask.css(_getTransformation(opacity));
mask.css(_getTransformation('0.2'));
}, 1);
}
@ -785,12 +795,11 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.hide();
mask.attr('counter', 0);
}
@ -803,7 +812,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 +835,11 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.hide();
mask.attr('counter', 0);
}
@ -843,7 +851,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 +959,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]);
}
}
},

View file

@ -261,6 +261,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 +277,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);
}
@ -354,6 +356,7 @@ define([
ascComment.asc_putUserName(t.currentUserName);
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 +383,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 +415,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'));
@ -434,6 +439,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 +480,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 +497,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);
}
@ -533,6 +541,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 +558,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,6 +772,7 @@ 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));
@ -783,6 +794,7 @@ 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,
@ -1217,6 +1229,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,
@ -1257,6 +1270,7 @@ 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,

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

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

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

@ -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);
});
@ -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);

View file

@ -117,6 +117,16 @@ define([
if (data) {
this.currentUserId = data.config.user.id;
if (this.appConfig && this.appConfig.canUseReviewPermissions) {
var permissions = this.appConfig.customization.reviewPermissions,
arr = [],
groups = Common.Utils.UserInfoParser.getParsedGroups(data.config.user.fullname);
groups && groups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
});
this.currentUserGroups = arr;
}
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
}
return this;
@ -183,7 +193,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 +206,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 +471,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 +479,15 @@ define([
return arr;
},
checkUserGroups: function(username) {
var groups = Common.Utils.UserInfoParser.getParsedGroups(username);
return this.currentUserGroups && groups && (_.intersection(this.currentUserGroups, (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 '';
},

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

@ -64,6 +64,7 @@ define([
lock : false,
lockuserid : '',
unattached : false,
userdata : '',
id : Common.UI.getId(), // internal
time : 0,
@ -89,6 +90,7 @@ define([
usercolor : null,
reply : '',
date : undefined,
userdata : '',
id : Common.UI.getId(), // internal
editText : false,

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: 86px;"><%= scope.textResetAll %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 86px;float: right;"><%= scope.textDelete %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 86px;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,7 +31,7 @@
</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")) { %>

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

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

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

@ -594,6 +594,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 +712,7 @@ 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);
return _user;
};
@ -748,6 +763,8 @@ Common.Utils.loadConfig = function(url, callback) {
else return 'error';
}).then(function(json){
callback(json);
}).catch(function(e) {
callback('error');
});
};
@ -945,4 +962,36 @@ Common.Utils.ModalWindow = new(function() {
return count>0;
}
}
})();
Common.Utils.UserInfoParser = new(function() {
var parse = false;
var separator = String.fromCharCode(160);
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;
}
}
})();

View file

@ -0,0 +1,803 @@
/*
*
* (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';
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-')
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>',
'<button class="btn normal dlg-btn primary can-apply hidden" result="ok" style="width: 86px;">' + this.okButtonText + '</button>',
'<button class="btn normal dlg-btn can-apply hidden" result="cancel" style="width: 86px;">' + this.cancelButtonText + '</button>',
'</div>'
].join('')
}, options || {});
this.mathStore = this.options.mathStore || new Common.UI.DataViewStore();
this.functionsStore = this.options.functionsStore || new Common.UI.DataViewStore();
this.api = this.options.api;
var path = this.appPrefix + "settings-math-correct";
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) : [];
if (this.appPrefix=='de-') {
var me = this;
this.options.handler = function(result, value) {
if ( result == 'ok' ) {
var value = me.chBulleted.getValue()==='checked';
Common.localStorage.setBool("de-settings-autoformat-bulleted", value);
Common.Utils.InternalSettings.set("de-settings-autoformat-bulleted", value);
me.api.asc_SetAutomaticBulletedLists(value);
value = me.chNumbered.getValue()==='checked';
Common.localStorage.setBool("de-settings-autoformat-numbered", value);
Common.Utils.InternalSettings.set("de-settings-autoformat-numbered", value);
me.api.asc_SetAutomaticNumberedLists(value);
value = me.chQuotes.getValue()==='checked';
Common.localStorage.setBool("de-settings-autoformat-smart-quotes", value);
Common.Utils.InternalSettings.set("de-settings-autoformat-smart-quotes", value);
me.api.asc_SetAutoCorrectSmartQuotes(value);
value = me.chHyphens.getValue()==='checked';
Common.localStorage.setBool("de-settings-autoformat-hyphens", value);
Common.Utils.InternalSettings.set("de-settings-autoformat-hyphens", value);
me.api.asc_SetAutoCorrectHyphensWithDash(value);
}
};
} else if (this.appPrefix=='sse-') {
var me = this;
this.options.handler = function(result, value) {
if ( result == 'ok' ) {
var value = me.chNewRows.getValue()==='checked';
Common.localStorage.setBool("sse-settings-autoformat-new-rows", value);
Common.Utils.InternalSettings.set("sse-settings-autoformat-new-rows", value);
me.api.asc_setIncludeNewRowColTable(value);
}
};
}
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
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(this.mathStore.slice(0, 9)),
simpleAddMode: false,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div style="min-width:110px;padding-right: 5px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
'</div>'
].join('')),
scrollAlwaysVisible: true
});
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,
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.cmpEl.find('.listview').focus();
},10);
}
});
this.inputBy = new Common.UI.InputField({
el : $window.find('#auto-correct-by'),
allowBlank : true,
validateOnChange : true,
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(this.functionsStore.slice(0, 9)),
simpleAddMode: false,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
].join('')),
scrollAlwaysVisible: true
});
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,
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.cmpEl.find('.listview').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.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")
});
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")
});
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")
});
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")
});
} 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")
});
}
this.applyButtons = $window.find('.dlg-btn.can-apply');
this.closeButtons = $window.find('.dlg-btn:not(.can-apply)');
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
this.btnsCategory[2] && this.btnsCategory[2].on('click', _.bind(this.updateFooterButtons, this, true));
this.afterRender();
},
afterRender: function() {
this.updateControls();
this.updateRecControls();
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
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);
this.updateFooterButtons(value>1);
},
close: function() {
Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments);
this.mathList && this.mathList.deselectAll();
this.mathRecList && this.mathRecList.deselectAll();
},
onMathCategoryClick: function(delay) {
this.updateFooterButtons(false);
var me = this;
_.delay(function(){
$('input', me.inputReplace.cmpEl).select().focus();
},delay ? 50 : 0);
if (me.mathList.store.length < me.mathStore.length) {
_.delay(function(){
me.mathList.setStore(me.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 {
this.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 = this.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 = this.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 = [];
this.mathStore.remove(this.mathStore.where({defaultValue: undefined}));
this.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 (this.mathStore.length>0) return;
this.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];
}
});
this.mathStore.reset(data.concat(dataAdd));
this.updateControls();
},
onInitRecList: function() {
if (this.functionsStore.length>0) return;
this.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
});
}
});
this.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 = [];
this.functionsStore.remove(this.functionsStore.where({defaultValue: false}));
this.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) {
this.updateFooterButtons(false);
var me = this;
_.delay(function(){
$('input', me.inputRecFind.cmpEl).select().focus();
},delay ? 50 : 0);
if (me.mathRecList.store.length < me.functionsStore.length) {
_.delay(function(){
me.mathRecList.setStore(me.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 {
this.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 = this.functionsStore.findWhere({value: this.inputRecFind.getValue()})
}
if (!rec) {
if (/^[A-Z]+$/i.test(this.inputRecFind.getValue())) {
rec = this.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);
},
updateFooterButtons: function(apply) {
this.applyButtons.toggleClass('hidden', !apply);
this.closeButtons.toggleClass('hidden', apply);
},
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

@ -655,7 +655,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

@ -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,34 @@ 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>' +
'<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-options"></div>' +
'</div>' +
'</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>' +
'</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>' +
'</section>';
var templateLeftBox = '<section class="logo">' +
@ -109,14 +109,14 @@ 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>' +
'</section>';
@ -128,7 +128,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 +206,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);
}
}
@ -235,44 +242,35 @@ 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']();
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');
}
$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 ( me.btnPrint ) {
@ -323,24 +321,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 +355,6 @@ define([
}
}
function onAppUndocked(c) {
var me = this;
if ( me.btnUndock ) {
c.status == 'undocked' ? me.btnUndock.hide() : me.btnUndock.show();
}
}
return {
options: {
branding: {},
@ -431,9 +404,7 @@ define([
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 +441,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,10 +457,6 @@ 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 {
@ -527,7 +488,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);
@ -655,21 +615,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 ) {
@ -727,10 +672,6 @@ define([
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,7 +682,6 @@ define([
tipSave: 'Save',
tipUndo: 'Undo',
tipRedo: 'Redo',
tipUndock: 'Undock',
textCompactView: 'Hide Toolbar',
textHideStatusBar: 'Hide Status Bar',
textHideLines: 'Hide Rulers',

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

@ -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,147 @@ 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,
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,
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 +282,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 +298,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,16 +306,14 @@ 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();
},
@ -161,43 +328,46 @@ 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);
},
_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 +384,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 +458,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

@ -104,7 +104,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 +113,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 +244,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 +349,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 +375,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 +469,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 +505,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

@ -108,7 +108,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 +116,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]);
});
@ -202,14 +202,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'
});
@ -358,36 +358,37 @@ define([
if ( config.canReview ) {
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) {
@ -583,7 +584,7 @@ define([
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
turnChanges: function(state) {
@ -771,7 +772,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 +792,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 +820,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 +828,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

@ -721,18 +721,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'},
@ -803,7 +803,7 @@ define([
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) {

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

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

View file

Before

Width:  |  Height:  |  Size: 158 B

After

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

View file

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B

View file

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

View file

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

View file

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

View file

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

View file

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

View file

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

View file

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

View file

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

View file

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View file

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

View file

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

View file

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

View file

@ -21,6 +21,7 @@
padding: 9px 2px 9px 12px;
line-height: normal;
height: auto;
white-space: normal;
}
}

View file

@ -312,7 +312,7 @@
&:not(.icon-top)
.caption:not(:empty) {
padding: 0 2px;
padding: 0 4px;
}
.icon {

View file

@ -281,9 +281,14 @@
.combo-template(60px);
top: -7px;
padding-right: 24px;
position: absolute;
.view .dataview, .dropdown-menu {
padding: 1px;
}
}
.combo-slicer-style {
.combo-textart(61px, 4px);
}

View file

@ -15,6 +15,7 @@
.ps-scrollbar-y-rail {
margin-top: 1px;
margin-bottom: 1px;
cursor: default;
}
}
@ -90,4 +91,26 @@
}
}
}
&.shifted-right {
li {
& > a {
padding-left: 28px;
}
.menu-item-icon {
margin: -3px 0 0 -24px;
}
.checked:not(.no-checkmark):before {
margin-left: -22px;
}
}
}
&.shifted-left {
li {
& > a {
padding-left: 12px;
padding-right: 12px;
}
}
}
}

View file

@ -88,6 +88,7 @@
#box-doc-name {
flex-grow: 1;
display: flex;
justify-content: center;
}
#rib-doc-name {
@ -101,19 +102,19 @@
background-color: transparent;
border: 0 none;
cursor: default;
line-height: 32px;
&:hover:not(:disabled) {
border: 1px solid @gray-dark;
background-color: rgba(255,255,255,0.2);
}
&:focus:not(:active) {
border: 1px solid @gray-dark;
cursor: text;
background-color: white;
color: @gray-deep;
}
width: 100%;
//&:hover:not(:disabled) {
// border: 1px solid @gray-dark;
// background-color: rgba(255,255,255,0.2);
//}
//
//&:focus:not(:active) {
// border: 1px solid @gray-dark;
// cursor: text;
// background-color: white;
// color: @gray-deep;
//}
}
#rib-save-status {
@ -373,21 +374,25 @@
}
}
#id-box-doc-name {
display: flex;
justify-content: center;
overflow: hidden;
}
#title-doc-name {
color: @white;
white-space: nowrap;
white-space: pre;
text-overflow: ellipsis;
overflow: hidden;
text-align: center;
font-size: 12px;
height: 100%;
width: 100%;
line-height: 28px;
background-color: transparent;
border: 0 none;
cursor: default;
}
#title-user-name {
white-space: nowrap;
white-space: pre;
text-overflow: ellipsis;
overflow: hidden;
text-align: right;
@ -402,3 +407,18 @@
flex-grow: 1;
}
}
#box-doc-name, #box-document-title {
.inner-box-icon.crypted {
width: 20px;
position: relative;
> svg {
position: absolute;
width: 20px;
height: 20px;
top: 50%;
margin-top: -10px;
}
}
}

View file

@ -22,6 +22,11 @@
border-left: solid 1px @gray-darker;
border-radius: 0 3px;
box-sizing: content-box;
.thumb-top-inner {
border-top: solid 1px #fff;
border-left: solid 1px #fff;
height: 100%;
}
}
.thumb-bottom {
@ -29,16 +34,34 @@
top: 6px;
left: 1px;
width: 10px;
height: 8px;
height: 9px;
background-color: #ffffff;
border: solid 1px @gray-darker;
border-top: none;
border-radius: 2px;
box-sizing: content-box;
.thumb-bottom-inner {
border: solid 1px #fff;
border-top: none;
height: 100%;
}
}
&.active .thumb-bottom {
border-bottom-width: 2px;
&.active {
.thumb-top {
border-top: solid 1px #000;
border-left: solid 1px #000;
}
.thumb-bottom {
border: solid 1px #000;
border-top: none;
}
}
&:hover {
.thumb-bottom {
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.32);
}
}
&.remove {
@ -58,6 +81,8 @@
background-position: 0 0;
outline: 1px solid rgba(162, 162, 162, 1);
border: 1px solid #FFFFFF;
cursor: copy;
}
}

View file

@ -41,9 +41,6 @@
cursor: pointer;
}
}
&:last-of-type {
margin-right: 20px;
}
}
&.bottom {

View file

@ -59,6 +59,12 @@
cursor: move;
.tools {
position: absolute;
right: 0;
padding-right: 6px;
}
.tool {
float: right;
width: 16px;
@ -80,6 +86,25 @@
cursor: default;
}
}
&.help {
width: 20px;
margin-right:0;
line-height: 14px;
font-size: 14px;
font-weight: bold;
color: #444;
opacity: 0.7;
&:hover {
opacity: 1;
}
&.disabled {
opacity: 0.3;
cursor: default;
}
}
}
&.resizing {

View file

@ -63,7 +63,8 @@ define([
canViewReview,
arrChangeReview = [],
dateChange = [],
_fileKey;
_fileKey,
_currentUserGroups;
return {
@ -113,6 +114,18 @@ define([
if (editor === 'DE') {
_fileKey = mode.fileKey;
}
if (mode && mode.canUseReviewPermissions) {
var permissions = mode.customization.reviewPermissions,
arr = [],
groups = Common.Utils.UserInfoParser.getParsedGroups(mode.user.fullname);
groups && groups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
});
_currentUserGroups = arr;
}
return this;
},
@ -231,7 +244,8 @@ define([
getUsersInfo: function() {
var usersArray = [];
_.each(editUsers, function(item){
var fio = item.asc_getUserName().split(' ');
var name = Common.Utils.UserInfoParser.getParsedName(item.asc_getUserName());
var fio = name.split(' ');
var initials = fio[0].substring(0, 1).toUpperCase();
if (fio.length > 1) {
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
@ -241,7 +255,7 @@ define([
color: item.asc_getColor(),
id: item.asc_getId(),
idOriginal: item.asc_getIdOriginal(),
name: item.asc_getUserName(),
name: name,
view: item.asc_getView(),
initial: initials
};
@ -300,6 +314,13 @@ define([
$('#settings-accept-all').hide();
$('#settings-reject-all').hide();
}
if (this.appConfig.canUseReviewPermissions) {
$('#settings-accept-all').hide();
$('#settings-reject-all').hide();
}
if (this.appConfig.isRestrictedEdit) {
$('#display-mode-settings').hide();
}
},
onTrackChanges: function(e) {
@ -407,6 +428,11 @@ define([
$('.accept-reject').html('<a href="#" id="btn-delete-change" class="link">' + this.textDelete + '</a>');
$('#btn-delete-change').single('click', _.bind(this.onDeleteChange, this));
}
} else {
if(arrChangeReview.length != 0 && !arrChangeReview[0].editable) {
$('#btn-accept-change').addClass('disabled');
$('#btn-reject-change').addClass('disabled');
}
}
if(displayMode == "final" || displayMode == "original") {
$('#btn-accept-change').addClass('disabled');
@ -663,9 +689,7 @@ define([
userColor = item.get_UserColor(),
goto = (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom);
date = me.dateToLocaleTimeString(date);
var editable = (item.get_UserId() == _userId);
var editable = me.appConfig.isReviewOnly && (item.get_UserId() == _userId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || me.checkUserGroups(item.get_UserName()));
arr.push({date: date, user: user, usercolor: userColor, changetext: changetext, goto: goto, editable: editable});
});
arrChangeReview = arr;
@ -677,6 +701,11 @@ define([
this.updateInfoChange();
},
checkUserGroups: function(username) {
var groups = Common.Utils.UserInfoParser.getParsedGroups(username);
return _currentUserGroups && groups && (_.intersection(_currentUserGroups, (groups.length>0) ? groups : [""]).length>0);
},
dateToLocaleTimeString: function (date) {
function format(date) {
var strTime,
@ -736,7 +765,7 @@ define([
},
getInitials: function(name) {
var fio = name.split(' ');
var fio = Common.Utils.UserInfoParser.getParsedName(name).split(' ');
var initials = fio[0].substring(0, 1).toUpperCase();
if (fio.length > 1) {
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();

View file

@ -177,7 +177,7 @@ define([
if (isAndroid) {
template += '<div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>';
}
template += '<div class="user-name">' + comment.username + '</div>' +
template += '<div class="user-name">' + me.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>';
if (isAndroid) {
template += '</div>';
@ -202,7 +202,7 @@ define([
if (isAndroid) {
template += '<div class="initials-reply" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>'
}
template += '<div class="user-name">' + reply.username + '</div>' +
template += '<div class="user-name">' + me.getUserName(reply.username) + '</div>' +
'<div class="reply-date">' + reply.date + '</div>' +
'</div>';
if (isAndroid) {
@ -249,7 +249,7 @@ define([
'<div class="item-inner">',
'<div class="header-comment"><div class="comment-left">',
'<% if (android) { %><div class="initials-comment" style="background-color:<%= item.usercolor %> "> <%= item.userInitials %></div><div><% } %>',
'<div class="user-name"><%= item.username %></div>',
'<div class="user-name"><%= scope.getUserName(item.username) %></div>',
'<div class="comment-date"><%= item.date %></div>',
'<% if (android) { %></div><% } %>',
'</div>',
@ -271,7 +271,7 @@ define([
'<div class="header-reply">',
'<div class="reply-left">',
'<% if (android) { %><div class="initials-reply" style="background-color: <%= reply.usercolor %>;"><%= reply.userInitials %></div><div><% } %>',
'<div class="user-name"><%= reply.username %></div>',
'<div class="user-name"><%= scope.getUserName(reply.username) %></div>',
'<div class="reply-date"><%= reply.date %></div>',
'</div>',
'<% if (android) { %></div><% } %>',
@ -292,7 +292,8 @@ define([
item: comment,
replys: comment.replys.length,
viewmode: me.viewmode,
quote: me.sliceQuote(comment.quote)
quote: me.sliceQuote(comment.quote),
scope: me
}));
});
$listComments.html(items.join(''));
@ -304,7 +305,7 @@ define([
var isAndroid = Framework7.prototype.device.android === true;
var template = '<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
'<div class="user-name">' + comment.username + '</div>' +
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea id="comment-text" class="comment-textarea">' + comment.comment + '</textarea></div>' +
@ -317,7 +318,7 @@ define([
var isAndroid = Framework7.prototype.device.android === true;
var template = '<div class="wrap-reply">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + color + ';">' + initials + '</div><div>' : '') +
'<div class="user-name">' + name + '</div>' +
'<div class="user-name">' + this.getUserName(name) + '</div>' +
'<div class="comment-date">' + date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea class="reply-textarea" placeholder="' + this.textAddReply + '">' + '</textarea></div>' +
@ -330,7 +331,7 @@ define([
var isAndroid = Framework7.prototype.device.android === true;
var template = '<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
'<div class="user-name">' + reply.username + '</div>' +
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
'<div class="comment-date">' + reply.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea id="comment-text" class="edit-reply-textarea">' + reply.reply + '</textarea></div>' +
@ -354,7 +355,7 @@ define([
'<div class="page-content">' +
'<div class="wrap-reply">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + color + ';">' + initial + '</div><div>' : '') +
'<div class="user-name">' + name + '</div>' +
'<div class="user-name">' + this.getUserName(name) + '</div>' +
'<div class="comment-date">' + date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea class="reply-textarea" placeholder="' + this.textAddReply + '"></textarea></div>' +
@ -401,7 +402,7 @@ define([
'<div class="page-content">' +
'<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
'<div class="user-name">' + comment.username + '</div>' +
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea id="comment-text" class="comment-textarea">' + comment.comment + '</textarea></div>' +
@ -427,7 +428,7 @@ define([
'<div class="page-content">' +
'<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
'<div class="user-name">' + reply.username + '</div>' +
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
'<div class="comment-date">' + reply.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div><textarea id="comment-text" class="edit-reply-textarea">' + reply.reply + '</textarea></div>' +
@ -442,13 +443,17 @@ define([
renderChangeReview: function(change) {
var isAndroid = Framework7.prototype.device.android === true;
var template = (isAndroid ? '<div class="header-change"><div class="initials-change" style="background-color: #' + change.color + ';">' + change.initials + '</div><div>' : '') +
'<div id="user-name">' + change.user + '</div>' +
'<div id="user-name">' + this.getUserName(change.user) + '</div>' +
'<div id="date-change">' + change.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
'<div id="text-change">' + change.text + '</div>';
$('#current-change').html(_.template(template));
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
textCollaboration: 'Collaboration',
textReviewing: 'Review',
textСomments: 'Сomments',

View file

@ -126,5 +126,5 @@ define([
new IScroll(targetSelector);
}, 500);
}
}
};
});

View file

@ -229,6 +229,9 @@ DE.ApplicationController = new(function(){
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();
if ( permissions.print === false)
$('#idt-print').hide();
if ( !embedConfig.shareUrl )
$('#idt-share').hide();
@ -276,6 +279,12 @@ DE.ApplicationController = new(function(){
Common.Analytics.trackEvent('Save');
});
DE.ApplicationView.tools.get('#idt-print')
.on('click', function(){
api.asc_Print(new Asc.asc_CDownloadOptions(null, $.browser.chrome || $.browser.safari || $.browser.opera));
Common.Analytics.trackEvent('Print');
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback) {
if (config.customization.goback.requestClose && config.canRequestClose)

View file

@ -46,6 +46,7 @@ DE.ApplicationView = new(function(){
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
'<li><a id="idt-embed" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>' + this.txtEmbed + '</a></li>' +
'<li><a id="idt-fullscreen"><span class="mi-icon svg-icon fullscr"></span>' + this.txtFullScreen + '</a></li>' +
@ -63,6 +64,7 @@ DE.ApplicationView = new(function(){
},
txtDownload: 'Download',
txtPrint: 'Print',
txtShare: 'Share',
txtEmbed: 'Embed',
txtFullScreen: 'Full Screen'

View file

@ -0,0 +1,30 @@
{
"common.view.modals.txtCopy": "Kopier",
"common.view.modals.txtEmbed": "Indlejre",
"common.view.modals.txtHeight": "Højde",
"common.view.modals.txtShare": "Del link",
"common.view.modals.txtWidth": "Bredde",
"DE.ApplicationController.convertationErrorText": "Samtale fejlede.",
"DE.ApplicationController.convertationTimeoutText": "Konverteringstidsfrist er overskredet",
"DE.ApplicationController.criticalErrorTitle": "Fejl",
"DE.ApplicationController.downloadErrorText": "Download fejlet.",
"DE.ApplicationController.downloadTextText": "Hent dokument...",
"DE.ApplicationController.errorAccessDeny": "Du forsøger at foretage en handling, som du ikke har rettighederne til.<br>venligst kontakt din Document Server administrator.",
"DE.ApplicationController.errorDefaultMessage": "Fejlkode: %1",
"DE.ApplicationController.errorFilePassProtect": "Dokumentet er beskyttet af et kodeord og kunne ikke åbnes.",
"DE.ApplicationController.errorFileSizeExceed": "Filens størrelse overgår begrænsningen, som er sat for din server.<br>Kontakt venligst til dokumentserver administrator for detaljer.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Internetforbindelsen er blevet genoprettet, og filversionen er blevet ændret.<br>Før du kan fortsætte arbejdet, skal du hente filen eller kopiere indholdet for at sikre, at intet vil blive tabt - og derefter genindlæse denne side.",
"DE.ApplicationController.errorUserDrop": "Der kan ikke opnås adgang til filen lige nu. ",
"DE.ApplicationController.notcriticalErrorTitle": "Advarsel",
"DE.ApplicationController.scriptLoadError": "Forbindelsen er for langsom, og nogle komponenter kunne ikke indlæses. Indlæs siden igen.",
"DE.ApplicationController.textLoadingDocument": "Indlæser dokument",
"DE.ApplicationController.textOf": "af",
"DE.ApplicationController.txtClose": "Luk",
"DE.ApplicationController.unknownErrorText": "Ukendt fejl.",
"DE.ApplicationController.unsupportedBrowserErrorText": "Din browser understøttes ikke.",
"DE.ApplicationController.waitText": "Vent venligst...",
"DE.ApplicationView.txtDownload": "Hent",
"DE.ApplicationView.txtEmbed": "Indlejre",
"DE.ApplicationView.txtFullScreen": "Fuld skærm",
"DE.ApplicationView.txtShare": "Del"
}

View file

@ -24,6 +24,7 @@
"DE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.",
"DE.ApplicationController.waitText": "Please, wait...",
"DE.ApplicationView.txtDownload": "Download",
"DE.ApplicationView.txtPrint": "Print",
"DE.ApplicationView.txtEmbed": "Embed",
"DE.ApplicationView.txtFullScreen": "Full Screen",
"DE.ApplicationView.txtShare": "Share"

View file

@ -1,21 +1,30 @@
{
"common.view.modals.txtCopy": "クリップボードにコピー",
"common.view.modals.txtEmbed": "埋め込み",
"common.view.modals.txtHeight": "高さ",
"common.view.modals.txtShare": "共有リンク",
"common.view.modals.txtWidth": "幅",
"DE.ApplicationController.convertationErrorText": "変換に失敗しました",
"DE.ApplicationController.convertationTimeoutText": "変換のタイムアウトを超過しました。",
"DE.ApplicationController.criticalErrorTitle": "エラー",
"DE.ApplicationController.downloadErrorText": "ダウンロードに失敗しました",
"DE.ApplicationController.downloadTextText": "ドキュメントのダウンロード中...",
"DE.ApplicationController.errorAccessDeny": "利用権限がない操作をしようとしました。<br>Documentサーバー管理者に連絡してください。",
"DE.ApplicationController.errorDefaultMessage": "エラー コード: %1",
"DE.ApplicationController.errorFilePassProtect": "ドキュメントがパスワードで保護されているため開くことができません",
"DE.ApplicationController.errorFileSizeExceed": "ファイルサイズがサーバーで設定された制限を超過しています。<br>Documentサーバー管理者に詳細を問い合わせてください。",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "インターネット接続が復旧し、ファイルのバージョンが更新されています。<br>作業を継続する前に、ファイルをダウンロードするか内容をコピーして、変更が消えてしまわないようにしてからページを再読み込みしてください。",
"DE.ApplicationController.errorUserDrop": "今、ファイルにアクセスすることはできません。",
"DE.ApplicationController.notcriticalErrorTitle": "警告",
"DE.ApplicationController.scriptLoadError": "接続が非常に遅いため、いくつかのコンポーネントはロードされませんでした。ページを再読み込みしてください。",
"DE.ApplicationController.textLoadingDocument": "ドキュメントを読み込んでいます",
"DE.ApplicationController.textOf": "から",
"DE.ApplicationController.txtClose": "閉じる",
"DE.ApplicationController.unknownErrorText": "不明なエラー",
"DE.ApplicationController.unsupportedBrowserErrorText": "お使いのブラウザがサポートされていません。",
"DE.ApplicationController.waitText": "少々お待ちください...",
"DE.ApplicationView.txtDownload": "ダウンロード",
"DE.ApplicationView.txtEmbed": "埋め込み",
"DE.ApplicationView.txtFullScreen": "全画面表示",
"DE.ApplicationView.txtShare": "シェア"
}

View file

@ -1,28 +1,30 @@
{
"common.view.modals.txtCopy": "클립보드로 복사",
"common.view.modals.txtEmbed": "퍼가기",
"common.view.modals.txtEmbed": "개체 삽입",
"common.view.modals.txtHeight": "높이",
"common.view.modals.txtShare": "링크 공유",
"common.view.modals.txtWidth": "너비",
"DE.ApplicationController.convertationErrorText": "변환 실패",
"DE.ApplicationController.convertationTimeoutText": "전환 시간 초과를 초과했습니다.",
"DE.ApplicationController.convertationErrorText": "변환 실패 ",
"DE.ApplicationController.convertationTimeoutText": "변환 시간을 초과했습니다.",
"DE.ApplicationController.criticalErrorTitle": "오류",
"DE.ApplicationController.downloadErrorText": "다운로드하지 못했습니다.",
"DE.ApplicationController.downloadTextText": "문서 다운로드 중 ...",
"DE.ApplicationController.downloadErrorText": "다운로드 실패",
"DE.ApplicationController.downloadTextText": "문서 다운로드 중...",
"DE.ApplicationController.errorAccessDeny": "권한이없는 작업을 수행하려고합니다. <br> Document Server 관리자에게 문의하십시오.",
"DE.ApplicationController.errorDefaultMessage": "오류 코드 : %1",
"DE.ApplicationController.errorDefaultMessage": "오류 코드: %1",
"DE.ApplicationController.errorFilePassProtect": "이 문서는 암호로 보호되어있어 열 수 없습니다.",
"DE.ApplicationController.errorFileSizeExceed": "파일의 크기가 서버에서 정해진 범위를 초과 했습니다. 문서 서버 관리자에게 해당 내용에 대한 자세한 안내를 받아 보시기 바랍니다.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "인터넷 연결이 복구 되었으며 파일에 수정 사항이 발생되었습니다. 작업을 계속 하시기 전에 반드시 기존의 파일을 다운로드하거나 내용을 복사해서 작업 내용을 잃어 버리는 일이 없도록 한 후에 이 페이지를 새로 고침(reload) 해 주시기 바랍니다.",
"DE.ApplicationController.errorUserDrop": "파일에 지금 액세스 할 수 없습니다.",
"DE.ApplicationController.notcriticalErrorTitle": "경고",
"DE.ApplicationController.scriptLoadError": "연결 속도가 느려, 일부 요소들이 로드되지 않았습니다. 페이지를 다시 새로 고침해주세요.",
"DE.ApplicationController.textLoadingDocument": "문서로드 중",
"DE.ApplicationController.textOf": "",
"DE.ApplicationController.txtClose": "완료",
"DE.ApplicationController.textLoadingDocument": "문서 로드 중",
"DE.ApplicationController.textOf": "",
"DE.ApplicationController.txtClose": "닫기",
"DE.ApplicationController.unknownErrorText": "알 수없는 오류.",
"DE.ApplicationController.unsupportedBrowserErrorText": "사용중인 브라우저가 지원되지 않습니다.",
"DE.ApplicationController.waitText": "잠시만 기달려주세요...",
"DE.ApplicationView.txtDownload": "다운로드",
"DE.ApplicationView.txtEmbed": "퍼가기",
"DE.ApplicationView.txtDownload": "다운로드 ",
"DE.ApplicationView.txtEmbed": "개체 삽입",
"DE.ApplicationView.txtFullScreen": "전체 화면",
"DE.ApplicationView.txtShare": "공유"
}

View file

@ -1,7 +1,10 @@
{
"common.view.modals.txtCopy": "Kopieer naar klembord",
"common.view.modals.txtEmbed": "Invoegen",
"common.view.modals.txtHeight": "Hoogte",
"common.view.modals.txtShare": "Link delen",
"common.view.modals.txtWidth": "Breedte",
"DE.ApplicationController.convertationErrorText": "Conversie is mislukt",
"DE.ApplicationController.convertationTimeoutText": "Time-out voor conversie overschreden.",
"DE.ApplicationController.criticalErrorTitle": "Fout",
"DE.ApplicationController.downloadErrorText": "Download mislukt.",
@ -9,6 +12,8 @@
"DE.ApplicationController.errorAccessDeny": "U probeert een actie uit te voeren waarvoor u geen rechten hebt.<br>Neem contact op met de beheerder van de documentserver.",
"DE.ApplicationController.errorDefaultMessage": "Foutcode: %1",
"DE.ApplicationController.errorFilePassProtect": "Het bestand is beschermd met een wachtwoord en kan niet worden geopend.",
"DE.ApplicationController.errorFileSizeExceed": "De bestandsgrootte overschrijdt de limiet die is ingesteld voor uw server. <br>Neem contact op met uw Document Server-beheerder voor details.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "De internetverbinding is hersteld en de bestandsversie is gewijzigd. <br>Voordat u verder kunt werken, moet u het bestand downloaden of de inhoud kopiëren om er zeker van te zijn dat er niets verloren gaat, en deze pagina vervolgens opnieuw laden.",
"DE.ApplicationController.errorUserDrop": "Toegang tot het bestand is op dit moment niet mogelijk.",
"DE.ApplicationController.notcriticalErrorTitle": "Waarschuwing",
"DE.ApplicationController.scriptLoadError": "De verbinding is te langzaam, sommige componenten konden niet geladen worden. Laad de pagina opnieuw.",
@ -17,7 +22,9 @@
"DE.ApplicationController.txtClose": "Sluiten",
"DE.ApplicationController.unknownErrorText": "Onbekende fout.",
"DE.ApplicationController.unsupportedBrowserErrorText": "Uw browser wordt niet ondersteund.",
"DE.ApplicationController.waitText": "Een moment geduld",
"DE.ApplicationView.txtDownload": "Downloaden",
"DE.ApplicationView.txtEmbed": "Invoegen",
"DE.ApplicationView.txtFullScreen": "Volledig scherm",
"DE.ApplicationView.txtShare": "Delen"
}

View file

@ -1,7 +1,10 @@
{
"common.view.modals.txtCopy": "Skopírovať do schránky",
"common.view.modals.txtEmbed": "Vložiť",
"common.view.modals.txtHeight": "Výška",
"common.view.modals.txtShare": "Zdieľať odkaz",
"common.view.modals.txtWidth": "Šírka",
"DE.ApplicationController.convertationErrorText": "Konverzia zlyhala.",
"DE.ApplicationController.convertationTimeoutText": "Prekročený čas konverzie.",
"DE.ApplicationController.criticalErrorTitle": "Chyba",
"DE.ApplicationController.downloadErrorText": "Sťahovanie zlyhalo.",
@ -9,8 +12,11 @@
"DE.ApplicationController.errorAccessDeny": "Pokúšate sa vykonať akciu, na ktorú nemáte práva.<br>Prosím, kontaktujte svojho správcu dokumentového servera.",
"DE.ApplicationController.errorDefaultMessage": "Kód chyby: %1",
"DE.ApplicationController.errorFilePassProtect": "Dokument je chránený heslom a nie je možné ho otvoriť.",
"DE.ApplicationController.errorFileSizeExceed": "Veľkosť súboru prekračuje limity vášho servera.<br> Kontaktujte prosím vášho správcu dokumentového servera o ďalšie podrobnosti.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Internetové spojenie bolo obnovené a verzia súboru bola zmenená.<br>Predtým, než budete pokračovať v práci, potrebujete si stiahnuť súbor alebo kópiu jeho obsahu, aby sa nič nestratilo. Potom znovu načítajte stránku.",
"DE.ApplicationController.errorUserDrop": "K súboru nie je možné práve teraz získať prístup.",
"DE.ApplicationController.notcriticalErrorTitle": "Upozornenie",
"DE.ApplicationController.scriptLoadError": "Spojenie je príliš pomalé, niektoré komponenty nemožno nahrať. Obnovte prosím stránku.",
"DE.ApplicationController.textLoadingDocument": "Načítavanie dokumentu",
"DE.ApplicationController.textOf": "z",
"DE.ApplicationController.txtClose": "Zatvoriť",
@ -18,6 +24,7 @@
"DE.ApplicationController.unsupportedBrowserErrorText": "Váš prehliadač nie je podporovaný.",
"DE.ApplicationController.waitText": "Prosím čakajte...",
"DE.ApplicationView.txtDownload": "Stiahnuť",
"DE.ApplicationView.txtEmbed": "Vložiť",
"DE.ApplicationView.txtFullScreen": "Celá obrazovka",
"DE.ApplicationView.txtShare": "Zdieľať"
}

View file

@ -1,21 +1,30 @@
{
"common.view.modals.txtCopy": "Kopiraj v odložišče",
"common.view.modals.txtEmbed": "Vdelano",
"common.view.modals.txtHeight": "Višina",
"common.view.modals.txtShare": "Deli povezavo",
"common.view.modals.txtWidth": "Širina",
"DE.ApplicationController.convertationErrorText": "Pretvorba ni uspela.",
"DE.ApplicationController.convertationErrorText": "Pogovor ni uspel.",
"DE.ApplicationController.convertationTimeoutText": "Pretvorbena prekinitev presežena.",
"DE.ApplicationController.criticalErrorTitle": "Napaka",
"DE.ApplicationController.downloadErrorText": "Prenos ni uspel.",
"DE.ApplicationController.downloadTextText": "Prenašanje dokumenta...",
"DE.ApplicationController.downloadTextText": "Prenašanje dokumenta ...",
"DE.ApplicationController.errorAccessDeny": "Poskušate izvesti dejanje, za katerega nimate pravic. <br> Obrnite se na skrbnika strežnika dokumentov.",
"DE.ApplicationController.errorDefaultMessage": "Koda napake: %1",
"DE.ApplicationController.errorFilePassProtect": "Dokument je zaščiten z geslom in ga ni mogoče odpreti.",
"DE.ApplicationController.errorFileSizeExceed": "Velikost datoteke presega omejitev, nastavljeno za vaš strežnik. <br> Za podrobnosti se obrnite na skrbnika strežnika dokumentov.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Povezava s spletom je bila obnovljena in spremenjena je različica datoteke. <br> Preden nadaljujete z delom, morate datoteko prenesti ali kopirati njeno vsebino, da se prepričate, da se nič ne izgubi, in nato znova naložite to stran.",
"DE.ApplicationController.errorUserDrop": "Do datoteke v tem trenutku ni možno dostopati.",
"DE.ApplicationController.notcriticalErrorTitle": "Opozorilo",
"DE.ApplicationController.scriptLoadError": "Povezava je počasna, nekatere komponente niso pravilno naložene.Prosimo osvežite stran.",
"DE.ApplicationController.textLoadingDocument": "Nalaganje dokumenta",
"DE.ApplicationController.textOf": "od",
"DE.ApplicationController.txtClose": "Zapri",
"DE.ApplicationController.unknownErrorText": "Neznana napaka.",
"DE.ApplicationController.unsupportedBrowserErrorText": "Vaš brskalnik ni podprt.",
"DE.ApplicationController.waitText": "Prosimo počakajte ...",
"DE.ApplicationView.txtDownload": "Prenesi",
"DE.ApplicationView.txtEmbed": "Vdelano",
"DE.ApplicationView.txtFullScreen": "Celozaslonski",
"DE.ApplicationView.txtShare": "Deli"
}

View file

@ -1,7 +1,10 @@
{
"common.view.modals.txtCopy": "Копіювати в буфер обміну",
"common.view.modals.txtEmbed": "Вставити",
"common.view.modals.txtHeight": "Висота",
"common.view.modals.txtShare": "Поділитися посиланням",
"common.view.modals.txtWidth": "Ширина",
"DE.ApplicationController.convertationErrorText": "Не вдалося поспілкуватися.",
"DE.ApplicationController.convertationTimeoutText": "Термін переходу перевищено.",
"DE.ApplicationController.criticalErrorTitle": "Помилка",
"DE.ApplicationController.downloadErrorText": "Завантаження не вдалося",
@ -9,14 +12,19 @@
"DE.ApplicationController.errorAccessDeny": "Ви намагаєтеся виконати дію, на яку у вас немає прав. <br> Будь ласка, зв'яжіться з адміністратором вашого Сервера документів.",
"DE.ApplicationController.errorDefaultMessage": "Код помилки: %1",
"DE.ApplicationController.errorFilePassProtect": "Документ захищений паролем і його неможливо відкрити.",
"DE.ApplicationController.errorFileSizeExceed": "Розмір файлу перевищує обмеження, встановлені для вашого сервера. <br> Для детальної інформації зверніться до адміністратора сервера документів.",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Підключення до Інтернету було відновлено, а версія файлу змінена. <br> Перш ніж продовжувати роботу, потрібно завантажити файл або скопіювати його вміст, щоб переконатися, що нічого не втрачено, а потім перезавантажити цю сторінку.",
"DE.ApplicationController.errorUserDrop": "На даний момент файл не доступний.",
"DE.ApplicationController.notcriticalErrorTitle": "Застереження",
"DE.ApplicationController.scriptLoadError": "З'єднання занадто повільне, деякі компоненти не вдалося завантажити. Перезавантажте сторінку.",
"DE.ApplicationController.textLoadingDocument": "Завантаження документа",
"DE.ApplicationController.textOf": "з",
"DE.ApplicationController.txtClose": "Закрити",
"DE.ApplicationController.unknownErrorText": "Невідома помилка.",
"DE.ApplicationController.unsupportedBrowserErrorText": "Ваш браузер не підтримується",
"DE.ApplicationController.waitText": "Будь ласка, зачекайте...",
"DE.ApplicationView.txtDownload": "Завантажити",
"DE.ApplicationView.txtEmbed": "Вставити",
"DE.ApplicationView.txtFullScreen": "Повноекранний режим",
"DE.ApplicationView.txtShare": "Доступ"
}

View file

@ -503,8 +503,12 @@ define([
onCreateNew: function(menu, type) {
if ( !Common.Controllers.Desktop.process('create:new') ) {
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
if (newDocumentPage) newDocumentPage.focus();
if (this.mode.canRequestCreateNew)
Common.Gateway.requestCreateNew();
else {
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
if (newDocumentPage) newDocumentPage.focus();
}
}
if (menu) {

View file

@ -46,7 +46,8 @@ define([
'documenteditor/main/app/view/HyperlinkSettingsDialog',
'documenteditor/main/app/view/TableOfContentsSettings',
'documenteditor/main/app/view/BookmarksDialog',
'documenteditor/main/app/view/CaptionDialog'
'documenteditor/main/app/view/CaptionDialog',
'documenteditor/main/app/view/NotesRemoveDialog'
], function () {
'use strict';
@ -292,33 +293,37 @@ define([
case 'ins_footnote':
this.api.asc_AddFootnote();
break;
case 'ins_endnote':
this.api.asc_AddEndnote();
break;
case 'delele':
Common.UI.warning({
msg: this.view.confirmDeleteFootnotes,
buttons: ['yes', 'no'],
primary: 'yes',
callback: _.bind(function (btn) {
if (btn == 'yes') {
this.api.asc_RemoveAllFootnotes();
(new DE.Views.NotesRemoveDialog({
handler: function (dlg, result) {
if (result=='ok') {
var settings = dlg.getSettings();
(settings.footnote || settings.endnote) && me.api.asc_RemoveAllFootnotes(settings.footnote, settings.endnote);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, this)
});
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
})).show();
break;
case 'settings':
var isEndNote = me.api.asc_IsCursorInEndnote();
(new DE.Views.NoteSettingsDialog({
api: me.api,
handler: function (result, settings) {
if (settings) {
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
settings.isEndNote ? me.api.asc_SetEndnoteProps(settings.props, settings.applyToAll) :
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
if (result == 'insert')
setTimeout(function() {
me.api.asc_AddFootnote(settings.custom);
settings.isEndNote ? me.api.asc_AddEndnote(settings.custom) : me.api.asc_AddFootnote(settings.custom);
}, 1);
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
},
props: me.api.asc_GetFootnoteProps()
isEndNote: isEndNote,
props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps()
})).show();
break;
case 'prev':
@ -333,6 +338,36 @@ define([
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
case 'prev-end':
this.api.asc_GotoEndnote(false);
setTimeout(function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
case 'next-end':
this.api.asc_GotoEndnote(true);
setTimeout(function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
case 'to-endnotes':
this.api.asc_ConvertFootnoteType(false, true, false);
setTimeout(function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
case 'to-footnotes':
this.api.asc_ConvertFootnoteType(false, false, true);
setTimeout(function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
case 'swap':
this.api.asc_ConvertFootnoteType(false, true, true);
setTimeout(function() {
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50);
break;
}
},

View file

@ -326,9 +326,11 @@ define([
}
me.defaultTitleText = '{{APP_TITLE_TEXT}}';
me.warnNoLicense = me.warnNoLicense.replace('%1', '{{COMPANY_NAME}}');
me.warnNoLicenseUsers = me.warnNoLicenseUsers.replace('%1', '{{COMPANY_NAME}}');
me.textNoLicenseTitle = me.textNoLicenseTitle.replace('%1', '{{COMPANY_NAME}}');
me.warnNoLicense = me.warnNoLicense.replace(/%1/g, '{{COMPANY_NAME}}');
me.warnNoLicenseUsers = me.warnNoLicenseUsers.replace(/%1/g, '{{COMPANY_NAME}}');
me.textNoLicenseTitle = me.textNoLicenseTitle.replace(/%1/g, '{{COMPANY_NAME}}');
me.warnLicenseExceeded = me.warnLicenseExceeded.replace(/%1/g, '{{COMPANY_NAME}}');
me.warnLicenseUsersExceeded = me.warnLicenseUsersExceeded.replace(/%1/g, '{{COMPANY_NAME}}');
},
loadConfig: function(data) {
@ -337,11 +339,12 @@ define([
this.editorConfig.user =
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, this.textAnonymous);
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
this.appOptions.canCreateNew = !_.isEmpty(this.editorConfig.createUrl);
this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl);
this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp;
this.appOptions.templates = this.editorConfig.templates;
this.appOptions.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
this.appOptions.canRequestCreateNew = this.editorConfig.canRequestCreateNew;
this.appOptions.lang = this.editorConfig.lang;
this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : '';
this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl;
@ -365,12 +368,11 @@ define([
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-сontrols");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
.setUserName(this.appOptions.user.fullname);
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '');
if (this.editorConfig.lang)
this.api.asc_setLocale(this.editorConfig.lang);
@ -769,7 +771,7 @@ define([
if ( type == Asc.c_oAscAsyncActionType.BlockInteraction &&
(!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) &&
(!this.getApplication().getController('Toolbar').dlgSymbolTable || !this.getApplication().getController('Toolbar').dlgSymbolTable.isVisible()) &&
!((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || Common.Utils.ModalWindow.isVisible() || this.inFormControl)) ) {
!((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges'] || id == Asc.c_oAscAsyncAction['DownloadAs']) && (this.dontCloseDummyComment || this.inTextareaControl || Common.Utils.ModalWindow.isVisible() || this.inFormControl)) ) {
// this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод
this.api.asc_enableKeyEvents(true);
}
@ -1053,6 +1055,8 @@ define([
Common.Utils.InternalSettings.set("de-settings-paste-button", parseInt(value));
me.api.asc_setVisiblePasteButton(!!parseInt(value));
me.loadAutoCorrectSettings();
if (me.needToUpdateVersion)
Common.NotificationCenter.trigger('api:disconnect');
var timer_sl = setInterval(function(){
@ -1202,6 +1206,7 @@ define([
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.isCrypted = this.api.asc_isCrypto();
this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false;
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review
@ -1212,7 +1217,7 @@ define([
this.appOptions.canViewReview = true;
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && (this.permissions.changeHistory !== false);
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore;
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isOffline;
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
@ -1221,7 +1226,7 @@ define([
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
this.appOptions.canRename = this.editorConfig.canRename;
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
@ -1257,6 +1262,10 @@ define([
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
this.appOptions.canRename && appHeader.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions);
@ -1279,9 +1288,6 @@ define([
this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
this.appOptions.isRestrictedEdit && this.appOptions.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
this.api.asc_LoadDocument();
if (this.permissions.changeHistory !== undefined)
console.warn("Obsolete: The changeHistory parameter of the document permission section is deprecated. Please use onRequestRestore event instead.");
},
applyModeCommonElements: function() {
@ -2237,7 +2243,7 @@ define([
});
win.$window.find('#id-equation-convert-help').on('click', function (e) {
win && win.close();
me.getApplication().getController('LeftMenu').getView('LeftMenu').showMenu('file:help', 'UsageInstructions\/InsertEquation.htm');
me.getApplication().getController('LeftMenu').getView('LeftMenu').showMenu('file:help', 'UsageInstructions\/InsertEquation.htm#convertequation');
})
},
@ -2245,10 +2251,15 @@ define([
var me = this;
var _disable_ui = function (disable) {
me.disableEditing(disable);
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
DE.getController('Navigation') && DE.getController('Navigation').SetDisabled(disable);
DE.getController('LeftMenu').setPreviewMode(disable);
var comments = DE.getController('Common.Controllers.Comments');
var app = me.getApplication();
app.getController('DocumentHolder').getView().SetDisabled(disable, true);
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
var leftMenu = app.getController('LeftMenu');
leftMenu.leftMenu.getMenu('file').getButton('protect').setDisabled(disable);
leftMenu.setPreviewMode(disable);
var comments = app.getController('Common.Controllers.Comments');
if (comments) comments.setPreviewMode(disable);
};
@ -2285,6 +2296,44 @@ define([
}
},
loadAutoCorrectSettings: function() {
// autocorrection
var me = this;
var value = Common.localStorage.getItem("de-settings-math-correct-add");
Common.Utils.InternalSettings.set("de-settings-math-correct-add", value);
var arrAdd = value ? JSON.parse(value) : [];
value = Common.localStorage.getItem("de-settings-math-correct-rem");
Common.Utils.InternalSettings.set("de-settings-math-correct-rem", value);
var arrRem = value ? JSON.parse(value) : [];
value = Common.localStorage.getBool("de-settings-math-correct-replace-type", true); // replace on type
Common.Utils.InternalSettings.set("de-settings-math-correct-replace-type", value);
me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value);
value = Common.localStorage.getItem("de-settings-rec-functions-add");
Common.Utils.InternalSettings.set("de-settings-rec-functions-add", value);
arrAdd = value ? JSON.parse(value) : [];
value = Common.localStorage.getItem("de-settings-rec-functions-rem");
Common.Utils.InternalSettings.set("de-settings-rec-functions-rem", value);
arrRem = value ? JSON.parse(value) : [];
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
value = Common.localStorage.getBool("de-settings-autoformat-bulleted", true);
Common.Utils.InternalSettings.set("de-settings-autoformat-bulleted", value);
me.api.asc_SetAutomaticBulletedLists(value);
value = Common.localStorage.getBool("de-settings-autoformat-numbered", true);
Common.Utils.InternalSettings.set("de-settings-autoformat-numbered", value);
me.api.asc_SetAutomaticNumberedLists(value);
value = Common.localStorage.getBool("de-settings-autoformat-smart-quotes", true);
Common.Utils.InternalSettings.set("de-settings-autoformat-smart-quotes", value);
me.api.asc_SetAutoCorrectSmartQuotes(value);
value = Common.localStorage.getBool("de-settings-autoformat-hyphens", true);
Common.Utils.InternalSettings.set("de-settings-autoformat-hyphens", value);
me.api.asc_SetAutoCorrectHyphensWithDash(value);
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',
@ -2373,7 +2422,7 @@ define([
textStrict: 'Strict mode',
txtErrorLoadHistory: 'Loading history failed',
textBuyNow: 'Visit website',
textNoLicenseTitle: '%1 connection limitation',
textNoLicenseTitle: 'License limit reached',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored and page is reloaded.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
@ -2424,10 +2473,10 @@ define([
txtNoTableOfContents: "There are no headings in the document. Apply a heading style to the text so that it appears in the table of contents.",
txtTableOfContents: "Table of Contents",
errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.",
warnNoLicense: 'This version of %1 editors has certain limitations for concurrent connections to the document server.<br>If you need more please consider purchasing a commercial license.',
warnNoLicenseUsers: 'This version of %1 editors has certain limitations for concurrent users.<br>If you need more please consider purchasing a commercial license.',
warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.<br>Please contact your administrator for more information.',
warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.<br>Please contact your administrator for more information.',
warnNoLicense: "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
warnNoLicenseUsers: "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
warnLicenseExceeded: "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact your administrator to learn more.",
warnLicenseUsersExceeded: "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.',
textClose: 'Close',
textPaidFeature: 'Paid feature',

View file

@ -310,7 +310,7 @@ define([
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnDropCap.menu.on('item:click', _.bind(this.onDropCapSelect, this));
toolbar.btnContentControls.menu.on('item:click', _.bind(this.onControlsSelect, this));
toolbar.mnuDropCapAdvanced.on('click', _.bind(this.onDropCapAdvancedClick, this));
toolbar.mnuDropCapAdvanced.on('click', _.bind(this.onDropCapAdvancedClick, this, false));
toolbar.btnColumns.menu.on('item:click', _.bind(this.onColumnsSelect, this));
toolbar.btnPageOrient.menu.on('item:click', _.bind(this.onPageOrientSelect, this));
toolbar.btnPageMargins.menu.on('item:click', _.bind(this.onPageMarginsSelect, this));
@ -341,6 +341,8 @@ define([
$('#id-save-style-plus, #id-save-style-link', toolbar.$el).on('click', this.onMenuSaveStyle.bind(this));
this.onSetupCopyStyleButton();
this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled());
this.onBtnChangeState('redo:disabled', toolbar.btnRedo, toolbar.btnRedo.isDisabled());
},
setApi: function(api) {
@ -392,6 +394,7 @@ define([
this.api.asc_registerCallback('asc_onTableEraseModeChanged', _.bind(this.onTableErase, this));
Common.NotificationCenter.on('storage:image-load', _.bind(this.openImageFromStorage, this));
Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this));
Common.NotificationCenter.on('dropcap:settings', _.bind(this.onDropCapAdvancedClick, this));
} else if (this.mode.isRestrictedEdit) {
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObjectRestrictedEdit, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
@ -783,10 +786,10 @@ define([
toolbar.btnContentControls.setDisabled(paragraph_locked || header_locked);
if (!(paragraph_locked || header_locked)) {
var control_disable = control_plain || content_locked;
for (var i=0; i<7; i++)
for (var i=0; i<14; i++)
toolbar.btnContentControls.menu.items[i].setDisabled(control_disable);
toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
toolbar.btnContentControls.menu.items[10].setDisabled(!in_control);
toolbar.btnContentControls.menu.items[15].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
toolbar.btnContentControls.menu.items[17].setDisabled(!in_control);
}
var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock;
@ -829,12 +832,12 @@ define([
need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled() || control_plain;
toolbar.mnuInsertPageNum.setDisabled(need_disable);
var in_footnote = this.api.asc_IsCursorInFootnote();
need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || in_footnote || in_control || rich_edit_lock || plain_edit_lock || rich_del_lock;
var in_footnote = this.api.asc_IsCursorInFootnote() || this.api.asc_IsCursorInEndnote();
need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || in_footnote || in_control || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock;
toolbar.btnsPageBreak.setDisabled(need_disable);
toolbar.btnBlankPage.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_equation || control_plain || content_locked;
need_disable = paragraph_locked || header_locked || in_equation || control_plain || content_locked || in_footnote;
toolbar.btnInsertShape.setDisabled(need_disable);
toolbar.btnInsertText.setDisabled(need_disable);
@ -1740,11 +1743,11 @@ define([
this._state.dropcap = v;
},
onDropCapAdvancedClick: function() {
onDropCapAdvancedClick: function(isFrame) {
var win, props, text,
me = this;
if (_.isUndefined(me.fontstore)) {
if (!isFrame && _.isUndefined(me.fontstore)) {
me.fontstore = new Common.Collections.Fonts();
var fonts = me.toolbar.cmbFontName.store.toJSON();
var arr = [];
@ -1774,16 +1777,18 @@ define([
(new DE.Views.DropcapSettingsAdvanced({
tableStylerRows: 2,
tableStylerColumns: 1,
fontStore: me.fontstore,
fontStore: !isFrame ? me.fontstore : null,
paragraphProps: props,
borderProps: me.borderAdvancedProps,
api: me.api,
isFrame: false,
isFrame: !!isFrame,
handler: function(result, value) {
if (result == 'ok') {
me.borderAdvancedProps = value.borderProps;
if (value.paragraphProps && value.paragraphProps.get_DropCap() === Asc.c_oAscDropCap.None) {
me.api.removeDropcap(true);
if (value.paragraphProps &&
( !isFrame && value.paragraphProps.get_DropCap() === Asc.c_oAscDropCap.None ||
isFrame && value.paragraphProps.get_Wrap() === c_oAscFrameWrap.None)) {
me.api.removeDropcap(!isFrame);
} else
me.api.put_FramePr(value.paragraphProps);
}
@ -1826,16 +1831,29 @@ define([
}
}
} else {
var isnew = (item.value.indexOf('new-')==0),
oPr, oFormPr;
if (isnew) {
oFormPr = new AscCommon.CSdtFormPr();
}
if (item.value == 'plain' || item.value == 'rich')
this.api.asc_AddContentControl((item.value=='plain') ? Asc.c_oAscSdtLevelType.Inline : Asc.c_oAscSdtLevelType.Block);
else if (item.value == 'picture')
this.api.asc_AddContentControlPicture();
else if (item.value == 'checkbox')
this.api.asc_AddContentControlCheckBox();
else if (item.value == 'date')
else if (item.value.indexOf('picture')>=0)
this.api.asc_AddContentControlPicture(oFormPr);
else if (item.value.indexOf('checkbox')>=0 || item.value.indexOf('radiobox')>=0) {
if (isnew) {
oPr = new AscCommon.CSdtCheckBoxPr();
(item.value.indexOf('radiobox')>=0) && oPr.put_GroupKey('Group 1');
}
this.api.asc_AddContentControlCheckBox(oPr, oFormPr);
} else if (item.value == 'date')
this.api.asc_AddContentControlDatePicker();
else if (item.value == 'combobox' || item.value == 'dropdown')
this.api.asc_AddContentControlList(item.value == 'combobox');
else if (item.value.indexOf('combobox')>=0 || item.value.indexOf('dropdown')>=0)
this.api.asc_AddContentControlList(item.value.indexOf('combobox')>=0, oPr, oFormPr);
else if (item.value == 'new-field') {
oPr = new AscCommon.CSdtTextFormPr();
this.api.asc_AddContentControlTextForm(oPr, oFormPr);
}
Common.component.Analytics.trackEvent('ToolBar', 'Add Content Control');
}
@ -2583,14 +2601,14 @@ define([
buttons: [{value: 'ok', caption: this.textInsert}, 'close'],
handler: function(dlg, result, settings) {
if (result == 'ok') {
me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code);
me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special);
} else
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
me.dlgSymbolTable.show();
me.dlgSymbolTable.on('symbol:dblclick', function(cmp, result, settings) {
me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code);
me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special);
});
}
},
@ -3420,4 +3438,4 @@ define([
textInsert: 'Insert'
}, DE.Controllers.Toolbar || {}));
});
});

View file

@ -148,4 +148,70 @@
</tr>
</table>
</div>
</div>
</div>
<div id="id-adv-control-settings-additional" class="settings-panel">
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr class="group-key">
<td class="padding-small">
<label class="input-label"><%= scope.textGroupKey %></label>
<div id="control-settings-txt-groupkey"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<label class="input-label"><%= scope.textKey %></label>
<div id="control-settings-txt-key"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<label class="input-label"><%= scope.textLabel %></label>
<div id="control-settings-txt-label"></div>
</td>
</tr>
<tr>
<td class="padding-large">
<label class="input-label"><%= scope.textHelp %></label>
<textarea id="control-settings-txt-help" class="form-control" style="width: 100%; height: 90px;"></textarea>
</td>
</tr>
<tr>
<td class="padding-large">
<div id="control-settings-chb-required"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-control-settings-field" class="settings-panel">
<div class="inner-content">
<table cols="2" style="width: auto;">
<tr>
<td class="padding-small" colspan="2">
<div id="control-settings-chb-max-chars" style="display: inline-block;margin-right: 10px;"></div>
<div id="control-settings-spin-max-chars" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan="2">
<div id="control-settings-chb-comb"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<label class="input-label" style="margin-right: 10px;"><%= scope.textPlaceholderSymbol %></label>
</td>
<td class="padding-small">
<button type="button" class="btn btn-text-default" id="control-settings-btn-placeholder-edit" style="width:53px"></button>
</td>
</tr>
<tr>
<td class="padding-small" colspan="2">
<label class="input-label" style="margin-right: 10px;"><%= scope.textWidth %></label>
<div id="control-settings-spin-width" style=""></div>
</td>
</tr>
</table>
</div>
</div>

View file

@ -12,41 +12,41 @@
</div>
<div><label class="header" style="padding-bottom: 4px;"><%= scope.strIndent %></label></div>
<div>
<div class="padding-large" style="display: inline-block;">
<label class="input-label"><%= scope.strIndentsLeftText %></label>
<div class="padding-large" style="display: inline-block;margin-right: 3px;">
<label class="input-label"><%= scope.strIndentsLeftText %></label>
<div id="paragraphadv-spin-indent-left"></div>
</div>
<div class="padding-large" style="display: inline-block;">
</div><!--
--><div class="padding-large" style="display: inline-block;margin-right: 3px;">
<label class="input-label"><%= scope.strIndentsRightText %></label>
<div id="paragraphadv-spin-indent-right"></div>
</div>
<div class="padding-large" style="display: inline-block;">
</div><!--
--><div class="padding-large" style="display: inline-block;">
<div>
<label class="input-label"><%= scope.strIndentsSpecial %></label>
</div>
<div>
<div id="paragraphadv-spin-special" style="display: inline-block;"></div>
<div id="paragraphadv-spin-special-by" style="display: inline-block;"></div>
<div>
<div id="paragraphadv-spin-special" style="display: inline-block; margin-right: 3px;"></div><!--
--><div id="paragraphadv-spin-special-by" style="display: inline-block;"></div>
</div>
</div>
</div>
<div><label class="header" style="padding-bottom: 4px;"><%= scope.strSpacing %></label></div>
<div>
<div style="display: inline-block;">
<div style="display: inline-block;margin-right: 3px;">
<label class="input-label"><%= scope.strIndentsSpacingBefore %></label>
<div id="paragraphadv-spin-spacing-before"></div>
</div>
<div style="display: inline-block;">
</div><!--
--><div style="display: inline-block;margin-right: 3px;">
<label class="input-label"><%= scope.strIndentsSpacingAfter %></label>
<div id="paragraphadv-spin-spacing-after"></div>
</div>
<div style="display: inline-block;">
</div><!--
--><div style="display: inline-block;">
<div>
<label class="input-label"><%= scope.strIndentsLineSpacing %></label>
</div>
<div>
<div id="paragraphadv-spin-line-rule" style="display: inline-block;"></div>
<div id="paragraphadv-spin-line-height" style="display: inline-block;"></div>
<div id="paragraphadv-spin-line-rule" style="display: inline-block;margin-right: 3px;"></div><!--
--><div id="paragraphadv-spin-line-height" style="display: inline-block;"></div>
</div>
</div>
</div>

View file

@ -52,21 +52,50 @@
</div>
</div>
<div id="shape-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;">
<div style="display: inline-block;">
<label class="input-label" style=""><%= scope.textStyle %></label>
<div id="shape-combo-grad-type" style="width: 90px;"></div>
</div>
<div style="display: inline-block;float: right;">
<label class="input-label" style=""><%= scope.textDirection %></label>
<div id="shape-button-direction" style=""></div>
</div>
</div>
<label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<table cols="3" style="margin-bottom: 10px;">
<tr valign="top">
<td colspan="2">
<div>
<label class="input-label" style=""><%= scope.textStyle %></label>
<div id="shape-combo-grad-type" style="width: 100%;"></div>
</div>
</td>
<td rowspan="2" style="width: 100%;">
<div style="float: right;">
<label class="input-label"><%= scope.textDirection %></label>
<div id="shape-button-direction"></div>
</div>
</td>
</tr>
<tr valign="bottom">
<td>
<label class="input-label" style="margin-right: 5px;margin-bottom: 3px;"><%= scope.textAngle %></label>
</td>
<td>
<div id="shape-spin-gradient-angle" style="display: inline-block; width: 60px;"></div>
</td>
</tr>
</table>
<label class="input-label" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block; margin-top: 3px;">
<div id="shape-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div>
<div id="shape-gradient-color-btn" style="display: inline-block;float: right;"></div>
<div style="height: 40px;margin-top:6px;display:flex;justify-content:space-between;">
<div style="display: flex;">
<div style="">
<label class="input-label" style=""><%= scope.strColor %></label>
<div id="shape-gradient-color-btn"></div>
</div>
<div style="margin-left: 10px;">
<label class="input-label" style=""><%= scope.textPosition %></label>
<div id="shape-gradient-position"></div>
</div>
</div>
<div style="display:flex;padding-top:15px;">
<div id="shape-gradient-add-step"></div>
<div id="shape-gradient-remove-step"></div>
</div>
</div>
</div>
</td>
</tr>

View file

@ -30,21 +30,50 @@
<div id="textart-back-color-btn" style=""></div>
</div>
<div id="textart-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;">
<div style="display: inline-block;">
<label class="input-label" style=""><%= scope.textStyle %></label>
<div id="textart-combo-grad-type" style="width: 90px;"></div>
</div>
<div style="display: inline-block;float: right;">
<label class="input-label" style=""><%= scope.textDirection %></label>
<div id="textart-button-direction" style=""></div>
</div>
</div>
<label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<table cols="3" style="margin-bottom: 10px;">
<tr valign="top">
<td colspan="2">
<div>
<label class="input-label" style=""><%= scope.textStyle %></label>
<div id="textart-combo-grad-type" style="width: 100%;"></div>
</div>
</td>
<td rowspan="2" style="width: 100%;">
<div style="float: right;">
<label class="input-label"><%= scope.textDirection %></label>
<div id="textart-button-direction"></div>
</div>
</td>
</tr>
<tr valign="bottom">
<td>
<label class="input-label" style="margin-right: 5px;margin-bottom: 3px;"><%= scope.textAngle %></label>
</td>
<td>
<div id="textart-spin-gradient-angle" style="display: inline-block; width: 60px;"></div>
</td>
</tr>
</table>
<label class="input-label" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block; margin-top: 3px;">
<div id="textart-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div>
<div id="textart-gradient-color-btn" style="display: inline-block;float: right;"></div>
<div style="height: 40px;margin-top:6px;display:flex;justify-content:space-between;">
<div style="display: flex;">
<div style="">
<label class="input-label" style=""><%= scope.strColor %></label>
<div id="textart-gradient-color-btn"></div>
</div>
<div style="margin-left: 10px;">
<label class="input-label" style=""><%= scope.textPosition %></label>
<div id="textart-gradient-position"></div>
</div>
</div>
<div style="display:flex;padding-top:15px;">
<div id="textart-gradient-add-step"></div>
<div id="textart-gradient-remove-step"></div>
</div>
</div>
</div>
</td>
</tr>

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