From 4545ee47ffca71df4565db44e75d14b31cd1c3c1 Mon Sep 17 00:00:00 2001 From: larry Date: Wed, 7 May 2014 21:34:11 +0800 Subject: [PATCH] Test realtime channel features --- .bowerrc | 3 + .gitignore | 62 ++++++++++++++++- .travis.yml | 30 ++++++++ app/bus.html | 166 +++++++++++++++++++++++++++++++++++++++++++++ app/vertxbus.html | 147 +++++++++++++++++++++++++++++++++++++++ app/websocket.html | 43 ++++++++++++ bower.json | 12 ++++ package.json | 21 ++++++ scripts/vertx.js | 6 ++ 9 files changed, 487 insertions(+), 3 deletions(-) create mode 100644 .bowerrc create mode 100644 .travis.yml create mode 100644 app/bus.html create mode 100644 app/vertxbus.html create mode 100644 app/websocket.html create mode 100644 bower.json create mode 100644 package.json create mode 100644 scripts/vertx.js diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..5773025 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} diff --git a/.gitignore b/.gitignore index 49ece72..80528c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,59 @@ -*.pyc -.project -.pydevproject \ No newline at end of file +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm + +## Directory-based project format +.idea/ +# if you remove the above rule, at least ignore user-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# and these sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml + +## File-based project format +*.ipr +*.iws +*.iml + +## Additional for IntelliJ +out/ + +# generated by mpeltonen/sbt-idea plugin +.idea_modules/ + +# generated by JIRA plugin +atlassian-ide-plugin.xml + +# generated by Crashlytics plugin (for Android Studio and Intellij) +com_crashlytics_export_strings.xml + +## OS X +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +bower_components/ + +# Logs +logs +*.log +node_modules \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b9c0a60 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: node_js +node_js: +- 0.10 + +branches: + only: + - master + +before_install: +- git config --global user.name "Goodow Dev" +- git config --global user.email "dev@goodow.com" +- git remote set-url origin "https://${GH_TOKEN}@github.com/goodow/realtime-web-playground.git" +- git fetch origin gh-pages:gh-pages + +before_script: +- export DISPLAY=:99.0 +- sh -e /etc/init.d/xvfb start +- npm start > /dev/null & +- npm run update-webdriver +- sleep 1 + +after_success: +- cp -r app/ .gh-pages/ +- git checkout gh-pages && cp -r .gh-pages/* . && rm -rf .gh-pages/ app/ node_modules/ +- git add . && git commit -m "Generated by ${TRAVIS_COMMIT}" +- test ${TRAVIS_PULL_REQUEST} == "false" && git push origin + +env: + global: + secure: gECuwl39mTQ1XRBBYAkrD42YUj1p0fdDlDIbjRBQaxLdUVNvPHZiV0/jTJgnvG+lEwJNIAaDGuw+rIK+/+VlbVE6LWQgRuwAB5eBI18NFNNytXUvvnS2IREYKRGPuRwC4a51V3Q0L+zTyg8xVzNQSNl7N2J/znVBUlXMCzAy95E= diff --git a/app/bus.html b/app/bus.html new file mode 100644 index 0000000..cb07bd9 --- /dev/null +++ b/app/bus.html @@ -0,0 +1,166 @@ + + + Goodow Realtime Channel API Playground + + + + + + + + +
+ + + +
+ +
+
+ Connection Status:  +
Not connected
+
+ +
+ +
+ Topic: + +
+ Subscriptions: +
+
+
+ +
+ +
+ Topic:
+ Message: + +
+ + Sent messages:
+
+
+
+
+ +
+ + Received messages:
+ +
+
+
+ + +Fork me on GitHub + + diff --git a/app/vertxbus.html b/app/vertxbus.html new file mode 100644 index 0000000..2c0e528 --- /dev/null +++ b/app/vertxbus.html @@ -0,0 +1,147 @@ + + + + + + + + + + +
+ + + +
+ +
+
+ Connection Status:  +
Not connected
+
+ +
+ +
+ Address: + +
+ Subscriptions: +
+
+
+ +
+ +
+ Address:
+ Message: + +
+ + Sent messages:
+
+
+
+
+ +
+ + Received messages:
+ +
+
+
+ + + +Fork me on GitHub + \ No newline at end of file diff --git a/app/websocket.html b/app/websocket.html new file mode 100644 index 0000000..145e000 --- /dev/null +++ b/app/websocket.html @@ -0,0 +1,43 @@ + +Web Socket Test + + +
+ + +
+ + diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..4998a6e --- /dev/null +++ b/bower.json @@ -0,0 +1,12 @@ +{ + "name": "realtime-web-playground", + "description": "Goodow Web Playground helps you to try out the features of the Realtime API", + "version": "0.0.0", + "homepage": "https://github.com/goodow/realtime-web-playground", + "dependencies": { + "realtime-channel": "gh-pages", + "realtime-store": "gh-pages", + "vertxbus": "v2.1", + "google-diff-match-patch-js": "1.0.0" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..33dc6b3 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "realtime-web-playground", + "private": true, + "version": "0.0.0", + "description": "Goodow Web Playground helps you to try out the features of the Realtime API", + "repository": "https://github.com/goodow/realtime-web-playground", + "devDependencies": { + "karma": "~0.10", + "protractor": "~0.20.1", + "http-server": "^0.6.1", + "bower": "^1.3.1", + "shelljs": "^0.2.6", + "karma-junit-reporter": "^0.2.2" + }, + "scripts": { + "postinstall": "bower install", + + "prestart": "npm install", + "start": "http-server -a localhost -p 8000" + } +} \ No newline at end of file diff --git a/scripts/vertx.js b/scripts/vertx.js new file mode 100644 index 0000000..f77106f --- /dev/null +++ b/scripts/vertx.js @@ -0,0 +1,6 @@ +var vertx = require('vertx') + +vertx.createHttpServer().requestHandler(function(req) { + var filename = "app/" + (req.uri() == "/" ? "index.html" : "." + req.uri()); + req.response.sendFile(filename) +}).listen(1990) \ No newline at end of file