-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
312 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
$( function() { | ||
var timeout = null | ||
var account = null | ||
var latestOnly = true | ||
|
||
var query = function() { | ||
$.ajax( { | ||
url : 'http://52.76.12.160:41400/jsonp/1' + ( $( '#account' ).val() != '' ? '/' + $( '#account' ).val() : '' ), | ||
jsonp : 'callback', | ||
dataType : 'jsonp', | ||
success : function( data ) { | ||
var html = '' | ||
var sid = [] | ||
for ( var d in data ) { | ||
html += '<tr' | ||
if ( sid.indexOf( data[ d ].s ) !== -1 ) { | ||
html += ' class="not-latest"' | ||
} else { | ||
html += ' class="latest"' | ||
sid.push( data[ d ].s ) | ||
} | ||
html += ( | ||
'>' + | ||
'<td>' + data[ d ].i + '</td>' + | ||
'<td>' + data[ d ].t + '</td>' + | ||
'<td>' + data[ d ].s + '</td>' + | ||
'<td>' + data[ d ].h + '</td>' + | ||
'</tr>' | ||
) | ||
} | ||
if ( html == '' ) | ||
html = '<tr><td colspan="4"><p class="text-center lead">No records</p></td></tr>' | ||
|
||
$( '#list' ).html( html ) | ||
|
||
$( '#show-latest' ).change() | ||
|
||
$( '#submission' ).html( $( '.latest' ).length ) | ||
$( '#percent' ).html( ( $( '.latest' ).length / 63 * 100 ).toFixed( 1 ) ) | ||
|
||
timeout = setTimeout( query, 2000 ) | ||
} | ||
} ) | ||
} | ||
query() | ||
|
||
var filter = function( e ) { | ||
e.preventDefault() | ||
clearTimeout( timeout ) | ||
account = $( '#account' ).val() != '' ? $( '#account' ).val() : null | ||
query() | ||
} | ||
$( '#filter-form' ).submit( filter ) | ||
$( '#account' ).blur( filter ) | ||
|
||
$( '#show-latest' ).change( function() { | ||
latestOnly = this.checked | ||
if ( latestOnly ) | ||
$( '.not-latest' ).hide() | ||
else | ||
$( '.not-latest' ).show() | ||
} ) | ||
} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,5 @@ | |
} | ||
], | ||
"created" : "14 January 2016", | ||
"lastModified" : "17 March 2016" | ||
"lastModified" : "26 March 2016" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<script> | ||
if (window.location.protocol != 'http:' ) | ||
window.location.href = 'http:' + window.location.href.substring( window.location.protocol.length ); | ||
</script> | ||
<link href="css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="css/font-awesome.min.css" rel="stylesheet"> | ||
<link href="css/custom.css" rel="stylesheet"> | ||
<link href="favicon.png" rel="icon" type="image/png" /> | ||
<!--[if lt IE 9]> | ||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | ||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | ||
<![endif]--> | ||
<script src="js/ga.js"></script> | ||
<script src="js/jquery.min.js"></script> | ||
<style> | ||
@media (min-width: 992px) { | ||
.checkbox { | ||
text-align: right; | ||
padding-right: 10px; | ||
} | ||
} | ||
</style> | ||
<title>CSCI 4140: Open-Source Software Project Development - Submission Status</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<header> | ||
<h3> | ||
<small>CSCI 4140<span class="visible-sm-inline visible-md-inline visible-lg-inline">: Open-Source Software Project Development</span> (Spring 2016)</small><br /> | ||
<span>Assignment 1: Web Instagram</span> - Submission Status | ||
</h3> | ||
<p><strong>Deadline: 23:59, 2016 March 16 (Wed)</strong></p> | ||
<p><strong>Number of submissions:</strong> <span id="submission">0</span> / 63 (<span id="percent"></span>%)</p> | ||
<hr /> | ||
</header> | ||
|
||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<form class="form-inline" id="filter-form"> | ||
<div class="form-group"> | ||
<label for="account" style="padding-right: 10px;">Filter by GitHub Account:</label> | ||
<input type="text" class="form-control" id="account" value="" /> | ||
</div> | ||
<button type="submit" class="btn btn-default">Filter</button> | ||
</form> | ||
<div class="visible-xs visible-sm"><br /></div> | ||
</div> | ||
<div class="col-sm-6"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox" id="show-latest" checked /> Show Latest Submissions Only | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
<hr /> | ||
|
||
<div class="table-responsive"> | ||
<table class="table table-hover"> | ||
<thead> | ||
<th width="10%">#</th> | ||
<th width="30%">Submission Time</th> | ||
<th width="20%">Student ID</th> | ||
<th width="40%">Latest Commit</th> | ||
</thead> | ||
<tbody id="list"> | ||
<tr> | ||
<td colspan="4"><p class="text-center lead">Loading...</p></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<p class="text-muted"> | ||
<strong>Note:</strong> We only accept submission at the <code>master</code> branch. | ||
</p> | ||
</div> | ||
<script src="js/bootstrap.min.js"></script> | ||
<script src="js/jsonp-1.js"></script> | ||
<script src="js/custom.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Please run "npm install" before executing the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "ExpressDemo", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"express": "~4.11.1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
body { | ||
padding: 50px; | ||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
a { | ||
color: #00B7FF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var router = require( 'express' ).Router(); | ||
|
||
router.get( '/', function( request, response ) { | ||
response.send( '[/alice] Home' ); | ||
}); | ||
|
||
router.get( '/whoami', function( request, response ) { | ||
response.send( '[/alice/whoami] I am Alice!' ); | ||
}); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var router = require( 'express' ).Router(); | ||
|
||
router.get( '/', function( request, response ) { | ||
response.send( '[/bob] Home' ); | ||
}); | ||
|
||
router.get( '/whoami', function( request, response ) { | ||
response.send( '[/bob/whoami] I am Bob!' ); | ||
}); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var express = require( 'express' ); | ||
var app = express(); | ||
|
||
app.use( express.static( __dirname + '/public' ) ); | ||
|
||
// Set up root-level routes | ||
// ------------------------ | ||
app.get( '/', function ( request, response ) { | ||
response.send( 'Hello World!' ); | ||
} ); | ||
|
||
app.get( '/preview', function ( request, response ) { | ||
response.sendFile( __dirname + '/views/player.html' ); | ||
} ); | ||
|
||
app.get( '/message/:message', function ( request, response ) { | ||
response.send( 'The message: ' + request.params.message ); | ||
} ); | ||
|
||
app.get( '/room/:id([0-9]+)', function ( request, response ) { | ||
response.send( 'The room number is: ' + request.params.id ); | ||
} ); | ||
|
||
// Demonstrating Jade templating engine | ||
// ------------------------------------ | ||
app.set( 'views', __dirname + '/views' ); | ||
app.set( 'view engine', 'jade' ); | ||
app.get( '/hi', function ( request, response ) { | ||
response.render( 'index', | ||
{ title: 'Hey', message: 'Hello there!' } ); | ||
} ); | ||
|
||
// Load external routes | ||
// -------------------- | ||
var alice = require( './routes/alice' ); | ||
var bob = require( './routes/bob' ); | ||
app.use( '/alice', alice ); | ||
app.use( '/bob', bob ); | ||
|
||
|
||
// Start the server | ||
// ---------------- | ||
var server = app.listen( 4140, function () { | ||
var host = server.address().address; | ||
var port = server.address().port; | ||
console.log( 'Listening at http://%s:%s', host, port ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extends layout | ||
|
||
block content | ||
h1= message | ||
h2= error.status | ||
pre #{error.stack} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
html | ||
head | ||
title!= title | ||
body | ||
h1!= message |
Oops, something went wrong.