Giter Site home page Giter Site logo

glance's Introduction

glance

Description

glance is the back-end for the new CHI2013 papers-at-a-glance system.

Installing and running

You'll need node.js, CoffeeScript and CouchDB to run the server. You will also need the CHI2013 program data. The CHI2013 program data should be extracted into bootstrap_scripts/json

Run 'npm install' in the root of glance Now go to the folder 'bootstrap_scripts' and run

sh bootstrap.sh

To compile the (now very simple client code) in the root of glace run 'cake build'

Change the config.json to point at the right database in CouchDB

NOW you can run the server by from the glance root:

coffee glance.coffee config.json

The server will now run on http://localhost:8000

If you just browse there nothing will happen but http://localhost:8000/session should dump all sessions.

You can see a bit of interaction if you browser to http://localhost:8000/phone.html and look at the javascript console output. (The functionality of mobile.html is implemented in phone.coffee). If you post a new filter

curl -X POST http://localhost:8000/filters -H "Content-Type: application/json" -d '{"authorKeywords": ["visualization", "infoviz"]}'

Usage

The glance server provides a basic REST based API.

###Central concepts and API

###Events The glance server uses socket.io to send messages to the client. Import the socket.io script (when HTML is served from node.js)

<script src="/socket.io/socket.io.js"></script>

To connect

var socket = io.connect("http://"+window.location.hostname, {port: 8000});

Now it is possible to listen to the following events

  • tilesUpdated: is called whenever a new filter is applied to the server
  • tick: is called with a configurable time interval and used to synchronise the "slideshows" of the displays. The data given with the tick event is an integer with the tick count.

Example:

socket.on('tick', function(count) {
    console.log("Tick " + count;)
});

socket.on('tilesUpdated', function(data) {
    $.get('/tiles', function(tiles) {
        console.log("Filters updated!");
        console.log(data);
    });
});

Mobile Interface

The main file for the mobile interface is located under glance/mobile/phone.html

Once the server is running you can use it to post filters and view submissions related to them.

Once submissions are being display, a tap event on the tile triggers the function to send the selected submission ID to the future Obj-C function to add to the schedule on the iOS app.

function addSubmission(id){
    alert("called iOS");
}

As explained here https://developer.apple.com/library/mac/#documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html#//apple_ref/doc/uid/30001215-BBCBFJCD , we should use this function to communicate both apps.

Currently it only offers "add" capabilities but more will come in the future.

glance's People

Contributors

arvind avatar cklokmose avatar mblinsitu avatar strazzulla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.