1
0
Fork 0

Fixed jslint warnings, removed sloppy:true

This commit is contained in:
Michael Hackstein 2013-11-12 15:44:44 +01:00
parent 61ab284433
commit 20578ae5f5
2 changed files with 1027 additions and 1007 deletions

View File

@ -1,7 +1,9 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */ /*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global window, $ */ /*global window, $ */
window.arangoHelper = { (function() {
"use strict";
window.arangoHelper = {
lastNotificationMessage: null, lastNotificationMessage: null,
CollectionTypes: {}, CollectionTypes: {},
@ -46,7 +48,7 @@ window.arangoHelper = {
}, },
databaseAllowed: function () { databaseAllowed: function () {
var currentDB = this.currentDatabase(); var currentDB = this.currentDatabase(),
returnVal = false; returnVal = false;
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -94,7 +96,7 @@ window.arangoHelper = {
// prevent display the same message over & over // prevent display the same message over & over
return false; return false;
} }
if($('.gritter-item-wrapper').length == 3) { if($('.gritter-item-wrapper').length === 3) {
// not more than 3 messages at once // not more than 3 messages at once
return false; return false;
} }
@ -249,4 +251,5 @@ window.arangoHelper = {
return typeof v; return typeof v;
} }
}; };
}());

View File

@ -1,7 +1,9 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */ /*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global require, exports, Backbone, EJS, $, window, arangoHelper */ /*global require, exports, Backbone, EJS, $, window, arangoHelper, templateEngine */
var documentsView = Backbone.View.extend({ (function() {
"use strict";
var documentsView = Backbone.View.extend({
collectionID: 0, collectionID: 0,
currentPage: 1, currentPage: 1,
documentsPerPage: 10, documentsPerPage: 10,
@ -23,6 +25,9 @@ var documentsView = Backbone.View.extend({
el: '#content', el: '#content',
table: '#documentsTableID', table: '#documentsTableID',
template: templateEngine.createTemplate("documentsView.ejs"),
events: { events: {
"click #collectionPrev" : "prevCollection", "click #collectionPrev" : "prevCollection",
"click #collectionNext" : "nextCollection", "click #collectionNext" : "nextCollection",
@ -189,7 +194,14 @@ var documentsView = Backbone.View.extend({
prevCollection : function () { prevCollection : function () {
if (this.collectionContext.prev !== null) { if (this.collectionContext.prev !== null) {
$('#collectionPrev').parent().removeClass('disabledPag'); $('#collectionPrev').parent().removeClass('disabledPag');
window.App.navigate(this.buildCollectionLink(this.collectionContext.prev), { trigger: true }); window.App.navigate(
this.buildCollectionLink(
this.collectionContext.prev
),
{
trigger: true
}
);
} }
else { else {
$('#collectionPrev').parent().addClass('disabledPag'); $('#collectionPrev').parent().addClass('disabledPag');
@ -199,7 +211,14 @@ var documentsView = Backbone.View.extend({
nextCollection : function () { nextCollection : function () {
if (this.collectionContext.next !== null) { if (this.collectionContext.next !== null) {
$('#collectionNext').parent().removeClass('disabledPag'); $('#collectionNext').parent().removeClass('disabledPag');
window.App.navigate(this.buildCollectionLink(this.collectionContext.next), { trigger: true }); window.App.navigate(
this.buildCollectionLink(
this.collectionContext.next
),
{
trigger: true
}
);
} }
else { else {
$('#collectionNext').parent().addClass('disabledPag'); $('#collectionNext').parent().addClass('disabledPag');
@ -275,7 +294,6 @@ var documentsView = Backbone.View.extend({
}, },
addFilterItem : function () { addFilterItem : function () {
"use strict";
// adds a line to the filter widget // adds a line to the filter widget
var num = ++this.filterId; var num = ++this.filterId;
@ -306,7 +324,6 @@ var documentsView = Backbone.View.extend({
}, },
removeFilterItem : function (e) { removeFilterItem : function (e) {
"use strict";
// removes line from the filter widget // removes line from the filter widget
var button = e.currentTarget; var button = e.currentTarget;
@ -560,7 +577,6 @@ var documentsView = Backbone.View.extend({
} }
}, },
template: templateEngine.createTemplate("documentsView.ejs"),
render: function() { render: function() {
this.collectionContext = window.arangoCollectionsStore.getPosition(this.colid); this.collectionContext = window.arangoCollectionsStore.getPosition(this.colid);
@ -830,4 +846,5 @@ var documentsView = Backbone.View.extend({
arangoHelper.fixTooltips("deleteIndex", "left"); arangoHelper.fixTooltips("deleteIndex", "left");
} }
} }
}); });
}());