Merge branch 'feature/mobile-apps-on-reactjs-fixes' into feature/mobile-apps-on-reactjs
This commit is contained in:
commit
8fb2dc61d5
Binary file not shown.
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 46 KiB |
|
@ -25,6 +25,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
.title {
|
||||||
|
text-overflow: initial;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.subnavbar {
|
.subnavbar {
|
||||||
.subnavbar-inner {
|
.subnavbar-inner {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -65,6 +72,16 @@
|
||||||
padding: 14px 10px 0 10px;
|
padding: 14px 10px 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
.item-text {
|
||||||
|
text-overflow: initial;
|
||||||
|
white-space: normal;
|
||||||
|
height: auto;
|
||||||
|
max-height: initial;
|
||||||
|
-webkit-line-clamp: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.shapes {
|
.shapes {
|
||||||
li {
|
li {
|
||||||
width: 70px;
|
width: 70px;
|
||||||
|
@ -226,8 +243,8 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
box-shadow: 0 0 0 1px rgba(0,0,0,.15);
|
box-shadow: 0 0 0 1px rgba(0,0,0,.15);
|
||||||
width: 85px;
|
width: 88px;
|
||||||
height: 38px;
|
height: 40px;
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
background-image: url(../img/themes/themes.png);
|
background-image: url(../img/themes/themes.png);
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -334,7 +334,9 @@
|
||||||
"textReplaceAll": "Replace All",
|
"textReplaceAll": "Replace All",
|
||||||
"textCaseSensitive": "Case Sensitive",
|
"textCaseSensitive": "Case Sensitive",
|
||||||
"textHighlightResults": "Highlight Results",
|
"textHighlightResults": "Highlight Results",
|
||||||
"textSearch": "Search"
|
"textSearch": "Search",
|
||||||
|
"textMarginsW": "Left and right margins are too high for a given page width",
|
||||||
|
"textMarginsH": "Top and bottom margins are too high for a given page height"
|
||||||
},
|
},
|
||||||
"Edit": {
|
"Edit": {
|
||||||
"textClose": "Close",
|
"textClose": "Close",
|
||||||
|
|
|
@ -24,13 +24,13 @@ class DocumentSettingsController extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getMargins () {
|
getMargins() {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
if (api) {
|
if (api) {
|
||||||
this.localSectionProps = api.asc_GetSectionProps();
|
this.localSectionProps = api.asc_GetSectionProps();
|
||||||
if (this.localSectionProps) {
|
if (this.localSectionProps) {
|
||||||
this.maxMarginsH = this.localSectionProps.get_H() - 26;
|
this.maxMarginsH = this.localSectionProps.get_H() - 2.6;
|
||||||
this.maxMarginsW = this.localSectionProps.get_W() - 127;
|
this.maxMarginsW = this.localSectionProps.get_W() - 12.7;
|
||||||
|
|
||||||
const top = this.localSectionProps.get_TopMargin();
|
const top = this.localSectionProps.get_TopMargin();
|
||||||
const bottom = this.localSectionProps.get_BottomMargin();
|
const bottom = this.localSectionProps.get_BottomMargin();
|
||||||
|
@ -51,6 +51,7 @@ class DocumentSettingsController extends Component {
|
||||||
|
|
||||||
applyMargins (align, value) {
|
applyMargins (align, value) {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
|
||||||
if (api) {
|
if (api) {
|
||||||
switch (align) {
|
switch (align) {
|
||||||
case 'left':
|
case 'left':
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {observer, inject} from "mobx-react";
|
||||||
import {Page, Navbar, List, ListItem, BlockTitle, Segmented, Button, Icon} from 'framework7-react';
|
import {Page, Navbar, List, ListItem, BlockTitle, Segmented, Button, Icon} from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {Device} from '../../../../../common/mobile/utils/device';
|
import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
|
import { f7 } from 'framework7-react';
|
||||||
|
|
||||||
const PageDocumentFormats = props => {
|
const PageDocumentFormats = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
@ -11,6 +12,29 @@ const PageDocumentFormats = props => {
|
||||||
const pageSizesIndex = storeSettings.pageSizesIndex;
|
const pageSizesIndex = storeSettings.pageSizesIndex;
|
||||||
const pageSizes = storeSettings.getPageSizesList();
|
const pageSizes = storeSettings.getPageSizesList();
|
||||||
const textMetric = Common.Utils.Metric.getCurrentMetricName();
|
const textMetric = Common.Utils.Metric.getCurrentMetricName();
|
||||||
|
const margins = props.getMargins();
|
||||||
|
const maxMarginsW = margins.maxMarginsW;
|
||||||
|
const maxMarginsH = margins.maxMarginsH;
|
||||||
|
|
||||||
|
// console.log(margins.left, margins.right, margins.top, margins.bottom);
|
||||||
|
// console.log(maxMarginsW, maxMarginsH);
|
||||||
|
|
||||||
|
const onFormatChange = (value) => {
|
||||||
|
let errorMsg;
|
||||||
|
|
||||||
|
if (margins.left + margins.right > maxMarginsW) {
|
||||||
|
errorMsg = _t.textMarginsW;
|
||||||
|
} else if (margins.top + margins.bottom > maxMarginsH) {
|
||||||
|
errorMsg = _t.textMarginsH;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorMsg) {
|
||||||
|
f7.dialog.alert(errorMsg, _t.notcriticalErrorTitle);
|
||||||
|
} else {
|
||||||
|
props.onFormatChange(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textDocumentSettings} backLink={_t.textBack} />
|
<Navbar title={_t.textDocumentSettings} backLink={_t.textBack} />
|
||||||
|
@ -21,7 +45,7 @@ const PageDocumentFormats = props => {
|
||||||
subtitle={parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[0]).toFixed(2)) + ' ' + textMetric + ' x ' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[1]).toFixed(2)) + ' ' + textMetric}
|
subtitle={parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[0]).toFixed(2)) + ' ' + textMetric + ' x ' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[1]).toFixed(2)) + ' ' + textMetric}
|
||||||
name="format-size-checkbox"
|
name="format-size-checkbox"
|
||||||
checked={pageSizesIndex === index}
|
checked={pageSizesIndex === index}
|
||||||
onClick={e => {props.onFormatChange(item.value)}}
|
onClick={e => onFormatChange(item.value)}
|
||||||
></ListItem>)}
|
></ListItem>)}
|
||||||
</List>
|
</List>
|
||||||
</Page>
|
</Page>
|
||||||
|
@ -38,26 +62,31 @@ const PageDocumentMargins = props => {
|
||||||
const [stateBottom, setBottom] = useState(margins.bottom);
|
const [stateBottom, setBottom] = useState(margins.bottom);
|
||||||
const [stateLeft, setLeft] = useState(margins.left);
|
const [stateLeft, setLeft] = useState(margins.left);
|
||||||
const [stateRight, setRight] = useState(margins.right);
|
const [stateRight, setRight] = useState(margins.right);
|
||||||
|
|
||||||
const onChangeMargins = (align, isDecrement) => {
|
const onChangeMargins = (align, isDecrement) => {
|
||||||
const step = Common.Utils.Metric.fnRecalcToMM(Common.Utils.Metric.getCurrentMetric() === Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
const step = Common.Utils.Metric.fnRecalcToMM(Common.Utils.Metric.getCurrentMetric() === Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
let marginValue;
|
let marginValue;
|
||||||
|
|
||||||
switch (align) {
|
switch (align) {
|
||||||
case 'left': marginValue = stateLeft; break;
|
case 'left': marginValue = stateLeft; break;
|
||||||
case 'top': marginValue = stateTop; break;
|
case 'top': marginValue = stateTop; break;
|
||||||
case 'right': marginValue = stateRight; break;
|
case 'right': marginValue = stateRight; break;
|
||||||
case 'bottom': marginValue = stateBottom; break;
|
case 'bottom': marginValue = stateBottom; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDecrement) {
|
if (isDecrement) {
|
||||||
marginValue = Math.max(0, marginValue - step);
|
marginValue = Math.max(0, marginValue - step);
|
||||||
} else {
|
} else {
|
||||||
marginValue = Math.min((align == 'left' || align == 'right') ? margins.maxMarginsW : margins.maxMarginsH, marginValue + step);
|
marginValue = Math.min((align == 'left' || align == 'right') ? margins.maxMarginsW : margins.maxMarginsH, marginValue + step);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (align) {
|
switch (align) {
|
||||||
case 'left': setLeft(marginValue); break;
|
case 'left': setLeft(marginValue); break;
|
||||||
case 'top': setTop(marginValue); break;
|
case 'top': setTop(marginValue); break;
|
||||||
case 'right': setRight(marginValue); break;
|
case 'right': setRight(marginValue); break;
|
||||||
case 'bottom': setBottom(marginValue); break;
|
case 'bottom': setBottom(marginValue); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
props.applyMargins(align, marginValue);
|
props.applyMargins(align, marginValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -210,7 +239,8 @@ const PageDocumentSettings = props => {
|
||||||
<BlockTitle>{_t.textFormat}</BlockTitle>
|
<BlockTitle>{_t.textFormat}</BlockTitle>
|
||||||
<List mediaList>
|
<List mediaList>
|
||||||
<ListItem title={textFormat} subtitle={pageSizeTxt} link="/document-formats/" routeProps={{
|
<ListItem title={textFormat} subtitle={pageSizeTxt} link="/document-formats/" routeProps={{
|
||||||
onFormatChange: props.onFormatChange
|
onFormatChange: props.onFormatChange,
|
||||||
|
getMargins: props.getMargins
|
||||||
}}></ListItem>
|
}}></ListItem>
|
||||||
<ListItem title={_t.textMargins} link="/margins/" routeProps={{
|
<ListItem title={_t.textMargins} link="/margins/" routeProps={{
|
||||||
getMargins: props.getMargins,
|
getMargins: props.getMargins,
|
||||||
|
|
|
@ -100,6 +100,8 @@ class EditTextController extends Component {
|
||||||
newDistance = (distance < 0) ? 0 : Math.min(maxValue, distance + step);
|
newDistance = (distance < 0) ? 0 : Math.min(maxValue, distance + step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newDistance = parseFloat(newDistance.toFixed(2));
|
||||||
|
|
||||||
api.put_LineSpacingBeforeAfter(0, (newDistance < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(newDistance));
|
api.put_LineSpacingBeforeAfter(0, (newDistance < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(newDistance));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -122,6 +124,8 @@ class EditTextController extends Component {
|
||||||
newDistance = (distance < 0) ? 0 : Math.min(maxValue, distance + step);
|
newDistance = (distance < 0) ? 0 : Math.min(maxValue, distance + step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newDistance = parseFloat(newDistance.toFixed(2));
|
||||||
|
|
||||||
api.put_LineSpacingBeforeAfter(1, (newDistance < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(newDistance));
|
api.put_LineSpacingBeforeAfter(1, (newDistance < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(newDistance));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ class PresentationSettingsController extends Component {
|
||||||
[12192000, 6858000, Asc.c_oAscSlideSZType.SzCustom]
|
[12192000, 6858000, Asc.c_oAscSlideSZType.SzCustom]
|
||||||
];
|
];
|
||||||
|
|
||||||
this.props.storePresentationSettings.changeSizeIndex(api.get_PresentationWidth(), api.get_PresentationHeight());
|
|
||||||
this.props.storePresentationSettings.initSlideSizes(slideSizes);
|
this.props.storePresentationSettings.initSlideSizes(slideSizes);
|
||||||
|
this.props.storePresentationSettings.changeSizeIndex(api.get_PresentationWidth(), api.get_PresentationHeight());
|
||||||
this.init = true;
|
this.init = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class PresentationSettingsController extends Component {
|
||||||
let ratio = slideSizeArr[1] / slideSizeArr[0];
|
let ratio = slideSizeArr[1] / slideSizeArr[0];
|
||||||
let currentHeight = this.props.storePresentationSettings.currentPageSize.height;
|
let currentHeight = this.props.storePresentationSettings.currentPageSize.height;
|
||||||
let currentPageSize = {
|
let currentPageSize = {
|
||||||
width: (currentHeight || slideSizeArr[1]) / ratio,
|
width: ((currentHeight || slideSizeArr[1]) / ratio),
|
||||||
height: currentHeight
|
height: currentHeight
|
||||||
};
|
};
|
||||||
// api.changeSlideSize(slideSizeArr[0], slideSizeArr[1], slideSizeArr[2]);
|
// api.changeSlideSize(slideSizeArr[0], slideSizeArr[1], slideSizeArr[2]);
|
||||||
|
|
|
@ -48,6 +48,8 @@ const PageTheme = props => {
|
||||||
const defaultThemes = arrayThemes[0];
|
const defaultThemes = arrayThemes[0];
|
||||||
const docThemes = arrayThemes[1];
|
const docThemes = arrayThemes[1];
|
||||||
|
|
||||||
|
console.log(arrayThemes);
|
||||||
|
|
||||||
// console.log(slideThemeIndex);
|
// console.log(slideThemeIndex);
|
||||||
// console.log(arrayThemes);
|
// console.log(arrayThemes);
|
||||||
|
|
||||||
|
@ -63,7 +65,7 @@ const PageTheme = props => {
|
||||||
{defaultThemes.map((elem, index) => {
|
{defaultThemes.map((elem, index) => {
|
||||||
return (
|
return (
|
||||||
<ListItem key={elem.Index} className={elem.Index === slideThemeIndex ? "item-theme active" : "item-theme"}
|
<ListItem key={elem.Index} className={elem.Index === slideThemeIndex ? "item-theme active" : "item-theme"}
|
||||||
style={{backgroundPosition: "0 " + index * -38 + "px"}}
|
style={{backgroundPosition: "0 " + index * -40 + "px"}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
storeSlideSettings.changeSlideThemeIndex(elem.Index);
|
storeSlideSettings.changeSlideThemeIndex(elem.Index);
|
||||||
props.onThemeClick(elem.Index);
|
props.onThemeClick(elem.Index);
|
||||||
|
|
|
@ -33,8 +33,8 @@ const EditText = props => {
|
||||||
spaceAfter = paragraphObj.get_Spacing().get_After() < 0 ? paragraphObj.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_After());
|
spaceAfter = paragraphObj.get_Spacing().get_After() < 0 ? paragraphObj.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(paragraphObj.get_Spacing().get_After());
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayBefore = spaceBefore && spaceBefore < 0 ? _t.textAuto : spaceBefore + ' ' + metricText;
|
const displayBefore = spaceBefore && spaceBefore < 0 ? _t.textAuto : parseFloat(spaceBefore.toFixed(2)) + ' ' + metricText;
|
||||||
const displayAfter = spaceAfter && spaceAfter < 0 ? _t.textAuto : spaceAfter + ' ' + metricText;
|
const displayAfter = spaceAfter && spaceAfter < 0 ? _t.textAuto : parseFloat(spaceAfter.toFixed(2)) + ' ' + metricText;
|
||||||
|
|
||||||
const fontColorPreview = fontColor !== 'auto' ?
|
const fontColorPreview = fontColor !== 'auto' ?
|
||||||
<span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> :
|
<span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> :
|
||||||
|
|
|
@ -6,10 +6,10 @@ import { useTranslation } from "react-i18next";
|
||||||
const PagePresentationSettings = props => {
|
const PagePresentationSettings = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t("View.Settings", { returnObjects: true });
|
const _t = t("View.Settings", { returnObjects: true });
|
||||||
// props.initSlideSize();
|
|
||||||
const storePresentationSettings = props.storePresentationSettings;
|
const storePresentationSettings = props.storePresentationSettings;
|
||||||
const slideSizeArr = storePresentationSettings.slideSizes;
|
const slideSizeArr = storePresentationSettings.slideSizes;
|
||||||
const slideSizeIndex = storePresentationSettings.slideSizeIndex;
|
const slideSizeIndex = storePresentationSettings.slideSizeIndex;
|
||||||
|
// console.log(slideSizeIndex);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
|
|
Loading…
Reference in a new issue