Sammlung
This commit is contained in:
9597
Sammlung/Praktikum/2/ias-p2_a0.02/js/jquery-1.9.1.js
vendored
Normal file
9597
Sammlung/Praktikum/2/ias-p2_a0.02/js/jquery-1.9.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
70
Sammlung/Praktikum/2/ias-p2_a0.02/js/test.js
Normal file
70
Sammlung/Praktikum/2/ias-p2_a0.02/js/test.js
Normal file
@ -0,0 +1,70 @@
|
||||
var number = -1;
|
||||
|
||||
var waiting = function(){
|
||||
var path = '/test';
|
||||
path += '/' + number;
|
||||
|
||||
$.ajax({
|
||||
url: path,
|
||||
type: 'REFRESH',
|
||||
dataType: "json"
|
||||
})
|
||||
.done(function(data){
|
||||
$("#idNumberArea").html(data);
|
||||
number = data;
|
||||
waiting();
|
||||
})
|
||||
.fail(function(){
|
||||
//alert("Server lost");
|
||||
//tritt bei Reload der Seite einmal auf, danach alles OK
|
||||
//Wayne, deswegen auskommentiert
|
||||
});
|
||||
};
|
||||
|
||||
inc = function(){
|
||||
$.ajax({
|
||||
url: '/test',
|
||||
type: 'INC'
|
||||
})
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
waiting();
|
||||
});
|
||||
|
||||
|
||||
var clock_id = 'clock';
|
||||
var clock_size = 100;
|
||||
var clock_color = 'rgb(0, 0, 0)';
|
||||
setInterval(drawClock, 250);
|
||||
|
||||
/**
|
||||
* Initializes the clock canvas.
|
||||
*
|
||||
* @param id
|
||||
* The ID of the clock canvas element
|
||||
* @param size
|
||||
* The size of the clock (size == width == height)
|
||||
* @param color
|
||||
* The color of the clock in 'rgb(r, g, b)' format
|
||||
*/
|
||||
function initClock(id, size, color) {
|
||||
clock_id = id;
|
||||
clock_size = size;
|
||||
clock_color = color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the clock.
|
||||
*/
|
||||
function drawClock() {
|
||||
var canvas = document.getElementById(clock_id);
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width = clock_size;
|
||||
canvas.height = clock_size;
|
||||
|
||||
ctx.translate(clock_size / 2, clock_size / 2);
|
||||
ctx.fillStyle = clock_color;
|
||||
|
||||
ctx.save();
|
||||
for ( var i = 1; i <p>
|
Reference in New Issue
Block a user