Commit b0216477 authored by Christoph Thelen's avatar Christoph Thelen

Fixed the first JSHint errors

parent cca12deb
......@@ -30,7 +30,7 @@
</target>
<target name="sencha:app:watch">
<exec executable="sencha" dir="${main.dir}">
<exec executable="sencha" dir="${main.dir}" failonerror="true">
<arg value="app"/>
<arg value="watch"/>
</exec>
......
......@@ -154,6 +154,7 @@
"resources/icons",
"resources/startup",
"favicon.png",
"lib/socket.io/socket.io.min.js",
"WEB-INF"
],
......
(function() {
"use strict";
// by http://www.quirksmode.org/js/detect.html
Ext.define('ARSnova.BrowserDetect', {
constructor: function () {
var userAgentVersion, appVersion;
userAgentVersion = this.searchVersion(navigator.userAgent);
appVersion = this.searchVersion(navigator.appVersion);
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.version = userAgentVersion || appVersion || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
if ( this.extractAndroidVersion() != null) {
if (this.extractAndroidVersion() !== null) {
this.browser = 'Android';
this.version = this.searchVersion(
this.extractAndroidVersion().match(/[1-9]+[0-9]*\.[0-9]+/)
this.extractAndroidVersion().match(/[1-9]+[0-9]*\.[0-9]+/)
);
}
},
......@@ -19,7 +22,9 @@ Ext.define('ARSnova.BrowserDetect', {
extractAndroidVersion: function() {
// Should match 'Android x.y'
var version = navigator.userAgent.match(/Android [1-9]+[0-9]*\.[0-9]+/);
if (version == null) return null;
if (version === null) {
return null;
}
return version.toString();
},
......@@ -29,17 +34,18 @@ Ext.define('ARSnova.BrowserDetect', {
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
if (dataString.indexOf(data[i].subString) !== -1) {
return data[i].identity;
}
else if (dataProp)
}
} else if (dataProp) {
return data[i].identity;
}
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) {
if (index === -1) {
// iOS WebView Fallback
return parseFloat(dataString);
}
......@@ -125,4 +131,5 @@ Ext.define('ARSnova.BrowserDetect', {
subString: "Linux",
identity: "Linux"
}]
});
\ No newline at end of file
});
}());
\ No newline at end of file
(function() {
"use strict";
Ext.define('ARSnova.BrowserSupport', {
extend: 'Ext.Base',
......@@ -26,9 +28,11 @@ Ext.define('ARSnova.BrowserSupport', {
getRequiredBrowsers: function() {
var browsers = [];
for (var browser in this.getSupported()) {
// hasOwnProperty does not seem to work here
browsers.push(browser);
var supported = this.getSupported();
for (var browser in supported) {
if (supported.hasOwnProperty(browser)) {
browsers.push(browser);
}
}
return browsers;
},
......@@ -43,4 +47,5 @@ Ext.define('ARSnova.BrowserSupport', {
browserUnsupportedCallback.call(scope || this, this.getRequiredBrowsers());
}
}
});
\ No newline at end of file
});
}());
\ No newline at end of file
......@@ -84,7 +84,6 @@ Ext.application({
USER_ROLE_SPEAKER: "1",
isIconPrecomposed: true,
icon: 'resources/images/ARSnova_Grafiken/01_AppIcon_114x114px.png',
models: ['Answer', 'Feedback', 'LoggedIn', 'Question', 'Session', 'Statistic', 'Course', 'Auth', 'FeedbackQuestion'],
......
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