diff options
| author | andrewdkim <adkim414@gmail.com> | 2020-02-12 03:37:51 -0500 | 
|---|---|---|
| committer | andrewdkim <adkim414@gmail.com> | 2020-02-12 03:37:51 -0500 | 
| commit | d1b9049fe50e401ac1a33177babd0cfa4b32f6a0 (patch) | |
| tree | 6df9a57fbceac3eaceb04061a9c88b2a5d3059b3 /src/mobile/MobileInterface.tsx | |
| parent | 864cba561db8e26240b093da7ab524e76c8823d1 (diff) | |
can select text from web node and upload from mobile
Diffstat (limited to 'src/mobile/MobileInterface.tsx')
| -rw-r--r-- | src/mobile/MobileInterface.tsx | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index 83410b99d..0c2ed8156 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -35,6 +35,9 @@ import GoogleAuthenticationManager from '../client/apis/GoogleAuthenticationMana  import { listSpec } from '../new_fields/Schema';  import { Id } from '../new_fields/FieldSymbols';  import { DocumentManager } from '../client/util/DocumentManager'; +import RichTextMenu from '../client/util/RichTextMenu'; +import { WebField } from "../new_fields/URLField"; +import { FieldResult } from "../new_fields/Doc";  library.add(faLongArrowAltLeft); @@ -235,6 +238,20 @@ export default class MobileInterface extends React.Component {          e.preventDefault();      } +    addWebToCollection = async () => { +        let url = "https://en.wikipedia.org/wiki/Hedgehog"; +        if (this.mainContainer) { +            const data = Cast(this.mainContainer.data, listSpec(Doc)); +            if (data) { +                const webDoc = await data[0]; +                const urlField: FieldResult<WebField> = Cast(webDoc.data, WebField); +                url = urlField ? urlField.url.toString() : "https://en.wikipedia.org/wiki/Hedgehog"; + +            } +        } +        Docs.Create.WebDocument(url, { _width: 300, _height: 300, title: "Mobile Upload Web Doc" }); +    } +      renderUploadContent() {          if (this.mainContainer) {              return ( @@ -244,6 +261,7 @@ export default class MobileInterface extends React.Component {                              <button className="mobileInterface-button cancel" onClick={this.onBack} title="Back">BACK</button>                          </div>                          <div className="uploadSettings"> +                            {/* <button className="mobileInterface-button" onClick={this.addWeb} title="Add Web Doc to Upload Collection"></button> */}                              <button className="mobileInterface-button" onClick={this.upload} title="Upload">UPLOAD</button>                          </div>                      </div> @@ -302,6 +320,7 @@ export default class MobileInterface extends React.Component {                  <PreviewCursor />                  {/* <ContextMenu /> */}                  <RadialMenu /> +                <RichTextMenu />                  {/* <PDFMenu />                  <MarqueeOptionsMenu />                  <OverlayView /> */} @@ -315,4 +334,5 @@ Scripting.addGlobal(function onSwitchMobileInking() { return MobileInterface.Ins  Scripting.addGlobal(function renderMobileInking() { return MobileInterface.Instance.renderInkingContent(); });  Scripting.addGlobal(function onSwitchMobileUpload() { return MobileInterface.Instance.onSwitchUpload(); });  Scripting.addGlobal(function renderMobileUpload() { return MobileInterface.Instance.renderUploadContent(); }); +Scripting.addGlobal(function addWebToMobileUpload() { return MobileInterface.Instance.addWebToCollection(); });  | 
