Skip to content

Commit

Permalink
VVV linting for the win
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko committed May 12, 2012
1 parent c98db5b commit 87e81fe
Show file tree
Hide file tree
Showing 41 changed files with 95 additions and 61 deletions.
1 change: 1 addition & 0 deletions demos/background-data.js
@@ -1,3 +1,4 @@
/*global jQuery, document, setTimeout, console, $ */
var backgroundData = [
{
"id" : "plain-white",
Expand Down
2 changes: 1 addition & 1 deletion demos/backgrounds.js
Expand Up @@ -2,7 +2,7 @@

"use strict";

/*global require, krusovice, window, console, $, document*/
/*global require, krusovice, window, console, document, jQuery, setTimeout, $ */

/**
*
Expand Down
2 changes: 1 addition & 1 deletion demos/canvas.js
@@ -1,6 +1,6 @@
"use strict";

/*global require, krusovice, window, console, $, document*/
/*global require, krusovice, window, console, document, jQuery, setTimeout, $ */

/**
* Test different <canvas> sizes for the show rendering.
Expand Down
18 changes: 11 additions & 7 deletions demos/effect-browser.js
@@ -1,3 +1,4 @@
/*global require, window, jQuery, document, setTimeout, console, $, krusovice */
"use strict";

/**
Expand Down Expand Up @@ -68,15 +69,16 @@ var effectbrowser = {
lines.forEach(function(l) {
l = l.trim();
console.log("Got line:" + l);
var copy;

if(l != "") {
if(l !== "") {

if(l.indexOf(".jpg") >= 0) {
var copy = $.extend({}, baseelem);
copy = $.extend({}, baseelem);
copy.imageURL = l;
baseplan.push(copy);
} else {
var copy = $.extend({}, baseelem);
copy = $.extend({}, baseelem);
copy.type = "text";
copy.texts = { text : l };
copy.shape = "clear";
Expand All @@ -102,7 +104,7 @@ var effectbrowser = {
},

onScreen : {
type : $("#onscreen option:selected").val() || "zoomfar",
type : $("#onscreen option:selected").val() || "zoomfar"
}

};
Expand Down Expand Up @@ -269,13 +271,13 @@ var effectbrowser = {
defaultName = "Random";
}

var elems = [{id:defaultId, name:defaultName}]
var elems = [{id:defaultId, name:defaultName}];
$.merge(elems, data);

elems.forEach(function(e) {
var selected="";
if(e.id == defaults[id.substring(1)]) {
selected="selected"
selected="selected";
}
sel.append("<option " + selected + " value='" + e.id + "'>" + e.name + "</option>");
});
Expand Down Expand Up @@ -344,6 +346,8 @@ var effectbrowser = {

function switchSong(song) {

/*jshint validthis:true*/

if(!song) {
throw "Who turned off the music?";
}
Expand Down Expand Up @@ -403,7 +407,7 @@ var effectbrowser = {
$("#create-json").click($.proxy(this.outputJSON, this));
}

}
};


require(["krusovice/api", "../src/thirdparty/domready!"], function(krusovice) {
Expand Down
5 changes: 4 additions & 1 deletion demos/horizontal-and-vertical.js
@@ -1,10 +1,13 @@
"using strict";
/*global jQuery, document, setTimeout, console, $ */

/**
* Test show with one portrait and one landscape image.
*/
function getHorizontalAndVerticalDesign() {

"use strict";


// Create a show with two elements
var horizontalAndVerticalPlan = [
{
Expand Down
6 changes: 5 additions & 1 deletion demos/song-data.js
@@ -1,3 +1,7 @@
/*global jQuery, document, setTimeout, console, $ */

"use strict";

var songData = [

{
Expand All @@ -9,4 +13,4 @@ var songData = [
"license" : "Creative Commons",
"categories" : ["Test"]
}
]
];
2 changes: 1 addition & 1 deletion demos/text.js
@@ -1,6 +1,6 @@
"use strict";

/*global require,krusovice,window*/
/*global require, krusovice, window, jQuery, document, setTimeout, console, $ */

/**
* Test different text outputs
Expand Down
5 changes: 4 additions & 1 deletion src/api.js
@@ -1,4 +1,4 @@
/*global define,window*/
/*global define, window, console, jQuery, document, setTimeout */

define("krusovice/api", [

Expand Down Expand Up @@ -44,6 +44,9 @@ define("krusovice/api", [
//"krusovice/thirdparty/three-extra/BloomPass"

], function(require, $, THREE, krusovice) {

"use strict";

console.log("Krusovice API init");
window.krusovice = krusovice;
return krusovice;
Expand Down
2 changes: 1 addition & 1 deletion src/backgrounds.js
Expand Up @@ -3,7 +3,7 @@
*
*/

/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/backgrounds", ["krusovice/thirdparty/jquery-bundle",
"krusovice/core",
Expand Down
4 changes: 3 additions & 1 deletion src/backgrounds/plain.js
Expand Up @@ -4,10 +4,12 @@
* Scroll & rotate inside a bigger continuous 2D texture.
*/

/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/backgrounds/plain", ["krusovice/thirdparty/jquery-bundle", "krusovice/core", "krusovice/backgrounds"], function($, krusovice, backgrounds) {

"use strict";

/**
* Single color background
*/
Expand Down
4 changes: 3 additions & 1 deletion src/backgrounds/scroll2d.js
Expand Up @@ -4,10 +4,12 @@
* Scroll & rotate inside a bigger continuous 2D texture.
*/

/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/backgrounds/scroll2d", ["krusovice/thirdparty/jquery-bundle", "krusovice/core", "krusovice/backgrounds"], function($, krusovice, backgrounds) {

"use strict";

backgrounds.Scroll2D = function(options, data) {
this.data = data;
this.options = options;
Expand Down
2 changes: 2 additions & 0 deletions src/backgrounds/video.js
@@ -1,3 +1,5 @@
/*global console, jQuery, document, setTimeout */

/*
(function() {
"use strict";
Expand Down
5 changes: 4 additions & 1 deletion src/core.js
@@ -1,8 +1,11 @@
/*global define,window*/
/*global define, window, console, jQuery, document, setTimeout */

/* Define krusovice global namespace (from time before require.js) */

define("krusovice/core", [], function() {

"use strict";

var krusovice = window.krusovice || {};
return krusovice;
});
2 changes: 1 addition & 1 deletion src/design.js
@@ -1,4 +1,4 @@
/*global define,window, console*/
/*global define, window, console, jQuery, document, setTimeout */
define("krusovice/design", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion src/editdata.js
@@ -1,4 +1,4 @@
/*global define,window,console*/
/*global define, window, console, jQuery, document, setTimeout */

define("krusovice/editdata", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/effects.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/effects", ['krusovice/thirdparty/jquery-bundle', "krusovice/core", "krusovice/utils"], function($, krusovice, utils) {
"use strict";
Expand Down
10 changes: 5 additions & 5 deletions src/effects/linear.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/effects/linear",
["krusovice/thirdparty/jquery-bundle",
Expand All @@ -8,7 +8,7 @@ define("krusovice/effects/linear",
], function($, krusovice, effects, THREE) {
"use strict";

/*global krusovice,window,THREE*/
/*global krusovice, window, THREE, console, jQuery, document, setTimeout */

/**
*
Expand Down Expand Up @@ -248,8 +248,8 @@ effects.SlightMove = $.extend(true, {}, effects.Interpolate, {
var y = krusovice.utils.splitrnd(r) * effects.ON_SCREEN_MAX_Y;
this.parameters.sourceVariation.position = [x, y, 0];

var x = krusovice.utils.splitrnd(r) * effects.ON_SCREEN_MAX_X;
var y = krusovice.utils.splitrnd(r) * effects.ON_SCREEN_MAX_Y;
x = krusovice.utils.splitrnd(r) * effects.ON_SCREEN_MAX_X;
y = krusovice.utils.splitrnd(r) * effects.ON_SCREEN_MAX_Y;
this.parameters.targetVariation.position = [x, y, 0];
}

Expand Down Expand Up @@ -493,7 +493,7 @@ effects.Flip = $.extend(true, {}, effects.QuaternionRotate, {
p.target.axis = [0,0,0];
p.targetVariation.axis = [0,0,0];
p.target.angle = 0;
},
}

});

Expand Down
2 changes: 1 addition & 1 deletion src/inputelement.js
@@ -1,4 +1,4 @@
/*global define,window,console*/
/*global define, window, console, jQuery, document, setTimeout */

define("krusovice/inputelement", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/loader.js
@@ -1,4 +1,4 @@
/*global define,window,console*/
/*global define, window, console, jQuery, document, setTimeout, Image */

define("krusovice/loader", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
"use strict";
Expand Down
4 changes: 2 additions & 2 deletions src/music.js
@@ -1,4 +1,4 @@
/*global define,window*/
/*global define, window, console, jQuery, document, setTimeout */

define("krusovice/music", ["krusovice/thirdparty/jquery-bundle", "krusovice/core", "krusovice/utils"], function($, krusovice, utils) {
"use strict";
Expand Down Expand Up @@ -91,7 +91,7 @@ krusovice.music.Registry = $.extend(true, {}, utils.Registry, {
*
* @param {Object} audio HTMLAudio element used for music playback, or null if only to load rhytm data
*
* @param {Function} callback(songURL, rhytmhURL, rhytmData) called when all done
* @param {Function} callback(songURL, rhytmhURL, rhytmData) called when all done
*
* @param {boolean} prelisten Load low quality audio version
*
Expand Down
2 changes: 1 addition & 1 deletion src/project.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/project", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
'use strict';
Expand Down
4 changes: 2 additions & 2 deletions src/quickplay.js
Expand Up @@ -6,14 +6,14 @@
* This is not part of the API bundle, but must be loaded separately using require.js.
*/

/*global define*/
/*global define, console, jQuery, document, setTimeout */
define("krusovice/quickplay", ["krusovice/thirdparty/jquery-bundle", "krusovice/api"], function($, krusovice) {
"use strict";


function setupFadeOut(show, audio, fadeOutThreshold) {

fadeOutThreshold = fadeOutThreshold || 3.0;
fadeOutThreshold = fadeOutThreshold || 3.0;
var duration = show.getDuration();
var nearEnd = duration - fadeOutThreshold;

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/three.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/renderers/three", ["krusovice/thirdparty/jquery-bundle", "krusovice/core", "krusovice/thirdparty/three-bundle"], function($, krusovice, THREE) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rhythmanalysis.js
Expand Up @@ -6,7 +6,7 @@
*
*/

/*global define,window,console*/
/*global define, window, console, jQuery, document, setTimeout */

define("krusovice/rhythmanalysis", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion src/show.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout, setInterval, clearInterval */
define("krusovice/show", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
"use strict";

Expand Down
8 changes: 4 additions & 4 deletions src/showobjects.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */

define("krusovice/showobjects", ["krusovice/thirdparty/jquery-bundle", "krusovice/core"], function($, krusovice) {
'use strict';
Expand Down Expand Up @@ -34,12 +34,12 @@ krusovice.showobjects.Base = function(cfg) {
krusovice.showobjects.Base.prototype = {

/**
* @cfg {krusovice.Show} Rendering backend used to create artsy
* @cfg {krusovice.Show} Rendering backend used to create artsy
*/
renderer : null,

/**
* @cfg {krusovice.TimelineElement} data TimelineElement of play parameters
* @cfg {krusovice.TimelineElement} data TimelineElement of play parameters
*/
data : null,

Expand All @@ -55,7 +55,7 @@ krusovice.showobjects.Base.prototype = {
effectObject : null,

/**
* @cfg {Function} Function which is called when async prepare() is ready.
* @cfg {Function} Function which is called when async prepare() is ready.
*
* prepareCallback(success, msg). If success is false delegate the error message.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/showobjects/framedimage.js
Expand Up @@ -5,7 +5,7 @@ define("krusovice/showobjects/framedimage", ["krusovice/thirdparty/jquery-bundle

"use strict";

/*global krusovice,window,$,console,THREE*/
/*global krusovice, window, console, THREE, jQuery, document, setTimeout, Image */

/**
*
Expand Down Expand Up @@ -36,9 +36,9 @@ $.extend(krusovice.showobjects.FramedAndLabeledPhoto.prototype, {
*
* Draw borders around the image.
*
* @param {Number} width Canvas width for which we prepare (downscale)
* @param {Number} width Canvas width for which we prepare (downscale)
*
* @param {Number} height Canvas width for which we prepare (downscale)
* @param {Number} height Canvas width for which we prepare (downscale)
*/
prepare : function(loader, width, height) {

Expand Down Expand Up @@ -248,7 +248,7 @@ $.extend(krusovice.showobjects.FramedAndLabeledPhoto.prototype, {
var mat = new THREE.ShaderMaterial({
uniforms: uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader,
fragmentShader: shader.fragmentShader
//blending: THREE.NormalBlending,
//transparent : true,
//opacity : 0.5
Expand Down
2 changes: 1 addition & 1 deletion src/showobjects/text.js
Expand Up @@ -4,7 +4,7 @@
*
*/

/*global window,$,console,define*/
/*global window, console, define, jQuery, document, setTimeout, Image */

define("krusovice/showobjects/text", ["krusovice/thirdparty/jquery-bundle",
"krusovice/core",
Expand Down
2 changes: 1 addition & 1 deletion src/showobjects/textdefinitions.js
@@ -1,4 +1,4 @@
/*global define*/
/*global define, console, jQuery, document, setTimeout */


/**
Expand Down

0 comments on commit 87e81fe

Please sign in to comment.