├── .gitignore ├── Worker ├── .idea │ ├── .name │ ├── Worker.iml │ ├── jsLibraryMappings.xml │ ├── libraries │ │ └── Worker_node_modules.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations │ │ └── bin_www.xml │ ├── vcs.xml │ └── workspace.xml ├── app.js ├── config.js ├── node_modules │ ├── game_session │ │ └── index.js │ ├── manager │ │ └── index.js │ └── user │ │ └── index.js ├── package.json └── run_worker.bat ├── app ├── .idea │ ├── .name │ ├── app.iml │ ├── jsLibraryMappings.xml │ ├── libraries │ │ └── app_node_modules.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations │ │ └── bin_www.xml │ ├── vcs.xml │ └── workspace.xml ├── app.js ├── bin │ └── www ├── node_modules │ ├── config │ │ └── index.js │ ├── db │ │ └── index.js │ └── worker_manager │ │ └── index.js ├── package.json ├── public │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── images │ │ ├── cross.png │ │ ├── empty.png │ │ └── zero.png │ ├── js │ │ ├── game.js │ │ └── login.js │ ├── libs │ │ ├── angular.min.js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.9.0.js │ │ ├── jquery-1.9.1.js │ │ ├── jquery.min.js │ │ └── socket.io.js │ └── stylesheets │ │ └── style.css ├── routes │ ├── game.js │ └── start_game.js ├── run_app.bat └── views │ ├── error.ejs │ ├── game.ejs │ ├── layout.ejs │ └── login.ejs └── db_node ├── .idea ├── .name ├── db_node.iml ├── jsLibraryMappings.xml ├── libraries │ └── db_node_node_modules.xml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── config.js ├── index.js ├── package.json └── run_db.bat /.gitignore: -------------------------------------------------------------------------------- 1 | /app/node_modules/basic-auth 2 | /app/node_modules/body-parser 3 | /app/node_modules/cookie-parser 4 | /app/node_modules/debug 5 | /app/node_modules/ejs 6 | /app/node_modules/ejs-locals 7 | /app/node_modules/express 8 | /app/node_modules/morgan 9 | /app/node_modules/serve-favicon 10 | /app/node_modules/socket.io-client 11 | /app/node_modules/util 12 | /db_node/node_modules/express 13 | /db_node/node_modules/nano 14 | /db_node/node_modules/socket.io 15 | /db_node/node_modules/util 16 | /Worker/node_modules/async 17 | /Worker/node_modules/debug 18 | /Worker/node_modules/express 19 | /Worker/node_modules/socket.io 20 | -------------------------------------------------------------------------------- /Worker/.idea/.name: -------------------------------------------------------------------------------- 1 | Worker -------------------------------------------------------------------------------- /Worker/.idea/Worker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Worker/.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Worker/.idea/libraries/Worker_node_modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Worker/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Worker/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Worker/.idea/runConfigurations/bin_www.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Worker/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Worker/app.js: -------------------------------------------------------------------------------- 1 | var config = require('./config') 2 | var express = require('express'); 3 | var app = express(); 4 | var server = app.listen(config.start_port); 5 | var io = require('socket.io').listen(server); 6 | var manager = require('manager'); 7 | var uf = require('user'); 8 | var gf = require('game_session'); 9 | var async = require('async'); 10 | 11 | var rooms = -1; 12 | 13 | function get_room_number(){ 14 | rooms += 1; 15 | return rooms; 16 | } 17 | 18 | app.get('/isWorking', function(req, res){ 19 | res.sendStatus(200); 20 | console.log('checked'); 21 | }); 22 | 23 | io.sockets.on('connection', function (socket) { 24 | console.log('Client connected... ' + socket.id); 25 | var user = manager.find_user(socket.id); 26 | if(user == null){ 27 | manager.add_user(uf.create_user(socket.id, socket)); 28 | } 29 | else{ 30 | socket.emit('double_connect'); 31 | return; 32 | } 33 | console.log('all users ' + manager.all().length); 34 | console.log('free users ' + manager.free().length); 35 | 36 | socket.on('new_game', function(){ 37 | async.waterfall([ 38 | function(callback){ 39 | callback(null, manager.find_user(socket.id)); 40 | }, 41 | function(user, callback){ 42 | if(user != null){ 43 | callback(null, user, manager.find_wait_game()); 44 | } 45 | }, 46 | function(user, game){ 47 | if(game != null){ 48 | game.add_user(user.id); 49 | user.game_session = game.id; 50 | socket.join('room' + game.id); 51 | manager.remove_wait_user(user.id); 52 | io.to('room' + game.id).emit('started_new_game', game); 53 | console.log('started game ' + game.id + ' with ' + game.users_id[0] + ' and ' + user.id); 54 | } 55 | else{ 56 | var number = get_room_number(); 57 | manager.start_new_game(gf.create_new_game_session(number, user.id)); 58 | user.game_session = number; 59 | socket.join('room' + number); 60 | console.log('created game ' + number + ' with ' + user.id); 61 | socket.emit('wait_partner', manager.find_game(number)); 62 | } 63 | }], function(err){ 64 | console.log('error with new_game'); 65 | socket.emit('error'); 66 | } 67 | ); 68 | }); 69 | 70 | socket.on('disconnect', function(){ 71 | console.log('Client disconnected... ' + socket.id); 72 | var lost_user = manager.find_user(socket.id); 73 | var game = manager.find_game(lost_user.game_session); 74 | if(game != null){ 75 | io.to('room' + game.id).emit('won', ', partner got away!'); 76 | } 77 | 78 | manager.remove_user(socket.id); 79 | console.log('all users ' + manager.all().length); 80 | console.log('free users ' + manager.free().length); 81 | }); 82 | 83 | socket.on('update_state', function(data){ 84 | var game = manager.find_game(data.id); 85 | var set_step_res = game.set_step(data); 86 | if(set_step_res){ 87 | var step_res = game.next_step(); 88 | if(!step_res && game.finished) { 89 | if(game.winner_count > 1){ 90 | io.to('room' + game.id).emit('draw'); 91 | } 92 | else { 93 | var winner_id = game.get_winner(); 94 | var losser_id = game.get_losser(); 95 | console.log('winner - ' + winner_id); 96 | console.log('losser - ' + losser_id); 97 | var winner = manager.find_user(winner_id); 98 | var losser = manager.find_user(losser_id); 99 | winner.socket.emit('won', ''); 100 | losser.socket.emit('lost'); 101 | } 102 | 103 | manager.finished_game(game.id); 104 | } 105 | else{ 106 | io.to('room' + game.id).emit('update', game); 107 | } 108 | } 109 | else{ 110 | console.log('set next step error'); 111 | socket.emit('error'); 112 | } 113 | 114 | }); 115 | // 116 | //socket.on('game_finished', function(){ 117 | // 118 | //}); 119 | }); 120 | console.log('worker started'); -------------------------------------------------------------------------------- /Worker/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 22.11.2015. 3 | */ 4 | var config = {}; 5 | 6 | config.start_port = '6001'; 7 | config.db_address = 'http://localhost:4001'; 8 | 9 | module.exports = config; -------------------------------------------------------------------------------- /Worker/node_modules/game_session/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 22.11.2015. 3 | */ 4 | module.exports.create_new_game_session = function(id, user_id1){ 5 | var game_session = {}; 6 | game_session.id = id; 7 | game_session.users_id = [ 8 | user_id1 9 | ]; 10 | game_session.state = [ 11 | [-1, -1, -1], 12 | [-1, -1, -1], 13 | [-1, -1, -1] 14 | ]; 15 | game_session.current_user = user_id1; 16 | game_session.current_user_num = 0; 17 | game_session.finished = false; 18 | game_session.started = false; 19 | game_session.winner_count = 0; 20 | 21 | game_session.add_user = function(userid){ 22 | this.users_id.push(userid); 23 | this.started = true; 24 | }; 25 | 26 | game_session.get_winner = function(){ 27 | return this.users_id[this.winner_value]; 28 | } 29 | 30 | game_session.get_losser = function() { 31 | return this.users_id[1 - this.winner_value]; 32 | } 33 | 34 | game_session.set_step = function(data){ 35 | if(data.x == undefined || data.x == null || data.y == undefined || data.y == null){ 36 | return false; 37 | } 38 | if(data.x >= 0 && data.x <3 && data.y >= 0 && data.y < 3){ 39 | this.state[data.x][data.y] = this.current_user_num; 40 | } 41 | else{ 42 | return false; 43 | } 44 | 45 | return true; 46 | } 47 | 48 | game_session.next_step = function(){ 49 | var checked = this.check(this.state); 50 | if(this.finished){ 51 | return false; 52 | } 53 | if(checked && this.winner_count == 2){ 54 | return false; 55 | } 56 | if(checked){ 57 | this.finished = true; 58 | } 59 | if(checked && this.current_user_num == 1){ 60 | return false; 61 | } 62 | if(this.is_end(this.state)){ 63 | this.finished = true; 64 | this.winner_count = 2; 65 | return false; 66 | } 67 | this.current_user_num = 1 - this.current_user_num; 68 | this.current_user = this.users_id[this.current_user_num]; 69 | 70 | return true; 71 | } 72 | 73 | game_session.is_end = function(arr){ 74 | for (var i = 0; i < 3; i++) { 75 | for (var j = 0; j< 3; j++){ 76 | if(arr[i][j] == -1){ 77 | return false; 78 | } 79 | } 80 | } 81 | 82 | return true; 83 | } 84 | 85 | game_session.check = function(arr){ 86 | this.winner_value = -1; 87 | this.winner_count = 0; 88 | var win_x = true; 89 | for (var i = 0; i < 3; i++) { 90 | win_x = arr[i][0] == arr[i][1] && arr[i][1] == arr[i][2] && arr[i][0] != -1; 91 | if(win_x){ 92 | this.winner_count += 1; 93 | this.winner_value = arr[i][0]; 94 | } 95 | } 96 | 97 | var win_y = true; 98 | for (i = 0; i < 3; i++) { 99 | win_y = arr[0][i] == arr[1][i] && arr[1][i] == arr[2][i] && arr[0][i] != -1; 100 | if (win_y) { 101 | this.winner_count += 1; 102 | this.winner_value = arr[i][0]; 103 | } 104 | } 105 | 106 | var win_xy = (arr[0][0] == arr[1][1] && arr[1][1] == arr[2][2] && arr[0][0] != -1); 107 | 108 | var win_yx = (arr[0][2] == arr[1][1] && arr[1][1] == arr[2][0] && arr[0][2] != -1); 109 | 110 | if(win_xy){ 111 | this.winner_count += 1; 112 | this.winner_value = arr[0][0]; 113 | } 114 | 115 | if(win_yx){ 116 | this.winner_count += 1; 117 | this.winner_value = arr[0][2]; 118 | } 119 | 120 | return this.winner_count > 0; 121 | } 122 | 123 | return game_session; 124 | }; -------------------------------------------------------------------------------- /Worker/node_modules/manager/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 22.11.2015. 3 | */ 4 | var gs = require('game_session'); 5 | var u = require('user'); 6 | 7 | var free_users = []; 8 | 9 | var all_users = []; 10 | 11 | var games = []; 12 | 13 | exports.all = function(){ 14 | return all_users; 15 | }; 16 | 17 | exports.free = function(){ 18 | return free_users; 19 | }; 20 | 21 | exports.add_user = function(user){ 22 | all_users.push(user); 23 | }; 24 | 25 | exports.find_user = function(id){ 26 | var res = all_users.filter(function(v){ 27 | return v['id'] == id; 28 | }); 29 | if(res.length > 0){ 30 | return res[0]; 31 | } 32 | 33 | return null; 34 | }; 35 | 36 | exports.find_game = function(id){ 37 | var res = games.filter(function(v){ 38 | return v['id'] == id; 39 | }); 40 | if(res.length > 0){ 41 | return res[0]; 42 | } 43 | 44 | return null; 45 | }; 46 | 47 | exports.find_wait_game = function(){ 48 | var res = games.filter(function(x){ 49 | return x.users_id.length == 1; 50 | }); 51 | if(res.length > 0){ 52 | 53 | return res[0]; 54 | } 55 | 56 | return null; 57 | }; 58 | 59 | exports.start_new_game = function(game){ 60 | games.push(game); 61 | }; 62 | 63 | exports.finished_game = function(id){ 64 | var game = this.find_game(id); 65 | free_users.push(this.find_user(game.users_id[0])); 66 | free_users.push(this.find_user(game.users_id[1])); 67 | games = games.filter(function(x){ 68 | return x.id != id; 69 | }); 70 | }; 71 | 72 | exports.remove_wait_user = function(id){ 73 | free_users = free_users.filter(function(x){ 74 | return x.id != id; 75 | }); 76 | }; 77 | 78 | exports.remove_user = function(id){ 79 | all_users = all_users.filter(function(x){ 80 | return x.id != id; 81 | }); 82 | free_users = free_users.filter(function(x){ 83 | return x.id != id; 84 | }); 85 | }; -------------------------------------------------------------------------------- /Worker/node_modules/user/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 22.11.2015. 3 | */ 4 | module.exports.create_user = function(id, socket){ 5 | var user = {}; 6 | user.id = id; 7 | 8 | user.game_session = null; 9 | 10 | user.socket = socket; 11 | 12 | return user; 13 | } -------------------------------------------------------------------------------- /Worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "worker", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "start": "node app.js" 6 | }, 7 | "dependencies": { 8 | "express": "~4.13.1", 9 | "socket.io": "1.3.7", 10 | "async": "1.5.0", 11 | "debug": "2.2.0" 12 | } 13 | } -------------------------------------------------------------------------------- /Worker/run_worker.bat: -------------------------------------------------------------------------------- 1 | node app.js -------------------------------------------------------------------------------- /app/.idea/.name: -------------------------------------------------------------------------------- 1 | app -------------------------------------------------------------------------------- /app/.idea/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/.idea/libraries/app_node_modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/.idea/runConfigurations/bin_www.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 124 | 125 | 126 | 146 | 147 | 148 | 149 | true 150 | 151 | 152 | 153 | 154 | 155 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 191 | 192 | 193 | 194 | 197 | 198 | 201 | 202 | 203 | 204 | 207 | 208 | 211 | 212 | 215 | 216 | 217 | 218 | 221 | 222 | 225 | 226 | 229 | 230 | 231 | 232 | 235 | 236 | 239 | 240 | 243 | 244 | 245 | 246 | 249 | 250 | 253 | 254 | 257 | 258 | 261 | 262 | 263 | 264 | 267 | 268 | 271 | 272 | 275 | 276 | 279 | 280 | 281 | 282 | 285 | 286 | 289 | 290 | 293 | 294 | 295 | 296 | 299 | 300 | 303 | 304 | 307 | 308 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 363 | 364 | 365 | 366 | 367 | 368 | true 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 1448191095064 384 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 416 | 419 | 420 | 421 | 423 | 424 | 425 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | -------------------------------------------------------------------------------- /app/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var favicon = require('serve-favicon'); 4 | var logger = require('morgan'); 5 | var cookieParser = require('cookie-parser'); 6 | var bodyParser = require('body-parser'); 7 | var engine = require('ejs-locals'); 8 | 9 | //var routes = require('./routes/index'); 10 | //var users = require('./routes/users'); 11 | var game = require('./routes/game'); 12 | var start_game = require('./routes/start_game'); 13 | 14 | var app = express(); 15 | 16 | // view engine setup 17 | app.set('views', path.join(__dirname, 'views')); 18 | app.engine('ejs', engine); 19 | app.set('view engine', 'ejs'); 20 | 21 | // uncomment after placing your favicon in /public 22 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 23 | app.use(logger('dev')); 24 | app.use(bodyParser.json()); 25 | app.use(bodyParser.urlencoded({ extended: false })); 26 | app.use(cookieParser()); 27 | 28 | 29 | app.use(express.static(path.join(__dirname, 'public'))); 30 | 31 | //app.use('/', routes); 32 | //app.use('/users', users); 33 | app.use('/game', game); 34 | app.use('/startGame', start_game); 35 | 36 | // catch 404 and forward to error handler 37 | app.use(function(req, res, next) { 38 | var err = new Error('Not Found'); 39 | err.status = 404; 40 | next(err); 41 | }); 42 | 43 | // error handlers 44 | 45 | // development error handler 46 | // will print stacktrace 47 | 48 | app.use(function(err, req, res, next) { 49 | res.status(err.status || 500); 50 | res.render('error', { 51 | message: err.message, 52 | error: err 53 | }); 54 | }); 55 | 56 | 57 | module.exports = app; 58 | -------------------------------------------------------------------------------- /app/bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('app:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /app/node_modules/config/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 17.11.2015. 3 | */ 4 | var config = {}; 5 | config.start_port = '3000'; 6 | config.workers = { 7 | data: [{ 8 | hostname: 'localhost', 9 | port: '6001', 10 | //address: 'http://192.168.137.196:6001' 11 | address: 'http://localhost:6001' 12 | }, { 13 | hostname: 'localhost', 14 | port: '6002', 15 | address: 'http://localhost:6002' 16 | } 17 | ], 18 | api: { 19 | check_url: '/isWorking', 20 | start_game: '/startGame' 21 | }, 22 | secret: "tYo9p21o3ERe0'" 23 | }; 24 | config.db_address = 'http://192.168.137.236:4001'; 25 | //config.db_address = 'http://localhost:4001'; 26 | 27 | config.debug = false; 28 | 29 | module.exports = config; -------------------------------------------------------------------------------- /app/node_modules/db/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 22.11.2015. 3 | */ 4 | var util = require('util'); 5 | var io = require('socket.io-client'); 6 | var config = require('config'); 7 | 8 | var db = {}; 9 | 10 | 11 | db.socket = io.connect(config.db_address); 12 | 13 | db.is_work = function(){ 14 | return this.socket.connected; 15 | }; 16 | 17 | db.check_user = function(body, callback){ 18 | if(config.debug){ 19 | console.log('DEGUG'); 20 | callback(true); 21 | return; 22 | } 23 | if(!this.is_work() || body == undefined || body == null){ 24 | console.log('Db is not working'); 25 | callback(false); 26 | return; 27 | } 28 | this.socket.off('send_checked_data'); 29 | this.socket.on('send_checked_data', function (res) { 30 | if (res.result !== null) { 31 | callback(true); 32 | } 33 | else { 34 | callback(false); 35 | } 36 | }); 37 | this.socket.emit('send_data_for_check', { 38 | login: body.login, 39 | pass: body.pass 40 | }); 41 | }; 42 | 43 | module.exports = db; -------------------------------------------------------------------------------- /app/node_modules/worker_manager/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 23.11.2015. 3 | */ 4 | var config = require('config'); 5 | var http = require('http'); 6 | var active_workers = []; 7 | 8 | config.workers.data.forEach(function(item) { 9 | http.get(item.address + config.workers.api.check_url, function(res) { 10 | console.log(item.address + ' works'); 11 | active_workers.push({ 12 | url: item.address, 13 | count:0 14 | }); 15 | }).on('error', function(e) { 16 | console.log(item.address + ' doesn\'t works'); 17 | }); 18 | 19 | }); 20 | 21 | exports.get_worker = function(){ 22 | if(active_workers.length > 0) { 23 | var worker = active_workers[0]; 24 | active_workers.forEach(function(item){ 25 | if(item.count < worker.count){ 26 | worker = item; 27 | } 28 | }); 29 | worker.count ++; 30 | return worker.url; 31 | } 32 | else{ 33 | return null; 34 | } 35 | }; -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "body-parser": "~1.13.2", 10 | "cookie-parser": "~1.3.5", 11 | "debug": "~2.2.0", 12 | "ejs": "~2.3.3", 13 | "express": "~4.13.1", 14 | "morgan": "~1.6.1", 15 | "serve-favicon": "~2.3.0", 16 | "basic-auth" : "1.0.3", 17 | "ejs-locals" : "1.0.2", 18 | "util": "0.10.3", 19 | "socket.io-client": "1.3.7" 20 | } 21 | } -------------------------------------------------------------------------------- /app/public/css/bootstrap-theme.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /*! 8 | * Generated using the Bootstrap Customizer (http://bootstrap-3.ru/customize.php?id=c8141826cc160add19a4) 9 | * Config saved to config.json and https://gist.github.com/c8141826cc160add19a4 10 | */ 11 | /*! 12 | * Bootstrap v3.3.5 (http://getbootstrap.com) 13 | * Copyright 2011-2015 Twitter, Inc. 14 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 15 | */ 16 | .btn-default, 17 | .btn-primary, 18 | .btn-success, 19 | .btn-info, 20 | .btn-warning, 21 | .btn-danger { 22 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); 23 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); 24 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); 25 | } 26 | .btn-default:active, 27 | .btn-primary:active, 28 | .btn-success:active, 29 | .btn-info:active, 30 | .btn-warning:active, 31 | .btn-danger:active, 32 | .btn-default.active, 33 | .btn-primary.active, 34 | .btn-success.active, 35 | .btn-info.active, 36 | .btn-warning.active, 37 | .btn-danger.active { 38 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); 39 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); 40 | } 41 | .btn-default.disabled, 42 | .btn-primary.disabled, 43 | .btn-success.disabled, 44 | .btn-info.disabled, 45 | .btn-warning.disabled, 46 | .btn-danger.disabled, 47 | .btn-default[disabled], 48 | .btn-primary[disabled], 49 | .btn-success[disabled], 50 | .btn-info[disabled], 51 | .btn-warning[disabled], 52 | .btn-danger[disabled], 53 | fieldset[disabled] .btn-default, 54 | fieldset[disabled] .btn-primary, 55 | fieldset[disabled] .btn-success, 56 | fieldset[disabled] .btn-info, 57 | fieldset[disabled] .btn-warning, 58 | fieldset[disabled] .btn-danger { 59 | -webkit-box-shadow: none; 60 | box-shadow: none; 61 | } 62 | .btn-default .badge, 63 | .btn-primary .badge, 64 | .btn-success .badge, 65 | .btn-info .badge, 66 | .btn-warning .badge, 67 | .btn-danger .badge { 68 | text-shadow: none; 69 | } 70 | .btn:active, 71 | .btn.active { 72 | background-image: none; 73 | } 74 | .btn-default { 75 | background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); 76 | background-image: -o-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); 77 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e0e0e0)); 78 | background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%); 79 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); 80 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 81 | background-repeat: repeat-x; 82 | border-color: #dbdbdb; 83 | text-shadow: 0 1px 0 #fff; 84 | border-color: #ccc; 85 | } 86 | .btn-default:hover, 87 | .btn-default:focus { 88 | background-color: #e0e0e0; 89 | background-position: 0 -15px; 90 | } 91 | .btn-default:active, 92 | .btn-default.active { 93 | background-color: #e0e0e0; 94 | border-color: #dbdbdb; 95 | } 96 | .btn-default.disabled, 97 | .btn-default[disabled], 98 | fieldset[disabled] .btn-default, 99 | .btn-default.disabled:hover, 100 | .btn-default[disabled]:hover, 101 | fieldset[disabled] .btn-default:hover, 102 | .btn-default.disabled:focus, 103 | .btn-default[disabled]:focus, 104 | fieldset[disabled] .btn-default:focus, 105 | .btn-default.disabled.focus, 106 | .btn-default[disabled].focus, 107 | fieldset[disabled] .btn-default.focus, 108 | .btn-default.disabled:active, 109 | .btn-default[disabled]:active, 110 | fieldset[disabled] .btn-default:active, 111 | .btn-default.disabled.active, 112 | .btn-default[disabled].active, 113 | fieldset[disabled] .btn-default.active { 114 | background-color: #e0e0e0; 115 | background-image: none; 116 | } 117 | .btn-primary { 118 | background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%); 119 | background-image: -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%); 120 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#2d6ca2)); 121 | background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%); 122 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0); 123 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 124 | background-repeat: repeat-x; 125 | border-color: #2b669a; 126 | } 127 | .btn-primary:hover, 128 | .btn-primary:focus { 129 | background-color: #2d6ca2; 130 | background-position: 0 -15px; 131 | } 132 | .btn-primary:active, 133 | .btn-primary.active { 134 | background-color: #2d6ca2; 135 | border-color: #2b669a; 136 | } 137 | .btn-primary.disabled, 138 | .btn-primary[disabled], 139 | fieldset[disabled] .btn-primary, 140 | .btn-primary.disabled:hover, 141 | .btn-primary[disabled]:hover, 142 | fieldset[disabled] .btn-primary:hover, 143 | .btn-primary.disabled:focus, 144 | .btn-primary[disabled]:focus, 145 | fieldset[disabled] .btn-primary:focus, 146 | .btn-primary.disabled.focus, 147 | .btn-primary[disabled].focus, 148 | fieldset[disabled] .btn-primary.focus, 149 | .btn-primary.disabled:active, 150 | .btn-primary[disabled]:active, 151 | fieldset[disabled] .btn-primary:active, 152 | .btn-primary.disabled.active, 153 | .btn-primary[disabled].active, 154 | fieldset[disabled] .btn-primary.active { 155 | background-color: #2d6ca2; 156 | background-image: none; 157 | } 158 | .btn-success { 159 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); 160 | background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); 161 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); 162 | background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); 163 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); 164 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 165 | background-repeat: repeat-x; 166 | border-color: #3e8f3e; 167 | } 168 | .btn-success:hover, 169 | .btn-success:focus { 170 | background-color: #419641; 171 | background-position: 0 -15px; 172 | } 173 | .btn-success:active, 174 | .btn-success.active { 175 | background-color: #419641; 176 | border-color: #3e8f3e; 177 | } 178 | .btn-success.disabled, 179 | .btn-success[disabled], 180 | fieldset[disabled] .btn-success, 181 | .btn-success.disabled:hover, 182 | .btn-success[disabled]:hover, 183 | fieldset[disabled] .btn-success:hover, 184 | .btn-success.disabled:focus, 185 | .btn-success[disabled]:focus, 186 | fieldset[disabled] .btn-success:focus, 187 | .btn-success.disabled.focus, 188 | .btn-success[disabled].focus, 189 | fieldset[disabled] .btn-success.focus, 190 | .btn-success.disabled:active, 191 | .btn-success[disabled]:active, 192 | fieldset[disabled] .btn-success:active, 193 | .btn-success.disabled.active, 194 | .btn-success[disabled].active, 195 | fieldset[disabled] .btn-success.active { 196 | background-color: #419641; 197 | background-image: none; 198 | } 199 | .btn-info { 200 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 201 | background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 202 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); 203 | background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); 204 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); 205 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 206 | background-repeat: repeat-x; 207 | border-color: #28a4c9; 208 | } 209 | .btn-info:hover, 210 | .btn-info:focus { 211 | background-color: #2aabd2; 212 | background-position: 0 -15px; 213 | } 214 | .btn-info:active, 215 | .btn-info.active { 216 | background-color: #2aabd2; 217 | border-color: #28a4c9; 218 | } 219 | .btn-info.disabled, 220 | .btn-info[disabled], 221 | fieldset[disabled] .btn-info, 222 | .btn-info.disabled:hover, 223 | .btn-info[disabled]:hover, 224 | fieldset[disabled] .btn-info:hover, 225 | .btn-info.disabled:focus, 226 | .btn-info[disabled]:focus, 227 | fieldset[disabled] .btn-info:focus, 228 | .btn-info.disabled.focus, 229 | .btn-info[disabled].focus, 230 | fieldset[disabled] .btn-info.focus, 231 | .btn-info.disabled:active, 232 | .btn-info[disabled]:active, 233 | fieldset[disabled] .btn-info:active, 234 | .btn-info.disabled.active, 235 | .btn-info[disabled].active, 236 | fieldset[disabled] .btn-info.active { 237 | background-color: #2aabd2; 238 | background-image: none; 239 | } 240 | .btn-warning { 241 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 242 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 243 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); 244 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); 245 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); 246 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 247 | background-repeat: repeat-x; 248 | border-color: #e38d13; 249 | } 250 | .btn-warning:hover, 251 | .btn-warning:focus { 252 | background-color: #eb9316; 253 | background-position: 0 -15px; 254 | } 255 | .btn-warning:active, 256 | .btn-warning.active { 257 | background-color: #eb9316; 258 | border-color: #e38d13; 259 | } 260 | .btn-warning.disabled, 261 | .btn-warning[disabled], 262 | fieldset[disabled] .btn-warning, 263 | .btn-warning.disabled:hover, 264 | .btn-warning[disabled]:hover, 265 | fieldset[disabled] .btn-warning:hover, 266 | .btn-warning.disabled:focus, 267 | .btn-warning[disabled]:focus, 268 | fieldset[disabled] .btn-warning:focus, 269 | .btn-warning.disabled.focus, 270 | .btn-warning[disabled].focus, 271 | fieldset[disabled] .btn-warning.focus, 272 | .btn-warning.disabled:active, 273 | .btn-warning[disabled]:active, 274 | fieldset[disabled] .btn-warning:active, 275 | .btn-warning.disabled.active, 276 | .btn-warning[disabled].active, 277 | fieldset[disabled] .btn-warning.active { 278 | background-color: #eb9316; 279 | background-image: none; 280 | } 281 | .btn-danger { 282 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 283 | background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 284 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); 285 | background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); 286 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); 287 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 288 | background-repeat: repeat-x; 289 | border-color: #b92c28; 290 | } 291 | .btn-danger:hover, 292 | .btn-danger:focus { 293 | background-color: #c12e2a; 294 | background-position: 0 -15px; 295 | } 296 | .btn-danger:active, 297 | .btn-danger.active { 298 | background-color: #c12e2a; 299 | border-color: #b92c28; 300 | } 301 | .btn-danger.disabled, 302 | .btn-danger[disabled], 303 | fieldset[disabled] .btn-danger, 304 | .btn-danger.disabled:hover, 305 | .btn-danger[disabled]:hover, 306 | fieldset[disabled] .btn-danger:hover, 307 | .btn-danger.disabled:focus, 308 | .btn-danger[disabled]:focus, 309 | fieldset[disabled] .btn-danger:focus, 310 | .btn-danger.disabled.focus, 311 | .btn-danger[disabled].focus, 312 | fieldset[disabled] .btn-danger.focus, 313 | .btn-danger.disabled:active, 314 | .btn-danger[disabled]:active, 315 | fieldset[disabled] .btn-danger:active, 316 | .btn-danger.disabled.active, 317 | .btn-danger[disabled].active, 318 | fieldset[disabled] .btn-danger.active { 319 | background-color: #c12e2a; 320 | background-image: none; 321 | } 322 | .thumbnail, 323 | .img-thumbnail { 324 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 325 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 326 | } 327 | .dropdown-menu > li > a:hover, 328 | .dropdown-menu > li > a:focus { 329 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 330 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 331 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); 332 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 333 | background-repeat: repeat-x; 334 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 335 | background-color: #e8e8e8; 336 | } 337 | .dropdown-menu > .active > a, 338 | .dropdown-menu > .active > a:hover, 339 | .dropdown-menu > .active > a:focus { 340 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 341 | background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%); 342 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd)); 343 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 344 | background-repeat: repeat-x; 345 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 346 | background-color: #357ebd; 347 | } 348 | .navbar-default { 349 | background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); 350 | background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); 351 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#f8f8f8)); 352 | background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%); 353 | background-repeat: repeat-x; 354 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); 355 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 356 | border-radius: 4px; 357 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 358 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 359 | } 360 | .navbar-default .navbar-nav > .open > a, 361 | .navbar-default .navbar-nav > .active > a { 362 | background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); 363 | background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); 364 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); 365 | background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); 366 | background-repeat: repeat-x; 367 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); 368 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 369 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 370 | } 371 | .navbar-brand, 372 | .navbar-nav > li > a { 373 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); 374 | } 375 | .navbar-inverse { 376 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%); 377 | background-image: -o-linear-gradient(top, #3c3c3c 0%, #222222 100%); 378 | background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222222)); 379 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%); 380 | background-repeat: repeat-x; 381 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); 382 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 383 | border-radius: 4px; 384 | } 385 | .navbar-inverse .navbar-nav > .open > a, 386 | .navbar-inverse .navbar-nav > .active > a { 387 | background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); 388 | background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); 389 | background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); 390 | background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); 391 | background-repeat: repeat-x; 392 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); 393 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 394 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 395 | } 396 | .navbar-inverse .navbar-brand, 397 | .navbar-inverse .navbar-nav > li > a { 398 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 399 | } 400 | .navbar-static-top, 401 | .navbar-fixed-top, 402 | .navbar-fixed-bottom { 403 | border-radius: 0; 404 | } 405 | @media (max-width: 767px) { 406 | .navbar .navbar-nav .open .dropdown-menu > .active > a, 407 | .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, 408 | .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { 409 | color: #fff; 410 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 411 | background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%); 412 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd)); 413 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 414 | background-repeat: repeat-x; 415 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 416 | } 417 | } 418 | .alert { 419 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); 420 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 421 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 422 | } 423 | .alert-success { 424 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 425 | background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 426 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); 427 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); 428 | background-repeat: repeat-x; 429 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); 430 | border-color: #b2dba1; 431 | } 432 | .alert-info { 433 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 434 | background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 435 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); 436 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); 437 | background-repeat: repeat-x; 438 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); 439 | border-color: #9acfea; 440 | } 441 | .alert-warning { 442 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 443 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 444 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); 445 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); 446 | background-repeat: repeat-x; 447 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); 448 | border-color: #f5e79e; 449 | } 450 | .alert-danger { 451 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 452 | background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 453 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); 454 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); 455 | background-repeat: repeat-x; 456 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); 457 | border-color: #dca7a7; 458 | } 459 | .progress { 460 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 461 | background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 462 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); 463 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); 464 | background-repeat: repeat-x; 465 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); 466 | } 467 | .progress-bar { 468 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); 469 | background-image: -o-linear-gradient(top, #428bca 0%, #3071a9 100%); 470 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3071a9)); 471 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); 472 | background-repeat: repeat-x; 473 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); 474 | } 475 | .progress-bar-success { 476 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); 477 | background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); 478 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); 479 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); 480 | background-repeat: repeat-x; 481 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); 482 | } 483 | .progress-bar-info { 484 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 485 | background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 486 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); 487 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); 488 | background-repeat: repeat-x; 489 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); 490 | } 491 | .progress-bar-warning { 492 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 493 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 494 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); 495 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); 496 | background-repeat: repeat-x; 497 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); 498 | } 499 | .progress-bar-danger { 500 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); 501 | background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); 502 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); 503 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); 504 | background-repeat: repeat-x; 505 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); 506 | } 507 | .progress-bar-striped { 508 | background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); 509 | background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); 510 | background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); 511 | } 512 | .list-group { 513 | border-radius: 4px; 514 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 515 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 516 | } 517 | .list-group-item.active, 518 | .list-group-item.active:hover, 519 | .list-group-item.active:focus { 520 | text-shadow: 0 -1px 0 #3071a9; 521 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); 522 | background-image: -o-linear-gradient(top, #428bca 0%, #3278b3 100%); 523 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3278b3)); 524 | background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); 525 | background-repeat: repeat-x; 526 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); 527 | border-color: #3278b3; 528 | } 529 | .list-group-item.active .badge, 530 | .list-group-item.active:hover .badge, 531 | .list-group-item.active:focus .badge { 532 | text-shadow: none; 533 | } 534 | .panel { 535 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 536 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 537 | } 538 | .panel-default > .panel-heading { 539 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 540 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 541 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); 542 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 543 | background-repeat: repeat-x; 544 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 545 | } 546 | .panel-primary > .panel-heading { 547 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 548 | background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%); 549 | background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd)); 550 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 551 | background-repeat: repeat-x; 552 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 553 | } 554 | .panel-success > .panel-heading { 555 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 556 | background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 557 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); 558 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); 559 | background-repeat: repeat-x; 560 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); 561 | } 562 | .panel-info > .panel-heading { 563 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 564 | background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 565 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); 566 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); 567 | background-repeat: repeat-x; 568 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); 569 | } 570 | .panel-warning > .panel-heading { 571 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 572 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 573 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); 574 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); 575 | background-repeat: repeat-x; 576 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); 577 | } 578 | .panel-danger > .panel-heading { 579 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 580 | background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 581 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); 582 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); 583 | background-repeat: repeat-x; 584 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); 585 | } 586 | .well { 587 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 588 | background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 589 | background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); 590 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); 591 | background-repeat: repeat-x; 592 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); 593 | border-color: #dcdcdc; 594 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 595 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 596 | } 597 | -------------------------------------------------------------------------------- /app/public/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /*! 8 | * Generated using the Bootstrap Customizer (http://bootstrap-3.ru/customize.php?id=c8141826cc160add19a4) 9 | * Config saved to config.json and https://gist.github.com/c8141826cc160add19a4 10 | *//*! 11 | * Bootstrap v3.3.5 (http://getbootstrap.com) 12 | * Copyright 2011-2015 Twitter, Inc. 13 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 14 | */.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-default.disabled,.btn-primary.disabled,.btn-success.disabled,.btn-info.disabled,.btn-warning.disabled,.btn-danger.disabled,.btn-default[disabled],.btn-primary[disabled],.btn-success[disabled],.btn-info[disabled],.btn-warning[disabled],.btn-danger[disabled],fieldset[disabled] .btn-default,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-info,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-danger{-webkit-box-shadow:none;box-shadow:none}.btn-default .badge,.btn-primary .badge,.btn-success .badge,.btn-info .badge,.btn-warning .badge,.btn-danger .badge{text-shadow:none}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:-o-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0));background-image:linear-gradient(to bottom, #fff 0, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top, #428bca 0, #2d6ca2 100%);background-image:-o-linear-gradient(top, #428bca 0, #2d6ca2 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#2d6ca2));background-image:linear-gradient(to bottom, #428bca 0, #2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#2d6ca2;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:-o-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641));background-image:linear-gradient(to bottom, #5cb85c 0, #419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:-o-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2));background-image:linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:-o-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316));background-image:linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:-o-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a));background-image:linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#c12e2a;background-image:none}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-o-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#357ebd));background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:-o-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8));background-image:linear-gradient(to bottom, #fff 0, #f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);background-image:-o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2));background-image:linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:-o-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222));background-image:linear-gradient(to bottom, #3c3c3c 0, #222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #080808 0, #0f0f0f 100%);background-image:-o-linear-gradient(top, #080808 0, #0f0f0f 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f));background-image:linear-gradient(to bottom, #080808 0, #0f0f0f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-o-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#357ebd));background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:-o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc));background-image:linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:-o-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0));background-image:linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:-o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0));background-image:linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:-o-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3));background-image:linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:-o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5));background-image:linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top, #428bca 0, #3071a9 100%);background-image:-o-linear-gradient(top, #428bca 0, #3071a9 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#3071a9));background-image:linear-gradient(to bottom, #428bca 0, #3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:-o-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44));background-image:linear-gradient(to bottom, #5cb85c 0, #449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:-o-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5));background-image:linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:-o-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f));background-image:linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:-o-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c));background-image:linear-gradient(to bottom, #d9534f 0, #c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top, #428bca 0, #3278b3 100%);background-image:-o-linear-gradient(top, #428bca 0, #3278b3 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#3278b3));background-image:linear-gradient(to bottom, #428bca 0, #3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.list-group-item.active .badge,.list-group-item.active:hover .badge,.list-group-item.active:focus .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-o-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #428bca), to(#357ebd));background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:-o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6));background-image:linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:-o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3));background-image:linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:-o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc));background-image:linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:-o-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc));background-image:linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:-o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5));background-image:linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} -------------------------------------------------------------------------------- /app/public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /app/public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /app/public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/public/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /app/public/images/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/images/cross.png -------------------------------------------------------------------------------- /app/public/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/images/empty.png -------------------------------------------------------------------------------- /app/public/images/zero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmitryartuh/nodejsapp/1de78f67a45bd92cca7cf01e18ab19fb66400657/app/public/images/zero.png -------------------------------------------------------------------------------- /app/public/js/game.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 15.11.2015. 3 | */ 4 | 5 | gameApp.controller('gameController', ['$window', '$scope', '$rootScope', '$timeout', function($window, $scope, $rootScope, $timeout){ 6 | $scope.game_started = false; 7 | $scope.wait = false; 8 | this.message = ''; 9 | this.connected = false; 10 | this.connect = function(){ 11 | var gc = this; 12 | this.socket = io.connect($rootScope.worker_url); 13 | this.connected = true; 14 | 15 | this.socket.on('connecting', function () { 16 | console.log('connecting...'); 17 | }); 18 | 19 | this.socket.on('disconnect', function(){ 20 | console.log('disconnected'); 21 | $scope.game_started = false; 22 | gc.connected = false; 23 | $scope.$apply(); 24 | alert('something went wrong'); 25 | $window.location.reload(); 26 | }); 27 | 28 | this.socket.on('wait_partner', function(data) { 29 | console.log(data); 30 | }); 31 | 32 | this.socket.on('error', function(data) { 33 | alert('something went wrong'); 34 | $window.location.reload(); 35 | }); 36 | 37 | this.socket.on('double_connect', function(data){ 38 | console.log('double_connect'); 39 | }); 40 | 41 | this.socket.on('won', function(data){ 42 | console.log('won'); 43 | 44 | gc.game_finished(true, data); 45 | }); 46 | 47 | this.socket.on('draw', function(data){ 48 | console.log('draw'); 49 | gc.game_finished(false); 50 | }); 51 | 52 | this.socket.on('lost', function(data){ 53 | console.log('lost'); 54 | gc.game_finished(false); 55 | }); 56 | 57 | this.socket.on('started_new_game', function (game) { 58 | $scope.game_started = true; 59 | gc.game = game; 60 | gc.step = false; 61 | if(gc.game.current_user == gc.socket.id){ 62 | gc.step = true; 63 | } 64 | $scope.$apply(); 65 | $timeout(function() { 66 | var cw = $('.image').width(); 67 | $('.image').css({'height':cw+'px'}); 68 | }, 100); 69 | }); 70 | 71 | this.socket.on('update', function(game) { 72 | if(game.current_user == gc.socket.id){ 73 | gc.step = true; 74 | } 75 | gc.game = game; 76 | 77 | gc.updateState(game.state); 78 | }); 79 | }; 80 | this.start_game = function() { 81 | if($scope.wait){ 82 | return; 83 | } 84 | $scope.wait = true; 85 | $.each($('.image'), function(key, value){ 86 | $(value).removeClass('zero cross empty').addClass('empty'); 87 | }); 88 | if(!this.connected){ 89 | this.connect(); 90 | } 91 | this.message = ''; 92 | this.socket.emit('new_game'); 93 | }; 94 | 95 | this.game_finished = function(value, data){ 96 | if(value){ 97 | if(data !== undefined && data !== null) { 98 | this.message = 'Won! Nice work!' + data; 99 | } 100 | else { 101 | this.message = 'Won! Nice work!'; 102 | } 103 | } 104 | else { 105 | this.message = 'Loser!'; 106 | } 107 | $scope.game_started = false; 108 | $scope.wait = false; 109 | $scope.$apply(); 110 | } 111 | 112 | this.setZero = function (i, j) { 113 | if(this.step && $scope.game_started) { 114 | if(this.game.state[i - 1][j - 1] != -1){ 115 | return; 116 | } 117 | this.step = false; 118 | this.socket.emit('update_state', { 119 | id: this.game.id, 120 | x: i - 1, 121 | y: j - 1 122 | }); 123 | } 124 | // $('#' + i + j + '.image').removeClass().addClass(this.step); 125 | }; 126 | 127 | this.updateState = function(sessionState){ 128 | if(sessionState != null){ 129 | for (var i = 0; i < 3; i++) { 130 | for (var j = 0; j < 3; j++){ 131 | var ii = i + 1; 132 | var jj = j + 1; 133 | $('#' + ii + jj + '.image').removeClass('zero cross empty'); 134 | if(sessionState[i][j] == 0){ 135 | $('#' + ii + jj + '.image').addClass('zero'); 136 | } 137 | else if (sessionState[i][j] == 1){ 138 | $('#' + ii + jj + '.image').addClass('cross'); 139 | } 140 | else { 141 | $('#' + ii + jj + '.image').addClass('empty'); 142 | } 143 | } 144 | } 145 | } 146 | }; 147 | }]); -------------------------------------------------------------------------------- /app/public/js/login.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 13.11.2015. 3 | */ 4 | var gameApp = angular.module('gameApp', []); 5 | 6 | gameApp.factory('Base64', function() { 7 | var keyStr = 'ABCDEFGHIJKLMNOP' + 8 | 'QRSTUVWXYZabcdef' + 9 | 'ghijklmnopqrstuv' + 10 | 'wxyz0123456789+/' + 11 | '='; 12 | return { 13 | encode: function (input) { 14 | var output = ""; 15 | var chr1, chr2, chr3 = ""; 16 | var enc1, enc2, enc3, enc4 = ""; 17 | var i = 0; 18 | 19 | do { 20 | chr1 = input.charCodeAt(i++); 21 | chr2 = input.charCodeAt(i++); 22 | chr3 = input.charCodeAt(i++); 23 | 24 | enc1 = chr1 >> 2; 25 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 26 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 27 | enc4 = chr3 & 63; 28 | 29 | if (isNaN(chr2)) { 30 | enc3 = enc4 = 64; 31 | } else if (isNaN(chr3)) { 32 | enc4 = 64; 33 | } 34 | 35 | output = output + 36 | keyStr.charAt(enc1) + 37 | keyStr.charAt(enc2) + 38 | keyStr.charAt(enc3) + 39 | keyStr.charAt(enc4); 40 | chr1 = chr2 = chr3 = ""; 41 | enc1 = enc2 = enc3 = enc4 = ""; 42 | } while (i < input.length); 43 | 44 | return output; 45 | } 46 | } 47 | }); 48 | 49 | gameApp.controller('login_form', ['$scope', '$http', '$location', 'Base64', '$rootScope', function($scope, $http, $location, Base64, $rootScope) { 50 | $rootScope.inlog = false; 51 | $rootScope.worker_url = ''; 52 | this.sendInfo = function(){ 53 | var data = { 54 | pass: this.pass, 55 | login: this.login 56 | }; 57 | $http({ 58 | method: 'POST', 59 | url: $location.absUrl(), 60 | data: data 61 | }).then(function successCallback(response) { 62 | if (response.data.login_state){ 63 | $rootScope.inlog = true; 64 | } 65 | else{ 66 | $rootScope.inlog = false; 67 | } 68 | }, function errorCallback(response) { 69 | console.log('error'); 70 | }); 71 | }; 72 | 73 | this.startNewGame = function(){ 74 | $http.defaults.headers.common['Authorization'] = 'Basic ' + Base64.encode(this.login + ':' + this.pass); 75 | $http({ 76 | method: 'GET', 77 | url: '/startGame' 78 | }).success(function(data){ 79 | $rootScope.worker_url = data; 80 | }); 81 | }; 82 | }]); -------------------------------------------------------------------------------- /app/public/libs/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /*! 8 | * Generated using the Bootstrap Customizer (http://bootstrap-3.ru/customize.php?id=c8141826cc160add19a4) 9 | * Config saved to config.json and https://gist.github.com/c8141826cc160add19a4 10 | */ 11 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.5",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.5",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),t(i.target).is('input[type="radio"]')||t(i.target).is('input[type="checkbox"]')||i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.5",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",s))))}))}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.5",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",r)}return!1}},a.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var n=e(o),a=n.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find(".dropdown-menu"+r);if(l.length){var h=l.index(i.target);38==i.which&&h>0&&h--,40==i.which&&hdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+c>u.bottom?"top":"top"==r&&d.top-cu.width?"left":"left"==r&&d.left-pa.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;ha.right&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.5",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.5",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.5",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.5",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l]); 12 | }}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.5",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e=n[t]&&(void 0===n[t+1]||e<%= message %> 2 |

<%= error.status %>

3 |
<%= error.stack %>
4 | -------------------------------------------------------------------------------- /app/views/game.ejs: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Result - {{gc.message}}

5 |
{{wait}} 6 | 7 |
8 |
9 |
.col-sm-4
10 |
11 |
12 | 13 |
14 |
15 |
.col-sm-4
16 |
17 |
18 |
19 | 20 | -------------------------------------------------------------------------------- /app/views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= title %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
<%= title %>
18 | <%- body %> 19 | 20 | -------------------------------------------------------------------------------- /app/views/login.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout', {title: title}) -%> 2 | 3 |
4 |
5 |
6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 | 25 |
26 |
27 |
28 |
29 |
30 | 31 |
32 |
33 |
34 |
35 |
36 | 37 |
38 |
39 |
40 | Worker url.{{worker_url}}. 41 | <%- include game.ejs %> 42 |
-------------------------------------------------------------------------------- /db_node/.idea/.name: -------------------------------------------------------------------------------- 1 | db_node -------------------------------------------------------------------------------- /db_node/.idea/db_node.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /db_node/.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /db_node/.idea/libraries/db_node_node_modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /db_node/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /db_node/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /db_node/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /db_node/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 100 | 101 | 108 | 109 | 110 | 111 | true 112 | 113 | 114 | 115 | 116 | 117 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 154 | 155 | 156 | 157 | 160 | 161 | 164 | 165 | 166 | 167 | 170 | 171 | 174 | 175 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 223 | 224 | 225 | 226 | 227 | 228 | true 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 1447608087717 247 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 288 | 291 | 292 | 293 | 295 | 296 | 297 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | -------------------------------------------------------------------------------- /db_node/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 17.11.2015. 3 | */ 4 | var config = {}; 5 | config.start_port = '4001'; 6 | //config.couchdb_address = 'http://192.168.137.250:5984'; 7 | config.couchdb_address = 'http://localhost:5984'; 8 | config.db_name = { 9 | // users: 'cz_users' 10 | users: 'test' 11 | }; 12 | 13 | module.exports = config; -------------------------------------------------------------------------------- /db_node/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by User on 15.11.2015. 3 | // */ 4 | var config = require('./config') 5 | var express = require('express'); 6 | var util = require('util'); 7 | var app = express(); 8 | var server = app.listen(config.start_port); 9 | var io = require('socket.io').listen(server); 10 | 11 | var nano = require('nano')(config.couchdb_address); 12 | var db_name = config.db_name.users; 13 | var db = nano.use(db_name); 14 | 15 | io.sockets.on('connection', function (socket) { 16 | console.log('Client connected...'); 17 | socket.on('send_data_for_check', function (data) { 18 | console.log('received data: ' + data.login + ', ' + data.pass); 19 | if(data.login != undefined && data.login != null && 20 | data.pass != undefined && data.pass != null){ 21 | nano.db.use(db_name).list(function(err, body) { 22 | if (!err) { 23 | var count = 0; 24 | var finished = false; 25 | body.rows.forEach(function(doc) { 26 | count ++; 27 | db.get(doc.id, function(err, doc) { 28 | if(doc.login != undefined && doc.pass != undefined){ 29 | if(doc.login == data.login && doc.pass == data.pass){ 30 | socket.emit('send_checked_data', { 31 | result: doc._id 32 | }); 33 | console.log('found id = ' + doc._id); 34 | finished = true; 35 | } 36 | } 37 | if(count == body.rows.length && !finished){ 38 | console.log('not found'); 39 | socket.emit('send_checked_data', { 40 | result: null 41 | }); 42 | } 43 | }); 44 | }); 45 | } 46 | else{ 47 | console.log('get user list error') 48 | socket.emit('send_checked_data', { 49 | result: null 50 | }); 51 | } 52 | }); 53 | } 54 | else{ 55 | console.log('input data is not valid') 56 | socket.emit('send_checked_data', { 57 | result: null 58 | }); 59 | } 60 | }); 61 | }); 62 | console.log('started'); 63 | 64 | nano.db.use(db_name).list(function(err, body) { 65 | if (!err) { 66 | body.rows.forEach(function(doc) { 67 | db.get(doc.id, function(err, doc) { 68 | console.log(util.inspect(doc)); 69 | }); 70 | }); 71 | } 72 | else{ 73 | console.log('start get users error'); 74 | } 75 | }); 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /db_node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "db", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "start": "node index.js" 6 | }, 7 | "dependencies": { 8 | "express": "~4.13.1", 9 | "util": "0.10.3", 10 | "socket.io": "1.3.7", 11 | "nano": "6.1.5" 12 | } 13 | } -------------------------------------------------------------------------------- /db_node/run_db.bat: -------------------------------------------------------------------------------- 1 | node index.js --------------------------------------------------------------------------------