Merge branch release/v6.1.0 into master
15
.github/workflows/check.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
name: check
|
||||
on: [push]
|
||||
jobs:
|
||||
project-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 12
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Build using grunt
|
||||
run: |
|
||||
npm install --prefix build
|
||||
grunt --level=ADVANCED --base build --gruntfile build/Gruntfile.js
|
|
@ -1,9 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '12'
|
||||
before_install: npm install -g grunt-cli
|
||||
before_script:
|
||||
- cd build
|
||||
script:
|
||||
- npm install
|
||||
- grunt --level=ADVANCED
|
|
@ -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',
|
||||
|
@ -299,6 +303,8 @@
|
|||
if ( msg ) {
|
||||
if ( msg.type === "onExternalPluginMessage" ) {
|
||||
_sendCommand(msg);
|
||||
} else if (msg.type === "onExternalPluginMessageCallback") {
|
||||
postMessage(window.parent, msg);
|
||||
} else
|
||||
if ( msg.frameEditorId == placeholderId ) {
|
||||
var events = _config.events || {},
|
||||
|
@ -334,9 +340,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) {
|
||||
|
@ -355,9 +367,9 @@
|
|||
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';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -737,9 +749,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()];
|
||||
|
@ -748,8 +763,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: {
|
||||
|
@ -80,7 +80,7 @@
|
|||
}
|
||||
|
||||
function getDocumentData(urlParams) {
|
||||
return {
|
||||
let docparams = {
|
||||
key: urlParams["key"],
|
||||
url: urlParams["url"] || '_offline_',
|
||||
title: urlParams["title"],
|
||||
|
@ -91,6 +91,11 @@
|
|||
download: true
|
||||
}
|
||||
};
|
||||
|
||||
if (urlParams['mode'] == 'review')
|
||||
docparams.permissions.edit = !(docparams.permissions.review = true);
|
||||
|
||||
return docparams;
|
||||
}
|
||||
|
||||
function getEditorConfig(urlParams) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -302,6 +302,9 @@ define([
|
|||
if ($list.hasClass('menu-absolute')) {
|
||||
var offset = this.cmpEl.offset();
|
||||
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
|
||||
} else if ($list.hasClass('menu-aligned')) {
|
||||
var offset = this.cmpEl.offset();
|
||||
$list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight());
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -96,11 +96,13 @@ define([
|
|||
'<a class="scroll left"></a>' +
|
||||
'<ul>' +
|
||||
'<% for(var i in items) { %>' +
|
||||
'<% if (typeof items[i] == "object") { %>' +
|
||||
'<li class="ribtab' +
|
||||
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
|
||||
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>">' +
|
||||
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>"><%= items[i].caption %></a>' +
|
||||
'</li>' +
|
||||
'<% } %>' +
|
||||
'<% } %>' +
|
||||
'</ul>' +
|
||||
'<a class="scroll right"></a>' +
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -111,7 +111,9 @@ define([
|
|||
} else
|
||||
if (this.placement == 'top')
|
||||
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
|
||||
else {// left or right
|
||||
else if (this.placement == 'target') {
|
||||
this.cmpEl.css({top : (showxy.top+5) + 'px', left: (showxy.left+5) + 'px'});
|
||||
} else {// left or right
|
||||
var top = showxy.top + this.target.height()/2,
|
||||
height = this.cmpEl.height();
|
||||
if (top+height>innerHeight)
|
||||
|
|
|
@ -51,9 +51,15 @@ define([
|
|||
this.active = false;
|
||||
this.label = 'Tab';
|
||||
this.cls = '';
|
||||
this.iconCls = '';
|
||||
this.iconVisible = false;
|
||||
this.iconTitle = '';
|
||||
this.index = -1;
|
||||
this.template = _.template(['<li class="list-item <% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%- label %>">',
|
||||
'<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>"><%- label %></span>',
|
||||
this.template = _.template(['<li class="list-item <% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%><% if(iconVisible){%> icon-visible <%}%>" data-label="<%- label %>">',
|
||||
'<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>">',
|
||||
'<div class="toolbar__icon <% if(iconCls.length){%><%= iconCls %><%}%>" title="<% if(iconTitle.length){%><%=iconTitle%><%}%>"></div>',
|
||||
'<%- label %>',
|
||||
'</span>',
|
||||
'</li>'].join(''));
|
||||
|
||||
this.initialize.call(this, opts);
|
||||
|
@ -126,6 +132,16 @@ define([
|
|||
|
||||
setCaption: function(text) {
|
||||
this.$el.find('> span').text(text);
|
||||
},
|
||||
|
||||
changeIconState: function(visible, title) {
|
||||
if (this.iconCls.length) {
|
||||
this.iconVisible = visible;
|
||||
this.iconTitle = title || '';
|
||||
this[visible ? 'addClass' : 'removeClass']('icon-visible');
|
||||
if (title)
|
||||
this.$el.find('.' + this.iconCls).attr('title', title);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ define([
|
|||
|
||||
_onMouseWheel: function(e) {
|
||||
var hidden = this.checkInvisible(true),
|
||||
forward = ((e.detail && -e.detail) || e.wheelDelta) > 0;
|
||||
forward = ((e.detail && -e.detail) || e.wheelDelta) < 0;
|
||||
|
||||
if (forward) {
|
||||
if (hidden.last) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -289,7 +291,7 @@ define([
|
|||
|
||||
return false;
|
||||
},
|
||||
onShowComment: function (id, selected) {
|
||||
onShowComment: function (id, selected, fromLeftPanelSelection) {
|
||||
var comment = this.findComment(id);
|
||||
if (comment) {
|
||||
if (null !== comment.get('quote')) {
|
||||
|
@ -317,9 +319,11 @@ define([
|
|||
this.isSelectedComment = selected;
|
||||
}
|
||||
|
||||
this.api.asc_selectComment(id);
|
||||
this._dontScrollToComment = true;
|
||||
this.api.asc_showComment(id,false);
|
||||
if (!fromLeftPanelSelection || !((0 === _.difference(this.uids, [id]).length) && (0 === _.difference([id], this.uids).length))) {
|
||||
this.api.asc_selectComment(id);
|
||||
this._dontScrollToComment = true;
|
||||
this.api.asc_showComment(id,false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -354,6 +358,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 +385,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 +417,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 +441,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 +482,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 +499,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 +543,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 +560,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 +774,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 +796,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 +1231,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 +1272,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,15 +192,7 @@ 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} ));
|
||||
|
||||
|
|
|
@ -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 '';
|
||||
},
|
||||
|
|
|
@ -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>
|
||||
<% } %>
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -961,4 +962,36 @@ Common.Utils.ModalWindow = new(function() {
|
|||
return count>0;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
Common.Utils.UserInfoParser = new(function() {
|
||||
var parse = false;
|
||||
var separator = String.fromCharCode(160);
|
||||
return {
|
||||
setParser: function(value) {
|
||||
parse = !!value;
|
||||
},
|
||||
|
||||
getSeparator: function() {
|
||||
return separator;
|
||||
},
|
||||
|
||||
getParsedName: function(username) {
|
||||
if (parse && username) {
|
||||
return username.substring(username.indexOf(separator)+1);
|
||||
} else
|
||||
return username;
|
||||
},
|
||||
|
||||
getParsedGroups: function(username) {
|
||||
if (parse && username) {
|
||||
var idx = username.indexOf(separator),
|
||||
groups = (idx>-1) ? username.substring(0, idx).split(',') : [];
|
||||
for (var i=0; i<groups.length; i++)
|
||||
groups[i] = groups[i].trim();
|
||||
return groups;
|
||||
} else
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
})();
|
|
@ -40,79 +40,102 @@
|
|||
*/
|
||||
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>',
|
||||
'</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) : [];
|
||||
|
||||
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.slice(0, 11)),
|
||||
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="width:110px;padding-right: 5px;overflow: hidden;text-overflow: ellipsis;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
|
||||
'<div style="width:230px;overflow: hidden;text-overflow: ellipsis;flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
scrollAlwaysVisible: true
|
||||
|
@ -123,24 +146,27 @@ define([
|
|||
el : $window.find('#auto-correct-replace'),
|
||||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
maxLength : 31,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
var _selectedItem;
|
||||
if (value.length) {
|
||||
var store = me.mathList.store;
|
||||
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){
|
||||
|
@ -161,43 +187,591 @@ define([
|
|||
el : $window.find('#auto-correct-by'),
|
||||
allowBlank : true,
|
||||
validateOnChange : true,
|
||||
maxLength : 255,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
me.updateControls();
|
||||
});
|
||||
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
|
||||
|
||||
$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="width: 340px;text-overflow: ellipsis;overflow: hidden;<% 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,
|
||||
maxLength : 255,
|
||||
validation : function () { return true; }
|
||||
}).on ('changing', function (input, value) {
|
||||
var _selectedItem;
|
||||
if (value.length) {
|
||||
var store = me.mathRecList.store;
|
||||
_selectedItem = store.find(function(item) {
|
||||
if ( item.get('value').indexOf(value) == 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (_selectedItem) {
|
||||
me.mathRecList.scrollToRecord(_selectedItem, true);
|
||||
if (_selectedItem.get('value') == value)
|
||||
me.mathRecList.selectRecord(_selectedItem, true);
|
||||
else
|
||||
_selectedItem = null;
|
||||
}
|
||||
}
|
||||
(!_selectedItem) && me.mathRecList.deselectAll();
|
||||
me.updateRecControls(_selectedItem);
|
||||
});
|
||||
|
||||
this.inputRecFind.cmpEl.find('input').on('keydown', function(event){
|
||||
if (event.key == 'ArrowDown') {
|
||||
var _selectedItem = me.mathRecList.getSelectedRec() || me.mathRecList.store.at(0);
|
||||
if (_selectedItem) {
|
||||
me.mathRecList.selectRecord(_selectedItem);
|
||||
me.mathRecList.scrollToRecord(_selectedItem);
|
||||
}
|
||||
_.delay(function(){
|
||||
me.mathRecList.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")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-smart-quotes", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-smart-quotes", checked);
|
||||
me.api.asc_SetAutoCorrectSmartQuotes(checked);
|
||||
});
|
||||
this.chHyphens = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-hyphens'),
|
||||
labelText: this.textHyphens,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyphens")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyphens", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyphens", checked);
|
||||
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
|
||||
});
|
||||
this.chBulleted = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-bulleted'),
|
||||
labelText: this.textBulleted,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-bulleted")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-bulleted", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-bulleted", checked);
|
||||
me.api.asc_SetAutomaticBulletedLists(checked);
|
||||
});
|
||||
this.chNumbered = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-numbered'),
|
||||
labelText: this.textNumbered,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||
me.api.asc_SetAutomaticNumberedLists(checked);
|
||||
});
|
||||
} else if (this.appPrefix=='sse-') {
|
||||
this.chNewRows = new Common.UI.CheckBox({
|
||||
el: $('#id-autocorrect-dialog-chk-new-rows'),
|
||||
labelText: this.textNewRowCol,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-new-rows", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
|
||||
me.api.asc_setIncludeNewRowColTable(checked);
|
||||
});
|
||||
}
|
||||
|
||||
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
|
||||
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
|
||||
|
||||
this.afterRender();
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this.updateControls();
|
||||
this.updateRecControls();
|
||||
if (this.storageName) {
|
||||
var value = Common.localStorage.getItem(this.storageName);
|
||||
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments);
|
||||
this.mathList && this.mathList.deselectAll();
|
||||
this.mathRecList && this.mathRecList.deselectAll();
|
||||
},
|
||||
|
||||
onMathCategoryClick: function(delay) {
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
$('input', me.inputReplace.cmpEl).select().focus();
|
||||
},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);
|
||||
}
|
||||
},
|
||||
|
||||
onDelete: function() {
|
||||
var rec = this.mathList.getSelectedRec();
|
||||
if (rec) {
|
||||
if (rec.get('defaultValue')) {
|
||||
var path = this.appPrefix + "settings-math-correct-rem";
|
||||
var disabled = !rec.get('defaultDisabled');
|
||||
rec.set('defaultDisabled', disabled);
|
||||
if (disabled)
|
||||
this.arrRem.push(rec.get('replaced'));
|
||||
else
|
||||
this.arrRem.splice(this.arrRem.indexOf(rec.get('replaced')), 1);
|
||||
var val = JSON.stringify(this.arrRem);
|
||||
Common.Utils.InternalSettings.set(path, val);
|
||||
Common.localStorage.setItem(path, val);
|
||||
this.btnDelete.setCaption(disabled ? this.textRestore : this.textDelete);
|
||||
disabled ? this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced')) : this.api.asc_AddOrEditFromAutoCorrectMathSymbols(rec.get('replaced'), rec.get('defaultValue'));
|
||||
} else {
|
||||
this.mathStore.remove(rec);
|
||||
this.mathList.scroller && this.mathList.scroller.update({});
|
||||
this.api.asc_deleteFromAutoCorrectMathSymbols(rec.get('replaced'));
|
||||
}
|
||||
this.updateControls();
|
||||
}
|
||||
},
|
||||
|
||||
onEdit: function() {
|
||||
var rec = this.mathList.getSelectedRec(),
|
||||
by = '',
|
||||
me = this,
|
||||
applySettings = function(record, by) {
|
||||
var path = me.appPrefix + "settings-math-correct-add";
|
||||
var val = JSON.stringify(me.arrAdd);
|
||||
Common.Utils.InternalSettings.set(path, val);
|
||||
Common.localStorage.setItem(path, val);
|
||||
me.api.asc_AddOrEditFromAutoCorrectMathSymbols(record.get('replaced'), by);
|
||||
me.mathList.selectRecord(record);
|
||||
me.mathList.scrollToRecord(record);
|
||||
};
|
||||
if (!rec) {
|
||||
rec = this.mathStore.findWhere({replaced: this.inputReplace.getValue()})
|
||||
}
|
||||
if (rec) {
|
||||
var idx = _.findIndex(this.arrAdd, function(item){return (item[0]==rec.get('replaced'));});
|
||||
var restore = rec.get('defaultValue') && (rec.get('defaultValueStr')!==rec.get('by')) && (this.inputBy.getValue() === rec.get('by'));
|
||||
Common.UI.warning({
|
||||
maxwidth: 500,
|
||||
msg: restore ? this.warnRestore.replace('%1', rec.get('replaced')) : this.warnReplace.replace('%1', rec.get('replaced')),
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn, dontshow){
|
||||
if (btn == 'yes') {
|
||||
if (restore) {// reset to default
|
||||
by = rec.get('defaultValue');
|
||||
rec.set('by', rec.get('defaultValueStr'));
|
||||
(idx>=0) && this.arrAdd.splice(idx, 1);
|
||||
} else { // replace
|
||||
by = this.inputBy.getValue();
|
||||
rec.set('by', by);
|
||||
if (idx<0)
|
||||
this.arrAdd.push([rec.get('replaced'), by]);
|
||||
else
|
||||
this.arrAdd[idx][1] = by;
|
||||
}
|
||||
applySettings(rec, by);
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
|
||||
} else {
|
||||
rec = this.mathStore.add({
|
||||
replaced: this.inputReplace.getValue(),
|
||||
by: this.inputBy.getValue(),
|
||||
defaultDisabled: false
|
||||
});
|
||||
by = rec.get('by');
|
||||
this.arrAdd.push([rec.get('replaced'), by]);
|
||||
applySettings(rec, by);
|
||||
}
|
||||
},
|
||||
|
||||
onResetToDefault: function() {
|
||||
Common.UI.warning({
|
||||
maxwidth: 500,
|
||||
msg: this.warnReset,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn, dontshow){
|
||||
if (btn == 'yes') {
|
||||
this.api.asc_resetToDefaultAutoCorrectMathSymbols();
|
||||
this.onResetList();
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
},
|
||||
|
||||
onResetList: function() {
|
||||
// remove storage data
|
||||
var path = this.appPrefix + "settings-math-correct";
|
||||
var val = JSON.stringify([]);
|
||||
Common.Utils.InternalSettings.set(path + "-add", val);
|
||||
Common.localStorage.setItem(path + "-add", val);
|
||||
Common.Utils.InternalSettings.set(path + "-rem", val);
|
||||
Common.localStorage.setItem(path + "-rem", val);
|
||||
this.arrAdd = [];
|
||||
this.arrRem = [];
|
||||
|
||||
this.mathStore.remove(this.mathStore.where({defaultValue: undefined}));
|
||||
this.mathStore.each(function(item, index){
|
||||
item.set('by', item.get('defaultValueStr'));
|
||||
item.set('defaultDisabled', false);
|
||||
});
|
||||
this.mathList.deselectAll();
|
||||
if (this.mathList.scroller) {
|
||||
this.mathList.scroller.update();
|
||||
this.mathList.scroller.scrollTop(0);
|
||||
}
|
||||
this.updateControls();
|
||||
},
|
||||
|
||||
onInitList: function() {
|
||||
if (this.mathStore.length>0) return;
|
||||
|
||||
this.mathStore.comparator = function(item1, item2) {
|
||||
var n1 = item1.get('replaced').toLowerCase(),
|
||||
n2 = item2.get('replaced').toLowerCase();
|
||||
if (n1==n2) return 0;
|
||||
return (n1<n2) ? -1 : 1;
|
||||
};
|
||||
|
||||
var arrAdd = this.arrAdd,
|
||||
arrRem = this.arrRem;
|
||||
|
||||
var arr = (this.api) ? this.api.asc_getAutoCorrectMathSymbols() : [],
|
||||
data = [];
|
||||
_.each(arr, function(item, index){
|
||||
var itm = {
|
||||
replaced: item[0],
|
||||
defaultValue: item[1],
|
||||
defaultDisabled: arrRem.indexOf(item[0])>-1
|
||||
};
|
||||
if (typeof item[1]=='object') {
|
||||
itm.defaultValueStr = '';
|
||||
_.each(item[1], function(ch){
|
||||
itm.defaultValueStr += Common.Utils.String.encodeSurrogateChar(ch);
|
||||
});
|
||||
itm.by = itm.defaultValueStr;
|
||||
} else {
|
||||
itm.by = itm.defaultValueStr = Common.Utils.String.encodeSurrogateChar(item[1]);
|
||||
}
|
||||
data.push(itm);
|
||||
});
|
||||
|
||||
var dataAdd = [];
|
||||
_.each(arrAdd, function(item, index){
|
||||
var idx = _.findIndex(data, {replaced: item[0]});
|
||||
if (idx<0) {
|
||||
dataAdd.push({
|
||||
replaced: item[0],
|
||||
by: item[1],
|
||||
defaultDisabled: false
|
||||
});
|
||||
} else {
|
||||
var changed = data[idx];
|
||||
changed.by = item[1];
|
||||
}
|
||||
});
|
||||
this.mathStore.reset(data.concat(dataAdd));
|
||||
this.updateControls();
|
||||
},
|
||||
|
||||
onInitRecList: function() {
|
||||
if (this.functionsStore.length>0) return;
|
||||
|
||||
this.functionsStore.comparator = function(item1, item2) {
|
||||
var n1 = item1.get('value').toLowerCase(),
|
||||
n2 = item2.get('value').toLowerCase();
|
||||
if (n1==n2) return 0;
|
||||
return (n1<n2) ? -1 : 1;
|
||||
};
|
||||
|
||||
var arrAdd = this.arrAddRec,
|
||||
arrRem = this.arrRemRec;
|
||||
|
||||
var arr = (this.api) ? this.api.asc_getAutoCorrectMathFunctions() : [],
|
||||
data = [];
|
||||
_.each(arr, function(item, index){
|
||||
data.push({
|
||||
value: item,
|
||||
defaultValue: true,
|
||||
defaultDisabled: arrRem.indexOf(item)>-1
|
||||
});
|
||||
});
|
||||
|
||||
var dataAdd = [];
|
||||
_.each(arrAdd, function(item, index){
|
||||
if (_.findIndex(data, {value: item})<0) {
|
||||
dataAdd.push({
|
||||
value: item,
|
||||
defaultValue: false,
|
||||
defaultDisabled: false
|
||||
});
|
||||
}
|
||||
});
|
||||
this.functionsStore.reset(data.concat(dataAdd));
|
||||
this.updateRecControls();
|
||||
},
|
||||
|
||||
onResetRecToDefault: function() {
|
||||
Common.UI.warning({
|
||||
maxwidth: 500,
|
||||
msg: this.textWarnResetRec,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn, dontshow){
|
||||
if (btn == 'yes') {
|
||||
this.api.asc_resetToDefaultAutoCorrectMathFunctions();
|
||||
this.onResetRecList();
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
},
|
||||
|
||||
onResetRecList: function() {
|
||||
// remove storage data
|
||||
var path = this.appPrefix + "settings-rec-functions";
|
||||
var val = JSON.stringify([]);
|
||||
Common.Utils.InternalSettings.set(path + "-add", val);
|
||||
Common.localStorage.setItem(path + "-add", val);
|
||||
Common.Utils.InternalSettings.set(path + "-rem", val);
|
||||
Common.localStorage.setItem(path + "-rem", val);
|
||||
this.arrAddRec = [];
|
||||
this.arrRemRec = [];
|
||||
|
||||
this.functionsStore.remove(this.functionsStore.where({defaultValue: false}));
|
||||
this.functionsStore.each(function(item, index){
|
||||
item.set('defaultDisabled', false);
|
||||
});
|
||||
this.mathRecList.deselectAll();
|
||||
if (this.mathRecList.scroller) {
|
||||
this.mathRecList.scroller.update();
|
||||
this.mathRecList.scroller.scrollTop(0);
|
||||
}
|
||||
this.updateRecControls();
|
||||
},
|
||||
|
||||
onRecCategoryClick: function(delay) {
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.mathList.store.reset(me.props);
|
||||
},100);
|
||||
$('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);
|
||||
}
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this.close();
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
return true;
|
||||
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);
|
||||
},
|
||||
|
||||
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 () {
|
||||
|
|
|
@ -283,7 +283,16 @@ define([
|
|||
} else if (!btn.hasClass('msg-reply') &&
|
||||
!btn.hasClass('btn-resolve-check') &&
|
||||
!btn.hasClass('btn-resolve')) {
|
||||
me.fireEvent('comment:show', [commentId, false]);
|
||||
var isTextSelected = false;
|
||||
if (btn.hasClass('user-message')) {
|
||||
if (window.getSelection) {
|
||||
var selection = window.getSelection();
|
||||
isTextSelected = (selection.toString()!=='')
|
||||
} else if (document.selection) {
|
||||
isTextSelected = document.selection;
|
||||
}
|
||||
}
|
||||
me.fireEvent('comment:show', [commentId, false, isTextSelected]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -655,7 +664,7 @@ define([
|
|||
return Common.Utils.String.ellipsis(Common.Utils.String.htmlEncode(quote), 120, true);
|
||||
},
|
||||
getUserName: function (username) {
|
||||
return Common.Utils.String.htmlEncode(username);
|
||||
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
|
||||
},
|
||||
|
||||
pickLink: function (message) {
|
||||
|
|
127
apps/common/main/lib/view/EditNameDialog.js
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* EditNameDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 10.07.2020
|
||||
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/InputField'
|
||||
], function () { 'use strict';
|
||||
|
||||
Common.Views.EditNameDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
width: 330,
|
||||
header: false,
|
||||
cls: 'modal-dlg',
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
_.extend(this.options, options || {});
|
||||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div class="input-row">',
|
||||
'<label>' + (this.options.label ? this.options.label : this.textLabel) + '</label>',
|
||||
'</div>',
|
||||
'<div id="id-dlg-label-caption" class="input-row"></div>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var me = this;
|
||||
me.inputLabel = new Common.UI.InputField({
|
||||
el : $('#id-dlg-label-caption'),
|
||||
allowBlank : false,
|
||||
blankError : me.options.error ? me.options.error : me.textLabelError,
|
||||
style : 'width: 100%;',
|
||||
validateOnBlur: false,
|
||||
validation : me.options.validation || function(value) {
|
||||
return value ? true : '';
|
||||
}
|
||||
});
|
||||
me.inputLabel.setValue(this.options.value || '' );
|
||||
|
||||
var $window = this.getChild();
|
||||
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
|
||||
},
|
||||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
me.getChild('input').focus();
|
||||
},50);
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
this._handleInput('ok');
|
||||
return false;
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
if (state == 'ok') {
|
||||
if (this.inputLabel.checkValidate() !== true) {
|
||||
this.inputLabel.cmpEl.find('input').focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.options.handler.call(this, state, this.inputLabel.getValue());
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
textLabel: 'Label:',
|
||||
textLabelError: 'Label must not be empty.'
|
||||
}, Common.Views.EditNameDialog || {}));
|
||||
});
|
|
@ -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 =
|
||||
|
@ -77,7 +76,6 @@ define([
|
|||
// '<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
|
||||
'<label id="rib-doc-name" />' +
|
||||
'</section>' +
|
||||
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
|
||||
'<section style="display: inherit;">' +
|
||||
'<div class="hedset">' +
|
||||
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
|
||||
|
@ -99,7 +97,6 @@ define([
|
|||
'</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>' +
|
||||
|
@ -131,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({
|
||||
|
@ -274,17 +273,6 @@ define([
|
|||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
|
||||
}
|
||||
|
||||
if ( $saveStatus ) {
|
||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||
if (appConfig.canUseHistory) {
|
||||
// $saveStatus.on('click', function(e) {
|
||||
// me.fireEvent('history:show', ['header']);
|
||||
// });
|
||||
} else {
|
||||
$saveStatus.addClass('locked');
|
||||
}
|
||||
}
|
||||
|
||||
if ( me.btnPrint ) {
|
||||
me.btnPrint.updateHint(me.tipPrint + Common.Utils.String.platformKey('Ctrl+P'));
|
||||
me.btnPrint.on('click', function (e) {
|
||||
|
@ -333,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;
|
||||
|
||||
|
@ -385,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: {},
|
||||
|
@ -441,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);
|
||||
},
|
||||
|
@ -480,8 +441,7 @@ define([
|
|||
if ( role == 'right' ) {
|
||||
var $html = $(_.template(templateRightBox)({
|
||||
tipUsers: this.labelCoUsersDescr,
|
||||
txtAccessRights: this.txtAccessRights,
|
||||
textSaveEnd: this.textSaveEnd
|
||||
txtAccessRights: this.txtAccessRights
|
||||
}));
|
||||
|
||||
if ( !me.labelDocName ) {
|
||||
|
@ -497,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 {
|
||||
|
@ -659,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 ) {
|
||||
|
@ -723,18 +664,16 @@ define([
|
|||
|
||||
fakeMenuItem: function() {
|
||||
return {
|
||||
conf: {checked: false},
|
||||
conf: {checked: false, disabled: false},
|
||||
setChecked: function (val) { this.conf.checked = val; },
|
||||
isChecked: function () { return this.conf.checked; }
|
||||
isChecked: function () { return this.conf.checked; },
|
||||
setDisabled: function (val) { this.conf.disabled = val; },
|
||||
isDisabled: function () { return this.conf.disabled; }
|
||||
};
|
||||
},
|
||||
|
||||
textBack: 'Go to Documents',
|
||||
txtRename: 'Rename',
|
||||
textSaveBegin: 'Saving...',
|
||||
textSaveEnd: 'All changes saved',
|
||||
textSaveChanged: 'Modified',
|
||||
textSaveExpander: 'All changes saved',
|
||||
txtAccessRights: 'Change access rights',
|
||||
tipAccessRights: 'Manage document access rights',
|
||||
labelCoUsersDescr: 'Document is currently being edited by several users.',
|
||||
|
@ -745,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>',
|
||||
|
|
|
@ -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]);
|
||||
});
|
||||
|
||||
|
|
|
@ -807,7 +807,7 @@ define([
|
|||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
this._handleInput(event.currentTarget.attributes['result'].value, true);
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
|
@ -815,7 +815,11 @@ define([
|
|||
return false;
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
_handleInput: function(state, fromButton) {
|
||||
if(!fromButton && document.activeElement && document.activeElement.localName == 'textarea' && /area_id/.test(document.activeElement.id)){
|
||||
return;
|
||||
}
|
||||
|
||||
var special = this.btnSpecial.isActive();
|
||||
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
|
||||
if (this.options.handler) {
|
||||
|
|
|
@ -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"/>
|
||||
|
|
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,11 @@
|
|||
.dropdown-menu.menu-absolute {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.dropdown-menu.show-top {
|
||||
top: auto;
|
||||
bottom: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.open > .combobox.combo-dataview-menu {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
.ps-scrollbar-y-rail {
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,4 +85,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -381,7 +381,7 @@
|
|||
}
|
||||
|
||||
#title-doc-name {
|
||||
white-space: nowrap;
|
||||
white-space: pre;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
|
@ -392,7 +392,7 @@
|
|||
cursor: default;
|
||||
}
|
||||
#title-user-name {
|
||||
white-space: nowrap;
|
||||
white-space: pre;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.no-arrow {
|
||||
.tip-arrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.asc-synchronizetip {
|
||||
padding-right: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
&.inc-index {
|
||||
z-index: @zindex-navbar + 4;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
white-space: pre-wrap;
|
||||
white-space: pre;
|
||||
text-align: center;
|
||||
|
||||
&::after {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -185,7 +185,7 @@ define([
|
|||
el.find('.color-palette a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
me.currentColor = color;
|
||||
if (effectId) {
|
||||
if (effectId!==undefined) {
|
||||
me.currentColor = {color: color, effectId: effectId};
|
||||
}
|
||||
me.trigger('select', me, me.currentColor);
|
||||
|
@ -214,7 +214,7 @@ define([
|
|||
}
|
||||
|
||||
if (/^[a-fA-F0-9]{6}|transparent$/.test(color) || _.indexOf(Common.Utils.ThemeColor.getStandartColors(), color) > -1 || _.indexOf(this.dynamicColors, color) > -1) {
|
||||
el.find('.color-palette a[data-color=' + color + ']').first().addClass('active');
|
||||
el.find('.standart-colors a[data-color=' + color + '], .dynamic-colors a[data-color=' + color + ']').first().addClass('active');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,8 @@ define([
|
|||
canViewReview,
|
||||
arrChangeReview = [],
|
||||
dateChange = [],
|
||||
_fileKey;
|
||||
_fileKey,
|
||||
_currentUserGroups;
|
||||
|
||||
|
||||
return {
|
||||
|
@ -87,6 +88,7 @@ define([
|
|||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
|
||||
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
|
||||
this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
|
||||
|
@ -113,6 +115,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;
|
||||
},
|
||||
|
||||
|
@ -216,6 +230,13 @@ define([
|
|||
me.initComments();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
|
||||
} else {
|
||||
var length = 0;
|
||||
_.each(editUsers, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
(length<1) && $('#item-edit-users').hide();
|
||||
|
||||
if(editor === 'DE' && !this.appConfig.canReview && !canViewReview) {
|
||||
$('#reviewing-settings').hide();
|
||||
}
|
||||
|
@ -228,20 +249,35 @@ define([
|
|||
editUsers = users;
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in editUsers) {
|
||||
if (undefined !== uid) {
|
||||
var user = editUsers[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
editUsers[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (editUsers[change.asc_getId()] = change);
|
||||
},
|
||||
|
||||
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();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
if((item.asc_getState()!==false) && !item.asc_getView()) {
|
||||
var userAttr = {
|
||||
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 +336,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 +450,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 +711,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 +723,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 +787,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();
|
||||
|
@ -779,9 +830,6 @@ define([
|
|||
me.indexCurrentComment = 0;
|
||||
me.updateViewComment();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(true);
|
||||
}
|
||||
},
|
||||
|
||||
apiHideComments: function() {
|
||||
|
@ -789,9 +837,6 @@ define([
|
|||
uiApp.closeModal();
|
||||
$('.container-view-comment').remove();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(false);
|
||||
}
|
||||
},
|
||||
|
||||
disabledViewComments: function(disabled) {
|
||||
|
@ -1310,8 +1355,11 @@ define([
|
|||
onEditComment: function(comment) {
|
||||
var value = $('#comment-text')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.comment = value;
|
||||
comment.userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
|
@ -1390,9 +1438,12 @@ define([
|
|||
onEditReply: function(comment, indReply) {
|
||||
var value = $('.edit-reply-textarea')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
|
@ -1409,6 +1460,8 @@ define([
|
|||
} else {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
rootView.router.back();
|
||||
|
@ -1483,7 +1536,9 @@ define([
|
|||
date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
@ -1504,8 +1559,10 @@ define([
|
|||
readSDKComment: function(id, data) {
|
||||
var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}),
|
||||
groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
var groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var username = data.asc_getUserName();
|
||||
var comment = {
|
||||
uid : id,
|
||||
|
@ -1546,7 +1603,9 @@ define([
|
|||
date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
comment.comment = data.asc_getText();
|
||||
comment.userid = data.asc_getUserId();
|
||||
comment.username = data.asc_getUserName();
|
||||
|
@ -1566,7 +1625,9 @@ define([
|
|||
dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<li id="item-edit-users">
|
||||
<a id="list-edit-users" class="item-link" data-page="#edit-users-view">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
|
|
|
@ -175,9 +175,9 @@ define([
|
|||
'<div class="item-inner">' +
|
||||
'<div class="header-comment"><div class="comment-left">';
|
||||
if (isAndroid) {
|
||||
template += '<div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>';
|
||||
template += '<div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + 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>';
|
||||
|
@ -200,9 +200,9 @@ define([
|
|||
'<div class="header-reply">' +
|
||||
'<div class="reply-left">';
|
||||
if (isAndroid) {
|
||||
template += '<div class="initials-reply" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>'
|
||||
template += '<div class="initials-reply" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + 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) {
|
||||
|
@ -248,8 +248,8 @@ define([
|
|||
'<li class="comment item-content" data-uid="<%= item.uid %>">',
|
||||
'<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>',
|
||||
'<% if (android) { %><div class="initials-comment" style="background-color:<% if (item.usercolor!==null) { %><%=item.usercolor%><% } else { %> #cfcfcf <% } %>;"> <%= item.userInitials %></div><div><% } %>',
|
||||
'<div class="user-name"><%= scope.getUserName(item.username) %></div>',
|
||||
'<div class="comment-date"><%= item.date %></div>',
|
||||
'<% if (android) { %></div><% } %>',
|
||||
'</div>',
|
||||
|
@ -270,8 +270,8 @@ define([
|
|||
'<li class="reply-item" data-ind="<%= reply.ind %>">',
|
||||
'<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>',
|
||||
'<% if (android) { %><div class="initials-reply" style="background-color: <% if (reply.usercolor!==null) { %><%=reply.usercolor%><% } else { %> #cfcfcf <% } %>;"><%= reply.userInitials %></div><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(''));
|
||||
|
@ -303,8 +304,8 @@ define([
|
|||
var $pageEdit = $('.page-edit-comment .page-content');
|
||||
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>' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><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>' +
|
||||
|
@ -329,8 +330,8 @@ define([
|
|||
var $pageEdit = $('.page-edit-reply .page-content');
|
||||
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>' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><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>' +
|
||||
|
@ -400,8 +401,8 @@ define([
|
|||
'<div class="page-edit-comment">' +
|
||||
'<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>' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><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>' +
|
||||
|
@ -426,8 +427,8 @@ define([
|
|||
'<div class="page add-comment">' +
|
||||
'<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>' +
|
||||
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><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',
|
||||
|
|
|
@ -164,3 +164,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -168,4 +168,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -126,5 +126,5 @@ define([
|
|||
new IScroll(targetSelector);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -91,12 +91,16 @@ DE.ApplicationController = new(function(){
|
|||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo();
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
_user.put_Id(config.user && config.user.id ? config.user.id : ('uid-' + Date.now()));
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
|
@ -229,6 +233,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 +283,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'
|
||||
|
|
|
@ -24,5 +24,6 @@
|
|||
"DE.ApplicationController.waitText": "Čekejte prosím…",
|
||||
"DE.ApplicationView.txtDownload": "Stáhnout",
|
||||
"DE.ApplicationView.txtFullScreen": "Na celou obrazovku",
|
||||
"DE.ApplicationView.txtPrint": "Tisk",
|
||||
"DE.ApplicationView.txtShare": "Sdílet"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Hent",
|
||||
"DE.ApplicationView.txtEmbed": "Indlejre",
|
||||
"DE.ApplicationView.txtFullScreen": "Fuld skærm",
|
||||
"DE.ApplicationView.txtPrint": "Print",
|
||||
"DE.ApplicationView.txtShare": "Del"
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
"DE.ApplicationController.errorFilePassProtect": "Das Dokument ist kennwortgeschützt und kann nicht geöffnet werden.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Die Dateigröße überschreitet die für Ihren Server festgelegte Einschränkung.<br>Weitere Informationen können Sie von Ihrem Document Server-Administrator erhalten.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Die Internetverbindung wurde wiederhergestellt und die Dateiversion wurde geändert.<br>Bevor Sie weiterarbeiten können, müssen Sie die Datei herunterladen oder den Inhalt kopieren, um sicherzustellen, dass nichts verloren geht, und diese Seite anschließend neu laden.",
|
||||
"DE.ApplicationController.errorUserDrop": "Kein Zugriff auf diese Datei ist möglich.",
|
||||
"DE.ApplicationController.errorUserDrop": "Der Zugriff auf diese Datei ist nicht möglich.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Warnung",
|
||||
"DE.ApplicationController.scriptLoadError": "Die Verbindung ist zu langsam, einige der Komponenten konnten nicht geladen werden. Bitte laden Sie die Seite erneut.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Dokument wird geladen...",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Herunterladen",
|
||||
"DE.ApplicationView.txtEmbed": "Einbetten",
|
||||
"DE.ApplicationView.txtFullScreen": "Vollbild-Modus",
|
||||
"DE.ApplicationView.txtPrint": "Drucken",
|
||||
"DE.ApplicationView.txtShare": "Freigeben"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Download",
|
||||
"DE.ApplicationView.txtEmbed": "Embed",
|
||||
"DE.ApplicationView.txtFullScreen": "Full Screen",
|
||||
"DE.ApplicationView.txtPrint": "Print",
|
||||
"DE.ApplicationView.txtShare": "Share"
|
||||
}
|
|
@ -5,26 +5,27 @@
|
|||
"common.view.modals.txtShare": "Compartir enlace",
|
||||
"common.view.modals.txtWidth": "Ancho",
|
||||
"DE.ApplicationController.convertationErrorText": "Fallo de conversión.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Límite de tiempo de conversión está superado.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Se superó el tiempo de espera de conversión.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Error",
|
||||
"DE.ApplicationController.downloadErrorText": "Fallo en descarga.",
|
||||
"DE.ApplicationController.downloadTextText": "Cargando documento...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Usted no tiene permisos para realizar la acción que está intentando hacer.<br> Por favor, contacte con su Administrador del Servidor de Documentos.",
|
||||
"DE.ApplicationController.downloadErrorText": "Error en la descarga",
|
||||
"DE.ApplicationController.downloadTextText": "Descargando documento...",
|
||||
"DE.ApplicationController.errorAccessDeny": "Está tratando de realizar una acción para la cual no tiene permiso.<br> Por favor, contacte con su Administrador del Servidor de Documentos.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Código de error: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "El archivo está protegido por una contraseña y no puede ser abierto.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "El tamaño del archivo excede la limitación establecida para su servidor. Póngase en contacto con el administrador del Servidor de documentos para obtener más información.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "El tamaño del archivo excede el límite establecido para su servidor. Por favor póngase en contacto con el administrador del Servidor de Documentos para obtener más información.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "La conexión a Internet ha sido restaurada, y la versión del archivo ha sido cambiada. Antes de poder seguir trabajando, es necesario descargar el archivo o copiar su contenido para asegurarse de que no se pierda nada, y luego recargar esta página.",
|
||||
"DE.ApplicationController.errorUserDrop": "No se puede acceder al archivo ahora mismo.",
|
||||
"DE.ApplicationController.errorUserDrop": "No se puede acceder al archivo en este momento.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Aviso",
|
||||
"DE.ApplicationController.scriptLoadError": "La conexión a Internet es demasiado lenta, no se podía cargar algunos componentes. Por favor, recargue la página.",
|
||||
"DE.ApplicationController.scriptLoadError": "La conexión a Internet es demasiado lenta, algunos de los componentes no se han podido cargar. Por favor, recargue la página.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Cargando documento",
|
||||
"DE.ApplicationController.textOf": "de",
|
||||
"DE.ApplicationController.txtClose": "Cerrar",
|
||||
"DE.ApplicationController.unknownErrorText": "Error desconocido.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Su navegador no está soportado.",
|
||||
"DE.ApplicationController.unsupportedBrowserErrorText": "Su navegador no es compatible.",
|
||||
"DE.ApplicationController.waitText": "Por favor, espere...",
|
||||
"DE.ApplicationView.txtDownload": "Descargar",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporar",
|
||||
"DE.ApplicationView.txtFullScreen": "Pantalla Completa",
|
||||
"DE.ApplicationView.txtPrint": "Imprimir",
|
||||
"DE.ApplicationView.txtShare": "Compartir"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "Vous tentez d'exéсuter une action pour laquelle vous ne disposez pas des droits.<br>Veuillez contacter l'administrateur de Document Server.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Code d'erreur: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Le fichier est protégé par le mot de passe et ne peut pas être ouvert.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "La taille du fichier dépasse les limites établies sur votre serveur.<br>Veuillez contacter votre administrateur de Document Server pour obtenir plus d'information. ",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "La taille du fichier dépasse les limites établies sur votre serveur.<br>Veuillez contacter votre administrateur de Document Server pour obtenir plus d'informations. ",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "La connexion internet a été rétablie, la version du fichier est modifiée.<br>Avant de continuer, téléchargez le fichier ou copiez le contenu pour vous assurer que tous les changements ont été enregistrés, et rechargez la page.",
|
||||
"DE.ApplicationController.errorUserDrop": "Impossible d'accéder au fichier.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Avertissement",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Télécharger",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporer",
|
||||
"DE.ApplicationView.txtFullScreen": "Plein écran",
|
||||
"DE.ApplicationView.txtPrint": "Imprimer",
|
||||
"DE.ApplicationView.txtShare": "Partager"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Scarica",
|
||||
"DE.ApplicationView.txtEmbed": "Incorpora",
|
||||
"DE.ApplicationView.txtFullScreen": "Schermo intero",
|
||||
"DE.ApplicationView.txtPrint": "Stampa",
|
||||
"DE.ApplicationView.txtShare": "Condividi"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "利用権限がない操作をしようとしました。<br>Documentサーバー管理者に連絡してください。",
|
||||
"DE.ApplicationController.errorDefaultMessage": "エラー コード: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "ドキュメントがパスワードで保護されているため開くことができません",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "ファイルサイズがサーバーで設定された制限を超過しています。<br>Documentサーバー管理者に詳細を問い合わせてください。",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "ファイルサイズがサーバーで設定された制限を超過しています。<br>Documentサーバー管理者に詳細をお問い合わせください。",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "インターネット接続が復旧し、ファイルのバージョンが更新されています。<br>作業を継続する前に、ファイルをダウンロードするか内容をコピーして、変更が消えてしまわないようにしてからページを再読み込みしてください。",
|
||||
"DE.ApplicationController.errorUserDrop": "今、ファイルにアクセスすることはできません。",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "警告",
|
||||
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "ダウンロード",
|
||||
"DE.ApplicationView.txtEmbed": "埋め込み",
|
||||
"DE.ApplicationView.txtFullScreen": "全画面表示",
|
||||
"DE.ApplicationView.txtPrint": "印刷する",
|
||||
"DE.ApplicationView.txtShare": "シェア"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Downloaden",
|
||||
"DE.ApplicationView.txtEmbed": "Invoegen",
|
||||
"DE.ApplicationView.txtFullScreen": "Volledig scherm",
|
||||
"DE.ApplicationView.txtPrint": "Afdrukken",
|
||||
"DE.ApplicationView.txtShare": "Delen"
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"common.view.modals.txtCopy": "Skopiuj do schowka",
|
||||
"common.view.modals.txtHeight": "Wysokość",
|
||||
"common.view.modals.txtShare": "Udostępnij link",
|
||||
"common.view.modals.txtWidth": "Szerokość",
|
||||
"DE.ApplicationController.convertationErrorText": "Konwertowanie nieudane.",
|
||||
"DE.ApplicationController.convertationTimeoutText": "Przekroczono limit czasu konwersji.",
|
||||
"DE.ApplicationController.criticalErrorTitle": "Błąd",
|
||||
"DE.ApplicationController.downloadErrorText": "Pobieranie nieudane.",
|
||||
|
@ -9,8 +11,11 @@
|
|||
"DE.ApplicationController.errorAccessDeny": "Próbujesz wykonać działanie, na które nie masz uprawnień.<br>Proszę skontaktować się z administratorem serwera dokumentów.",
|
||||
"DE.ApplicationController.errorDefaultMessage": "Kod błędu: %1",
|
||||
"DE.ApplicationController.errorFilePassProtect": "Dokument jest chroniony hasłem i nie może być otwarty.",
|
||||
"DE.ApplicationController.errorFileSizeExceed": "Rozmiar pliku przekracza dopuszczone limit dla twojego serwera.<br>Prosimy o kontakt z administratorem twojego serwera w celu uzyskania szczegółowych informacji.",
|
||||
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "Połączenie z internetem zostało odzyskane, a wersja pliku uległa zmianie.<br>Zanim będzie mógł kontynuować pracę, musisz pobrać plik albo skopiować jego zawartość, aby mieć pewność, że nic nie zostało utracone, a następnie odświeżyć stronę.",
|
||||
"DE.ApplicationController.errorUserDrop": "Nie można uzyskać dostępu do tego pliku.",
|
||||
"DE.ApplicationController.notcriticalErrorTitle": "Ostrzeżenie",
|
||||
"DE.ApplicationController.scriptLoadError": "Połączenie jest zbyt wolne, niektóre komponenty mogą być niezaładowane. Prosimy odświeżyć stronę.",
|
||||
"DE.ApplicationController.textLoadingDocument": "Ładowanie dokumentu",
|
||||
"DE.ApplicationController.textOf": "z",
|
||||
"DE.ApplicationController.txtClose": "Zamknij",
|
||||
|
@ -19,5 +24,6 @@
|
|||
"DE.ApplicationController.waitText": "Proszę czekać...",
|
||||
"DE.ApplicationView.txtDownload": "Pobierz",
|
||||
"DE.ApplicationView.txtFullScreen": "Pełny ekran",
|
||||
"DE.ApplicationView.txtPrint": "Drukuj",
|
||||
"DE.ApplicationView.txtShare": "Udostępnij"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Transferir",
|
||||
"DE.ApplicationView.txtEmbed": "Incorporar",
|
||||
"DE.ApplicationView.txtFullScreen": "Tela cheia",
|
||||
"DE.ApplicationView.txtPrint": "Imprimir",
|
||||
"DE.ApplicationView.txtShare": "Compartilhar"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Скачать файл",
|
||||
"DE.ApplicationView.txtEmbed": "Встроить",
|
||||
"DE.ApplicationView.txtFullScreen": "Во весь экран",
|
||||
"DE.ApplicationView.txtPrint": "Печать",
|
||||
"DE.ApplicationView.txtShare": "Поделиться"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Stiahnuť",
|
||||
"DE.ApplicationView.txtEmbed": "Vložiť",
|
||||
"DE.ApplicationView.txtFullScreen": "Celá obrazovka",
|
||||
"DE.ApplicationView.txtPrint": "Tlačiť",
|
||||
"DE.ApplicationView.txtShare": "Zdieľať"
|
||||
}
|
|
@ -26,5 +26,6 @@
|
|||
"DE.ApplicationView.txtDownload": "Ladda ner",
|
||||
"DE.ApplicationView.txtEmbed": "Inbädda",
|
||||
"DE.ApplicationView.txtFullScreen": "Fullskärm",
|
||||
"DE.ApplicationView.txtPrint": "Skriva ut",
|
||||
"DE.ApplicationView.txtShare": "Dela"
|
||||
}
|
|
@ -46,7 +46,9 @@ 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',
|
||||
'documenteditor/main/app/view/CrossReferenceDialog'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
|
@ -68,7 +70,8 @@ define([
|
|||
'links:notes': this.onNotesClick,
|
||||
'links:hyperlink': this.onHyperlinkClick,
|
||||
'links:bookmarks': this.onBookmarksClick,
|
||||
'links:caption': this.onCaptionClick
|
||||
'links:caption': this.onCaptionClick,
|
||||
'links:crossref': this.onCrossRefClick
|
||||
},
|
||||
'DocumentHolder': {
|
||||
'links:contents': this.onTableContents,
|
||||
|
@ -153,12 +156,15 @@ define([
|
|||
this._state.in_object = in_image || in_table || in_equation;
|
||||
|
||||
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
|
||||
control_plain = (control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
|
||||
control_plain = (control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false,
|
||||
lock_type = control_props ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
|
||||
content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
|
||||
var rich_del_lock = (frame_pr) ? !frame_pr.can_DeleteBlockContentControl() : false,
|
||||
rich_edit_lock = (frame_pr) ? !frame_pr.can_EditBlockContentControl() : false,
|
||||
plain_del_lock = (frame_pr) ? !frame_pr.can_DeleteInlineContentControl() : false,
|
||||
plain_edit_lock = (frame_pr) ? !frame_pr.can_EditInlineContentControl() : false;
|
||||
|
||||
|
||||
var need_disable = paragraph_locked || in_equation || in_image || in_header || control_plain || rich_edit_lock || plain_edit_lock;
|
||||
this.view.btnsNotes.setDisabled(need_disable);
|
||||
|
||||
|
@ -170,6 +176,10 @@ define([
|
|||
|
||||
need_disable = in_header;
|
||||
this.view.btnCaption.setDisabled(need_disable);
|
||||
|
||||
need_disable = paragraph_locked || header_locked || control_plain || rich_edit_lock || plain_edit_lock || content_locked;
|
||||
this.view.btnCrossRef.setDisabled(need_disable);
|
||||
this.dlgCrossRefDialog && this.dlgCrossRefDialog.isVisible() && this.dlgCrossRefDialog.setLocked(need_disable);
|
||||
},
|
||||
|
||||
onApiCanAddHyperlink: function(value) {
|
||||
|
@ -292,33 +302,43 @@ 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(true, false);
|
||||
(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(),
|
||||
isFootNote = me.api.asc_IsCursorInFootnote();
|
||||
isEndNote = (isEndNote || isFootNote) ? isEndNote : Common.Utils.InternalSettings.get("de-settings-note-last") || false;
|
||||
(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);
|
||||
if (result == 'insert' || result == 'apply') {
|
||||
Common.Utils.InternalSettings.set("de-settings-note-last", settings.isEndNote);
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
},
|
||||
props: me.api.asc_GetFootnoteProps()
|
||||
isEndNote: isEndNote,
|
||||
hasSections: me.api.asc_GetSectionsCount()>1,
|
||||
props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps()
|
||||
})).show();
|
||||
break;
|
||||
case 'prev':
|
||||
|
@ -333,6 +353,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;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -408,6 +458,24 @@ define([
|
|||
|
||||
onShowContentControlsActions: function(obj, x, y) {
|
||||
(obj.type == Asc.c_oAscContentControlSpecificType.TOC) && this.onShowTOCActions(obj, x, y);
|
||||
},
|
||||
|
||||
onCrossRefClick: function(btn) {
|
||||
if (this.dlgCrossRefDialog && this.dlgCrossRefDialog.isVisible()) return;
|
||||
|
||||
var me = this;
|
||||
me.dlgCrossRefDialog = new DE.Views.CrossReferenceDialog({
|
||||
api: me.api,
|
||||
crossRefProps: me.crossRefProps,
|
||||
handler: function (result, settings) {
|
||||
if (result != 'ok')
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
});
|
||||
me.dlgCrossRefDialog.on('close', function(obj){
|
||||
me.crossRefProps = me.dlgCrossRefDialog.getSettings();
|
||||
});
|
||||
me.dlgCrossRefDialog.show();
|
||||
}
|
||||
|
||||
}, DE.Controllers.Links || {}));
|
||||
|
|
|
@ -372,8 +372,7 @@ define([
|
|||
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);
|
||||
|
@ -1056,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(){
|
||||
|
@ -1086,6 +1087,8 @@ define([
|
|||
} else {
|
||||
documentHolderController.getView().createDelayedElementsViewer();
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
me.applyLicense();
|
||||
}
|
||||
|
||||
// TODO bug 43960
|
||||
|
@ -1115,7 +1118,8 @@ define([
|
|||
onLicenseChanged: function(params) {
|
||||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' &&
|
||||
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS))
|
||||
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|
||||
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady)
|
||||
|
@ -1127,7 +1131,11 @@ define([
|
|||
var license = this._state.licenseType,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
|
||||
(license===Asc.c_oLicenseResult.SuccessLimit || license===Asc.c_oLicenseResult.ExpiredLimited || this.appOptions.permissionsLicense===Asc.c_oLicenseResult.SuccessLimit)) {
|
||||
(license===Asc.c_oLicenseResult.ExpiredLimited) && this.getApplication().getController('LeftMenu').leftMenu.setLimitMode();// show limited hint
|
||||
license = (license===Asc.c_oLicenseResult.ExpiredLimited) ? this.warnLicenseLimitedNoAccess : this.warnLicenseLimitedRenewed;
|
||||
} else if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded;
|
||||
} else {
|
||||
license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers;
|
||||
|
@ -1135,15 +1143,17 @@ define([
|
|||
primary = 'buynow';
|
||||
}
|
||||
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("de-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
var now = (new Date).getTime();
|
||||
if (now - value > 86400000) {
|
||||
Common.UI.info({
|
||||
width: 500,
|
||||
maxwidth: 500,
|
||||
title: this.textNoLicenseTitle,
|
||||
msg : license,
|
||||
buttons: buttons,
|
||||
|
@ -1190,6 +1200,8 @@ define([
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (Asc.c_oLicenseResult.ExpiredLimited === licType)
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if ( this.onServerVersion(params.asc_getBuildVersion()) ) return;
|
||||
|
||||
|
@ -1198,6 +1210,7 @@ define([
|
|||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
this.permissions.edit = this.permissions.review = false;
|
||||
|
||||
this.appOptions.permissionsLicense = licType;
|
||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
this.appOptions.isLightVersion = params.asc_getIsLight();
|
||||
|
@ -1216,7 +1229,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');
|
||||
|
@ -1225,7 +1238,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!==false);
|
||||
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;
|
||||
|
@ -1236,7 +1249,7 @@ define([
|
|||
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
|
||||
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||
this.appOptions.canFillForms = ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
||||
this.appOptions.canFillForms = this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
||||
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms);
|
||||
if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms
|
||||
this.appOptions.canComments = false;
|
||||
|
@ -1261,6 +1274,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);
|
||||
|
@ -1283,11 +1300,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.");
|
||||
if (this.permissions.rename !== undefined)
|
||||
console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead.");
|
||||
},
|
||||
|
||||
applyModeCommonElements: function() {
|
||||
|
@ -1427,7 +1439,7 @@ define([
|
|||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationSaveError:
|
||||
config.msg = this.saveErrorText;
|
||||
config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.saveErrorTextDesktop : this.saveErrorText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.DownloadError:
|
||||
|
@ -2296,6 +2308,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',
|
||||
|
@ -2649,7 +2699,10 @@ define([
|
|||
txtEnterDate: 'Enter a date.',
|
||||
txtTypeEquation: 'Type equation here.',
|
||||
textHasMacros: 'The file contains automatic macros.<br>Do you want to run macros?',
|
||||
textRemember: 'Remember my choice'
|
||||
textRemember: 'Remember my choice',
|
||||
warnLicenseLimitedRenewed: 'License needs to be renewed.<br>You have a limited access to document editing functionality.<br>Please contact your administrator to get full access',
|
||||
warnLicenseLimitedNoAccess: 'License expired.<br>You have no access to document editing functionality.<br>Please contact your administrator.',
|
||||
saveErrorTextDesktop: 'This file cannot be saved or created.<br>Possible reasons are: <br>1. The file is read-only. <br>2. The file is being edited by other users. <br>3. The disk is full or corrupted.'
|
||||
}
|
||||
})(), DE.Controllers.Main || {}))
|
||||
});
|