From ba2628e268e0f024fa9975e3594b6e218b5dc9c9 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Sun, 4 Aug 2019 22:08:41 -0400 Subject: buxton's new docs --- .../source/Bill_Notes_3_button_optical_mouse.docx | Bin 0 -> 412208 bytes .../source/Bill_Notes_Amazon_Kindle_Keyboard.docx | Bin 0 -> 474022 bytes .../buxton/source/Bill_Notes_Apple_Adj_Keyboard.docx | Bin 0 -> 1758498 bytes src/scraping/buxton/source/Bill_Notes_BAT.docx | Bin 0 -> 1349620 bytes .../buxton/source/Bill_Notes_Casio_CZ-101.docx | Bin 0 -> 523939 bytes .../source/Bill_Notes_Kindle_3G_lighted_cover.docx | Bin 0 -> 919789 bytes .../buxton/source/Bill_Notes_Microwriter.docx | Bin 0 -> 1042556 bytes src/scraping/buxton/source/Bill_Notes_Twiddler.docx | Bin 0 -> 526307 bytes src/scraping/buxton/source/Bill_Notes_orbiTouch.doc | Bin 0 -> 3945306 bytes 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/scraping/buxton/source/Bill_Notes_3_button_optical_mouse.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Amazon_Kindle_Keyboard.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Apple_Adj_Keyboard.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_BAT.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Casio_CZ-101.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Kindle_3G_lighted_cover.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Microwriter.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_Twiddler.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_orbiTouch.doc (limited to 'src/scraping/buxton/source') diff --git a/src/scraping/buxton/source/Bill_Notes_3_button_optical_mouse.docx b/src/scraping/buxton/source/Bill_Notes_3_button_optical_mouse.docx new file mode 100644 index 000000000..a2ab04b78 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_3_button_optical_mouse.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Amazon_Kindle_Keyboard.docx b/src/scraping/buxton/source/Bill_Notes_Amazon_Kindle_Keyboard.docx new file mode 100644 index 000000000..e4375ebeb Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Amazon_Kindle_Keyboard.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Apple_Adj_Keyboard.docx b/src/scraping/buxton/source/Bill_Notes_Apple_Adj_Keyboard.docx new file mode 100644 index 000000000..99f7ad19d Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Apple_Adj_Keyboard.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_BAT.docx b/src/scraping/buxton/source/Bill_Notes_BAT.docx new file mode 100644 index 000000000..0e3368611 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_BAT.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Casio_CZ-101.docx b/src/scraping/buxton/source/Bill_Notes_Casio_CZ-101.docx new file mode 100644 index 000000000..c8d3943c0 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Casio_CZ-101.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Kindle_3G_lighted_cover.docx b/src/scraping/buxton/source/Bill_Notes_Kindle_3G_lighted_cover.docx new file mode 100644 index 000000000..f00fcb772 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Kindle_3G_lighted_cover.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Microwriter.docx b/src/scraping/buxton/source/Bill_Notes_Microwriter.docx new file mode 100644 index 000000000..3ac272e42 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Microwriter.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Twiddler.docx b/src/scraping/buxton/source/Bill_Notes_Twiddler.docx new file mode 100644 index 000000000..27b4acc85 Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Twiddler.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_orbiTouch.doc b/src/scraping/buxton/source/Bill_Notes_orbiTouch.doc new file mode 100644 index 000000000..6bd71f20e Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_orbiTouch.doc differ -- cgit v1.2.3-70-g09d2 From 4d3962cf221cb2421835c7016562433077e7b200 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Wed, 7 Aug 2019 01:48:15 -0400 Subject: pivot view script retrieval and context menu behavior improvements --- src/client/views/collections/CollectionView.tsx | 14 ++++-- .../collectionFreeForm/CollectionFreeFormView.tsx | 12 ++--- src/scraping/buxton/source/Silverlight.dmg | Bin 0 -> 15097394 bytes src/server/index.ts | 52 ++++++++++++--------- 4 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 src/scraping/buxton/source/Silverlight.dmg (limited to 'src/scraping/buxton/source') diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 59572b7e7..60ede17e7 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -1,6 +1,6 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { faEye } from '@fortawesome/free-regular-svg-icons'; -import { faColumns, faEllipsisV, faFingerprint, faImage, faProjectDiagram, faSignature, faSquare, faTh, faThList, faTree } from '@fortawesome/free-solid-svg-icons'; +import { faColumns, faEllipsisV, faFingerprint, faImage, faProjectDiagram, faSignature, faSquare, faTh, faThList, faTree, faCopy } from '@fortawesome/free-solid-svg-icons'; import { action, IReactionDisposer, observable, reaction, runInAction } from 'mobx'; import { observer } from "mobx-react"; import * as React from 'react'; @@ -20,7 +20,7 @@ import { CollectionTreeView } from "./CollectionTreeView"; import { CollectionViewBaseChrome } from './CollectionViewChromes'; export const COLLECTION_BORDER_WIDTH = 2; -library.add(faTh, faTree, faSquare, faProjectDiagram, faSignature, faThList, faFingerprint, faColumns, faEllipsisV, faImage, faEye as any); +library.add(faTh, faTree, faSquare, faProjectDiagram, faSignature, faThList, faFingerprint, faColumns, faEllipsisV, faImage, faEye as any, faCopy); @observer export class CollectionView extends React.Component { @@ -86,7 +86,13 @@ export class CollectionView extends React.Component { onContextMenu = (e: React.MouseEvent): void => { if (!this.isAnnotationOverlay && !e.isPropagationStopped() && this.props.Document[Id] !== CurrentUserUtils.MainDocId) { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7 let subItems: ContextMenuProps[] = []; - subItems.push({ description: "Freeform", event: () => this.props.Document.viewType = CollectionViewType.Freeform, icon: "signature" }); + subItems.push({ + description: "Freeform", event: () => { + this.props.Document.viewType = CollectionViewType.Freeform; + delete this.props.Document.arrangeInit; + delete this.props.Document.arrangeScript; + }, icon: "signature" + }); if (CollectionBaseView.InSafeMode()) { ContextMenu.Instance.addItem({ description: "Test Freeform", event: () => this.props.Document.viewType = CollectionViewType.Invalid, icon: "project-diagram" }); } @@ -97,7 +103,7 @@ export class CollectionView extends React.Component { switch (this.props.Document.viewType) { case CollectionViewType.Freeform: { subItems.push({ description: "Custom", icon: "fingerprint", event: CollectionFreeFormView.AddCustomLayout(this.props.Document, this.props.fieldKey) }); - subItems.push({ description: "Pivot", icon: "fingerprint", event: () => CollectionFreeFormView.SetPivotLayout(this.props.Document) }); + subItems.push({ description: "Pivot", icon: "copy", event: () => CollectionFreeFormView.SetPivotLayout(this.props.Document) }); break; } } diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 17c4e83b0..110ac2f25 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -51,14 +51,10 @@ export const panZoomSchema = createSchema({ export namespace PivotView { - export let arrangeInit: string; - export let arrangeScript: string; + export let scripts: { arrangeInit: string, arrangeScript: string }; export async function loadLayouts() { - let response = await fetch(Utils.prepend("/layoutscripts")); - let scripts = JSON.parse(await response.text()); - arrangeInit = scripts[0]; - arrangeScript = scripts[1]; + scripts = JSON.parse(await (await fetch(Utils.prepend("/layoutscripts"))).text()); } } @@ -815,8 +811,8 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { } target[key] = new ScriptField(script); }; - setSpecifiedLayoutField(PivotView.arrangeInit, "arrangeInit", { collection: "Doc", docs: "Doc[]" }, undefined); - setSpecifiedLayoutField(PivotView.arrangeScript, "arrangeScript", { doc: "Doc", index: "number", collection: "Doc", state: "any", docs: "Doc[]" }, "{x: number, y: number, width?: number, height?: number}"); + setSpecifiedLayoutField(PivotView.scripts.arrangeInit, "arrangeInit", { collection: "Doc", docs: "Doc[]" }, undefined); + setSpecifiedLayoutField(PivotView.scripts.arrangeScript, "arrangeScript", { doc: "Doc", index: "number", collection: "Doc", state: "any", docs: "Doc[]" }, "{x: number, y: number, width?: number, height?: number}"); } render() { diff --git a/src/scraping/buxton/source/Silverlight.dmg b/src/scraping/buxton/source/Silverlight.dmg new file mode 100644 index 000000000..d88290362 Binary files /dev/null and b/src/scraping/buxton/source/Silverlight.dmg differ diff --git a/src/server/index.ts b/src/server/index.ts index d735a6d8c..a0101e3f8 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -1,6 +1,6 @@ require('dotenv').config(); import * as bodyParser from 'body-parser'; -import { exec } from 'child_process'; +import { exec, ExecOptions } from 'child_process'; import * as cookieParser from 'cookie-parser'; import * as express from 'express'; import * as session from 'express-session'; @@ -149,31 +149,39 @@ app.get("/pull", (req, res) => })); app.get("/buxton", (req, res) => { - let buxton_scraping = path.join(__dirname, '../scraping/buxton'); - exec('python scraper.py', { cwd: buxton_scraping }, (err, stdout, sterr) => { - if (err) { - res.send(err.message); - return; + let cwd = '../scraping/buxton'; + + let onResolved = (stdout: string) => { console.log(stdout); res.redirect("/"); }; + let onRejected = (err: any) => { console.error(err.message); res.send(err); }; + let tryPython3 = () => command_line('python3 scraper.py', cwd).then(onResolved, onRejected); + + command_line('python scraper.py', cwd).then(onResolved, tryPython3); +}); + +const command_line = (command: string, fromDirectory?: string) => { + return new Promise((resolve, reject) => { + let options: ExecOptions = {}; + if (fromDirectory) { + options.cwd = path.join(__dirname, fromDirectory); } - console.log(stdout); - res.redirect("/"); + exec(command, options, (err, stdout) => err ? reject(err) : resolve(stdout)); }); -}); +}; + +const read_text_file = (relativePath: string) => { + let target = path.join(__dirname, relativePath); + return new Promise((resolve, reject) => { + fs.readFile(target, (err, data) => err ? reject(err) : resolve(data.toString())); + }); +}; app.get('/layoutscripts', (req, res) => { - let scripts: string[] = []; - let handler = (err: NodeJS.ErrnoException | null, data: Buffer) => { - if (err) { - console.log(err.message); - return; - } - scripts.push(data.toString()); - if (scripts.length === 2) { - res.send(JSON.stringify(scripts)); - } - }; - fs.readFile(path.join(__dirname, '../scraping/buxton/scripts/initialization.txt'), handler); - fs.readFile(path.join(__dirname, '../scraping/buxton/scripts/layout.txt'), handler); + let prefix = '../scraping/buxton/scripts/'; + read_text_file(prefix + 'initialization.txt').then(arrangeInit => { + read_text_file(prefix + 'layout.txt').then(arrangeScript => { + res.send(JSON.stringify({ arrangeInit, arrangeScript })); + }); + }); }); app.get("/version", (req, res) => { -- cgit v1.2.3-70-g09d2 From 74cb792cb1ef9fd11b7bd635fb25518903757204 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Wed, 7 Aug 2019 01:49:30 -0400 Subject: removed dmg --- src/scraping/buxton/source/Silverlight.dmg | Bin 15097394 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/scraping/buxton/source/Silverlight.dmg (limited to 'src/scraping/buxton/source') diff --git a/src/scraping/buxton/source/Silverlight.dmg b/src/scraping/buxton/source/Silverlight.dmg deleted file mode 100644 index d88290362..000000000 Binary files a/src/scraping/buxton/source/Silverlight.dmg and /dev/null differ -- cgit v1.2.3-70-g09d2 From 7cf716e4288f09e835fce3613ab007f239a59e8e Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Thu, 8 Aug 2019 00:14:32 -0400 Subject: updated bill's word docs --- .../source/Bill_Notes_Apple_Mac_Portable.docx | Bin 0 -> 748412 bytes .../buxton/source/Bill_Notes_Bill_Notes_CyKey.docx | Bin 1561425 -> 1675500 bytes src/scraping/buxton/source/Bill_Notes_FrogPad.docx | Bin 679241 -> 840173 bytes .../buxton/source/Bill_Notes_Gavilan_SC.docx | Bin 1531689 -> 1729610 bytes .../source/Bill_Notes_Grandjean_Stenotype.docx | Bin 1933004 -> 2094142 bytes src/scraping/buxton/source/Bill_Notes_NewO.docx | Bin 2150143 -> 2264571 bytes src/scraping/buxton/source/Bill_Notes_PARCkbd.docx | Bin 517484 -> 631959 bytes src/scraping/buxton/source/Bill_Notes_PARCtab.doc | Bin 0 -> 4046250 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/scraping/buxton/source/Bill_Notes_Apple_Mac_Portable.docx create mode 100644 src/scraping/buxton/source/Bill_Notes_PARCtab.doc (limited to 'src/scraping/buxton/source') diff --git a/src/scraping/buxton/source/Bill_Notes_Apple_Mac_Portable.docx b/src/scraping/buxton/source/Bill_Notes_Apple_Mac_Portable.docx new file mode 100644 index 000000000..df1aafe9c Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_Apple_Mac_Portable.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Bill_Notes_CyKey.docx b/src/scraping/buxton/source/Bill_Notes_Bill_Notes_CyKey.docx index 649d636e3..06094b4d3 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_Bill_Notes_CyKey.docx and b/src/scraping/buxton/source/Bill_Notes_Bill_Notes_CyKey.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_FrogPad.docx b/src/scraping/buxton/source/Bill_Notes_FrogPad.docx index ba80c1959..d01e1bf5c 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_FrogPad.docx and b/src/scraping/buxton/source/Bill_Notes_FrogPad.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Gavilan_SC.docx b/src/scraping/buxton/source/Bill_Notes_Gavilan_SC.docx index 8558a4e13..b9a30c8a9 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_Gavilan_SC.docx and b/src/scraping/buxton/source/Bill_Notes_Gavilan_SC.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_Grandjean_Stenotype.docx b/src/scraping/buxton/source/Bill_Notes_Grandjean_Stenotype.docx index 09e17f971..0615c4953 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_Grandjean_Stenotype.docx and b/src/scraping/buxton/source/Bill_Notes_Grandjean_Stenotype.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_NewO.docx b/src/scraping/buxton/source/Bill_Notes_NewO.docx index 2f4a04e81..a514926d2 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_NewO.docx and b/src/scraping/buxton/source/Bill_Notes_NewO.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_PARCkbd.docx b/src/scraping/buxton/source/Bill_Notes_PARCkbd.docx index 3038de363..c0cf6ba9a 100644 Binary files a/src/scraping/buxton/source/Bill_Notes_PARCkbd.docx and b/src/scraping/buxton/source/Bill_Notes_PARCkbd.docx differ diff --git a/src/scraping/buxton/source/Bill_Notes_PARCtab.doc b/src/scraping/buxton/source/Bill_Notes_PARCtab.doc new file mode 100644 index 000000000..3cdc2d21b Binary files /dev/null and b/src/scraping/buxton/source/Bill_Notes_PARCtab.doc differ -- cgit v1.2.3-70-g09d2