diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..eba1110b5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto \ No newline at end of file diff --git a/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jquery.mousewheel-3.0.4.js b/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jquery.mousewheel-3.0.4.js index dbf8f4b0f..b7932415c 100644 --- a/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jquery.mousewheel-3.0.4.js +++ b/src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jquery.mousewheel-3.0.4.js @@ -1,78 +1,78 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * Thanks to: Seamus Leahy for adding deltaX and deltaY - * - * Version: 3.0.4 - * - * Requires: 1.2.2+ - */ - -(function($) { - -var types = ['DOMMouseScroll', 'mousewheel']; - -$.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i=types.length; i; ) { - this.addEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i=types.length; i; ) { - this.removeEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - } -}; - -$.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); - }, - - unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); - } -}); - - -function handler(event) { - var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; - event = $.event.fix(orgEvent); - event.type = "mousewheel"; - - // Old school scrollwheel delta - if ( event.wheelDelta ) { delta = event.wheelDelta/120; } - if ( event.detail ) { delta = -event.detail/3; } - - // New school multidimensional scroll (touchpads) deltas - deltaY = delta; - - // Gecko - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = -1*delta; - } - - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - return $.event.handle.apply(this, args); -} - +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.4 + * + * Requires: 1.2.2+ + */ + +(function($) { + +var types = ['DOMMouseScroll', 'mousewheel']; + +$.event.special.mousewheel = { + setup: function() { + if ( this.addEventListener ) { + for ( var i=types.length; i; ) { + this.addEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = handler; + } + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i=types.length; i; ) { + this.removeEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = null; + } + } +}; + +$.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); + }, + + unmousewheel: function(fn) { + return this.unbind("mousewheel", fn); + } +}); + + +function handler(event) { + var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; + event = $.event.fix(orgEvent); + event.type = "mousewheel"; + + // Old school scrollwheel delta + if ( event.wheelDelta ) { delta = event.wheelDelta/120; } + if ( event.detail ) { delta = -event.detail/3; } + + // New school multidimensional scroll (touchpads) deltas + deltaY = delta; + + // Gecko + if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { + deltaY = 0; + deltaX = -1*delta; + } + + // Webkit + if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } + if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } + + // Add event and delta to the front of the arguments + args.unshift(event, delta, deltaX, deltaY); + + return $.event.handle.apply(this, args); +} + })(jQuery); \ No newline at end of file diff --git a/src/extensions/default/RecentProjects/down-arrow.svg b/src/extensions/default/RecentProjects/down-arrow.svg index 133c4fb70..9e1177942 100644 --- a/src/extensions/default/RecentProjects/down-arrow.svg +++ b/src/extensions/default/RecentProjects/down-arrow.svg @@ -1,10 +1,10 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/src/styles/images/bracketsSprites.svg b/src/styles/images/bracketsSprites.svg index ff3289b19..e36a1638f 100644 --- a/src/styles/images/bracketsSprites.svg +++ b/src/styles/images/bracketsSprites.svg @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/brackets_icon.svg b/src/styles/images/brackets_icon.svg index 29a07812f..c46e259c9 100644 --- a/src/styles/images/brackets_icon.svg +++ b/src/styles/images/brackets_icon.svg @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/close_btn.svg b/src/styles/images/close_btn.svg index f662ce413..1588c01c7 100644 --- a/src/styles/images/close_btn.svg +++ b/src/styles/images/close_btn.svg @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/styles/images/jsTreeSprites.svg b/src/styles/images/jsTreeSprites.svg index c722f5622..e291ca1a7 100644 --- a/src/styles/images/jsTreeSprites.svg +++ b/src/styles/images/jsTreeSprites.svg @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/live_development_sprites.svg b/src/styles/images/live_development_sprites.svg index fed57f141..1741b793b 100644 --- a/src/styles/images/live_development_sprites.svg +++ b/src/styles/images/live_development_sprites.svg @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/no_content_bg.svg b/src/styles/images/no_content_bg.svg index efafcee4a..36b956f4d 100644 --- a/src/styles/images/no_content_bg.svg +++ b/src/styles/images/no_content_bg.svg @@ -1,88 +1,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/settings_small.svg b/src/styles/images/settings_small.svg index 7a8914ee1..cb543712e 100644 --- a/src/styles/images/settings_small.svg +++ b/src/styles/images/settings_small.svg @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/small_spinner.svg b/src/styles/images/small_spinner.svg index 5999e3590..3eb9b27dd 100644 --- a/src/styles/images/small_spinner.svg +++ b/src/styles/images/small_spinner.svg @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles/images/stepper-arrow-sprites.svg b/src/styles/images/stepper-arrow-sprites.svg index 015275b8c..ef9816797 100644 --- a/src/styles/images/stepper-arrow-sprites.svg +++ b/src/styles/images/stepper-arrow-sprites.svg @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/src/styles/images/updateSprites.svg b/src/styles/images/updateSprites.svg index 2d6ee9773..e80241a3e 100644 --- a/src/styles/images/updateSprites.svg +++ b/src/styles/images/updateSprites.svg @@ -1,9 +1,9 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/styles/images/update_large_icon.svg b/src/styles/images/update_large_icon.svg index 7bfb546c6..70ed5d288 100644 --- a/src/styles/images/update_large_icon.svg +++ b/src/styles/images/update_large_icon.svg @@ -1,3 +1,3 @@ - - - + + + diff --git a/test/smokes/citrus completed/css/citrus_mq.css b/test/smokes/citrus completed/css/citrus_mq.css index fa3ac6026..188d21220 100755 --- a/test/smokes/citrus completed/css/citrus_mq.css +++ b/test/smokes/citrus completed/css/citrus_mq.css @@ -1,8 +1,8 @@ -/* Desktop */ -@import url("desktop.css"); -/* Phone */ -@import url("phone.css") only screen and (max-width:320px); -/* Tablet */ -@import url("tablet.css") only screen and (min-width:321px) and (max-width:768px); - - +/* Desktop */ +@import url("desktop.css"); +/* Phone */ +@import url("phone.css") only screen and (max-width:320px); +/* Tablet */ +@import url("tablet.css") only screen and (min-width:321px) and (max-width:768px); + + diff --git a/test/smokes/citrus completed/css/desktop.css b/test/smokes/citrus completed/css/desktop.css index db9737cf4..bb27d55ae 100755 --- a/test/smokes/citrus completed/css/desktop.css +++ b/test/smokes/citrus completed/css/desktop.css @@ -1,165 +1,165 @@ -@charset "utf-8"; -/* CSS Document */ - -article, aside, figure, footer, header, nav, section { - display: block; - margin: 0; - padding: 0; -} -body { - font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; - color: #000; - background-color: #66B034; - margin: 0px; - padding: 0px; -} -#container { - width: 840px; - margin-top: 0px; - margin-right: auto; - margin-bottom: 0px; - margin-left: auto; -} -#logo { - background-image: url(../images/lrg_logo.png); - background-repeat: no-repeat; - height: 138px; - width: 100%; -} -#logo h1, #logo h2 { - position: absolute; - top: -500px; -} -nav { - padding-top: 150px; -} -#maincontent { - margin-top: 80px; - padding-top: 10px; - padding-right: 0px; - padding-bottom: 10px; - padding-left: 0px; -} -ul { - padding:0; - margin:0; -} -nav ul { - list-style: none; - margin-bottom: 15px; - font-weight: bold; - font-size:20px; -} -nav ul li { - float: left; -} -nav ul a { - display: block; - width:140px; - padding: 10px; - text-align:center; - text-decoration: none; - color: #fff; - border: 1px solid #618A37; - margin: 5px 0px; - border-radius: 8px; - -moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.3); - -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.3); - box-shadow: 1px 1px 3px rgba(0,0,0,0.3); - text-shadow: 1px 1px 1px rgba(0,0,0,0.8); -} -nav ul a:link, nav ul a:visited { - background: rgba(255,255,255,0.2); -} -nav ul a:hover, nav ul a:active, nav ul a:focus { - background: rgba(255,255,255,0.4); -} -nav ul li:hover { - margin-top:-10px; -} -nav ul li { - float: left; - -webkit-transition-duration:.5s; - -webkit-transition-property:margin-top; - -webkit-transition-timing-function:ease-in-out; - -o-transition-duration:.5s; - -o-transition-property:margin-top; - -o-transition-timing-function:ease-in-out; - -moz-transition-duration:.5s; - -moz-transition-property:margin-top; - -moz-transition-timing-function:ease-in-out; - transition-duration:.5s; - transition-property:margin-top; - transition-timing-function:ease-in-out; -} -#vision { - font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; - font-size:32px; - font-weight:bold; - line-height:1.2; - background-image:url(../images/lrg_hero.jpg); - background-repeat:no-repeat; - width: 409px; - height:237px; - padding:60px 370px 0 40px; - margin-bottom:20px; -} -.pod { - background: #fff; - padding: 10px; - width: 244px; - float:left; - margin-right: 13px; -} -.podContent { - margin-top:10px; - width: 244px; - height:181px; - overflow:hidden; -} -#news .podContent { - margin-top:12px; - overflow:auto; -} -#news .podContent p { - margin-top: 5px; - margin-bottom: 5px; - margin-left:6px; - font-size:15px; -} -.pod h1 { - background: #CCC; - color: #000; - padding:5px; - background-image:url(../images/icon_chevron.png); - background-repeat:no-repeat; - background-position:95%; - font-size:16px; - font-weight:normal; - margin: 0 0 10px 0; -} -a.block { - text-decoration:none; - display:block; -} -time { - font-weight:bold; - display:inline-block; - width:2.5em; -} -footer { - padding: 10px 0; - clear:both; - color: #fff; -} -footer p { - margin:0 0 5px 0; -} -#phone { - font-weight:bold; - color: #000; -} -#facebookTwitter { - float:right; - margin-right:25px; -} +@charset "utf-8"; +/* CSS Document */ + +article, aside, figure, footer, header, nav, section { + display: block; + margin: 0; + padding: 0; +} +body { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + color: #000; + background-color: #66B034; + margin: 0px; + padding: 0px; +} +#container { + width: 840px; + margin-top: 0px; + margin-right: auto; + margin-bottom: 0px; + margin-left: auto; +} +#logo { + background-image: url(../images/lrg_logo.png); + background-repeat: no-repeat; + height: 138px; + width: 100%; +} +#logo h1, #logo h2 { + position: absolute; + top: -500px; +} +nav { + padding-top: 150px; +} +#maincontent { + margin-top: 80px; + padding-top: 10px; + padding-right: 0px; + padding-bottom: 10px; + padding-left: 0px; +} +ul { + padding:0; + margin:0; +} +nav ul { + list-style: none; + margin-bottom: 15px; + font-weight: bold; + font-size:20px; +} +nav ul li { + float: left; +} +nav ul a { + display: block; + width:140px; + padding: 10px; + text-align:center; + text-decoration: none; + color: #fff; + border: 1px solid #618A37; + margin: 5px 0px; + border-radius: 8px; + -moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.3); + -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.3); + box-shadow: 1px 1px 3px rgba(0,0,0,0.3); + text-shadow: 1px 1px 1px rgba(0,0,0,0.8); +} +nav ul a:link, nav ul a:visited { + background: rgba(255,255,255,0.2); +} +nav ul a:hover, nav ul a:active, nav ul a:focus { + background: rgba(255,255,255,0.4); +} +nav ul li:hover { + margin-top:-10px; +} +nav ul li { + float: left; + -webkit-transition-duration:.5s; + -webkit-transition-property:margin-top; + -webkit-transition-timing-function:ease-in-out; + -o-transition-duration:.5s; + -o-transition-property:margin-top; + -o-transition-timing-function:ease-in-out; + -moz-transition-duration:.5s; + -moz-transition-property:margin-top; + -moz-transition-timing-function:ease-in-out; + transition-duration:.5s; + transition-property:margin-top; + transition-timing-function:ease-in-out; +} +#vision { + font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; + font-size:32px; + font-weight:bold; + line-height:1.2; + background-image:url(../images/lrg_hero.jpg); + background-repeat:no-repeat; + width: 409px; + height:237px; + padding:60px 370px 0 40px; + margin-bottom:20px; +} +.pod { + background: #fff; + padding: 10px; + width: 244px; + float:left; + margin-right: 13px; +} +.podContent { + margin-top:10px; + width: 244px; + height:181px; + overflow:hidden; +} +#news .podContent { + margin-top:12px; + overflow:auto; +} +#news .podContent p { + margin-top: 5px; + margin-bottom: 5px; + margin-left:6px; + font-size:15px; +} +.pod h1 { + background: #CCC; + color: #000; + padding:5px; + background-image:url(../images/icon_chevron.png); + background-repeat:no-repeat; + background-position:95%; + font-size:16px; + font-weight:normal; + margin: 0 0 10px 0; +} +a.block { + text-decoration:none; + display:block; +} +time { + font-weight:bold; + display:inline-block; + width:2.5em; +} +footer { + padding: 10px 0; + clear:both; + color: #fff; +} +footer p { + margin:0 0 5px 0; +} +#phone { + font-weight:bold; + color: #000; +} +#facebookTwitter { + float:right; + margin-right:25px; +} diff --git a/test/smokes/citrus completed/css/phone.css b/test/smokes/citrus completed/css/phone.css index c03051610..e302285ac 100755 --- a/test/smokes/citrus completed/css/phone.css +++ b/test/smokes/citrus completed/css/phone.css @@ -1,61 +1,61 @@ -@charset "utf-8"; -#container { - width: 100%; -} -#logo { - height:auto; - width:270px; - background-image: url(../images/sml_logo.png); - margin-left:auto; - margin-right:auto; -} -nav { - padding-top:100px; -} -nav ul { - font-size:24px; -} -nav ul a { - width:97%; - padding-right:0; -} -nav ul li { - float:none; -} -nav ul li:hover { - margin-top:0; -} -#maincontent { - margin-top: 0; - padding:0; -} -#vision { - background-image:none; - width: 280px; - height:auto; - font-size:16px; - line-height:normal; - padding-top:0; -} -/* Uncomment the declarations in the following rules to hide the images in the pods. */ -.pod { - width: 305px; - /*padding-bottom:0;*/ -} -/*.pod h1 { - margin-bottom:0; -}*/ -.podContent { - width: 302px; - height:180px; - /*display:none;*/ -} -/*#news .podContent { - display:block; -}*/ -footer p { - margin-left:5px; -} -#facebookTwitter { - margin-right:5px; -} +@charset "utf-8"; +#container { + width: 100%; +} +#logo { + height:auto; + width:270px; + background-image: url(../images/sml_logo.png); + margin-left:auto; + margin-right:auto; +} +nav { + padding-top:100px; +} +nav ul { + font-size:24px; +} +nav ul a { + width:97%; + padding-right:0; +} +nav ul li { + float:none; +} +nav ul li:hover { + margin-top:0; +} +#maincontent { + margin-top: 0; + padding:0; +} +#vision { + background-image:none; + width: 280px; + height:auto; + font-size:16px; + line-height:normal; + padding-top:0; +} +/* Uncomment the declarations in the following rules to hide the images in the pods. */ +.pod { + width: 305px; + /*padding-bottom:0;*/ +} +/*.pod h1 { + margin-bottom:0; +}*/ +.podContent { + width: 302px; + height:180px; + /*display:none;*/ +} +/*#news .podContent { + display:block; +}*/ +footer p { + margin-left:5px; +} +#facebookTwitter { + margin-right:5px; +} diff --git a/test/smokes/citrus completed/css/tablet.css b/test/smokes/citrus completed/css/tablet.css index dfbc7aba3..cdf194cb5 100755 --- a/test/smokes/citrus completed/css/tablet.css +++ b/test/smokes/citrus completed/css/tablet.css @@ -1,47 +1,47 @@ -@charset "utf-8"; -#container { - width:700px; -} -#logo { - background-image:url(../images/med_logo.png); - height:100px; -} -nav { - padding-top:110px; -} -nav ul { - font-size:18px; -} -nav ul a { - width:114px; -} -#maincontent { - padding: 0; - margin-left:5px; - width: 700px; -} -#vision { - background-image:url(../images/med_hero.jpg); - width: 289px; - height:217px; - padding-top:45px; - padding-right:350px; - font-size:26px; -} -.pod { - width: 305px; -} -.podContent { - width: 302px; - height:180px; -} -#events { - margin-left:7px; -} -#news { - width:650px; - margin-top:20px; -} -footer p { - margin-left:5px; -} +@charset "utf-8"; +#container { + width:700px; +} +#logo { + background-image:url(../images/med_logo.png); + height:100px; +} +nav { + padding-top:110px; +} +nav ul { + font-size:18px; +} +nav ul a { + width:114px; +} +#maincontent { + padding: 0; + margin-left:5px; + width: 700px; +} +#vision { + background-image:url(../images/med_hero.jpg); + width: 289px; + height:217px; + padding-top:45px; + padding-right:350px; + font-size:26px; +} +.pod { + width: 305px; +} +.podContent { + width: 302px; + height:180px; +} +#events { + margin-left:7px; +} +#news { + width:650px; + margin-top:20px; +} +footer p { + margin-left:5px; +} diff --git a/test/smokes/citrus completed/index.html b/test/smokes/citrus completed/index.html index d111393c6..fa31cb76f 100755 --- a/test/smokes/citrus completed/index.html +++ b/test/smokes/citrus completed/index.html @@ -1,69 +1,69 @@ - - - - - -Citrus Cafe - - - - -
- -
-
A new neighborhood kitchen using only organic and sustainable ingredients all locally sourced.
-
-

Today's specials

-
Soup and salad
-
-
-

Events

-
Cafe interior
-
-
-

News

-
-

- -Celebrity Guest Chef Night

-

- -New Menu Samplers!

-

- -Chef Citrus Style

-

- -Pork Pork and More Pork

-

- -Celebrity Guest Chef Night

-

- -New Menu Samplers!

-

- -Iron Chef Citrus Style

-
-
-
- -
- - + + + + + +Citrus Cafe + + + + +
+ +
+
A new neighborhood kitchen using only organic and sustainable ingredients all locally sourced.
+
+

Today's specials

+
Soup and salad
+
+
+

Events

+
Cafe interior
+
+
+

News

+
+

+ +Celebrity Guest Chef Night

+

+ +New Menu Samplers!

+

+ +Chef Citrus Style

+

+ +Pork Pork and More Pork

+

+ +Celebrity Guest Chef Night

+

+ +New Menu Samplers!

+

+ +Iron Chef Citrus Style

+
+
+
+ +
+ + diff --git a/test/thirdparty/jasmine-jquery-1.3.1.js b/test/thirdparty/jasmine-jquery-1.3.1.js index 7e85548aa..4f7357df7 100644 --- a/test/thirdparty/jasmine-jquery-1.3.1.js +++ b/test/thirdparty/jasmine-jquery-1.3.1.js @@ -1,288 +1,288 @@ -var readFixtures = function() { - return jasmine.getFixtures().proxyCallTo_('read', arguments); -}; - -var preloadFixtures = function() { - jasmine.getFixtures().proxyCallTo_('preload', arguments); -}; - -var loadFixtures = function() { - jasmine.getFixtures().proxyCallTo_('load', arguments); -}; - -var setFixtures = function(html) { - jasmine.getFixtures().set(html); -}; - -var sandbox = function(attributes) { - return jasmine.getFixtures().sandbox(attributes); -}; - -var spyOnEvent = function(selector, eventName) { - jasmine.JQuery.events.spyOn(selector, eventName); -} - -jasmine.getFixtures = function() { - return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures(); -}; - -jasmine.Fixtures = function() { - this.containerId = 'jasmine-fixtures'; - this.fixturesCache_ = {}; - this.fixturesPath = 'spec/javascripts/fixtures'; -}; - -jasmine.Fixtures.prototype.set = function(html) { - this.cleanUp(); - this.createContainer_(html); -}; - -jasmine.Fixtures.prototype.preload = function() { - this.read.apply(this, arguments); -}; - -jasmine.Fixtures.prototype.load = function() { - this.cleanUp(); - this.createContainer_(this.read.apply(this, arguments)); -}; - -jasmine.Fixtures.prototype.read = function() { - var htmlChunks = []; - - var fixtureUrls = arguments; - for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) { - htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex])); - } - - return htmlChunks.join(''); -}; - -jasmine.Fixtures.prototype.clearCache = function() { - this.fixturesCache_ = {}; -}; - -jasmine.Fixtures.prototype.cleanUp = function() { - jQuery('#' + this.containerId).remove(); -}; - -jasmine.Fixtures.prototype.sandbox = function(attributes) { - var attributesToSet = attributes || {}; - return jQuery('
').attr(attributesToSet); -}; - -jasmine.Fixtures.prototype.createContainer_ = function(html) { - var container; - if(html instanceof jQuery) { - container = jQuery('
'); - container.html(html); - } else { - container = '
' + html + '
' - } - jQuery('body').append(container); -}; - -jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) { - if (typeof this.fixturesCache_[url] == 'undefined') { - this.loadFixtureIntoCache_(url); - } - return this.fixturesCache_[url]; -}; - -jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) { - var self = this; - var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl; - jQuery.ajax({ - async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded - cache: false, - dataType: 'html', - url: url, - success: function(data) { - self.fixturesCache_[relativeUrl] = data; - }, - error: function(jqXHR, status, errorThrown) { - throw Error('Fixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')'); - } - }); -}; - -jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) { - return this[methodName].apply(this, passedArguments); -}; - - -jasmine.JQuery = function() {}; - -jasmine.JQuery.browserTagCaseIndependentHtml = function(html) { - return jQuery('
').append(html).html(); -}; - -jasmine.JQuery.elementToString = function(element) { - return jQuery('
').append(element.clone()).html(); -}; - -jasmine.JQuery.matchersClass = {}; - -(function(namespace) { - var data = { - spiedEvents: {}, - handlers: [] - }; - - namespace.events = { - spyOn: function(selector, eventName) { - var handler = function(e) { - data.spiedEvents[[selector, eventName]] = e; - }; - jQuery(selector).bind(eventName, handler); - data.handlers.push(handler); - }, - - wasTriggered: function(selector, eventName) { - return !!(data.spiedEvents[[selector, eventName]]); - }, - - cleanUp: function() { - data.spiedEvents = {}; - data.handlers = []; - } - } -})(jasmine.JQuery); - -(function(){ - var jQueryMatchers = { - toHaveClass: function(className) { - return this.actual.hasClass(className); - }, - - toBeVisible: function() { - return this.actual.is(':visible'); - }, - - toBeHidden: function() { - return this.actual.is(':hidden'); - }, - - toBeSelected: function() { - return this.actual.is(':selected'); - }, - - toBeChecked: function() { - return this.actual.is(':checked'); - }, - - toBeEmpty: function() { - return this.actual.is(':empty'); - }, - - toExist: function() { - return this.actual.size() > 0; - }, - - toHaveAttr: function(attributeName, expectedAttributeValue) { - return hasProperty(this.actual.attr(attributeName), expectedAttributeValue); - }, - - toHaveId: function(id) { - return this.actual.attr('id') == id; - }, - - toHaveHtml: function(html) { - return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html); - }, - - toHaveText: function(text) { - if (text && jQuery.isFunction(text.test)) { - return text.test(this.actual.text()); - } else { - return this.actual.text() == text; - } - }, - - toHaveValue: function(value) { - return this.actual.val() == value; - }, - - toHaveData: function(key, expectedValue) { - return hasProperty(this.actual.data(key), expectedValue); - }, - - toBe: function(selector) { - return this.actual.is(selector); - }, - - toContain: function(selector) { - return this.actual.find(selector).size() > 0; - }, - - toBeDisabled: function(selector){ - return this.actual.is(':disabled'); - }, - - // tests the existence of a specific event binding - toHandle: function(eventName) { - var events = this.actual.data("events"); - return events && events[eventName].length > 0; - }, - - // tests the existence of a specific event binding + handler - toHandleWith: function(eventName, eventHandler) { - var stack = this.actual.data("events")[eventName]; - var i; - for (i = 0; i < stack.length; i++) { - if (stack[i].handler == eventHandler) { - return true; - } - } - return false; - } - }; - - var hasProperty = function(actualValue, expectedValue) { - if (expectedValue === undefined) { - return actualValue !== undefined; - } - return actualValue == expectedValue; - }; - - var bindMatcher = function(methodName) { - var builtInMatcher = jasmine.Matchers.prototype[methodName]; - - jasmine.JQuery.matchersClass[methodName] = function() { - if (this.actual instanceof jQuery) { - var result = jQueryMatchers[methodName].apply(this, arguments); - this.actual = jasmine.JQuery.elementToString(this.actual); - return result; - } - - if (builtInMatcher) { - return builtInMatcher.apply(this, arguments); - } - - return false; - }; - }; - - for(var methodName in jQueryMatchers) { - bindMatcher(methodName); - } -})(); - -beforeEach(function() { - this.addMatchers(jasmine.JQuery.matchersClass); - this.addMatchers({ - toHaveBeenTriggeredOn: function(selector) { - this.message = function() { - return [ - "Expected event " + this.actual + " to have been triggered on" + selector, - "Expected event " + this.actual + " not to have been triggered on" + selector - ]; - }; - return jasmine.JQuery.events.wasTriggered(selector, this.actual); - } - }) -}); - -afterEach(function() { - jasmine.getFixtures().cleanUp(); - jasmine.JQuery.events.cleanUp(); -}); +var readFixtures = function() { + return jasmine.getFixtures().proxyCallTo_('read', arguments); +}; + +var preloadFixtures = function() { + jasmine.getFixtures().proxyCallTo_('preload', arguments); +}; + +var loadFixtures = function() { + jasmine.getFixtures().proxyCallTo_('load', arguments); +}; + +var setFixtures = function(html) { + jasmine.getFixtures().set(html); +}; + +var sandbox = function(attributes) { + return jasmine.getFixtures().sandbox(attributes); +}; + +var spyOnEvent = function(selector, eventName) { + jasmine.JQuery.events.spyOn(selector, eventName); +} + +jasmine.getFixtures = function() { + return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures(); +}; + +jasmine.Fixtures = function() { + this.containerId = 'jasmine-fixtures'; + this.fixturesCache_ = {}; + this.fixturesPath = 'spec/javascripts/fixtures'; +}; + +jasmine.Fixtures.prototype.set = function(html) { + this.cleanUp(); + this.createContainer_(html); +}; + +jasmine.Fixtures.prototype.preload = function() { + this.read.apply(this, arguments); +}; + +jasmine.Fixtures.prototype.load = function() { + this.cleanUp(); + this.createContainer_(this.read.apply(this, arguments)); +}; + +jasmine.Fixtures.prototype.read = function() { + var htmlChunks = []; + + var fixtureUrls = arguments; + for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) { + htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex])); + } + + return htmlChunks.join(''); +}; + +jasmine.Fixtures.prototype.clearCache = function() { + this.fixturesCache_ = {}; +}; + +jasmine.Fixtures.prototype.cleanUp = function() { + jQuery('#' + this.containerId).remove(); +}; + +jasmine.Fixtures.prototype.sandbox = function(attributes) { + var attributesToSet = attributes || {}; + return jQuery('
').attr(attributesToSet); +}; + +jasmine.Fixtures.prototype.createContainer_ = function(html) { + var container; + if(html instanceof jQuery) { + container = jQuery('
'); + container.html(html); + } else { + container = '
' + html + '
' + } + jQuery('body').append(container); +}; + +jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) { + if (typeof this.fixturesCache_[url] == 'undefined') { + this.loadFixtureIntoCache_(url); + } + return this.fixturesCache_[url]; +}; + +jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) { + var self = this; + var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl; + jQuery.ajax({ + async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded + cache: false, + dataType: 'html', + url: url, + success: function(data) { + self.fixturesCache_[relativeUrl] = data; + }, + error: function(jqXHR, status, errorThrown) { + throw Error('Fixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')'); + } + }); +}; + +jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) { + return this[methodName].apply(this, passedArguments); +}; + + +jasmine.JQuery = function() {}; + +jasmine.JQuery.browserTagCaseIndependentHtml = function(html) { + return jQuery('
').append(html).html(); +}; + +jasmine.JQuery.elementToString = function(element) { + return jQuery('
').append(element.clone()).html(); +}; + +jasmine.JQuery.matchersClass = {}; + +(function(namespace) { + var data = { + spiedEvents: {}, + handlers: [] + }; + + namespace.events = { + spyOn: function(selector, eventName) { + var handler = function(e) { + data.spiedEvents[[selector, eventName]] = e; + }; + jQuery(selector).bind(eventName, handler); + data.handlers.push(handler); + }, + + wasTriggered: function(selector, eventName) { + return !!(data.spiedEvents[[selector, eventName]]); + }, + + cleanUp: function() { + data.spiedEvents = {}; + data.handlers = []; + } + } +})(jasmine.JQuery); + +(function(){ + var jQueryMatchers = { + toHaveClass: function(className) { + return this.actual.hasClass(className); + }, + + toBeVisible: function() { + return this.actual.is(':visible'); + }, + + toBeHidden: function() { + return this.actual.is(':hidden'); + }, + + toBeSelected: function() { + return this.actual.is(':selected'); + }, + + toBeChecked: function() { + return this.actual.is(':checked'); + }, + + toBeEmpty: function() { + return this.actual.is(':empty'); + }, + + toExist: function() { + return this.actual.size() > 0; + }, + + toHaveAttr: function(attributeName, expectedAttributeValue) { + return hasProperty(this.actual.attr(attributeName), expectedAttributeValue); + }, + + toHaveId: function(id) { + return this.actual.attr('id') == id; + }, + + toHaveHtml: function(html) { + return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html); + }, + + toHaveText: function(text) { + if (text && jQuery.isFunction(text.test)) { + return text.test(this.actual.text()); + } else { + return this.actual.text() == text; + } + }, + + toHaveValue: function(value) { + return this.actual.val() == value; + }, + + toHaveData: function(key, expectedValue) { + return hasProperty(this.actual.data(key), expectedValue); + }, + + toBe: function(selector) { + return this.actual.is(selector); + }, + + toContain: function(selector) { + return this.actual.find(selector).size() > 0; + }, + + toBeDisabled: function(selector){ + return this.actual.is(':disabled'); + }, + + // tests the existence of a specific event binding + toHandle: function(eventName) { + var events = this.actual.data("events"); + return events && events[eventName].length > 0; + }, + + // tests the existence of a specific event binding + handler + toHandleWith: function(eventName, eventHandler) { + var stack = this.actual.data("events")[eventName]; + var i; + for (i = 0; i < stack.length; i++) { + if (stack[i].handler == eventHandler) { + return true; + } + } + return false; + } + }; + + var hasProperty = function(actualValue, expectedValue) { + if (expectedValue === undefined) { + return actualValue !== undefined; + } + return actualValue == expectedValue; + }; + + var bindMatcher = function(methodName) { + var builtInMatcher = jasmine.Matchers.prototype[methodName]; + + jasmine.JQuery.matchersClass[methodName] = function() { + if (this.actual instanceof jQuery) { + var result = jQueryMatchers[methodName].apply(this, arguments); + this.actual = jasmine.JQuery.elementToString(this.actual); + return result; + } + + if (builtInMatcher) { + return builtInMatcher.apply(this, arguments); + } + + return false; + }; + }; + + for(var methodName in jQueryMatchers) { + bindMatcher(methodName); + } +})(); + +beforeEach(function() { + this.addMatchers(jasmine.JQuery.matchersClass); + this.addMatchers({ + toHaveBeenTriggeredOn: function(selector) { + this.message = function() { + return [ + "Expected event " + this.actual + " to have been triggered on" + selector, + "Expected event " + this.actual + " not to have been triggered on" + selector + ]; + }; + return jasmine.JQuery.events.wasTriggered(selector, this.actual); + } + }) +}); + +afterEach(function() { + jasmine.getFixtures().cleanUp(); + jasmine.JQuery.events.cleanUp(); +});