diff --git a/js/apps/system/aardvark/GruntFile.js b/js/apps/system/aardvark/GruntFile.js index 21dd99be0c..19292aee8a 100644 --- a/js/apps/system/aardvark/GruntFile.js +++ b/js/apps/system/aardvark/GruntFile.js @@ -33,8 +33,6 @@ "frontend/js/lib/jquery.uploadfile.js", "frontend/js/lib/select2.min.js", "frontend/js/lib/handlebars-1.0.rc.1.js", - "frontend/js/lib/underscore.js", - "frontend/js/lib/backbone.js", "frontend/js/lib/jsoneditor-min.js", "frontend/js/lib/d3.v3.min.js", "frontend/js/lib/nv.d3.js", @@ -50,17 +48,19 @@ "frontend/js/lib/md5.js", "frontend/src/ace.js" ], - js: [ + graphViewer: [ "frontend/js/graphViewer/graph/*", "frontend/js/graphViewer/ui/*", - "frontend/js/graphViewer/graphViewer.js", + "frontend/js/graphViewer/graphViewer.js" + ], + modules: [ + "frontend/js/arango/arango.js", "frontend/js/arango/templateEngine.js", "frontend/js/shell/browser.js", "frontend/js/config/dygraphConfig.js", "frontend/js/modules/underscore.js", "frontend/js/modules/org/arangodb/aql/functions.js", "frontend/js/modules/org/arangodb/graph/traversal.js", - "frontend/js/modules/org/arangodb/.js", "frontend/js/modules/org/arangodb/arango-collection-common.js", "frontend/js/modules/org/arangodb/arango-collection.js", "frontend/js/modules/org/arangodb/arango-database.js", @@ -85,8 +85,9 @@ "frontend/js/bootstrap/module-internal.js", "frontend/js/client/bootstrap/module-internal.js", "frontend/js/client/client.js", - "frontend/js/bootstrap/module-console.js", - "frontend/js/arango/arango.js", + "frontend/js/bootstrap/module-console.js" + ], + js: [ "frontend/js/models/*", "frontend/js/collections/*", "frontend/js/views/*", @@ -133,7 +134,8 @@ 'frontend/build/app.js': [ '<%=project.shared.lib %>', '<%=project.standalone.lib %>', - + '<%=project.standalone.graphViewer %>', + '<%=project.standalone.modules %>', '<%=project.standalone.js %>' ] }, @@ -147,6 +149,15 @@ } } }, + + jshint: { + options: { + laxbreak: true + }, + default: [ + '<%=project.standalone.js %>' + ] + }, uglify: { dist: { diff --git a/js/apps/system/aardvark/frontend/js/views/modalView.js b/js/apps/system/aardvark/frontend/js/views/modalView.js index b3ce9cf4b4..8006764e7c 100644 --- a/js/apps/system/aardvark/frontend/js/views/modalView.js +++ b/js/apps/system/aardvark/frontend/js/views/modalView.js @@ -102,7 +102,7 @@ createModalHotkeys: function() { //submit modal - $(this.el).bind('keydown', 'ctrl+return', function(){ + $(this.el).bind('keydown', 'return', function(){ $('.modal-footer .button-success').click(); }); $("input", $(this.el)).bind('keydown', 'return', function(){ diff --git a/js/apps/system/aardvark/manifest.json b/js/apps/system/aardvark/manifest.json index 6d4f4470ef..4fcd854ccf 100644 --- a/js/apps/system/aardvark/manifest.json +++ b/js/apps/system/aardvark/manifest.json @@ -105,7 +105,7 @@ "app.js": { "files": [ - "frontend/build/app.min.js" + "frontend/build/app.js" ] }, diff --git a/js/apps/system/aardvark/package.json b/js/apps/system/aardvark/package.json index d75eca7b38..ebe03efc3c 100644 --- a/js/apps/system/aardvark/package.json +++ b/js/apps/system/aardvark/package.json @@ -7,6 +7,7 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-concat-in-order": "^0.1.6", + "grunt-contrib-jshint": "^0.11.0", "grunt-contrib-sass": "^0.8.1", "grunt-contrib-uglify": "^0.7.0", "grunt-contrib-watch": "^0.6.1", diff --git a/js/apps/system/aardvark/test/karma/files.json b/js/apps/system/aardvark/test/karma/files.json index f0ea1a7448..ae51d0d337 100755 --- a/js/apps/system/aardvark/test/karma/files.json +++ b/js/apps/system/aardvark/test/karma/files.json @@ -85,9 +85,6 @@ "test/specs/views/shellViewSpec.js", "test/specs/views/userManagementViewSpec.js", - "test/specs/router/routerSpec.js", - "test/specs/router/clusterRouterSpec.js", - "test/specs/router/routerSpec.js", "test/specs/router/versionCheckSpec.js" diff --git a/js/apps/system/aardvark/test/specs/views/modalViewSpec.js b/js/apps/system/aardvark/test/specs/views/modalViewSpec.js index 0e4b51366a..d373224c1a 100644 --- a/js/apps/system/aardvark/test/specs/views/modalViewSpec.js +++ b/js/apps/system/aardvark/test/specs/views/modalViewSpec.js @@ -421,6 +421,7 @@ buttons = [], cbs = { callback: function () { + throw "Should by a spy"; } }, btn, @@ -429,17 +430,18 @@ e.which = 13; e.keyCode = 13; - spyOn(cbs, "callback").andCallThrough(); + spyOn(cbs, "callback"); btnObj = testee.createSuccessButton(title, cbs.callback); buttons.push(btnObj); testShow(buttons); btn = $(".button-" + btnObj.type, $(div)); - spyOn($.fn, "click"); + spyOn($.fn, "click").andCallThrough(); $(testee.el).trigger(e); expect($.fn.click).toHaveBeenCalled(); + expect(cbs.callback).toHaveBeenCalled(); }); it("should call function bind function for view.el input", function () { @@ -447,8 +449,10 @@ btnObj = {}, title = "Save", buttons = [], + textField = [], cbs = { callback: function () { + throw "Should be a spy"; } }, btn, @@ -458,19 +462,22 @@ testee.enabledHotkey = false; - spyOn(cbs, "callback").andCallThrough(); + spyOn(cbs, "callback"); btnObj = testee.createSuccessButton(title, cbs.callback); buttons.push(btnObj); + textField.push( + testee.createTextEntry("dontcare", "ABC", "asd") + ); - testShow(buttons); - $('.modal-body').html('ABC'); + testShow(buttons, textField); btn = $(".button-" + btnObj.type, $(div)); - spyOn($.fn, "click"); - $("input").trigger(e); + spyOn($.fn, "click").andCallThrough(); + $("#dontcare").trigger(e); expect($.fn.click).toHaveBeenCalled(); + expect(cbs.callback).toHaveBeenCalled(); }); it("should call function bind function for view.el select", function () { @@ -478,8 +485,10 @@ btnObj = {}, title = "Save", buttons = [], + select = [], cbs = { callback: function () { + throw "Should be a spy"; } }, btn, @@ -489,19 +498,25 @@ testee.enabledHotkey = false; - spyOn(cbs, "callback").andCallThrough(); + spyOn(cbs, "callback"); btnObj = testee.createSuccessButton(title, cbs.callback); buttons.push(btnObj); + + select.push( + testee.createSelectEntry("dontcare", "Choose", false, undefined, + testee.createOptionEntry("option1") + ) + ); - testShow(buttons); - $('.modal-body').html(''); + testShow(buttons, select); btn = $(".button-" + btnObj.type, $(div)); - spyOn($.fn, "click"); + spyOn($.fn, "click").andCallThrough(); $("select").trigger(e); expect($.fn.click).toHaveBeenCalled(); + expect(cbs.callback).toHaveBeenCalled(); }); /*it("test focused button navigation (direction right)", function() {