Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Skurishin Vladislav committed Feb 20, 2016
1 parent aa7c1ef commit d1f3390
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/javascripts/angular/services/LessonProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ app.service('lessonProvider', ['$storage', function ($storage)
},
instructions:
'<ul>' +
'<li>Введите свое имя в кавычках, к примеру для меня код будет выглядеть так: <span class="red-label">«Джайна»</span>.</li>' +
'<li>Введите свое имя в кавычках, к примеру для меня код будет выглядеть так: <span class="red-label">"Джайна"</span>.</li>' +
'<li>Для запуска кода нажмите, в правом верхнем углу, на зеленую кнопку <i class="glyphicon glyphicon-play green"></i>.</li>' +
'</ul>',
hint: [
Expand Down
14 changes: 12 additions & 2 deletions public/javascripts/angular/welcome/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ var app = angular.module('spacecraft.welcome');
app.controller('WelcomeController', ['$scope', '$storage', '$state', '$sce',
function ($scope, $storage, $state, $sce)
{
var empty = [
{
killEnemy: 0,
takenBonus: 0,
totalScore: 0,
acceptDamage: 0,
takenDamage: 0
}
];

function sum(a, param1, param2, predicate)
{
var c = 0;
Expand All @@ -25,15 +35,15 @@ app.controller('WelcomeController', ['$scope', '$storage', '$state', '$sce',
return c;
}

var stat = $scope.stat = JSON.parse($storage.local.getItem("statistic"));
var stat = $scope.stat = JSON.parse($storage.local.getItem("statistic")) || empty;
var lessons = JSON.parse($storage.local.getItem("lessons")) || [];

// Кол-во подуроков
var size = sum(lessons, null, 'size') || 100;

// Добавляем полное кол-во уроков, если он уже был пройден,
// иначе номер текущего урока.
var end = sum(lessons, 'size', 'current', 'complete');
var end = sum(lessons, 'size', 'current', 'completed');

// Вычитаем из общего размера.
var notEnd = size - end;
Expand Down
6 changes: 6 additions & 0 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,12 @@ div.helper:after {
}

@media (max-width: 800px) {
.container-25,
.container-50,
.container-75 {
width: 100%;
}

.bbot-img {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion public/views/main/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="container-inside" ng-show="index === 1" ng-click="changeChart()">

<div class="chart-inside">
<canvas id="line" ng-show="index === 1"
<canvas id="line"
class="chart chart-line"
chart-data="totalScore"
chart-labels="labels"
Expand Down

0 comments on commit d1f3390

Please sign in to comment.