Skip to content

Commit 61a7067

Browse files
committed
Bug fixes and cleanup compatibility with coder
1 parent 8a97c39 commit 61a7067

File tree

13 files changed

+53
-68
lines changed

13 files changed

+53
-68
lines changed

coder-apps/common/rva-coderdojo-matrix/static/js/index.js

Lines changed: 0 additions & 38 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"created": "2013-05-08",
33
"modified": "2014-01-14",
4-
"color": "#00",
4+
"color": "#00cc00",
55
"author": "Macon Pegram",
6-
"name": "RVA Coder Dojo with Matrix Rain",
6+
"name": "RVA Coder Dojo",
77
"hidden": false
88
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// The page must be loaded first before the script can run.
2+
// This makes sure that the page is loaded first.
3+
$(document).ready(function () {
4+
// Check to see if the browser is capable of showing an HTML 5 canvas.
5+
// If so we can do matrix rain!
6+
if (!!window.HTMLCanvasElement) {
7+
var matrixRain = new MatrixRain(); // Create a Javascript Object of MatrixRain
8+
matrixRain.setImageURL(staticurl + '/media/rva-coderdojo-lg.png');
9+
10+
// Try changing this to see what happens!
11+
matrixRain.setText("WELCOME TO THE RVA CODER DOJO");
12+
13+
// I wonder what happens if you change this number?
14+
matrixRain.setFontSize(10);
15+
16+
// Too fast or too slow? You are in control.
17+
// Try changing this value.
18+
matrixRain.setDelay(80);
19+
20+
// Try different colors.. remember:
21+
// - rgb(redColor, greenColor, blueColor)
22+
// - Colors can go from 0 [dark] to 255 [bright]
23+
// - So rgb(255, 0, 255) will be bright purple (red + blue).
24+
matrixRain.setFontColor('#00FF00');
25+
26+
// Start running the matrix rain animation!
27+
matrixRain.start();
28+
}
29+
else
30+
{
31+
// If we can't add an HTML 5 canvas, just show the coder dojo non-animated image.
32+
// Add a fallback image if canvas is not supported.
33+
var fallback = document.createElement('img'); // Creates a regular <img> tag.
34+
fallback.id='matrix-fallback';
35+
fallback.src = staticurl + '/media/rva-coderdojo-nocanvas-lg.png';
36+
// Attaches the RVA coder dojo image to the page as a regular html <img>
37+
document.body.appendChild(fallback);
38+
}
39+
});

coder-apps/common/rva-coderdojo-matrix/static/js/matrix-rain.js renamed to coder-apps/common/rva_coderdojo_matrix/static/js/matrix-rain.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ MatrixRain.prototype.setFontSize = function (fontSize) {
7373
this.fontSize = fontSize;
7474
};
7575

76+
// Call setFontColor to change what color the text is in your secret message.
77+
MatrixRain.prototype.setFontColor = function (fontColor) {
78+
if (fontColor != undefined)
79+
this.fontColor = fontColor;
80+
};
81+
7682
// This helps to resize the canvas.
7783
MatrixRain.prototype.resize = function (width, height) {
7884
this.matrixCanvas.width=width;

coder-apps/common/rva-coderdojo-matrix/views/index.html renamed to coder-apps/common/rva_coderdojo_matrix/views/index.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,7 @@
2626
<script src="{{&static_url}}/js/index.js"></script>
2727
<!-- End apps includes -->
2828
</head>
29-
<body class="">
30-
<div class="pagecontent">
29+
<body>
3130
<!-- The matrix rain canvases will get inserted right below here -->
3231
</body>
3332
</html>
34-
35-
<!doctype html>
36-
<html lang="en">
37-
<head>
38-
<LINK href="styles/splash.css" rel="stylesheet" type="text/css">
39-
</head>
40-
<body>
41-
</body>
42-
</html>

coder-apps/install_all.cmd

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
@echo off
22
if =%1-==-- echo "Usage: install_all.cmd [coderbase]" & exit /b
33

4-
goto check_Permissions
5-
6-
:check_Permissions
7-
echo Administrative permissions required. Detecting permissions...
8-
9-
net session >nul 2>&1
10-
if %errorLevel% == 0 (
11-
echo Success: Administrative permissions confirmed.
12-
) else (
13-
echo Failure: Current permissions inadequate.
14-
exit /b
15-
)
16-
174
set base=%1
185

196
REM Create base folder
@@ -28,5 +15,5 @@ echo "Installing common files"
2815
call install_common.cmd %base%
2916

3017
echo "Preparing dependent libraries"
31-
cd %base%
32-
npm install
18+
cd %base%
19+
npm install

coder-apps/install_common.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ call install_app.cmd localauth %base% .\common\
4646
REM RVA Coder Dojo extra bundles
4747
call install_app.cmd pop_up_penguins %base% .\common\
4848
call install_app.cmd comic_creator %base% .\common\
49-
call install_app.cmd rva-coderdojo-matrix %base% .\common\
49+
call install_app.cmd rva_coderdojo_matrix %base% .\common\
5050

5151
REM Assets for other projects used in RVA Coder Dojo
5252
if NOT EXIST %base%\project-assets (

coder-apps/install_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ base=$1
3131
## RVA Coder Dojo extra bundles
3232
./install_app.sh pop_up_penguins $base ./common/
3333
./install_app.sh comic_creator $base ./common/
34-
./install_app.sh rva-coderdojo-matrix $base ./common/
34+
./install_app.sh rva_coderdojo_matrix $base ./common/
3535

3636
## Assets for other projects used in RVA Coder Dojo
3737
mkdir -p $base/project-assets

coder-base/localserver.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ var apphandler = function( req, res, appdir ) {
136136

137137
var startLocal = function() {
138138
http.createServer(localapp).listen( config.httpListenPort, '127.0.0.1' );
139+
console.log('Listening on: http://127.0.0.1:' + config.httpListenPort);
139140
};
140141

141142
var getHost = function( req ) {

0 commit comments

Comments
 (0)