Merge branch 'develop' into feature/sse-views
|
@ -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,8 +43,6 @@
|
|||
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
|
||||
|
@ -70,7 +68,8 @@
|
|||
|
||||
user: {
|
||||
id: 'user id',
|
||||
name: 'user name'
|
||||
name: 'user name',
|
||||
group: 'group name' // for customization.reviewPermissions parameter
|
||||
},
|
||||
recent: [
|
||||
{
|
||||
|
@ -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',
|
||||
|
@ -334,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) {
|
||||
|
@ -348,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';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -736,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()];
|
||||
|
@ -747,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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
type: urlParams['type'],
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
documentType: urlParams['doctype'] || 'text',
|
||||
documentType: urlParams['doctype'] || 'word',
|
||||
document: doc,
|
||||
editorConfig: cfg,
|
||||
events: {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>';
|
||||
|
|
|
@ -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 |
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>') },
|
||||
{ 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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -149,7 +149,7 @@ define([
|
|||
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();
|
||||
|
|
|
@ -573,7 +573,7 @@ define([
|
|||
} else {
|
||||
var cg = Common.Utils.croppedGeometry();
|
||||
docH = cg.height - 10;
|
||||
if (top + menuH > docH) {
|
||||
if (top + menuH > docH + cg.top) {
|
||||
if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height
|
||||
m = fixedAlign.match(/^([a-z]+)-([a-z]+)/);
|
||||
top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1] + (fixedOffset || 0);
|
||||
|
|
|
@ -238,6 +238,16 @@ define([
|
|||
this.cmpEl.find('a').contents().last()[0].textContent = (noencoding) ? caption : Common.Utils.String.htmlEncode(caption);
|
||||
},
|
||||
|
||||
setIconCls: function(iconCls) {
|
||||
if (this.rendered && !_.isEmpty(this.iconCls)) {
|
||||
var firstChild = this.cmpEl.children(':first');
|
||||
if (firstChild) {
|
||||
firstChild.find('.menu-item-icon').removeClass(this.iconCls).addClass(iconCls);
|
||||
}
|
||||
}
|
||||
this.iconCls = iconCls;
|
||||
},
|
||||
|
||||
setChecked: function(check, suppressEvent) {
|
||||
this.toggle(check, suppressEvent);
|
||||
},
|
||||
|
|
|
@ -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) {
|
||||
|
@ -237,25 +239,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -291,12 +303,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]);
|
||||
}
|
||||
},
|
||||
|
@ -393,7 +399,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;
|
||||
}
|
||||
|
@ -401,7 +408,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
|
||||
|
@ -435,7 +442,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -464,8 +471,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();
|
||||
}
|
||||
}
|
||||
};
|
||||
}()));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(
|
||||
|
@ -351,10 +364,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 +386,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 +555,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 +641,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;
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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 : {
|
||||
|
|
|
@ -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 : {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 '';
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
91
apps/common/main/lib/template/AutoCorrectDialog.template
Normal 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>
|
|
@ -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")) { %>
|
||||
|
|
|
@ -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>
|
||||
<% } %>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -712,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;
|
||||
};
|
||||
|
||||
|
@ -959,4 +960,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;
|
||||
}
|
||||
}
|
||||
})();
|
|
@ -40,79 +40,141 @@
|
|||
*/
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
define([
|
||||
define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||
'common/main/lib/component/ListView',
|
||||
'common/main/lib/component/Window'
|
||||
], function () { 'use strict';
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/CheckBox'
|
||||
], function (contentTemplate) { 'use strict';
|
||||
|
||||
Common.Views.AutoCorrectDialog = Common.UI.Window.extend(_.extend({
|
||||
Common.Views.AutoCorrectDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||
options: {
|
||||
width: 448,
|
||||
cls: 'modal-dlg',
|
||||
buttons: null
|
||||
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
|
||||
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.template = [
|
||||
'<div class="box">',
|
||||
'<div id="symbol-table-pnl-special">',
|
||||
'<table cols="1" style="width: 100%;">',
|
||||
'<tr>',
|
||||
'<td style="padding-bottom: 8px;">',
|
||||
'<label style="font-weight: bold;">' + this.textMathCorrect + '</label>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td>',
|
||||
'<label style="width: 117px;">' + this.textReplace + '</label>',
|
||||
'<label>' + this.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: 299px;display: inline-block;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td>',
|
||||
'<div id="auto-correct-math-list" class="" style="width:100%; height: 254px;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'<div class="footer center">',
|
||||
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>',
|
||||
'</div>'
|
||||
].join('');
|
||||
this.mathStore = this.options.mathStore || new Common.UI.DataViewStore();
|
||||
this.functionsStore = this.options.functionsStore || new Common.UI.DataViewStore();
|
||||
this.api = this.options.api;
|
||||
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
this.props = this.options.props || [];
|
||||
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) : [];
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
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.UI.Window.prototype.render.call(this);
|
||||
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||
|
||||
var $window = this.getChild();
|
||||
var me = this;
|
||||
|
||||
// special
|
||||
// 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.props),
|
||||
simpleAddMode: true,
|
||||
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;"><%= replaced %></div>',
|
||||
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;"><%= by %></div>',
|
||||
'<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
|
||||
|
@ -125,22 +187,24 @@ define([
|
|||
validateOnChange : true,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
var _selectedItem;
|
||||
if (value.length) {
|
||||
var store = me.mathList.store;
|
||||
var _selectedItem = store.find(function(item) {
|
||||
_selectedItem = store.find(function(item) {
|
||||
if ( item.get('replaced').indexOf(value) == 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (_selectedItem) {
|
||||
me.mathList.selectRecord(_selectedItem, true);
|
||||
me.mathList.scrollToRecord(_selectedItem);
|
||||
} else {
|
||||
me.mathList.deselectAll();
|
||||
me.mathList.scrollToRecord(_selectedItem, true);
|
||||
if (_selectedItem.get('replaced') == value)
|
||||
me.mathList.selectRecord(_selectedItem, true);
|
||||
else
|
||||
_selectedItem = null;
|
||||
}
|
||||
} else {
|
||||
me.mathList.deselectAll();
|
||||
}
|
||||
(!_selectedItem) && me.mathList.deselectAll();
|
||||
me.updateControls(_selectedItem);
|
||||
});
|
||||
|
||||
this.inputReplace.cmpEl.find('input').on('keydown', function(event){
|
||||
|
@ -162,38 +226,578 @@ define([
|
|||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
me.updateControls();
|
||||
});
|
||||
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
|
||||
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
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) {
|
||||
this.inputReplace.setValue(record.get('replaced'));
|
||||
this.inputBy.setValue(record.get('by'));
|
||||
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.UI.Window.prototype.show.apply(this, arguments);
|
||||
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();
|
||||
},100);
|
||||
},delay ? 50 : 0);
|
||||
|
||||
if (me.mathList.store.length < me.mathStore.length) {
|
||||
_.delay(function(){
|
||||
me.mathList.setStore(me.mathStore);
|
||||
me.mathList.onResetItems();
|
||||
},delay ? 100 : 10);
|
||||
}
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this.close();
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
return true;
|
||||
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:'
|
||||
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 || {}))
|
||||
});
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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">+</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">+</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 ) {
|
||||
|
@ -729,10 +674,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.',
|
||||
|
@ -743,7 +684,6 @@ define([
|
|||
tipSave: 'Save',
|
||||
tipUndo: 'Undo',
|
||||
tipRedo: 'Redo',
|
||||
tipUndock: 'Undock',
|
||||
textCompactView: 'Hide Toolbar',
|
||||
textHideStatusBar: 'Hide Status Bar',
|
||||
textHideLines: 'Hide Rulers',
|
||||
|
|
|
@ -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>',
|
||||
|
|
|
@ -159,7 +159,7 @@ define([
|
|||
data : [
|
||||
{ displayValue: this.txtNone, value: -1 },
|
||||
{ displayValue: 'A, B, C,...', value: 4 },
|
||||
{ displayValue: 'a), b), c),...', value: 6 },
|
||||
{ displayValue: 'a), b), c),...', value: 5 },
|
||||
{ displayValue: 'a, b, c,...', value: 6 },
|
||||
{ displayValue: '1, 2, 3,...', value: 1 },
|
||||
{ displayValue: '1), 2), 3),...', value: 2 },
|
||||
|
@ -225,49 +225,48 @@ define([
|
|||
this.cmbBulletFormat.selectRecord(rec);
|
||||
this.bulletProps = {symbol: rec.get('symbol'), font: rec.get('font')};
|
||||
this.cmbBulletFormat.on('selected', _.bind(function (combo, record) {
|
||||
if (this._changedProps) {
|
||||
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);
|
||||
}
|
||||
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) {
|
||||
}
|
||||
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);
|
||||
}
|
||||
} 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));
|
||||
|
|
|
@ -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]);
|
||||
});
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 |
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
BIN
apps/common/main/resources/img/toolbar/1.25x/btn-cut.png
Normal file
After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-cut.png
Normal file
After Width: | Height: | Size: 528 B |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
After Width: | Height: | Size: 479 B |
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
BIN
apps/common/main/resources/img/toolbar/1.75x/btn-cut.png
Normal file
After Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
BIN
apps/common/main/resources/img/toolbar/1x/btn-cut.png
Normal file
After Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
BIN
apps/common/main/resources/img/toolbar/2x/btn-cut.png
Normal file
After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
|
@ -21,6 +21,7 @@
|
|||
padding: 9px 2px 9px 12px;
|
||||
line-height: normal;
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@
|
|||
|
||||
&:not(.icon-top)
|
||||
.caption:not(:empty) {
|
||||
padding: 0 5px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
|
|
@ -281,6 +281,7 @@
|
|||
.combo-template(60px);
|
||||
|
||||
top: -7px;
|
||||
padding-right: 24px;
|
||||
position: absolute;
|
||||
|
||||
.view .dataview, .dropdown-menu {
|
||||
|
|
|
@ -84,4 +84,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,20 +374,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
#id-box-doc-name {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#title-doc-name {
|
||||
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;
|
||||
|
@ -401,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
&:last-of-type {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
&.bottom {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -126,5 +126,5 @@ define([
|
|||
new IScroll(targetSelector);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
30
apps/documenteditor/embed/locale/da.json
Normal 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"
|
||||
}
|
|
@ -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"
|
||||
|
|
|
@ -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": "シェア"
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Skopírovať do schránky",
|
||||
"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 +11,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ť",
|
||||
|
|
|
@ -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"
|
||||
}
|
|
@ -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": "Завантаження не вдалося",
|
||||
|
@ -16,7 +19,9 @@
|
|||
"DE.ApplicationController.txtClose": "Закрити",
|
||||
"DE.ApplicationController.unknownErrorText": "Невідома помилка.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Ваш браузер не підтримується",
|
||||
"DE.ApplicationController.waitText": "Будь ласка, зачекайте...",
|
||||
"DE.ApplicationView.txtDownload": "Завантажити",
|
||||
"DE.ApplicationView.txtEmbed": "Вставити",
|
||||
"DE.ApplicationView.txtFullScreen": "Повноекранний режим",
|
||||
"DE.ApplicationView.txtShare": "Доступ"
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
@ -366,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);
|
||||
|
@ -770,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);
|
||||
}
|
||||
|
@ -1054,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(){
|
||||
|
@ -1203,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
|
||||
|
@ -1213,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');
|
||||
|
@ -1222,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;
|
||||
|
@ -1258,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);
|
||||
|
@ -1280,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() {
|
||||
|
@ -2238,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');
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -2246,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);
|
||||
};
|
||||
|
||||
|
@ -2286,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',
|
||||
|
@ -2374,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.',
|
||||
|
@ -2425,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',
|
||||
|
|
|
@ -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) {
|
||||
|
@ -829,12 +831,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);
|
||||
|
||||
|
@ -2593,14 +2595,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);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -3430,4 +3432,4 @@ define([
|
|||
textInsert: 'Insert'
|
||||
|
||||
}, DE.Controllers.Toolbar || {}));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -132,7 +132,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
|
|||
additionalItems: [{
|
||||
id: 'control-settings-system-color',
|
||||
caption: this.textSystemColor,
|
||||
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 -7px; background-color: #dcdcdc;"></span><%= caption %></a>')
|
||||
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #dcdcdc;"></span><%= caption %></a>')
|
||||
},
|
||||
{caption: '--'}],
|
||||
additionalAlign: this.menuAddAlign,
|
||||
|
|
|
@ -99,6 +99,8 @@ define([
|
|||
this.spnColumns.on('change', function(field, newValue, oldValue, eOpts){
|
||||
var space = Common.Utils.Metric.fnRecalcToMM(me.spnSpacing.getNumberValue()),
|
||||
num = me.spnColumns.getNumberValue();
|
||||
me.chSeparator.setDisabled(num<2);
|
||||
me.spnSpacing.setDisabled(num<2);
|
||||
(num<2) && (num = 2);
|
||||
var maxspace = parseFloat(((me.totalWidth-num*12.7)/(num-1)).toFixed(1));
|
||||
me.spnSpacing.setMaxValue(Common.Utils.Metric.fnRecalcFromMM(maxspace));
|
||||
|
@ -158,6 +160,8 @@ define([
|
|||
maxcols = parseInt((total+minspace)/(12.7+minspace));
|
||||
this.spnColumns.setMaxValue(maxcols);
|
||||
this.spnColumns.setValue(num, true);
|
||||
this.chSeparator.setDisabled(num<2);
|
||||
this.spnSpacing.setDisabled(num<2);
|
||||
|
||||
(num<2) && (num = 2);
|
||||
(num>maxcols) && (num = maxcols);
|
||||
|
|
|
@ -359,7 +359,7 @@ define([
|
|||
if (usersStore){
|
||||
var rec = usersStore.findUser(id);
|
||||
if (rec)
|
||||
return rec.get('username');
|
||||
return Common.Utils.UserInfoParser.getParsedName(rec.get('username'));
|
||||
}
|
||||
return me.guestText;
|
||||
};
|
||||
|
@ -883,6 +883,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1053,6 +1054,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1080,6 +1082,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1099,6 +1102,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1128,6 +1132,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1180,6 +1185,7 @@ define([
|
|||
equation : true,
|
||||
disabled : me._currentParaObjDisabled,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -1986,11 +1992,13 @@ define([
|
|||
var me = this;
|
||||
|
||||
var menuViewCopy = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-copy',
|
||||
caption: me.textCopy,
|
||||
value: 'copy'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuViewUndo = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-undo',
|
||||
caption: me.textUndo
|
||||
}).on('click', function () {
|
||||
me.api.Undo();
|
||||
|
@ -2001,6 +2009,7 @@ define([
|
|||
});
|
||||
|
||||
var menuViewAddComment = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-menu-comments',
|
||||
caption: me.addCommentText
|
||||
}).on('click', _.bind(me.addComment, me));
|
||||
|
||||
|
@ -2011,10 +2020,12 @@ define([
|
|||
var menuViewSignSeparator = new Common.UI.MenuItem({caption: '--' });
|
||||
|
||||
var menuViewPrint = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-print',
|
||||
caption : me.txtPrintSelection
|
||||
}).on('click', _.bind(me.onPrintSelection, me));
|
||||
|
||||
this.viewModeMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function (value) {
|
||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
|
||||
isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties())),
|
||||
|
@ -2118,7 +2129,7 @@ define([
|
|||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
return new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
|
@ -2204,7 +2215,7 @@ define([
|
|||
}
|
||||
|
||||
return new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
|
@ -2246,6 +2257,7 @@ define([
|
|||
});
|
||||
|
||||
this.menuImageWrap = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon wrap-inline',
|
||||
caption : me.textWrap,
|
||||
menu : (function(){
|
||||
function onItemClick(item, e) {
|
||||
|
@ -2272,7 +2284,7 @@ define([
|
|||
}
|
||||
|
||||
return new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
|
@ -2339,6 +2351,7 @@ define([
|
|||
});
|
||||
|
||||
var menuImageAdvanced = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-menu-image',
|
||||
caption : me.advancedText
|
||||
}).on('click', function(item, e) {
|
||||
var elType, elValue;
|
||||
|
@ -2405,6 +2418,7 @@ define([
|
|||
var menuImgReplace = new Common.UI.MenuItem({
|
||||
caption : me.textReplace,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
|
@ -2444,21 +2458,25 @@ define([
|
|||
});
|
||||
|
||||
var menuImgCopy = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-copy',
|
||||
caption : me.textCopy,
|
||||
value : 'copy'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuImgPaste = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-paste',
|
||||
caption : me.textPaste,
|
||||
value : 'paste'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuImgCut = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-cut',
|
||||
caption : me.textCut,
|
||||
value : 'cut'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuImgPrint = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-print',
|
||||
caption : me.txtPrintSelection
|
||||
}).on('click', _.bind(me.onPrintSelection, me));
|
||||
|
||||
|
@ -2469,22 +2487,27 @@ define([
|
|||
var menuImgRotate = new Common.UI.MenuItem({
|
||||
caption : me.textRotate,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-rotate-90',
|
||||
caption: this.textRotate90,
|
||||
value : 1
|
||||
}).on('click', _.bind(me.onImgRotate, me)),
|
||||
new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-rotate-270',
|
||||
caption: this.textRotate270,
|
||||
value : 0
|
||||
}).on('click', _.bind(me.onImgRotate, me)),
|
||||
{ caption: '--' },
|
||||
new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-flip-hor',
|
||||
caption: this.textFlipH,
|
||||
value : 1
|
||||
}).on('click', _.bind(me.onImgFlip, me)),
|
||||
new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-flip-vert',
|
||||
caption: this.textFlipV,
|
||||
value : 0
|
||||
}).on('click', _.bind(me.onImgFlip, me))
|
||||
|
@ -2495,6 +2518,7 @@ define([
|
|||
me.menuImgCrop = new Common.UI.MenuItem({
|
||||
caption : me.textCrop,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
|
@ -2516,6 +2540,7 @@ define([
|
|||
});
|
||||
|
||||
this.pictureMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function(value){
|
||||
if (_.isUndefined(value.imgProps))
|
||||
return;
|
||||
|
@ -2525,50 +2550,63 @@ define([
|
|||
|
||||
me.menuImageWrap._originalProps = value.imgProps.value;
|
||||
|
||||
var cls = 'menu__icon ';
|
||||
if (notflow) {
|
||||
for (var i = 0; i < 6; i++) {
|
||||
me.menuImageWrap.menu.items[i].setChecked(false);
|
||||
}
|
||||
cls += 'wrap-inline';
|
||||
} else {
|
||||
switch (wrapping) {
|
||||
case Asc.c_oAscWrapStyle2.Inline:
|
||||
me.menuImageWrap.menu.items[0].setChecked(true);
|
||||
cls += 'wrap-inline';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.Square:
|
||||
me.menuImageWrap.menu.items[1].setChecked(true);
|
||||
cls += 'wrap-square';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.Tight:
|
||||
me.menuImageWrap.menu.items[2].setChecked(true);
|
||||
cls += 'wrap-tight';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.Through:
|
||||
me.menuImageWrap.menu.items[3].setChecked(true);
|
||||
cls += 'wrap-through';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.TopAndBottom:
|
||||
me.menuImageWrap.menu.items[4].setChecked(true);
|
||||
cls += 'wrap-topandbottom';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.Behind:
|
||||
me.menuImageWrap.menu.items[6].setChecked(true);
|
||||
cls += 'wrap-behind';
|
||||
break;
|
||||
case Asc.c_oAscWrapStyle2.InFront:
|
||||
me.menuImageWrap.menu.items[5].setChecked(true);
|
||||
cls += 'wrap-infront';
|
||||
break;
|
||||
default:
|
||||
for (var i = 0; i < 6; i++) {
|
||||
me.menuImageWrap.menu.items[i].setChecked(false);
|
||||
}
|
||||
cls += 'wrap-infront';
|
||||
break;
|
||||
}
|
||||
}
|
||||
me.menuImageWrap.setIconCls(cls);
|
||||
_.each(me.menuImageWrap.menu.items, function(item) {
|
||||
item.setDisabled(notflow);
|
||||
});
|
||||
|
||||
var onlyCommonProps = ( value.imgProps.isImg && value.imgProps.isChart || value.imgProps.isImg && value.imgProps.isShape ||
|
||||
value.imgProps.isShape && value.imgProps.isChart);
|
||||
if (onlyCommonProps)
|
||||
if (onlyCommonProps) {
|
||||
menuImageAdvanced.setCaption(me.advancedText, true);
|
||||
else {
|
||||
menuImageAdvanced.setIconCls('menu__icon btn-menu-image');
|
||||
} else {
|
||||
menuImageAdvanced.setCaption((value.imgProps.isImg) ? me.imageText : ((value.imgProps.isChart) ? me.chartText : me.shapeText), true);
|
||||
menuImageAdvanced.setIconCls('menu__icon ' + (value.imgProps.isImg ? 'btn-menu-image' : (value.imgProps.isChart ? 'btn-menu-chart' : 'btn-menu-shape')));
|
||||
}
|
||||
|
||||
menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps);
|
||||
|
@ -2672,6 +2710,7 @@ define([
|
|||
}).on('click', _.bind(me.onInsertCaption, me));
|
||||
|
||||
var mnuTableMerge = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-merge',
|
||||
caption : me.mergeCellsText
|
||||
}).on('click', function(item) {
|
||||
if (me.api)
|
||||
|
@ -2706,27 +2745,35 @@ define([
|
|||
};
|
||||
|
||||
var menuTableCellAlign = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-top',
|
||||
caption : me.cellAlignText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuTableCellTop = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-top',
|
||||
caption : me.textShapeAlignTop,
|
||||
toggleGroup : 'popuptablecellalign',
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
valign : Asc.c_oAscVertAlignJc.Top
|
||||
}).on('click', _.bind(tableCellsVAlign, me)),
|
||||
me.menuTableCellCenter = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-middle',
|
||||
caption : me.textShapeAlignMiddle,
|
||||
toggleGroup : 'popuptablecellalign',
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
valign : Asc.c_oAscVertAlignJc.Center
|
||||
}).on('click', _.bind(tableCellsVAlign, me)),
|
||||
me.menuTableCellBottom = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-bottom',
|
||||
caption : me.textShapeAlignBottom,
|
||||
toggleGroup : 'popuptablecellalign',
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
valign : Asc.c_oAscVertAlignJc.Bottom
|
||||
|
@ -2736,10 +2783,12 @@ define([
|
|||
});
|
||||
|
||||
var menuTableAdvanced = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-menu-table',
|
||||
caption : me.advancedTableText
|
||||
}).on('click', _.bind(me.advancedTableClick, me));
|
||||
|
||||
var menuParagraphAdvancedInTable = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-paragraph',
|
||||
caption : me.advancedParagraphText
|
||||
}).on('click', _.bind(me.advancedParagraphClick, me));
|
||||
|
||||
|
@ -2759,8 +2808,10 @@ define([
|
|||
});
|
||||
|
||||
var menuHyperlinkTable = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
menuEditHyperlinkTable,
|
||||
|
@ -2782,6 +2833,7 @@ define([
|
|||
var menuTableControl = new Common.UI.MenuItem({
|
||||
caption: me.textContentControls,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
menuTableRemoveControl,
|
||||
|
@ -2793,6 +2845,7 @@ define([
|
|||
var menuTableTOC = new Common.UI.MenuItem({
|
||||
caption : me.textTOC,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -2816,11 +2869,13 @@ define([
|
|||
|
||||
/** coauthoring begin **/
|
||||
var menuAddCommentTable = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-menu-comments',
|
||||
caption : me.addCommentText
|
||||
}).on('click', _.bind(me.addComment, me));
|
||||
/** coauthoring end **/
|
||||
|
||||
var menuAddHyperlinkTable = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText
|
||||
}).on('click', _.bind(me.addHyperlink, me));
|
||||
|
||||
|
@ -2836,6 +2891,7 @@ define([
|
|||
me.menuSpellMoreTable = new Common.UI.MenuItem({
|
||||
caption : me.moreText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
restoreHeight: true,
|
||||
items : [
|
||||
|
@ -2851,6 +2907,7 @@ define([
|
|||
].join(''));
|
||||
|
||||
me.langTableMenu = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-ic-doclang',
|
||||
caption : me.langText,
|
||||
menu : new Common.UI.MenuSimple({
|
||||
cls: 'lang-menu',
|
||||
|
@ -2896,8 +2953,10 @@ define([
|
|||
});
|
||||
|
||||
me.menuSpellCheckTable = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-ic-docspell',
|
||||
caption : me.spellcheckText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuSpellTable,
|
||||
|
@ -2913,21 +2972,25 @@ define([
|
|||
});
|
||||
|
||||
var menuTableCopy = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-copy',
|
||||
caption : me.textCopy,
|
||||
value : 'copy'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuTablePaste = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-paste',
|
||||
caption : me.textPaste,
|
||||
value : 'paste'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuTableCut = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-cut',
|
||||
caption : me.textCut,
|
||||
value : 'cut'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuTablePrint = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-print',
|
||||
caption : me.txtPrintSelection
|
||||
}).on('click', _.bind(me.onPrintSelection, me));
|
||||
|
||||
|
@ -2961,9 +3024,10 @@ define([
|
|||
};
|
||||
|
||||
var menuTableDirection = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon text-orient-hor',
|
||||
caption : me.directionText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuTableDirectH = new Common.UI.MenuItem({
|
||||
|
@ -3012,6 +3076,7 @@ define([
|
|||
var menuNumberingTable = new Common.UI.MenuItem({
|
||||
caption : me.bulletsText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
menuTableStartNewList,
|
||||
|
@ -3033,6 +3098,7 @@ define([
|
|||
});
|
||||
|
||||
this.tableMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function(value){
|
||||
// table properties
|
||||
if (_.isUndefined(value.tableProps))
|
||||
|
@ -3045,11 +3111,37 @@ define([
|
|||
}
|
||||
|
||||
var align = value.tableProps.value.get_CellsVAlign();
|
||||
var cls = '';
|
||||
switch (align) {
|
||||
case Asc.c_oAscVertAlignJc.Top:
|
||||
cls = 'menu__icon btn-align-top';
|
||||
break;
|
||||
case Asc.c_oAscVertAlignJc.Center:
|
||||
cls = 'menu__icon btn-align-middle';
|
||||
break;
|
||||
case Asc.c_oAscVertAlignJc.Bottom:
|
||||
cls = 'menu__icon btn-align-bottom';
|
||||
break;
|
||||
}
|
||||
menuTableCellAlign.setIconCls(cls);
|
||||
me.menuTableCellTop.setChecked(align == Asc.c_oAscVertAlignJc.Top);
|
||||
me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center);
|
||||
me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom);
|
||||
|
||||
var dir = value.tableProps.value.get_CellsTextDirection();
|
||||
cls = '';
|
||||
switch (dir) {
|
||||
case Asc.c_oAscCellTextDirection.LRTB:
|
||||
cls = 'menu__icon text-orient-hor';
|
||||
break;
|
||||
case Asc.c_oAscCellTextDirection.TBRL:
|
||||
cls = 'menu__icon text-orient-rdown';
|
||||
break;
|
||||
case Asc.c_oAscCellTextDirection.BTLR:
|
||||
cls = 'menu__icon btn-align-rup';
|
||||
break;
|
||||
}
|
||||
menuTableDirection.setIconCls(cls);
|
||||
me.menuTableDirectH.setChecked(dir == Asc.c_oAscCellTextDirection.LRTB);
|
||||
me.menuTableDirect90.setChecked(dir == Asc.c_oAscCellTextDirection.TBRL);
|
||||
me.menuTableDirect270.setChecked(dir == Asc.c_oAscCellTextDirection.BTLR);
|
||||
|
@ -3067,7 +3159,6 @@ define([
|
|||
menuTableDistCols.setDisabled(disabled);
|
||||
menuTableCellAlign.setDisabled(disabled);
|
||||
menuTableDirection.setDisabled(disabled);
|
||||
|
||||
menuTableAdvanced.setDisabled(disabled);
|
||||
|
||||
var cancopy = me.api && me.api.can_CopyCut();
|
||||
|
@ -3204,6 +3295,7 @@ define([
|
|||
{
|
||||
caption : me.selectText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
style : 'width: 100px',
|
||||
items : [
|
||||
|
@ -3235,8 +3327,10 @@ define([
|
|||
})
|
||||
},
|
||||
{
|
||||
iconCls: 'menu__icon btn-addcell',
|
||||
caption : me.insertText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
style : 'width: 100px',
|
||||
items : [
|
||||
|
@ -3273,8 +3367,10 @@ define([
|
|||
})
|
||||
},
|
||||
{
|
||||
iconCls: 'menu__icon btn-delcell',
|
||||
caption : me.deleteText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
style : 'width: 100px',
|
||||
items : [
|
||||
|
@ -3365,26 +3461,34 @@ define([
|
|||
};
|
||||
|
||||
var menuParagraphVAlign = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-top',
|
||||
caption : me.vertAlignText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuParagraphTop = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-top',
|
||||
caption : me.textShapeAlignTop,
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
toggleGroup : 'popupparagraphvalign',
|
||||
valign : Asc.c_oAscVAlign.Top
|
||||
}).on('click', _.bind(paragraphVAlign, me)),
|
||||
me.menuParagraphCenter = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-middle',
|
||||
caption : me.textShapeAlignMiddle,
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
toggleGroup : 'popupparagraphvalign',
|
||||
valign : Asc.c_oAscVAlign.Center
|
||||
}).on('click', _.bind(paragraphVAlign, me)),
|
||||
me.menuParagraphBottom = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-align-bottom',
|
||||
caption : me.textShapeAlignBottom,
|
||||
checkmark : false,
|
||||
checkable : true,
|
||||
checked : false,
|
||||
toggleGroup : 'popupparagraphvalign',
|
||||
|
@ -3403,9 +3507,10 @@ define([
|
|||
};
|
||||
|
||||
var menuParagraphDirection = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon text-orient-hor',
|
||||
caption : me.directionText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuParagraphDirectH = new Common.UI.MenuItem({
|
||||
|
@ -3440,6 +3545,7 @@ define([
|
|||
});
|
||||
|
||||
var menuParagraphAdvanced = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-paragraph',
|
||||
caption : me.advancedParagraphText
|
||||
}).on('click', _.bind(me.advancedParagraphClick, me));
|
||||
|
||||
|
@ -3453,6 +3559,7 @@ define([
|
|||
});
|
||||
|
||||
var menuAddCommentPara = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-menu-comments',
|
||||
caption : me.addCommentText
|
||||
}).on('click', _.bind(me.addComment, me));
|
||||
/** coauthoring end **/
|
||||
|
@ -3462,6 +3569,7 @@ define([
|
|||
});
|
||||
|
||||
var menuAddHyperlinkPara = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText
|
||||
}).on('click', _.bind(me.addHyperlink, me));
|
||||
|
||||
|
@ -3477,8 +3585,10 @@ define([
|
|||
});
|
||||
|
||||
var menuHyperlinkPara = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-inserthyperlink',
|
||||
caption : me.hyperlinkText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
menuEditHyperlinkPara,
|
||||
|
@ -3491,6 +3601,7 @@ define([
|
|||
var menuStyle = new Common.UI.MenuItem({
|
||||
caption: me.styleText,
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
me.menuStyleSave = new Common.UI.MenuItem({
|
||||
|
@ -3511,6 +3622,7 @@ define([
|
|||
me.menuSpellMorePara = new Common.UI.MenuItem({
|
||||
caption : me.moreText,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
restoreHeight: true,
|
||||
items: []
|
||||
|
@ -3518,6 +3630,7 @@ define([
|
|||
});
|
||||
|
||||
me.langParaMenu = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-ic-doclang',
|
||||
caption : me.langText,
|
||||
menu : new Common.UI.MenuSimple({
|
||||
cls: 'lang-menu',
|
||||
|
@ -3559,21 +3672,25 @@ define([
|
|||
});
|
||||
|
||||
var menuParaCopy = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-copy',
|
||||
caption : me.textCopy,
|
||||
value : 'copy'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuParaPaste = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-paste',
|
||||
caption : me.textPaste,
|
||||
value : 'paste'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuParaCut = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-cut',
|
||||
caption : me.textCut,
|
||||
value : 'cut'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuParaPrint = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-print',
|
||||
caption : me.txtPrintSelection
|
||||
}).on('click', _.bind(me.onPrintSelection, me));
|
||||
|
||||
|
@ -3606,6 +3723,7 @@ define([
|
|||
var menuParaTOCRefresh = new Common.UI.MenuItem({
|
||||
caption : me.textUpdateTOC,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
{
|
||||
|
@ -3663,6 +3781,7 @@ define([
|
|||
});
|
||||
|
||||
this.textMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function(value){
|
||||
var isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties()));
|
||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
||||
|
@ -3672,11 +3791,37 @@ define([
|
|||
menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
|
||||
if ( isInShape || isInChart ) {
|
||||
var align = value.imgProps.value.get_VerticalTextAlign();
|
||||
var cls = '';
|
||||
switch (align) {
|
||||
case Asc.c_oAscVAlign.Top:
|
||||
cls = 'menu__icon btn-align-top';
|
||||
break;
|
||||
case Asc.c_oAscVAlign.Center:
|
||||
cls = 'menu__icon btn-align-middle';
|
||||
break;
|
||||
case Asc.c_oAscVAlign.Bottom:
|
||||
cls = 'menu__icon btn-align-bottom';
|
||||
break;
|
||||
}
|
||||
menuParagraphVAlign.setIconCls(cls);
|
||||
me.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top);
|
||||
me.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center);
|
||||
me.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom);
|
||||
|
||||
var dir = value.imgProps.value.get_Vert();
|
||||
cls = '';
|
||||
switch (dir) {
|
||||
case Asc.c_oAscVertDrawingText.normal:
|
||||
cls = 'menu__icon text-orient-hor';
|
||||
break;
|
||||
case Asc.c_oAscVertDrawingText.vert:
|
||||
cls = 'menu__icon text-orient-rdown';
|
||||
break;
|
||||
case Asc.c_oAscVertDrawingText.vert270:
|
||||
cls = 'menu__icon btn-align-rup';
|
||||
break;
|
||||
}
|
||||
menuParagraphDirection.setIconCls(cls);
|
||||
me.menuParagraphDirectH.setChecked(dir == Asc.c_oAscVertDrawingText.normal);
|
||||
me.menuParagraphDirect90.setChecked(dir == Asc.c_oAscVertDrawingText.vert);
|
||||
me.menuParagraphDirect270.setChecked(dir == Asc.c_oAscVertDrawingText.vert270);
|
||||
|
@ -3896,6 +4041,7 @@ define([
|
|||
});
|
||||
|
||||
this.hdrMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function(value){
|
||||
menuEditHeaderFooter.setCaption(value.Header ? me.editHeaderText : me.editFooterText, true);
|
||||
menuEditHeaderFooter.off('click').on('click', function(item) {
|
||||
|
|
|
@ -188,7 +188,8 @@ define([
|
|||
menu: undefined,
|
||||
|
||||
template: _.template([
|
||||
'<table><tbody>',
|
||||
'<div class="flex-settings">',
|
||||
'<table style="margin: 30px 0 0;"><tbody>',
|
||||
/** coauthoring begin **/
|
||||
'<tr class="comments">',
|
||||
'<td class="left"><label><%= scope.txtLiveComment %></label></td>',
|
||||
|
@ -261,11 +262,16 @@ define([
|
|||
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
|
||||
'<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>',
|
||||
'</tr>','<tr class="divider macros"></tr>',
|
||||
'</tbody></table>',
|
||||
'</div>',
|
||||
'<div>',
|
||||
'<table style="margin: 10px 0;"><tbody>',
|
||||
'<tr>',
|
||||
'<td class="left"></td>',
|
||||
'<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
|
||||
'<td class="left"></td>',
|
||||
'<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
|
||||
'</tr>',
|
||||
'</tbody></table>'
|
||||
'</tbody></table>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
initialize: function(options) {
|
||||
|
@ -333,7 +339,7 @@ define([
|
|||
style : 'width: 160px;',
|
||||
editable : false,
|
||||
cls : 'input-group-nr',
|
||||
menuStyle : 'max-height: 210px;',
|
||||
menuStyle : 'max-height: 157px;',
|
||||
data : [
|
||||
{ value: -1, displayValue: this.txtFitPage },
|
||||
{ value: -2, displayValue: this.txtFitWidth },
|
||||
|
@ -446,15 +452,24 @@ define([
|
|||
|
||||
this.btnApply.on('click', this.applySettings.bind(this));
|
||||
|
||||
this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
|
||||
|
||||
this.$el = $(node).html($markup);
|
||||
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
el: this.$el,
|
||||
el: this.pnlSettings,
|
||||
suppressScrollX: true,
|
||||
alwaysVisibleY: true
|
||||
});
|
||||
}
|
||||
|
||||
Common.NotificationCenter.on({
|
||||
'window:resize': function() {
|
||||
me.isVisible() && me.updateScroller();
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -462,7 +477,14 @@ define([
|
|||
Common.UI.BaseView.prototype.show.call(this,arguments);
|
||||
|
||||
this.updateSettings();
|
||||
this.scroller && this.scroller.update();
|
||||
this.updateScroller();
|
||||
},
|
||||
|
||||
updateScroller: function() {
|
||||
if (this.scroller) {
|
||||
this.scroller.update();
|
||||
this.pnlSettings.toggleClass('bordered', this.scroller.isVisible());
|
||||
}
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
|
@ -609,25 +631,14 @@ define([
|
|||
},
|
||||
|
||||
autoCorrect: function() {
|
||||
if (!this._mathCorrect) {
|
||||
var arr = (this.api) ? this.api.asc_getAutoCorrectMathSymbols() : [],
|
||||
data = [];
|
||||
_.each(arr, function(item, index){
|
||||
var itm = {replaced: item[0]};
|
||||
if (typeof item[1]=='object') {
|
||||
itm.by = '';
|
||||
_.each(item[1], function(ch){
|
||||
itm.by += Common.Utils.String.encodeSurrogateChar(ch);
|
||||
});
|
||||
} else {
|
||||
itm.by = Common.Utils.String.encodeSurrogateChar(item[1]);
|
||||
}
|
||||
data.push(itm);
|
||||
});
|
||||
this._mathCorrect = data;
|
||||
}
|
||||
if (!this._mathCorrect)
|
||||
this._mathCorrect = new Common.UI.DataViewStore();
|
||||
if (!this._funcCorrect)
|
||||
this._funcCorrect = new Common.UI.DataViewStore();
|
||||
(new Common.Views.AutoCorrectDialog({
|
||||
props: this._mathCorrect
|
||||
mathStore: this._mathCorrect,
|
||||
functionsStore: this._funcCorrect,
|
||||
api: this.api
|
||||
})).show();
|
||||
},
|
||||
|
||||
|
@ -838,7 +849,8 @@ define([
|
|||
this.rendered = false;
|
||||
|
||||
this.template = _.template([
|
||||
'<table class="main">',
|
||||
'<div class="flex-settings">',
|
||||
'<table class="main" style="margin: 30px 0 0;">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtPlacement + '</label></td>',
|
||||
'<td class="right"><label id="id-info-placement">-</label></td>',
|
||||
|
@ -921,12 +933,17 @@ define([
|
|||
'</table>',
|
||||
'</div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr style="height: 5px;"></tr>',
|
||||
'</table>',
|
||||
'</div>',
|
||||
'<div id="fms-flex-apply">',
|
||||
'<table class="main" style="margin: 10px 0;">',
|
||||
'<tr>',
|
||||
'<td class="left"></td>',
|
||||
'<td class="right"><button id="fminfo-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
|
||||
'</tr>',
|
||||
'</table>'
|
||||
'</table>',
|
||||
'</div>'
|
||||
].join(''));
|
||||
|
||||
this.infoObj = {PageCount: 0, WordsCount: 0, ParagraphCount: 0, SymbolsCount: 0, SymbolsWSCount:0};
|
||||
|
@ -1003,6 +1020,7 @@ define([
|
|||
idx = me.tblAuthor.find('tr').index(el);
|
||||
el.remove();
|
||||
me.authors.splice(idx, 1);
|
||||
me.updateScroller(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1024,6 +1042,7 @@ define([
|
|||
if (!isFromApply) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(str)));
|
||||
me.trAuthor.before(div);
|
||||
me.updateScroller();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1036,6 +1055,9 @@ define([
|
|||
});
|
||||
this.btnApply.on('click', _.bind(this.applySettings, this));
|
||||
|
||||
this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings');
|
||||
this.pnlApply = $markup.findById('#fms-flex-apply');
|
||||
|
||||
this.rendered = true;
|
||||
|
||||
this.updateInfo(this.doc);
|
||||
|
@ -1043,11 +1065,18 @@ define([
|
|||
this.$el = $(node).html($markup);
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
el: this.$el,
|
||||
el: this.pnlInfo,
|
||||
suppressScrollX: true,
|
||||
alwaysVisibleY: true
|
||||
});
|
||||
}
|
||||
|
||||
Common.NotificationCenter.on({
|
||||
'window:resize': function() {
|
||||
me.isVisible() && me.updateScroller();
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -1056,7 +1085,8 @@ define([
|
|||
|
||||
this.updateStatisticInfo();
|
||||
this.updateFileInfo();
|
||||
this.scroller && this.scroller.update();
|
||||
this.scroller && this.scroller.scrollTop(0);
|
||||
this.updateScroller();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
@ -1065,6 +1095,13 @@ define([
|
|||
this.stopUpdatingStatisticInfo();
|
||||
},
|
||||
|
||||
updateScroller: function(destroy) {
|
||||
if (this.scroller) {
|
||||
this.scroller.update(destroy ? {} : undefined);
|
||||
this.pnlInfo.toggleClass('bordered', this.scroller.isVisible());
|
||||
}
|
||||
},
|
||||
|
||||
updateInfo: function(doc) {
|
||||
if (!this.doc && doc && doc.info) {
|
||||
doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
|
||||
|
@ -1135,7 +1172,7 @@ define([
|
|||
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
|
||||
value = props.asc_getLastModifiedBy();
|
||||
if (value)
|
||||
this.lblModifyBy.text(value);
|
||||
this.lblModifyBy.text(Common.Utils.UserInfoParser.getParsedName(value));
|
||||
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
|
||||
$('tr.divider.modify', this.el)[visible?'show':'hide']();
|
||||
|
||||
|
@ -1199,7 +1236,7 @@ define([
|
|||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
this.inputAuthor.setVisible(mode.isEdit);
|
||||
this.btnApply.setVisible(mode.isEdit);
|
||||
this.pnlApply.toggleClass('hidden', !mode.isEdit);
|
||||
this.tblAuthor.find('.close').toggleClass('hidden', !mode.isEdit);
|
||||
if (!mode.isEdit) {
|
||||
this.inputTitle._input.attr('placeholder', '');
|
||||
|
@ -1314,7 +1351,7 @@ define([
|
|||
this.rendered = false;
|
||||
|
||||
this.template = _.template([
|
||||
'<table class="main">',
|
||||
'<table class="main" style="margin: 30px 0;">',
|
||||
'<tr class="rights">',
|
||||
'<td class="left" style="vertical-align: top;"><label>' + this.txtRights + '</label></td>',
|
||||
'<td class="right"><div id="id-info-rights"></div></td>',
|
||||
|
@ -1529,7 +1566,7 @@ define([
|
|||
});
|
||||
|
||||
this.viewHelpPicker.on('item:select', function(dataview, itemview, record) {
|
||||
me.iFrame.src = me.urlPref + record.get('src');
|
||||
me.onSelectItem(record.get('src'));
|
||||
});
|
||||
|
||||
this.iFrame = document.createElement('iframe');
|
||||
|
@ -1575,10 +1612,14 @@ define([
|
|||
}
|
||||
},
|
||||
success: function () {
|
||||
var rec = (me.openUrl) ? store.findWhere({ src: me.openUrl }) || store.at(0) : store.at(0);
|
||||
me.viewHelpPicker.selectRecord(rec);
|
||||
me.viewHelpPicker.scrollToRecord(rec);
|
||||
me.iFrame.src = me.urlPref + rec.get('src');
|
||||
var rec = me.openUrl ? store.find(function(record){
|
||||
return (me.openUrl.indexOf(record.get('src'))>=0);
|
||||
}) : store.at(0);
|
||||
if (rec) {
|
||||
me.viewHelpPicker.selectRecord(rec, true);
|
||||
me.viewHelpPicker.scrollToRecord(rec);
|
||||
}
|
||||
me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src'));
|
||||
}
|
||||
};
|
||||
store.url = 'resources/help/' + lang + '/Contents.json';
|
||||
|
@ -1594,15 +1635,22 @@ define([
|
|||
this._scrollerInited = true;
|
||||
}
|
||||
if (url) {
|
||||
var rec = this.viewHelpPicker.store.findWhere({
|
||||
src: url
|
||||
});
|
||||
if (rec) {
|
||||
this.viewHelpPicker.selectRecord(rec);
|
||||
this.viewHelpPicker.scrollToRecord(rec);
|
||||
if (this.viewHelpPicker.store.length>0) {
|
||||
var rec = this.viewHelpPicker.store.find(function(record){
|
||||
return (url.indexOf(record.get('src'))>=0);
|
||||
});
|
||||
if (rec) {
|
||||
this.viewHelpPicker.selectRecord(rec, true);
|
||||
this.viewHelpPicker.scrollToRecord(rec);
|
||||
}
|
||||
this.onSelectItem(url);
|
||||
} else
|
||||
this.openUrl = url;
|
||||
}
|
||||
},
|
||||
|
||||
onSelectItem: function(src) {
|
||||
this.iFrame.src = this.urlPref + src;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -82,6 +82,9 @@ define([
|
|||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['ins_footnote']);
|
||||
});
|
||||
button.menu.items[7].menu.on('item:click', function (menu, item, e) {//convert
|
||||
me.fireEvent('links:notes', [item.value]);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsPrevNote.forEach(function(button) {
|
||||
|
@ -96,6 +99,18 @@ define([
|
|||
});
|
||||
});
|
||||
|
||||
this.btnsPrevEndNote.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['prev-end']);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsNextEndNote.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:notes', ['next-end']);
|
||||
});
|
||||
});
|
||||
|
||||
this.btnsHyperlink.forEach(function(button) {
|
||||
button.on('click', function (b, e) {
|
||||
me.fireEvent('links:hyperlink');
|
||||
|
@ -121,6 +136,8 @@ define([
|
|||
|
||||
this.btnsPrevNote = [];
|
||||
this.btnsNextNote = [];
|
||||
this.btnsPrevEndNote = [];
|
||||
this.btnsNextEndNote = [];
|
||||
this.paragraphControls = [];
|
||||
|
||||
var me = this,
|
||||
|
@ -178,7 +195,7 @@ define([
|
|||
btn.updateHint( me.tipContents );
|
||||
|
||||
var _menu = new Common.UI.Menu({
|
||||
cls: 'toc-menu',
|
||||
cls: 'toc-menu shifted-left',
|
||||
items: [
|
||||
{template: contentsTemplate, offsety: 0, value: 0},
|
||||
{template: contentsTemplate, offsety: 72, value: 1},
|
||||
|
@ -191,7 +208,7 @@ define([
|
|||
});
|
||||
|
||||
me.contentsMenu = new Common.UI.Menu({
|
||||
cls: 'toc-menu',
|
||||
cls: 'toc-menu shifted-left',
|
||||
items: [
|
||||
{template: contentsTemplate, offsety: 0, value: 0},
|
||||
{template: contentsTemplate, offsety: 72, value: 1},
|
||||
|
@ -221,6 +238,7 @@ define([
|
|||
var _menu = new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: me.mniInsFootnote, value: 'ins_footnote'},
|
||||
{caption: me.mniInsEndnote, value: 'ins_endnote'},
|
||||
{caption: '--'},
|
||||
new Common.UI.MenuItem({
|
||||
template: _.template([
|
||||
|
@ -235,8 +253,32 @@ define([
|
|||
].join('')),
|
||||
stopPropagation: true
|
||||
}),
|
||||
new Common.UI.MenuItem({
|
||||
template: _.template([
|
||||
'<div class="menu-zoom" style="height: 25px;" ',
|
||||
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
|
||||
'data-stopPropagation="true"',
|
||||
'<% } %>', '>',
|
||||
'<label class="title">' + me.textGotoEndnote + '</label>',
|
||||
'<button id="id-menu-goto-endnote-next-' + index + '" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><i class="icon menu__icon btn-nextitem"> </i></button>',
|
||||
'<button id="id-menu-goto-endnote-prev-' + index + '" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><i class="icon menu__icon btn-previtem"> </i></button>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
stopPropagation: true
|
||||
}),
|
||||
{caption: '--'},
|
||||
{caption: me.mniDelFootnote, value: 'delele'},
|
||||
{
|
||||
caption: me.mniConvertNote, value: 'convert',
|
||||
menu: new Common.UI.Menu({
|
||||
menuAlign : 'tl-tr',
|
||||
items: [
|
||||
{caption: me.textConvertToEndnotes, value: 'to-endnotes'},
|
||||
{caption: me.textConvertToFootnotes, value: 'to-footnotes'},
|
||||
{caption: me.textSwapNotes, value: 'swap'}
|
||||
]
|
||||
})
|
||||
},
|
||||
{caption: me.mniNoteSettings, value: 'settings'}
|
||||
]
|
||||
});
|
||||
|
@ -250,6 +292,14 @@ define([
|
|||
el: $('#id-menu-goto-footnote-next-'+index),
|
||||
cls: 'btn-toolbar'
|
||||
}));
|
||||
me.btnsPrevEndNote.push(new Common.UI.Button({
|
||||
el: $('#id-menu-goto-endnote-prev-'+index),
|
||||
cls: 'btn-toolbar'
|
||||
}));
|
||||
me.btnsNextEndNote.push(new Common.UI.Button({
|
||||
el: $('#id-menu-goto-endnote-next-'+index),
|
||||
cls: 'btn-toolbar'
|
||||
}));
|
||||
});
|
||||
|
||||
me.btnsHyperlink.forEach( function(btn) {
|
||||
|
@ -291,7 +341,7 @@ define([
|
|||
textUpdatePages: 'Refresh page numbers only',
|
||||
tipNotes: 'Footnotes',
|
||||
mniInsFootnote: 'Insert Footnote',
|
||||
mniDelFootnote: 'Delete All Footnotes',
|
||||
mniDelFootnote: 'Delete All Notes',
|
||||
mniNoteSettings: 'Notes Settings',
|
||||
textGotoFootnote: 'Go to Footnotes',
|
||||
capBtnInsFootnote: 'Footnotes',
|
||||
|
@ -301,7 +351,13 @@ define([
|
|||
capBtnBookmarks: 'Bookmark',
|
||||
tipBookmarks: 'Create a bookmark',
|
||||
capBtnCaption: 'Caption',
|
||||
tipCaption: 'Insert caption'
|
||||
tipCaption: 'Insert caption',
|
||||
mniConvertNote: 'Convert All Notes',
|
||||
textGotoEndnote: 'Go to Endnotes',
|
||||
mniInsEndnote: 'Insert Endnote',
|
||||
textConvertToEndnotes: 'Convert All Footnotes to Endnotes',
|
||||
textConvertToFootnotes: 'Convert All Endnotes to Footnotes',
|
||||
textSwapNotes: 'Swap Footnotes and Endnotes'
|
||||
}
|
||||
}()), DE.Views.Links || {}));
|
||||
});
|
|
@ -65,18 +65,19 @@ define([
|
|||
'<table cols="1" style="width: 100%;">',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<label class="header">', me.textLocation,'</label>',
|
||||
'<label class="header">', me.textLocation,'</label>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-large">',
|
||||
'<label class="input-label" style="margin-top: 4px;">', me.textFootnote,'</label>',
|
||||
'<td class="padding-small">',
|
||||
'<div id="note-settings-radio-foot" style="margin-top: 4px;display: inline-block"></div>',
|
||||
'<div id="note-settings-combo-footnote" class="input-group-nr" style="display: inline-block; width:150px;float:right;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td>',
|
||||
'<div class="padding-large"></div>',
|
||||
'<td class="padding-large">',
|
||||
'<div id="note-settings-radio-end" style="margin-top: 4px;display: inline-block"></div>',
|
||||
'<div id="note-settings-combo-endnote" class="input-group-nr" style="display: inline-block; width:150px;float:right;"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
|
@ -107,11 +108,6 @@ define([
|
|||
'<div id="note-settings-txt-custom"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td>',
|
||||
'<div class="padding-large"></div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="padding-small">',
|
||||
'<label class="header" style="margin-top: 4px;">', me.textApplyTo,'</label>',
|
||||
|
@ -133,17 +129,50 @@ define([
|
|||
this.api = options.api;
|
||||
this.handler = options.handler;
|
||||
this.props = options.props;
|
||||
this.isEndNote = options.isEndNote || false;
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
|
||||
this.FormatType = 1;
|
||||
this.StartValue = 1;
|
||||
this._state = {
|
||||
footnote: {
|
||||
numbering: Asc.c_oAscFootnoteRestart.Continuous,
|
||||
format: Asc.c_oAscNumberingFormat.Decimal,
|
||||
start: 1
|
||||
},
|
||||
endnote: {
|
||||
numbering: Asc.c_oAscFootnoteRestart.Continuous,
|
||||
format: Asc.c_oAscNumberingFormat.LowerRoman,
|
||||
start: 1
|
||||
}};
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||
var me = this;
|
||||
|
||||
this.radioFootnote = new Common.UI.RadioBox({
|
||||
el: $('#note-settings-radio-foot'),
|
||||
name: 'asc-radio-notes',
|
||||
labelText: this.textFootnote,
|
||||
checked: true
|
||||
});
|
||||
this.radioFootnote.on('change', function(field, newValue, eOpts) {
|
||||
if (newValue) {
|
||||
me.changeNoteType(false);
|
||||
}
|
||||
});
|
||||
|
||||
this.radioEndnote = new Common.UI.RadioBox({
|
||||
el: $('#note-settings-radio-end'),
|
||||
labelText: this.textEndnote,
|
||||
name: 'asc-radio-notes'
|
||||
});
|
||||
this.radioEndnote.on('change', function(field, newValue, eOpts) {
|
||||
if (newValue) {
|
||||
me.changeNoteType(true);
|
||||
}
|
||||
});
|
||||
|
||||
this.cmbFootnote = new Common.UI.ComboBox({
|
||||
el: $('#note-settings-combo-footnote'),
|
||||
cls: 'input-group-nr',
|
||||
|
@ -156,6 +185,18 @@ define([
|
|||
});
|
||||
this.cmbFootnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
||||
|
||||
this.cmbEndnote = new Common.UI.ComboBox({
|
||||
el: $('#note-settings-combo-endnote'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 150px;',
|
||||
editable: false,
|
||||
data: [
|
||||
{ displayValue: this.textSectEnd, value: Asc.c_oAscFootnotePos.SectEnd },
|
||||
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom }
|
||||
]
|
||||
});
|
||||
this.cmbEndnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
||||
|
||||
this.cmbFormat = new Common.UI.ComboBox({
|
||||
el: $('#note-settings-combo-format'),
|
||||
cls: 'input-group-nr',
|
||||
|
@ -169,10 +210,9 @@ define([
|
|||
{ displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman, maskExp: /[IVXLCDM]/, defValue: 'I' }
|
||||
]
|
||||
});
|
||||
this.cmbFormat.setValue(this.FormatType);
|
||||
this.cmbFormat.setValue(this._state.footnote.format);
|
||||
this.cmbFormat.on('selected', _.bind(this.onFormatSelect, this));
|
||||
|
||||
// this.spnStart = new Common.UI.MetricSpinner({
|
||||
this.spnStart = new Common.UI.CustomSpinner({
|
||||
el: $('#note-settings-spin-start'),
|
||||
step: 1,
|
||||
|
@ -185,16 +225,17 @@ define([
|
|||
maskExp: /[0-9]/
|
||||
});
|
||||
|
||||
this._arrNumbering = [
|
||||
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.Continuous },
|
||||
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.EachSect },
|
||||
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.EachPage }
|
||||
];
|
||||
this.cmbNumbering = new Common.UI.ComboBox({
|
||||
el: $('#note-settings-combo-numbering'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 150px;',
|
||||
editable: false,
|
||||
data: [
|
||||
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.Continuous },
|
||||
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.EachSect },
|
||||
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.EachPage }
|
||||
]
|
||||
data: this._arrNumbering
|
||||
});
|
||||
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous);
|
||||
|
||||
|
@ -239,9 +280,13 @@ define([
|
|||
},
|
||||
|
||||
_setDefaults: function (props) {
|
||||
|
||||
this.isEndNote ? this.radioEndnote.setValue(true, true) : this.radioFootnote.setValue(true, true);
|
||||
this.changeNoteType(this.isEndNote);
|
||||
|
||||
if (props) {
|
||||
var val = props.get_Pos();
|
||||
this.cmbFootnote.setValue(val);
|
||||
this.isEndNote ? this.cmbEndnote.setValue(val) : this.cmbFootnote.setValue(val);
|
||||
|
||||
val = props.get_NumFormat();
|
||||
this.cmbFormat.setValue(val);
|
||||
|
@ -258,7 +303,7 @@ define([
|
|||
getSettings: function () {
|
||||
var props = new Asc.CAscFootnotePr();
|
||||
|
||||
props.put_Pos(this.cmbFootnote.getValue());
|
||||
props.put_Pos(this.isEndNote ? this.cmbEndnote.getValue() : this.cmbFootnote.getValue());
|
||||
props.put_NumRestart(this.cmbNumbering.getValue());
|
||||
|
||||
var val = this.txtCustom.getValue();
|
||||
|
@ -268,7 +313,7 @@ define([
|
|||
props.put_NumStart(this.spnStart.getNumberValue());
|
||||
}
|
||||
|
||||
return {props: props, applyToAll: (this.cmbApply.getValue()==1), custom: _.isEmpty(val) ? undefined : val};
|
||||
return {props: props, applyToAll: (this.cmbApply.getValue()==1), custom: _.isEmpty(val) ? undefined : val, isEndNote: this.isEndNote};
|
||||
},
|
||||
|
||||
onDlgBtnClick: function(event) {
|
||||
|
@ -315,7 +360,7 @@ define([
|
|||
}
|
||||
|
||||
this.spnStart.setValue(this.spnStart.getValue());
|
||||
this.FormatType = record.value;
|
||||
this._state[this.isEndNote ? 'endnote' : 'footnote'].format = record.value;
|
||||
},
|
||||
|
||||
_10toS: function(value) {
|
||||
|
@ -411,6 +456,26 @@ define([
|
|||
return result;
|
||||
},
|
||||
|
||||
changeNoteType: function(isEndNote) {
|
||||
this._state[this.isEndNote ? 'endnote' : 'footnote'].start = this.spnStart.getNumberValue(); // save prev start
|
||||
this._state[this.isEndNote ? 'endnote' : 'footnote'].numbering = this.cmbNumbering.getValue(); // save prev numbering
|
||||
|
||||
this.isEndNote = isEndNote;
|
||||
|
||||
this.cmbFootnote.setDisabled(isEndNote);
|
||||
this.cmbEndnote.setDisabled(!isEndNote);
|
||||
|
||||
var state = this._state[isEndNote ? 'endnote' : 'footnote'],
|
||||
arr = isEndNote ? this._arrNumbering.slice(0,2) : this._arrNumbering;
|
||||
this.cmbNumbering.setData(arr);
|
||||
this.cmbNumbering.setValue(state.numbering);
|
||||
|
||||
this.cmbFormat.setValue(state.format);
|
||||
this.onFormatSelect(this.cmbFormat, this.cmbFormat.getSelectedRecord());
|
||||
|
||||
this.spnStart.setValue(state.start);
|
||||
},
|
||||
|
||||
textTitle: 'Notes Settings',
|
||||
textLocation: 'Location',
|
||||
textFootnote: 'Footnote',
|
||||
|
@ -428,7 +493,9 @@ define([
|
|||
textSection: 'Current section',
|
||||
textApply: 'Apply',
|
||||
textInsert: 'Insert',
|
||||
textCustom: 'Custom Mark'
|
||||
textCustom: 'Custom Mark',
|
||||
textSectEnd: 'End of section',
|
||||
textEndnote: 'Endnote'
|
||||
|
||||
}, DE.Views.NoteSettingsDialog || {}))
|
||||
});
|
115
apps/documenteditor/main/app/view/NotesRemoveDialog.js
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* NotesRemoveDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 29.07.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
define([
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/RadioBox'
|
||||
], function () { 'use strict';
|
||||
|
||||
DE.Views.NotesRemoveDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
width: 214,
|
||||
height: 138,
|
||||
header: true,
|
||||
style: 'min-width: 214px;',
|
||||
cls: 'modal-dlg',
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
_.extend(this.options, {
|
||||
title: this.textTitle
|
||||
}, options);
|
||||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div id="notes-remove-chk-foot" style="margin-bottom: 5px;"></div>',
|
||||
'<div id="notes-remove-chk-end"></div>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var $window = this.getChild();
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
|
||||
this.chFootnote = new Common.UI.CheckBox({
|
||||
el: $window.find('#notes-remove-chk-foot'),
|
||||
labelText: this.textFoot,
|
||||
value: true
|
||||
});
|
||||
|
||||
this.chEndnote = new Common.UI.CheckBox({
|
||||
el: $window.find('#notes-remove-chk-end'),
|
||||
labelText: this.textEnd,
|
||||
value: true
|
||||
});
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state);
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
return {footnote: this.chFootnote.isChecked(), endnote: this.chEndnote.isChecked()};
|
||||
},
|
||||
|
||||
onPrimary: function() {
|
||||
this._handleInput('ok');
|
||||
return false;
|
||||
},
|
||||
textTitle: 'Delete Notes',
|
||||
textFoot: 'Delete All Footnotes',
|
||||
textEnd: 'Delete All Endnotes'
|
||||
}, DE.Views.NotesRemoveDialog || {}))
|
||||
});
|
|
@ -81,7 +81,7 @@ define([
|
|||
defaultUnit : "",
|
||||
value: 1,
|
||||
maxValue: 16383,
|
||||
minValue: 1,
|
||||
minValue: 0,
|
||||
allowDecimal: false,
|
||||
maskExp: /[0-9]/
|
||||
});
|
||||
|
|
|
@ -410,6 +410,8 @@ define([
|
|||
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
|
||||
else
|
||||
this.btnDirection.setIconCls('');
|
||||
this.numGradientAngle.setValue(this.GradLinearDirectionType);
|
||||
this.numGradientAngle.setDisabled(this._locked);
|
||||
} else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) {
|
||||
this.mnuDirectionPicker.store.reset(this._viewDataRadial);
|
||||
this.mnuDirectionPicker.cmpEl.width(60);
|
||||
|
@ -419,6 +421,8 @@ define([
|
|||
this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls);
|
||||
else
|
||||
this.btnDirection.setIconCls('');
|
||||
this.numGradientAngle.setValue(0);
|
||||
this.numGradientAngle.setDisabled(true);
|
||||
}
|
||||
|
||||
if (this.api && !this._noApply) {
|
||||
|
@ -455,11 +459,12 @@ define([
|
|||
} else {
|
||||
rawData = record;
|
||||
}
|
||||
|
||||
this.btnDirection.setIconCls('item-gradient ' + rawData.iconcls);
|
||||
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
|
||||
if (this.api) {
|
||||
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
|
||||
this.numGradientAngle.setValue(rawData.type);
|
||||
|
||||
var props = new Asc.asc_CShapeProperty();
|
||||
var fill = new Asc.asc_CShapeFill();
|
||||
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
|
||||
|
@ -513,6 +518,7 @@ define([
|
|||
|
||||
onGradientChange: function(slider, newValue, oldValue){
|
||||
this.GradColor.values = slider.getValues();
|
||||
this.spnGradPosition.setValue(this.GradColor.values[this.GradColor.currentIdx], true);
|
||||
this._sliderChanged = true;
|
||||
if (this.api && !this._noApply) {
|
||||
if (this._sendUndoPoint) {
|
||||
|
@ -935,8 +941,10 @@ define([
|
|||
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
|
||||
else
|
||||
this.btnDirection.setIconCls('');
|
||||
this.numGradientAngle.setValue(value);
|
||||
}
|
||||
}
|
||||
} else
|
||||
this.numGradientAngle.setValue(0);
|
||||
|
||||
var me = this;
|
||||
var colors = fill.get_colors(),
|
||||
|
@ -973,6 +981,7 @@ define([
|
|||
me.GradColor.currentIdx = 0;
|
||||
}
|
||||
me.sldrGradient.setActiveThumb(me.GradColor.currentIdx);
|
||||
this.spnGradPosition.setValue(this.GradColor.values[this.GradColor.currentIdx]);
|
||||
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
|
||||
this.FGColor = {Value: 1, Color: this.GradColor.colors[0]};
|
||||
this.BGColor = {Value: 1, Color: 'ffffff'};
|
||||
|
@ -1298,7 +1307,7 @@ define([
|
|||
this.cmbGradType = new Common.UI.ComboBox({
|
||||
el: $('#shape-combo-grad-type'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 90px;',
|
||||
menuStyle: 'min-width: 100%;',
|
||||
editable: false,
|
||||
data: this._arrGradType
|
||||
});
|
||||
|
@ -1348,7 +1357,7 @@ define([
|
|||
|
||||
this.sldrGradient = new Common.UI.MultiSliderGradient({
|
||||
el: $('#shape-slider-gradient'),
|
||||
width: 125,
|
||||
width: 192,
|
||||
minValue: 0,
|
||||
maxValue: 100,
|
||||
values: [0, 100]
|
||||
|
@ -1360,6 +1369,8 @@ define([
|
|||
var color = me.GradColor.colors[me.GradColor.currentIdx];
|
||||
me.btnGradColor.setColor(color);
|
||||
me.colorsGrad.select(color,false);
|
||||
var pos = me.GradColor.values[me.GradColor.currentIdx];
|
||||
me.spnGradPosition.setValue(pos, true);
|
||||
});
|
||||
this.sldrGradient.on('thumbdblclick', function(cmp){
|
||||
me.btnGradColor.cmpEl.find('button').dropdown('toggle');
|
||||
|
@ -1376,18 +1387,75 @@ define([
|
|||
me.GradColor.colors = colors;
|
||||
me.GradColor.currentIdx = currentIdx;
|
||||
});
|
||||
this.sldrGradient.on('addthumb', function(cmp, index, nearIndex, color){
|
||||
me.GradColor.colors[index] = me.GradColor.colors[nearIndex];
|
||||
this.sldrGradient.on('addthumb', function(cmp, index, pos){
|
||||
me.GradColor.colors[index] = me.GradColor.colors[me.GradColor.currentIdx];
|
||||
me.GradColor.currentIdx = index;
|
||||
me.sldrGradient.addNewThumb(index, color);
|
||||
var color = me.sldrGradient.addNewThumb(index, pos);
|
||||
me.GradColor.colors[me.GradColor.currentIdx] = color;
|
||||
});
|
||||
this.sldrGradient.on('removethumb', function(cmp, index){
|
||||
me.sldrGradient.removeThumb(index);
|
||||
me.GradColor.values.splice(index, 1);
|
||||
me.sldrGradient.changeGradientStyle();
|
||||
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= me.GradColor.colors.length) {
|
||||
var newIndex = index > 0 ? index - 1 : index;
|
||||
newIndex = (newIndex === 0 && me.GradColor.values.length > 2) ? me.GradColor.values.length - 2 : newIndex;
|
||||
me.GradColor.currentIdx = newIndex;
|
||||
}
|
||||
me.sldrGradient.setActiveThumb(me.GradColor.currentIdx);
|
||||
});
|
||||
this.fillControls.push(this.sldrGradient);
|
||||
|
||||
this.spnGradPosition = new Common.UI.MetricSpinner({
|
||||
el: $('#shape-gradient-position'),
|
||||
step: 1,
|
||||
width: 60,
|
||||
defaultUnit : "%",
|
||||
value: '50 %',
|
||||
allowDecimal: false,
|
||||
maxValue: 100,
|
||||
minValue: 0,
|
||||
disabled: this._locked
|
||||
});
|
||||
this.fillControls.push(this.spnGradPosition);
|
||||
this.spnGradPosition.on('change', _.bind(this.onPositionChange, this));
|
||||
this.spnGradPosition.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
this.btnAddGradientStep = new Common.UI.Button({
|
||||
parentEl: $('#shape-gradient-add-step'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-add-breakpoint',
|
||||
disabled: this._locked,
|
||||
hint: this.tipAddGradientPoint
|
||||
});
|
||||
this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this));
|
||||
this.fillControls.push(this.btnAddGradientStep);
|
||||
|
||||
this.btnRemoveGradientStep = new Common.UI.Button({
|
||||
parentEl: $('#shape-gradient-remove-step'),
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-remove-breakpoint',
|
||||
disabled: this._locked,
|
||||
hint: this.tipRemoveGradientPoint
|
||||
});
|
||||
this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this));
|
||||
this.fillControls.push(this.btnRemoveGradientStep);
|
||||
|
||||
this.numGradientAngle = new Common.UI.MetricSpinner({
|
||||
el: $('#shape-spin-gradient-angle'),
|
||||
step: 10,
|
||||
width: 60,
|
||||
defaultUnit : "°",
|
||||
value: '0 °',
|
||||
allowDecimal: true,
|
||||
maxValue: 359.9,
|
||||
minValue: 0,
|
||||
disabled: this._locked
|
||||
});
|
||||
this.fillControls.push(this.numGradientAngle);
|
||||
this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this));
|
||||
this.numGradientAngle.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||
|
||||
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
|
||||
el: $('#shape-combo-border-size'),
|
||||
style: "width: 93px;",
|
||||
|
@ -1775,6 +1843,7 @@ define([
|
|||
});
|
||||
this.lblTransparencyStart.toggleClass('disabled', disable);
|
||||
this.lblTransparencyEnd.toggleClass('disabled', disable);
|
||||
this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1817,6 +1886,79 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onPositionChange: function(btn) {
|
||||
var pos = btn.getNumberValue(),
|
||||
minValue = (this.GradColor.currentIdx-1<0) ? 0 : this.GradColor.values[this.GradColor.currentIdx-1],
|
||||
maxValue = (this.GradColor.currentIdx+1<this.GradColor.values.length) ? this.GradColor.values[this.GradColor.currentIdx+1] : 100,
|
||||
needSort = pos < minValue || pos > maxValue;
|
||||
if (this.api) {
|
||||
this.GradColor.values[this.GradColor.currentIdx] = pos;
|
||||
var props = new Asc.asc_CShapeProperty();
|
||||
var fill = new Asc.asc_CShapeFill();
|
||||
fill.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD);
|
||||
fill.asc_putFill( new Asc.asc_CFillGrad());
|
||||
fill.asc_getFill().asc_putGradType(this.GradFillType);
|
||||
var arr = [];
|
||||
this.GradColor.values.forEach(function(item){
|
||||
arr.push(item*1000);
|
||||
});
|
||||
fill.asc_getFill().asc_putPositions(arr);
|
||||
props.asc_putFill(fill);
|
||||
this.imgprops.put_ShapeProperties(props);
|
||||
this.api.ImgApply(this.imgprops);
|
||||
|
||||
if (needSort) {
|
||||
this.sldrGradient.sortThumbs();
|
||||
this.sldrGradient.trigger('change', this.sldrGradient);
|
||||
this.sldrGradient.trigger('changecomplete', this.sldrGradient);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onAddGradientStep: function() {
|
||||
if (this.GradColor.colors.length > 9) return;
|
||||
var curIndex = this.GradColor.currentIdx;
|
||||
var pos = (this.GradColor.values[curIndex] + this.GradColor.values[curIndex < this.GradColor.colors.length - 1 ? curIndex + 1 : curIndex - 1]) / 2;
|
||||
|
||||
this.GradColor.colors[this.GradColor.colors.length] = this.GradColor.colors[curIndex];
|
||||
this.GradColor.currentIdx = this.GradColor.colors.length - 1;
|
||||
var color = this.sldrGradient.addNewThumb(undefined, pos, curIndex);
|
||||
this.GradColor.colors[this.GradColor.currentIdx] = color;
|
||||
|
||||
this.sldrGradient.trigger('change', this.sldrGradient);
|
||||
this.sldrGradient.trigger('changecomplete', this.sldrGradient);
|
||||
},
|
||||
|
||||
onRemoveGradientStep: function() {
|
||||
if (this.GradColor.values.length < 3) return;
|
||||
var index = this.GradColor.currentIdx;
|
||||
this.GradColor.values.splice(this.GradColor.currentIdx, 1);
|
||||
this.sldrGradient.removeThumb(this.GradColor.currentIdx);
|
||||
if (_.isUndefined(this.GradColor.currentIdx) || this.GradColor.currentIdx >= this.GradColor.colors.length) {
|
||||
var newIndex = index > 0 ? index - 1 : index;
|
||||
newIndex = (newIndex === 0 && this.GradColor.values.length > 2) ? this.GradColor.values.length - 2 : newIndex;
|
||||
this.GradColor.currentIdx = newIndex;
|
||||
}
|
||||
this.sldrGradient.setActiveThumb(this.GradColor.currentIdx);
|
||||
this.sldrGradient.trigger('change', this.sldrGradient);
|
||||
this.sldrGradient.trigger('changecomplete', this.sldrGradient);
|
||||
},
|
||||
|
||||
onGradientAngleChange: function(field, newValue, oldValue, eOpts) {
|
||||
if (this.api) {
|
||||
var props = new Asc.asc_CShapeProperty();
|
||||
var fill = new Asc.asc_CShapeFill();
|
||||
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
|
||||
fill.put_fill( new Asc.asc_CFillGrad());
|
||||
fill.get_fill().put_grad_type(this.GradFillType);
|
||||
fill.get_fill().put_linear_angle(field.getNumberValue() * 60000);
|
||||
fill.get_fill().put_linear_scale(true);
|
||||
props.put_fill(fill);
|
||||
this.imgprops.put_ShapeProperties(props);
|
||||
this.api.ImgApply(this.imgprops);
|
||||
}
|
||||
},
|
||||
|
||||
txtNoBorders : 'No Line',
|
||||
strStroke : 'Stroke',
|
||||
strColor : 'Color',
|
||||
|
@ -1855,7 +1997,7 @@ define([
|
|||
textRadial: 'Radial',
|
||||
textDirection: 'Direction',
|
||||
textStyle: 'Style',
|
||||
textGradient: 'Gradient',
|
||||
textGradient: 'Gradient Points',
|
||||
textWrap: 'Wraping Style',
|
||||
txtInline: 'Inline',
|
||||
txtSquare: 'Square',
|
||||
|
@ -1875,6 +2017,10 @@ define([
|
|||
textHintFlipH: 'Flip Horizontally',
|
||||
strShadow: 'Show shadow',
|
||||
textFromStorage: 'From Storage',
|
||||
textSelectImage: 'Select Picture'
|
||||
textSelectImage: 'Select Picture',
|
||||
textPosition: 'Position',
|
||||
tipAddGradientPoint: 'Add gradient point',
|
||||
tipRemoveGradientPoint: 'Remove gradient point',
|
||||
textAngle: 'Angle'
|
||||
}, DE.Views.ShapeSettings || {}));
|
||||
});
|
||||
|
|