From 4b4292edb86d34067a2babb9f572a3641dd1d2a7 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 1 Sep 2011 16:16:01 +0200 Subject: style: fix some missing semi-colons and spaces, typos --- docs/src/gen-docs.js | 4 ++-- docs/src/writer.js | 4 ++-- src/service/route.js | 12 ++++++------ test/directivesSpec.js | 48 +++++++++++++++++++++++----------------------- test/markupSpec.js | 2 +- test/service/localeSpec.js | 3 +-- test/service/routeSpec.js | 30 +++++++++++++++-------------- 7 files changed, 52 insertions(+), 51 deletions(-) diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 93d0038e..e1778bb7 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -30,7 +30,7 @@ writer.makeDir('build/docs/syntaxhighlighter').then(function() { return Q.deep(fileFutures); }).then(function generateManifestFile() { return appCache('build/docs/').then(function(list) { - writer.output('appcache-offline.manifest',list) + writer.output('appcache-offline.manifest', list); }); }).then(function printStats() { console.log('DONE. Generated ' + docs.length + ' pages in ' + (now()-start) + 'ms.' ); @@ -46,7 +46,7 @@ function writeTheRest(writesFuture) { var manifest = 'manifest="appcache.manifest"', jq = '', ngMin = '', - ng = '' + ng = ''; writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html', writer.replace, {'doc:manifest': manifest, diff --git a/docs/src/writer.js b/docs/src/writer.js index 5aa8f566..85d797ea 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -8,14 +8,14 @@ var Q = require('qq'); var OUTPUT_DIR = "build/docs/"; var fs = require('fs'); -exports.output = function(file, content){ +exports.output = function(file, content) { console.log('writing ', file); var fullPath = OUTPUT_DIR + file; var dir = parent(fullPath); return Q.when(exports.makeDir(dir), function(error) { qfs.write(fullPath,exports.toString(content)); }); -} +}; //recursively create directory exports.makeDir = function (path) { diff --git a/src/service/route.js b/src/service/route.js index 05cb62f8..c12ce99d 100644 --- a/src/service/route.js +++ b/src/service/route.js @@ -188,10 +188,10 @@ angularServiceInject('$route', function($location, $routeParams) { * @description * Adds a new route definition to the `$route` service. */ - when:function (path, route) { + when: function (path, route) { var routeDef = routes[path]; if (!routeDef) routeDef = routes[path] = {reloadOnSearch: true}; - if (route) extend(routeDef, route); //TODO(im): what the heck? merge two route definitions? + if (route) extend(routeDef, route); // TODO(im): what the heck? merge two route definitions? dirty++; return routeDef; }, @@ -238,7 +238,7 @@ angularServiceInject('$route', function($location, $routeParams) { var regex = '^' + when.replace(/[\.\\\(\)\^\$]/g, "\$1") + '$', params = [], dst = {}; - forEach(when.split(/\W/), function(param){ + forEach(when.split(/\W/), function(param) { if (param) { var paramRegExp = new RegExp(":" + param + "([\\W])"); if (regex.match(paramRegExp)) { @@ -249,14 +249,14 @@ angularServiceInject('$route', function($location, $routeParams) { }); var match = on.match(new RegExp(regex)); if (match) { - forEach(params, function(name, index){ + forEach(params, function(name, index) { dst[name] = match[index + 1]; }); } return match ? dst : null; } - function updateRoute(){ + function updateRoute() { var next = parseRoute(), last = $route.current; @@ -292,7 +292,7 @@ angularServiceInject('$route', function($location, $routeParams) { /** * @returns the current active route, by matching it against the URL */ - function parseRoute(){ + function parseRoute() { // Match a route var params, match; forEach(routes, function(route, path) { diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 314f9a88..2979cf75 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe("directive", function(){ +describe("directive", function() { var compile, model, element; @@ -20,7 +20,7 @@ describe("directive", function(){ expect(scope.a).toEqual(123); }); - describe('ng:bind', function(){ + describe('ng:bind', function() { it('should set text', function() { var scope = compile('
'); expect(element.text()).toEqual(''); @@ -74,7 +74,7 @@ describe("directive", function(){ }); - it('should suppress rendering of falsy values', function(){ + it('should suppress rendering of falsy values', function() { var scope = compile('
{{ null }}{{ undefined }}{{ "" }}-{{ 0 }}{{ false }}
'); scope.$digest(); expect(scope.$element.text()).toEqual('-0false'); @@ -82,7 +82,7 @@ describe("directive", function(){ }); - describe('ng:bind-template', function(){ + describe('ng:bind-template', function() { it('should ng:bind-template', function() { var scope = compile('
'); scope.name = 'Misko'; @@ -91,9 +91,9 @@ describe("directive", function(){ expect(element.text()).toEqual('Hello Misko!'); }); - it('should have $element set to current bind element', function(){ + it('should have $element set to current bind element', function() { var innerText; - angularFilter.myFilter = function(text){ + angularFilter.myFilter = function(text) { innerText = innerText || this.$element.text(); return text; }; @@ -105,22 +105,22 @@ describe("directive", function(){ }); - describe('ng:bind-attr', function(){ - it('should bind attributes', function(){ + describe('ng:bind-attr', function() { + it('should bind attributes', function() { var scope = compile('
'); scope.$digest(); expect(element.attr('src')).toEqual('http://localhost/mysrc'); expect(element.attr('alt')).toEqual('myalt'); }); - it('should not pretty print JSON in attributes', function(){ + it('should not pretty print JSON in attributes', function() { var scope = compile('{{ {a:1} }}'); scope.$digest(); expect(element.attr('alt')).toEqual('{"a":1}'); }); }); - it('should remove special attributes on false', function(){ + it('should remove special attributes on false', function() { var scope = compile(''); var input = scope.$element[0]; expect(input.disabled).toEqual(false); @@ -138,7 +138,7 @@ describe("directive", function(){ }); describe('ng:click', function(){ - it('should get called on a click', function(){ + it('should get called on a click', function() { var scope = compile('
'); scope.$digest(); expect(scope.clicked).toBeFalsy(); @@ -296,7 +296,7 @@ describe("directive", function(){ }); - it('should ng:class odd/even', function(){ + it('should ng:class odd/even', function() { var scope = compile('