Commit cbf939d8 authored by Pascal Hartig's avatar Pascal Hartig

Site JS code style

parent 3a6d6afa
/*global $ */ /*global $ */
(function() { (function () {
'use strict'; 'use strict';
$.fn.persistantPopover = function() { $.fn.persistantPopover = function () {
var popoverTimeout; var popoverTimeout;
function delay() { function delay() {
popoverTimeout = setTimeout(function() { popoverTimeout = setTimeout(function () {
$('.popover').hide(); $('.popover').hide();
}, 100); }, 100);
} }
return this.each(function() { return this.each(function () {
var $this = $( this ); var $this = $(this);
$this.popover({ $this.popover({
trigger: 'manual', trigger: 'manual',
placement: 'right', placement: 'right',
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
title: this.firstChild.textContent + '<a href="' + $this.data('source') + '">Website</a>' title: this.firstChild.textContent + '<a href="' + $this.data('source') + '">Website</a>'
}); });
}) })
.mouseenter(function() { .mouseenter(function () {
clearTimeout( popoverTimeout ); clearTimeout(popoverTimeout);
$('.popover').remove(); $('.popover').remove();
$( this ).popover('show'); $(this).popover('show');
}) })
.mouseleave(function() { .mouseleave(function () {
delay(); delay();
$('.popover').mouseenter(function() { $('.popover').mouseenter(function () {
clearTimeout( popoverTimeout ) ; clearTimeout(popoverTimeout);
}).mouseleave(function() { }).mouseleave(function () {
delay(); delay();
}); });
}); });
...@@ -84,11 +84,11 @@ ...@@ -84,11 +84,11 @@
Quotes.animate = function (container, animSpeed) { Quotes.animate = function (container, animSpeed) {
var fader = function (fadeOut, fadeIn) { var fader = function (fadeOut, fadeIn) {
var fadeOutCallback = function(){ var fadeOutCallback = function () {
fadeIn.fadeIn(500, fadeInCallback); fadeIn.fadeIn(500, fadeInCallback);
}; };
var fadeInCallback = function(){ var fadeInCallback = function () {
window.setTimeout(swap, animSpeed); window.setTimeout(swap, animSpeed);
}; };
...@@ -126,8 +126,8 @@ ...@@ -126,8 +126,8 @@
Quotes.animate(container, 25000); Quotes.animate(container, 25000);
}; };
$.fn.quote = function(quotes) { $.fn.quote = function (quotes) {
return this.each(function(){ return this.each(function () {
Quotes.init.call(this, quotes); Quotes.init.call(this, quotes);
}); });
}; };
...@@ -143,21 +143,21 @@ ...@@ -143,21 +143,21 @@
gravatar: 'http://gravatar.com/avatar/ffe68d6f71b225f7661d33f2a8908281?s=40', gravatar: 'http://gravatar.com/avatar/ffe68d6f71b225f7661d33f2a8908281?s=40',
link: 'https://github.com/paulirish' link: 'https://github.com/paulirish'
} }
},{ }, {
quote: 'Modern JavaScript developers realise an MVC framework is essential for managing the complexity of their apps. TodoMVC is a fabulous community contribution that helps developers compare frameworks on the basis of actual project code, not just claims and anecdotes.', quote: 'Modern JavaScript developers realise an MVC framework is essential for managing the complexity of their apps. TodoMVC is a fabulous community contribution that helps developers compare frameworks on the basis of actual project code, not just claims and anecdotes.',
person: { person: {
name: 'Michael Mahemoff', name: 'Michael Mahemoff',
gravatar: 'http://gravatar.com/avatar/cabf735ce7b8b4471ef46ea54f71832d?s=40', gravatar: 'http://gravatar.com/avatar/cabf735ce7b8b4471ef46ea54f71832d?s=40',
link: 'https://github.com/mahemoff' link: 'https://github.com/mahemoff'
} }
},{ }, {
quote: 'TodoMVC is an immensely valuable attempt at a difficult problem - providing a structured way of comparing JS libraries and frameworks. TodoMVC is a lone data point in a sea of conjecture and opinion.', quote: 'TodoMVC is an immensely valuable attempt at a difficult problem - providing a structured way of comparing JS libraries and frameworks. TodoMVC is a lone data point in a sea of conjecture and opinion.',
person: { person: {
name: 'Justin Meyer', name: 'Justin Meyer',
gravatar: 'http://gravatar.com/avatar/70ee60f32937b52758869488d5753259?s=40', gravatar: 'http://gravatar.com/avatar/70ee60f32937b52758869488d5753259?s=40',
link: 'https://github.com/justinbmeyer' link: 'https://github.com/justinbmeyer'
} }
},{ }, {
quote: 'It can be hard to make the leap from hacking together code that works to writing code that`s organized, maintainable, reusable, and a joy to work on. The TodoMVC project does a great job of introducing developers to different approaches to code organization, and to the various libraries that can help them along the way. If you`re trying to get your bearings in the world of client-side application development, the TodoMVC project is a great place to get started.', quote: 'It can be hard to make the leap from hacking together code that works to writing code that`s organized, maintainable, reusable, and a joy to work on. The TodoMVC project does a great job of introducing developers to different approaches to code organization, and to the various libraries that can help them along the way. If you`re trying to get your bearings in the world of client-side application development, the TodoMVC project is a great place to get started.',
person: { person: {
name: 'Rebecca Murphey', name: 'Rebecca Murphey',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment