diff options
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 3 | ||||
-rw-r--r-- | src/new_fields/RichTextUtils.ts | 5 | ||||
-rw-r--r-- | src/server/credentials/google_docs_token.json | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index bf7e7df97..9b97705a0 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -583,7 +583,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu document.nativeIgnoreAspect = undefined; }); - public static makeCustomViewClicked = undoBatch((document: Doc): void => { + public static makeCustomViewClicked = undoBatch((document: Doc, showTitle = undefined): void => { document.nativeLayout = document.layout; document.nativeType = document.type; document.nativeNativeWidth = document.nativeWidth; @@ -604,6 +604,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu let metaKey = "data"; let proto = Doc.GetProto(docTemplate); Doc.MakeTemplate(fieldTemplate, metaKey, proto); + fieldTemplate.showTitle = showTitle; Doc.ApplyTemplateTo(docTemplate, document, undefined, false); document.customLayout = document.layout; diff --git a/src/new_fields/RichTextUtils.ts b/src/new_fields/RichTextUtils.ts index ff28e6861..9b6e55948 100644 --- a/src/new_fields/RichTextUtils.ts +++ b/src/new_fields/RichTextUtils.ts @@ -413,7 +413,7 @@ export namespace RichTextUtils { let matches: RegExpExecArray | null; if ((matches = /p(\d+)/g.exec(markName)) !== null) { converted = "fontSize"; - value = { magnitude: parseInt(matches[1]), unit: "PT" }; + value = { magnitude: parseInt(matches[1].replace("px", "")), unit: "PT" }; } textStyle[converted] = value; } @@ -421,10 +421,11 @@ export namespace RichTextUtils { requests.push(EncodeStyleUpdate(information)); } if (node.type.name === "image") { + const width = attrs.width; requests.push(await EncodeImage({ startIndex: position + nodeSize - 1, uri: attrs.src, - width: attrs.width + width: Number(typeof width === "string" ? width.replace("px", "") : width) })); } position += nodeSize; diff --git a/src/server/credentials/google_docs_token.json b/src/server/credentials/google_docs_token.json index 8900f3301..64bd7a58d 100644 --- a/src/server/credentials/google_docs_token.json +++ b/src/server/credentials/google_docs_token.json @@ -1 +1 @@ -{"access_token":"ya29.GlyFB38lolkvmzKJYKWGKXTSSAkRH3HA1SrCMEp3YH8Gy_I06P7w5MN1C9zckoYXQPb-7OuO4vSCchAmiwfds19hhyXDFZhegUZ30y5WhBChJ0vS5X-086QWLgKbsg","refresh_token":"1/HTv_xFHszu2Nf3iiFrUTaeKzC_Vp2-6bpIB06xW_WHI","scope":"https://www.googleapis.com/auth/presentations.readonly https://www.googleapis.com/auth/documents.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.appendonly https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/photoslibrary.sharing","token_type":"Bearer","expiry_date":1568653300717}
\ No newline at end of file +{"access_token":"ya29.GlyFBwglzOsVNH90uoePSgwPkCqGNDMfx_us2wVe8YyS-MOA54Zdo7F_iiGOTDm9kGsINkQVgLu4rBZE7OTMa5Qxm8BuZIbTG66PPdVI0vbH96nfSlHQL8fnX1WOMQ","refresh_token":"1/HTv_xFHszu2Nf3iiFrUTaeKzC_Vp2-6bpIB06xW_WHI","scope":"https://www.googleapis.com/auth/presentations.readonly https://www.googleapis.com/auth/documents.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.appendonly https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/photoslibrary.sharing","token_type":"Bearer","expiry_date":1568657110414}
\ No newline at end of file |