Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cce07c4
nixify
pogoba Jul 16, 2022
16194f7
npm init
pogoba Jul 16, 2022
fd8d350
npm install @techstark/opencv-js
pogoba Jul 16, 2022
c1d6237
npm tests
pogoba Jul 16, 2022
515bf1e
start using EC6
pogoba Jul 16, 2022
3aac6ae
enable eslint
pogoba Jul 16, 2022
d34cd03
license: gpl3 -> mpl2
pogoba Jul 16, 2022
f239f79
ec6 imports: part 1
pogoba Jul 16, 2022
99b6943
itemcounter: expose both Image() and opencv mat interface
pogoba Jul 16, 2022
c52158a
ec6 imports: part 2
pogoba Jul 16, 2022
b1057e3
ec6 imports: images in nodejs
pogoba Jul 16, 2022
4c90d22
stash canvas experiments
pogoba Jul 18, 2022
d6cb53c
make opencv work in nodejs
pogoba Jul 20, 2022
20bb914
WIP: make tesseract work in nodejs
pogoba Jul 20, 2022
c47f109
cleanup and memory management fix
pogoba Jul 20, 2022
08d5129
ec6: implemented
pogoba Jul 20, 2022
e4ce338
nix: fix npm canvas binary
pogoba Jul 20, 2022
c895b90
index.html: webpack bundle
pogoba Jul 20, 2022
a22aab7
move js to src/
pogoba Jul 20, 2022
f806c5a
index.html: reconnect js functions
pogoba Jul 20, 2022
e33b5e4
fix breaking bugs
pogoba Jul 20, 2022
e3eb429
itemcounter: new constructor
pogoba Jul 20, 2022
f08c253
cleanup
pogoba Jul 20, 2022
b6e2cdb
fix warnings
pogoba Jul 20, 2022
207ef59
update readme
pogoba Jul 20, 2022
2787815
fix tests
pogoba Jul 20, 2022
40866bc
fix npm exports
pogoba Jul 24, 2022
dccf96e
foo
pogoba Jul 24, 2022
5255b33
fixup index.html
pogoba Jul 24, 2022
68c1383
fix package.json
pogoba Jul 25, 2022
d643840
fix package.json
pogoba Jul 25, 2022
619c372
no webpack
pogoba Jul 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"env": {
"browser": true,
"node": true,
"es2021": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
test-screenshots/
apps-script/build/
node_modules/
dist/
1,046 changes: 372 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ This repo contains two sub-projects: A standalone statically served website (`./

## Standalone Website

Clone this repository with all submodules: `git clone --recurse-submodules [repourl]`
1. Clone this repository with all submodules: `git clone --recurse-submodules [repourl]`

Pull to fetch updates: `git pull && git submodule update`
2. Pull to fetch updates: `git pull && git submodule update`

Run a debugging server: `make debug`
3. Build the javascript bundle: `npm run build`

4. Run a debugging server: `make debug`

The webpage has no backend, so just shove the files into some webroot or so which has its files statically served (i.e. `make install`).

Expand All @@ -92,6 +94,13 @@ The webpage has no backend, so just shove the files into some webroot or so whic

Use `make appsscript` to package the files (`./apps-script/build`). Those files will be pushed to google via googles `clasp`. You can just as well copy and paste the build files to the `Apps Script` area of your spreadsheet to incorporate the sidebar, for example if you don't have clasp installed.

# License

Mozilla Public License 2.0 ([MPL](./LICENSE)):

- This allows, for example, programs using MPL-licensed code to be statically linked to and distributed as part of a larger proprietary piece of software [[1]](https://www.mozilla.org/en-US/MPL/2.0/FAQ/)
- All modified files containing MPL'd code must be disclosed under the MPL. [[2]](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2))

# Conribute

This project can use some work on the front-end. The frontend could be set up with proper compilation steps (react).
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
description = "A very basic flake";

inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixos-22.05";
};

outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.${system} = {
default = pkgs.callPackage ./shell.nix { inherit pkgs; };
};

packages.${system}.hello = pkgs.hello;
packages.${system}.default = pkgs.hello;
};
}
15 changes: 4 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://docs.opencv.org/4.1.1/opencv.js" type="text/javascript"></script>
<script src="https://unpkg.com/tesseract.js@2.1.5/dist/tesseract.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="items.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<script src="ocr.js" type="text/javascript"></script>
<script src="image.js" type="text/javascript"></script>
<script src="itemcounter.js" type="text/javascript"></script>
<script src="icons.js" type="text/javascript"></script>
<script src="./dist/browser.js" type="text/javascript"></script>
<style>
#imageSrc, #imageTempl {
max-width: 300px;
Expand Down Expand Up @@ -91,8 +84,8 @@ <h5 class="card-title">Analyze your screenshot</h5>
</select>
<br/>
<br/>
<button id="run" onclick="run();" type="button" class="btn btn-primary">Run it</button>
<button id="run" onclick="abort();" type="button" class="btn btn-danger">Abort</button>
<button id="run" onclick="sp.run();" type="button" class="btn btn-primary">Run it</button>
<button id="run" onclick="sp.abort();" type="button" class="btn btn-danger">Abort</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -163,7 +156,7 @@ <h5 class="card-title">Analyze your screenshot</h5>
<a href="https://github.com/pogobanane/foxhole-screenparse" target="_blank" class="text-muted">sources</a> via git
</footer>
<script>
loaded()
sp.loaded()
</script>
</body>
</html>
Loading