aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/content/api/angular.inputType.ngdoc10
-rw-r--r--docs/content/cookbook/advancedform.ngdoc10
-rw-r--r--docs/content/cookbook/deeplinking.ngdoc8
-rw-r--r--docs/content/cookbook/form.ngdoc12
-rw-r--r--docs/content/cookbook/helloworld.ngdoc4
-rw-r--r--docs/content/cookbook/mvc.ngdoc8
-rw-r--r--docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc2
-rw-r--r--docs/content/guide/dev_guide.expressions.ngdoc10
-rw-r--r--docs/content/guide/dev_guide.forms.ngdoc40
-rw-r--r--docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc6
-rw-r--r--docs/content/guide/dev_guide.overview.ngdoc4
-rw-r--r--docs/content/guide/dev_guide.services.creating_services.ngdoc2
-rw-r--r--docs/content/guide/dev_guide.services.injecting_controllers.ngdoc2
-rw-r--r--docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc4
-rw-r--r--docs/content/guide/dev_guide.unit-testing.ngdoc28
-rw-r--r--docs/content/tutorial/step_02.ngdoc4
-rw-r--r--docs/content/tutorial/step_04.ngdoc2
-rw-r--r--docs/content/tutorial/step_11.ngdoc2
-rw-r--r--docs/spec/domSpec.js12
-rw-r--r--docs/spec/ngdocSpec.js92
-rw-r--r--docs/spec/sitemapSpec.js6
-rw-r--r--docs/spec/specs.js2
-rw-r--r--docs/spec/writerSpec.js10
-rw-r--r--docs/src/SiteMap.js2
-rw-r--r--docs/src/dom.js6
-rwxr-xr-xdocs/src/gen-docs.js6
-rw-r--r--docs/src/ngdoc.js78
-rw-r--r--docs/src/templates/doc_widgets.js2
-rw-r--r--docs/src/templates/docs.js2
-rw-r--r--docs/src/templates/syntaxhighlighter/shCore.js2
-rw-r--r--docs/src/writer.js8
-rw-r--r--example/buzz/buzz.js6
-rw-r--r--example/personalLog/scenario/personalLogScenario.js2
-rw-r--r--example/tweeter/tweeterclient.js6
-rwxr-xr-xgdocs.js16
-rw-r--r--i18n/locale/angular-locale_am-et.js2
-rw-r--r--perf/MiscPerf.js12
-rw-r--r--src/Angular.js26
-rw-r--r--src/Browser.js6
-rw-r--r--src/Injector.js2
-rw-r--r--src/Resource.js2
-rw-r--r--src/Scope.js4
-rw-r--r--src/angular-mocks.js16
-rw-r--r--src/angular.suffix2
-rw-r--r--src/apis.js16
-rw-r--r--src/directives.js42
-rw-r--r--src/filters.js26
-rw-r--r--src/jqLite.js2
-rw-r--r--src/parser.js48
-rw-r--r--src/sanitizer.js2
-rw-r--r--src/scenario/Scenario.js2
-rw-r--r--src/scenario/angular-bootstrap.js4
-rw-r--r--src/service/cookies.js2
-rw-r--r--src/service/formFactory.js24
-rw-r--r--src/service/log.js2
-rw-r--r--src/service/resource.js4
-rw-r--r--src/service/route.js2
-rw-r--r--src/service/routeParams.js2
-rw-r--r--src/service/xhr.bulk.js2
-rw-r--r--src/service/xhr.js2
-rw-r--r--src/widget/form.js6
-rw-r--r--src/widget/input.js24
-rw-r--r--src/widget/select.js36
-rw-r--r--src/widgets.js44
-rw-r--r--test/AngularSpec.js48
-rw-r--r--test/ApiSpecs.js2
-rw-r--r--test/BinderSpec.js98
-rw-r--r--test/BrowserSpecs.js30
-rw-r--r--test/CompilerSpec.js32
-rw-r--r--test/FiltersSpec.js4
-rw-r--r--test/InjectorSpec.js76
-rw-r--r--test/JsonSpec.js56
-rw-r--r--test/ParserSpec.js6
-rw-r--r--test/ResourceSpec.js42
-rw-r--r--test/ScenarioSpec.js14
-rw-r--r--test/ScopeSpec.js8
-rw-r--r--test/angular-mocksSpec.js14
-rw-r--r--test/directivesSpec.js18
-rw-r--r--test/jQueryPatchSpec.js20
-rw-r--r--test/jqLiteSpec.js116
-rw-r--r--test/jstd-scenario-adapter/AdapterSpecs.js2
-rw-r--r--test/manual.html4
-rw-r--r--test/markupSpec.js44
-rw-r--r--test/mocks.js8
-rw-r--r--test/sanitizerSpec.js92
-rw-r--r--test/scenario/DescribeSpec.js4
-rw-r--r--test/scenario/dslSpec.js2
-rw-r--r--test/scenario/e2e/widgets-scenario.js2
-rw-r--r--test/service/cookieStoreSpec.js2
-rw-r--r--test/service/cookiesSpec.js6
-rw-r--r--test/service/deferSpec.js6
-rw-r--r--test/service/documentSpec.js6
-rw-r--r--test/service/exceptionHandlerSpec.js6
-rw-r--r--test/service/formFactorySpec.js43
-rw-r--r--test/service/locationSpec.js4
-rw-r--r--test/service/logSpec.js32
-rw-r--r--test/service/routeParamsSpec.js6
-rw-r--r--test/service/windowSpec.js6
-rw-r--r--test/service/xhr.bulkSpec.js12
-rw-r--r--test/service/xhr.cacheSpec.js12
-rw-r--r--test/service/xhr.errorSpec.js6
-rw-r--r--test/service/xhrSpec.js22
-rw-r--r--test/testabilityPatch.js12
-rw-r--r--test/widget/formSpec.js20
-rw-r--r--test/widget/inputSpec.js84
-rw-r--r--test/widget/selectSpec.js70
-rw-r--r--test/widgetsSpec.js6
107 files changed, 942 insertions, 941 deletions
diff --git a/docs/content/api/angular.inputType.ngdoc b/docs/content/api/angular.inputType.ngdoc
index 434fe6c2..12c59989 100644
--- a/docs/content/api/angular.inputType.ngdoc
+++ b/docs/content/api/angular.inputType.ngdoc
@@ -40,8 +40,8 @@ All `inputType` widgets support:
<doc:example>
<doc:source>
<script>
- angular.inputType('json', function(){
- this.$parseView = function(){
+ angular.inputType('json', function() {
+ this.$parseView = function() {
try {
this.$modelValue = angular.fromJson(this.$viewValue);
if (this.$error.JSON) {
@@ -52,12 +52,12 @@ All `inputType` widgets support:
}
}
- this.$parseModel = function(){
+ this.$parseModel = function() {
this.$viewValue = angular.toJson(this.$modelValue);
}
});
- function Ctrl(){
+ function Ctrl() {
this.data = {
framework:'angular',
codenames:'supper-powers'
@@ -81,7 +81,7 @@ All `inputType` widgets support:
</div>
</doc:source>
<doc:scenario>
- it('should invalidate on wrong input', function(){
+ it('should invalidate on wrong input', function() {
expect(element('form[name=myForm]').prop('className')).toMatch('ng-valid');
input('data').enter('{}');
expect(binding('data')).toEqual('data={\n }');
diff --git a/docs/content/cookbook/advancedform.ngdoc b/docs/content/cookbook/advancedform.ngdoc
index d38008f2..8e29ed35 100644
--- a/docs/content/cookbook/advancedform.ngdoc
+++ b/docs/content/cookbook/advancedform.ngdoc
@@ -9,7 +9,7 @@ detection, and preventing invalid form submission.
<doc:example>
<doc:source>
<script>
- function UserForm(){
+ function UserForm() {
this.state = /^\w\w$/;
this.zip = /^\d\d\d\d\d$/;
this.master = {
@@ -28,11 +28,11 @@ detection, and preventing invalid form submission.
}
UserForm.prototype = {
- cancel: function(){
+ cancel: function() {
this.form = angular.copy(this.master);
},
- save: function(){
+ save: function() {
this.master = this.form;
this.cancel();
}
@@ -76,7 +76,7 @@ detection, and preventing invalid form submission.
</div>
</doc:source>
<doc:scenario>
- it('should enable save button', function(){
+ it('should enable save button', function() {
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
input('form.name').enter('');
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
@@ -85,7 +85,7 @@ detection, and preventing invalid form submission.
element(':button:contains(Save)').click();
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
});
- it('should enable cancel button', function(){
+ it('should enable cancel button', function() {
expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy();
input('form.name').enter('change');
expect(element(':button:contains(Cancel)').attr('disabled')).toBeFalsy();
diff --git a/docs/content/cookbook/deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc
index 6747b55f..9e00f362 100644
--- a/docs/content/cookbook/deeplinking.ngdoc
+++ b/docs/content/cookbook/deeplinking.ngdoc
@@ -56,7 +56,7 @@ The two partials are defined in the following URLs:
function WelcomeCntl($route){}
WelcomeCntl.prototype = {
- greet: function(){
+ greet: function() {
alert("Hello " + this.person.name);
}
};
@@ -67,11 +67,11 @@ The two partials are defined in the following URLs:
this.cancel();
}
SettingsCntl.prototype = {
- cancel: function(){
+ cancel: function() {
this.form = angular.copy(this.person);
},
- save: function(){
+ save: function() {
angular.copy(this.form, this.person);
this.$location.path('/welcome');
}
@@ -89,7 +89,7 @@ The two partials are defined in the following URLs:
</div>
</doc:source>
<doc:scenario>
- it('should navigate to URL', function(){
+ it('should navigate to URL', function() {
element('a:contains(Welcome)').click();
expect(element('ng\\:view').text()).toMatch(/Hello anonymous/);
element('a:contains(Settings)').click();
diff --git a/docs/content/cookbook/form.ngdoc b/docs/content/cookbook/form.ngdoc
index c74b203b..874db792 100644
--- a/docs/content/cookbook/form.ngdoc
+++ b/docs/content/cookbook/form.ngdoc
@@ -11,7 +11,7 @@ allow a user to enter data.
<doc:example>
<doc:source>
<script>
- function FormController(){
+ function FormController() {
this.user = {
name: 'John Smith',
address:{line1: '123 Main St.', city:'Anytown', state:'AA', zip:'12345'},
@@ -53,22 +53,22 @@ allow a user to enter data.
</doc:source>
<doc:scenario>
- it('should show debug', function(){
+ it('should show debug', function() {
expect(binding('user')).toMatch(/John Smith/);
});
- it('should add contact', function(){
+ it('should add contact', function() {
using('.example').element('a:contains(add)').click();
using('.example div:last').input('contact.value').enter('you@example.org');
expect(binding('user')).toMatch(/\(234\) 555\-1212/);
expect(binding('user')).toMatch(/you@example.org/);
});
- it('should remove contact', function(){
+ it('should remove contact', function() {
using('.example').element('a:contains(X)').click();
expect(binding('user')).not().toMatch(/\(234\) 555\-1212/);
});
- it('should validate zip', function(){
+ it('should validate zip', function() {
expect(using('.example').
element(':input[ng\\:model="user.address.zip"]').
prop('className')).not().toMatch(/ng-invalid/);
@@ -78,7 +78,7 @@ allow a user to enter data.
prop('className')).toMatch(/ng-invalid/);
});
- it('should validate state', function(){
+ it('should validate state', function() {
expect(using('.example').element(':input[ng\\:model="user.address.state"]').prop('className'))
.not().toMatch(/ng-invalid/);
using('.example').input('user.address.state').enter('XXX');
diff --git a/docs/content/cookbook/helloworld.ngdoc b/docs/content/cookbook/helloworld.ngdoc
index 9562aaff..67d78bbe 100644
--- a/docs/content/cookbook/helloworld.ngdoc
+++ b/docs/content/cookbook/helloworld.ngdoc
@@ -6,7 +6,7 @@
<doc:example>
<doc:source>
<script>
- function HelloCntl(){
+ function HelloCntl() {
this.name = 'World';
}
</script>
@@ -17,7 +17,7 @@
</div>
</doc:source>
<doc:scenario>
- it('should change the binding when user enters text', function(){
+ it('should change the binding when user enters text', function() {
expect(binding('name')).toEqual('World');
input('name').enter('angular');
expect(binding('name')).toEqual('angular');
diff --git a/docs/content/cookbook/mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc
index 4529cd29..a9ab7f3c 100644
--- a/docs/content/cookbook/mvc.ngdoc
+++ b/docs/content/cookbook/mvc.ngdoc
@@ -36,7 +36,7 @@ no connection between the controller and the view.
this.setUrl();
}
},
- reset: function(){
+ reset: function() {
this.board = [
['', '', ''],
['', '', ''],
@@ -46,7 +46,7 @@ no connection between the controller and the view.
this.winner = '';
this.setUrl();
},
- grade: function(){
+ grade: function() {
var b = this.board;
this.winner =
row(0) || row(1) || row(2) ||
@@ -57,7 +57,7 @@ no connection between the controller and the view.
function diagonal(i) { return same(b[0][1-i], b[1][1], b[2][1+i]);}
function same(a, b, c) { return (a==b && b==c) ? a : '';};
},
- setUrl: function(){
+ setUrl: function() {
var rows = [];
angular.forEach(this.board, function(row){
rows.push(row.join(','));
@@ -91,7 +91,7 @@ no connection between the controller and the view.
</div>
</doc:source>
<doc:scenario>
- it('should play a game', function(){
+ it('should play a game', function() {
piece(1, 1);
expect(binding('nextMove')).toEqual('O');
piece(3, 1);
diff --git a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
index 674f98aa..b73304c0 100644
--- a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
+++ b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
@@ -61,7 +61,7 @@ angular.widget('@my:watch', function(expression, compileElement) {
angular.widget('my:time', function(compileElement){
compileElement.css('display', 'block');
return function(linkElement){
- function update(){
+ function update() {
linkElement.text('Current time is: ' + new Date());
setTimeout(update, 1000);
}
diff --git a/docs/content/guide/dev_guide.expressions.ngdoc b/docs/content/guide/dev_guide.expressions.ngdoc
index ab5a897b..57fb9130 100644
--- a/docs/content/guide/dev_guide.expressions.ngdoc
+++ b/docs/content/guide/dev_guide.expressions.ngdoc
@@ -41,7 +41,7 @@ the `Scope:$eval()` method.
1+2={{1+2}}
</doc:source>
<doc:scenario>
- it('should calculate expression in binding', function(){
+ it('should calculate expression in binding', function() {
expect(binding('1+2')).toEqual('3');
});
</doc:scenario>
@@ -52,7 +52,7 @@ You can try evaluating different expressions here:
<doc:example>
<doc:source>
<script>
- function Cntl2(){
+ function Cntl2() {
this.exprs = [];
this.expr = '3*10|currency';
}
@@ -70,7 +70,7 @@ You can try evaluating different expressions here:
</div>
</doc:source>
<doc:scenario>
- it('should allow user expression testing', function(){
+ it('should allow user expression testing', function() {
element('.expressions :button').click();
var li = using('.expressions ul').repeater('li');
expect(li.count()).toBe(1);
@@ -105,7 +105,7 @@ the global state (a common source of subtle bugs).
</div>
</doc:source>
<doc:scenario>
- it('should calculate expression in binding', function(){
+ it('should calculate expression in binding', function() {
var alertText;
this.addFutureAction('set mock', function($window, $document, done) {
$window.mockWindow = {
@@ -183,7 +183,7 @@ Extensions: You can further extend the expression vocabulary by adding new metho
</table>
</doc:source>
<doc:scenario>
- it('should filter the list', function(){
+ it('should filter the list', function() {
var tr = using('table.example3').repeater('tr.ng-attr-widget');
expect(tr.count()).toBe(5);
input('searchText').enter('a');
diff --git a/docs/content/guide/dev_guide.forms.ngdoc b/docs/content/guide/dev_guide.forms.ngdoc
index 6849ff4e..bf0545a4 100644
--- a/docs/content/guide/dev_guide.forms.ngdoc
+++ b/docs/content/guide/dev_guide.forms.ngdoc
@@ -111,7 +111,7 @@ The following example demonstrates:
.ng-form {display: block;}
</style>
<script>
- function UserFormCntl(){
+ function UserFormCntl() {
this.state = /^\w\w$/;
this.zip = /^\d\d\d\d\d$/;
this.master = {
@@ -127,11 +127,11 @@ The following example demonstrates:
}
UserFormCntl.prototype = {
- cancel: function(){
+ cancel: function() {
this.form = angular.copy(this.master);
},
- save: function(){
+ save: function() {
this.master = this.form;
this.cancel();
}
@@ -187,7 +187,7 @@ The following example demonstrates:
</div>
</doc:source>
<doc:scenario>
- it('should enable save button', function(){
+ it('should enable save button', function() {
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
input('form.customer').enter('');
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
@@ -196,7 +196,7 @@ The following example demonstrates:
element(':button:contains(Save)').click();
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
});
- it('should enable cancel button', function(){
+ it('should enable cancel button', function() {
expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy();
input('form.customer').enter('change');
expect(element(':button:contains(Cancel)').attr('disabled')).toBeFalsy();
@@ -274,7 +274,7 @@ This example shows how to implement a custom HTML editor widget in Angular.
<doc:example>
<doc:source>
<script>
- function EditorCntl(){
+ function EditorCntl() {
this.htmlContent = '<b>Hello</b> <i>World</i>!';
}
@@ -282,7 +282,7 @@ This example shows how to implement a custom HTML editor widget in Angular.
var self = this;
var htmlFilter = angular.filter('html');
- this.$parseModel = function(){
+ this.$parseModel = function() {
// need to protect for script injection
try {
this.$viewValue = htmlFilter(
@@ -297,18 +297,18 @@ This example shows how to implement a custom HTML editor widget in Angular.
}
}
- this.$render = function(){
+ this.$render = function() {
element.html(this.$viewValue);
}
- element.bind('keyup', function(){
- self.$apply(function(){
+ element.bind('keyup', function() {
+ self.$apply(function() {
self.$emit('$viewChange', element.html());
});
});
}
- angular.directive('ng:html-editor-model', function(){
+ angular.directive('ng:html-editor-model', function() {
function linkFn($formFactory, element) {
var exp = element.attr('ng:html-editor-model'),
form = $formFactory.forElement(element),
@@ -321,7 +321,7 @@ This example shows how to implement a custom HTML editor widget in Angular.
controllerArgs: [element]});
// if the element is destroyed, then we need to
// notify the form.
- element.bind('$destroy', function(){
+ element.bind('$destroy', function() {
widget.$destroy();
});
}
@@ -339,7 +339,7 @@ This example shows how to implement a custom HTML editor widget in Angular.
</form>
</doc:source>
<doc:scenario>
- it('should enter invalid HTML', function(){
+ it('should enter invalid HTML', function() {
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-valid/);
input('htmlContent').enter('<');
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-invalid/);
@@ -358,7 +358,7 @@ validation.
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.input1 = '';
this.input2 = '';
this.input3 = 'A';
@@ -447,32 +447,32 @@ validation.
</doc:source>
<doc:scenario>
- it('should exercise text', function(){
+ it('should exercise text', function() {
input('input1').enter('Carlos');
expect(binding('input1')).toEqual('"Carlos"');
});
- it('should exercise textarea', function(){
+ it('should exercise textarea', function() {
input('input2').enter('Carlos');
expect(binding('input2')).toEqual('"Carlos"');
});
- it('should exercise radio', function(){
+ it('should exercise radio', function() {
expect(binding('input3')).toEqual('"A"');
input('input3').select('B');
expect(binding('input3')).toEqual('"B"');
input('input3').select('A');
expect(binding('input3')).toEqual('"A"');
});
- it('should exercise checkbox', function(){
+ it('should exercise checkbox', function() {
expect(binding('input4')).toEqual('false');
input('input4').check();
expect(binding('input4')).toEqual('true');
});
- it('should exercise pulldown', function(){
+ it('should exercise pulldown', function() {
expect(binding('input5')).toEqual('"c"');
select('input5').option('d');
expect(binding('input5')).toEqual('"d"');
});
- it('should exercise multiselect', function(){
+ it('should exercise multiselect', function() {
expect(binding('input6')).toEqual('[]');
select('input6').options('e');
expect(binding('input6')).toEqual('["e"]');
diff --git a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
index 7a6653e9..f5522246 100644
--- a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
+++ b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
@@ -3,7 +3,7 @@
@name Developer Guide: About MVC in Angular: Understanding the Controller Component
@description
-In angular, a controller is a JavaScript function (type/class) that is used to augment instances of
+In angular, a controller is a JavaScript function(type/class) that is used to augment instances of
angular {@link dev_guide.scopes Scope}, excluding the root scope. When you or angular create a new
child scope object via the {@link api/angular.scope.$new scope.$new} API , there is an
option to pass in a controller as a method argument. This will tell angular to associate the
@@ -128,7 +128,7 @@ starts with capital letter and ends with "Ctrl" or "Controller".
controller augments.
- Assigning a property to `this` creates or updates the model.
- Controller methods can be created through direct assignment to scope (the `chiliSpicy` method) or
-as prototype methods of the controller constructor function (the `jalapenoSpicy` method)
+as prototype methods of the controller constructor function(the `jalapenoSpicy` method)
- Both controller methods are available in the template (for the `body` element and and its
children).
@@ -227,7 +227,7 @@ Controller Test:
<pre>
describe('myController function', function() {
- describe('myController', function(){
+ describe('myController', function() {
var ctrl;
beforeEach(function() {
diff --git a/docs/content/guide/dev_guide.overview.ngdoc b/docs/content/guide/dev_guide.overview.ngdoc
index fcf15044..2e555dd8 100644
--- a/docs/content/guide/dev_guide.overview.ngdoc
+++ b/docs/content/guide/dev_guide.overview.ngdoc
@@ -43,7 +43,7 @@ easier a web developer's life can if they're using angular:
<doc:example>
<doc:source>
<script>
- function InvoiceCntl(){
+ function InvoiceCntl() {
this.qty = 1;
this.cost = 19.95;
}
@@ -66,7 +66,7 @@ easier a web developer's life can if they're using angular:
</doc:source>
<!--
<doc:scenario>
- it('should show of angular binding', function(){
+ it('should show of angular binding', function() {
expect(binding('qty * cost')).toEqual('$19.95');
input('qty').enter('2');
input('cost').enter('5.00');
diff --git a/docs/content/guide/dev_guide.services.creating_services.ngdoc b/docs/content/guide/dev_guide.services.creating_services.ngdoc
index b75e75a3..bc59f34d 100644
--- a/docs/content/guide/dev_guide.services.creating_services.ngdoc
+++ b/docs/content/guide/dev_guide.services.creating_services.ngdoc
@@ -10,7 +10,7 @@ that angular's DI will use to create the service object when it is needed.
The `angular.service` method accepts three parameters:
- `{string} name` - Name of the service.
-- `{function()} factory` - Factory function (called just once by DI).
+- `{function()} factory` - Factory function(called just once by DI).
- `{Object} config` - Configuration object with the following properties:
- `$inject` - {Array.<string>} - Array of service ids this service depends on. These services
will be passed as arguments into the factory function in the same order specified in the `$inject`
diff --git a/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc b/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc
index 44206f7c..9bc1aed8 100644
--- a/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc
+++ b/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc
@@ -59,7 +59,7 @@ myController.$inject = ['notify'];
</div>
</doc:source>
<doc:scenario>
-it('should test service', function(){
+it('should test service', function() {
expect(element(':input[ng\\:model="message"]').val()).toEqual('test');
});
</doc:scenario>
diff --git a/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc b/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc
index 27daec9f..e2814a48 100644
--- a/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc
+++ b/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc
@@ -36,7 +36,7 @@ text upper-case and assigns color.
return out;
});
- function Ctrl(){
+ function Ctrl() {
this.greeting = 'hello';
}
</script>
@@ -50,7 +50,7 @@ text upper-case and assigns color.
</div>
</doc:source>
<doc:scenario>
- it('should reverse greeting', function(){
+ it('should reverse greeting', function() {
expect(binding('greeting|reverse')).toEqual('olleh');
input('greeting').enter('ABC');
expect(binding('greeting|reverse')).toEqual('CBA');
diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc
index 459b6b93..978784f9 100644
--- a/docs/content/guide/dev_guide.unit-testing.ngdoc
+++ b/docs/content/guide/dev_guide.unit-testing.ngdoc
@@ -43,11 +43,11 @@ on a constructor permanently binds the call site to the type. For example lets s
trying to instantiate an `XHR` so that we can get some data from the server.
<pre>
-function MyClass(){
- this.doWork = function(){
+function MyClass() {
+ this.doWork = function() {
var xhr = new XHR();
xhr.open(method, url, true);
- xhr.onreadystatechange = function(){...}
+ xhr.onreadystatechange = function() {...}
xhr.send();
}
}
@@ -61,7 +61,7 @@ patching, that is a bad idea for many reasons, which is outside the scope of thi
The class above is hard to test since we have to resort to monkey patching:
<pre>
var oldXHR = XHR;
-XHR = function MockXHR(){};
+XHR = function MockXHR() {};
var myClass = new MyClass();
myClass.doWork();
// assert that MockXHR got called with the right arguments
@@ -73,8 +73,8 @@ XHR = oldXHR; // if you forget this bad things will happen
Another way to approach the problem is look for the service in a well known location.
<pre>
-function MyClass(){
- this.doWork = function(){
+function MyClass() {
+ this.doWork = function() {
global.xhr({
method:'...',
url:'...',
@@ -94,7 +94,7 @@ State & Singletons}
The class above is hard to test since we have to change global state:
<pre>
var oldXHR = glabal.xhr;
-glabal.xhr = function mockXHR(){};
+glabal.xhr = function mockXHR() {};
var myClass = new MyClass();
myClass.doWork();
// assert that mockXHR got called with the right arguments
@@ -110,7 +110,7 @@ having the tests replace the services as needed.
<pre>
function MyClass() {
var serviceRegistry = ????;
- this.doWork = function(){
+ this.doWork = function() {
var xhr = serviceRegistry.get('xhr');
xhr({
method:'...',
@@ -128,7 +128,7 @@ there is only one global variable to be reset).
The class above is hard to test since we have to change global state:
<pre>
var oldServiceLocator = glabal.serviceLocator;
-glabal.serviceLocator.set('xhr', function mockXHR(){});
+glabal.serviceLocator.set('xhr', function mockXHR() {});
var myClass = new MyClass();
myClass.doWork();
// assert that mockXHR got called with the right arguments
@@ -141,7 +141,7 @@ Lastly the dependency can be passed in.
<pre>
function MyClass(xhr) {
- this.doWork = function(){
+ this.doWork = function() {
xhr({
method:'...',
url:'...',
@@ -174,13 +174,13 @@ for your application is mixed in with DOM manipulation, it will be hard to test
below:
<pre>
-function PasswordController(){
+function PasswordController() {
// get references to DOM elements
var msg = $('.ex1 span');
var input = $('.ex1 input');
var strength;
- this.grade = function(){
+ this.grade = function() {
msg.removeClass(strength);
var pwd = input.val();
password.text(pwd);
@@ -219,9 +219,9 @@ In angular the controllers are strictly separated from the DOM manipulation logi
a much easier testability story as can be seen in this example:
<pre>
-function PasswordCntrl(){
+function PasswordCntrl() {
this.password = '';
- this.grade = function(){
+ this.grade = function() {
var size = this.password.length;
if (size > 8) {
this.strength = 'strong';
diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc
index 4e1abfad..09065979 100644
--- a/docs/content/tutorial/step_02.ngdoc
+++ b/docs/content/tutorial/step_02.ngdoc
@@ -69,7 +69,7 @@ view.
## Model and Controller
The data __model__ (a simple array of phones in object literal notation) is instantiated within
-the __controller__ function (`PhoneListCtrl`):
+the __controller__ function(`PhoneListCtrl`):
__`app/js/controllers.js`:__
<pre>
@@ -91,7 +91,7 @@ providing context for our data model, the controller allows us to establish data
the model and the view. We connected the dots between the presentation, data, and logic components
as follows:
-* The name of our controller function (in the JavaScript file `controllers.js`) matches the {@link
+* The name of our controller function(in the JavaScript file `controllers.js`) matches the {@link
api/angular.directive.ng:controller ng:controller} directive in the `<body>` tag (`PhoneListCtrl`).
* The data is instantiated within the *scope* of our controller function; our template binding
points are located within the block bounded by the `<body ng:controller="PhoneListCtrl">` tag.
diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc
index d05a8e7c..6426674a 100644
--- a/docs/content/tutorial/step_04.ngdoc
+++ b/docs/content/tutorial/step_04.ngdoc
@@ -114,7 +114,7 @@ __`test/unit/controllerSpec.js`:__
<pre>
describe('PhoneCat controllers', function() {
- describe('PhoneListCtrl', function(){
+ describe('PhoneListCtrl', function() {
var scope, $browser, ctrl;
beforeEach(function() {
diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc
index 3d474583..450bf679 100644
--- a/docs/content/tutorial/step_11.ngdoc
+++ b/docs/content/tutorial/step_11.ngdoc
@@ -129,7 +129,7 @@ __`test/unit/controllersSpec.js`:__
<pre>
describe('PhoneCat controllers', function() {
- beforeEach(function(){
+ beforeEach(function() {
this.addMatchers({
toEqualData: function(expected) {
return angular.equals(this.actual, expected);
diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js
index 3fda656f..45813cc4 100644
--- a/docs/spec/domSpec.js
+++ b/docs/spec/domSpec.js
@@ -1,15 +1,15 @@
var DOM = require('dom.js').DOM;
-describe('dom', function(){
+describe('dom', function() {
var dom;
- beforeEach(function(){
+ beforeEach(function() {
dom = new DOM();
});
- describe('h', function(){
+ describe('h', function() {
- it('should render using function', function(){
+ it('should render using function', function() {
var cbThis;
var cdValue;
dom.h('heading', 'content', function(value){
@@ -20,8 +20,8 @@ describe('dom', function(){
expect(cbValue).toEqual('content');
});
- it('should update heading numbers', function(){
- dom.h('heading', function(){
+ it('should update heading numbers', function() {
+ dom.h('heading', function() {
this.html('<h1>sub-heading</h1>');
});
expect(dom.toString()).toContain('<h1>heading</h1>');
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index 2afcc3d4..c6e67b13 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -1,11 +1,11 @@
var ngdoc = require('ngdoc.js');
var DOM = require('dom.js').DOM;
-describe('ngdoc', function(){
+describe('ngdoc', function() {
var Doc = ngdoc.Doc;
var dom;
- beforeEach(function(){
+ beforeEach(function() {
dom = new DOM();
this.addMatchers({
toContain: function(text) {
@@ -15,15 +15,15 @@ describe('ngdoc', function(){
});
});
- describe('Doc', function(){
- describe('metadata', function(){
+ describe('Doc', function() {
+ describe('metadata', function() {
- it('should find keywords', function(){
+ it('should find keywords', function() {
expect(new Doc('\nHello: World! @ignore. $abc').keywords()).toEqual('$abc hello world');
expect(new Doc('The `ng:class-odd` and').keywords()).toEqual('and ng:class-odd the');
});
- it('should have shortName', function(){
+ it('should have shortName', function() {
var d1 = new Doc('@name a.b.c').parse();
var d2 = new Doc('@name a.b.ng:c').parse();
var d3 = new Doc('@name some text: more text').parse();
@@ -32,7 +32,7 @@ describe('ngdoc', function(){
expect(ngdoc.metadata([d3])[0].shortName).toEqual('more text');
});
- it('should have depth information', function(){
+ it('should have depth information', function() {
var d1 = new Doc('@name a.b.c').parse();
var d2 = new Doc('@name a.b.ng:c').parse();
var d3 = new Doc('@name some text: more text').parse();
@@ -43,8 +43,8 @@ describe('ngdoc', function(){
});
- describe('parse', function(){
- it('should convert @names into properties', function(){
+ describe('parse', function() {
+ it('should convert @names into properties', function() {
var doc = new Doc('\n@name name\n@desc\ndesc\ndesc2\n@dep\n');
doc.parse();
expect(doc.name).toEqual('name');
@@ -52,7 +52,7 @@ describe('ngdoc', function(){
expect(doc.dep).toEqual('');
});
- it('should parse parameters', function(){
+ it('should parse parameters', function() {
var doc = new Doc(
'@param {*} a short\n' +
'@param {Type} b med\n' +
@@ -65,7 +65,7 @@ describe('ngdoc', function(){
]);
});
- it('should parse return', function(){
+ it('should parse return', function() {
var doc = new Doc('@returns {Type} text *bold*.');
doc.parse();
expect(doc.returns).toEqual({
@@ -74,14 +74,14 @@ describe('ngdoc', function(){
});
});
- it('should parse filename', function(){
+ it('should parse filename', function() {
var doc = new Doc('@name friendly name', 'docs/a.b.ngdoc', 1);
doc.parse(0);
expect(doc.id).toEqual('a.b');
expect(doc.name).toEqual('friendly name');
});
- it('should escape <doc:source> element', function(){
+ it('should escape <doc:source> element', function() {
var doc = new Doc('@description before <doc:example>' +
'<doc:source>\n<>\n</doc:source></doc:example> after');
doc.parse();
@@ -89,7 +89,7 @@ describe('ngdoc', function(){
'<pre class="doc-source">\n&lt;&gt;\n</pre></doc:example><p>after</p>');
});
- it('should preserve the jsfiddle attribute', function(){
+ it('should preserve the jsfiddle attribute', function() {
var doc = new Doc('@description before <doc:example>' +
'<doc:source jsfiddle="foo">lala</doc:source></doc:example> after');
doc.parse();
@@ -97,7 +97,7 @@ describe('ngdoc', function(){
'<pre class="doc-source" jsfiddle="foo">lala</pre></doc:example><p>after</p>');
});
- it('should escape <doc:scenario> element', function(){
+ it('should escape <doc:scenario> element', function() {
var doc = new Doc('@description before <doc:example>' +
'<doc:scenario>\n<>\n</doc:scenario></doc:example> after');
doc.parse();
@@ -132,11 +132,11 @@ describe('ngdoc', function(){
});
});
- describe('sorting', function(){
+ describe('sorting', function() {
function property(name) {
return function(obj) {return obj[name];};
}
- function noop(){}
+ function noop() {}
function doc(type, name){
return {
id: name,
@@ -149,7 +149,7 @@ describe('ngdoc', function(){
var angular_x = doc('function', 'angular.x');
var angular_y = doc('property', 'angular.y');
- it('should put angular.fn() in front of angular.widget, etc', function(){
+ it('should put angular.fn() in front of angular.widget, etc', function() {
expect(ngdoc.metadata([angular_widget, angular_y, angular_x]).map(property('id')))
.toEqual(['angular.x', 'angular.y', 'angular.widget' ]);
});
@@ -157,13 +157,13 @@ describe('ngdoc', function(){
});
});
- describe('markdown', function(){
- it('should replace angular in markdown', function(){
+ describe('markdown', function() {
+ it('should replace angular in markdown', function() {
expect(new Doc().markdown('<angular/>')).
toEqual('<p><tt>&lt;angular/&gt;</tt></p>');
});
- it('should not replace anything in <pre>, but escape the html escape the content', function(){
+ it('should not replace anything in <pre>, but escape the html escape the content', function() {
expect(new Doc().markdown('bah x\n<pre>\n<b>angular</b>.k\n</pre>\n asdf x')).
toEqual(
'<p>bah x</p>' +
@@ -234,19 +234,19 @@ describe('ngdoc', function(){
});
- describe('trim', function(){
+ describe('trim', function() {
var trim = ngdoc.trim;
- it('should remove leading/trailing space', function(){
+ it('should remove leading/trailing space', function() {
expect(trim(' \nabc\n ')).toEqual('abc');
});
- it('should remove leading space on every line', function(){
+ it('should remove leading space on every line', function() {
expect(trim('\n 1\n 2\n 3\n')).toEqual('1\n 2\n 3');
});
});
- describe('merge', function(){
- it('should merge child with parent', function(){
+ describe('merge', function() {
+ it('should merge child with parent', function() {
var parent = new Doc({id: 'angular.service.abc', name: 'angular.service.abc', section: 'api'});
var methodA = new Doc({name: 'methodA', methodOf: 'angular.service.abc'});
var methodB = new Doc({name: 'methodB', methodOf: 'angular.service.abc'});
@@ -294,9 +294,9 @@ describe('ngdoc', function(){
////////////////////////////////////////
- describe('TAG', function(){
- describe('@param', function(){
- it('should parse with no default', function(){
+ describe('TAG', function() {
+ describe('@param', function() {
+ it('should parse with no default', function() {
var doc = new Doc('@param {(number|string)} number Number \n to format.');
doc.parse();
expect(doc.param).toEqual([{
@@ -307,7 +307,7 @@ describe('ngdoc', function(){
description : '<p>Number \nto format.</p>' }]);
});
- it('should parse with default and optional', function(){
+ it('should parse with default and optional', function() {
var doc = new Doc('@param {(number|string)=} [fractionSize=2] desc');
doc.parse();
expect(doc.param).toEqual([{
@@ -397,8 +397,8 @@ describe('ngdoc', function(){
});
});
- describe('@description', function(){
- it('should support pre blocks', function(){
+ describe('@description', function() {
+ it('should support pre blocks', function() {
var doc = new Doc("@description <pre><b>abc</b></pre>");
doc.parse();
expect(doc.description).
@@ -442,7 +442,7 @@ describe('ngdoc', function(){
toContain('<a href="./static.html">./static.html</a>');
});
- it('should support line breaks in @link', function(){
+ it('should support line breaks in @link', function() {
var doc = new Doc("@description " +
'{@link\napi/angular.foo\na\nb}');
doc.parse();
@@ -452,14 +452,14 @@ describe('ngdoc', function(){
});
- describe('@example', function(){
- it('should not remove {{}}', function(){
+ describe('@example', function() {
+ it('should not remove {{}}', function() {
var doc = new Doc('@example text {{ abc }}');
doc.parse();
expect(doc.example).toEqual('<p>text {{ abc }}</p>');
});
- it('should support doc:example', function(){
+ it('should support doc:example', function() {
var doc = new Doc('@ngdoc overview\n@example \n' +
'<doc:example>\n' +
' <doc:source><escapeme></doc:source>\n' +
@@ -480,7 +480,7 @@ describe('ngdoc', function(){
});
});
- describe('@this', function(){
+ describe('@this', function() {
it('should render @this', function() {
var doc = new Doc('@this I am self.');
doc.ngdoc = 'filter';
@@ -495,9 +495,9 @@ describe('ngdoc', function(){
});
});
- describe('usage', function(){
- describe('overview', function(){
- it('should supress description heading', function(){
+ describe('usage', function() {
+ describe('overview', function() {
+ it('should supress description heading', function() {
var doc = new Doc('@ngdoc overview\n@name angular\n@description\n#heading\ntext');
doc.parse();
expect(doc.html()).toContain('text');
@@ -507,8 +507,8 @@ describe('ngdoc', function(){
});
- describe('function', function(){
- it('should format', function(){
+ describe('function', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'function',
name:'some.name',
@@ -527,8 +527,8 @@ describe('ngdoc', function(){
});
});
- describe('filter', function(){
- it('should format', function(){
+ describe('filter', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'formatter',
shortName:'myFilter',
@@ -543,8 +543,8 @@ describe('ngdoc', function(){
});
});
- describe('property', function(){
- it('should format', function(){
+ describe('property', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'property',
name:'myProp',
diff --git a/docs/spec/sitemapSpec.js b/docs/spec/sitemapSpec.js
index b14d58bf..dc6c3438 100644
--- a/docs/spec/sitemapSpec.js
+++ b/docs/spec/sitemapSpec.js
@@ -2,8 +2,8 @@ var SiteMap = require('SiteMap.js').SiteMap;
var Doc = require('ngdoc.js').Doc;
-describe('sitemap', function(){
- it('should render empty sitemap', function(){
+describe('sitemap', function() {
+ it('should render empty sitemap', function() {
var map = new SiteMap([]);
expect(map.render()).toEqual([
'<?xml version="1.0" encoding="UTF-8"?>',
@@ -11,7 +11,7 @@ describe('sitemap', function(){
'</urlset>', ''].join('\n'));
});
- it('should render ngdoc url', function(){
+ it('should render ngdoc url', function() {
var map = new SiteMap([new Doc({section: 'foo', id: 'a.b.c<>\'"&'})]);
expect(map.render()).toContain([
' <url>',
diff --git a/docs/spec/specs.js b/docs/spec/specs.js
index a6ba17a9..7f9f92ee 100644
--- a/docs/spec/specs.js
+++ b/docs/spec/specs.js
@@ -10,7 +10,7 @@ for(var key in jasmine) {
}
//Patch Jasmine for proper stack traces
-jasmine.Spec.prototype.fail = function (e) {
+jasmine.Spec.prototype.fail = function(e) {
var expectationResult = new jasmine.ExpectationResult({
passed: false,
message: e ? jasmine.util.formatException(e) : 'Exception'
diff --git a/docs/spec/writerSpec.js b/docs/spec/writerSpec.js
index a44e283c..973bb64e 100644
--- a/docs/spec/writerSpec.js
+++ b/docs/spec/writerSpec.js
@@ -1,17 +1,17 @@
var writer = require('writer.js');
-describe('writer', function(){
- describe('toString', function(){
+describe('writer', function() {
+ describe('toString', function() {
var toString = writer.toString;
- it('should merge string', function(){
+ it('should merge string', function() {
expect(toString('abc')).toEqual('abc');
});
- it('should merge obj', function(){
+ it('should merge obj', function() {
expect(toString({a:1})).toEqual('{"a":1}');
});
- it('should merge array', function(){
+ it('should merge array', function() {
expect(toString(['abc',{}])).toEqual('abc{}');
});
});
diff --git a/docs/src/SiteMap.js b/docs/src/SiteMap.js
index 61834c6f..fb670c31 100644
--- a/docs/src/SiteMap.js
+++ b/docs/src/SiteMap.js
@@ -7,7 +7,7 @@ exports.SiteMap = SiteMap;
* @returns {SiteMap}
*/
function SiteMap(docs){
- this.render = function(){
+ this.render = function() {
var map = [];
map.push('<?xml version="1.0" encoding="UTF-8"?>');
map.push('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
diff --git a/docs/src/dom.js b/docs/src/dom.js
index 4210d687..ccfee7ac 100644
--- a/docs/src/dom.js
+++ b/docs/src/dom.js
@@ -12,7 +12,7 @@ function htmlEscape(text){
}
-function DOM(){
+function DOM() {
this.out = [];
this.headingDepth = 0;
}
@@ -69,7 +69,7 @@ DOM.prototype = {
},
code: function(text) {
- this.tag('div', {'ng:non-bindable':''}, function(){
+ this.tag('div', {'ng:non-bindable':''}, function() {
this.tag('pre', {'class':"brush: js; html-script: true;"}, text);
});
},
@@ -84,7 +84,7 @@ DOM.prototype = {
if (content instanceof Array) {
this.ul(content, className, fn);
} else if (fn) {
- this.tag('div', className, function(){
+ this.tag('div', className, function() {
fn.call(this, content);
});
} else {
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js
index 5e642686..eecc98cc 100755
--- a/docs/src/gen-docs.js
+++ b/docs/src/gen-docs.js
@@ -7,7 +7,7 @@ var reader = require('reader.js'),
appCache = require('appCache.js').appCache,
Q = require('qq');
-process.on('uncaughtException', function (err) {
+process.on('uncaughtException', function(err) {
console.error(err.stack || err);
});
@@ -93,6 +93,6 @@ function writeTheRest(writesFuture) {
}
-function now(){ return new Date().getTime(); }
+function now() { return new Date().getTime(); }
-function noop(){};
+function noop() {};
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 1a4f5d25..a154ae7d 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -37,14 +37,14 @@ function Doc(text, file, line) {
this.events = this.events || [];
this.links = this.links || [];
}
-Doc.METADATA_IGNORE = (function(){
+Doc.METADATA_IGNORE = (function() {
var words = require('fs').readFileSync(__dirname + '/ignore.words', 'utf8');
return words.toString().split(/[,\s\n\r]+/gm);
})();
Doc.prototype = {
- keywords: function keywords(){
+ keywords: function keywords() {
var keywords = {};
Doc.METADATA_IGNORE.forEach(function(ignore){ keywords[ignore] = true; });
var words = [];
@@ -83,7 +83,7 @@ Doc.prototype = {
return this.section + '/' + url;
},
- markdown: function (text) {
+ markdown: function(text) {
if (!text) return text;
var self = this,
@@ -151,7 +151,7 @@ Doc.prototype = {
return parts.join('');
},
- parse: function(){
+ parse: function() {
var atName;
var atText;
var match;
@@ -180,7 +180,7 @@ Doc.prototype = {
this['this'] = this.markdown(this['this']);
return this;
- function flush(){
+ function flush() {
if (atName) {
var text = trim(atText.join('\n'));
if (atName == 'param') {
@@ -234,11 +234,11 @@ Doc.prototype = {
}
},
- html: function(){
+ html: function() {
var dom = new DOM(),
self = this;
- dom.h(this.name, function(){
+ dom.h(this.name, function() {
notice('workInProgress', 'Work in Progress',
'This page is currently being revised. It might be incomplete or contain inaccuracies.');
notice('deprecated', 'Deprecated API', self.deprecated);
@@ -247,13 +247,13 @@ Doc.prototype = {
dom.h('Description', self.description, dom.html);
}
dom.h('Dependencies', self.requires, function(require){
- dom.tag('code', function(){
+ dom.tag('code', function() {
dom.tag('a', {href: 'api/angular.service.' + require.name}, require.name);
});
dom.html(require.text);
});
- (self['html_usage_' + self.ngdoc] || function(){
+ (self['html_usage_' + self.ngdoc] || function() {
throw new Error("Don't know how to format @ngdoc: " + self.ngdoc);
}).call(self, dom);
@@ -276,10 +276,10 @@ Doc.prototype = {
html_usage_parameters: function(dom) {
dom.h('Parameters', this.param, function(param){
- dom.tag('code', function(){
+ dom.tag('code', function() {
dom.text(param.name);
if (param.optional) {
- dom.tag('i', function(){
+ dom.tag('i', function() {
dom.text('(optional');
if(param['default']) {
dom.text('=' + param['default']);
@@ -298,7 +298,7 @@ Doc.prototype = {
html_usage_returns: function(dom) {
var self = this;
if (self.returns) {
- dom.h('Returns', function(){
+ dom.h('Returns', function() {
dom.tag('code', '{' + self.returns.type + '}');
dom.text('– ');
dom.html(self.returns.description);
@@ -319,8 +319,8 @@ Doc.prototype = {
html_usage_function: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.code(function(){
+ dom.h('Usage', function() {
+ dom.code(function() {
dom.text(self.name.split('service.').pop());
dom.text('(');
self.parameters(dom, ', ');
@@ -335,8 +335,8 @@ Doc.prototype = {
html_usage_property: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.code(function(){
+ dom.h('Usage', function() {
+ dom.code(function() {
dom.text(self.name);
});
@@ -346,8 +346,8 @@ Doc.prototype = {
html_usage_directive: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.tag('pre', {'class':"brush: js; html-script: true;"}, function(){
+ dom.h('Usage', function() {
+ dom.tag('pre', {'class':"brush: js; html-script: true;"}, function() {
dom.text('<' + self.element + ' ');
dom.text(self.shortName);
if (self.param.length) {
@@ -362,9 +362,9 @@ Doc.prototype = {
html_usage_filter: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.h('In HTML Template Binding', function(){
- dom.tag('code', function(){
+ dom.h('Usage', function() {
+ dom.h('In HTML Template Binding', function() {
+ dom.tag('code', function() {
dom.text('{{ ');
dom.text(self.shortName);
dom.text('_expression | ');
@@ -374,8 +374,8 @@ Doc.prototype = {
});
});
- dom.h('In JavaScript', function(){
- dom.tag('code', function(){
+ dom.h('In JavaScript', function() {
+ dom.tag('code', function() {
dom.text('angular.filter.');
dom.text(self.shortName);
dom.text('(');
@@ -392,8 +392,8 @@ Doc.prototype = {
html_usage_inputType: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.code(function(){
+ dom.h('Usage', function() {
+ dom.code(function() {
dom.text('<input type="' + self.shortName + '"');
(self.param||[]).forEach(function(param){
dom.text('\n ');
@@ -410,9 +410,9 @@ Doc.prototype = {
html_usage_widget: function(dom){
var self = this;
- dom.h('Usage', function(){
- dom.h('In HTML Template Binding', function(){
- dom.code(function(){
+ dom.h('Usage', function() {
+ dom.h('In HTML Template Binding', function() {
+ dom.code(function() {
if (self.shortName.match(/^@/)) {
dom.text('<');
dom.text(self.element);
@@ -456,8 +456,8 @@ Doc.prototype = {
var self = this;
if (this.param.length) {
- dom.h('Usage', function(){
- dom.code(function(){
+ dom.h('Usage', function() {
+ dom.code(function() {
dom.text(self.name.split('.').pop());
dom.text('(');
self.parameters(dom, ', ');
@@ -472,7 +472,7 @@ Doc.prototype = {
dom.h('Methods', this.methods, function(method){
var signature = (method.param || []).map(property('name'));
- dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){
+ dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function() {
dom.html(method.description);
method.html_usage_parameters(dom);
self.html_usage_this(dom);
@@ -482,23 +482,23 @@ Doc.prototype = {
});
});
dom.h('Properties', this.properties, function(property){
- dom.h(property.name, function(){
+ dom.h(property.name, function() {
dom.html(property.description);
dom.h('Example', property.example, dom.html);
});
});
dom.h('Events', this.events, function(event){
- dom.h(event.shortName, event, function(){
+ dom.h(event.shortName, event, function() {
dom.html(event.description);
if (event.type == 'listen') {
- dom.tag('div', {class:'inline'}, function(){
+ dom.tag('div', {class:'inline'}, function() {
dom.h('Listen on:', event.target);
});
} else {
- dom.tag('div', {class:'inline'}, function(){
+ dom.tag('div', {class:'inline'}, function() {
dom.h('Type:', event.type);
});
- dom.tag('div', {class:'inline'}, function(){
+ dom.tag('div', {class:'inline'}, function() {
dom.h('Target:', event.target);
});
}
@@ -547,8 +547,8 @@ function scenarios(docs){
function appendSpecs(urlPrefix) {
docs.forEach(function(doc){
- specs.push(' describe("' + doc.section + '/' + doc.id + '", function(){');
- specs.push(' beforeEach(function(){');
+ specs.push(' describe("' + doc.section + '/' + doc.id + '", function() {');
+ specs.push(' beforeEach(function() {');
specs.push(' browser().navigateTo("' + urlPrefix + doc.section + '/' + doc.id + '");');
specs.push(' });');
specs.push(' ');
@@ -686,7 +686,7 @@ function indent(text, spaceCount) {
function merge(docs){
var byFullId = {};
- docs.forEach(function (doc) {
+ docs.forEach(function(doc) {
byFullId[doc.section + '/' + doc.id] = doc;
});
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js
index 72f59f74..f2e2f3fc 100644
--- a/docs/src/templates/doc_widgets.js
+++ b/docs/src/templates/doc_widgets.js
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var angularJsUrl;
var scripts = document.getElementsByTagName("script");
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index 505aed60..7667391e 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -44,7 +44,7 @@ function DocsController($location, $browser, $window, $cookies) {
return page.section + '/' + page.id;
};
- this.getCurrentPartial = function(){
+ this.getCurrentPartial = function() {
return this.partialId ? ('./partials/' + this.sectionId + '/' + this.partialId + '.html') : '';
};
diff --git a/docs/src/templates/syntaxhighlighter/shCore.js b/docs/src/templates/syntaxhighlighter/shCore.js
index effcf59d..21d52a28 100644
--- a/docs/src/templates/syntaxhighlighter/shCore.js
+++ b/docs/src/templates/syntaxhighlighter/shCore.js
@@ -14,4 +14,4 @@
* @license
* Dual licensed under the MIT and GPL licenses.
*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a<f.L;a++)I(f[a]===e)H a;H-1}M=6(f,e){K a=[],b=M.1B,c=0,d,h;I(M.1R(f)){I(e!==1d)1S 3m("2a\'t 5r 5I 5F 5B 5C 15 5E 5p");H r(f)}I(v)1S 2U("2a\'t W 3l M 59 5m 5g 5x 5i");e=e||"";O(d={2N:11,19:[],2K:6(g){H e.1i(g)>-1},3d:6(g){e+=g}};c<f.L;)I(h=B(f,c,b,d)){a.U(h.3k);c+=h.1C[0].L||1}Y I(h=n.X.W(z[b],f.1a(c))){a.U(h[0]);c+=h[0].L}Y{h=f.3a(c);I(h==="[")b=M.2I;Y I(h==="]")b=M.1B;a.U(h);c++}a=15(a.1K(""),n.Q.W(e,w,""));a.1w={1m:f,19:d.2N?d.19:N};H a};M.3v="1.5.0";M.2I=1;M.1B=2;K C=/\\$(?:(\\d\\d?|[$&`\'])|{([$\\w]+)})/g,w=/[^5h]+|([\\s\\S])(?=[\\s\\S]*\\1)/g,A=/^(?:[?*+]|{\\d+(?:,\\d*)?})\\??/,v=11,u=[],n={X:15.Z.X,1A:15.Z.1A,1C:1r.Z.1C,Q:1r.Z.Q,1e:1r.Z.1e},x=n.X.W(/()??/,"")[1]===1d,D=6(){K f=/^/g;n.1A.W(f,"");H!f.12}(),y=6(){K f=/x/g;n.Q.W("x",f,"");H!f.12}(),E=15.Z.3n!==1d,z={};z[M.2I]=/^(?:\\\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S]))/;z[M.1B]=/^(?:\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\\d*|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S])|\\(\\?[:=!]|[?*+]\\?|{\\d+(?:,\\d*)?}\\??)/;M.1h=6(f,e,a,b){u.U({2q:r(f,"g"+(E?"y":"")),2b:e,3r:a||M.1B,2p:b||N})};M.2n=6(f,e){K a=f+"/"+(e||"");H M.2n[a]||(M.2n[a]=M(f,e))};M.3c=6(f){H r(f,"g")};M.5l=6(f){H f.Q(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,"\\\\$&")};M.5e=6(f,e,a,b){e=r(e,"g"+(b&&E?"y":""));e.12=a=a||0;f=e.X(f);H b?f&&f.P===a?f:N:f};M.3q=6(){M.1h=6(){1S 2U("2a\'t 55 1h 54 3q")}};M.1R=6(f){H 53.Z.1q.W(f)==="[2m 15]"};M.3p=6(f,e,a,b){O(K c=r(e,"g"),d=-1,h;h=c.X(f);){a.W(b,h,++d,f,c);c.12===h.P&&c.12++}I(e.1J)e.12=0};M.57=6(f,e){H 6 a(b,c){K d=e[c].1I?e[c]:{1I:e[c]},h=r(d.1I,"g"),g=[],i;O(i=0;i<b.L;i++)M.3p(b[i],h,6(k){g.U(d.3j?k[d.3j]||"":k[0])});H c===e.L-1||!g.L?g:a(g,c+1)}([f],0)};15.Z.1p=6(f,e){H J.X(e[0])};15.Z.W=6(f,e){H J.X(e)};15.Z.X=6(f){K e=n.X.1p(J,14),a;I(e){I(!x&&e.L>1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;b<e.L;b++)I(a=J.1w.19[b-1])e[a]=e[b];!D&&J.1J&&!e[0].L&&J.12>e.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;d<b.L;d++)I(b[d])14[0][b[d]]=14[d+1]}I(a&&f.1J)f.12=14[14.L-2]+14[0].L;H e.1p(N,14)});Y{c=J+"";c=n.Q.W(c,f,6(){K d=14;H n.Q.W(e,C,6(h,g,i){I(g)5b(g){24"$":H"$";24"&":H d[0];24"`":H d[d.L-1].1a(0,d[d.L-2]);24"\'":H d[d.L-1].1a(d[d.L-2]+d[0].L);5a:i="";g=+g;I(!g)H h;O(;g>d.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P<a.L&&3b.Z.U.1p(b,d.1a(1));h=d[0].L;c=f.12;I(b.L>=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a<d.L&&i==N;a++)i=p(d[a],b,c);H i}6 C(a,b){K c={},d;O(d 2g a)c[d]=a[d];O(d 2g b)c[d]=b[d];H c}6 w(a,b,c,d){6 h(g){g=g||1P.5y;I(!g.1F){g.1F=g.52;g.3N=6(){J.5w=11}}c.W(d||1P,g)}a.3g?a.3g("4U"+b,h):a.4y(b,h,11)}6 A(a,b){K c=e.1Y.2j,d=N;I(c==N){c={};O(K h 2g e.1U){K g=e.1U[h];d=g.4x;I(d!=N){g.1V=h.4w();O(g=0;g<d.L;g++)c[d[g]]=h}}e.1Y.2j=c}d=e.1U[c[a]];d==N&&b!=11&&1P.1X(e.13.1x.1X+(e.13.1x.3E+a));H d}6 v(a,b){O(K c=a.1e("\\n"),d=0;d<c.L;d++)c[d]=b(c[d],d);H c.1K("\\n")}6 u(a,b){I(a==N||a.L==0||a=="\\n")H a;a=a.Q(/</g,"&1y;");a=a.Q(/ {2,}/g,6(c){O(K d="",h=0;h<c.L-1;h++)d+=e.13.1W;H d+" "});I(b!=N)a=v(a,6(c){I(c.L==0)H"";K d="";c=c.Q(/^(&2s;| )+/,6(h){d=h;H""});I(c.L==0)H d;H d+\'<17 1g="\'+b+\'">\'+c+"</17>"});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.P<b.P)H-1;Y I(a.P>b.P)H 1;Y I(a.L<b.L)H-1;Y I(a.L>b.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'<a 2h="\'+c+\'">\'+c+"</a>"+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<a.L;c++)a[c].3s=="20"&&b.U(a[c]);H b}6 f(a){a=a.1F;K b=p(a,".20",R);a=p(a,".3O",R);K c=1E.4i("3t");I(!(!a||!b||p(a,"3t"))){B(b.1c);r(b,"1m");O(K d=a.3G,h=[],g=0;g<d.L;g++)h.U(d[g].4z||d[g].4A);h=h.1K("\\r");c.39(1E.4D(h));a.39(c);c.2C();c.4C();w(c,"4u",6(){c.2G.4E(c);b.1l=b.1l.Q("1m","")})}}I(1j 3F!="1d"&&1j M=="1d")M=3F("M").M;K e={2v:{"1g-27":"","2i-1s":1,"2z-1s-2t":11,1M:N,1t:N,"42-45":R,"43-22":4,1u:R,16:R,"3V-17":R,2l:11,"41-40":R,2k:11,"1z-1k":11},13:{1W:"&2s;",2M:R,46:11,44:11,34:"4n",1x:{21:"4o 1m",2P:"?",1X:"1v\\n\\n",3E:"4r\'t 4t 1D O: ",4g:"4m 4B\'t 51 O 1z-1k 4F: ",37:\'<!4T 1z 4S "-//4V//3H 4W 1.0 4Z//4Y" "1Z://2y.3L.3K/4X/3I/3H/3I-4P.4J"><1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v</1t></3J><3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;"><T 1L="2O-3D:3C;3w-32:1.6z;"><T 1L="25-22:6A-6E;">1v</T><T 1L="25-22:.6C;3w-6B:6R;"><T>3v 3.0.76 (72 73 3x)</T><T><a 2h="1Z://3u.2w/1v" 1F="38" 1L="2f:#3y">1Z://3u.2w/1v</a></T><T>70 17 6U 71.</T><T>6T 6X-3x 6Y 6D.</T></T><T>6t 61 60 J 1k, 5Z <a 2h="6u://2y.62.2w/63-66/65?64=5X-5W&5P=5O" 1L="2f:#3y">5R</a> 5V <2R/>5U 5T 5S!</T></T></3B></1z>\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'<T 1g="16">\',d=e.16.2x,h=d.2X,g=0;g<h.L;g++)c+=(d[h[g]].1H||b)(a,h[g]);c+="</T>";H c},2o:6(a,b,c){H\'<2W><a 2h="#" 1g="6e 6h\'+b+" "+b+\'">\'+c+"</a></2W>"},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h<c.L;h++)d.U(c[h]);c=d}c=c;d=[];I(e.13.2M)c=c.1O(z());I(c.L===0)H d;O(h=0;h<c.L;h++){O(K g=c[h],i=a,k=c[h].1l,j=3W 0,l={},m=1f M("^\\\\[(?<2V>(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g<c.L;g++){b=c[g];K i=b.1F,k=b.1n,j=k.1D,l;I(j!=N){I(k["1z-1k"]=="R"||e.2v["1z-1k"]==R){d=1f e.4l(j);j="4O"}Y I(d=A(j))d=1f d;Y 6H;l=i.3X;I(h.2M){l=l;K m=x(l),s=11;I(m.1i("<![6G[")==0){m=m.4h(9);s=R}K o=m.L;I(m.1i("]]\\>")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;m<j.L;m++)j[m].P+=l}K c=A(a),d,h=1f e.1U.5Y,g=J,i="2F 1H 2Q".1e(" ");I(c!=N){d=1f c;O(K k=0;k<i.L;k++)(6(){K j=i[k];g[j]=6(){H h[j].1p(h,14)}})();d.28==N?1P.1X(e.13.1x.1X+(e.13.1x.4g+a)):h.2J.U({1I:d.28.17,2D:6(j){O(K l=j.17,m=[],s=d.2J,o=j.P+j.18.L,F=d.28,q,G=0;G<s.L;G++){q=y(l,s[G]);b(q,o);m=m.1O(q)}I(F.18!=N&&j.18!=N){q=y(j.18,F.18);b(q,j.P);m=m.1O(q)}I(F.1b!=N&&j.1b!=N){q=y(j.1b,F.1b);b(q,j.P+j[0].5Q(j.1b));m=m.1O(q)}O(j=0;j<m.L;j++)m[j].1V=c.1V;H m}})}};e.4j=6(){};e.4j.Z={V:6(a,b){K c=J.1n[a];c=c==N?b:c;K d={"R":R,"11":11}[c];H d==N?c:d},3Y:6(a){H 1E.4i(a)},4c:6(a,b){K c=[];I(a!=N)O(K d=0;d<a.L;d++)I(1j a[d]=="2m")c=c.1O(y(b,a[d]));H J.4e(c.6b(D))},4e:6(a){O(K b=0;b<a.L;b++)I(a[b]!==N)O(K c=a[b],d=c.P+c.L,h=b+1;h<a.L&&a[b]!==N;h++){K g=a[h];I(g!==N)I(g.P>d)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P<d)a[h]=N}H a},4d:6(a){K b=[],c=2u(J.V("2i-1s"));v(a,6(d,h){b.U(h+c)});H b},3U:6(a){K b=J.V("1M",[]);I(1j b!="2m"&&b.U==N)b=[b];a:{a=a.1q();K c=3W 0;O(c=c=1Q.6c(c||0,0);c<b.L;c++)I(b[c]==a){b=c;1N a}b=-1}H b!=-1},2r:6(a,b,c){a=["1s","6i"+b,"P"+a,"6r"+(b%2==0?1:2).1q()];J.3U(b)&&a.U("67");b==0&&a.U("1N");H\'<T 1g="\'+a.1K(" ")+\'">\'+c+"</T>"},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i<d;i++){K k=b?b[i]:h+i,j;I(k==0)j=e.13.1W;Y{j=g;O(K l=k.1q();l.L<j;)l="0"+l;j=l}a=j;c+=J.2r(i,k,a)}H c},49:6(a,b){a=x(a);K c=a.1e("\\n");J.V("2z-1s-2t");K d=2u(J.V("2i-1s"));a="";O(K h=J.V("1D"),g=0;g<c.L;g++){K i=c[g],k=/^(&2s;|\\s)+/.X(i),j=N,l=b?b[g]:d+g;I(k!=N){j=k[0].1q();i=i.1o(j.L);j=j.Q(" ",e.13.1W)}i=x(i);I(i.L==0)i=e.13.1W;a+=J.2r(g,l,(j!=N?\'<17 1g="\'+h+\' 5N">\'+j+"</17>":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"</4a>":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i<b.L;i++){K k=b[i],j;I(!(k===N||k.L===0)){j=c(k);h+=u(a.1o(d,k.P-d),j+"48")+u(k.1T,j+k.23);d=k.P+k.L+(k.75||0)}}h+=u(a.1o(d),c()+"48");H h},1H:6(a){K b="",c=["20"],d;I(J.V("2k")==R)J.1n.16=J.1n.1u=11;1l="20";J.V("2l")==R&&c.U("47");I((1u=J.V("1u"))==11)c.U("6S");c.U(J.V("1g-27"));c.U(J.V("1D"));a=a.Q(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"").Q(/\\r/g," ");b=J.V("43-22");I(J.V("42-45")==R)a=n(a,b);Y{O(K h="",g=0;g<b;g++)h+=" ";a=a.Q(/\\t/g,h)}a=a;a:{b=a=a;h=/<2R\\s*\\/?>|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i<b.L&&g>0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i<b.L;i++)b[i]=b[i].1o(g);a=b.1K("\\n")}I(1u)d=J.4d(a);b=J.4c(J.2J,a);b=J.4b(a,b);b=J.49(b,d);I(J.V("41-40"))b=E(b);1j 2H!="1d"&&2H.3S&&2H.3S.1C(/5s/)&&c.U("5t");H b=\'<T 1c="\'+t(J.1c)+\'" 1g="\'+c.1K(" ")+\'">\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"</2d>":"")+\'<2d 1g="17"><T 1g="3O">\'+b+"</T></2d></3P></3T></3Z></T>"},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function() {return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6() {6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a<f.L;a++)I(f[a]===e)H a;H-1}M=6(f,e){K a=[],b=M.1B,c=0,d,h;I(M.1R(f)){I(e!==1d)1S 3m("2a\'t 5r 5I 5F 5B 5C 15 5E 5p");H r(f)}I(v)1S 2U("2a\'t W 3l M 59 5m 5g 5x 5i");e=e||"";O(d={2N:11,19:[],2K:6(g){H e.1i(g)>-1},3d:6(g){e+=g}};c<f.L;)I(h=B(f,c,b,d)){a.U(h.3k);c+=h.1C[0].L||1}Y I(h=n.X.W(z[b],f.1a(c))){a.U(h[0]);c+=h[0].L}Y{h=f.3a(c);I(h==="[")b=M.2I;Y I(h==="]")b=M.1B;a.U(h);c++}a=15(a.1K(""),n.Q.W(e,w,""));a.1w={1m:f,19:d.2N?d.19:N};H a};M.3v="1.5.0";M.2I=1;M.1B=2;K C=/\\$(?:(\\d\\d?|[$&`\'])|{([$\\w]+)})/g,w=/[^5h]+|([\\s\\S])(?=[\\s\\S]*\\1)/g,A=/^(?:[?*+]|{\\d+(?:,\\d*)?})\\??/,v=11,u=[],n={X:15.Z.X,1A:15.Z.1A,1C:1r.Z.1C,Q:1r.Z.Q,1e:1r.Z.1e},x=n.X.W(/()??/,"")[1]===1d,D=6() {K f=/^/g;n.1A.W(f,"");H!f.12}(),y=6() {K f=/x/g;n.Q.W("x",f,"");H!f.12}(),E=15.Z.3n!==1d,z={};z[M.2I]=/^(?:\\\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S]))/;z[M.1B]=/^(?:\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\\d*|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S])|\\(\\?[:=!]|[?*+]\\?|{\\d+(?:,\\d*)?}\\??)/;M.1h=6(f,e,a,b){u.U({2q:r(f,"g"+(E?"y":"")),2b:e,3r:a||M.1B,2p:b||N})};M.2n=6(f,e){K a=f+"/"+(e||"");H M.2n[a]||(M.2n[a]=M(f,e))};M.3c=6(f){H r(f,"g")};M.5l=6(f){H f.Q(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,"\\\\$&")};M.5e=6(f,e,a,b){e=r(e,"g"+(b&&E?"y":""));e.12=a=a||0;f=e.X(f);H b?f&&f.P===a?f:N:f};M.3q=6() {M.1h=6() {1S 2U("2a\'t 55 1h 54 3q")}};M.1R=6(f){H 53.Z.1q.W(f)==="[2m 15]"};M.3p=6(f,e,a,b){O(K c=r(e,"g"),d=-1,h;h=c.X(f);){a.W(b,h,++d,f,c);c.12===h.P&&c.12++}I(e.1J)e.12=0};M.57=6(f,e){H 6 a(b,c){K d=e[c].1I?e[c]:{1I:e[c]},h=r(d.1I,"g"),g=[],i;O(i=0;i<b.L;i++)M.3p(b[i],h,6(k){g.U(d.3j?k[d.3j]||"":k[0])});H c===e.L-1||!g.L?g:a(g,c+1)}([f],0)};15.Z.1p=6(f,e){H J.X(e[0])};15.Z.W=6(f,e){H J.X(e)};15.Z.X=6(f){K e=n.X.1p(J,14),a;I(e){I(!x&&e.L>1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6() {O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;b<e.L;b++)I(a=J.1w.19[b-1])e[a]=e[b];!D&&J.1J&&!e[0].L&&J.12>e.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6() {I(b){14[0]=1f 1r(14[0]);O(K d=0;d<b.L;d++)I(b[d])14[0][b[d]]=14[d+1]}I(a&&f.1J)f.12=14[14.L-2]+14[0].L;H e.1p(N,14)});Y{c=J+"";c=n.Q.W(c,f,6() {K d=14;H n.Q.W(e,C,6(h,g,i){I(g)5b(g){24"$":H"$";24"&":H d[0];24"`":H d[d.L-1].1a(0,d[d.L-2]);24"\'":H d[d.L-1].1a(d[d.L-2]+d[0].L);5a:i="";g=+g;I(!g)H h;O(;g>d.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P<a.L&&3b.Z.U.1p(b,d.1a(1));h=d[0].L;c=f.12;I(b.L>=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6() {J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6() {H J.2K("x")});M.1h(/\\./,6() {H"[\\\\s\\\\S]"},M.1B,6() {H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6() {6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a<d.L&&i==N;a++)i=p(d[a],b,c);H i}6 C(a,b){K c={},d;O(d 2g a)c[d]=a[d];O(d 2g b)c[d]=b[d];H c}6 w(a,b,c,d){6 h(g){g=g||1P.5y;I(!g.1F){g.1F=g.52;g.3N=6() {J.5w=11}}c.W(d||1P,g)}a.3g?a.3g("4U"+b,h):a.4y(b,h,11)}6 A(a,b){K c=e.1Y.2j,d=N;I(c==N){c={};O(K h 2g e.1U){K g=e.1U[h];d=g.4x;I(d!=N){g.1V=h.4w();O(g=0;g<d.L;g++)c[d[g]]=h}}e.1Y.2j=c}d=e.1U[c[a]];d==N&&b!=11&&1P.1X(e.13.1x.1X+(e.13.1x.3E+a));H d}6 v(a,b){O(K c=a.1e("\\n"),d=0;d<c.L;d++)c[d]=b(c[d],d);H c.1K("\\n")}6 u(a,b){I(a==N||a.L==0||a=="\\n")H a;a=a.Q(/</g,"&1y;");a=a.Q(/ {2,}/g,6(c){O(K d="",h=0;h<c.L-1;h++)d+=e.13.1W;H d+" "});I(b!=N)a=v(a,6(c){I(c.L==0)H"";K d="";c=c.Q(/^(&2s;| )+/,6(h){d=h;H""});I(c.L==0)H d;H d+\'<17 1g="\'+b+\'">\'+c+"</17>"});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.P<b.P)H-1;Y I(a.P>b.P)H 1;Y I(a.L<b.L)H-1;Y I(a.L>b.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'<a 2h="\'+c+\'">\'+c+"</a>"+d})}6 z() {O(K a=1E.36("1k"),b=[],c=0;c<a.L;c++)a[c].3s=="20"&&b.U(a[c]);H b}6 f(a){a=a.1F;K b=p(a,".20",R);a=p(a,".3O",R);K c=1E.4i("3t");I(!(!a||!b||p(a,"3t"))){B(b.1c);r(b,"1m");O(K d=a.3G,h=[],g=0;g<d.L;g++)h.U(d[g].4z||d[g].4A);h=h.1K("\\r");c.39(1E.4D(h));a.39(c);c.2C();c.4C();w(c,"4u",6() {c.2G.4E(c);b.1l=b.1l.Q("1m","")})}}I(1j 3F!="1d"&&1j M=="1d")M=3F("M").M;K e={2v:{"1g-27":"","2i-1s":1,"2z-1s-2t":11,1M:N,1t:N,"42-45":R,"43-22":4,1u:R,16:R,"3V-17":R,2l:11,"41-40":R,2k:11,"1z-1k":11},13:{1W:"&2s;",2M:R,46:11,44:11,34:"4n",1x:{21:"4o 1m",2P:"?",1X:"1v\\n\\n",3E:"4r\'t 4t 1D O: ",4g:"4m 4B\'t 51 O 1z-1k 4F: ",37:\'<!4T 1z 4S "-//4V//3H 4W 1.0 4Z//4Y" "1Z://2y.3L.3K/4X/3I/3H/3I-4P.4J"><1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v</1t></3J><3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;"><T 1L="2O-3D:3C;3w-32:1.6z;"><T 1L="25-22:6A-6E;">1v</T><T 1L="25-22:.6C;3w-6B:6R;"><T>3v 3.0.76 (72 73 3x)</T><T><a 2h="1Z://3u.2w/1v" 1F="38" 1L="2f:#3y">1Z://3u.2w/1v</a></T><T>70 17 6U 71.</T><T>6T 6X-3x 6Y 6D.</T></T><T>6t 61 60 J 1k, 5Z <a 2h="6u://2y.62.2w/63-66/65?64=5X-5W&5P=5O" 1L="2f:#3y">5R</a> 5V <2R/>5U 5T 5S!</T></T></3B></1z>\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'<T 1g="16">\',d=e.16.2x,h=d.2X,g=0;g<h.L;g++)c+=(d[h[g]].1H||b)(a,h[g]);c+="</T>";H c},2o:6(a,b,c){H\'<2W><a 2h="#" 1g="6e 6h\'+b+" "+b+\'">\'+c+"</a></2W>"},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6() {K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h<c.L;h++)d.U(c[h]);c=d}c=c;d=[];I(e.13.2M)c=c.1O(z());I(c.L===0)H d;O(h=0;h<c.L;h++){O(K g=c[h],i=a,k=c[h].1l,j=3W 0,l={},m=1f M("^\\\\[(?<2V>(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g<c.L;g++){b=c[g];K i=b.1F,k=b.1n,j=k.1D,l;I(j!=N){I(k["1z-1k"]=="R"||e.2v["1z-1k"]==R){d=1f e.4l(j);j="4O"}Y I(d=A(j))d=1f d;Y 6H;l=i.3X;I(h.2M){l=l;K m=x(l),s=11;I(m.1i("<![6G[")==0){m=m.4h(9);s=R}K o=m.L;I(m.1i("]]\\>")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6() {e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6() {H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;m<j.L;m++)j[m].P+=l}K c=A(a),d,h=1f e.1U.5Y,g=J,i="2F 1H 2Q".1e(" ");I(c!=N){d=1f c;O(K k=0;k<i.L;k++)(6() {K j=i[k];g[j]=6() {H h[j].1p(h,14)}})();d.28==N?1P.1X(e.13.1x.1X+(e.13.1x.4g+a)):h.2J.U({1I:d.28.17,2D:6(j){O(K l=j.17,m=[],s=d.2J,o=j.P+j.18.L,F=d.28,q,G=0;G<s.L;G++){q=y(l,s[G]);b(q,o);m=m.1O(q)}I(F.18!=N&&j.18!=N){q=y(j.18,F.18);b(q,j.P);m=m.1O(q)}I(F.1b!=N&&j.1b!=N){q=y(j.1b,F.1b);b(q,j.P+j[0].5Q(j.1b));m=m.1O(q)}O(j=0;j<m.L;j++)m[j].1V=c.1V;H m}})}};e.4j=6() {};e.4j.Z={V:6(a,b){K c=J.1n[a];c=c==N?b:c;K d={"R":R,"11":11}[c];H d==N?c:d},3Y:6(a){H 1E.4i(a)},4c:6(a,b){K c=[];I(a!=N)O(K d=0;d<a.L;d++)I(1j a[d]=="2m")c=c.1O(y(b,a[d]));H J.4e(c.6b(D))},4e:6(a){O(K b=0;b<a.L;b++)I(a[b]!==N)O(K c=a[b],d=c.P+c.L,h=b+1;h<a.L&&a[b]!==N;h++){K g=a[h];I(g!==N)I(g.P>d)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P<d)a[h]=N}H a},4d:6(a){K b=[],c=2u(J.V("2i-1s"));v(a,6(d,h){b.U(h+c)});H b},3U:6(a){K b=J.V("1M",[]);I(1j b!="2m"&&b.U==N)b=[b];a:{a=a.1q();K c=3W 0;O(c=c=1Q.6c(c||0,0);c<b.L;c++)I(b[c]==a){b=c;1N a}b=-1}H b!=-1},2r:6(a,b,c){a=["1s","6i"+b,"P"+a,"6r"+(b%2==0?1:2).1q()];J.3U(b)&&a.U("67");b==0&&a.U("1N");H\'<T 1g="\'+a.1K(" ")+\'">\'+c+"</T>"},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i<d;i++){K k=b?b[i]:h+i,j;I(k==0)j=e.13.1W;Y{j=g;O(K l=k.1q();l.L<j;)l="0"+l;j=l}a=j;c+=J.2r(i,k,a)}H c},49:6(a,b){a=x(a);K c=a.1e("\\n");J.V("2z-1s-2t");K d=2u(J.V("2i-1s"));a="";O(K h=J.V("1D"),g=0;g<c.L;g++){K i=c[g],k=/^(&2s;|\\s)+/.X(i),j=N,l=b?b[g]:d+g;I(k!=N){j=k[0].1q();i=i.1o(j.L);j=j.Q(" ",e.13.1W)}i=x(i);I(i.L==0)i=e.13.1W;a+=J.2r(g,l,(j!=N?\'<17 1g="\'+h+\' 5N">\'+j+"</17>":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"</4a>":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i<b.L;i++){K k=b[i],j;I(!(k===N||k.L===0)){j=c(k);h+=u(a.1o(d,k.P-d),j+"48")+u(k.1T,j+k.23);d=k.P+k.L+(k.75||0)}}h+=u(a.1o(d),c()+"48");H h},1H:6(a){K b="",c=["20"],d;I(J.V("2k")==R)J.1n.16=J.1n.1u=11;1l="20";J.V("2l")==R&&c.U("47");I((1u=J.V("1u"))==11)c.U("6S");c.U(J.V("1g-27"));c.U(J.V("1D"));a=a.Q(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"").Q(/\\r/g," ");b=J.V("43-22");I(J.V("42-45")==R)a=n(a,b);Y{O(K h="",g=0;g<b;g++)h+=" ";a=a.Q(/\\t/g,h)}a=a;a:{b=a=a;h=/<2R\\s*\\/?>|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i<b.L&&g>0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i<b.L;i++)b[i]=b[i].1o(g);a=b.1K("\\n")}I(1u)d=J.4d(a);b=J.4c(J.2J,a);b=J.4b(a,b);b=J.49(b,d);I(J.V("41-40"))b=E(b);1j 2H!="1d"&&2H.3S&&2H.3S.1C(/5s/)&&c.U("5t");H b=\'<T 1c="\'+t(J.1c)+\'" 1g="\'+c.1K(" ")+\'">\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"</2d>":"")+\'<2d 1g="17"><T 1g="3O">\'+b+"</T></2d></3P></3T></3Z></T>"},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
diff --git a/docs/src/writer.js b/docs/src/writer.js
index 85d797ea..e5dff59f 100644
--- a/docs/src/writer.js
+++ b/docs/src/writer.js
@@ -18,7 +18,7 @@ exports.output = function(file, content) {
};
//recursively create directory
-exports.makeDir = function (path) {
+exports.makeDir = function(path) {
var parts = path.split(/\//);
var path = ".";
//Sequentially create directories
@@ -99,7 +99,7 @@ function merge(srcs, to) {
var contents = [];
//Sequentially read file
var done;
- srcs.forEach(function (src) {
+ srcs.forEach(function(src) {
done = Q.when(done, function(content) {
if(content) contents.push(content);
return qfs.read(src, 'b');
@@ -128,7 +128,7 @@ exports.toString = function toString(obj) {
return obj;
case 'object':
if (obj instanceof Array) {
- obj.forEach(function (value, key) {
+ obj.forEach(function(value, key) {
obj[key] = toString(value);
});
return obj.join('');
@@ -140,4 +140,4 @@ exports.toString = function toString(obj) {
};
-function noop(){};
+function noop() {};
diff --git a/example/buzz/buzz.js b/example/buzz/buzz.js
index 40813d16..3f29d300 100644
--- a/example/buzz/buzz.js
+++ b/example/buzz/buzz.js
@@ -8,11 +8,11 @@ angular.service('myApplication', function($resource){
});
}, {inject:['$resource']});
-function BuzzController(){
+function BuzzController() {
this.$watch('$location.hashPath', this.userChange);
}
BuzzController.prototype = {
- userChange: function(){
+ userChange: function() {
this.userId = this.$location.hashPath;
this.activities = this.Activity.get({userId:this.userId});
},
@@ -22,7 +22,7 @@ BuzzController.prototype = {
if (activity.replies) {
activity.replies.show = !activity.replies.show;
} else {
- activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}, function(){
+ activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}, function() {
activity.replies.show = true;
});
}
diff --git a/example/personalLog/scenario/personalLogScenario.js b/example/personalLog/scenario/personalLogScenario.js
index 5baeeb1a..fe6388b4 100644
--- a/example/personalLog/scenario/personalLogScenario.js
+++ b/example/personalLog/scenario/personalLogScenario.js
@@ -10,7 +10,7 @@ describe('personal log', function() {
});
- it('should create new logs and order them in reverse chronological order', function(){
+ it('should create new logs and order them in reverse chronological order', function() {
//create first msg
input('newMsg').enter('my first message');
element('form input[type="submit"]').click();
diff --git a/example/tweeter/tweeterclient.js b/example/tweeter/tweeterclient.js
index 84fc5ef7..9ad7eabc 100644
--- a/example/tweeter/tweeterclient.js
+++ b/example/tweeter/tweeterclient.js
@@ -1,7 +1,7 @@
-function noop(){}
-$(document).ready(function(){
+function noop() {}
+$(document).ready(function() {
function xhr(method, url, data, callback){
- jQuery.getJSON(url, function(){
+ jQuery.getJSON(url, function() {
callback.apply(this, arguments);
scope.updateView();
});
diff --git a/gdocs.js b/gdocs.js
index c02f4dcb..31377df2 100755
--- a/gdocs.js
+++ b/gdocs.js
@@ -36,7 +36,7 @@ if (flag == '--login') {
help();
}
-function help(){
+function help() {
console.log('Synopsys');
console.log('gdocs.js --login <username>');
console.log('gdocs.js --fetch [<docs collection>]');
@@ -141,7 +141,7 @@ function login(username, password){
);
}
-function getAuthToken(){
+function getAuthToken() {
var pwdFile = 'tmp/gdocs.auth';
try {
fs.statSync(pwdFile);
@@ -164,10 +164,10 @@ function request(method, url, options, response) {
case 200:
var data = [];
res.setEncoding('utf8');
- res.on('end', function (){ response(data.join('')); });
- res.on('close', function (){ response(data.join('')); }); // https
+ res.on('end', function () { response(data.join('')); });
+ res.on('close', function () { response(data.join('')); }); // https
res.on('data', function (chunk) { data.push(chunk); });
- res.on('error', function (e){ console.log(e); });
+ res.on('error', function (e) { console.log(e); });
break;
case 401:
console.log('Eror: Login credentials expired! Please login.');
@@ -190,7 +190,7 @@ function request(method, url, options, response) {
}
if (options.data)
request.write(encodeData(options.data));
- request.on('end', function(){
+ request.on('end', function() {
console.log('end');
});
request.end();
@@ -212,7 +212,7 @@ function askPassword(callback) {
console.log('Enter your password:');
var password = "";
- stdin.on("data", function (c) {
+ stdin.on("data", function(c) {
c = c + "";
switch (c) {
case "\n": case "\r": case "\u0004":
@@ -236,7 +236,7 @@ function reflow(text, margin) {
text.split(/\n/).forEach(function(line) {
var col = 0;
var reflowLine = '';
- function flush(){
+ function flush() {
reflowLine = reflowLine.replace(/\s*$/, '');
lines.push(reflowLine);
reflowLine = '';
diff --git a/i18n/locale/angular-locale_am-et.js b/i18n/locale/angular-locale_am-et.js
index 2b72d8fd..4e556020 100644
--- a/i18n/locale/angular-locale_am-et.js
+++ b/i18n/locale/angular-locale_am-et.js
@@ -1,4 +1,4 @@
angular.service("$locale", function() {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
-return {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4","posSuf":"","negPre":"(\u00A4","negSuf":")","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"Br"},"pluralCat":function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር"],"SHORTMONTH":["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም"],"DAY":["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],"SHORTDAY":["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],"AMPMS":["ጡዋት","ከሳዓት"],"medium":"d MMM y h:mm:ss a","short":"dd/MM/yyyy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"dd/MM/yyyy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"am-et"};
+return {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4","posSuf":"","negPre":"(\u00A4","negSuf":")","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"Br"},"pluralCat":function(n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር"],"SHORTMONTH":["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም"],"DAY":["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],"SHORTDAY":["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],"AMPMS":["ጡዋት","ከሳዓት"],"medium":"d MMM y h:mm:ss a","short":"dd/MM/yyyy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"dd/MM/yyyy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"am-et"};
}); \ No newline at end of file
diff --git a/perf/MiscPerf.js b/perf/MiscPerf.js
index c1d71cbd..98d51a9f 100644
--- a/perf/MiscPerf.js
+++ b/perf/MiscPerf.js
@@ -1,20 +1,20 @@
-describe('perf misc', function(){
- it('operation speeds', function(){
+describe('perf misc', function() {
+ it('operation speeds', function() {
perf(
- function typeByTypeof(){ return typeof noop == 'function'; }, // WINNER
+ function typeByTypeof() { return typeof noop == 'function'; }, // WINNER
function typeByProperty() { return noop.apply && noop.call; },
function typeByConstructor() { return noop.constructor == Function; }
);
});
- it('property access', function(){
+ it('property access', function() {
var name = 'value';
var none = 'x';
var scope = {};
perf(
- function direct(){ return scope.value; }, // WINNER
+ function direct() { return scope.value; }, // WINNER
function byName() { return scope[name]; },
- function undefinedDirect(){ return scope.x; },
+ function undefinedDirect() { return scope.x; },
function undefiendByName() { return scope[none]; }
);
});
diff --git a/src/Angular.js b/src/Angular.js
index 7c218c6e..9b651fce 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -14,7 +14,7 @@ if (typeof document.getAttribute == $undefined)
* @param {string} string String to be converted to lowercase.
* @returns {string} Lowercased string.
*/
-var lowercase = function (string){ return isString(string) ? string.toLowerCase() : string; };
+var lowercase = function(string){ return isString(string) ? string.toLowerCase() : string; };
/**
@@ -26,17 +26,17 @@ var lowercase = function (string){ return isString(string) ? string.toLowerCase(
* @param {string} string String to be converted to uppercase.
* @returns {string} Uppercased string.
*/
-var uppercase = function (string){ return isString(string) ? string.toUpperCase() : string; };
+var uppercase = function(string){ return isString(string) ? string.toUpperCase() : string; };
-var manualLowercase = function (s) {
+var manualLowercase = function(s) {
return isString(s)
- ? s.replace(/[A-Z]/g, function (ch) {return fromCharCode(ch.charCodeAt(0) | 32); })
+ ? s.replace(/[A-Z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) | 32); })
: s;
};
-var manualUppercase = function (s) {
+var manualUppercase = function(s) {
return isString(s)
- ? s.replace(/[a-z]/g, function (ch) {return fromCharCode(ch.charCodeAt(0) & ~32); })
+ ? s.replace(/[a-z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) & ~32); })
: s;
};
@@ -239,7 +239,7 @@ function extend(dst) {
function inherit(parent, extra) {
- return extend(new (extend(function(){}, {prototype:parent}))(), extra);
+ return extend(new (extend(function() {}, {prototype:parent}))(), extra);
}
@@ -279,11 +279,11 @@ function noop() {}
function identity($) {return $;}
-function valueFn(value) {return function(){ return value; };}
+function valueFn(value) {return function() { return value; };}
function extensionMap(angular, name, transform) {
var extPoint;
- return angular[name] || (extPoint = angular[name] = function (name, fn, prop){
+ return angular[name] || (extPoint = angular[name] = function(name, fn, prop){
name = (transform || identity)(name);
if (isDefined(fn)) {
extPoint[name] = extend(fn, prop || {});
@@ -604,12 +604,12 @@ function isLeafNode (node) {
* <doc:example>
* <doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.master = {
salutation: 'Hello',
name: 'world'
};
- this.copy = function (){
+ this.copy = function() {
this.form = angular.copy(this.master);
}
}
@@ -709,7 +709,7 @@ function copy(source, destination){
* <doc:example>
* <doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.master = {
salutation: 'Hello',
name: 'world'
@@ -969,7 +969,7 @@ function angularJsConfig(document) {
return config;
}
-function bindJQuery(){
+function bindJQuery() {
// bind to jQuery if present;
jQuery = window.jQuery;
// reset to jQuery or default to us.
diff --git a/src/Browser.js b/src/Browser.js
index 77d1c684..e45c7042 100644
--- a/src/Browser.js
+++ b/src/Browser.js
@@ -3,7 +3,7 @@
//////////////////////////////
// Browser
//////////////////////////////
-var XHR = window.XMLHttpRequest || function () {
+var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
@@ -56,7 +56,7 @@ function Browser(window, document, body, XHR, $log, $sniffer) {
/**
- * Executes the `fn` function (supports currying) and decrements the `outstandingRequestCallbacks`
+ * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
* counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
*/
function completeOutstandingRequest(fn) {
@@ -322,7 +322,7 @@ function Browser(window, document, body, XHR, $log, $sniffer) {
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
- self.cookies = function (name, value) {
+ self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, keyValue, index;
if (name) {
diff --git a/src/Injector.js b/src/Injector.js
index 0e0fddf6..d6cf15c2 100644
--- a/src/Injector.js
+++ b/src/Injector.js
@@ -44,7 +44,7 @@ function createInjector(factoryScope, factories, instanceCache) {
factoryScope = factoryScope || {};
injector.invoke = invoke;
- injector.eager = function(){
+ injector.eager = function() {
forEach(factories, function(factory, name){
if (factory.$eager)
injector(name);
diff --git a/src/Resource.js b/src/Resource.js
index 045ab3a2..959561e4 100644
--- a/src/Resource.js
+++ b/src/Resource.js
@@ -67,7 +67,7 @@ ResourceFactory.prototype = {
forEach(actions, function(action, name){
var isPostOrPut = action.method == 'POST' || action.method == 'PUT';
- Resource[name] = function (a1, a2, a3, a4) {
+ Resource[name] = function(a1, a2, a3, a4) {
var params = {};
var data;
var success = noop;
diff --git a/src/Scope.js b/src/Scope.js
index e4fc0622..be5030cc 100644
--- a/src/Scope.js
+++ b/src/Scope.js
@@ -50,7 +50,7 @@ function createScope(providers, instanceCache) {
expect(scope.greeting).toEqual(undefined);
- scope.$watch('name', function(){
+ scope.$watch('name', function() {
this.greeting = this.salutation + ' ' + this.name + '!';
}); // initialize the watch
@@ -584,7 +584,7 @@ Scope.prototype = {
event = {
name: name,
targetScope: scope,
- cancel: function(){canceled = true;}
+ cancel: function() {canceled = true;}
},
listenerArgs = concat([event], arguments, 1),
i, length;
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index 731c2c29..86f1b46f 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -146,7 +146,7 @@ function MockBrowser() {
if (!expectation) {
throw new Error("Unexpected request for method '" + method + "' and url '" + url + "'.");
}
- requests.push(function(){
+ requests.push(function() {
angular.forEach(expectation.headers, function(value, key){
if (headers[key] !== value) {
throw new Error("Missing HTTP request header: " + key + ": " + value);
@@ -317,7 +317,7 @@ MockBrowser.prototype = {
* @description
* run all fns in pollFns
*/
- poll: function poll(){
+ poll: function poll() {
angular.forEach(this.pollFns, function(pollFn){
pollFn();
});
@@ -356,10 +356,10 @@ MockBrowser.prototype = {
}
},
- addJs: function(){}
+ addJs: function() {}
};
-angular.service('$browser', function(){
+angular.service('$browser', function() {
return new MockBrowser();
});
@@ -397,10 +397,10 @@ angular.service('$log', MockLogFactory);
function MockLogFactory() {
var $log = {
- log: function(){ $log.log.logs.push(arguments); },
- warn: function(){ $log.warn.logs.push(arguments); },
- info: function(){ $log.info.logs.push(arguments); },
- error: function(){ $log.error.logs.push(arguments); }
+ log: function() { $log.log.logs.push(arguments); },
+ warn: function() { $log.warn.logs.push(arguments); },
+ info: function() { $log.info.logs.push(arguments); },
+ error: function() { $log.error.logs.push(arguments); }
};
$log.log.logs = [];
diff --git a/src/angular.suffix b/src/angular.suffix
index 179e0ce6..e8bb83b7 100644
--- a/src/angular.suffix
+++ b/src/angular.suffix
@@ -1,5 +1,5 @@
- jqLiteWrap(document).ready(function(){
+ jqLiteWrap(document).ready(function() {
angularInit(angularJsConfig(document), document);
});
diff --git a/src/apis.js b/src/apis.js
index 6a5bf6c4..c9b2a99f 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -104,7 +104,7 @@ var angularArray = {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.books = ['Moby Dick', 'Great Gatsby', 'Romeo and Juliet'];
this.bookName = 'Romeo and Juliet';
}
@@ -154,7 +154,7 @@ var angularArray = {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.invoice = {
items:[ {
qty:10,
@@ -400,7 +400,7 @@ var angularArray = {
case "object":
for (var key in expression) {
if (key == '$') {
- (function(){
+ (function() {
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
@@ -408,7 +408,7 @@ var angularArray = {
});
})();
} else {
- (function(){
+ (function() {
var path = key;
var text = (''+expression[key]).toLowerCase();
if (!text) return;
@@ -462,7 +462,7 @@ var angularArray = {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.people = [];
}
</script>
@@ -612,7 +612,7 @@ var angularArray = {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.friends =
[{name:'John', phone:'555-1212', age:10},
{name:'Mary', phone:'555-9876', age:19},
@@ -738,7 +738,7 @@ var angularArray = {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.numbers = [1,2,3,4,5,6,7,8,9];
this.limit = 3;
}
@@ -939,7 +939,7 @@ HashMap.prototype = {
* A map where multiple values can be added to the same key such that the form a queue.
* @returns {HashQueueMap}
*/
-function HashQueueMap(){}
+function HashQueueMap() {}
HashQueueMap.prototype = {
/**
* Same as array push, but using an array as the value for the hash
diff --git a/src/directives.js b/src/directives.js
index 852d04cd..b1502f54 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -61,7 +61,7 @@
</div>
</doc:source>
<doc:scenario>
- it('should check greeting', function(){
+ it('should check greeting', function() {
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});
@@ -115,10 +115,10 @@ angularDirective("ng:init", function(expression){
{type:'email', value:'john.smith@example.org'} ];
}
SettingsController.prototype = {
- greet: function(){
+ greet: function() {
alert(this.name);
},
- addContact: function(){
+ addContact: function() {
this.contacts.push({type:'email', value:'yourname@example.org'});
},
removeContact: function(contactToRemove) {
@@ -149,7 +149,7 @@ angularDirective("ng:init", function(expression){
</div>
</doc:source>
<doc:scenario>
- it('should check controller', function(){
+ it('should check controller', function() {
expect(element('.doc-example-live div>:input').val()).toBe('John Smith');
expect(element('.doc-example-live li:nth-child(1) input').val())
.toBe('408 555 1212');
@@ -199,7 +199,7 @@ angularDirective("ng:controller", function(expression){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.name = 'Whirled';
}
</script>
@@ -209,7 +209,7 @@ angularDirective("ng:controller", function(expression){
</div>
</doc:source>
<doc:scenario>
- it('should check ng:bind', function(){
+ it('should check ng:bind', function() {
expect(using('.doc-example-live').binding('name')).toBe('Whirled');
using('.doc-example-live').input('name').enter('world');
expect(using('.doc-example-live').binding('name')).toBe('world');
@@ -326,7 +326,7 @@ function compileBindTemplate(template){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.salutation = 'Hello';
this.name = 'World';
}
@@ -338,7 +338,7 @@ function compileBindTemplate(template){
</div>
</doc:source>
<doc:scenario>
- it('should check ng:bind', function(){
+ it('should check ng:bind', function() {
expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).
toBe('Hello World!');
using('.doc-example-live').input('salutation').enter('Greetings');
@@ -402,7 +402,7 @@ angularDirective("ng:bind-template", function(expression, element){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.query = 'AngularJS';
}
</script>
@@ -413,7 +413,7 @@ angularDirective("ng:bind-template", function(expression, element){
</div>
</doc:source>
<doc:scenario>
- it('should check ng:bind-attr', function(){
+ it('should check ng:bind-attr', function() {
expect(using('.doc-example-live').element('a').attr('href')).
toBe('http://www.google.com/search?q=AngularJS');
using('.doc-example-live').input('query').enter('google');
@@ -471,7 +471,7 @@ angularDirective("ng:bind-attr", function(expression){
count: {{count}}
</doc:source>
<doc:scenario>
- it('should check ng:click', function(){
+ it('should check ng:click', function() {
expect(binding('count')).toBe('0');
element('.doc-example-live :button').click();
expect(binding('count')).toBe('1');
@@ -516,10 +516,10 @@ angularDirective("ng:click", function(expression, element){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.list = [];
this.text = 'hello';
- this.submit = function(){
+ this.submit = function() {
this.list.push(this.text);
this.text = '';
};
@@ -533,7 +533,7 @@ angularDirective("ng:click", function(expression, element){
</form>
</doc:source>
<doc:scenario>
- it('should check ng:submit', function(){
+ it('should check ng:submit', function() {
expect(binding('list')).toBe('list=[]');
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('list=["hello"]');
@@ -592,7 +592,7 @@ function ngClass(selector) {
<span ng:class="myVar">Sample Text &nbsp;&nbsp;&nbsp;&nbsp;</span>
</doc:source>
<doc:scenario>
- it('should check ng:class', function(){
+ it('should check ng:class', function() {
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-input-indicator-wait/);
@@ -609,7 +609,7 @@ function ngClass(selector) {
</doc:scenario>
</doc:example>
*/
-angularDirective("ng:class", ngClass(function(){return true;}));
+angularDirective("ng:class", ngClass(function() {return true;}));
/**
* @workInProgress
@@ -641,7 +641,7 @@ angularDirective("ng:class", ngClass(function(){return true;}));
</ol>
</doc:source>
<doc:scenario>
- it('should check ng:class-odd and ng:class-even', function(){
+ it('should check ng:class-odd and ng:class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
expect(element('.doc-example-live li:last span').prop('className')).
@@ -682,7 +682,7 @@ angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;}));
</ol>
</doc:source>
<doc:scenario>
- it('should check ng:class-odd and ng:class-even', function(){
+ it('should check ng:class-odd and ng:class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
expect(element('.doc-example-live li:last span').prop('className')).
@@ -714,7 +714,7 @@ angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;}));
Hide: <span ng:hide="checked">I hide when your checkbox is checked.</span>
</doc:source>
<doc:scenario>
- it('should check ng:show / ng:hide', function(){
+ it('should check ng:show / ng:hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
@@ -755,7 +755,7 @@ angularDirective("ng:show", function(expression, element){
Hide: <span ng:hide="checked">I hide when you checkbox is checked?</span>
</doc:source>
<doc:scenario>
- it('should check ng:show / ng:hide', function(){
+ it('should check ng:show / ng:hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
@@ -798,7 +798,7 @@ angularDirective("ng:hide", function(expression, element){
<pre>myStyle={{myStyle}}</pre>
</doc:source>
<doc:scenario>
- it('should check ng:style', function(){
+ it('should check ng:style', function() {
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
element('.doc-example-live :button[value=set]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');
diff --git a/src/filters.js b/src/filters.js
index 0fcd442b..e4ee7453 100644
--- a/src/filters.js
+++ b/src/filters.js
@@ -49,7 +49,7 @@
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.amount = 1234.56;
}
</script>
@@ -60,11 +60,11 @@
</div>
</doc:source>
<doc:scenario>
- it('should init with 1234.56', function(){
+ it('should init with 1234.56', function() {
expect(binding('amount | currency')).toBe('$1,234.56');
expect(binding('amount | currency:"USD$"')).toBe('USD$1,234.56');
});
- it('should update', function(){
+ it('should update', function() {
input('amount').enter('-1234');
expect(binding('amount | currency')).toBe('($1,234.00)');
expect(binding('amount | currency:"USD$"')).toBe('(USD$1,234.00)');
@@ -101,7 +101,7 @@ angularFilter.currency = function(amount, currencySymbol){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.val = 1234.56789;
}
</script>
@@ -113,13 +113,13 @@ angularFilter.currency = function(amount, currencySymbol){
</div>
</doc:source>
<doc:scenario>
- it('should format numbers', function(){
+ it('should format numbers', function() {
expect(binding('val | number')).toBe('1,234.568');
expect(binding('val | number:0')).toBe('1,235');
expect(binding('-val | number:4')).toBe('-1,234.5679');
});
- it('should update', function(){
+ it('should update', function() {
input('val').enter('3374.333');
expect(binding('val | number')).toBe('3,374.333');
expect(binding('val | number:0')).toBe('3,374');
@@ -336,7 +336,7 @@ var GET_TIME_ZONE = /[A-Z]{3}(?![+\-])/,
{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br/>
</doc:source>
<doc:scenario>
- it('should format date', function(){
+ it('should format date', function() {
expect(binding("1288323623006 | date:'medium'")).
toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
expect(binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).
@@ -477,7 +477,7 @@ angularFilter.uppercase = uppercase;
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
@@ -515,7 +515,7 @@ angularFilter.uppercase = uppercase;
</div>
</doc:source>
<doc:scenario>
- it('should sanitize the html snippet ', function(){
+ it('should sanitize the html snippet ', function() {
expect(using('#html-filter').binding('snippet | html')).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
@@ -534,7 +534,7 @@ angularFilter.uppercase = uppercase;
"snippet</p>");
});
- it('should update', function(){
+ it('should update', function() {
input('snippet').enter('new <b>text</b>');
expect(using('#html-filter').binding('snippet | html')).toBe('new <b>text</b>');
expect(using('#escaped-html').binding('snippet')).toBe("new &lt;b&gt;text&lt;/b&gt;");
@@ -565,7 +565,7 @@ angularFilter.html = function(html, option){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.snippet =
'Pretty text with some links:\n'+
'http://angularjs.org/,\n'+
@@ -599,7 +599,7 @@ angularFilter.html = function(html, option){
</table>
</doc:source>
<doc:scenario>
- it('should linkify the snippet with urls', function(){
+ it('should linkify the snippet with urls', function() {
expect(using('#linky-filter').binding('snippet | linky')).
toBe('Pretty text with some links:\n' +
'<a href="http://angularjs.org/">http://angularjs.org/</a>,\n' +
@@ -617,7 +617,7 @@ angularFilter.html = function(html, option){
"and one more: ftp://127.0.0.1/.");
});
- it('should update', function(){
+ it('should update', function() {
input('snippet').enter('new http://link.');
expect(using('#linky-filter').binding('snippet | linky')).
toBe('new <a href="http://link">http://link</a>.');
diff --git a/src/jqLite.js b/src/jqLite.js
index 0052055c..e14eb127 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -459,7 +459,7 @@ forEach({
if (!eventHandler) {
bind[type] = eventHandler = function(event) {
if (!event.preventDefault) {
- event.preventDefault = function(){
+ event.preventDefault = function() {
event.returnValue = false; //ie
};
}
diff --git a/src/parser.js b/src/parser.js
index 4934b9e6..ecdc25b9 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -142,7 +142,7 @@ function lex(text, parseStringsForObjects){
}
number = 1 * number;
tokens.push({index:start, text:number, json:true,
- fn:function(){return number;}});
+ fn:function() {return number;}});
}
function readIdent() {
var ident = "";
@@ -200,7 +200,7 @@ function lex(text, parseStringsForObjects){
} else if (ch == quote) {
index++;
tokens.push({index:start, text:rawString, string:string, json:true,
- fn:function(){
+ fn:function() {
return (string.length == dateParseLength)
? angular['String']['toDate'](string)
: string;
@@ -239,7 +239,7 @@ function parser(text, json){
filterChain =
functionIdent =
pipeFunction =
- function (){ throwError("is not valid json", {text:text, index:0}); };
+ function() { throwError("is not valid json", {text:text, index:0}); };
}
//TODO: Shouldn't all of the public methods have assertAllConsumed?
//TODO: I think these should be public as part of the parser api instead of scope.$eval().
@@ -251,7 +251,7 @@ function parser(text, json){
};
function assertConsumed(fn) {
- return function(){
+ return function() {
var value = fn();
if (tokens.length !== 0) {
throwError("is an unexpected token", tokens[0]);
@@ -320,7 +320,7 @@ function parser(text, json){
return tokens.length > 0;
}
- function statements(){
+ function statements() {
var statements = [];
while(true) {
if (tokens.length > 0 && !peek('}', ')', ';', ']'))
@@ -330,7 +330,7 @@ function parser(text, json){
// TODO(size): maybe we should not support multiple statements?
return statements.length == 1
? statements[0]
- : function (self){
+ : function(self){
var value;
for ( var i = 0; i < statements.length; i++) {
var statement = statements[i];
@@ -343,7 +343,7 @@ function parser(text, json){
}
}
- function _filterChain(){
+ function _filterChain() {
var left = expression();
var token;
while(true) {
@@ -355,7 +355,7 @@ function parser(text, json){
}
}
- function filter(){
+ function filter() {
return pipeFunction(angularFilter);
}
@@ -374,18 +374,18 @@ function parser(text, json){
}
return fn.apply(self, args);
};
- return function(){
+ return function() {
return fnInvoke;
};
}
}
}
- function expression(){
+ function expression() {
return assignment();
}
- function _assignment(){
+ function _assignment() {
var left = logicalOR();
var right;
var token;
@@ -403,7 +403,7 @@ function parser(text, json){
}
}
- function logicalOR(){
+ function logicalOR() {
var left = logicalAND();
var token;
while(true) {
@@ -415,7 +415,7 @@ function parser(text, json){
}
}
- function logicalAND(){
+ function logicalAND() {
var left = equality();
var token;
if ((token = expect('&&'))) {
@@ -424,7 +424,7 @@ function parser(text, json){
return left;
}
- function equality(){
+ function equality() {
var left = relational();
var token;
if ((token = expect('==','!='))) {
@@ -433,7 +433,7 @@ function parser(text, json){
return left;
}
- function relational(){
+ function relational() {
var left = additive();
var token;
if ((token = expect('<', '>', '<=', '>='))) {
@@ -442,7 +442,7 @@ function parser(text, json){
return left;
}
- function additive(){
+ function additive() {
var left = multiplicative();
var token;
while ((token = expect('+','-'))) {
@@ -451,7 +451,7 @@ function parser(text, json){
return left;
}
- function multiplicative(){
+ function multiplicative() {
var left = unary();
var token;
while ((token = expect('*','/','%'))) {
@@ -460,7 +460,7 @@ function parser(text, json){
return left;
}
- function unary(){
+ function unary() {
var token;
if (expect('+')) {
return primary();
@@ -524,7 +524,7 @@ function parser(text, json){
function _fieldAccess(object) {
var field = expect().text;
var getter = getterFn(field);
- return extend(function (self){
+ return extend(function(self){
return getter(object(self));
}, {
assign:function(self, value){
@@ -537,7 +537,7 @@ function parser(text, json){
var indexFn = expression();
consume(']');
return extend(
- function (self){
+ function(self){
var o = obj(self);
var i = indexFn(self);
return (o) ? o[i] : undefined;
@@ -556,7 +556,7 @@ function parser(text, json){
} while (expect(','));
}
consume(')');
- return function (self){
+ return function(self){
var args = [];
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self));
@@ -578,7 +578,7 @@ function parser(text, json){
} while (expect(','));
}
consume(']');
- return function (self){
+ return function(self){
var array = [];
for ( var i = 0; i < elementFns.length; i++) {
array.push(elementFns[i](self));
@@ -599,7 +599,7 @@ function parser(text, json){
} while (expect(','));
}
consume('}');
- return function (self){
+ return function(self){
var object = {};
for ( var i = 0; i < keyValues.length; i++) {
var keyValue = keyValues[i];
@@ -721,7 +721,7 @@ function getterFn(path) {
});
code += 'return s;';
fn = Function('s', code);
- fn["toString"] = function(){ return code; };
+ fn["toString"] = function() { return code; };
return getterFnCache[path] = fn;
}
diff --git a/src/sanitizer.js b/src/sanitizer.js
index da629c7a..eb8ed344 100644
--- a/src/sanitizer.js
+++ b/src/sanitizer.js
@@ -67,7 +67,7 @@ var validAttrs = extend({}, uriAttrs, makeMap(
*/
function htmlParser( html, handler ) {
var index, chars, match, stack = [], last = html;
- stack.last = function(){ return stack[ stack.length - 1 ]; };
+ stack.last = function() { return stack[ stack.length - 1 ]; };
while ( html ) {
chars = true;
diff --git a/src/scenario/Scenario.js b/src/scenario/Scenario.js
index 53be6c67..8d34bd0e 100644
--- a/src/scenario/Scenario.js
+++ b/src/scenario/Scenario.js
@@ -96,7 +96,7 @@ angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
*
* @param {Object=} config Config options
*/
-angular.scenario.setUpAndRun = function (config) {
+angular.scenario.setUpAndRun = function(config) {
var href = window.location.href;
var body = _jQuery(document.body);
var output = [];
diff --git a/src/scenario/angular-bootstrap.js b/src/scenario/angular-bootstrap.js
index 250d2845..35a98bda 100644
--- a/src/scenario/angular-bootstrap.js
+++ b/src/scenario/angular-bootstrap.js
@@ -1,7 +1,7 @@
'use strict';
(function(previousOnLoad){
- var prefix = (function(){
+ var prefix = (function() {
var filename = /(.*\/)angular-bootstrap.js(#(.*))?/;
var scripts = document.getElementsByTagName("script");
for(var j = 0; j < scripts.length; j++) {
@@ -21,7 +21,7 @@
document.write('<link rel="stylesheet" type="text/css" href="' + prefix + path + '"/>');
}
- window.onload = function(){
+ window.onload = function() {
try {
if (previousOnLoad) previousOnLoad();
} catch(e) {}
diff --git a/src/service/cookies.js b/src/service/cookies.js
index 220a6ed5..c02fd8a8 100644
--- a/src/service/cookies.js
+++ b/src/service/cookies.js
@@ -45,7 +45,7 @@ angularServiceInject('$cookies', function($browser) {
/**
* Pushes all the cookies from the service to the browser and verifies if all cookies were stored.
*/
- function push(){
+ function push() {
var name,
value,
browserCookies,
diff --git a/src/service/formFactory.js b/src/service/formFactory.js
index 4fc53935..1efbe363 100644
--- a/src/service/formFactory.js
+++ b/src/service/formFactory.js
@@ -25,7 +25,7 @@
<doc:example>
<doc:source>
<script>
- function EditorCntl(){
+ function EditorCntl() {
this.html = '<b>Hello</b> <i>World</i>!';
}
@@ -33,7 +33,7 @@
var self = this;
var htmlFilter = angular.filter('html');
- this.$parseModel = function(){
+ this.$parseModel = function() {
// need to protect for script injection
try {
this.$viewValue = htmlFilter(this.$modelValue || '').get();
@@ -47,18 +47,18 @@
}
}
- this.$render = function(){
+ this.$render = function() {
element.html(this.$viewValue);
}
- element.bind('keyup', function(){
- self.$apply(function(){
+ element.bind('keyup', function() {
+ self.$apply(function() {
self.$emit('$viewChange', element.html());
});
});
}
- angular.directive('ng:contenteditable', function(){
+ angular.directive('ng:contenteditable', function() {
function linkFn($formFactory, element) {
var exp = element.attr('ng:contenteditable'),
form = $formFactory.forElement(element),
@@ -70,7 +70,7 @@
controller: HTMLEditorWidget,
controllerArgs: [element]});
// if the element is destroyed, then we need to notify the form.
- element.bind('$destroy', function(){
+ element.bind('$destroy', function() {
widget.$destroy();
});
}
@@ -88,7 +88,7 @@
</form>
</doc:source>
<doc:scenario>
- it('should enter invalid HTML', function(){
+ it('should enter invalid HTML', function() {
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-valid/);
input('html').enter('<');
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-invalid/);
@@ -96,7 +96,7 @@
</doc:scenario>
</doc:example>
*/
-angularServiceInject('$formFactory', function(){
+angularServiceInject('$formFactory', function() {
/**
@@ -123,7 +123,7 @@ angularServiceInject('$formFactory', function(){
* {@link angular.widget.form form} element.
* @param {Element} element The element where the search for form should initiate.
*/
- formFactory.forElement = function (element) {
+ formFactory.forElement = function(element) {
return element.inheritedData('$form') || formFactory.rootForm;
};
return formFactory;
@@ -225,7 +225,7 @@ function propertiesUpdate(widget) {
* @param {*} viewValue The new value for the view which will be assigned to `widget.$viewValue`.
*/
-function FormController(){
+function FormController() {
var form = this,
$error = form.$error = {};
@@ -361,7 +361,7 @@ FormController.prototype.$createWidget = function(params) {
// Set the state to something we know will change to get the process going.
widget.$modelValue = Number.NaN;
// watch for scope changes and update the view appropriately
- modelScope.$watch(scopeGet, function (scope, value) {
+ modelScope.$watch(scopeGet, function(scope, value) {
if (!equals(widget.$modelValue, value)) {
widget.$modelValue = value;
widget.$parseModel ? widget.$parseModel() : (widget.$viewValue = value);
diff --git a/src/service/log.js b/src/service/log.js
index 3dacd117..01254178 100644
--- a/src/service/log.js
+++ b/src/service/log.js
@@ -87,7 +87,7 @@ angularServiceInject("$log", $logFactory = function($window){
var console = $window.console || {};
var logFn = console[type] || console.log || noop;
if (logFn.apply) {
- return function(){
+ return function() {
var args = [];
forEach(arguments, function(arg){
args.push(formatError(arg));
diff --git a/src/service/resource.js b/src/service/resource.js
index 915f2d92..27bb1632 100644
--- a/src/service/resource.js
+++ b/src/service/resource.js
@@ -65,7 +65,7 @@
* update, delete) on server-side data like this:
* <pre>
var User = $resource('/user/:userId', {userId:'@id'});
- var user = User.get({userId:123}, function(){
+ var user = User.get({userId:123}, function() {
user.abc = true;
user.$save();
});
@@ -136,7 +136,7 @@
<pre>
var User = $resource('/user/:userId', {userId:'@id'});
- var user = User.get({userId:123}, function(){
+ var user = User.get({userId:123}, function() {
user.abc = true;
user.$save();
});
diff --git a/src/service/route.js b/src/service/route.js
index b78cca91..f5c8a672 100644
--- a/src/service/route.js
+++ b/src/service/route.js
@@ -188,7 +188,7 @@ 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?
diff --git a/src/service/routeParams.js b/src/service/routeParams.js
index d9bfa61a..ac496ec7 100644
--- a/src/service/routeParams.js
+++ b/src/service/routeParams.js
@@ -26,6 +26,6 @@
* $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
* </pre>
*/
-angularService('$routeParams', function(){
+angularService('$routeParams', function() {
return {};
});
diff --git a/src/service/xhr.bulk.js b/src/service/xhr.bulk.js
index 2365be77..db560556 100644
--- a/src/service/xhr.bulk.js
+++ b/src/service/xhr.bulk.js
@@ -83,6 +83,6 @@ angularServiceInject('$xhr.bulk', function($xhr, $error, $log){
}
});
};
- this.$watch(function(){ bulkXHR.flush(); });
+ this.$watch(function() { bulkXHR.flush(); });
return bulkXHR;
}, ['$xhr', '$xhr.error', '$log']);
diff --git a/src/service/xhr.js b/src/service/xhr.js
index 4981c078..8a50964b 100644
--- a/src/service/xhr.js
+++ b/src/service/xhr.js
@@ -205,7 +205,7 @@ angularServiceInject('$xhr', function($browser, $error, $log){
response = fromJson(response, true);
}
}
- rootScope.$apply(function(){
+ rootScope.$apply(function() {
if (200 <= code && code < 300) {
success(code, response);
} else if (isFunction(error)) {
diff --git a/src/widget/form.js b/src/widget/form.js
index bc34bf0d..b01a07ef 100644
--- a/src/widget/form.js
+++ b/src/widget/form.js
@@ -24,7 +24,7 @@
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.text = 'guest';
}
</script>
@@ -41,12 +41,12 @@
</div>
</doc:source>
<doc:scenario>
- it('should initialize to model', function(){
+ it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
- it('should be invalid if empty', function(){
+ it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
diff --git a/src/widget/input.js b/src/widget/input.js
index f82027f4..18d1ae12 100644
--- a/src/widget/input.js
+++ b/src/widget/input.js
@@ -25,7 +25,7 @@ var INTEGER_REGEXP = /^\s*(\-|\+)?\d+\s*$/;
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.text = 'guest';
this.word = /^\w*$/;
}
@@ -87,7 +87,7 @@ var INTEGER_REGEXP = /^\s*(\-|\+)?\d+\s*$/;
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.text = 'me@example.com';
}
</script>
@@ -155,7 +155,7 @@ angularInputType('email', function() {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.text = 'http://google.com';
}
</script>
@@ -222,7 +222,7 @@ angularInputType('url', function() {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.names = ['igor', 'misko', 'vojta'];
}
</script>
@@ -295,7 +295,7 @@ angularInputType('list', function() {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.value = 12;
}
</script>
@@ -359,7 +359,7 @@ angularInputType('number', numericRegexpInputType(NUMBER_REGEXP, 'NUMBER'));
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.value = 12;
}
</script>
@@ -418,7 +418,7 @@ angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER'));
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.value1 = true;
this.value2 = 'YES'
}
@@ -446,7 +446,7 @@ angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER'));
</doc:scenario>
</doc:example>
*/
-angularInputType('checkbox', function (inputElement) {
+angularInputType('checkbox', function(inputElement) {
var widget = this,
trueValue = inputElement.attr('true-value'),
falseValue = inputElement.attr('false-value');
@@ -490,7 +490,7 @@ angularInputType('checkbox', function (inputElement) {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.color = 'blue';
}
</script>
@@ -604,7 +604,7 @@ var HTML5_INPUTS_TYPES = makeMap(
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.text = 'guest';
}
</script>
@@ -635,7 +635,7 @@ var HTML5_INPUTS_TYPES = makeMap(
</doc:scenario>
</doc:example>
*/
-angularWidget('input', function (inputElement){
+angularWidget('input', function(inputElement){
this.directives(true);
this.descend(true);
var modelExp = inputElement.attr('ng:model');
@@ -715,7 +715,7 @@ angularWidget('input', function (inputElement){
}
});
- forEach(['valid', 'invalid', 'pristine', 'dirty'], function (name) {
+ forEach(['valid', 'invalid', 'pristine', 'dirty'], function(name) {
widget.$watch('$' + name, function(scope, value) {
inputElement[value ? 'addClass' : 'removeClass']('ng-' + name);
}
diff --git a/src/widget/select.js b/src/widget/select.js
index f397180e..1687721c 100644
--- a/src/widget/select.js
+++ b/src/widget/select.js
@@ -66,7 +66,7 @@
<doc:example>
<doc:source>
<script>
- function MyCntrl(){
+ function MyCntrl() {
this.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
@@ -112,7 +112,7 @@
</div>
</doc:source>
<doc:scenario>
- it('should check ng:options', function(){
+ it('should check ng:options', function() {
expect(binding('color')).toMatch('red');
select('color').option('0');
expect(binding('color')).toMatch('black');
@@ -128,7 +128,7 @@
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/;
-angularWidget('select', function (element){
+angularWidget('select', function(element){
this.directives(true);
this.descend(true);
return element.attr('ng:model') && annotate('$formFactory', function($formFactory, selectElement){
@@ -145,7 +145,7 @@ angularWidget('select', function (element){
alias: selectElement.attr('name'),
controller: optionsExp ? Options : (multiple ? Multiple : Single)});
- selectElement.bind('$destroy', function(){ widget.$destroy(); });
+ selectElement.bind('$destroy', function() { widget.$destroy(); });
widget.$pristine = !(widget.$dirty = false);
@@ -153,7 +153,7 @@ angularWidget('select', function (element){
watchElementProperty(modelScope, widget, 'readonly', selectElement);
watchElementProperty(modelScope, widget, 'disabled', selectElement);
- widget.$on('$validate', function(){
+ widget.$on('$validate', function() {
var valid = !widget.$required || !!widget.$modelValue;
if (valid && multiple && widget.$required) valid = !!widget.$modelValue.length;
if (valid !== !widget.$error.REQUIRED) {
@@ -161,11 +161,11 @@ angularWidget('select', function (element){
}
});
- widget.$on('$viewChange', function(){
+ widget.$on('$viewChange', function() {
widget.$pristine = !(widget.$dirty = true);
});
- forEach(['valid', 'invalid', 'pristine', 'dirty'], function (name) {
+ forEach(['valid', 'invalid', 'pristine', 'dirty'], function(name) {
widget.$watch('$' + name, function(scope, value) {
selectElement[value ? 'addClass' : 'removeClass']('ng-' + name);
});
@@ -173,18 +173,18 @@ angularWidget('select', function (element){
////////////////////////////
- function Multiple(){
+ function Multiple() {
var widget = this;
- this.$render = function(){
+ this.$render = function() {
var items = new HashMap(this.$viewValue);
forEach(selectElement.children(), function(option){
option.selected = isDefined(items.get(option.value));
});
};
- selectElement.bind('change', function (){
- widget.$apply(function(){
+ selectElement.bind('change', function() {
+ widget.$apply(function() {
var array = [];
forEach(selectElement.children(), function(option){
if (option.selected) {
@@ -197,15 +197,15 @@ angularWidget('select', function (element){
}
- function Single(){
+ function Single() {
var widget = this;
- widget.$render = function(){
+ widget.$render = function() {
selectElement.val(widget.$viewValue);
};
- selectElement.bind('change', function(){
- widget.$apply(function(){
+ selectElement.bind('change', function() {
+ widget.$apply(function() {
widget.$emit('$viewChange', selectElement.val());
});
});
@@ -213,7 +213,7 @@ angularWidget('select', function (element){
widget.$viewValue = selectElement.val();
}
- function Options(){
+ function Options() {
var widget = this,
match;
@@ -249,8 +249,8 @@ angularWidget('select', function (element){
});
selectElement.html(''); // clear contents
- selectElement.bind('change', function(){
- widgetScope.$apply(function(){
+ selectElement.bind('change', function() {
+ widgetScope.$apply(function() {
var optionGroup,
collection = valuesFn(modelScope) || [],
key = selectElement.val(),
diff --git a/src/widgets.js b/src/widgets.js
index e3c6906f..189dff29 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -49,7 +49,7 @@
<doc:example>
<doc:source jsfiddle="false">
<script>
- function Ctrl(){
+ function Ctrl() {
this.templates =
[ { name: 'template1.html', url: 'examples/ng-include/template1.html'}
, { name: 'template2.html', url: 'examples/ng-include/template2.html'} ];
@@ -66,16 +66,16 @@
</div>
</doc:source>
<doc:scenario>
- it('should load template1.html', function(){
+ it('should load template1.html', function() {
expect(element('.doc-example-live .ng-include').text()).
toBe('Content of template1.html\n');
});
- it('should load template2.html', function(){
+ it('should load template2.html', function() {
select('template').option('1');
expect(element('.doc-example-live .ng-include').text()).
toBe('Content of template2.html\n');
});
- it('should change to blank', function(){
+ it('should change to blank', function() {
select('template').option('');
expect(element('.doc-example-live .ng-include').text()).toEqual('');
});
@@ -99,7 +99,7 @@ angularWidget('ng:include', function(element){
childScope,
oldScope;
- function incrementChange(){ changeCounter++;}
+ function incrementChange() { changeCounter++;}
this.$watch(srcExp, incrementChange);
this.$watch(function(scope){
var newScope = scope.$eval(scopeExp);
@@ -108,7 +108,7 @@ angularWidget('ng:include', function(element){
incrementChange();
}
});
- this.$watch(function(){return changeCounter;}, function(scope) {
+ this.$watch(function() {return changeCounter;}, function(scope) {
var src = scope.$eval(srcExp),
useScope = scope.$eval(scopeExp);
@@ -161,7 +161,7 @@ angularWidget('ng:include', function(element){
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.items = ['settings', 'home', 'other'];
this.selection = this.items[0];
}
@@ -179,21 +179,21 @@ angularWidget('ng:include', function(element){
</div>
</doc:source>
<doc:scenario>
- it('should start in settings', function(){
+ it('should start in settings', function() {
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Settings Div');
});
- it('should change to home', function(){
+ it('should change to home', function() {
select('selection').option('home');
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Home Span');
});
- it('should select deafault', function(){
+ it('should select deafault', function() {
select('selection').option('other');
expect(element('.doc-example-live ng\\:switch').text()).toEqual('default');
});
</doc:scenario>
</doc:example>
*/
-angularWidget('ng:switch', function (element) {
+angularWidget('ng:switch', function(element) {
var compiler = this,
watchExpr = element.attr("on"),
changeExpr = element.attr('change'),
@@ -234,7 +234,7 @@ angularWidget('ng:switch', function (element) {
}
});
- this.$watch(function(){return changeCounter;}, function() {
+ this.$watch(function() {return changeCounter;}, function() {
element.html('');
if (selectedTemplate) {
selectedTemplate(childScope, function(caseElement) {
@@ -325,7 +325,7 @@ angularWidget('a', function() {
</div>
</doc:source>
<doc:scenario>
- it('should check ng:repeat', function(){
+ it('should check ng:repeat', function() {
var r = using('.doc-example-live').repeater('ul li');
expect(r.count()).toBe(2);
expect(r.row(0)).toEqual(["1","John","25"]);
@@ -467,7 +467,7 @@ angularWidget('@ng:repeat', function(expression, element){
<div ng:non-bindable>Ignored: {{1 + 2}}</div>
</doc:source>
<doc:scenario>
- it('should check ng:non-bindable', function(){
+ it('should check ng:non-bindable', function() {
expect(using('.doc-example-live').binding('1 + 2')).toBe('3');
expect(using('.doc-example-live').element('div:last').text()).
toMatch(/1 \+ 2/);
@@ -517,8 +517,8 @@ angularWidget("@ng:non-bindable", noop);
};
MyCtrl.$inject = ['$route'];
- function BootstrapCtrl(){}
- function OverviewCtrl(){}
+ function BootstrapCtrl() {}
+ function OverviewCtrl() {}
</script>
<div ng:controller="MyCtrl">
<a href="overview">overview</a> |
@@ -533,7 +533,7 @@ angularWidget("@ng:non-bindable", noop);
</div>
</doc:source>
<doc:scenario>
- it('should load templates', function(){
+ it('should load templates', function() {
element('.doc-example-live a:contains(overview)').click();
expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Overview/);
@@ -552,11 +552,11 @@ angularWidget('ng:view', function(element) {
var template;
var changeCounter = 0;
- this.$on('$afterRouteChange', function(){
+ this.$on('$afterRouteChange', function() {
changeCounter++;
});
- this.$watch(function(){return changeCounter;}, function() {
+ this.$watch(function() {return changeCounter;}, function() {
var template = $route.current && $route.current.template;
if (template) {
//xhr's callback must be async, see commit history for more info
@@ -669,7 +669,7 @@ angularWidget('ng:view', function(element) {
<doc:example>
<doc:source>
<script>
- function Ctrl(){
+ function Ctrl() {
this.person1 = 'Igor';
this.person2 = 'Misko';
this.personCount = 1;
@@ -700,7 +700,7 @@ angularWidget('ng:view', function(element) {
</div>
</doc:source>
<doc:scenario>
- it('should show correct pluralized string', function(){
+ it('should show correct pluralized string', function() {
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('1 person is viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
@@ -731,7 +731,7 @@ angularWidget('ng:view', function(element) {
toBe('Igor, Misko and 2 other people are viewing.');
});
- it('should show data-binded names', function(){
+ it('should show data-binded names', function() {
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index 0332c01b..5b0a3466 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -1,8 +1,8 @@
'use strict';
-describe('angular', function(){
- describe('case', function(){
- it('should change case', function(){
+describe('angular', function() {
+ describe('case', function() {
+ it('should change case', function() {
expect(lowercase('ABC90')).toEqual('abc90');
expect(manualLowercase('ABC90')).toEqual('abc90');
expect(uppercase('abc90')).toEqual('ABC90');
@@ -10,22 +10,22 @@ describe('angular', function(){
});
});
- describe("copy", function(){
- it("should return same object", function (){
+ describe("copy", function() {
+ it("should return same object", function () {
var obj = {};
var arr = [];
expect(copy({}, obj)).toBe(obj);
expect(copy([], arr)).toBe(arr);
});
- it("should copy Date", function(){
+ it("should copy Date", function() {
var date = new Date(123);
expect(copy(date) instanceof Date).toBeTruthy();
expect(copy(date).getTime()).toEqual(123);
expect(copy(date) === date).toBeFalsy();
});
- it("should copy array", function(){
+ it("should copy array", function() {
var src = [1, {name:"value"}];
var dst = [{key:"v"}];
expect(copy(src, dst)).toBe(dst);
@@ -41,7 +41,7 @@ describe('angular', function(){
expect(dst).toEqual([]);
});
- it("should copy object", function(){
+ it("should copy object", function() {
var src = {a:{name:"value"}};
var dst = {b:{key:"v"}};
expect(copy(src, dst)).toBe(dst);
@@ -50,7 +50,7 @@ describe('angular', function(){
expect(dst.a).not.toBe(src.a);
});
- it("should copy primitives", function(){
+ it("should copy primitives", function() {
expect(copy(null)).toEqual(null);
expect(copy('')).toBe('');
expect(copy('lala')).toBe('lala');
@@ -59,8 +59,8 @@ describe('angular', function(){
});
});
- describe('equals', function(){
- it('should return true if same object', function(){
+ describe('equals', function() {
+ it('should return true if same object', function() {
var o = {};
expect(equals(o, o)).toEqual(true);
expect(equals(o, {})).toEqual(true);
@@ -68,7 +68,7 @@ describe('angular', function(){
expect(equals(1, '2')).toEqual(false);
});
- it('should recurse into object', function(){
+ it('should recurse into object', function() {
expect(equals({}, {})).toEqual(true);
expect(equals({name:'misko'}, {name:'misko'})).toEqual(true);
expect(equals({name:'misko', age:1}, {name:'misko'})).toEqual(false);
@@ -79,13 +79,13 @@ describe('angular', function(){
expect(equals(['misko'], ['misko', 'adam'])).toEqual(false);
});
- it('should ignore $ member variables', function(){
+ it('should ignore $ member variables', function() {
expect(equals({name:'misko', $id:1}, {name:'misko', $id:2})).toEqual(true);
expect(equals({name:'misko'}, {name:'misko', $id:2})).toEqual(true);
expect(equals({name:'misko', $id:1}, {name:'misko'})).toEqual(true);
});
- it('should ignore functions', function(){
+ it('should ignore functions', function() {
expect(equals({func: function() {}}, {bar: function() {}})).toEqual(true);
});
@@ -169,8 +169,8 @@ describe('angular', function(){
});
});
- describe('sortedKeys', function(){
- it('should collect keys from object', function(){
+ describe('sortedKeys', function() {
+ it('should collect keys from object', function() {
expect(sortedKeys({c:0, b:0, a:0})).toEqual(['a', 'b', 'c']);
});
});
@@ -524,14 +524,14 @@ describe('angular', function(){
});
});
- describe('compile', function(){
+ describe('compile', function() {
var scope, template;
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should link to existing node and create scope', function(){
+ it('should link to existing node and create scope', function() {
template = angular.element('<div>{{greeting = "hello world"}}</div>');
scope = angular.compile(template)();
scope.$digest();
@@ -539,7 +539,7 @@ describe('angular', function(){
expect(scope.greeting).toEqual('hello world');
});
- it('should link to existing node and given scope', function(){
+ it('should link to existing node and given scope', function() {
scope = angular.scope();
template = angular.element('<div>{{greeting = "hello world"}}</div>');
angular.compile(template)(scope);
@@ -548,7 +548,7 @@ describe('angular', function(){
expect(scope).toEqual(scope);
});
- it('should link to new node and given scope', function(){
+ it('should link to new node and given scope', function() {
scope = angular.scope();
template = jqLite('<div>{{greeting = "hello world"}}</div>');
@@ -566,7 +566,7 @@ describe('angular', function(){
expect(scope.greeting).toEqual('hello world');
});
- it('should link to cloned node and create scope', function(){
+ it('should link to cloned node and create scope', function() {
scope = angular.scope();
template = jqLite('<div>{{greeting = "hello world"}}</div>');
angular.compile(template)(scope, noop).$digest();
@@ -598,8 +598,8 @@ describe('angular', function(){
});
- describe('nextUid()', function(){
- it('should return new id per call', function(){
+ describe('nextUid()', function() {
+ it('should return new id per call', function() {
var seen = {};
var count = 100;
diff --git a/test/ApiSpecs.js b/test/ApiSpecs.js
index bd77d734..208169df 100644
--- a/test/ApiSpecs.js
+++ b/test/ApiSpecs.js
@@ -16,7 +16,7 @@ describe('api', function() {
expect(map.get(key)).toBe(undefined);
});
- it('should init from an array', function(){
+ it('should init from an array', function() {
var map = new HashMap(['a','b']);
expect(map.get('a')).toBe(0);
expect(map.get('b')).toBe(1);
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index fa7fde60..bdeed675 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -1,7 +1,7 @@
'use strict';
-describe('Binder', function(){
- beforeEach(function(){
+describe('Binder', function() {
+ beforeEach(function() {
var self = this;
this.compile = function(html, parent, logErrors) {
@@ -22,42 +22,42 @@ describe('Binder', function(){
};
});
- afterEach(function(){
+ afterEach(function() {
if (this.element && this.element.dealoc) {
this.element.dealoc();
}
});
- it('BindUpdate', function(){
+ it('BindUpdate', function() {
var scope = this.compile('<div ng:init="a=123"/>');
scope.$digest();
assertEquals(123, scope.a);
});
- it('ExecuteInitialization', function(){
+ it('ExecuteInitialization', function() {
var scope = this.compile('<div ng:init="a=123">');
assertEquals(scope.a, 123);
});
- it('ExecuteInitializationStatements', function(){
+ it('ExecuteInitializationStatements', function() {
var scope = this.compile('<div ng:init="a=123;b=345">');
assertEquals(scope.a, 123);
assertEquals(scope.b, 345);
});
- it('ApplyTextBindings', function(){
+ it('ApplyTextBindings', function() {
var scope = this.compile('<div ng:bind="model.a">x</div>');
scope.model = {a:123};
scope.$apply();
assertEquals('123', scope.$element.text());
});
- it('ReplaceBindingInTextWithSpan', function(){
+ it('ReplaceBindingInTextWithSpan', function() {
assertEquals(this.compileToHtml("<b>a{{b}}c</b>"), '<b>a<span ng:bind="b"></span>c</b>');
assertEquals(this.compileToHtml("<b>{{b}}</b>"), '<b><span ng:bind="b"></span></b>');
});
- it('BindingSpaceConfusesIE', function(){
+ it('BindingSpaceConfusesIE', function() {
if (!msie) return;
var span = document.createElement("span");
span.innerHTML = '&nbsp;';
@@ -70,7 +70,7 @@ describe('Binder', function(){
this.compileToHtml("<b>{{A}} x {{B}} ({{C}})</b>"));
});
- it('BindingOfAttributes', function(){
+ it('BindingOfAttributes', function() {
var scope = this.compile("<a href='http://s/a{{b}}c' foo='x'></a>");
var attrbinding = scope.$element.attr("ng:bind-attr");
var bindings = fromJson(attrbinding);
@@ -78,7 +78,7 @@ describe('Binder', function(){
assertTrue(!bindings.foo);
});
- it('MarkMultipleAttributes', function(){
+ it('MarkMultipleAttributes', function() {
var scope = this.compile('<a href="http://s/a{{b}}c" foo="{{d}}"></a>');
var attrbinding = scope.$element.attr("ng:bind-attr");
var bindings = fromJson(attrbinding);
@@ -86,20 +86,20 @@ describe('Binder', function(){
assertEquals(decodeURI(bindings.href), "http://s/a{{b}}c");
});
- it('AttributesNoneBound', function(){
+ it('AttributesNoneBound', function() {
var scope = this.compile("<a href='abc' foo='def'></a>");
var a = scope.$element;
assertEquals(a[0].nodeName, "A");
assertTrue(!a.attr("ng:bind-attr"));
});
- it('ExistingAttrbindingIsAppended', function(){
+ it('ExistingAttrbindingIsAppended', function() {
var scope = this.compile("<a href='http://s/{{abc}}' ng:bind-attr='{\"b\":\"{{def}}\"}'></a>");
var a = scope.$element;
assertEquals('{"b":"{{def}}","href":"http://s/{{abc}}"}', a.attr('ng:bind-attr'));
});
- it('AttributesAreEvaluated', function(){
+ it('AttributesAreEvaluated', function() {
var scope = this.compile('<a ng:bind-attr=\'{"a":"a", "b":"a+b={{a+b}}"}\'></a>');
scope.$eval('a=1;b=2');
scope.$apply();
@@ -108,21 +108,21 @@ describe('Binder', function(){
assertEquals(a.attr('b'), 'a+b=3');
});
- it('InputTypeButtonActionExecutesInScope', function(){
+ it('InputTypeButtonActionExecutesInScope', function() {
var savedCalled = false;
var scope = this.compile('<input type="button" ng:click="person.save()" value="Apply">');
scope.person = {};
- scope.person.save = function(){
+ scope.person.save = function() {
savedCalled = true;
};
browserTrigger(scope.$element, 'click');
assertTrue(savedCalled);
});
- it('InputTypeButtonActionExecutesInScope2', function(){
+ it('InputTypeButtonActionExecutesInScope2', function() {
var log = "";
var scope = this.compile('<input type="image" ng:click="action()">');
- scope.action = function(){
+ scope.action = function() {
log += 'click;';
};
expect(log).toEqual('');
@@ -130,18 +130,18 @@ describe('Binder', function(){
expect(log).toEqual('click;');
});
- it('ButtonElementActionExecutesInScope', function(){
+ it('ButtonElementActionExecutesInScope', function() {
var savedCalled = false;
var scope = this.compile('<button ng:click="person.save()">Apply</button>');
scope.person = {};
- scope.person.save = function(){
+ scope.person.save = function() {
savedCalled = true;
};
browserTrigger(scope.$element, 'click');
assertTrue(savedCalled);
});
- it('RepeaterUpdateBindings', function(){
+ it('RepeaterUpdateBindings', function() {
var scope = this.compile('<ul><LI ng:repeat="item in model.items" ng:bind="item.a"/></ul>');
var form = scope.$element;
var items = [{a:"A"}, {a:"B"}];
@@ -176,7 +176,7 @@ describe('Binder', function(){
scope.$apply();
});
- it('RepeaterContentDoesNotBind', function(){
+ it('RepeaterContentDoesNotBind', function() {
var scope = this.compile('<ul><LI ng:repeat="item in model.items"><span ng:bind="item.a"></span></li></ul>');
scope.model = {items:[{a:"A"}]};
scope.$apply();
@@ -186,12 +186,12 @@ describe('Binder', function(){
'</ul>', sortedHtml(scope.$element));
});
- it('DoNotOverwriteCustomAction', function(){
+ it('DoNotOverwriteCustomAction', function() {
var html = this.compileToHtml('<input type="submit" value="Save" action="foo();">');
assertTrue(html.indexOf('action="foo();"') > 0 );
});
- it('RepeaterAdd', function(){
+ it('RepeaterAdd', function() {
var scope = this.compile('<div><input type="text" ng:model="item.x" ng:repeat="item in items"></div>');
scope.items = [{x:'a'}, {x:'b'}];
scope.$apply();
@@ -206,7 +206,7 @@ describe('Binder', function(){
expect(scope.items[0].x).toEqual('ABC');
});
- it('ItShouldRemoveExtraChildrenWhenIteratingOverHash', function(){
+ it('ItShouldRemoveExtraChildrenWhenIteratingOverHash', function() {
var scope = this.compile('<div><div ng:repeat="i in items">{{i}}</div></div>');
var items = {};
scope.items = items;
@@ -223,44 +223,44 @@ describe('Binder', function(){
expect(scope.$element[0].childNodes.length - 1).toEqual(0);
});
- it('IfTextBindingThrowsErrorDecorateTheSpan', function(){
+ it('IfTextBindingThrowsErrorDecorateTheSpan', function() {
var scope = this.compile('<div>{{error.throw()}}</div>', null, true);
var errorLogs = scope.$service('$exceptionHandler').errors;
scope.error = {
- 'throw': function(){throw "ErrorMsg1";}
+ 'throw': function() {throw "ErrorMsg1";}
};
scope.$apply();
- scope.error['throw'] = function(){throw "MyError";};
+ scope.error['throw'] = function() {throw "MyError";};
errorLogs.length = 0;
scope.$apply();
assertEquals(['MyError'], errorLogs.shift());
- scope.error['throw'] = function(){return "ok";};
+ scope.error['throw'] = function() {return "ok";};
scope.$apply();
assertEquals(0, errorLogs.length);
});
- it('IfAttrBindingThrowsErrorDecorateTheAttribute', function(){
+ it('IfAttrBindingThrowsErrorDecorateTheAttribute', function() {
var scope = this.compile('<div attr="before {{error.throw()}} after"></div>', null, true);
var errorLogs = scope.$service('$exceptionHandler').errors;
var count = 0;
scope.error = {
- 'throw': function(){throw new Error("ErrorMsg" + (++count));}
+ 'throw': function() {throw new Error("ErrorMsg" + (++count));}
};
scope.$apply();
expect(errorLogs.length).not.toEqual(0);
expect(errorLogs.shift()).toMatch(/ErrorMsg1/);
errorLogs.length = 0;
- scope.error['throw'] = function(){ return 'X';};
+ scope.error['throw'] = function() { return 'X';};
scope.$apply();
expect(errorLogs.length).toMatch(0);
});
- it('NestedRepeater', function(){
+ it('NestedRepeater', function() {
var scope = this.compile('<div><div ng:repeat="m in model" name="{{m.name}}">' +
'<ul name="{{i}}" ng:repeat="i in m.item"></ul>' +
'</div></div>');
@@ -282,7 +282,7 @@ describe('Binder', function(){
'</div></div>', sortedHtml(scope.$element));
});
- it('HideBindingExpression', function(){
+ it('HideBindingExpression', function() {
var scope = this.compile('<div ng:hide="hidden == 3"/>');
scope.hidden = 3;
@@ -296,7 +296,7 @@ describe('Binder', function(){
assertVisible(scope.$element);
});
- it('HideBinding', function(){
+ it('HideBinding', function() {
var scope = this.compile('<div ng:hide="hidden"/>');
scope.hidden = 'true';
@@ -315,7 +315,7 @@ describe('Binder', function(){
assertVisible(scope.$element);
});
- it('ShowBinding', function(){
+ it('ShowBinding', function() {
var scope = this.compile('<div ng:show="show"/>');
scope.show = 'true';
@@ -335,7 +335,7 @@ describe('Binder', function(){
});
- it('BindClass', function(){
+ it('BindClass', function() {
var scope = this.compile('<div ng:class="clazz"/>');
scope.clazz = 'testClass';
@@ -349,7 +349,7 @@ describe('Binder', function(){
assertEquals('<div class="a b" ng:class="clazz"></div>', sortedHtml(scope.$element));
});
- it('BindClassEvenOdd', function(){
+ it('BindClassEvenOdd', function() {
var scope = this.compile('<div><div ng:repeat="i in [0,1]" ng:class-even="\'e\'" ng:class-odd="\'o\'"></div></div>');
scope.$apply();
var d1 = jqLite(scope.$element[0].childNodes[1]);
@@ -363,7 +363,7 @@ describe('Binder', function(){
sortedHtml(scope.$element));
});
- it('BindStyle', function(){
+ it('BindStyle', function() {
var scope = this.compile('<div ng:style="style"/>');
scope.$eval('style={height: "10px"}');
@@ -375,9 +375,9 @@ describe('Binder', function(){
scope.$apply();
});
- it('ActionOnAHrefThrowsError', function(){
+ it('ActionOnAHrefThrowsError', function() {
var scope = this.compile('<a ng:click="action()">Add Phone</a>', null, true);
- scope.action = function(){
+ scope.action = function() {
throw new Error('MyError');
};
var input = scope.$element;
@@ -385,7 +385,7 @@ describe('Binder', function(){
expect(scope.$service('$exceptionHandler').errors[0]).toMatch(/MyError/);
});
- it('ShoulIgnoreVbNonBindable', function(){
+ it('ShoulIgnoreVbNonBindable', function() {
var scope = this.compile("<div>{{a}}" +
"<div ng:non-bindable>{{a}}</div>" +
"<div ng:non-bindable=''>{{b}}</div>" +
@@ -403,7 +403,7 @@ describe('Binder', function(){
assertEquals('<pre ng:bind-template="Hello {{name}}!">Hello World!</pre>', sortedHtml(scope.$element));
});
- it('FillInOptionValueWhenMissing', function(){
+ it('FillInOptionValueWhenMissing', function() {
var scope = this.compile(
'<select ng:model="foo">' +
'<option selected="true">{{a}}</option>' +
@@ -427,7 +427,7 @@ describe('Binder', function(){
expect(optionC.text()).toEqual('C');
});
- it('DeleteAttributeIfEvaluatesFalse', function(){
+ it('DeleteAttributeIfEvaluatesFalse', function() {
var scope = this.compile('<div>' +
'<input ng:model="a0" ng:bind-attr="{disabled:\'{{true}}\'}">' +
'<input ng:model="a1" ng:bind-attr="{disabled:\'{{false}}\'}">' +
@@ -449,7 +449,7 @@ describe('Binder', function(){
assertChild(5, false);
});
- it('ItShouldDisplayErrorWhenActionIsSyntacticlyIncorrect', function(){
+ it('ItShouldDisplayErrorWhenActionIsSyntacticlyIncorrect', function() {
var scope = this.compile('<div>' +
'<input type="button" ng:click="greeting=\'ABC\'"/>' +
'<input type="button" ng:click=":garbage:"/></div>', null, true);
@@ -466,7 +466,7 @@ describe('Binder', function(){
toMatchError(/Syntax Error: Token ':' not a primary expression/);
});
- it('ItShouldSelectTheCorrectRadioBox', function(){
+ it('ItShouldSelectTheCorrectRadioBox', function() {
var scope = this.compile('<div>' +
'<input type="radio" ng:model="sex" value="female">' +
'<input type="radio" ng:model="sex" value="male"></div>');
@@ -486,7 +486,7 @@ describe('Binder', function(){
assertEquals("male", male.val());
});
- it('ItShouldRepeatOnHashes', function(){
+ it('ItShouldRepeatOnHashes', function() {
var scope = this.compile('<ul><li ng:repeat="(k,v) in {a:0,b:1}" ng:bind=\"k + v\"></li></ul>');
scope.$apply();
assertEquals('<ul>' +
@@ -497,7 +497,7 @@ describe('Binder', function(){
sortedHtml(scope.$element));
});
- it('ItShouldFireChangeListenersBeforeUpdate', function(){
+ it('ItShouldFireChangeListenersBeforeUpdate', function() {
var scope = this.compile('<div ng:bind="name"></div>');
scope.name = "";
scope.$watch("watched", "name=123");
@@ -509,7 +509,7 @@ describe('Binder', function(){
sortedHtml(scope.$element));
});
- it('ItShouldHandleMultilineBindings', function(){
+ it('ItShouldHandleMultilineBindings', function() {
var scope = this.compile('<div>{{\n 1 \n + \n 2 \n}}</div>');
scope.$apply();
assertEquals("3", scope.$element.text());
diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js
index 692bc5ae..511bb643 100644
--- a/test/BrowserSpecs.js
+++ b/test/BrowserSpecs.js
@@ -46,11 +46,11 @@ function MockWindow() {
};
}
-describe('browser', function(){
+describe('browser', function() {
var browser, fakeWindow, xhr, logs, scripts, removedScripts, sniffer;
- beforeEach(function(){
+ beforeEach(function() {
scripts = [];
removedScripts = [];
xhr = null;
@@ -60,7 +60,7 @@ describe('browser', function(){
var fakeBody = [{appendChild: function(node){scripts.push(node);},
removeChild: function(node){removedScripts.push(node);}}];
- var FakeXhr = function(){
+ var FakeXhr = function() {
xhr = this;
this.open = function(method, url, async){
xhr.method = method;
@@ -91,14 +91,14 @@ describe('browser', function(){
expect(browser.cookies).toBeDefined();
});
- describe('outstading requests', function(){
- it('should process callbacks immedietly with no outstanding requests', function(){
+ describe('outstading requests', function() {
+ it('should process callbacks immedietly with no outstanding requests', function() {
var callback = jasmine.createSpy('callback');
browser.notifyWhenNoOutstandingRequests(callback);
expect(callback).toHaveBeenCalled();
});
- it('should queue callbacks with outstanding requests', function(){
+ it('should queue callbacks with outstanding requests', function() {
var callback = jasmine.createSpy('callback');
browser.xhr('GET', '/url', null, noop);
browser.notifyWhenNoOutstandingRequests(callback);
@@ -110,8 +110,8 @@ describe('browser', function(){
});
});
- describe('xhr', function(){
- describe('JSON', function(){
+ describe('xhr', function() {
+ describe('JSON', function() {
var log;
function callback(code, data) {
@@ -478,12 +478,12 @@ describe('browser', function(){
});
- describe('poller', function(){
+ describe('poller', function() {
- it('should call functions in pollFns in regular intervals', function(){
+ it('should call functions in pollFns in regular intervals', function() {
var log = '';
- browser.addPollFn(function(){log+='a';});
- browser.addPollFn(function(){log+='b';});
+ browser.addPollFn(function() {log+='a';});
+ browser.addPollFn(function() {log+='b';});
expect(log).toEqual('');
fakeWindow.setTimeout.flush();
expect(log).toEqual('ab');
@@ -491,14 +491,14 @@ describe('browser', function(){
expect(log).toEqual('abab');
});
- it('should startPoller', function(){
+ it('should startPoller', function() {
expect(fakeWindow.timeouts.length).toEqual(0);
- browser.addPollFn(function(){});
+ browser.addPollFn(function() {});
expect(fakeWindow.timeouts.length).toEqual(1);
//should remain 1 as it is the check fn
- browser.addPollFn(function(){});
+ browser.addPollFn(function() {});
expect(fakeWindow.timeouts.length).toEqual(1);
});
diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js
index f0045aa8..e0dcafc0 100644
--- a/test/CompilerSpec.js
+++ b/test/CompilerSpec.js
@@ -1,9 +1,9 @@
'use strict';
-describe('compiler', function(){
+describe('compiler', function() {
var compiler, markup, attrMarkup, directives, widgets, compile, log, scope;
- beforeEach(function(){
+ beforeEach(function() {
log = "";
directives = {
hello: function(expression, element){
@@ -34,13 +34,13 @@ describe('compiler', function(){
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should not allow compilation of multiple roots', function(){
- expect(function(){
+ it('should not allow compilation of multiple roots', function() {
+ expect(function() {
compiler.compile('<div>A</div><span></span>');
}).toThrow("Cannot compile multiple element roots: " + ie("<div>A</div><span></span>"));
function ie(text) {
@@ -49,7 +49,7 @@ describe('compiler', function(){
});
- it('should recognize a directive', function(){
+ it('should recognize a directive', function() {
var e = jqLite('<div directive="expr" ignore="me"></div>');
directives.directive = function(expression, element){
log += "found";
@@ -67,13 +67,13 @@ describe('compiler', function(){
});
- it('should recurse to children', function(){
+ it('should recurse to children', function() {
scope = compile('<div><span hello="misko"/></div>');
expect(log).toEqual("hello misko");
});
- it('should observe scope', function(){
+ it('should observe scope', function() {
scope = compile('<span observe="name"></span>');
expect(log).toEqual("");
scope.$digest();
@@ -87,14 +87,14 @@ describe('compiler', function(){
});
- it('should prevent descend', function(){
- directives.stop = function(){ this.descend(false); };
+ it('should prevent descend', function() {
+ directives.stop = function() { this.descend(false); };
scope = compile('<span hello="misko" stop="true"><span hello="adam"/></span>');
expect(log).toEqual("hello misko");
});
- it('should allow creation of templates', function(){
+ it('should allow creation of templates', function() {
directives.duplicate = function(expr, element){
element.replaceWith(document.createComment("marker"));
element.removeAttr("duplicate");
@@ -119,7 +119,7 @@ describe('compiler', function(){
});
- it('should process markup before directives', function(){
+ it('should process markup before directives', function() {
markup.push(function(text, textNode, parentNode) {
if (text == 'middle') {
expect(textNode.text()).toEqual(text);
@@ -133,7 +133,7 @@ describe('compiler', function(){
});
- it('should replace widgets', function(){
+ it('should replace widgets', function() {
widgets['NG:BUTTON'] = function(element) {
expect(element.hasClass('ng-widget')).toEqual(true);
element.replaceWith('<div>button</div>');
@@ -147,7 +147,7 @@ describe('compiler', function(){
});
- it('should use the replaced element after calling widget', function(){
+ it('should use the replaced element after calling widget', function() {
widgets['H1'] = function(element) {
// HTML elements which are augmented by acting as widgets, should not be marked as so
expect(element.hasClass('ng-widget')).toEqual(false);
@@ -166,7 +166,7 @@ describe('compiler', function(){
});
- it('should allow multiple markups per text element', function(){
+ it('should allow multiple markups per text element', function() {
markup.push(function(text, textNode, parent){
var index = text.indexOf('---');
if (index > -1) {
@@ -190,7 +190,7 @@ describe('compiler', function(){
});
- it('should add class for namespace elements', function(){
+ it('should add class for namespace elements', function() {
scope = compile('<ng:space>abc</ng:space>');
var space = jqLite(scope.$element[0].firstChild);
expect(space.hasClass('ng-space')).toEqual(true);
diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js
index 672540c5..5bf9df6f 100644
--- a/test/FiltersSpec.js
+++ b/test/FiltersSpec.js
@@ -6,7 +6,7 @@ describe('filter', function() {
it('should called the filter when evaluating expression', function() {
var scope = createScope();
- filter.fakeFilter = function(){};
+ filter.fakeFilter = function() {};
spyOn(filter, 'fakeFilter');
scope.$eval('10|fakeFilter');
@@ -205,7 +205,7 @@ describe('filter', function() {
});
});
- describe('date', function(){
+ describe('date', function() {
var morning = new TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am
var noon = new TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm
diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js
index ab4f3437..2c6c102a 100644
--- a/test/InjectorSpec.js
+++ b/test/InjectorSpec.js
@@ -1,20 +1,20 @@
'use strict';
-describe('injector', function(){
+describe('injector', function() {
var providers;
var cache;
var injector;
var scope;
- beforeEach(function(){
+ beforeEach(function() {
providers = extensionMap({}, 'providers');
cache = {};
scope = {};
injector = createInjector(scope, providers, cache);
});
- it("should return same instance from calling provider", function(){
- providers('text', function(){ return scope.name; });
+ it("should return same instance from calling provider", function() {
+ providers('text', function() { return scope.name; });
scope.name = 'abc';
expect(injector('text')).toEqual('abc');
expect(cache.text).toEqual('abc');
@@ -22,9 +22,9 @@ describe('injector', function(){
expect(injector('text')).toEqual('abc');
});
- it("should call function", function(){
- providers('a', function(){return 1;});
- providers('b', function(){return 2;});
+ it("should call function", function() {
+ providers('a', function() {return 1;});
+ providers('b', function() {return 2;});
var args;
function fn(a, b, c, d) {
args = [this, a, b, c, d];
@@ -34,15 +34,15 @@ describe('injector', function(){
expect(args).toEqual([{name:'this'}, 1, 2, 3, 4]);
});
- it('should inject providers', function(){
- providers('a', function(){return this.mi = 'Mi';});
+ it('should inject providers', function() {
+ providers('a', function() {return this.mi = 'Mi';});
providers('b', function(mi){return this.name = mi+'sko';}, {$inject:['a']});
expect(injector('b')).toEqual('Misko');
expect(scope).toEqual({mi:'Mi', name:'Misko'});
});
- it('should resolve dependency graph and instantiate all services just once', function(){
+ it('should resolve dependency graph and instantiate all services just once', function() {
var log = [];
// s1
@@ -54,12 +54,12 @@ describe('injector', function(){
// s6
- providers('s1', function(){ log.push('s1'); }, {$inject: ['s2', 's5', 's6']});
- providers('s2', function(){ log.push('s2'); }, {$inject: ['s3', 's4', 's5']});
- providers('s3', function(){ log.push('s3'); }, {$inject: ['s6']});
- providers('s4', function(){ log.push('s4'); }, {$inject: ['s3', 's5']});
- providers('s5', function(){ log.push('s5'); });
- providers('s6', function(){ log.push('s6'); });
+ providers('s1', function() { log.push('s1'); }, {$inject: ['s2', 's5', 's6']});
+ providers('s2', function() { log.push('s2'); }, {$inject: ['s3', 's4', 's5']});
+ providers('s3', function() { log.push('s3'); }, {$inject: ['s6']});
+ providers('s4', function() { log.push('s4'); }, {$inject: ['s3', 's5']});
+ providers('s5', function() { log.push('s5'); });
+ providers('s6', function() { log.push('s6'); });
injector('s1');
@@ -67,32 +67,32 @@ describe('injector', function(){
});
- it('should provide usefull message if no provider', function(){
- expect(function(){
+ it('should provide usefull message if no provider', function() {
+ expect(function() {
injector('idontexist');
}).toThrow("Unknown provider for 'idontexist'.");
});
- it('should autostart eager services', function(){
+ it('should autostart eager services', function() {
var log = '';
- providers('eager', function(){log += 'eager;'; return 'foo';}, {$eager: true});
+ providers('eager', function() {log += 'eager;'; return 'foo';}, {$eager: true});
injector.eager();
expect(log).toEqual('eager;');
expect(injector('eager')).toBe('foo');
});
- describe('annotation', function(){
- it('should return $inject', function(){
- function fn(){}
+ describe('annotation', function() {
+ it('should return $inject', function() {
+ function fn() {}
fn.$inject = ['a'];
expect(inferInjectionArgs(fn)).toBe(fn.$inject);
- expect(inferInjectionArgs(function(){})).toEqual([]);
- expect(inferInjectionArgs(function (){})).toEqual([]);
- expect(inferInjectionArgs(function (){})).toEqual([]);
- expect(inferInjectionArgs(function /* */ (){})).toEqual([]);
+ expect(inferInjectionArgs(function() {})).toEqual([]);
+ expect(inferInjectionArgs(function () {})).toEqual([]);
+ expect(inferInjectionArgs(function () {})).toEqual([]);
+ expect(inferInjectionArgs(function /* */ () {})).toEqual([]);
});
- it('should create $inject', function(){
+ it('should create $inject', function() {
// keep the multi-line to make sure we can handle it
function $f_n0 /*
*/(
@@ -107,40 +107,40 @@ describe('injector', function(){
expect($f_n0.$inject).toEqual(['$a', 'b_', '_c', 'd']);
});
- it('should handle no arg functions', function(){
- function $f_n0(){}
+ it('should handle no arg functions', function() {
+ function $f_n0() {}
expect(inferInjectionArgs($f_n0)).toEqual([]);
expect($f_n0.$inject).toEqual([]);
});
- it('should handle args with both $ and _', function(){
+ it('should handle args with both $ and _', function() {
function $f_n0($a_){}
expect(inferInjectionArgs($f_n0)).toEqual(['$a_']);
expect($f_n0.$inject).toEqual(['$a_']);
});
- it('should throw on non function arg', function(){
- expect(function(){
+ it('should throw on non function arg', function() {
+ expect(function() {
inferInjectionArgs({});
}).toThrow();
});
- it('should infer injection on services', function(){
+ it('should infer injection on services', function() {
var scope = angular.scope({
- a: function(){ return 'a';},
+ a: function() { return 'a';},
b: function(a){ return a + 'b';}
});
expect(scope.$service('b')).toEqual('ab');
});
});
- describe('inject', function(){
- it('should inject names', function(){
+ describe('inject', function() {
+ it('should inject names', function() {
expect(annotate('a', {}).$inject).toEqual(['a']);
expect(annotate('a', 'b', {}).$inject).toEqual(['a', 'b']);
});
- it('should inject array', function(){
+ it('should inject array', function() {
expect(annotate(['a'], {}).$inject).toEqual(['a']);
expect(annotate(['a', 'b'], {}).$inject).toEqual(['a', 'b']);
});
diff --git a/test/JsonSpec.js b/test/JsonSpec.js
index 2bd7241f..d3f6de0f 100644
--- a/test/JsonSpec.js
+++ b/test/JsonSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('json', function(){
+describe('json', function() {
it('should serialize primitives', function() {
expect(toJson(0/0)).toEqual('null');
expect(toJson(null)).toEqual('null');
@@ -11,11 +11,11 @@ describe('json', function(){
expect(toJson("a \t \n \r b \\")).toEqual('"a \\t \\n \\r b \\\\"');
});
- it('should not serialize $$properties', function(){
+ it('should not serialize $$properties', function() {
expect(toJson({$$some:'value', 'this':1, '$parent':1}, false)).toEqual('{}');
});
- it('should not serialize this or $parent', function(){
+ it('should not serialize this or $parent', function() {
expect(toJson({'this':'value', $parent:'abc'}, false)).toEqual('{}');
});
@@ -46,8 +46,8 @@ describe('json', function(){
});
it('should ignore functions', function() {
- expect(toJson([function(){},1])).toEqual('[null,1]');
- expect(toJson({a:function(){}})).toEqual('{}');
+ expect(toJson([function() {},1])).toEqual('[null,1]');
+ expect(toJson({a:function() {}})).toEqual('{}');
});
it('should parse null', function() {
@@ -127,7 +127,7 @@ describe('json', function(){
expect(fromJson("{exp:1.2e-10}")).toEqual({exp:1.2E-10});
});
- it('should ignore non-strings', function(){
+ it('should ignore non-strings', function() {
expect(fromJson([])).toEqual([]);
expect(fromJson({})).toEqual({});
expect(fromJson(null)).toEqual(null);
@@ -170,51 +170,51 @@ describe('json', function(){
}
- describe('security', function(){
- it('should not allow naked expressions', function(){
- expect(function(){fromJson('1+2');}).
+ describe('security', function() {
+ it('should not allow naked expressions', function() {
+ expect(function() {fromJson('1+2');}).
toThrow(new Error("Syntax Error: Token '+' is an unexpected token at column 2 of the expression [1+2] starting at [+2]."));
});
- it('should not allow naked expressions group', function(){
- expect(function(){fromJson('(1+2)');}).
+ it('should not allow naked expressions group', function() {
+ expect(function() {fromJson('(1+2)');}).
toThrow(new Error("Syntax Error: Token '(' is not valid json at column 1 of the expression [(1+2)] starting at [(1+2)]."));
});
- it('should not allow expressions in objects', function(){
- expect(function(){fromJson('{a:abc()}');}).
+ it('should not allow expressions in objects', function() {
+ expect(function() {fromJson('{a:abc()}');}).
toThrow(new Error("Syntax Error: Token 'abc' is not valid json at column 4 of the expression [{a:abc()}] starting at [abc()}]."));
});
- it('should not allow expressions in arrays', function(){
- expect(function(){fromJson('[1+2]');}).
+ it('should not allow expressions in arrays', function() {
+ expect(function() {fromJson('[1+2]');}).
toThrow(new Error("Syntax Error: Token '+' is not valid json at column 3 of the expression [[1+2]] starting at [+2]]."));
});
- it('should not allow vars', function(){
- expect(function(){fromJson('[1, x]');}).
+ it('should not allow vars', function() {
+ expect(function() {fromJson('[1, x]');}).
toThrow(new Error("Syntax Error: Token 'x' is not valid json at column 5 of the expression [[1, x]] starting at [x]]."));
});
- it('should not allow dereference', function(){
- expect(function(){fromJson('["".constructor]');}).
+ it('should not allow dereference', function() {
+ expect(function() {fromJson('["".constructor]');}).
toThrow(new Error("Syntax Error: Token '.' is not valid json at column 4 of the expression [[\"\".constructor]] starting at [.constructor]]."));
});
- it('should not allow expressions ofter valid json', function(){
- expect(function(){fromJson('[].constructor');}).
+ it('should not allow expressions ofter valid json', function() {
+ expect(function() {fromJson('[].constructor');}).
toThrow(new Error("Syntax Error: Token '.' is not valid json at column 3 of the expression [[].constructor] starting at [.constructor]."));
});
- it('should not allow object dereference', function(){
- expect(function(){fromJson('{a:1, b: $location, c:1}');}).toThrow();
- expect(function(){fromJson("{a:1, b:[1]['__parent__']['location'], c:1}");}).toThrow();
+ it('should not allow object dereference', function() {
+ expect(function() {fromJson('{a:1, b: $location, c:1}');}).toThrow();
+ expect(function() {fromJson("{a:1, b:[1]['__parent__']['location'], c:1}");}).toThrow();
});
- it('should not allow assignments', function(){
- expect(function(){fromJson("{a:1, b:[1]=1, c:1}");}).toThrow();
- expect(function(){fromJson("{a:1, b:=1, c:1}");}).toThrow();
- expect(function(){fromJson("{a:1, b:x=1, c:1}");}).toThrow();
+ it('should not allow assignments', function() {
+ expect(function() {fromJson("{a:1, b:[1]=1, c:1}");}).toThrow();
+ expect(function() {fromJson("{a:1, b:=1, c:1}");}).toThrow();
+ expect(function() {fromJson("{a:1, b:x=1, c:1}");}).toThrow();
});
});
diff --git a/test/ParserSpec.js b/test/ParserSpec.js
index 980a673c..975cacc4 100644
--- a/test/ParserSpec.js
+++ b/test/ParserSpec.js
@@ -191,7 +191,7 @@ describe('parser', function() {
expect(scope.$eval("'a' + 'b c'")).toEqual("ab c");
});
- it('should parse filters', function(){
+ it('should parse filters', function() {
angular.filter.substring = function(input, start, end) {
return input.substring(start, end);
};
@@ -416,8 +416,8 @@ describe('parser', function() {
});
- describe('assignable', function(){
- it('should expose assignment function', function(){
+ describe('assignable', function() {
+ it('should expose assignment function', function() {
var fn = parser('a').assignable();
expect(fn.assign).toBeTruthy();
var scope = {};
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index b6c116f7..15bbbdae 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -16,7 +16,7 @@ describe("resource", function() {
callback = jasmine.createSpy();
});
- it("should build resource", function(){
+ it("should build resource", function() {
expect(typeof CreditCard).toBe('function');
expect(typeof CreditCard.get).toBe('function');
expect(typeof CreditCard.save).toBe('function');
@@ -25,12 +25,12 @@ describe("resource", function() {
expect(typeof CreditCard.query).toBe('function');
});
- it('should default to empty parameters', function(){
+ it('should default to empty parameters', function() {
xhr.expectGET('URL').respond({});
resource.route('URL').query();
});
- it('should ignore slashes of undefinend parameters', function(){
+ it('should ignore slashes of undefinend parameters', function() {
var R = resource.route('/Path/:a/:b/:c');
xhr.expectGET('/Path').respond({});
xhr.expectGET('/Path/1').respond({});
@@ -42,7 +42,7 @@ describe("resource", function() {
R.get({a:4, b:5, c:6});
});
- it('should correctly encode url params', function(){
+ it('should correctly encode url params', function() {
var R = resource.route('/Path/:a');
xhr.expectGET('/Path/foo%231').respond({});
xhr.expectGET('/Path/doh!@foo?bar=baz%231').respond({});
@@ -67,7 +67,7 @@ describe("resource", function() {
R.get({a: 'doh&foo', bar: 'baz&1'});
});
- it("should build resource with default param", function(){
+ it("should build resource with default param", function() {
xhr.expectGET('/Order/123/Line/456.visa?minimum=0.05').respond({id:'abc'});
var LineItem = resource.route('/Order/:orderId/Line/:id:verb', {orderId: '123', id: '@id.key', verb:'.visa', minimum:0.05});
var item = LineItem.get({id:456});
@@ -75,7 +75,7 @@ describe("resource", function() {
nakedExpect(item).toEqual({id:'abc'});
});
- it("should build resource with action default param overriding default param", function(){
+ it("should build resource with action default param overriding default param", function() {
xhr.expectGET('/Customer/123').respond({id:'abc'});
var TypeItem = resource.route('/:type/:typeId', {type: 'Order'},
{get: {method: 'GET', params: {type: 'Customer'}}});
@@ -84,7 +84,7 @@ describe("resource", function() {
nakedExpect(item).toEqual({id:'abc'});
});
- it("should create resource", function(){
+ it("should create resource", function() {
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123, name:'misko'});
var cc = CreditCard.save({name:'misko'}, callback);
@@ -95,7 +95,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it("should read resource", function(){
+ it("should read resource", function() {
xhr.expectGET("/CreditCard/123").respond({id:123, number:'9876'});
var cc = CreditCard.get({id:123}, callback);
expect(cc instanceof CreditCard).toBeTruthy();
@@ -106,7 +106,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it("should read partial resource", function(){
+ it("should read partial resource", function() {
xhr.expectGET("/CreditCard").respond([{id:{key:123}}]);
xhr.expectGET("/CreditCard/123").respond({id:{key:123}, number:'9876'});
var ccs = CreditCard.query();
@@ -121,7 +121,7 @@ describe("resource", function() {
expect(cc.number).toEqual('9876');
});
- it("should update resource", function(){
+ it("should update resource", function() {
xhr.expectPOST('/CreditCard/123', {id:{key:123}, name:'misko'}).respond({id:{key:123}, name:'rama'});
var cc = CreditCard.save({id:{key:123}, name:'misko'}, callback);
@@ -130,7 +130,7 @@ describe("resource", function() {
xhr.flush();
});
- it("should query resource", function(){
+ it("should query resource", function() {
xhr.expectGET("/CreditCard?key=value").respond([{id:1}, {id:2}]);
var ccs = CreditCard.query({key:'value'}, callback);
@@ -141,16 +141,16 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(ccs);
});
- it("should have all arguments optional", function(){
+ it("should have all arguments optional", function() {
xhr.expectGET('/CreditCard').respond([{id:1}]);
var log = '';
- var ccs = CreditCard.query(function(){ log += 'cb;'; });
+ var ccs = CreditCard.query(function() { log += 'cb;'; });
xhr.flush();
nakedExpect(ccs).toEqual([{id:1}]);
expect(log).toEqual('cb;');
});
- it('should delete resource and call callback', function(){
+ it('should delete resource and call callback', function() {
xhr.expectDELETE("/CreditCard/123").respond(200, {});
CreditCard.remove({id:123}, callback);
@@ -166,20 +166,20 @@ describe("resource", function() {
nakedExpect(callback.mostRecentCall.args).toEqual([{}]);
});
- it('should post charge verb', function(){
+ it('should post charge verb', function() {
xhr.expectPOST('/CreditCard/123!charge?amount=10', {auth:'abc'}).respond({success:'ok'});
CreditCard.charge({id:123, amount:10},{auth:'abc'}, callback);
});
- it('should post charge verb on instance', function(){
+ it('should post charge verb on instance', function() {
xhr.expectPOST('/CreditCard/123!charge?amount=10', {id:{key:123}, name:'misko'}).respond({success:'ok'});
var card = new CreditCard({id:{key:123}, name:'misko'});
card.$charge({amount:10}, callback);
});
- it('should create on save', function(){
+ it('should create on save', function() {
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123});
var cc = new CreditCard();
expect(cc.$get).toBeDefined();
@@ -195,7 +195,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it('should not mutate the resource object if response contains no body', function(){
+ it('should not mutate the resource object if response contains no body', function() {
var data = {id:{key:123}, number:'9876'};
xhr.expectGET("/CreditCard/123").respond(data);
var cc = CreditCard.get({id:123});
@@ -209,7 +209,7 @@ describe("resource", function() {
expect(idBefore).toEqual(cc.id);
});
- it('should bind default parameters', function(){
+ it('should bind default parameters', function() {
xhr.expectGET('/CreditCard/123.visa?minimum=0.05').respond({id:123});
var Visa = CreditCard.bind({verb:'.visa', minimum:0.05});
var visa = Visa.get({id:123});
@@ -217,7 +217,7 @@ describe("resource", function() {
nakedExpect(visa).toEqual({id:123});
});
- it('should excersize full stack', function(){
+ it('should excersize full stack', function() {
var scope = angular.compile('<div></div>')();
var $browser = scope.$service('$browser');
var $resource = scope.$service('$resource');
@@ -229,7 +229,7 @@ describe("resource", function() {
dealoc(scope);
});
- it('should return the same object when verifying the cache', function(){
+ it('should return the same object when verifying the cache', function() {
var scope = angular.compile('<div></div>')();
var $browser = scope.$service('$browser');
var $resource = scope.$service('$resource');
diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js
index 52cfd454..5f83ab93 100644
--- a/test/ScenarioSpec.js
+++ b/test/ScenarioSpec.js
@@ -1,18 +1,18 @@
'use strict';
-describe("ScenarioSpec: Compilation", function(){
+describe("ScenarioSpec: Compilation", function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = null;
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- describe('compilation', function(){
- it("should compile dom node and return scope", function(){
+ describe('compilation', function() {
+ it("should compile dom node and return scope", function() {
var node = jqLite('<div ng:init="a=1">{{b=a+1}}</div>')[0];
scope = angular.compile(node)();
scope.$digest();
@@ -20,13 +20,13 @@ describe("ScenarioSpec: Compilation", function(){
expect(scope.b).toEqual(2);
});
- it("should compile jQuery node and return scope", function(){
+ it("should compile jQuery node and return scope", function() {
scope = compile(jqLite('<div>{{a=123}}</div>'))();
scope.$digest();
expect(jqLite(scope.$element).text()).toEqual('123');
});
- it("should compile text node and return scope", function(){
+ it("should compile text node and return scope", function() {
scope = angular.compile('<div>{{a=123}}</div>')();
scope.$digest();
expect(jqLite(scope.$element).text()).toEqual('123');
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js
index fa41e5a9..b1942646 100644
--- a/test/ScopeSpec.js
+++ b/test/ScopeSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('Scope', function(){
+describe('Scope', function() {
var root = null, mockHandler = null;
beforeEach(function() {
@@ -302,7 +302,7 @@ describe('Scope', function(){
});
- describe('$destroy', function(){
+ describe('$destroy', function() {
var first = null, middle = null, last = null, log = null;
beforeEach(function() {
@@ -471,7 +471,7 @@ describe('Scope', function(){
root = angular.scope(),
child = root.$new();
- function eventFn(){
+ function eventFn() {
log += 'X';
}
@@ -492,7 +492,7 @@ describe('Scope', function(){
child = root.$new(),
listenerRemove;
- function eventFn(){
+ function eventFn() {
log += 'X';
}
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index bf5c7816..c2cffca6 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('mocks', function(){
+describe('mocks', function() {
describe('TzDate', function() {
function minutes(min) {
@@ -172,26 +172,26 @@ describe('mocks', function(){
});
});
- describe('defer', function(){
+ describe('defer', function() {
var browser, log;
- beforeEach(function(){
+ beforeEach(function() {
browser = new MockBrowser();
log = '';
});
- function logFn(text){ return function(){
+ function logFn(text){ return function() {
log += text +';';
};
}
- it('should flush', function(){
+ it('should flush', function() {
browser.defer(logFn('A'));
expect(log).toEqual('');
browser.defer.flush();
expect(log).toEqual('A;');
});
- it('should flush delayed', function(){
+ it('should flush delayed', function() {
browser.defer(logFn('A'));
browser.defer(logFn('B'), 10);
browser.defer(logFn('C'), 20);
@@ -205,7 +205,7 @@ describe('mocks', function(){
expect(log).toEqual('A;B;C;');
});
- it('should defer and flush over time', function(){
+ it('should defer and flush over time', function() {
browser.defer(logFn('A'), 1);
browser.defer(logFn('B'), 2);
browser.defer(logFn('C'), 3);
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 1cbb92b0..8c07cf70 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -63,8 +63,8 @@ describe("directive", function() {
expect(lowercase(element.html())).toEqual('<a>hello</a>');
});
- it('should have $element set to current bind element', function(){
- angularFilter.myFilter = function(){
+ it('should have $element set to current bind element', function() {
+ angularFilter.myFilter = function() {
this.$element.addClass("filter");
return 'HELLO';
};
@@ -80,7 +80,7 @@ describe("directive", function() {
expect(scope.$element.text()).toEqual('-0false');
});
- it('should render object as JSON ignore $$', function(){
+ it('should render object as JSON ignore $$', function() {
var scope = compile('<div>{{ {key:"value", $$key:"hide"} }}</div>');
scope.$digest();
expect(fromJson(scope.$element.text())).toEqual({key:'value'});
@@ -108,7 +108,7 @@ describe("directive", function() {
expect(innerText).toEqual('INNER');
});
- it('should render object as JSON ignore $$', function(){
+ it('should render object as JSON ignore $$', function() {
var scope = compile('<pre>{{ {key:"value", $$key:"hide"} }}</pre>');
scope.$digest();
expect(fromJson(scope.$element.text())).toEqual({key:'value'});
@@ -148,7 +148,7 @@ describe("directive", function() {
expect(input.checked).toEqual(true);
});
- describe('ng:click', function(){
+ describe('ng:click', function() {
it('should get called on a click', function() {
var scope = compile('<div ng:click="clicked = true"></div>');
scope.$digest();
@@ -208,7 +208,7 @@ describe("directive", function() {
});
- it('should support adding multiple classes via an array', function(){
+ it('should support adding multiple classes via an array', function() {
var scope = compile('<div class="existing" ng:class="[\'A\', \'B\']"></div>');
scope.$digest();
expect(element.hasClass('existing')).toBeTruthy();
@@ -217,7 +217,7 @@ describe("directive", function() {
});
- it('should support adding multiple classes via a space delimited string', function(){
+ it('should support adding multiple classes via a space delimited string', function() {
var scope = compile('<div class="existing" ng:class="\'A B\'"></div>');
scope.$digest();
expect(element.hasClass('existing')).toBeTruthy();
@@ -420,7 +420,7 @@ describe("directive", function() {
});
describe('ng:hide', function() {
- it('should hide an element', function(){
+ it('should hide an element', function() {
var element = jqLite('<div ng:hide="exp"></div>'),
scope = compile(element);
@@ -480,7 +480,7 @@ describe("directive", function() {
expect(scope.$element.text()).toEqual('hey dude!');
});
- it('should infer injection arguments', function(){
+ it('should infer injection arguments', function() {
temp.MyController = function($xhr){
this.$root.someService = $xhr;
};
diff --git a/test/jQueryPatchSpec.js b/test/jQueryPatchSpec.js
index 0953bdac..19f4d821 100644
--- a/test/jQueryPatchSpec.js
+++ b/test/jQueryPatchSpec.js
@@ -2,14 +2,14 @@
if (window.jQuery) {
- describe('jQuery patch', function(){
+ describe('jQuery patch', function() {
var doc = null;
var divSpy = null;
var spy1 = null;
var spy2 = null;
- beforeEach(function(){
+ beforeEach(function() {
divSpy = jasmine.createSpy('div.$destroy');
spy1 = jasmine.createSpy('span1.$destroy');
spy2 = jasmine.createSpy('span2.$destroy');
@@ -18,7 +18,7 @@ if (window.jQuery) {
doc.find('span.second').bind('$destroy', spy2);
});
- afterEach(function(){
+ afterEach(function() {
expect(divSpy).not.toHaveBeenCalled();
expect(spy1).toHaveBeenCalled();
@@ -27,29 +27,29 @@ if (window.jQuery) {
expect(spy2.callCount).toEqual(1);
});
- describe('$detach event', function(){
+ describe('$detach event', function() {
- it('should fire on detach()', function(){
+ it('should fire on detach()', function() {
doc.find('span').detach();
});
- it('should fire on remove()', function(){
+ it('should fire on remove()', function() {
doc.find('span').remove();
});
- it('should fire on replaceWith()', function(){
+ it('should fire on replaceWith()', function() {
doc.find('span').replaceWith('<b>bla</b>');
});
- it('should fire on replaceAll()', function(){
+ it('should fire on replaceAll()', function() {
$('<b>bla</b>').replaceAll(doc.find('span'));
});
- it('should fire on empty()', function(){
+ it('should fire on empty()', function() {
doc.empty();
});
- it('should fire on html()', function(){
+ it('should fire on html()', function() {
doc.html('abc');
});
});
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 28cc7b90..96712210 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -1,16 +1,16 @@
'use strict';
-describe('jqLite', function(){
+describe('jqLite', function() {
var scope, a, b, c;
- beforeEach(function(){
+ beforeEach(function() {
a = jqLite('<div>A</div>')[0];
b = jqLite('<div>B</div>')[0];
c = jqLite('<div>C</div>')[0];
});
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
this.addMatchers({
toJqEqual: function(expected) {
@@ -32,7 +32,7 @@ describe('jqLite', function(){
});
- afterEach(function(){
+ afterEach(function() {
dealoc(a);
dealoc(b);
dealoc(c);
@@ -44,8 +44,8 @@ describe('jqLite', function(){
});
- describe('construction', function(){
- it('should allow construction with text node', function(){
+ describe('construction', function() {
+ it('should allow construction with text node', function() {
var text = a.firstChild;
var selected = jqLite(text);
expect(selected.length).toEqual(1);
@@ -53,7 +53,7 @@ describe('jqLite', function(){
});
- it('should allow construction with html', function(){
+ it('should allow construction with html', function() {
var nodes = jqLite('<div>1</div><span>2</span>');
expect(nodes.length).toEqual(2);
expect(nodes[0].innerHTML).toEqual('1');
@@ -138,8 +138,8 @@ describe('jqLite', function(){
});
- describe('data', function(){
- it('should set and get and remove data', function(){
+ describe('data', function() {
+ it('should set and get and remove data', function() {
var selected = jqLite([a, b, c]);
expect(selected.data('prop', 'value')).toEqual(selected);
@@ -160,18 +160,18 @@ describe('jqLite', function(){
expect(jqLite(c).data('prop')).toEqual(undefined);
});
- it('should call $destroy function if element removed', function(){
+ it('should call $destroy function if element removed', function() {
var log = '';
var element = jqLite(a);
- element.bind('$destroy', function(){log+= 'destroy;';});
+ element.bind('$destroy', function() {log+= 'destroy;';});
element.remove();
expect(log).toEqual('destroy;');
});
});
- describe('attr', function(){
- it('shoul read write and remove attr', function(){
+ describe('attr', function() {
+ it('shoul read write and remove attr', function() {
var selector = jqLite([a, b]);
expect(selector.attr('prop', 'value')).toEqual(selector);
@@ -191,7 +191,7 @@ describe('jqLite', function(){
expect(jqLite(b).attr('prop')).toBeFalsy();
});
- it('should read special attributes as strings', function(){
+ it('should read special attributes as strings', function() {
var select = jqLite('<select>');
expect(select.attr('multiple')).toBeUndefined();
expect(jqLite('<select multiple>').attr('multiple')).toBe('multiple');
@@ -244,16 +244,16 @@ describe('jqLite', function(){
});
- describe('class', function(){
+ describe('class', function() {
- describe('hasClass', function(){
- it('should check class', function(){
+ describe('hasClass', function() {
+ it('should check class', function() {
var selector = jqLite([a, b]);
expect(selector.hasClass('abc')).toEqual(false);
});
- it('should make sure that partial class is not checked as a subset', function(){
+ it('should make sure that partial class is not checked as a subset', function() {
var selector = jqLite([a, b]);
selector.addClass('a');
selector.addClass('b');
@@ -316,8 +316,8 @@ describe('jqLite', function(){
});
- describe('toggleClass', function(){
- it('should allow toggling of class', function(){
+ describe('toggleClass', function() {
+ it('should allow toggling of class', function() {
var selector = jqLite([a, b]);
expect(selector.toggleClass('abc')).toEqual(selector);
expect(jqLite(a).hasClass('abc')).toEqual(true);
@@ -339,8 +339,8 @@ describe('jqLite', function(){
});
- describe('removeClass', function(){
- it('should allow removal of class', function(){
+ describe('removeClass', function() {
+ it('should allow removal of class', function() {
var selector = jqLite([a, b]);
expect(selector.addClass('abc')).toEqual(selector);
expect(selector.removeClass('abc')).toEqual(selector);
@@ -372,8 +372,8 @@ describe('jqLite', function(){
});
- describe('css', function(){
- it('should set and read css', function(){
+ describe('css', function() {
+ it('should set and read css', function() {
var selector = jqLite([a, b]);
expect(selector.css('margin', '1px')).toEqual(selector);
@@ -439,14 +439,14 @@ describe('jqLite', function(){
});
- describe('text', function(){
- it('should return null on empty', function(){
+ describe('text', function() {
+ it('should return null on empty', function() {
expect(jqLite().length).toEqual(0);
expect(jqLite().text()).toEqual('');
});
- it('should read/write value', function(){
+ it('should read/write value', function() {
var element = jqLite('<div>abc</div>');
expect(element.length).toEqual(1);
expect(element[0].innerHTML).toEqual('abc');
@@ -457,8 +457,8 @@ describe('jqLite', function(){
});
- describe('val', function(){
- it('should read, write value', function(){
+ describe('val', function() {
+ it('should read, write value', function() {
var input = jqLite('<input type="text"/>');
expect(input.val('abc')).toEqual(input);
expect(input[0].value).toEqual('abc');
@@ -467,14 +467,14 @@ describe('jqLite', function(){
});
- describe('html', function(){
- it('should return null on empty', function(){
+ describe('html', function() {
+ it('should return null on empty', function() {
expect(jqLite().length).toEqual(0);
expect(jqLite().html()).toEqual(null);
});
- it('should read/write value', function(){
+ it('should read/write value', function() {
var element = jqLite('<div>abc</div>');
expect(element.length).toEqual(1);
expect(element[0].innerHTML).toEqual('abc');
@@ -485,8 +485,8 @@ describe('jqLite', function(){
});
- describe('bind', function(){
- it('should bind to window on hashchange', function(){
+ describe('bind', function() {
+ it('should bind to window on hashchange', function() {
if (jqLite.fn) return; // don't run in jQuery
var eventFn;
var window = {
@@ -507,7 +507,7 @@ describe('jqLite', function(){
detachEvent: noop
};
var log;
- var jWindow = jqLite(window).bind('hashchange', function(){
+ var jWindow = jqLite(window).bind('hashchange', function() {
log = 'works!';
});
eventFn({});
@@ -516,10 +516,10 @@ describe('jqLite', function(){
});
- it('should bind to all elements and return functions', function(){
+ it('should bind to all elements and return functions', function() {
var selected = jqLite([a, b]);
var log = '';
- expect(selected.bind('click', function(){
+ expect(selected.bind('click', function() {
log += 'click on: ' + jqLite(this).text() + ';';
})).toEqual(selected);
browserTrigger(a, 'click');
@@ -664,8 +664,8 @@ describe('jqLite', function(){
});
- describe('replaceWith', function(){
- it('should replaceWith', function(){
+ describe('replaceWith', function() {
+ it('should replaceWith', function() {
var root = jqLite('<div>').html('before-<div></div>after');
var div = root.find('div');
expect(div.replaceWith('<span>span-</span><b>bold-</b>')).toEqual(div);
@@ -673,7 +673,7 @@ describe('jqLite', function(){
});
- it('should replaceWith text', function(){
+ it('should replaceWith text', function() {
var root = jqLite('<div>').html('before-<div></div>after');
var div = root.find('div');
expect(div.replaceWith('text-')).toEqual(div);
@@ -682,8 +682,8 @@ describe('jqLite', function(){
});
- describe('children', function(){
- it('should select non-text children', function(){
+ describe('children', function() {
+ it('should select non-text children', function() {
var root = jqLite('<div>').html('before-<div></div>after-<span></span>');
var div = root.find('div');
var span = root.find('span');
@@ -692,13 +692,13 @@ describe('jqLite', function(){
});
- describe('append', function(){
- it('should append', function(){
+ describe('append', function() {
+ it('should append', function() {
var root = jqLite('<div>');
expect(root.append('<span>abc</span>')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('<span>abc</span>');
});
- it('should append text', function(){
+ it('should append text', function() {
var root = jqLite('<div>');
expect(root.append('text')).toEqual(root);
expect(root.html()).toEqual('text');
@@ -710,18 +710,18 @@ describe('jqLite', function(){
});
});
- describe('prepend', function(){
- it('should prepend to empty', function(){
+ describe('prepend', function() {
+ it('should prepend to empty', function() {
var root = jqLite('<div>');
expect(root.prepend('<span>abc</span>')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('<span>abc</span>');
});
- it('should prepend to content', function(){
+ it('should prepend to content', function() {
var root = jqLite('<div>text</div>');
expect(root.prepend('<span>abc</span>')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('<span>abc</span>text');
});
- it('should prepend text to content', function(){
+ it('should prepend text to content', function() {
var root = jqLite('<div>text</div>');
expect(root.prepend('abc')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('abctext');
@@ -729,8 +729,8 @@ describe('jqLite', function(){
});
- describe('remove', function(){
- it('should remove', function(){
+ describe('remove', function() {
+ it('should remove', function() {
var root = jqLite('<div><span>abc</span></div>');
var span = root.find('span');
expect(span.remove()).toEqual(span);
@@ -739,8 +739,8 @@ describe('jqLite', function(){
});
- describe('after', function(){
- it('should after', function(){
+ describe('after', function() {
+ it('should after', function() {
var root = jqLite('<div><span></span></div>');
var span = root.find('span');
expect(span.after('<i></i><b></b>')).toEqual(span);
@@ -748,7 +748,7 @@ describe('jqLite', function(){
});
- it('should allow taking text', function(){
+ it('should allow taking text', function() {
var root = jqLite('<div><span></span></div>');
var span = root.find('span');
span.after('abc');
@@ -757,8 +757,8 @@ describe('jqLite', function(){
});
- describe('parent', function(){
- it('should return parent or an empty set when no parent', function(){
+ describe('parent', function() {
+ it('should return parent or an empty set when no parent', function() {
var parent = jqLite('<div><p>abc</p></div>'),
child = parent.find('p');
@@ -790,7 +790,7 @@ describe('jqLite', function(){
describe('next', function() {
- it('should return next sibling', function(){
+ it('should return next sibling', function() {
var element = jqLite('<div><b>b</b><i>i</i></div>');
var b = element.find('b');
var i = element.find('i');
@@ -800,7 +800,7 @@ describe('jqLite', function(){
describe('find', function() {
- it('should find child by name', function(){
+ it('should find child by name', function() {
var root = jqLite('<div><div>text</div></div>');
var innerDiv = root.find('div');
expect(innerDiv.length).toEqual(1);
diff --git a/test/jstd-scenario-adapter/AdapterSpecs.js b/test/jstd-scenario-adapter/AdapterSpecs.js
index f0d54d3c..e360ad4f 100644
--- a/test/jstd-scenario-adapter/AdapterSpecs.js
+++ b/test/jstd-scenario-adapter/AdapterSpecs.js
@@ -42,7 +42,7 @@ describe('jstd-adapter', function() {
*/
function buildTestConf(type) {
return new jstestdriver.TestRunConfiguration(
- new jstestdriver.TestCaseInfo('Fake test - ' + Math.random(), function(){}, type), null);
+ new jstestdriver.TestCaseInfo('Fake test - ' + Math.random(), function() {}, type), null);
}
/**
diff --git a/test/manual.html b/test/manual.html
index ef2fff3a..8aa64128 100644
--- a/test/manual.html
+++ b/test/manual.html
@@ -52,7 +52,7 @@
<!-- include spec files here... -->
<script type="text/javascript">
-describe('manual', function(){
+describe('manual', function() {
var compile, model, element;
beforeEach(function() {
@@ -120,7 +120,7 @@ describe('angular.scenario.output.json', function() {
<script type="text/javascript">
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
- function run(){
+ function run() {
jasmine.getEnv().execute();
}
run();
diff --git a/test/markupSpec.js b/test/markupSpec.js
index bd77c058..d505ee73 100644
--- a/test/markupSpec.js
+++ b/test/markupSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("markups", function(){
+describe("markups", function() {
var compile, element, scope;
@@ -13,11 +13,11 @@ describe("markups", function(){
};
});
- afterEach(function(){
+ afterEach(function() {
dealoc(element);
});
- it('should translate {{}} in text', function(){
+ it('should translate {{}} in text', function() {
compile('<div>hello {{name}}!</div>');
expect(sortedHtml(element)).toEqual('<div>hello <span ng:bind="name"></span>!</div>');
scope.name = 'Misko';
@@ -25,7 +25,7 @@ describe("markups", function(){
expect(sortedHtml(element)).toEqual('<div>hello <span ng:bind="name">Misko</span>!</div>');
});
- it('should translate {{}} in terminal nodes', function(){
+ it('should translate {{}} in terminal nodes', function() {
compile('<select ng:model="x"><option value="">Greet {{name}}!</option></select>');
scope.$digest();
expect(sortedHtml(element).replace(' selected="true"', '')).
@@ -40,7 +40,7 @@ describe("markups", function(){
'</select>');
});
- it('should translate {{}} in attributes', function(){
+ it('should translate {{}} in attributes', function() {
compile('<div src="http://server/{{path}}.png"/>');
expect(element.attr('ng:bind-attr')).toEqual('{"src":"http://server/{{path}}.png"}');
scope.path = 'a/b';
@@ -48,11 +48,11 @@ describe("markups", function(){
expect(element.attr('src')).toEqual("http://server/a/b.png");
});
- describe('OPTION value', function(){
- beforeEach(function(){
+ describe('OPTION value', function() {
+ beforeEach(function() {
this.addMatchers({
toHaveValue: function(expected){
- this.message = function(){
+ this.message = function() {
return 'Expected "' + this.actual.html() + '" to have value="' + expected + '".';
};
@@ -74,22 +74,22 @@ describe("markups", function(){
});
- it('should populate value attribute on OPTION', function(){
+ it('should populate value attribute on OPTION', function() {
compile('<select ng:model="x"><option>abc</option></select>');
expect(element).toHaveValue('abc');
});
- it('should ignore value if already exists', function(){
+ it('should ignore value if already exists', function() {
compile('<select ng:model="x"><option value="abc">xyz</option></select>');
expect(element).toHaveValue('abc');
});
- it('should set value even if newlines present', function(){
+ it('should set value even if newlines present', function() {
compile('<select ng:model="x"><option attr="\ntext\n" \n>\nabc\n</option></select>');
expect(element).toHaveValue('\nabc\n');
});
- it('should set value even if self closing HTML', function(){
+ it('should set value even if self closing HTML', function() {
// IE removes the \n from option, which makes this test pointless
if (msie) return;
compile('<select ng:model="x"><option>\n</option></select>');
@@ -174,21 +174,21 @@ describe("markups", function(){
});
});
- it('should Parse Text With No Bindings', function(){
+ it('should Parse Text With No Bindings', function() {
var parts = parseBindings("a");
assertEquals(parts.length, 1);
assertEquals(parts[0], "a");
assertTrue(!binding(parts[0]));
});
- it('should Parse Empty Text', function(){
+ it('should Parse Empty Text', function() {
var parts = parseBindings("");
assertEquals(parts.length, 1);
assertEquals(parts[0], "");
assertTrue(!binding(parts[0]));
});
- it('should Parse Inner Binding', function(){
+ it('should Parse Inner Binding', function() {
var parts = parseBindings("a{{b}}C");
assertEquals(parts.length, 3);
assertEquals(parts[0], "a");
@@ -199,7 +199,7 @@ describe("markups", function(){
assertTrue(!binding(parts[2]));
});
- it('should Parse Ending Binding', function(){
+ it('should Parse Ending Binding', function() {
var parts = parseBindings("a{{b}}");
assertEquals(parts.length, 2);
assertEquals(parts[0], "a");
@@ -208,7 +208,7 @@ describe("markups", function(){
assertEquals(binding(parts[1]), "b");
});
- it('should Parse Begging Binding', function(){
+ it('should Parse Begging Binding', function() {
var parts = parseBindings("{{b}}c");
assertEquals(parts.length, 2);
assertEquals(parts[0], "{{b}}");
@@ -217,14 +217,14 @@ describe("markups", function(){
assertTrue(!binding(parts[1]));
});
- it('should Parse Loan Binding', function(){
+ it('should Parse Loan Binding', function() {
var parts = parseBindings("{{b}}");
assertEquals(parts.length, 1);
assertEquals(parts[0], "{{b}}");
assertEquals(binding(parts[0]), "b");
});
- it('should Parse Two Bindings', function(){
+ it('should Parse Two Bindings', function() {
var parts = parseBindings("{{b}}{{c}}");
assertEquals(parts.length, 2);
assertEquals(parts[0], "{{b}}");
@@ -233,7 +233,7 @@ describe("markups", function(){
assertEquals(binding(parts[1]), "c");
});
- it('should Parse Two Bindings With Text In Middle', function(){
+ it('should Parse Two Bindings With Text In Middle', function() {
var parts = parseBindings("{{b}}x{{c}}");
assertEquals(parts.length, 3);
assertEquals(parts[0], "{{b}}");
@@ -244,7 +244,7 @@ describe("markups", function(){
assertEquals(binding(parts[2]), "c");
});
- it('should Parse Multiline', function(){
+ it('should Parse Multiline', function() {
var parts = parseBindings('"X\nY{{A\nB}}C\nD"');
assertTrue(!!binding('{{A\nB}}'));
assertEquals(parts.length, 3);
@@ -253,7 +253,7 @@ describe("markups", function(){
assertEquals(parts[2], 'C\nD"');
});
- it('should Has Binding', function(){
+ it('should Has Binding', function() {
assertTrue(hasBindings(parseBindings("{{a}}")));
assertTrue(!hasBindings(parseBindings("a")));
assertTrue(hasBindings(parseBindings("{{b}}x{{c}}")));
diff --git a/test/mocks.js b/test/mocks.js
index 37e1d31b..da0449ac 100644
--- a/test/mocks.js
+++ b/test/mocks.js
@@ -30,10 +30,10 @@
* See {@link angular.mock} for more info on angular mocks.
*/
var $logMock = {
- log: function(){ $logMock.log.logs.push(concat([], arguments, 0)); },
- warn: function(){ $logMock.warn.logs.push(concat([], arguments, 0)); },
- info: function(){ $logMock.info.logs.push(concat([], arguments, 0)); },
- error: function(){ $logMock.error.logs.push(concat([], arguments, 0)); }
+ log: function() { $logMock.log.logs.push(concat([], arguments, 0)); },
+ warn: function() { $logMock.warn.logs.push(concat([], arguments, 0)); },
+ info: function() { $logMock.info.logs.push(concat([], arguments, 0)); },
+ error: function() { $logMock.error.logs.push(concat([], arguments, 0)); }
};
$logMock.log.logs = [];
$logMock.warn.logs = [];
diff --git a/test/sanitizerSpec.js b/test/sanitizerSpec.js
index f5ac69ff..7467a833 100644
--- a/test/sanitizerSpec.js
+++ b/test/sanitizerSpec.js
@@ -1,14 +1,14 @@
'use strict';
-describe('HTML', function(){
+describe('HTML', function() {
function expectHTML(html) {
return expect(new HTML(html).get());
}
- describe('htmlParser', function(){
+ describe('htmlParser', function() {
var handler, start, text;
- beforeEach(function(){
+ beforeEach(function() {
handler = {
start: function(tag, attrs, unary){
start = {
@@ -31,31 +31,31 @@ describe('HTML', function(){
};
});
- it('should parse basic format', function(){
+ it('should parse basic format', function() {
htmlParser('<tag attr="value">text</tag>', handler);
expect(start).toEqual({tag:'tag', attrs:{attr:'value'}, unary:false});
expect(text).toEqual('text');
});
- it('should parse newlines in tags', function(){
+ it('should parse newlines in tags', function() {
htmlParser('<\ntag\n attr="value"\n>text<\n/\ntag\n>', handler);
expect(start).toEqual({tag:'tag', attrs:{attr:'value'}, unary:false});
expect(text).toEqual('text');
});
- it('should parse newlines in attributes', function(){
+ it('should parse newlines in attributes', function() {
htmlParser('<tag attr="\nvalue\n">text</tag>', handler);
expect(start).toEqual({tag:'tag', attrs:{attr:'value'}, unary:false});
expect(text).toEqual('text');
});
- it('should parse namespace', function(){
+ it('should parse namespace', function() {
htmlParser('<ns:t-a-g ns:a-t-t-r="\nvalue\n">text</ns:t-a-g>', handler);
expect(start).toEqual({tag:'ns:t-a-g', attrs:{'ns:a-t-t-r':'value'}, unary:false});
expect(text).toEqual('text');
});
- it('should parse empty value attribute of node', function(){
+ it('should parse empty value attribute of node', function() {
htmlParser('<OPTION selected value="">abc</OPTION>', handler);
expect(start).toEqual({tag:'option', attrs:{selected:'', value:''}, unary:false});
expect(text).toEqual('abc');
@@ -63,87 +63,87 @@ describe('HTML', function(){
});
- it('should echo html', function(){
+ it('should echo html', function() {
expectHTML('hello<b class="1\'23" align=\'""\'>world</b>.').
toEqual('hello<b class="1\'23" align="&#34;&#34;">world</b>.');
});
- it('should remove script', function(){
+ it('should remove script', function() {
expectHTML('a<SCRIPT>evil< / scrIpt >c.').toEqual('ac.');
});
- it('should remove nested script', function(){
+ it('should remove nested script', function() {
expectHTML('a< SCRIPT >A< SCRIPT >evil< / scrIpt >B< / scrIpt >c.').toEqual('ac.');
});
- it('should remove attrs', function(){
+ it('should remove attrs', function() {
expectHTML('a<div style="abc">b</div>c').toEqual('a<div>b</div>c');
});
- it('should remove style', function(){
+ it('should remove style', function() {
expectHTML('a<STyle>evil</stYle>c.').toEqual('ac.');
});
- it('should remove script and style', function(){
+ it('should remove script and style', function() {
expectHTML('a<STyle>evil<script></script></stYle>c.').toEqual('ac.');
});
- it('should remove double nested script', function(){
+ it('should remove double nested script', function() {
expectHTML('a<SCRIPT>ev<script>evil</sCript>il</scrIpt>c.').toEqual('ac.');
});
- it('should remove unknown names', function(){
+ it('should remove unknown names', function() {
expectHTML('a<xxx><B>b</B></xxx>c').toEqual('a<b>b</b>c');
});
- it('should remove unsafe value', function(){
+ it('should remove unsafe value', function() {
expectHTML('<a href="javascript:alert()">').toEqual('<a></a>');
});
- it('should handle self closed elements', function(){
+ it('should handle self closed elements', function() {
expectHTML('a<hr/>c').toEqual('a<hr/>c');
});
- it('should handle namespace', function(){
+ it('should handle namespace', function() {
expectHTML('a<my:hr/><my:div>b</my:div>c').toEqual('abc');
});
- it('should handle entities', function(){
+ it('should handle entities', function() {
var everything = '<div rel="!@#$%^&amp;*()_+-={}[]:&#34;;\'&lt;&gt;?,./`~ &#295;">' +
'!@#$%^&amp;*()_+-={}[]:&#34;;\'&lt;&gt;?,./`~ &#295;</div>';
expectHTML(everything).toEqual(everything);
});
- it('should handle improper html', function(){
+ it('should handle improper html', function() {
expectHTML('< div rel="</div>" alt=abc dir=\'"\' >text< /div>').
toEqual('<div rel="&lt;/div&gt;" alt="abc" dir="&#34;">text</div>');
});
- it('should handle improper html2', function(){
+ it('should handle improper html2', function() {
expectHTML('< div rel="</div>" / >').
toEqual('<div rel="&lt;/div&gt;"/>');
});
- it('should ignore back slash as escape', function(){
+ it('should ignore back slash as escape', function() {
expectHTML('<img alt="xxx\\" title="><script>....">').
toEqual('<img alt="xxx\\" title="&gt;&lt;script&gt;...."/>');
});
- it('should ignore object attributes', function(){
+ it('should ignore object attributes', function() {
expectHTML('<a constructor="hola">:)</a>').
toEqual('<a>:)</a>');
expectHTML('<constructor constructor="hola">:)</constructor>').
toEqual('');
});
- describe('htmlSanitizerWriter', function(){
+ describe('htmlSanitizerWriter', function() {
var writer, html;
- beforeEach(function(){
+ beforeEach(function() {
html = '';
writer = htmlSanitizeWriter({push:function(text){html+=text;}});
});
- it('should write basic HTML', function(){
+ it('should write basic HTML', function() {
writer.chars('before');
writer.start('div', {rel:'123'}, false);
writer.chars('in');
@@ -153,38 +153,38 @@ describe('HTML', function(){
expect(html).toEqual('before<div rel="123">in</div>after');
});
- it('should escape text nodes', function(){
+ it('should escape text nodes', function() {
writer.chars('a<div>&</div>c');
expect(html).toEqual('a&lt;div&gt;&amp;&lt;/div&gt;c');
});
- it('should escape IE script', function(){
+ it('should escape IE script', function() {
writer.chars('&<>{}');
expect(html).toEqual('&amp;&lt;&gt;{}');
});
- it('should escape attributes', function(){
+ it('should escape attributes', function() {
writer.start('div', {rel:'!@#$%^&*()_+-={}[]:";\'<>?,./`~ \n\0\r\u0127'});
expect(html).toEqual('<div rel="!@#$%^&amp;*()_+-={}[]:&#34;;\'&lt;&gt;?,./`~ &#10;&#0;&#13;&#295;">');
});
- it('should ignore missformed elements', function(){
+ it('should ignore missformed elements', function() {
writer.start('d>i&v', {});
expect(html).toEqual('');
});
- it('should ignore unknown attributes', function(){
+ it('should ignore unknown attributes', function() {
writer.start('div', {unknown:""});
expect(html).toEqual('<div>');
});
- describe('explicitly dissallow', function(){
- it('should not allow attributes', function(){
+ describe('explicitly dissallow', function() {
+ it('should not allow attributes', function() {
writer.start('div', {id:'a', name:'a', style:'a'});
expect(html).toEqual('<div>');
});
- it('should not allow tags', function(){
+ it('should not allow tags', function() {
function tag(name) {
writer.start(name, {});
writer.end(name);
@@ -209,13 +209,13 @@ describe('HTML', function(){
});
});
- describe('isUri', function(){
+ describe('isUri', function() {
function isUri(value) {
return value.match(URI_REGEXP);
}
- it('should be URI', function(){
+ it('should be URI', function() {
expect(isUri('http://abc')).toBeTruthy();
expect(isUri('https://abc')).toBeTruthy();
expect(isUri('ftp://abc')).toBeTruthy();
@@ -223,46 +223,46 @@ describe('HTML', function(){
expect(isUri('#anchor')).toBeTruthy();
});
- it('should not be UIR', function(){
+ it('should not be UIR', function() {
expect(isUri('')).toBeFalsy();
expect(isUri('javascript:alert')).toBeFalsy();
});
});
- describe('javascript URL attribute', function(){
- beforeEach(function(){
+ describe('javascript URL attribute', function() {
+ beforeEach(function() {
this.addMatchers({
- toBeValidUrl: function(){
+ toBeValidUrl: function() {
return URI_REGEXP.exec(this.actual);
}
});
});
- it('should ignore javascript:', function(){
+ it('should ignore javascript:', function() {
expect('JavaScript:abc').not.toBeValidUrl();
expect(' \n Java\n Script:abc').not.toBeValidUrl();
expect('http://JavaScript/my.js').toBeValidUrl();
});
- it('should ignore dec encoded javascript:', function(){
+ it('should ignore dec encoded javascript:', function() {
expect('&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;').not.toBeValidUrl();
expect('&#106&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;').not.toBeValidUrl();
expect('&#106 &#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;').not.toBeValidUrl();
});
- it('should ignore decimal with leading 0 encodede javascript:', function(){
+ it('should ignore decimal with leading 0 encodede javascript:', function() {
expect('&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058').not.toBeValidUrl();
expect('&#0000106 &#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058').not.toBeValidUrl();
expect('&#0000106; &#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058').not.toBeValidUrl();
});
- it('should ignore hex encoded javascript:', function(){
+ it('should ignore hex encoded javascript:', function() {
expect('&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A;').not.toBeValidUrl();
expect('&#x6A;&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A;').not.toBeValidUrl();
expect('&#x6A &#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A;').not.toBeValidUrl();
});
- it('should ignore hex encoded whitespace javascript:', function(){
+ it('should ignore hex encoded whitespace javascript:', function() {
expect('jav&#x09;ascript:alert("A");').not.toBeValidUrl();
expect('jav&#x0A;ascript:alert("B");').not.toBeValidUrl();
expect('jav&#x0A ascript:alert("C");').not.toBeValidUrl();
diff --git a/test/scenario/DescribeSpec.js b/test/scenario/DescribeSpec.js
index 173b0807..6741ed6d 100644
--- a/test/scenario/DescribeSpec.js
+++ b/test/scenario/DescribeSpec.js
@@ -26,11 +26,11 @@ describe('angular.scenario.Describe', function() {
});
it('should handle basic nested case', function() {
- root.describe('A', function(){
+ root.describe('A', function() {
this.beforeEach(log.fn('{'));
this.afterEach(log.fn('}'));
this.it('1', log.fn('1'));
- this.describe('B', function(){
+ this.describe('B', function() {
this.beforeEach(log.fn('('));
this.afterEach(log.fn(')'));
this.it('2', log.fn('2'));
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js
index 3fc69c14..a6e80901 100644
--- a/test/scenario/dslSpec.js
+++ b/test/scenario/dslSpec.js
@@ -212,7 +212,7 @@ describe("angular.scenario.dsl", function() {
expect(_jQuery('[ng\\:model="test"]').val()).toEqual('A');
});
- it('should select option by name', function(){
+ it('should select option by name', function() {
doc.append(
'<select ng:model="test">' +
' <option value=A>one</option>' +
diff --git a/test/scenario/e2e/widgets-scenario.js b/test/scenario/e2e/widgets-scenario.js
index ca0f8130..fda9b3c6 100644
--- a/test/scenario/e2e/widgets-scenario.js
+++ b/test/scenario/e2e/widgets-scenario.js
@@ -1,7 +1,7 @@
'use strict';
describe('widgets', function() {
- it('should verify that basic widgets work', function(){
+ it('should verify that basic widgets work', function() {
browser().navigateTo('widgets.html');
using('#text-basic-box').input('text.basic').enter('Carlos');
diff --git a/test/service/cookieStoreSpec.js b/test/service/cookieStoreSpec.js
index fa4f3ceb..0bf7e99d 100644
--- a/test/service/cookieStoreSpec.js
+++ b/test/service/cookieStoreSpec.js
@@ -9,7 +9,7 @@ describe('$cookieStore', function() {
$browser = scope.$service('$browser');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
diff --git a/test/service/cookiesSpec.js b/test/service/cookiesSpec.js
index 782cee72..f078c20c 100644
--- a/test/service/cookiesSpec.js
+++ b/test/service/cookiesSpec.js
@@ -10,13 +10,13 @@ describe('$cookies', function() {
scope.$cookies = scope.$service('$cookies');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
it('should provide access to existing cookies via object properties and keep them in sync',
- function(){
+ function() {
expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
// access internal cookie storage of the browser mock directly to simulate behavior of
@@ -55,7 +55,7 @@ describe('$cookies', function() {
scope.$cookies.nonString = [1, 2, 3];
scope.$cookies.nullVal = null;
scope.$cookies.undefVal = undefined;
- scope.$cookies.preexisting = function(){};
+ scope.$cookies.preexisting = function() {};
scope.$digest();
expect($browser.cookies()).toEqual({'preexisting': 'oldCookie'});
expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
diff --git a/test/service/deferSpec.js b/test/service/deferSpec.js
index 4f651522..ad1459ec 100644
--- a/test/service/deferSpec.js
+++ b/test/service/deferSpec.js
@@ -3,7 +3,7 @@
describe('$defer', function() {
var scope, $browser, $defer, $exceptionHandler;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service,
{'$exceptionHandler': jasmine.createSpy('$exceptionHandler')});
$browser = scope.$service('$browser');
@@ -11,7 +11,7 @@ describe('$defer', function() {
$exceptionHandler = scope.$service('$exceptionHandler');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -69,7 +69,7 @@ describe('$defer', function() {
expect(applySpy).toHaveBeenCalled();
});
- it('should allow you to specify the delay time', function(){
+ it('should allow you to specify the delay time', function() {
var defer = this.spyOn($browser, 'defer');
$defer(noop, 123);
expect(defer.callCount).toEqual(1);
diff --git a/test/service/documentSpec.js b/test/service/documentSpec.js
index 79c752e4..885331e4 100644
--- a/test/service/documentSpec.js
+++ b/test/service/documentSpec.js
@@ -3,17 +3,17 @@
describe('$document', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it("should inject $document", function(){
+ it("should inject $document", function() {
expect(scope.$service('$document')).toEqual(jqLite(document));
});
});
diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js
index 74f37cb9..61e652b5 100644
--- a/test/service/exceptionHandlerSpec.js
+++ b/test/service/exceptionHandlerSpec.js
@@ -3,17 +3,17 @@
describe('$exceptionHandler', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should log errors', function(){
+ it('should log errors', function() {
var scope = createScope({$exceptionHandler: $exceptionHandlerFactory},
{$log: $logMock}),
$log = scope.$service('$log'),
diff --git a/test/service/formFactorySpec.js b/test/service/formFactorySpec.js
index 5223cede..23b8ae0a 100644
--- a/test/service/formFactorySpec.js
+++ b/test/service/formFactorySpec.js
@@ -1,23 +1,23 @@
'use strict';
-describe('$formFactory', function(){
+describe('$formFactory', function() {
var rootScope;
var formFactory;
- beforeEach(function(){
+ beforeEach(function() {
rootScope = angular.scope();
formFactory = rootScope.$service('$formFactory');
});
- it('should have global form', function(){
+ it('should have global form', function() {
expect(formFactory.rootForm).toBeTruthy();
expect(formFactory.rootForm.$createWidget).toBeTruthy();
});
- describe('new form', function(){
+ describe('new form', function() {
var form;
var scope;
var log;
@@ -25,7 +25,7 @@ describe('$formFactory', function(){
function WidgetCtrl($formFactory){
this.$formFactory = $formFactory;
log += '<init>';
- this.$render = function(){
+ this.$render = function() {
log += '$render();';
};
this.$on('$validate', function(e){
@@ -41,13 +41,13 @@ describe('$formFactory', function(){
}
};
- beforeEach(function(){
+ beforeEach(function() {
log = '';
scope = rootScope.$new();
form = formFactory(scope);
});
- describe('$createWidget', function(){
+ describe('$createWidget', function() {
var widget;
beforeEach(function() {
@@ -55,19 +55,20 @@ describe('$formFactory', function(){
scope:scope,
model:'text',
alias:'text',
- controller:WidgetCtrl});
+ controller:WidgetCtrl
+ });
});
- describe('data flow', function(){
- it('should have status properties', function(){
+ describe('data flow', function() {
+ it('should have status properties', function() {
expect(widget.$error).toEqual({});
expect(widget.$valid).toBe(true);
expect(widget.$invalid).toBe(false);
});
- it('should update view when model changes', function(){
+ it('should update view when model changes', function() {
scope.text = 'abc';
scope.$digest();
expect(log).toEqual('<init>$validate();$render();');
@@ -80,14 +81,14 @@ describe('$formFactory', function(){
});
- it('should have controller prototype methods', function(){
+ it('should have controller prototype methods', function() {
expect(widget.getFormFactory()).toEqual(formFactory);
});
});
- describe('validation', function(){
- it('should update state on error', function(){
+ describe('validation', function() {
+ it('should update state on error', function() {
widget.$emit('$invalid', 'E');
expect(widget.$valid).toEqual(false);
expect(widget.$invalid).toEqual(true);
@@ -98,9 +99,9 @@ describe('$formFactory', function(){
});
- it('should have called the model setter before the validation', function(){
+ it('should have called the model setter before the validation', function() {
var modelValue;
- widget.$on('$validate', function(){
+ widget.$on('$validate', function() {
modelValue = scope.text;
});
widget.$emit('$viewChange', 'abc');
@@ -108,8 +109,8 @@ describe('$formFactory', function(){
});
- describe('form', function(){
- it('should invalidate form when widget is invalid', function(){
+ describe('form', function() {
+ it('should invalidate form when widget is invalid', function() {
expect(form.$error).toEqual({});
expect(form.$valid).toEqual(true);
expect(form.$invalid).toEqual(false);
@@ -147,8 +148,8 @@ describe('$formFactory', function(){
});
- describe('id assignment', function(){
- it('should default to name expression', function(){
+ describe('id assignment', function() {
+ it('should default to name expression', function() {
expect(form.text).toEqual(widget);
});
@@ -201,7 +202,7 @@ describe('$formFactory', function(){
});
- it('should remove invalid fields from errors, when child widget removed', function(){
+ it('should remove invalid fields from errors, when child widget removed', function() {
widget.$emit('$invalid', 'MyError');
expect(form.$error.MyError).toEqual([widget]);
diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js
index a312c1b2..70319af7 100644
--- a/test/service/locationSpec.js
+++ b/test/service/locationSpec.js
@@ -481,7 +481,7 @@ describe('$location', function() {
});
- it('should parse file://', function(){
+ it('should parse file://', function() {
var match = URL_MATCH.exec('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html');
expect(match[1]).toBe('file');
@@ -492,7 +492,7 @@ describe('$location', function() {
});
- it('should parse url with "-" in host', function(){
+ it('should parse url with "-" in host', function() {
var match = URL_MATCH.exec('http://a-b1.c-d.09/path');
expect(match[1]).toBe('http');
diff --git a/test/service/logSpec.js b/test/service/logSpec.js
index 499447ad..c4efb8c5 100644
--- a/test/service/logSpec.js
+++ b/test/service/logSpec.js
@@ -3,22 +3,22 @@
describe('$log', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should use console if present', function(){
+ it('should use console if present', function() {
var logger = "";
- function log(){ logger+= 'log;'; }
- function warn(){ logger+= 'warn;'; }
- function info(){ logger+= 'info;'; }
- function error(){ logger+= 'error;'; }
+ function log() { logger+= 'log;'; }
+ function warn() { logger+= 'warn;'; }
+ function info() { logger+= 'info;'; }
+ function error() { logger+= 'error;'; }
var scope = createScope({$log: $logFactory},
{$exceptionHandler: rethrow,
$window: {console: {log: log,
@@ -35,9 +35,9 @@ describe('$log', function() {
});
- it('should use console.log() if other not present', function(){
+ it('should use console.log() if other not present', function() {
var logger = "";
- function log(){ logger+= 'log;'; }
+ function log() { logger+= 'log;'; }
var scope = createScope({$log: $logFactory},
{$window: {console:{log:log}},
$exceptionHandler: rethrow});
@@ -50,7 +50,7 @@ describe('$log', function() {
});
- it('should use noop if no console', function(){
+ it('should use noop if no console', function() {
var scope = createScope({$log: $logFactory},
{$window: {},
$exceptionHandler: rethrow}),
@@ -62,36 +62,36 @@ describe('$log', function() {
});
- describe('$log.error', function(){
+ describe('$log.error', function() {
var e, $log, errorArgs;
- beforeEach(function(){
+ beforeEach(function() {
e = new Error('');
e.message = undefined;
e.sourceURL = undefined;
e.line = undefined;
e.stack = undefined;
- $log = $logFactory({console:{error:function(){
+ $log = $logFactory({console:{error:function() {
errorArgs = arguments;
}}});
});
- it('should pass error if does not have trace', function(){
+ it('should pass error if does not have trace', function() {
$log.error('abc', e);
expect(errorArgs).toEqual(['abc', e]);
});
- it('should print stack', function(){
+ it('should print stack', function() {
e.stack = 'stack';
$log.error('abc', e);
expect(errorArgs).toEqual(['abc', 'stack']);
});
- it('should print line', function(){
+ it('should print line', function() {
e.message = 'message';
e.sourceURL = 'sourceURL';
e.line = '123';
diff --git a/test/service/routeParamsSpec.js b/test/service/routeParamsSpec.js
index 8cdf3af3..972e4314 100644
--- a/test/service/routeParamsSpec.js
+++ b/test/service/routeParamsSpec.js
@@ -1,7 +1,7 @@
'use strict';
-describe('$routeParams', function(){
- it('should publish the params into a service', function(){
+describe('$routeParams', function() {
+ it('should publish the params into a service', function() {
var scope = angular.scope(),
$location = scope.$service('$location'),
$route = scope.$service('$route'),
@@ -20,7 +20,7 @@ describe('$routeParams', function(){
});
- it('should preserve object identity during route reloads', function(){
+ it('should preserve object identity during route reloads', function() {
var scope = angular.scope(),
$location = scope.$service('$location'),
$route = scope.$service('$route'),
diff --git a/test/service/windowSpec.js b/test/service/windowSpec.js
index 3ead3df3..c539e285 100644
--- a/test/service/windowSpec.js
+++ b/test/service/windowSpec.js
@@ -3,17 +3,17 @@
describe('$window', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it("should inject $window", function(){
+ it("should inject $window", function() {
expect(scope.$service('$window')).toBe(window);
});
});
diff --git a/test/service/xhr.bulkSpec.js b/test/service/xhr.bulkSpec.js
index e35673c7..6b99fbba 100644
--- a/test/service/xhr.bulkSpec.js
+++ b/test/service/xhr.bulkSpec.js
@@ -3,7 +3,7 @@
describe('$xhr.bulk', function() {
var scope, $browser, $browserXhr, $log, $xhrBulk, $xhrError, log;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service, {
'$xhr.error': $xhrError = jasmine.createSpy('$xhr.error'),
'$log': $log = {}
@@ -16,7 +16,7 @@ describe('$xhr.bulk', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -27,7 +27,7 @@ describe('$xhr.bulk', function() {
}
- it('should collect requests', function(){
+ it('should collect requests', function() {
$xhrBulk.urls["/"] = {match:/.*/};
$xhrBulk('GET', '/req1', null, callback);
$xhrBulk('POST', '/req2', {post:'data'}, callback);
@@ -39,13 +39,13 @@ describe('$xhr.bulk', function() {
{status:200, response:'first'},
{status:200, response:'second'}
]);
- $xhrBulk.flush(function(){ log += 'DONE';});
+ $xhrBulk.flush(function() { log += 'DONE';});
$browserXhr.flush();
expect(log).toEqual('"first";"second";DONE');
});
- it('should handle non 200 status code by forwarding to error handler', function(){
+ it('should handle non 200 status code by forwarding to error handler', function() {
$xhrBulk.urls['/'] = {match:/.*/};
$xhrBulk('GET', '/req1', null, callback);
$xhrBulk('POST', '/req2', {post:'data'}, callback);
@@ -57,7 +57,7 @@ describe('$xhr.bulk', function() {
{status:404, response:'NotFound'},
{status:200, response:'second'}
]);
- $xhrBulk.flush(function(){ log += 'DONE';});
+ $xhrBulk.flush(function() { log += 'DONE';});
$browserXhr.flush();
expect($xhrError).toHaveBeenCalled();
diff --git a/test/service/xhr.cacheSpec.js b/test/service/xhr.cacheSpec.js
index c6b9cfec..0c77e629 100644
--- a/test/service/xhr.cacheSpec.js
+++ b/test/service/xhr.cacheSpec.js
@@ -12,7 +12,7 @@ describe('$xhr.cache', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -23,7 +23,7 @@ describe('$xhr.cache', function() {
}
- it('should cache requests', function(){
+ it('should cache requests', function() {
$browserXhr.expectGET('/url').respond('first');
cache('GET', '/url', null, callback);
$browserXhr.flush();
@@ -39,7 +39,7 @@ describe('$xhr.cache', function() {
});
- it('should first return cache request, then return server request', function(){
+ it('should first return cache request, then return server request', function() {
$browserXhr.expectGET('/url').respond('first');
cache('GET', '/url', null, callback, true);
$browserXhr.flush();
@@ -54,7 +54,7 @@ describe('$xhr.cache', function() {
});
- it('should serve requests from cache', function(){
+ it('should serve requests from cache', function() {
cache.data.url = {value:'123'};
cache('GET', 'url', null, callback);
$browser.defer.flush();
@@ -66,7 +66,7 @@ describe('$xhr.cache', function() {
});
- it('should keep track of in flight requests and request only once', function(){
+ it('should keep track of in flight requests and request only once', function() {
scope.$service('$xhr.bulk').urls['/bulk'] = {
match:function(url){
return url == '/url';
@@ -85,7 +85,7 @@ describe('$xhr.cache', function() {
});
- it('should clear cache on non GET', function(){
+ it('should clear cache on non GET', function() {
$browserXhr.expectPOST('abc', {}).respond({});
cache.data.url = {value:123};
cache('POST', 'abc', {});
diff --git a/test/service/xhr.errorSpec.js b/test/service/xhr.errorSpec.js
index 6cc7fce0..49b63fd0 100644
--- a/test/service/xhr.errorSpec.js
+++ b/test/service/xhr.errorSpec.js
@@ -3,7 +3,7 @@
describe('$xhr.error', function() {
var scope, $browser, $browserXhr, $xhr, $xhrError, log;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service, {
'$xhr.error': $xhrError = jasmine.createSpy('$xhr.error')
});
@@ -14,7 +14,7 @@ describe('$xhr.error', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -25,7 +25,7 @@ describe('$xhr.error', function() {
}
- it('should handle non 200 status codes by forwarding to error handler', function(){
+ it('should handle non 200 status codes by forwarding to error handler', function() {
$browserXhr.expectPOST('/req', 'MyData').respond(500, 'MyError');
$xhr('POST', '/req', 'MyData', callback);
$browserXhr.flush();
diff --git a/test/service/xhrSpec.js b/test/service/xhrSpec.js
index b01eb385..2a552403 100644
--- a/test/service/xhrSpec.js
+++ b/test/service/xhrSpec.js
@@ -3,7 +3,7 @@
describe('$xhr', function() {
var scope, $browser, $browserXhr, $log, $xhr, $xhrErr, log;
- beforeEach(function(){
+ beforeEach(function() {
var scope = angular.scope(angular.service, {
'$xhr.error': $xhrErr = jasmine.createSpy('xhr.error')});
$log = scope.$service('$log');
@@ -14,7 +14,7 @@ describe('$xhr', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -24,7 +24,7 @@ describe('$xhr', function() {
}
- it('should forward the request to $browser and decode JSON', function(){
+ it('should forward the request to $browser and decode JSON', function() {
$browserXhr.expectGET('/reqGET').respond('first');
$browserXhr.expectGET('/reqGETjson').respond('["second"]');
$browserXhr.expectPOST('/reqPOST', {post:'data'}).respond('third');
@@ -41,7 +41,7 @@ describe('$xhr', function() {
'{code=200; response="first"}');
});
- it('should allow all 2xx requests', function(){
+ it('should allow all 2xx requests', function() {
$browserXhr.expectGET('/req1').respond(200, '1');
$xhr('GET', '/req1', null, callback);
$browserXhr.flush();
@@ -56,9 +56,9 @@ describe('$xhr', function() {
});
- it('should handle exceptions in callback', function(){
+ it('should handle exceptions in callback', function() {
$browserXhr.expectGET('/reqGET').respond('first');
- $xhr('GET', '/reqGET', null, function(){ throw "MyException"; });
+ $xhr('GET', '/reqGET', null, function() { throw "MyException"; });
$browserXhr.flush();
expect($log.error.logs.shift()).toContain('MyException');
@@ -140,7 +140,7 @@ describe('$xhr', function() {
describe('default headers', function() {
- it('should set default headers for GET request', function(){
+ it('should set default headers for GET request', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expectGET('URL', '', {'Accept': 'application/json, text/plain, */*',
@@ -153,7 +153,7 @@ describe('$xhr', function() {
});
- it('should set default headers for POST request', function(){
+ it('should set default headers for POST request', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expectPOST('URL', 'xx', {'Accept': 'application/json, text/plain, */*',
@@ -167,7 +167,7 @@ describe('$xhr', function() {
});
- it('should set default headers for custom HTTP method', function(){
+ it('should set default headers for custom HTTP method', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expect('FOO', 'URL', '', {'Accept': 'application/json, text/plain, */*',
@@ -260,8 +260,8 @@ describe('$xhr', function() {
});
});
- describe('xsrf', function(){
- it('should copy the XSRF cookie into a XSRF Header', function(){
+ describe('xsrf', function() {
+ it('should copy the XSRF cookie into a XSRF Header', function() {
var code, response;
$browserXhr
.expectPOST('URL', 'DATA', {'X-XSRF-TOKEN': 'secret'})
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 41a6455c..b3316c0c 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -11,7 +11,7 @@ _jQuery.event.special.change = undefined;
if (window.jstestdriver) {
window.jstd = jstestdriver;
- window.dump = function dump(){
+ window.dump = function dump() {
var args = [];
forEach(arguments, function(arg){
if (isElement(arg)) {
@@ -46,7 +46,7 @@ function dumpScope(scope, offset) {
return log.join('\n' + offset);
}
-beforeEach(function(){
+beforeEach(function() {
// This is to reset parsers global cache of expressions.
compileCache = {};
@@ -65,7 +65,7 @@ beforeEach(function(){
jqLite(document.body).html('');
function cssMatcher(presentClasses, absentClasses) {
- return function(){
+ return function() {
var element = jqLite(this.actual);
var present = true;
var absent = false;
@@ -78,7 +78,7 @@ beforeEach(function(){
absent = absent || element.hasClass(className);
});
- this.message = function(){
+ this.message = function() {
return "Expected to have " + presentClasses +
(absentClasses ? (" and not have " + absentClasses + "" ) : "") +
" but had " + element[0].className + ".";
@@ -98,7 +98,7 @@ beforeEach(function(){
},
toHaveClass: function(clazz) {
- this.message = function(){
+ this.message = function() {
return "Expected '" + sortedHtml(this.actual) + "' to have class '" + clazz + "'.";
};
return this.actual.hasClass ?
@@ -191,7 +191,7 @@ afterEach(function() {
clearJqCache();
});
-function clearJqCache(){
+function clearJqCache() {
var count = 0;
forEachSorted(jqCache, function(value, key){
count ++;
diff --git a/test/widget/formSpec.js b/test/widget/formSpec.js
index 7c575c33..7d136dd8 100644
--- a/test/widget/formSpec.js
+++ b/test/widget/formSpec.js
@@ -1,35 +1,35 @@
'use strict';
-describe('form', function(){
+describe('form', function() {
var doc;
- afterEach(function(){
+ afterEach(function() {
dealoc(doc);
});
- it('should attach form to DOM', function(){
+ it('should attach form to DOM', function() {
doc = angular.element('<form>');
var scope = angular.compile(doc)();
expect(doc.data('$form')).toBeTruthy();
});
- it('should prevent form submission', function(){
+ it('should prevent form submission', function() {
var startingUrl = '' + window.location;
doc = angular.element('<form name="myForm"><input type=submit val=submit>');
var scope = angular.compile(doc)();
browserTrigger(doc.find('input'));
waitsFor(
- function(){ return true; },
+ function() { return true; },
'let browser breath, so that the form submision can manifest itself', 10);
- runs(function(){
+ runs(function() {
expect('' + window.location).toEqual(startingUrl);
});
});
- it('should publish form to scope', function(){
+ it('should publish form to scope', function() {
doc = angular.element('<form name="myForm">');
var scope = angular.compile(doc)();
expect(scope.myForm).toBeTruthy();
@@ -38,7 +38,7 @@ describe('form', function(){
});
- it('should have ng-valide/ng-invalid style', function(){
+ it('should have ng-valide/ng-invalid style', function() {
doc = angular.element('<form name="myForm"><input type=text ng:model=text required>');
var scope = angular.compile(doc)();
scope.text = 'misko';
@@ -54,7 +54,7 @@ describe('form', function(){
});
- it('should chain nested forms', function(){
+ it('should chain nested forms', function() {
doc = angular.element('<ng:form name=parent><ng:form name=child><input type=text ng:model=text name=text>');
var scope = angular.compile(doc)();
var parent = scope.parent;
@@ -71,7 +71,7 @@ describe('form', function(){
});
- it('should chain nested forms in repeater', function(){
+ it('should chain nested forms in repeater', function() {
doc = angular.element('<ng:form name=parent>' +
'<ng:form ng:repeat="f in forms" name=child><input type=text ng:model=text name=text>');
var scope = angular.compile(doc)();
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js
index 31f8c59c..d8d7f928 100644
--- a/test/widget/inputSpec.js
+++ b/test/widget/inputSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('widget: input', function(){
+describe('widget: input', function() {
var compile = null, element = null, scope = null, defer = null;
var doc = null;
@@ -21,13 +21,13 @@ describe('widget: input', function(){
};
});
- afterEach(function(){
+ afterEach(function() {
dealoc(element);
dealoc(doc);
});
- describe('text', function(){
+ describe('text', function() {
var scope = null,
form = null,
formElement = null,
@@ -46,7 +46,7 @@ describe('widget: input', function(){
};
- it('should bind update scope from model', function(){
+ it('should bind update scope from model', function() {
createInput();
expect(scope.form.name.$required).toBe(false);
scope.name = 'misko';
@@ -55,7 +55,7 @@ describe('widget: input', function(){
});
- it('should require', function(){
+ it('should require', function() {
createInput({required:''});
expect(scope.form.name.$required).toBe(true);
scope.$digest();
@@ -66,10 +66,10 @@ describe('widget: input', function(){
});
- it('should call $destroy on element remove', function(){
+ it('should call $destroy on element remove', function() {
createInput();
var log = '';
- form.$on('$destroy', function(){
+ form.$on('$destroy', function() {
log += 'destroy;';
});
inputElement.remove();
@@ -77,10 +77,10 @@ describe('widget: input', function(){
});
- it('should update the model and trim input', function(){
+ it('should update the model and trim input', function() {
createInput();
var log = '';
- scope.change = function(){
+ scope.change = function() {
log += 'change();';
};
inputElement.val(' a ');
@@ -91,14 +91,14 @@ describe('widget: input', function(){
});
- it('should change non-html5 types to text', function(){
+ it('should change non-html5 types to text', function() {
doc = angular.element('<form name="form"><input type="abc" ng:model="name"></form>');
scope = angular.compile(doc)();
expect(doc.find('input').attr('type')).toEqual('text');
});
- it('should not change html5 types to text', function(){
+ it('should not change html5 types to text', function() {
doc = angular.element('<form name="form"><input type="number" ng:model="name"></form>');
scope = angular.compile(doc)();
expect(doc.find('input')[0].getAttribute('type')).toEqual('number');
@@ -106,10 +106,10 @@ describe('widget: input', function(){
});
- describe("input", function(){
+ describe("input", function() {
- describe("text", function(){
- it('should input-text auto init and handle keydown/change events', function(){
+ describe("text", function() {
+ it('should input-text auto init and handle keydown/change events', function() {
compile('<input type="text" ng:model="name"/>');
scope.name = 'Adam';
@@ -130,7 +130,7 @@ describe('widget: input', function(){
});
- it('should not trigger eval if value does not change', function(){
+ it('should not trigger eval if value does not change', function() {
compile('<input type="text" ng:model="name" ng:change="count = count + 1" ng:init="count=0"/>');
scope.name = 'Misko';
scope.$digest();
@@ -143,7 +143,7 @@ describe('widget: input', function(){
});
- it('should allow complex reference binding', function(){
+ it('should allow complex reference binding', function() {
compile('<div>'+
'<input type="text" ng:model="obj[\'abc\'].name"/>'+
'</div>');
@@ -153,8 +153,8 @@ describe('widget: input', function(){
});
- describe("ng:format", function(){
- it("should format text", function(){
+ describe("ng:format", function() {
+ it("should format text", function() {
compile('<input type="list" ng:model="list"/>');
scope.list = ['x', 'y', 'z'];
@@ -168,14 +168,14 @@ describe('widget: input', function(){
});
- it("should render as blank if null", function(){
+ it("should render as blank if null", function() {
compile('<input type="text" ng:model="age" ng:format="number" ng:init="age=null"/>');
expect(scope.age).toBeNull();
expect(scope.$element[0].value).toEqual('');
});
- it("should show incorrect text while number does not parse", function(){
+ it("should show incorrect text while number does not parse", function() {
compile('<input type="number" ng:model="age"/>');
scope.age = 123;
scope.$digest();
@@ -195,7 +195,7 @@ describe('widget: input', function(){
});
- it("should not clobber text if model changes due to itself", function(){
+ it("should not clobber text if model changes due to itself", function() {
// When the user types 'a,b' the 'a,' stage parses to ['a'] but if the
// $parseModel function runs it will change to 'a', in essence preventing
// the user from ever typying ','.
@@ -227,7 +227,7 @@ describe('widget: input', function(){
});
- it("should come up blank when no value specified", function(){
+ it("should come up blank when no value specified", function() {
compile('<input type="number" ng:model="age"/>');
scope.$digest();
expect(scope.$element.val()).toEqual('');
@@ -236,15 +236,15 @@ describe('widget: input', function(){
});
- describe("checkbox", function(){
- it("should format booleans", function(){
+ describe("checkbox", function() {
+ it("should format booleans", function() {
compile('<input type="checkbox" ng:model="name" ng:init="name=false"/>');
expect(scope.name).toBe(false);
expect(scope.$element[0].checked).toBe(false);
});
- it('should support type="checkbox" with non-standard capitalization', function(){
+ it('should support type="checkbox" with non-standard capitalization', function() {
compile('<input type="checkBox" ng:model="checkbox"/>');
browserTrigger(element);
@@ -255,7 +255,7 @@ describe('widget: input', function(){
});
- it('should allow custom enumeration', function(){
+ it('should allow custom enumeration', function() {
compile('<input type="checkbox" ng:model="name" true-value="ano" false-value="nie"/>');
scope.name='ano';
@@ -280,7 +280,7 @@ describe('widget: input', function(){
});
- it("should process required", function(){
+ it("should process required", function() {
compile('<input type="text" ng:model="price" name="p" required/>', jqLite(document.body));
expect(scope.$service('$formFactory').rootForm.p.$required).toBe(true);
expect(element.hasClass('ng-invalid')).toBeTruthy();
@@ -320,7 +320,7 @@ describe('widget: input', function(){
});
- describe('textarea', function(){
+ describe('textarea', function() {
it("should process textarea", function() {
compile('<textarea ng:model="name"></textarea>');
@@ -341,8 +341,8 @@ describe('widget: input', function(){
});
- describe('radio', function(){
- it('should support type="radio"', function(){
+ describe('radio', function() {
+ it('should support type="radio"', function() {
compile('<div>' +
'<input type="radio" name="r" ng:model="chose" value="A"/>' +
'<input type="radio" name="r" ng:model="chose" value="B"/>' +
@@ -366,7 +366,7 @@ describe('widget: input', function(){
});
- it('should honor model over html checked keyword after', function(){
+ it('should honor model over html checked keyword after', function() {
compile('<div ng:init="choose=\'C\'">' +
'<input type="radio" ng:model="choose" value="A""/>' +
'<input type="radio" ng:model="choose" value="B" checked/>' +
@@ -380,7 +380,7 @@ describe('widget: input', function(){
});
- it('should honor model over html checked keyword before', function(){
+ it('should honor model over html checked keyword before', function() {
compile('<div ng:init="choose=\'A\'">' +
'<input type="radio" ng:model="choose" value="A""/>' +
'<input type="radio" ng:model="choose" value="B" checked/>' +
@@ -395,22 +395,22 @@ describe('widget: input', function(){
});
- it('should ignore text widget which have no name', function(){
+ it('should ignore text widget which have no name', function() {
compile('<input type="text"/>');
expect(scope.$element.attr('ng-exception')).toBeFalsy();
expect(scope.$element.hasClass('ng-exception')).toBeFalsy();
});
- it('should ignore checkbox widget which have no name', function(){
+ it('should ignore checkbox widget which have no name', function() {
compile('<input type="checkbox"/>');
expect(scope.$element.attr('ng-exception')).toBeFalsy();
expect(scope.$element.hasClass('ng-exception')).toBeFalsy();
});
- it('should report error on assignment error', function(){
- expect(function(){
+ it('should report error on assignment error', function() {
+ expect(function() {
compile('<input type="text" ng:model="throw \'\'">');
}).toThrow("Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at [''].");
$logMock.error.logs.shift();
@@ -418,8 +418,8 @@ describe('widget: input', function(){
});
- describe('scope declaration', function(){
- it('should read the declaration from scope', function(){
+ describe('scope declaration', function() {
+ it('should read the declaration from scope', function() {
var input, $formFactory;
element = angular.element('<input type="@MyType" ng:model="abc">');
scope = angular.scope();
@@ -451,18 +451,18 @@ describe('widget: input', function(){
});
- describe('text subtypes', function(){
+ describe('text subtypes', function() {
function itShouldVerify(type, validList, invalidList, params, fn) {
- describe(type, function(){
+ describe(type, function() {
forEach(validList, function(value){
- it('should validate "' + value + '"', function(){
+ it('should validate "' + value + '"', function() {
setup(value);
expect(scope.$element).toBeValid();
});
});
forEach(invalidList, function(value){
- it('should NOT validate "' + value + '"', function(){
+ it('should NOT validate "' + value + '"', function() {
setup(value);
expect(scope.$element).toBeInvalid();
});
diff --git a/test/widget/selectSpec.js b/test/widget/selectSpec.js
index 6adf8b93..ad9dab18 100644
--- a/test/widget/selectSpec.js
+++ b/test/widget/selectSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('select', function(){
+describe('select', function() {
var compile = null, element = null, scope = null, $formFactory = null;
beforeEach(function() {
@@ -20,12 +20,12 @@ describe('select', function(){
};
});
- afterEach(function(){
+ afterEach(function() {
dealoc(element);
});
- describe('select-one', function(){
+ describe('select-one', function() {
it('should compile children of a select without a name, but not create a model for it',
function() {
@@ -41,7 +41,7 @@ describe('select', function(){
expect(scope.$element.text()).toBe('foobarC');
});
- it('should require', function(){
+ it('should require', function() {
compile('<select name="select" ng:model="selection" required ng:change="log=log+\'change;\'">' +
'<option value=""></option>' +
'<option value="c">C</option>' +
@@ -67,7 +67,7 @@ describe('select', function(){
expect(scope.log).toEqual('change;');
});
- it('should not be invalid if no require', function(){
+ it('should not be invalid if no require', function() {
compile('<select name="select" ng:model="selection">' +
'<option value=""></option>' +
'<option value="c">C</option>' +
@@ -80,8 +80,8 @@ describe('select', function(){
});
- describe('select-multiple', function(){
- it('should support type="select-multiple"', function(){
+ describe('select-multiple', function() {
+ it('should support type="select-multiple"', function() {
compile('<select ng:model="selection" multiple>' +
'<option>A</option>' +
'<option>B</option>' +
@@ -91,7 +91,7 @@ describe('select', function(){
expect(element[0].childNodes[0].selected).toEqual(true);
});
- it('should require', function(){
+ it('should require', function() {
compile('<select name="select" ng:model="selection" multiple required>' +
'<option>A</option>' +
'<option>B</option>' +
@@ -117,7 +117,7 @@ describe('select', function(){
});
- describe('ng:options', function(){
+ describe('ng:options', function() {
var select, scope;
function createSelect(attrs, blank, unknown){
@@ -152,19 +152,19 @@ describe('select', function(){
}, blank, unknown);
}
- afterEach(function(){
+ afterEach(function() {
dealoc(select);
dealoc(scope);
});
- it('should throw when not formated "? for ? in ?"', function(){
- expect(function(){
+ it('should throw when not formated "? for ? in ?"', function() {
+ expect(function() {
compile('<select ng:model="selected" ng:options="i dont parse"></select>');
}).toThrow("Expected ng:options in form of '_select_ (as _label_)? for (_key_,)?_value_ in" +
" _collection_' but got 'i dont parse'.");
});
- it('should render a list', function(){
+ it('should render a list', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}, {name:'C'}];
scope.selected = scope.values[0];
@@ -176,7 +176,7 @@ describe('select', function(){
expect(sortedHtml(options[2])).toEqual('<option value="2">C</option>');
});
- it('should render an object', function(){
+ it('should render an object', function() {
createSelect({
'ng:model':'selected',
'ng:options': 'value as key for (key, value) in object'
@@ -197,7 +197,7 @@ describe('select', function(){
expect(options[3].selected).toEqual(true);
});
- it('should grow list', function(){
+ it('should grow list', function() {
createSingleSelect();
scope.values = [];
scope.$digest();
@@ -217,7 +217,7 @@ describe('select', function(){
expect(sortedHtml(select.find('option')[1])).toEqual('<option value="1">B</option>');
});
- it('should shrink list', function(){
+ it('should shrink list', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}, {name:'C'}];
scope.selected = scope.values[0];
@@ -241,7 +241,7 @@ describe('select', function(){
expect(select.find('option').length).toEqual(1); // we add back the special empty option
});
- it('should shrink and then grow list', function(){
+ it('should shrink and then grow list', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}, {name:'C'}];
scope.selected = scope.values[0];
@@ -259,7 +259,7 @@ describe('select', function(){
expect(select.find('option').length).toEqual(3);
});
- it('should update list', function(){
+ it('should update list', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}, {name:'C'}];
scope.selected = scope.values[0];
@@ -275,7 +275,7 @@ describe('select', function(){
expect(sortedHtml(options[2])).toEqual('<option value="2">D</option>');
});
- it('should preserve existing options', function(){
+ it('should preserve existing options', function() {
createSingleSelect(true);
scope.values = [];
@@ -296,8 +296,8 @@ describe('select', function(){
expect(jqLite(select.find('option')[0]).text()).toEqual('blank');
});
- describe('binding', function(){
- it('should bind to scope value', function(){
+ describe('binding', function() {
+ it('should bind to scope value', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}];
scope.selected = scope.values[0];
@@ -309,7 +309,7 @@ describe('select', function(){
expect(select.val()).toEqual('1');
});
- it('should bind to scope value and group', function(){
+ it('should bind to scope value and group', function() {
createSelect({
'ng:model':'selected',
'ng:options':'item.name group by item.group for item in values'
@@ -342,7 +342,7 @@ describe('select', function(){
expect(select.val()).toEqual('0');
});
- it('should bind to scope value through experession', function(){
+ it('should bind to scope value through experession', function() {
createSelect({'ng:model':'selected', 'ng:options':'item.id as item.name for item in values'});
scope.values = [{id:10, name:'A'}, {id:20, name:'B'}];
scope.selected = scope.values[0].id;
@@ -354,7 +354,7 @@ describe('select', function(){
expect(select.val()).toEqual('1');
});
- it('should bind to object key', function(){
+ it('should bind to object key', function() {
createSelect({
'ng:model':'selected',
'ng:options':'key as value for (key, value) in object'
@@ -369,7 +369,7 @@ describe('select', function(){
expect(select.val()).toEqual('blue');
});
- it('should bind to object value', function(){
+ it('should bind to object value', function() {
createSelect({
'ng:model':'selected',
'ng:options':'value as key for (key, value) in object'
@@ -384,7 +384,7 @@ describe('select', function(){
expect(select.val()).toEqual('blue');
});
- it('should insert a blank option if bound to null', function(){
+ it('should insert a blank option if bound to null', function() {
createSingleSelect();
scope.values = [{name:'A'}];
scope.selected = null;
@@ -399,7 +399,7 @@ describe('select', function(){
expect(select.find('option').length).toEqual(1);
});
- it('should reuse blank option if bound to null', function(){
+ it('should reuse blank option if bound to null', function() {
createSingleSelect(true);
scope.values = [{name:'A'}];
scope.selected = null;
@@ -414,7 +414,7 @@ describe('select', function(){
expect(select.find('option').length).toEqual(2);
});
- it('should insert a unknown option if bound to something not in the list', function(){
+ it('should insert a unknown option if bound to something not in the list', function() {
createSingleSelect();
scope.values = [{name:'A'}];
scope.selected = {};
@@ -430,8 +430,8 @@ describe('select', function(){
});
});
- describe('on change', function(){
- it('should update model on change', function(){
+ describe('on change', function() {
+ it('should update model on change', function() {
createSingleSelect();
scope.values = [{name:'A'}, {name:'B'}];
scope.selected = scope.values[0];
@@ -443,7 +443,7 @@ describe('select', function(){
expect(scope.selected).toEqual(scope.values[1]);
});
- it('should update model on change through expression', function(){
+ it('should update model on change through expression', function() {
createSelect({'ng:model':'selected', 'ng:options':'item.id as item.name for item in values'});
scope.values = [{id:10, name:'A'}, {id:20, name:'B'}];
scope.selected = scope.values[0].id;
@@ -455,7 +455,7 @@ describe('select', function(){
expect(scope.selected).toEqual(scope.values[1].id);
});
- it('should update model to null on change', function(){
+ it('should update model to null on change', function() {
createSingleSelect(true);
scope.values = [{name:'A'}, {name:'B'}];
scope.selected = scope.values[0];
@@ -468,8 +468,8 @@ describe('select', function(){
});
});
- describe('select-many', function(){
- it('should read multiple selection', function(){
+ describe('select-many', function() {
+ it('should read multiple selection', function() {
createMultiSelect();
scope.values = [{name:'A'}, {name:'B'}];
@@ -492,7 +492,7 @@ describe('select', function(){
expect(select.find('option')[1].selected).toEqual(true);
});
- it('should update model on change', function(){
+ it('should update model on change', function() {
createMultiSelect();
scope.values = [{name:'A'}, {name:'B'}];
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index 9361d28d..b6754b91 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("widget", function(){
+describe("widget", function() {
var compile = null, element = null, scope = null;
beforeEach(function() {
@@ -24,8 +24,8 @@ describe("widget", function(){
});
- describe('ng:switch', function(){
- it('should switch on value change', function(){
+ describe('ng:switch', function() {
+ it('should switch on value change', function() {
compile('<ng:switch on="select">' +
'<div ng:switch-when="1">first:{{name}}</div>' +
'<div ng:switch-when="2">second:{{name}}</div>' +