From f9e91266a5b890ae9b0077e9dc3e93c110d533f2 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 29 Jan 2021 22:52:14 +0300 Subject: [PATCH 1/4] [PE mobile] Make Link Settings --- apps/presentationeditor/mobile/locale/en.json | 17 +- .../mobile/src/controller/Main.jsx | 10 +- .../mobile/src/controller/edit/EditLink.jsx | 114 ++++++++++++ .../mobile/src/store/focusObjects.js | 15 ++ .../mobile/src/view/edit/Edit.jsx | 17 +- .../mobile/src/view/edit/EditLink.jsx | 170 ++++++++++++++++++ 6 files changed, 338 insertions(+), 5 deletions(-) create mode 100644 apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx create mode 100644 apps/presentationeditor/mobile/src/view/edit/EditLink.jsx diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 7207ffc45..90493c3b3 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -228,7 +228,22 @@ "textStyleOptions": "Style Options", "textRemoveTable": "Remove Table", "textCellMargins": "Cell Margins", - "textRemoveChart": "Remove Chart" + "textRemoveChart": "Remove Chart", + "textLinkType": "Link Type", + "textExternalLink": "External Link", + "textSlideInThisPresentation": "Slide in this Presentation", + "textLink": "Link", + "textLinkTo": "Link to", + "textNextSlide": "Next Slide", + "textPreviousSlide": "Previous Slide", + "textFirstSlide": "First Slide", + "textLastSlide": "Last Slide", + "textSlideNumber": "Slide Number", + "textEditLink": "Edit Link", + "textRemoveLink": "Remove Link", + "textDisplay": "Display", + "textScreenTip": "Screen Tip", + "textDefault": "Selected text" } }, "Common": { diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 902dca3d7..1e369e2f4 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -5,7 +5,7 @@ import { f7 } from "framework7-react"; import { withTranslation } from 'react-i18next'; import CollaborationController from '../../../../common/mobile/lib/controller/Collaboration.jsx' -@inject("storeFocusObjects", "storeAppOptions", "storePresentationInfo", "storePresentationSettings", "storeSlideSettings", "storeTextSettings", "storeTableSettings", "storeChartSettings") +@inject("storeFocusObjects", "storeAppOptions", "storePresentationInfo", "storePresentationSettings", "storeSlideSettings", "storeTextSettings", "storeTableSettings", "storeChartSettings", "storeLinkSettings") class MainController extends Component { constructor(props) { super(props) @@ -316,6 +316,14 @@ class MainController extends Component { storeChartSettings.updateChartStyles(this.api.asc_getChartPreviews(storeFocusObjects.chartObject.getType())); } }); + + // Link settings + + const storeLinkSettings = this.props.storeLinkSettings; + + this.api.asc_registerCallback('asc_onCanAddHyperlink', (value) => { + storeLinkSettings.canAddHyperlink(value); + }); } _onDocumentContentReady() { diff --git a/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx new file mode 100644 index 000000000..5d740848f --- /dev/null +++ b/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx @@ -0,0 +1,114 @@ +import React, { Component } from 'react'; +import { f7 } from 'framework7-react'; +import { Device } from '../../../../../common/mobile/utils/device'; +import {observer, inject} from "mobx-react"; +import { withTranslation } from 'react-i18next'; + +import { EditLink } from '../../view/edit/EditLink'; + +class EditLinkController extends Component { + constructor (props) { + super(props); + this.onEditLink = this.onEditLink.bind(this); + this.onRemoveLink = this.onRemoveLink.bind(this); + } + + closeModal () { + if ( Device.phone ) { + f7.sheet.close('#edit-sheet', true); + } else { + f7.popover.close('#edit-popover'); + } + } + + onEditLink(type, linkInfo) { + const api = Common.EditorApi.get(); + const { t } = this.props; + const _t = t("View.Edit", { returnObjects: true }); + + const c_oHyperlinkType = { + InternalLink: 0, + WebLink: 1 + }; + + const display = linkInfo.display; + const tip = linkInfo.tip; + const props = new Asc.CHyperlinkProperty(); + let def_display = ''; + + if (type == c_oHyperlinkType.WebLink) { + let url = linkInfo.url; + const urltype = api.asc_getUrlType(url.trim()); + const isEmail = (urltype == 2); + if (urltype < 1) { + f7.dialog.alert(_t.txtNotUrl, _t.notcriticalErrorTitle); + return; + } + + url = url.replace(/^\s+|\s+$/g, ''); + if (!/(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url)) + url = (isEmail ? 'mailto:' : 'http://' ) + url; + url = url.replace(new RegExp("%20", 'g'), " "); + + props.put_Value(url); + props.put_ToolTip(tip); + def_display = url; + } else { + let url = "ppaction://hlink"; + let slidetip = ''; + switch (linkInfo.linkTo) { + case 0: + url = url + "showjump?jump=nextslide"; + slidetip = _t.textNextSlide; + break; + case 1: + url = url + "showjump?jump=previousslide"; + slidetip = _t.textPrevSlide; + break; + case 2: + url = url + "showjump?jump=firstslide"; + slidetip = _t.textFirstSlide; + break; + case 3: + url = url + "showjump?jump=lastslide"; + slidetip = _t.textLastSlide; + break; + case 4: + url = url + "sldjumpslide" + linkInfo.numberTo; + slidetip = _t.textSlide + ' ' + (linkInfo.numberTo + 1); + break; + } + props.put_Value(url); + props.put_ToolTip(!tip ? slidetip : tip); + def_display = slidetip; + } + + if (!linkInfo.displayDisabled) { + props.put_Text(!display ? def_display : display); + } else + props.put_Text(null); + + api.change_Hyperlink(props); + + this.closeModal(); + } + + onRemoveLink() { + const api = Common.EditorApi.get(); + api.remove_Hyperlink(); + this.closeModal(); + } + + render () { + return ( + + ) + } +} + +const EditLinkWithTranslation = withTranslation()(EditLinkController); + +export {EditLinkWithTranslation as EditLinkController}; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/store/focusObjects.js b/apps/presentationeditor/mobile/src/store/focusObjects.js index 9a762cbc9..01560655d 100644 --- a/apps/presentationeditor/mobile/src/store/focusObjects.js +++ b/apps/presentationeditor/mobile/src/store/focusObjects.js @@ -172,4 +172,19 @@ export class storeFocusObjects { getTopObject(charts); getTopObject(shapes); } + + @computed get linkObject() { + const links = []; + for (let object of this._focusObjects) { + if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) { + links.push(object); + } + } + if (links.length > 0) { + const object = links[links.length - 1]; // get top + return object.get_ObjectValue(); + } else { + return undefined; + } + } } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/edit/Edit.jsx b/apps/presentationeditor/mobile/src/view/edit/Edit.jsx index 155016cd5..3f9537494 100644 --- a/apps/presentationeditor/mobile/src/view/edit/Edit.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/Edit.jsx @@ -11,6 +11,7 @@ import EditShapeController from "../../controller/edit/EditShape"; import EditImageController from "../../controller/edit/EditImage"; import EditTableController from "../../controller/edit/EditTable"; import EditChartController from "../../controller/edit/EditChart"; +import { EditLinkController } from "../../controller/edit/EditLink"; import { Theme, Layout, Transition, Type, Effect, StyleFillColor, CustomFillColor } from './EditSlide'; import { PageTextFonts, PageTextFontColor, PageTextCustomFontColor, PageTextAddFormatting, PageTextBullets, PageTextNumbers, PageTextLineSpacing } from './EditText'; @@ -18,7 +19,7 @@ import { PageShapeStyle, PageShapeStyleNoFill, PageReplaceContainer, PageReorder import { PageImageReplace, PageImageReorder, PageImageAlign, PageLinkSettings } from './EditImage'; import { PageTableStyle, PageTableStyleOptions, PageTableCustomFillColor, PageTableBorderColor, PageTableCustomBorderColor, PageTableReorder, PageTableAlign } from './EditTable'; import { PageChartStyle, PageChartCustomFillColor, PageChartBorderColor, PageChartCustomBorderColor, PageChartReorder, PageChartAlign } from './EditChart' -//import EditLinkController from "../../controller/edit/EditLink"; +import { PageLinkTo, PageTypeLink } from './EditLink' const routes = [ @@ -194,6 +195,17 @@ const routes = [ { path: '/edit-chart-custom-fill-color/', component: PageChartCustomFillColor + }, + + // Link + + { + path: '/edit-link-type/', + component: PageTypeLink + }, + { + path: '/edit-link-to/', + component: PageLinkTo } ]; @@ -303,14 +315,13 @@ const EditTabs = props => { component: }) } - /* if (settings.indexOf('hyperlink') > -1) { editors.push({ caption: _t.textHyperlink, id: 'edit-link', component: }) - }*/ + } } return ( diff --git a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx new file mode 100644 index 000000000..685ce5904 --- /dev/null +++ b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx @@ -0,0 +1,170 @@ +import React, {useState} from 'react'; +import {observer, inject} from "mobx-react"; +import {List, ListItem, Page, Navbar, Icon, ListButton, ListInput, Segmented, Button} from 'framework7-react'; +import { useTranslation } from 'react-i18next'; +import {Device} from "../../../../../common/mobile/utils/device"; + +const PageTypeLink = props => { + const { t } = useTranslation(); + const _t = t('View.Edit', {returnObjects: true}); + const [typeLink, setTypeLink] = useState(props.curType); + + return ( + + + + {setTypeLink(1); props.changeType(1);}}> + {setTypeLink(0); props.changeType(0);}}> + + + ) +}; + +const PageLinkTo = props => { + const isAndroid = Device.android; + const { t } = useTranslation(); + const _t = t('View.Edit', {returnObjects: true}); + const api = Common.EditorApi.get(); + const slidesCount = api.getCountPages(); + console.log(slidesCount); + + const [stateTypeTo, setTypeTo] = useState(props.curTo); + + const changeTypeTo = (type) => { + setTypeTo(type); + props.changeTo(type); + }; + + const [stateNumberTo, setNumberTo] = useState(0); + + const changeNumber = (curNumber, isDecrement) => { + setTypeTo(4); + let value; + if (isDecrement) { + value = curNumber < slidesCount ? 0 : curNumber - 1; + + } else { + value = curNumber >= slidesCount ? slidesCount : curNumber; + } + setNumberTo(value); + props.changeTo(4, value); + }; + + return ( + + + + {changeTypeTo(0)}}> + {changeTypeTo(1)}}> + {changeTypeTo(2)}}> + {changeTypeTo(3)}}> + + {!isAndroid &&
{stateNumberTo + 1}
} +
+ + + {isAndroid && } + + +
+
+
+
+ ) +}; + +const EditLink = props => { + const { t } = useTranslation(); + const _t = t('View.Edit', {returnObjects: true}); + const storeFocusObjects = props.storeFocusObjects; + const linkObject = storeFocusObjects.linkObject; + const valueLinkObject = linkObject.get_Value(); + const tooltipLinkObject = linkObject.get_ToolTip(); + + const [typeLink, setTypeLink] = useState(1); + const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation; + + const changeType = (newType) => { + setTypeLink(newType); + }; + + const [link, setLink] = useState(valueLinkObject ? [valueLinkObject.replace(new RegExp(" ", 'g'), "%20")] : ''); + + const [linkTo, setLinkTo] = useState(0); + const [displayTo, setDisplayTo] = useState(_t.textNextSlide); + const [numberTo, setNumberTo] = useState(0); + + const changeTo = (type, number) => { + setLinkTo(type); + switch (type) { + case 0 : setDisplayTo(_t.textNextSlide); break; + case 1 : setDisplayTo(_t.textPreviousSlide); break; + case 2 : setDisplayTo(_t.textFirstSlide); break; + case 3 : setDisplayTo(_t.textLastSlide); break; + case 4 : setDisplayTo(`${_t.textSlide} ${number + 1}`); setNumberTo(number); break; + } + }; + + const display = linkObject.get_Text(); + const displayDisabled = display !== false && display === null; + const [stateDisplay, setDisplay] = useState(display !== false ? ((display !== null) ? display : _t.textDefault) : ""); + + const [screenTip, setScreenTip] = useState(tooltipLinkObject); + + return ( + + + + + {typeLink === 1 ? + {setLink(event.target.value)}} + /> : + + } + {setDisplay(event.target.value)}} + /> + {setScreenTip(event.target.value)}} + /> + + + { + props.onEditLink(typeLink, (typeLink === 1 ? + {url: link, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled } : + {linkTo: linkTo, numberTo: numberTo, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled})); + }} /> + + + + ) +}; + +const PageEditLink = inject("storeFocusObjects")(observer(EditLink)); + +export { + PageEditLink as EditLink, + PageLinkTo, + PageTypeLink +} \ No newline at end of file From eeb9bcfce8621f9818f71762b10e34d8083dd7cb Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Mon, 1 Feb 2021 23:58:52 +0300 Subject: [PATCH 2/4] [PE mobile] Added Link Settings --- .../mobile/src/store/linkSettings.js | 66 +++++++- .../mobile/src/view/edit/EditLink.jsx | 141 ++++++++++-------- 2 files changed, 144 insertions(+), 63 deletions(-) diff --git a/apps/presentationeditor/mobile/src/store/linkSettings.js b/apps/presentationeditor/mobile/src/store/linkSettings.js index 9670a6466..a6d935ad7 100644 --- a/apps/presentationeditor/mobile/src/store/linkSettings.js +++ b/apps/presentationeditor/mobile/src/store/linkSettings.js @@ -5,4 +5,68 @@ export class storeLinkSettings { @action canAddHyperlink (value) { this.canAddLink = value; } -} \ No newline at end of file + + @observable typeLink; + @action changeLinkType(value) { + this.typeLink = value; + } + + @observable slideLink; + @action changeSlideLink(value) { + this.slideLink = value; + } + + @observable slideNum; + @action changeSlideNum(value) { + this.slideNum = value; + } + + @observable slideName; + @action changeSlideName(value) { + this.slideName = value; + } + + initCategory(linkObject) { + const url = linkObject.get_Value(); + const api = Common.EditorApi.get(); + + let indAction; + let slidesCount; + let slideNum; + + if(url === null || url === undefined || url === '') { + this.changeLinkType(1); + } + else { + indAction = url.indexOf("ppaction://hlink"); + if(0 == indAction) { + if (url == "ppaction://hlinkshowjump?jump=firstslide") { + this.changeSlideLink(2); + } else if (url == "ppaction://hlinkshowjump?jump=lastslide") { + this.changeSlideLink(3); + } + else if (url == "ppaction://hlinkshowjump?jump=nextslide") { + this.changeSlideLink(0); + } + else if (url == "ppaction://hlinkshowjump?jump=previousslide") { + this.changeSlideLink(1); + } + else { + this.changeSlideLink(4); + slidesCount = api.getCountPages(); + let mask = "ppaction://hlinksldjumpslide", + indSlide = url.indexOf(mask); + if (0 == indSlide) { + slideNum = parseInt(url.substring(mask.length)); + if (slideNum < 0) this.changeSlideNum(0); + if (slideNum >= slidesCount) this.changeSlideNum(slidesCount - 1); + } else this.changeSlideNum(0); + } + this.changeLinkType(0); + } else { + this.changeLinkType(1); + } + } + } + +} diff --git a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx index 685ce5904..63bb6fdfd 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import React, {useState, useEffect} from 'react'; import {observer, inject} from "mobx-react"; import {List, ListItem, Page, Navbar, Icon, ListButton, ListInput, Segmented, Button} from 'framework7-react'; import { useTranslation } from 'react-i18next'; @@ -7,14 +7,15 @@ import {Device} from "../../../../../common/mobile/utils/device"; const PageTypeLink = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); - const [typeLink, setTypeLink] = useState(props.curType); + const storeLinkSettings = props.storeLinkSettings; + const typeLink = storeLinkSettings.typeLink; return ( - {setTypeLink(1); props.changeType(1);}}> - {setTypeLink(0); props.changeType(0);}}> + {storeLinkSettings.changeLinkType(1);}}> + {storeLinkSettings.changeLinkType(0);}}> ) @@ -26,27 +27,31 @@ const PageLinkTo = props => { const _t = t('View.Edit', {returnObjects: true}); const api = Common.EditorApi.get(); const slidesCount = api.getCountPages(); - console.log(slidesCount); - - const [stateTypeTo, setTypeTo] = useState(props.curTo); + const storeLinkSettings = props.storeLinkSettings; + const slideLink = storeLinkSettings.slideLink; + // console.log(slideLink); + // const slideNum = storeLinkSettings.slideNum; + // const [stateTypeTo, setTypeTo] = useState(props.curTo); const changeTypeTo = (type) => { - setTypeTo(type); + storeLinkSettings.changeSlideLink(type); props.changeTo(type); }; const [stateNumberTo, setNumberTo] = useState(0); const changeNumber = (curNumber, isDecrement) => { - setTypeTo(4); + storeLinkSettings.changeSlideLink(4); let value; - if (isDecrement) { - value = curNumber < slidesCount ? 0 : curNumber - 1; + if (isDecrement) { + value = Math.max(0, --curNumber); } else { - value = curNumber >= slidesCount ? slidesCount : curNumber; + value = Math.min(slidesCount - 1, ++curNumber); } + setNumberTo(value); + storeLinkSettings.changeSlideNum(value); props.changeTo(4, value); }; @@ -54,11 +59,11 @@ const PageLinkTo = props => { - {changeTypeTo(0)}}> - {changeTypeTo(1)}}> - {changeTypeTo(2)}}> - {changeTypeTo(3)}}> - + {changeTypeTo(0)}}> + {changeTypeTo(1)}}> + {changeTypeTo(2)}}> + {changeTypeTo(3)}}> + {!isAndroid &&
{stateNumberTo + 1}
}
@@ -77,52 +82,56 @@ const PageLinkTo = props => { ) }; -const EditLink = props => { +const PageLink = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); const storeFocusObjects = props.storeFocusObjects; + const storeLinkSettings = props.storeLinkSettings; const linkObject = storeFocusObjects.linkObject; - const valueLinkObject = linkObject.get_Value(); - const tooltipLinkObject = linkObject.get_ToolTip(); - - const [typeLink, setTypeLink] = useState(1); - const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation; - - const changeType = (newType) => { - setTypeLink(newType); - }; - - const [link, setLink] = useState(valueLinkObject ? [valueLinkObject.replace(new RegExp(" ", 'g'), "%20")] : ''); - - const [linkTo, setLinkTo] = useState(0); - const [displayTo, setDisplayTo] = useState(_t.textNextSlide); - const [numberTo, setNumberTo] = useState(0); - - const changeTo = (type, number) => { - setLinkTo(type); - switch (type) { - case 0 : setDisplayTo(_t.textNextSlide); break; - case 1 : setDisplayTo(_t.textPreviousSlide); break; - case 2 : setDisplayTo(_t.textFirstSlide); break; - case 3 : setDisplayTo(_t.textLastSlide); break; - case 4 : setDisplayTo(`${_t.textSlide} ${number + 1}`); setNumberTo(number); break; - } - }; + + useEffect(() => { + storeLinkSettings.initCategory(linkObject); + }, [linkObject]); + const url = linkObject.get_Value(); + const tooltip = linkObject.get_ToolTip(); const display = linkObject.get_Text(); + const slideNum = storeLinkSettings.slideNum; + const slideLink = storeLinkSettings.slideLink; + const typeLink = storeLinkSettings.typeLink; + + if(typeLink === 1) { + storeLinkSettings.changeSlideName(_t.textNextSlide); + storeLinkSettings.changeSlideLink(0); + } + + const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation; + const [link, setLink] = useState(typeLink !== 0 ? [url.replace(new RegExp(" ", 'g'), "%20")] : ''); + + const changeTo = (slideLink, number) => { + switch (slideLink) { + case 0 : storeLinkSettings.changeSlideName(_t.textNextSlide); break; + case 1 : storeLinkSettings.changeSlideName(_t.textPreviousSlide); break; + case 2 : storeLinkSettings.changeSlideName(_t.textFirstSlide); break; + case 3 : storeLinkSettings.changeSlideName(_t.textLastSlide); break; + case 4 : storeLinkSettings.changeSlideName(`${_t.textSlide} ${number + 1}`); storeLinkSettings.changeSlideNum(number); + } + } + + changeTo(slideLink, slideNum); + + const slideName = storeLinkSettings.slideName; + const [screenTip, setScreenTip] = useState(tooltip); const displayDisabled = display !== false && display === null; const [stateDisplay, setDisplay] = useState(display !== false ? ((display !== null) ? display : _t.textDefault) : ""); - const [screenTip, setScreenTip] = useState(tooltipLinkObject); - return ( + }} /> {typeLink === 1 ? { value={link} onChange={(event) => {setLink(event.target.value)}} /> : - } { /> - { - props.onEditLink(typeLink, (typeLink === 1 ? - {url: link, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled } : - {linkTo: linkTo, numberTo: numberTo, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled})); - }} /> - + { + props.onEditLink(typeLink, (typeLink === 1 ? + {url: link, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled } : + {linkTo: slideLink, numberTo: slideNum, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled})); + }} + /> + { + props.onRemoveLink() + }} + /> ) }; -const PageEditLink = inject("storeFocusObjects")(observer(EditLink)); +const EditLink = inject("storeFocusObjects", "storeLinkSettings")(observer(PageLink)); +const LinkTo = inject("storeFocusObjects", "storeLinkSettings")(observer(PageLinkTo)); +const TypeLink = inject("storeFocusObjects", "storeLinkSettings")(observer(PageTypeLink)); -export { - PageEditLink as EditLink, - PageLinkTo, - PageTypeLink -} \ No newline at end of file +export {EditLink, + LinkTo as PageLinkTo, + TypeLink as PageTypeLink} \ No newline at end of file From e8d3cd5ca57778f4929060504d0f776788521061 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Wed, 3 Feb 2021 16:16:24 +0300 Subject: [PATCH 3/4] Small edits for link settings --- .../mobile/src/controller/edit/EditLink.jsx | 2 +- apps/presentationeditor/mobile/src/view/edit/EditLink.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx index 5d740848f..953e0f2f4 100644 --- a/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx +++ b/apps/presentationeditor/mobile/src/controller/edit/EditLink.jsx @@ -41,7 +41,7 @@ class EditLinkController extends Component { const urltype = api.asc_getUrlType(url.trim()); const isEmail = (urltype == 2); if (urltype < 1) { - f7.dialog.alert(_t.txtNotUrl, _t.notcriticalErrorTitle); + f7.dialog.alert(_t.textNotUrl, _t.notcriticalErrorTitle); return; } diff --git a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx index 63bb6fdfd..109ddb416 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx @@ -106,7 +106,7 @@ const PageLink = props => { } const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation; - const [link, setLink] = useState(typeLink !== 0 ? [url.replace(new RegExp(" ", 'g'), "%20")] : ''); + const [link, setLink] = useState(typeLink !== 0 ? url : ''); const changeTo = (slideLink, number) => { switch (slideLink) { @@ -132,7 +132,7 @@ const PageLink = props => { - {typeLink === 1 ? + {typeLink !== 0 ? Date: Wed, 3 Feb 2021 20:50:23 +0300 Subject: [PATCH 4/4] [PE mobile] Added another edit to Link Settings --- apps/presentationeditor/mobile/src/view/edit/EditLink.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx index 109ddb416..95edad25e 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditLink.jsx @@ -63,7 +63,7 @@ const PageLinkTo = props => { {changeTypeTo(1)}}> {changeTypeTo(2)}}> {changeTypeTo(3)}}> - + {!isAndroid &&
{stateNumberTo + 1}
}
@@ -160,7 +160,7 @@ const PageLink = props => { { props.onEditLink(typeLink, (typeLink === 1 ? {url: link, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled } :