Skip to content

Commit 80509c8

Browse files
authored
Merge pull request #4 from srea/add-initialize-option
#3
2 parents 72c11b5 + f02d8f4 commit 80509c8

15 files changed

Lines changed: 3397 additions & 75 deletions

File tree

.gitignore

Lines changed: 106 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,99 @@
11

2-
# Created by https://www.gitignore.io/api/xcode,swift
3-
# Edit at https://www.gitignore.io/?templates=xcode,swift
2+
# Created by https://www.gitignore.io/api/node,swift,xcode
3+
# Edit at https://www.gitignore.io/?templates=node,swift,xcode
4+
5+
### Node ###
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# dotenv environment variables file
71+
.env
72+
.env.test
73+
74+
# parcel-bundler cache (https://parceljs.org/)
75+
.cache
76+
77+
# next.js build output
78+
.next
79+
80+
# nuxt.js build output
81+
.nuxt
82+
83+
# react / gatsby
84+
public/
85+
86+
# vuepress build output
87+
.vuepress/dist
88+
89+
# Serverless directories
90+
.serverless/
91+
92+
# FuseBox cache
93+
.fusebox/
94+
95+
# DynamoDB Local files
96+
.dynamodb/
497

598
### Swift ###
699
# Xcode
@@ -38,33 +131,33 @@ timeline.xctimeline
38131
playground.xcworkspace
39132

40133
# Swift Package Manager
41-
#
42134
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
43135
# Packages/
44136
# Package.pins
45137
# Package.resolved
46138
.build/
139+
# Add this line if you want to avoid checking in Xcode SPM integration.
140+
# .swiftpm/xcode
47141

48142
# CocoaPods
49-
#
50143
# We recommend against adding the Pods directory to your .gitignore. However
51144
# you should judge for yourself, the pros and cons are mentioned at:
52145
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
53-
#
54-
Pods/
55-
#
146+
# Pods/
56147
# Add this line if you want to avoid checking in source code from the Xcode workspace
57148
# *.xcworkspace
58149

59150
# Carthage
60-
#
61151
# Add this line if you want to avoid checking in source code from Carthage dependencies.
62152
Carthage/Checkouts
63153

64154
Carthage/Build
65155

156+
# Accio dependency management
157+
Dependencies/
158+
.accio/
159+
66160
# fastlane
67-
#
68161
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
69162
# screenshots whenever they are needed.
70163
# For more information about the recommended setup visit:
@@ -76,15 +169,13 @@ fastlane/screenshots/**/*.png
76169
fastlane/test_output
77170

78171
# Code Injection
79-
#
80172
# After new code Injection tools there's a generated folder /iOSInjectionProject
81173
# https://github.com/johnno1962/injectionforxcode
82174

83175
iOSInjectionProject/
84176

85177
### Xcode ###
86178
# Xcode
87-
#
88179
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
89180

90181
## User settings
@@ -93,12 +184,14 @@ iOSInjectionProject/
93184

94185
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
95186

96-
### Xcode Patch ###
187+
## Xcode Patch
97188
*.xcodeproj/*
98189
!*.xcodeproj/project.pbxproj
99190
!*.xcodeproj/xcshareddata/
100191
!*.xcworkspace/contents.xcworkspacedata
101192
/*.gcno
193+
194+
### Xcode Patch ###
102195
**/xcshareddata/WorkspaceSettings.xcsettings
103196

104-
# End of https://www.gitignore.io/api/xcode,swift
197+
# End of https://www.gitignore.io/api/node,swift,xcode

Browser/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Browser",
3+
"version": "1.0.0",
4+
"description": "",
5+
"dependencies": {
6+
"blob-util": "^2.0.2",
7+
"chokidar": "^2.0.4",
8+
"fs": "^0.0.1-security",
9+
"ws": "^7.2.0"
10+
},
11+
"devDependencies": {
12+
"jqtree": "^1.4.9",
13+
"jquery": "^3.4.1",
14+
"webpack": "^4.29.6",
15+
"webpack-cli": "^3.1.2"
16+
},
17+
"scripts": {
18+
"test": "echo \"Error: no test specified\" && exit 1",
19+
"start": "node server.js"
20+
},
21+
"keywords": [],
22+
"author": "Yuki Tamazawa",
23+
"license": "MIT"
24+
}

Browser/src/app.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import 'jqtree'
2+
import * as blobUtil from 'blob-util'
3+
4+
const sock = new WebSocket("ws://0.0.0.0:8080");
5+
6+
sock.addEventListener("message", e => {
7+
if (typeof e.data === "string") {
8+
try {
9+
let parsedJSON = JSON.parse("[" + e.data + "]");
10+
$('#tree').remove()
11+
$("<div>", {
12+
id: 'tree'
13+
}).appendTo('#body');
14+
$('#tree').tree({
15+
data: parsedJSON,
16+
autoOpen: true,
17+
onCreateLi: function (node, $li) {
18+
$li.find('.jqtree-element').click(function () {
19+
sock.send(node.name.replace(" (View) ", ""));
20+
return false;
21+
});
22+
}
23+
});
24+
} catch (e) {
25+
}
26+
} else {
27+
const blob = new Blob([e.data], {
28+
type: 'image/jpeg'
29+
});
30+
var blobURL = blobUtil.createObjectURL(blob);
31+
document.getElementById('capture').setAttribute('src', blobURL);
32+
}
33+
});

Browser/webpack.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
4+
module.exports = {
5+
mode: 'production',
6+
entry: './src/app.js',
7+
output: {
8+
filename: 'bundle.js',
9+
path: path.join(__dirname, 'public/js')
10+
},
11+
plugins: [
12+
new webpack.ProvidePlugin({
13+
$: 'jquery',
14+
jQuery: 'jquery',
15+
'window.jQuery': 'jquery'
16+
})
17+
]
18+
};

0 commit comments

Comments
 (0)