Skip to content

Commit

Permalink
Merge branch hotfix/v8.3.1 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
papacarlo committed Feb 27, 2025
2 parents 3844317 + 655c843 commit 090ef83
Show file tree
Hide file tree
Showing 314 changed files with 6,761 additions and 6,004 deletions.
6 changes: 4 additions & 2 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
tabBackground: {
mode: 'header'/'toolbar' // init value, 'header' by default
change: true/false // show/hide feature
} / 'header'/'toolbar' // if string - use as init value
} / 'header'/'toolbar' // if string - use as init value,
featuresTips: false/true // show tips about new feature
},
font: {
name: "Arial",
Expand Down Expand Up @@ -332,7 +333,8 @@
url: 'document url',
fileType: 'document file type',
key: 'key',
vkey: 'vkey'
vkey: 'vkey',
isForm: 'pdf form' / false/true
},
editorConfig: {
licenseUrl: <url for license>,
Expand Down
6 changes: 3 additions & 3 deletions apps/common/main/lib/component/LoadMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ define([
template: _.template([
'<div id="<%= id %>" class="asc-loadmask-body <%= cls %>" role="presentation" tabindex="-1">',
'<i id="loadmask-spinner" class="asc-loadmask-image"></i>',
'<div class="asc-loadmask-title"><%= title %></div>',
'<div class="asc-loadmask-title"><%- title %></div>',
'</div>'
].join('')),

Expand Down Expand Up @@ -129,7 +129,7 @@ define([
var me = this;
if (me.title != me.options.title) {
me.options.title = me.title;
$('.asc-loadmask-title', this.loaderEl).html(me.title);
$('.asc-loadmask-title', this.loaderEl).html(Common.Utils.String.htmlEncode(me.title));
}

if (immediately) {
Expand Down Expand Up @@ -168,7 +168,7 @@ define([

if (this.ownerEl && this.ownerEl.hasloader && this.loaderEl){
var el = $('.asc-loadmask-title', this.loaderEl);
el.html(title);
el.html(Common.Utils.String.htmlEncode(title));
this.loaderEl.css('min-width', el.width() + 105);
}
},
Expand Down
8 changes: 8 additions & 0 deletions apps/common/main/lib/controller/Desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,14 @@ define([
t == utils.defines.FileFormat.FILE_CROSSPLATFORM_PDF ||
t == utils.defines.FileFormat.FILE_CROSSPLATFORM_DJVU ||
t == utils.defines.FileFormat.FILE_CROSSPLATFORM_XPS;
} else
if ( window.VE ) {
return t == utils.defines.FileFormat.FILE_DRAW_VSDX ||
t == utils.defines.FileFormat.FILE_DRAW_VSDM ||
t == utils.defines.FileFormat.FILE_DRAW_VSTX ||
t == utils.defines.FileFormat.FILE_DRAW_VSTM ||
t == utils.defines.FileFormat.FILE_DRAW_VSSX ||
t == utils.defines.FileFormat.FILE_DRAW_VSSM;
}

return false;
Expand Down
1 change: 1 addition & 0 deletions apps/common/main/lib/view/Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ define([
],
lock = (this.appPrefix === 'de-') ? [_set.headerLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.docLockViewIns, _set.docLockForms, _set.docLockCommentsIns, _set.viewMode] :
(this.appPrefix === 'pe-') ? [_set.slideDeleted, _set.lostConnect, _set.noSlides] :
(this.appPrefix === 'pdfe-') ? [_set.pageDeleted, _set.lostConnect] :
[_set.editCell, _set.lostConnect, _set.coAuth, _set['Objects']],
me = this;
penOptions.forEach(function (props) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/common/main/resources/img/toolbar/2.5x/btn-pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/common/main/resources/img/toolbar/2.5x/btn-unpin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 25 additions & 6 deletions apps/common/mobile/lib/controller/Draw.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export const DrawController = inject('storeAppOptions')(observer(({ storeAppOpti
}
return storageColors
})
const [enableErasing, setEnableErasing] = useState(true);

const onApiFocusObject = () => {
if (storeAppOptions.isDrawMode) {
const api = Common.EditorApi.get();
setEnableErasing(api.asc_HaveInks());
}
}

useEffect(() => {
Common.Notifications.on('draw:start', () => {
Expand All @@ -36,9 +44,14 @@ export const DrawController = inject('storeAppOptions')(observer(({ storeAppOpti
setCurrentToolAndApply('scroll');
})

Common.Notifications.on('engineCreated', api => {
api.asc_registerCallback(window.editorType === 'sse' ? 'asc_onSelectionChanged' : 'asc_onFocusObject', onApiFocusObject);
});

return () => {
Common.Notifications.off('draw:start');
Common.Notifications.off('draw:stop');
Common.Notifications.off('engineCreated');
}
}, []);

Expand All @@ -53,18 +66,23 @@ export const DrawController = inject('storeAppOptions')(observer(({ storeAppOpti
};

const toolActions = {
pen: (api, settings) => api.asc_StartDrawInk(createStroke(settings.pen.color, settings.pen.lineSize, settings.pen.opacity), 0),
highlighter: (api, settings) => api.asc_StartDrawInk(createStroke(settings.highlighter.color, settings.highlighter.lineSize, settings.highlighter.opacity), 1),
pen: (api, settings) => api.asc_StartDrawInk(createStroke(settings.pen.color, settings.pen.lineSize, settings.pen.opacity)),
highlighter: (api, settings) => api.asc_StartDrawInk(createStroke(settings.highlighter.color, settings.highlighter.lineSize, settings.highlighter.opacity)),
eraser: (api) => api.asc_StartInkEraser(),
eraseEntireScreen: (api) => {/* fixme: method */
},
eraseEntireScreen: (api) => api.asc_RemoveAllInks(),
scroll: (api) => api.asc_StopInkDrawer(),
};

const setCurrentToolAndApply = (tool) => {
const api = Common.EditorApi.get();
toolActions[tool]?.(api, toolSettings);
setCurrentTool(tool);
if (tool === 'eraseEntireScreen') {
toolActions.eraseEntireScreen(api);
toolActions[currentTool]?.(api, toolSettings);
setEnableErasing(false);
} else {
setCurrentTool(tool);
toolActions[tool]?.(api, toolSettings);
}
};

const updateToolSettings = (newSettings) => {
Expand All @@ -91,5 +109,6 @@ export const DrawController = inject('storeAppOptions')(observer(({ storeAppOpti
setSettings={updateToolSettings}
colors={colors}
addCustomColor={addCustomColor}
enableErasing={enableErasing}
/> : null
}));
18 changes: 10 additions & 8 deletions apps/common/mobile/lib/view/Draw.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IconScroll from '../../../../common/mobile/resources/icons/scroll.svg'
import { WheelColorPicker } from "../component/WheelColorPicker";
import { Device } from "../../utils/device";

export const DrawView = ({ currentTool, setTool, settings, setSettings, colors, addCustomColor }) => {
export const DrawView = ({ currentTool, setTool, settings, setSettings, colors, addCustomColor, enableErasing }) => {
const { t } = useTranslation();
const _t = t('Draw', { returnObjects: true });
const isDrawingTool = currentTool === 'pen' || currentTool === 'highlighter';
Expand All @@ -37,8 +37,10 @@ export const DrawView = ({ currentTool, setTool, settings, setSettings, colors,
<div className="draw-sheet--settings-colors-list">
{colors.map((color, index) => (
<div
key={index} className="draw-sheet--settings-colors-list-item" style={{ backgroundColor: color }}
key={index}
className="draw-sheet--settings-colors-list-item" style={{ backgroundColor: color }}
onClick={() => setSettings({ color })}
onTouchStart={() => setSettings({ color })}
/>
))}
<div
Expand Down Expand Up @@ -94,15 +96,15 @@ export const DrawView = ({ currentTool, setTool, settings, setSettings, colors,
<div className='draw-toolbar-divider'/>
</div>
<div className="draw-toolbar-item">
<Button type='button' disabled={false} fill={currentTool === 'eraser'} onClick={() => setTool('eraser')}>
<Button type='button' disabled={!enableErasing} fill={currentTool === 'eraser'} onClick={() => setTool('eraser')}>
<SvgIcon symbolId={IconClearObject.id} className='icon icon-svg'/>
</Button>
</div>
{/*<div className="draw-toolbar-item">*/}
{/* <Button type='button' disabled={false} onClick={() => setTool('eraseEntireScreen')}>*/}
{/* <SvgIcon symbolId={IconClearAll.id} className='icon icon-svg'/>*/}
{/* </Button>*/}
{/*</div>*/}
<div className="draw-toolbar-item">
<Button type='button' disabled={!enableErasing} onClick={() => setTool('eraseEntireScreen')}>
<SvgIcon symbolId={IconClearAll.id} className='icon icon-svg'/>
</Button>
</div>
<div className="draw-toolbar-item">
<div className='draw-toolbar-divider'/>
</div>
Expand Down
3 changes: 1 addition & 2 deletions apps/common/mobile/resources/less/draw.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@

@media (min-width: 550px) {
display: grid;
// todo: change to 8 later
grid-template-columns: repeat(7, 1fr);
grid-template-columns: repeat(8, 1fr);
}

&-item {
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/embed/locale/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"DE.ApplicationController.textConvertFormDownload": "Κατεβάστε το αρχείο ως συμπληρώσιμο PDF για να μπορείτε να το συμπληρώσετε.",
"DE.ApplicationController.textCtrl": "Ctrl",
"DE.ApplicationController.textDownloadPdf": "Λήψη PDF",
"DE.ApplicationController.textGotIt": "Ελήφθη",
"DE.ApplicationController.textGotIt": "Εντάξει",
"DE.ApplicationController.textGuest": "Επισκέπτης",
"DE.ApplicationController.textLoadingDocument": "Φόρτωση εγγράφου",
"DE.ApplicationController.textNext": "Επόμενο Πεδίο",
Expand Down
Loading

0 comments on commit 090ef83

Please sign in to comment.