Skip to content

Commit

Permalink
Merge pull request #4 from srea/add-initialize-option
Browse files Browse the repository at this point in the history
  • Loading branch information
srea committed Dec 3, 2019
2 parents 72c11b5 + f02d8f4 commit 80509c8
Show file tree
Hide file tree
Showing 15 changed files with 3,397 additions and 75 deletions.
119 changes: 106 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,99 @@

# Created by https://www.gitignore.io/api/xcode,swift
# Edit at https://www.gitignore.io/?templates=xcode,swift
# Created by https://www.gitignore.io/api/node,swift,xcode
# Edit at https://www.gitignore.io/?templates=node,swift,xcode

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# react / gatsby
public/

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### Swift ###
# Xcode
Expand Down Expand Up @@ -38,33 +131,33 @@ timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
# Add this line if you want to avoid checking in Xcode SPM integration.
# .swiftpm/xcode

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

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts

Carthage/Build

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
Expand All @@ -76,15 +169,13 @@ fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
Expand All @@ -93,12 +184,14 @@ iOSInjectionProject/

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

### Xcode Patch ###
## Xcode Patch
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno

### Xcode Patch ###
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.gitignore.io/api/xcode,swift
# End of https://www.gitignore.io/api/node,swift,xcode
24 changes: 24 additions & 0 deletions Browser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Browser",
"version": "1.0.0",
"description": "",
"dependencies": {
"blob-util": "^2.0.2",
"chokidar": "^2.0.4",
"fs": "^0.0.1-security",
"ws": "^7.2.0"
},
"devDependencies": {
"jqtree": "^1.4.9",
"jquery": "^3.4.1",
"webpack": "^4.29.6",
"webpack-cli": "^3.1.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "Yuki Tamazawa",
"license": "MIT"
}
33 changes: 33 additions & 0 deletions Browser/src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'jqtree'
import * as blobUtil from 'blob-util'

const sock = new WebSocket("ws://0.0.0.0:8080");

sock.addEventListener("message", e => {
if (typeof e.data === "string") {
try {
let parsedJSON = JSON.parse("[" + e.data + "]");
$('#tree').remove()
$("<div>", {
id: 'tree'
}).appendTo('#body');
$('#tree').tree({
data: parsedJSON,
autoOpen: true,
onCreateLi: function (node, $li) {
$li.find('.jqtree-element').click(function () {
sock.send(node.name.replace(" (View) ", ""));
return false;
});
}
});
} catch (e) {
}
} else {
const blob = new Blob([e.data], {
type: 'image/jpeg'
});
var blobURL = blobUtil.createObjectURL(blob);
document.getElementById('capture').setAttribute('src', blobURL);
}
});
18 changes: 18 additions & 0 deletions Browser/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require('path');
const webpack = require('webpack');

module.exports = {
mode: 'production',
entry: './src/app.js',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'public/js')
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
]
};
Loading

0 comments on commit 80509c8

Please sign in to comment.