Skip to content

Commit

Permalink
Fixes js console error (fossasia#725)
Browse files Browse the repository at this point in the history
Most of the js console error and warnings which
were shown earlier has been fixed by this commit.
  • Loading branch information
Shashank Kumar authored and ParthS007 committed Jan 10, 2018
1 parent 7892bae commit de0cebc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 76 deletions.
3 changes: 2 additions & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ <h6 class="title">Instagram</h6>
</div>


<script src="js/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/typed.js"></script>
<script type="text/javascript">
Typed.new('.typed', {
Expand Down
6 changes: 4 additions & 2 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>FOSSASIA | Google Code-In 2017</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta HTTP-EQUIV="Access-Control-Allow-Origin" content="https://code.jquery.com">

<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/flexslider.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" media="all" />
Expand All @@ -18,6 +18,8 @@
<link href="https://fonts.googleapis.com/css?family=Cabin+Sketch" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:300,400%7CRaleway:100,400,300,500,600,700%7COpen+Sans:400,500,600' rel='stylesheet' type='text/css'>
<link rel="icon" href="favicon.ico" />

<link rel="manifest" href="{{ "/manifest.json" | relative_url }}">
</head>

<body class="scroll-assist">
Expand Down
Binary file added img/cover11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ <h4 class="uppercase mb16 animated fadeIn">Student Projects</h4>
<div class="background-image-holder">
{% if project.image %}
<img title="{{project.name}} by {{project.author}}"
2 class="background-image" src="img/projects/{{project.image}}">
class="background-image" src="img/projects/{{project.image}}">
{% else %}
<img title="{{project.name}} by {{project.author}}"
class="background-image" src="img/projects/default.png">
{% endif %}
<span class="student-project-name"><span>By {{ {project.author }}</span></span>
<span class="student-project-name"><span>By {{ project.author }}</span></span>
</div>
</a>
</li>
Expand Down Expand Up @@ -605,7 +605,7 @@ <h3 class="mb40 mb-xs-24">FOSSASIA Google Code-In 2016/17</h3>
</div>
</div>
<blockquote class="embedly-card"><h4><a href="https://www.youtube.com/channel/UCQprMsG-raCIMlBudm20iLQ">FOSSASIA</a></h4><p>FOSSASIA develops Open Source software and hardware solutions with a global developer community from its base in Asia and organizes Open Technology events ar...</p></blockquote>
<script defer src="//cdn.embedly.com/widgets/platform.js"></script>
<script async src="https://cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>
</section>

<!-- Placeholder connect -->
Expand Down
4 changes: 0 additions & 4 deletions js/jquery.min.js

This file was deleted.

72 changes: 6 additions & 66 deletions js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,66 +1503,6 @@ var mr_cookies = {
}
};


var TxtRotate = function(el, toRotate, period) {
this.toRotate = toRotate;
this.el = el;
this.loopNum = 0;
this.period = parseInt(period, 10) || 2000;
this.txt = '';
this.tick();
this.isDeleting = false;
};

TxtRotate.prototype.tick = function() {
var i = this.loopNum % this.toRotate.length;
var fullTxt = this.toRotate[i];

if (this.isDeleting) {
this.txt = fullTxt.substring(0, this.txt.length - 1);
} else {
this.txt = fullTxt.substring(0, this.txt.length + 1);
}

this.el.innerHTML = '<span class="wrap">' + this.txt + '</span>';

var that = this;
var delta = 300 - Math.random() * 100;

if (this.isDeleting) {
delta /= 2;
}

if (!this.isDeleting && this.txt === fullTxt) {
delta = this.period;
this.isDeleting = true;
} else if (this.isDeleting && this.txt === '') {
this.isDeleting = false;
this.loopNum++;
delta = 500;
}

setTimeout(function() {
that.tick();
}, delta);
};

window.onload = function() {
var elements = document.getElementsByClassName('txt-rotate');
for (var i = 0; i < elements.length; i++) {
var toRotate = elements[i].getAttribute('data-rotate');
var period = elements[i].getAttribute('data-period');
if (toRotate) {
new TxtRotate(elements[i], JSON.parse(toRotate), period);
}
}
// INJECT CSS
var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = ".txt-rotate > .wrap { border-right: 0.08em solid #666 }";
document.body.appendChild(css);
};

// Search functions for activities.html page

// can be used to implement search into other components
Expand Down Expand Up @@ -1612,14 +1552,14 @@ jQuery(window).scroll(function() {
var basewrocketmeluncur = parseInt(ftrocketmeluncur.clientWidth);
var swrocketmeluncur = scrolltoprocketmeluncur.clientWidth;
if (basewrocketmeluncur < 1000) {
var leftrocketmeluncur = parseInt(fetchOffset(ftrocketmeluncur)['left']);
var leftrocketmeluncur = parseInt(ftrocketmeluncur.offsetLeft);
leftrocketmeluncur = leftrocketmeluncur < swrocketmeluncur ? leftrocketmeluncur * 2 - swrocketmeluncur : leftrocketmeluncur;
scrolltoprocketmeluncur.style.left = (basewrocketmeluncur + leftrocketmeluncur) + 'px';
scrolltoprocketmeluncur.css('left', (basewrocketmeluncur + leftrocketmeluncur + "px"));
} else {
scrolltoprocketmeluncur.style.left = 'auto';
scrolltoprocketmeluncur.style.right = '10px';
scrolltoprocketmeluncur.css('left', 'auto');
scrolltoprocketmeluncur.css('right', '10px');
}
})
});

jQuery('#rocketmeluncur').click(function() {
jQuery("html, body").animate({
Expand All @@ -1634,5 +1574,5 @@ jQuery('#rocketmeluncur').click(function() {
this.className += ' ' + "launchrocket";
setTimeout(function() {
self.className = 'showrocket';
}, 800)
}, 800);
});

0 comments on commit de0cebc

Please sign in to comment.