Satisfy JSHint and prevent crashing.

d6
Frode Petterson 2015-02-20 10:26:33 +01:00
parent 688b00f55e
commit 971a55df58
3 changed files with 22 additions and 23 deletions

View File

@ -45,9 +45,8 @@ H5P.XAPIEvent.prototype.setVerb = function(verb) {
};
}
else {
console.log('illegal verb');
H5P.error('illegal verb');
}
// Else: Fail silently...
};
/**
@ -68,7 +67,7 @@ H5P.XAPIEvent.prototype.getVerb = function(full) {
else {
return null;
}
}
};
/**
* Helperfunction to set the object part of the statement.

View File

@ -55,7 +55,7 @@ H5P.EventDispatcher.prototype.triggerXAPICompleted = function(score, maxScore) {
var event = this.createXAPIEventTemplate('completed');
event.setScoredResult(score, maxScore);
this.trigger(event);
}
};
/**
* Internal H5P function listening for xAPI completed events and stores scores

View File

@ -548,7 +548,7 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize) {
* @returns {undefined}
*/
H5P.error = function (err) {
if (window['console'] !== undefined && console.error !== undefined) {
if (window.console !== undefined && console.error !== undefined) {
console.error(err);
}
};
@ -1244,7 +1244,7 @@ H5P.trigger = function(instance, eventType) {
}
// Try deprecated event system
else if (instance.$ !== undefined && instance.$.trigger !== undefined) {
instance.$.trigger(eventType)
instance.$.trigger(eventType);
}
};
@ -1268,6 +1268,6 @@ H5P.on = function(instance, eventType, handler) {
}
// Try deprecated event system
else if (instance.$ !== undefined && instance.$.on !== undefined) {
instance.$.on(eventType, handler)
instance.$.on(eventType, handler);
}
};