diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/AngularTest.js | 15 | ||||
| -rw-r--r-- | test/BinderTest.js | 105 | ||||
| -rw-r--r-- | test/ControlBarTest.js | 2 | ||||
| -rw-r--r-- | test/ExternalApiTest.js | 15 | ||||
| -rw-r--r-- | test/JsonTest.js | 11 | ||||
| -rw-r--r-- | test/ScenarioSpec.js | 66 | ||||
| -rw-r--r-- | test/ScopeTest.js | 2 | ||||
| -rw-r--r-- | test/formsTest.js | 18 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 8 |
9 files changed, 142 insertions, 100 deletions
diff --git a/test/AngularTest.js b/test/AngularTest.js index 9610ef76..a9146adf 100644 --- a/test/AngularTest.js +++ b/test/AngularTest.js @@ -1,20 +1,5 @@ AngularTest = TestCase('AngularTest'); -AngularTest.prototype.testDefaultDatabasePathFromSubdomain = function() { - var loader = new Angular(null, null, {server:"http://account.getangular.com", database:"database"}); - loader.computeConfiguration(); - assertEquals("database", loader.config.database); - - loader = new Angular(null, null, {server:"http://account.getangular.com"}); - loader.computeConfiguration(); - assertEquals("account", loader.config.database); - - loader = new Angular(null, null, {server:"https://account.getangular.com"}); - loader.computeConfiguration(); - assertEquals("account", loader.config.database); -}; - - UrlWatcherTest = TestCase('UrlWatcherTest'); diff --git a/test/BinderTest.js b/test/BinderTest.js index 0ffd2120..bbb3eb8f 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -5,10 +5,10 @@ function compile(content, initialScope, config) { config = config || {autoSubmit:true}; var scope = new Scope(initialScope, "ROOT"); h.data('scope', scope); - var binder = new Binder(h[0], new WidgetFactory(), new MockUrlWatcher(), config); + var binder = new Binder(h[0], new WidgetFactory(), new MockLocation(), config); var datastore = new DataStore(); scope.set("$datastore", datastore); - scope.set("$binder", binder); + scope.set("$updateView", _(binder.updateView).bind(binder)); scope.set("$anchor", binder.anchor); binder.entity(scope); binder.compile(); @@ -120,7 +120,7 @@ BinderTest.prototype.testChangingTextareaUpdatesModel = function(){ var form = html('<textarea name="model.note">abc</textarea>'); var scope = new Scope({model:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertEquals(scope.get('model').note, 'abc'); @@ -131,7 +131,7 @@ BinderTest.prototype.testChangingRadioUpdatesModel = function(){ '<input type="radio" name="model.price" value="B">'); var scope = new Scope({model:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertEquals(scope.get('model').price, 'A'); @@ -141,7 +141,7 @@ BinderTest.prototype.testChangingCheckboxUpdatesModel = function(){ var form = html('<input type="checkbox" name="model.price" value="A" checked>'); var scope = new Scope({model:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertEquals('A', scope.get('model').price); @@ -157,7 +157,7 @@ BinderTest.prototype.testChangingSelectNonSelectedUpdatesModel = function(){ var form = html('<select name="model.price"><option value="A">A</option><option value="B">B</option></select>'); var scope = new Scope({model:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertEquals('A', scope.get('model').price); @@ -171,7 +171,7 @@ BinderTest.prototype.testChangingMultiselectUpdatesModel = function(){ '</select>'); var scope = new Scope({Invoice:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertJsonEquals(["A", "B"], scope.get('Invoice').options); @@ -181,7 +181,7 @@ BinderTest.prototype.testChangingSelectSelectedUpdatesModel = function(){ var form = html('<select name="model.price"><option>A</option><option selected value="b">B</option></select>'); var scope = new Scope({model:{}}); form.data('scope', scope); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); binder.compile(); binder.updateView(); assertEquals(scope.get('model').price, 'b'); @@ -210,7 +210,7 @@ BinderTest.prototype.testApplyTextBindings = function(){ var form = html('<div ng-bind="model.a">x</div>'); var scope = new Scope({model:{a:123}}); form.data('scope', scope); - var binder = new Binder(form.get(0), null, new MockUrlWatcher()); + var binder = new Binder(form.get(0), null, new MockLocation()); binder.compile(); binder.updateView(); assertEquals('123', form.text()); @@ -287,7 +287,7 @@ BinderTest.prototype.testExistingAttrbindingIsAppended = function() { BinderTest.prototype.testAttributesAreEvaluated = function(){ var form = html('<a ng-bind-attr=\'{"a":"a", "b":"a+b={{a+b}}"}\'></a>'); form.data('scope', new Scope({a:1, b:2})); - var binder = new Binder(form.get(0), null, new MockUrlWatcher()); + var binder = new Binder(form.get(0), null, new MockLocation()); binder.compile(); binder.updateView(); var a = form.find("a"); @@ -304,7 +304,7 @@ BinderTest.prototype.testInputsAreUpdated = function(){ '<input name="A.checkbox" type="checkbox" value="c" />' + '<input name="A.checkboxOff" type="checkbox" value="c" />' + '<select name="A.select"><option>a</option><option value="S">b</option></select>'); - var binder = new Binder(form.get(0), new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(form.get(0), new WidgetFactory(), new MockLocation()); form.data('scope', new Scope({A:{text:"t1", textarea:"t2", radio:"r", checkbox:"c", select:"S"}})); binder.compile(); binder.updateView(); @@ -348,21 +348,27 @@ BinderTest.prototype.testButtonElementActionExecutesInScope = function(){ }; BinderTest.prototype.testParseEmptyAnchor = function(){ - var binder = new Binder(null, null, new MockUrlWatcher()); + var location = new MockLocation(); + var binder = new Binder(null, null, location); var anchor = binder.anchor; - binder.parseAnchor("a#x=1"); + location.url = "a#x=1"; + binder.parseAnchor(); assertEquals(1, binder.anchor.x); - binder.parseAnchor("a#"); + location.url = "a#"; + binder.parseAnchor(); assertTrue("old values did not get removed", !binder.anchor.x); assertTrue("anchor gor replaced", anchor === binder.anchor); assertEquals('undefined', typeof (anchor[""])); }; BinderTest.prototype.testParseAnchor = function(){ - var binder = new Binder(null, null, new MockUrlWatcher()); - binder.parseAnchor("a#x=1"); + var location = new MockLocation(); + var binder = new Binder(null, null, location); + location.url = "a#x=1"; + binder.parseAnchor(); assertEquals(binder.anchor.x, "1"); - binder.parseAnchor("a#a=b&c=%20&d"); + location.url = "a#a=b&c=%20&d"; + binder.parseAnchor(); assertEquals(binder.anchor.a, 'b'); assertEquals(binder.anchor.c, ' '); assertTrue(binder.anchor.d !== null); @@ -370,27 +376,27 @@ BinderTest.prototype.testParseAnchor = function(){ }; BinderTest.prototype.testWriteAnchor = function(){ - var binder = new Binder(null, null, new MockUrlWatcher()); - binder.urlWatcher.setUrl('a'); + var binder = new Binder(null, null, new MockLocation()); + binder.location.set('a'); binder.anchor.a = 'b'; binder.anchor.c = ' '; binder.anchor.d = true; binder.updateAnchor(); - assertEquals(binder.urlWatcher.getUrl(), "a#a=b&c=%20&d"); + assertEquals(binder.location.get(), "a#a=b&c=%20&d"); }; BinderTest.prototype.testWriteAnchorAsPartOfTheUpdateView = function(){ - var binder = new Binder(html("<div/>")[0], null, new MockUrlWatcher()); - binder.urlWatcher.setUrl('a'); + var binder = new Binder(html("<div/>")[0], null, new MockLocation()); + binder.location.set('a'); $(binder.doc).data('scope', new Scope()); binder.anchor.a = 'b'; binder.updateView(); - assertEquals(binder.urlWatcher.getUrl(), "a#a=b"); + assertEquals(binder.location.get(), "a#a=b"); }; BinderTest.prototype.testRepeaterUpdateBindings = function(){ var form = html('<ul><LI ng-repeat="item in model.items" ng-bind="item.a"/></ul>'); - var binder = new Binder(form.get(0), null, new MockUrlWatcher()); + var binder = new Binder(form.get(0), null, new MockLocation()); var items = [{a:"A"}, {a:"B"}]; form.data('scope', new Scope({model:{items:items}})); binder.compile(); @@ -423,7 +429,7 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){ BinderTest.prototype.testRepeaterContentDoesNotBind = function(){ var form = html('<ul><LI ng-repeat="item in model.items"><span ng-bind="item.a"/></li></ul>'); form.data('scope', new Scope({model:{items:[{a:"A"}]}})); - var binder = new Binder(form.get(0), null, new MockUrlWatcher()); + var binder = new Binder(form.get(0), null, new MockLocation()); binder.compile(); binder.updateView(); assertEquals('<ul>' + @@ -449,7 +455,7 @@ BinderTest.prototype.testRepeaterInputContentDoesNotBind = function(){ var form = html('<ul><LI repeater="item in model.items">' + '<input type="text" name="item.a" value="OLD"/></li></ul>'); - var binder = new Binder(form.get(0), null, new MockUrlWatcher()); + var binder = new Binder(form.get(0), null, new MockLocation()); var items = [{a:"A"}]; form.data('scope', new Scope({model:{items:items}})); @@ -493,7 +499,7 @@ BinderTest.prototype.testReplaceFileUploadWithSwf = function(){ var form = jQuery("body").append('<div id="testTag"><input type="file"></div>'); form.data('scope', new Scope()); var factory = {}; - var binder = new Binder(form.get(0), factory, new MockUrlWatcher()); + var binder = new Binder(form.get(0), factory, new MockLocation()); factory.createController = function(node){ assertEquals(node.attr('type'), 'file'); return {updateModel:function(){}}; @@ -504,7 +510,7 @@ BinderTest.prototype.testReplaceFileUploadWithSwf = function(){ BinderTest.prototype.testRepeaterAdd = function(){ var doc = $('<div><input type="text" name="item.x" ng-repeat="item in items"></div>'); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); doc.data('scope', new Scope({items:[{x:'a'}, {x:'b'}], $binder:binder})); binder.compile(); binder.updateView(); @@ -521,7 +527,7 @@ BinderTest.prototype.testIfTextBindingThrowsErrorDecorateTheSpan = function(){ var doc = $('<div>{{error.throw()}}</div>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('error.throw', function(){throw "ErrorMsg1";}); @@ -549,7 +555,7 @@ BinderTest.prototype.testIfAttrBindingThrowsErrorDecorateTheSpan = function(){ var doc = $('<div attr="before {{error.throw()}} after"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('error.throw', function(){throw "ErrorMsg";}); @@ -571,7 +577,7 @@ BinderTest.prototype.testNestedRepeater = function() { '</div>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('model', [{name:'a', item:['a1', 'a2']}, {name:'b', item:['b1', 'b2']}]); @@ -595,7 +601,7 @@ BinderTest.prototype.testRadioButtonGetsPrefixed = function () { var doc = html('<input ng-repeat="m in model" type="radio" name="m.a" value="on"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('model', ['a1', 'a2']); @@ -612,7 +618,7 @@ BinderTest.prototype.testHideBindingExpression = function() { var doc = html('<div ng-hide="hidden == 3"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('hidden', 3); @@ -630,7 +636,7 @@ BinderTest.prototype.testHideBinding = function() { var doc = html('<div ng-hide="hidden"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('hidden', 'true'); @@ -653,7 +659,7 @@ BinderTest.prototype.testShowBinding = function() { var doc = html('<div ng-show="show"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('show', 'true'); @@ -685,7 +691,7 @@ BinderTest.prototype.testBindClass = function() { var doc = html('<div ng-class="class"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.set('class', 'testClass'); @@ -714,7 +720,7 @@ BinderTest.prototype.testBindStyle = function() { var doc = html('<div ng-style="style"/>'); var scope = new Scope(); doc.data('scope', scope); - var binder = new Binder(doc[0], new WidgetFactory(), new MockUrlWatcher()); + var binder = new Binder(doc[0], new WidgetFactory(), new MockLocation()); binder.compile(); scope.eval('style={color:"red"}'); @@ -797,7 +803,7 @@ BinderTest.prototype.testDissableAutoSubmit = function() { BinderTest.prototype.testSettingAnchorToNullOrUndefinedRemovesTheAnchorFromURL = function() { var c = compile(''); - c.binder.urlWatcher.setUrl("http://server/#a=1&b=2"); + c.binder.location.set("http://server/#a=1&b=2"); c.binder.parseAnchor(); assertEquals('1', c.binder.anchor.a); assertEquals('2', c.binder.anchor.b); @@ -805,7 +811,7 @@ BinderTest.prototype.testSettingAnchorToNullOrUndefinedRemovesTheAnchorFromURL = c.binder.anchor.a = null; c.binder.anchor.b = null; c.binder.updateAnchor(); - assertEquals('http://server/#', c.binder.urlWatcher.getUrl()); + assertEquals('http://server/#', c.binder.location.get()); }; BinderTest.prototype.testFillInOptionValueWhenMissing = function() { @@ -875,15 +881,24 @@ BinderTest.prototype.testItShouldCallListenersWhenAnchorChanges = function() { log += oldValue + "->" + newValue + ";"; }); assertEquals(0, c.scope.get("count")); - c.binder.onUrlChange("#counter=1"); + c.binder.location.url = "#counter=1"; + c.binder.onUrlChange(); assertEquals(1, c.scope.get("count")); - c.binder.onUrlChange("#counter=1"); + + c.binder.location.url = "#counter=1"; + c.binder.onUrlChange(); assertEquals(1, c.scope.get("count")); - c.binder.onUrlChange("#counter=2"); + + c.binder.location.url = "#counter=2"; + c.binder.onUrlChange(); assertEquals(2, c.scope.get("count")); - c.binder.onUrlChange("#counter=2"); + + c.binder.location.url = "#counter=2"; + c.binder.onUrlChange(); assertEquals(2, c.scope.get("count")); - c.binder.onUrlChange("#"); + + c.binder.location.url = "#"; + c.binder.onUrlChange(); assertEquals("undefined->1;1->2;2->undefined;", log); assertEquals(3, c.scope.get("count")); }; @@ -904,7 +919,7 @@ BinderTest.prototype.testParseQueryString = function(){ BinderTest.prototype.testSetBinderAnchorTriggersListeners = function(){ expectAsserts(2); var doc = html("<div/>")[0]; - var binder = new Binder(doc, null, new MockUrlWatcher()); + var binder = new Binder(doc, null, new MockLocation()); var scope = new Scope({$binder:binder, $anchor:binder.anchor}); jQuery(doc).data('scope', scope); diff --git a/test/ControlBarTest.js b/test/ControlBarTest.js deleted file mode 100644 index c914c8ff..00000000 --- a/test/ControlBarTest.js +++ /dev/null @@ -1,2 +0,0 @@ -ControlBarTest = TestCase("ControlBarTest"); - diff --git a/test/ExternalApiTest.js b/test/ExternalApiTest.js deleted file mode 100644 index cc102ae0..00000000 --- a/test/ExternalApiTest.js +++ /dev/null @@ -1,15 +0,0 @@ -ExternalApiTest = TestCase("ExternalApiTest"); - -ExternalApiTest.prototype = { - testItShouldExposefactory:function(){ - var node = $('<div ng-init="a=1">{{b=a+1}}</div>')[0]; - var scope = angular.compile(node); - scope.init(); - assertEquals(1, scope.get('a')); - assertEquals(2, scope.get('b')); - }, - - testItShouldRegisterAnchorListener: function (){ - - } -}; diff --git a/test/JsonTest.js b/test/JsonTest.js index cf49bec3..9b275248 100644 --- a/test/JsonTest.js +++ b/test/JsonTest.js @@ -67,3 +67,14 @@ JsonTest.prototype.testItShouldUTCDates = function() { assertEquals(date.getTime(), fromJson('"2009-10-09T01:02:03Z"').getTime()); }; + +JsonTest.prototype.testItShouldPreventRecursion = function () { + var obj = {a:'b'}; + obj.recursion = obj; + assertEquals('{"a":"b","recursion":RECURSION}', angular.toJson(obj)); +}; + +JsonTest.prototype.testItShouldSerializeSameObjectsMultipleTimes = function () { + var obj = {a:'b'}; + assertEquals('{"A":{"a":"b"},"B":{"a":"b"}}', angular.toJson({A:obj, B:obj})); +}; diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js new file mode 100644 index 00000000..c3c29f02 --- /dev/null +++ b/test/ScenarioSpec.js @@ -0,0 +1,66 @@ +describe("ScenarioSpec: Compilation", function(){ + it("should compile dom node and return scope", function(){ + var node = $('<div ng-init="a=1">{{b=a+1}}</div>')[0]; + var scope = angular.compile(node); + scope.init(); + expect(scope.get('a')).toEqual(1); + expect(scope.get('b')).toEqual(2); + }); + + it("should compile jQuery node and return scope", function(){ + var scope = angular.compile($('<div>{{a=123}}</div>')).init(); + expect($(scope.element).text()).toEqual('123'); + }); + + it("should compile text node and return scope", function(){ + var scope = angular.compile('<div>{{a=123}}</div>').init(); + expect($(scope.element).text()).toEqual('123'); + }); +}); + +describe("ScenarioSpec: Scope", function(){ + it("should have set, get, eval, init, updateView methods", function(){ + var scope = angular.compile('<div>{{a}}</div>').init(); + expect(scope.set("a", 2)).toEqual(2); + expect(scope.get("a")).toEqual(2); + expect(scope.eval("a=3")).toEqual(3); + scope.updateView(); + expect($(scope.element).text()).toEqual('3'); + }); + + it("should have config", function(){ + expect(angular.compile('', {a:'b'}).config.a).toEqual('b'); + }); + + it("should have $ objects", function(){ + var scope = angular.compile('<div></div>', {a:"b"}); + expect(scope.get('$anchor')).toBeDefined(); + expect(scope.get('$updateView')).toBeDefined(); + expect(scope.get('$config')).toBeDefined(); + expect(scope.get('$config.a')).toEqual("b"); + expect(scope.get('$datastore')).toBeDefined(); + }); +}); + +describe("ScenarioSpec: configuration", function(){ + it("should take location object", function(){ + var url = "http://server/#book=moby"; + var onUrlChange; + var location = { + listen:function(fn){onUrlChange=fn;}, + set:function(u){url = u;}, + get:function(){return url;} + }; + var scope = angular.compile("<div>{{$anchor}}</div>", {location:location}); + var $anchor = scope.get('$anchor'); + expect($anchor.book).toBeUndefined(); + expect(onUrlChange).toBeUndefined(); + scope.init(); + expect($anchor.book).toEqual('moby'); + expect(onUrlChange).toBeDefined(); + + url = "http://server/#book=none"; + onUrlChange(); + expect($anchor.book).toEqual('none'); + }); +}); diff --git a/test/ScopeTest.js b/test/ScopeTest.js index e1c5c8ce..b066f0cb 100644 --- a/test/ScopeTest.js +++ b/test/ScopeTest.js @@ -38,7 +38,7 @@ ScopeTest.prototype.testScopeFromPrototype = function(){ ScopeTest.prototype.testSetScopeGet = function(){ var scope = new Scope(); - scope.set('a', 987); + assertEquals(987, scope.set('a', 987)); assertEquals(scope.get('a'), 987); assertEquals(scope.eval('a'), 987); }; diff --git a/test/formsTest.js b/test/formsTest.js deleted file mode 100644 index ccade915..00000000 --- a/test/formsTest.js +++ /dev/null @@ -1,18 +0,0 @@ -nglrTest = TestCase('nglrTest'); - -nglrTest.prototype.testShiftBind = function(){ - expectAsserts(3); - shiftBind('this', function(target, arg) { - assertEquals(this, 'this'); - assertEquals(target, 'target'); - assertEquals(arg, 'arg'); - }).apply('target', ['arg']); -}; - -nglrTest.prototype.testBind = function(){ - expectAsserts(2); - bind('this', function(arg) { - assertEquals(this, 'this'); - assertEquals(arg, 'arg'); - }).apply('XXX', ['arg']); -}; diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 78ffd380..8fac7598 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -35,13 +35,13 @@ function report(reportTest){ }); } -MockUrlWatcher = function() { +MockLocation = function() { this.url = "http://server"; }; -MockUrlWatcher.prototype.getUrl = function(){ +MockLocation.prototype.get = function(){ return this.url; }; -MockUrlWatcher.prototype.setUrl = function(url){ +MockLocation.prototype.set = function(url){ this.url = url; }; @@ -96,7 +96,7 @@ function decode64(base64){ return fromJson(Base64.decode(base64)); } -Angular.prototype.configureJQueryPlugins(); +configureJQueryPlugins(); function assertHidden(node) { var display = node.css('display'); |
