From 1e0aec0267ebdbba9ffd8b84932388a45dbe689d Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:32:10 +1000 Subject: [PATCH 001/130] Adding in font files for custom font --- public/OFN.eot | Bin 0 -> 31132 bytes public/OFN.svg | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ public/OFN.ttf | Bin 0 -> 30984 bytes public/OFN.woff | Bin 0 -> 18936 bytes 4 files changed, 59 insertions(+) create mode 100755 public/OFN.eot create mode 100755 public/OFN.svg create mode 100755 public/OFN.ttf create mode 100755 public/OFN.woff diff --git a/public/OFN.eot b/public/OFN.eot new file mode 100755 index 0000000000000000000000000000000000000000..5b07d8beed6779132ee60b39623f71f16ed01867 GIT binary patch literal 31132 zcmcJY37lkCUGML?x9Z;7_oerxYPxH-bXRp(boty(;%gk&Is0RrdyG=9x$f+Al>-o*FR6nukk(kf;(?LHS?@LyqipOJYRF$t>1o%Yl-LExu$Nr<25fXKlGv+ z&!pdV|Lrfj^@Yy&{?vCl&Z|gswr(fE`&&29^EEv0x&6+&Ui|`-{Cl2N&!67$@)z7% z_`S7{InH-Jnddw1y!F+moSVEmcz%HArI+1$=Zo%sSNH$%{0ME-Prdxx?*dLful|DG zJD%&9dz>Wit}!nr<;v*#RcG4yFUmLZF{OzIdwarhKHoKup5dQ)l-j7qriVXzcI-f@ z#TxDEZOutIhqz{(6z^!>S^9kU%>O%chBSwJ$KIPWe>szgO4t|t7{`#SXln`6AcEmx z+vIk;7f!1<&Y4GP^if7^*4gXyohLiba=w)zexvga=RM8`o!@f)xAP_EYbI&R)IO*c z++e|LcKEJ&oq`t(k9(VgcB8gnn!^RJK2Q>0-XHgdLA$o#>SoOw3^xa@HMdi6YeB~r zt#9^^yF*^7GG(@xL0e4>sA{vX>|PMG>l>=Y?GFQ6l@h&H!L3vI=EiY%K*n~N$_G@q zN!~hDw1;(7PwmZu*RF4__SZ}&EI+6}md+ItiBu-*pP>Gf=XwdxbrW8~)RS3KyT%wd zktpQSem0X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qTg zvU8r;BwWOb97Jzb2u8k42fe?20S|6u$7>QuFteWS&_q}%NNIUyQRZpz2 z0JC+PyC>RtKhQ+U57?^!2N(Cz-pR1NYICyBYRYbzQ#6IJf>w6lf3P{)yT*B=dC;6t z|0eOeP9IyVZJi+y29eOet>LpDuLEzq5I`26*EpwX@8S@jljCa-LeTl7VQ>iQ0~@B^ z_jnDOi!azBN?5dJKg(XBSMIW#!li;q(+L$xadho!z}XNjPDfHG3*%tVLgGxm5JK5S z8#)N0&q{{k?R5UT_Ej@5#Pjd8dD4~HN@X80oyl!$Co#3Qf3;kiAs~0}CEv3CjAvZO z8Wohl=I&>ToGq(_;XUIzJ;2HMaj$)bs2fhf)7f^(%*NXOYGuBbF_XqghV75#y$3Fu zvZl(_Pru$aAd0;H>DGi0i5m0t>%*(1)%XqVO#B~mvOTZcg}-yyogi*v)-HG)JbT>q zwrBOZ@DrMc6Sx^$hqu2jf)i+-rLGG>E`h*&G|6^g!J2842pF4b{qNfD`%O`AU$5l@ zs&lPh<7`^t|IZ9w1<-&W{a#1#+271n!npSUx#`d(?_Zr6U79% zh$=dz@-+KR&o+)ve=LxW2C+2vo8fr@P4}V z2471`_ED5GiM$9^(Y(nDQ)f*gi>}VWXzrXflfIgm#Lu}9Xn7rIa-9EjI{mTd7mt0_ z$!Y_w<9z(**FG0t&zw2)IsVs+M|sx&gc^P*qyJA;0-5*!?50)AS)ak=lU}Om6Zqb# z8p(IZj=VQbJlD9tdE#01F7bV4lm=6kVij)qyPQ7vtHJ)@W2rA>pOgDo{&?}K>h1Mh7 z{O^m;{T~(EcTd0K+UWl{KKuVS4hvq%|8V>=`@bCDic{!C&I_F-w$i?a-={b);D0@S S8eje2$9$|)V<)P%pZ`CQcAmNb literal 0 HcmV?d00001 diff --git a/public/OFN.svg b/public/OFN.svg new file mode 100755 index 0000000000..36340b067d --- /dev/null +++ b/public/OFN.svg @@ -0,0 +1,59 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/OFN.ttf b/public/OFN.ttf new file mode 100755 index 0000000000000000000000000000000000000000..679180d708bad13a9a892cf44656d6489e6375f0 GIT binary patch literal 30984 zcmcJY37lkCUGML?x9Z;7_oerxYPxH-bXRp(b2T=K-H_*}?C;qmzJktjYy1&w|{QF%4*`#bmE>YDDENl>im zs(bIbXZfH1`JexG{^yKi9LLEzrybAfUh|aoja2KKUn1q#`JR049k-mCdFmhD2q%>{NCCp9OrwU!1L{Q-15p(&W+yfJm1gr(o1f+ zEVx_9mnOX7HjS^84<%>O%chBSwJ z$KIPWUz|xqCF~1+jAO`Ew6%n3)IB_Go7`^q!f6%9IrA`$KFo;CI(wbI^91Lq&U2iX zJFjy%!{grOpxvk~nC5W7s}GdK zm-olLVbHEExVl;M2E)xkYt8Kx+*;7FMeCdWd6i2xcC_%5JKn!W zxqQD=F8d(aGuLicb^VT3&GROEt=^AL*V^kdGwbbIeErHq=Qg)H^G@51ut%D45uLkE z)9E_SC8jgnNkUb~rq_m!dLpErD5+Qfv+J*K#aNH8rwgURFP1846JI~j>wR(;pr0yL zQZ6}eimy!4+!&6o^K9pboDVy{;d}}h*Ub_06!X*O1I)3m-}Q(7hTjkRe%~Lqwpv@k zFlhRXTBE+v*k}xETivZ5-;H4~TsQThzv{0Bw$!=_hMld(Ms3sIs%_P`HjbNNcWZU4 zGhFSj_S;N>Rwvk??xDX${agHU*XjphE3~ARYg@e8s11Wojarmzm0DYUf8h7Yy9IpQ z`5OT+`SyJSNN5>os;dRJ>1(=b(g%w!jco)}Q==hO2JmDI)=k%M`8~d^px;_;4O)GH z8Eo|h@^QDhMI8&CnkX1L*YZ35YHPJkHvneXY1W6$qFHyF%^2md0c*!u^!g}dhx>OySV*0WF>|^|-BtCO-i+Zq`57gqohxqIn$Ou{DjF9q0u&%vfPjgA#%w5s84sW^ zIh$mQjMLNsV^*@6LW$N&`Cl{1Y%cxbbS|4DJxCXV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ko1d9DUc-NZ z!vtvpN}b|E0i=DQQ%+iO%Ej+WALS+_>Dis<{p`s3z4zYx*>NYLPy9c0>aV%J#C^p- zMUn8{J?=yw5?490U2x=r&)iwAdJOvphKO>t#pXGu+d$UqAi~|6Rv# z3p3)MXN{j1;QVpyXN});y%VvYg#E|Zuf^VveF*#2<2#pmf0v{Ml2jkrB>dYP9u^Od z{})jG`Z)YEo^!{qkH_=RjbBg1^+n^?vh+#Z)ysbb^K$0+^-0oKrAv99CNee|X8pPj zvwmHNS--BstY6n*)~`Q;x?dizTZcJcnj>8+-6*ZWzW{2MZkHORjne7(M?vRF=i^@l z;T``=qI#i)D6~%6A~i_2qHz7$Ts+(8SH4wh!Fe?*uar7)oQMA`)F@qpok99N=Hp-7 F{x7dTD}ew2 literal 0 HcmV?d00001 From 0c2a7ac24745b31c15ccdbeee99326d585c85109 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:32:37 +1000 Subject: [PATCH 002/130] Adding style sheet to allow access to custom font --- app/assets/stylesheets/darkswarm/style.css | 173 +++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100755 app/assets/stylesheets/darkswarm/style.css diff --git a/app/assets/stylesheets/darkswarm/style.css b/app/assets/stylesheets/darkswarm/style.css new file mode 100755 index 0000000000..44887cb970 --- /dev/null +++ b/app/assets/stylesheets/darkswarm/style.css @@ -0,0 +1,173 @@ +@font-face { + font-family: 'OFN'; + src:url('/OFN.eot'); + src:url('/OFN.eot') format('embedded-opentype'), + url('/OFN.woff') format('woff'), + url('/OFN.ttf') format('truetype'), + url('/OFN.svg') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="ofn-"], [class*=" ofn-"] { + font-family: 'OFN'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + font-size: 1.5; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.ofn-i_049-web:before { + content: "\e600"; +} +.ofn-i_048-play-video:before { + content: "\e601"; +} +.ofn-i_047-youtube:before { + content: "\e602"; +} +.ofn-i_046-g:before { + content: "\e603"; +} +.ofn-i_045-pintrest:before { + content: "\e604"; +} +.ofn-i_044-facebook:before { + content: "\e605"; +} +.ofn-i_043-instagram:before { + content: "\e606"; +} +.ofn-i_042-twitter:before { + content: "\e607"; +} +.ofn-i_041-twitter:before { + content: "\e608"; +} +.ofn-i_040-hub:before { + content: "\e609"; +} +.ofn-i_039-delivery:before { + content: "\e60a"; +} +.ofn-i_038-takeaway:before { + content: "\e60b"; +} +.ofn-i_037-map:before { + content: "\e60c"; +} +.ofn-i_036-producers:before { + content: "\e60d"; +} +.ofn-i_035-groups:before { + content: "\e60e"; +} +.ofn-i_034-timer:before { + content: "\e60f"; +} +.ofn-i_033-open-sign:before { + content: "\e610"; +} +.ofn-i_032-closed-sign:before { + content: "\e611"; +} +.ofn-i_031-alarm-clock:before { + content: "\e612"; +} +.ofn-i_030-money:before { + content: "\e613"; +} +.ofn-i_029-shopping-basket:before { + content: "\e614"; +} +.ofn-i_028-barcode:before { + content: "\e615"; +} +.ofn-i_027-shopping-cart:before { + content: "\e616"; +} +.ofn-i_026-trash:before { + content: "\e617"; +} +.ofn-i_025-notepad:before { + content: "\e618"; +} +.ofn-i_024-mail:before { + content: "\e619"; +} +.ofn-i_023-refresh:before { + content: "\e61a"; +} +.ofn-i_022-cog:before { + content: "\e61b"; +} +.ofn-i_021-tools:before { + content: "\e61c"; +} +.ofn-i_020-search:before { + content: "\e61d"; +} +.ofn-i_019-map-pin:before { + content: "\e61e"; +} +.ofn-i_018-unlocked:before { + content: "\e61f"; +} +.ofn-i_017-locked:before { + content: "\e620"; +} +.ofn-i_016-group:before { + content: "\e621"; +} +.ofn-i_015-user:before { + content: "\e622"; +} +.ofn-i_014-menu:before { + content: "\e623"; +} +.ofn-i_013-help:before { + content: "\e624"; +} +.ofn-i_012-warning:before { + content: "\e625"; +} +.ofn-i_011-spinner:before { + content: "\e626"; +} +.ofn-i_010-bullet:before { + content: "\e627"; +} +.ofn-i_009-close:before { + content: "\e628"; +} +.ofn-i_008-caret-left:before { + content: "\e629"; +} +.ofn-i_007-caret-right:before { + content: "\e62a"; +} +.ofn-i_006-caret-up:before { + content: "\e62b"; +} +.ofn-i_005-caret-down:before { + content: "\e62c"; +} +.ofn-i_004-x:before { + content: "\e62d"; +} +.ofn-i_003-check:before { + content: "\e62e"; +} +.ofn-i_002-arrow-right:before { + content: "\e62f"; +} +.ofn-i_001-arrow-left:before { + content: "\e630"; +} From 8954caf3e0eae6715724d133cebbe712a4ed7904 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:33:01 +1000 Subject: [PATCH 003/130] Applying new icon font to active table on homepage --- app/views/home/_fat.html.haml | 2 +- app/views/home/_skinny.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index 9382844265..caddc00d8a 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -22,4 +22,4 @@ .columns.small-1.text-right %a{"bo-href" => "hub.path"} - %i.fi-arrow-right + %i.ofn-i_007-caret-right diff --git a/app/views/home/_skinny.html.haml b/app/views/home/_skinny.html.haml index fcf860575e..4f68badf5a 100644 --- a/app/views/home/_skinny.html.haml +++ b/app/views/home/_skinny.html.haml @@ -10,4 +10,4 @@ .columns.small-3{"bo-if" => "!hub.active"} Orders closed .columns.small-1.text-right - %i{"ng-class" => "{'fi-arrow-down' : !open(), 'fi-arrow-up' : open()}"} + %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"} From 7185aa6ab6d5d4e05d765d929118ea55f25bf5c3 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:38:01 +1000 Subject: [PATCH 004/130] Applying new icon font to groups partial on homepage --- app/views/home/_groups.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/home/_groups.html.haml b/app/views/home/_groups.html.haml index dd55a9bcd1..5d76dd1e2d 100644 --- a/app/views/home/_groups.html.haml +++ b/app/views/home/_groups.html.haml @@ -6,5 +6,5 @@ %h5 See all the groups & regions on the Open Food Network %p %a.neutral-btn.light{href: "/groups"} - %i.fi-torsos-all + %i.ofn-i_035-groups View groups & regions \ No newline at end of file From 4c832b6ae989f68164bd0c369ae34adc467d3e62 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:39:26 +1000 Subject: [PATCH 005/130] Applying new icon font to producers partial on homepage --- app/views/home/_producers.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/home/_producers.html.haml b/app/views/home/_producers.html.haml index 31a573d610..3d4fcfbd68 100644 --- a/app/views/home/_producers.html.haml +++ b/app/views/home/_producers.html.haml @@ -6,5 +6,5 @@ %h5 Looking for a specific producer or farmer? %p %a.neutral-btn.turquoise{href: "/producers"} - %i.fi-trees + %i.ofn-i_036-producers View all producers \ No newline at end of file From d3802e9f83438fb806620fc9ab23e49ffc2c6b32 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 16:43:06 +1000 Subject: [PATCH 006/130] Applying new icon font to map partial on homepage --- app/views/home/_map.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/home/_map.html.haml b/app/views/home/_map.html.haml index 29224493e2..8d83e58c40 100644 --- a/app/views/home/_map.html.haml +++ b/app/views/home/_map.html.haml @@ -6,5 +6,5 @@ %h5 of all our food hubs and producers %p %button.neutral-btn.light - %i.fi-map + %i.ofn-i_037-map View map \ No newline at end of file From 6ea7988f4e5a3a19ac9cacd50c569278efa56b44 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 17:06:06 +1000 Subject: [PATCH 007/130] New version fonts --- app/assets/stylesheets/darkswarm/style.css | 13 ++++++------- public/OFN.eot | Bin 31132 -> 31140 bytes public/OFN.svg | 2 +- public/OFN.ttf | Bin 30984 -> 30992 bytes public/OFN.woff | Bin 18936 -> 18940 bytes 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/style.css b/app/assets/stylesheets/darkswarm/style.css index 44887cb970..962390c353 100755 --- a/app/assets/stylesheets/darkswarm/style.css +++ b/app/assets/stylesheets/darkswarm/style.css @@ -1,10 +1,10 @@ @font-face { font-family: 'OFN'; - src:url('/OFN.eot'); - src:url('/OFN.eot') format('embedded-opentype'), - url('/OFN.woff') format('woff'), - url('/OFN.ttf') format('truetype'), - url('/OFN.svg') format('svg'); + src:url('/OFN.eot?nugltz'); + src:url('/OFN.eot?#iefixnugltz') format('embedded-opentype'), + url('/OFN.woff?nugltz') format('woff'), + url('/OFN.ttf?nugltz') format('truetype'), + url('/OFN.svg?nugltz#OFN') format('svg'); font-weight: normal; font-style: normal; } @@ -17,7 +17,6 @@ font-variant: normal; text-transform: none; line-height: 1; - font-size: 1.5; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; @@ -45,7 +44,7 @@ .ofn-i_043-instagram:before { content: "\e606"; } -.ofn-i_042-twitter:before { +.ofn-i_042-linkedin:before { content: "\e607"; } .ofn-i_041-twitter:before { diff --git a/public/OFN.eot b/public/OFN.eot index 5b07d8beed6779132ee60b39623f71f16ed01867..cf85b7a5cbf175e005bca8ebe368c9ddf30bdbf1 100755 GIT binary patch delta 353 zcmbR9nQ_TyM%E>j3=9GjSOIR<}${2M?!L<{nZOBk4eG7J?TK=KUCOq+ulIr8eaGE86$Wi((A zVbB7qGm>Ls7vp16R?=fqw_`R|SK?z5XOm+xHnL+f*JD;TW@P1+5a4EH^bAs$y>^6g3t27iJ43qU(W3-XIg7?^=F3>7ax@(j#On}ZoS^7w8r>|oSj - + diff --git a/public/OFN.ttf b/public/OFN.ttf index 679180d708bad13a9a892cf44656d6489e6375f0..ad8f6109bccf8950255f9ea440788175feea4825 100755 GIT binary patch delta 337 zcmeD9#5e(n9O{c1R_8M?FcvT{l&r}}O-x~^-DbeRP$t8`z+jdE6kvYM#0%ty0Qo8z zxg{0JjI3vX{0bodN=|-qBHwMjI}8lvK0tm>Zem3NLj-dUkiP@SSIA4uO>LiJ@E6Fx z0klK3AiubTff*>nQ1JmI&%n&IaX&|1{Z@tvjG>GM3?d9#KxIa9OzdKOOv*}nOzL*b z#_CFZOyX>EOvXlbOy+vb%EpYWyb=Q3jEvj@61;q3!kmnZoWf#!jQnz%C@3q+3!@nrH{0dkW0Mg(?%NX2Z}XLbn+fDX whV!efcERY$7G=*Fw@y|luN8h}Zed+&p!-Y3_#$yg@JMMLr<}ZI^6XS85mq2cByyxu8AU<3eU8E3g8bqVpxf_Ed=bWYW3xTubw=St`+fHR9PAuw9rilbImtNPb6&Dp zlUdo`X6E-TqU*bt=XGavXXNLl1F5_f-Rrv7tyr+&mRn23_#$yfq`-ILr<}ZI^6a57#Ljd1s;uK_7B!K zVqkE)0+dexVGgA~&ysT!3m6#OO@MqK5S9u()1IDK3=(Sq@;RVbAR{#~1t``50tIL>~z{ci_rhbo6%j@3?*PPd&G zZq{U0wzr(}-AA;vyK-*#!tRB0=K_iDxs~0e-KCY4rQICer$y_!8ydRny6dJj%;=uc zJ#8A0n9(q;uA5_Xhf@H{o@bH(%9d}ZKf0=kNU;rwd7`!IU)2KVQTH#X1k HNMQs3h(~cc From 3f36a3785be9d819acad1f7b6646803263682542 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 17:06:34 +1000 Subject: [PATCH 008/130] Adding in icon for list style from new OFN icon font --- app/assets/stylesheets/darkswarm/typography.css.sass | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/typography.css.sass b/app/assets/stylesheets/darkswarm/typography.css.sass index 63d4efe13f..aad9fa7237 100644 --- a/app/assets/stylesheets/darkswarm/typography.css.sass +++ b/app/assets/stylesheets/darkswarm/typography.css.sass @@ -37,18 +37,20 @@ h1, h2, h3, h4, h5, h6, .avenir padding: 0px ul.ofn-list - margin-left: 0.5em + margin: 0 li list-style: none + line-height: 1.5 + height: inherit li:before - content: "\f112" - font-family: "foundation-icons" + content: "\e627" + font-family: "OFN" display: inline-block font-weight: normal font-style: normal font-variant: normal text-transform: none - font-size: 80% + .light-grey color: #666666 From 614b25c446aac4b987ded5fe22c1cdee2eab86b1 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 28 May 2014 17:06:52 +1000 Subject: [PATCH 009/130] Applying new icon font to footer partial on homepage --- app/views/shared/_footer.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index bb33312652..66d50def5c 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -9,13 +9,13 @@ %h4 Follow us %p %a{title:'Follow us on Facebook', href: 'https://www.facebook.com/OpenFoodNet', target: '_blank'} - %i.fi-social-facebook + %i.ofn-i_044-facebook Facebook    %a{title:'Follow us on Twitter', href: 'https://twitter.com/OpenFoodNet', target: '_blank'} - %i.fi-social-twitter + %i.ofn-i_041-twitter Twitter    %a{title:'Join our group on LinkedIn', href: 'http://www.linkedin.com/groups/Open-Food-Foundation-4743336', target: '_blank'} - %i.fi-social-linkedin + %i.ofn-i_042-linkedin LinkedIn .small-12.medium-4.columns.text-left %h4 Getting around From 45f6a86fd261e22d176374f448b5f5c5b2c89866 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 10:19:50 +1000 Subject: [PATCH 010/130] Adding new icons to menu partials --- app/views/shared/menu/_large_menu.html.haml | 2 +- app/views/shared/menu/_mobile_menu.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 7a72b80f60..79e6c286ca 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -44,7 +44,7 @@ %li.divider %li.cart %a.icon{href: cart_url} - %i.fi-shopping-cart.nav-branded + %i.ofn-i_027-shopping-cart.nav-branded %span = cart_count items diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index 5e9f22c597..f796490b65 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -4,7 +4,7 @@ %span %section.right %a.nav-branded.icon{href: cart_url} - %i.fi-shopping-cart + %i.ofn-i_027-shopping-cart %span = cart_count items From 4971e2305f2a69e75a0e7bd2a846b2e0728a0d68 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 10:54:07 +1000 Subject: [PATCH 011/130] Add hub icon to modal --- app/views/modals/_food_hub.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_food_hub.html.haml b/app/views/modals/_food_hub.html.haml index 9b559d26cc..fc5cb36019 100644 --- a/app/views/modals/_food_hub.html.haml +++ b/app/views/modals/_food_hub.html.haml @@ -1,4 +1,6 @@ -%h2 Food Hubs +%h2 + %i.ofn-i_040-hub + Food Hubs %h5 Our food hubs are the point of contact between you and the people who make your food! %p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected. %p You can only shop one food hub at a time. From 8f7bab4ab7adf790e036683db67cbd691ad2e914 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 10:54:27 +1000 Subject: [PATCH 012/130] Add hub icon to active table --- app/views/home/_skinny.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/home/_skinny.html.haml b/app/views/home/_skinny.html.haml index 4f68badf5a..8798e504a6 100644 --- a/app/views/home/_skinny.html.haml +++ b/app/views/home/_skinny.html.haml @@ -1,5 +1,6 @@ .row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"} .columns.small-4 + %i.ofn-i_040-hub %strong {{ hub.name }} .columns.small-3 {{ hub.address.city }} From ff1c5a13e782ddbf6f0d216f96df27defa9909a2 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:01:49 +1000 Subject: [PATCH 013/130] Add producers icon to active table --- app/views/producers/_skinny.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/producers/_skinny.html.haml b/app/views/producers/_skinny.html.haml index c87c2295ed..a5608b8b3d 100644 --- a/app/views/producers/_skinny.html.haml +++ b/app/views/producers/_skinny.html.haml @@ -1,9 +1,10 @@ .row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"} .columns.small-4 + %i.ofn-i_036-producers %strong {{ producer.name }} .columns.small-3 {{ producer.address.city }} .columns.small-4 {{ producer.address.state | uppercase }} .columns.small-1.text-right - %i{"ng-class" => "{'fi-arrow-down' : !open(), 'fi-arrow-up' : open()}"} + %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"} \ No newline at end of file From 1248eaeed7648225360cfd2c8a1f568c7cfbbae3 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:05:28 +1000 Subject: [PATCH 014/130] Add producers icon to modal --- app/views/modals/_producers.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_producers.html.haml b/app/views/modals/_producers.html.haml index 89d8ccabae..d3be6e56c3 100644 --- a/app/views/modals/_producers.html.haml +++ b/app/views/modals/_producers.html.haml @@ -1,3 +1,5 @@ -%h2 Producers +%h2 + %i.ofn-i_036-producers + Producers %p Our producers make all the delicious food you can shop for on the Open Food Network. %a.close-reveal-modal{"ng-click" => "cancel()"} × \ No newline at end of file From 81f51e734c448ec3218bdf80d634de0adf7b3457 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:07:43 +1000 Subject: [PATCH 015/130] Add groups icon to listings on page --- app/views/groups/index.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/groups/index.html.haml b/app/views/groups/index.html.haml index fdbf8c5ee6..0e9ae1b185 100644 --- a/app/views/groups/index.html.haml +++ b/app/views/groups/index.html.haml @@ -24,7 +24,9 @@ .group-hero %img.group-hero-img{"bo-src" => "{{group.promo_image}}"} %img.group-logo{"bo-src" => "group.logo"} - %h3.group-name {{ group.name }} + %h3.group-name + %i.ofn-i_035-groups + {{ group.name }} %h5.group-description {{ group.description }} / Will - scale large images down to 1200px wide, crop in to img aspect ratio 60W:13H From b8eb43f8db5ffd05284280e356d2b1bc429f3de1 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:08:35 +1000 Subject: [PATCH 016/130] Add groups icon to modal --- app/views/modals/_groups.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_groups.html.haml b/app/views/modals/_groups.html.haml index 80e210c98a..a97b9982c7 100644 --- a/app/views/modals/_groups.html.haml +++ b/app/views/modals/_groups.html.haml @@ -1,4 +1,6 @@ -%h2 Groups / Regions +%h2 + %i.ofn-i_035-groups + Groups / Regions %p These are the organisations and relationships between hubs which make up the Open Food Network. %p Some groups are clustered by location or council, others by non-geographic similarities. %a.close-reveal-modal{"ng-click" => "cancel()"} × \ No newline at end of file From 68ab24b7907e497e60e6148211c64ef306a2fa98 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:10:45 +1000 Subject: [PATCH 017/130] Add links into footer --- app/views/shared/_footer.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index 66d50def5c..ee13a29d47 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -21,13 +21,13 @@ %h4 Getting around %ul.ofn-list %li - %a{href: ""} Shop + %a{href: "/map"} Shop %li - %a{href: ""} Map + %a{href: "/map"} Map %li - %a{href: ""} Producers + %a{href: "/producers"} Producers %li - %a{href: ""} Groups + %a{href: "/groups"} Groups .small-12.medium-4.columns.text-left %h4 About us %p OFN is a network of independent online food stores that connect farmers and food hubs with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food. From 39358247fd1ccc0a13a8a01a6f96beef35acdcaf Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:47:06 +1000 Subject: [PATCH 018/130] Kill whitespace around icon --- app/views/modals/_food_hub.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/modals/_food_hub.html.haml b/app/views/modals/_food_hub.html.haml index fc5cb36019..c6fcf4155b 100644 --- a/app/views/modals/_food_hub.html.haml +++ b/app/views/modals/_food_hub.html.haml @@ -1,5 +1,5 @@ %h2 - %i.ofn-i_040-hub + %i.ofn-i_040-hub> Food Hubs %h5 Our food hubs are the point of contact between you and the people who make your food! %p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected. From 86dee82acbba966ef799e00aadce0077f2fd2b43 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:59:28 +1000 Subject: [PATCH 019/130] Add search icon into search input on hubs --- app/views/home/_hubs.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/_hubs.html.haml b/app/views/home/_hubs.html.haml index cc893f5997..7d28d28508 100644 --- a/app/views/home/_hubs.html.haml +++ b/app/views/home/_hubs.html.haml @@ -10,10 +10,10 @@ %ofn-modal{title: "food hub"} = render partial: "modals/food_hub" from the list below: - %p - #active-table-search.row + #active-table-search.row.pad-top .small-12.columns + %i.ofn-i_020-search %input{type: :text, "ng-model" => "query", placeholder: "Search postcode, suburb or hub name...", From 4f1c7345c5d0edce8a64bf3c365bd30f4920267c Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 11:59:55 +1000 Subject: [PATCH 020/130] Add search icon into search input on producers page --- app/views/producers/index.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/producers/index.haml b/app/views/producers/index.haml index 41ef76680b..a5b1601ce3 100644 --- a/app/views/producers/index.haml +++ b/app/views/producers/index.haml @@ -4,17 +4,18 @@ -#%pre -#{{ Producers.producers | json }} - #active-table-search.row - .small-12.columns.text-center - %p + .row + .small-12.columns.text-center.pad-top %h1 Producers %div Select a %ofn-modal{title: "producer"} = render partial: "modals/producers" from the list below: - %p + #active-table-search.row.pad-top + .small-12.columns + %i.ofn-i_020-search %input{type: :text, "ng-model" => "query", placeholder: "Search postcode, suburb or hub name...", From c81631118dd563c90bb2ecf828bb43d609ca64f9 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 29 May 2014 12:00:16 +1000 Subject: [PATCH 021/130] Add styling to include the search icon in big input searches for Hubs and Producers --- .../darkswarm/active_table_search.css.sass | 19 ++++++++++++++++--- app/assets/stylesheets/darkswarm/mixins.sass | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index 5b70800bab..e558c41511 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -1,6 +1,19 @@ @import mixins #active-table-search - input - font-size: 2em - @include big-input \ No newline at end of file + position: relative + + i.ofn-i_020-search + position: absolute + left: 26px + top: 12px + font-size: 1.6em + z-index: 999 + color: #b2b2b2 + + input[type="text"] + font-size: 2em + @include csstrans + @include big-input + padding-left: 44px + \ No newline at end of file diff --git a/app/assets/stylesheets/darkswarm/mixins.sass b/app/assets/stylesheets/darkswarm/mixins.sass index fd26cfcae9..aa44d4c4b5 100644 --- a/app/assets/stylesheets/darkswarm/mixins.sass +++ b/app/assets/stylesheets/darkswarm/mixins.sass @@ -12,9 +12,14 @@ border: 1px solid #999 font-size: 18px @extend .avenir + box-shadow: 0 padding: 0.75em 1em height: auto margin-bottom: 1em + background: rgba(255,255,255,0.65) + &:active, &:hover, &:focus + background: rgba(255,255,255,1) + border-color: #888 @mixin disabled color: $disabled-bright From 0eb4e35ee430eac0b2ca78008d346eeee02783ba Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:30:30 +1000 Subject: [PATCH 022/130] New version of icon font --- app/assets/stylesheets/darkswarm/style.css | 126 ++++++++++++--------- public/OFN.eot | Bin 31140 -> 31948 bytes public/OFN.svg | 104 +++++++++-------- public/OFN.ttf | Bin 30992 -> 31800 bytes public/OFN.woff | Bin 18940 -> 19496 bytes 5 files changed, 127 insertions(+), 103 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/style.css b/app/assets/stylesheets/darkswarm/style.css index 962390c353..94980106af 100755 --- a/app/assets/stylesheets/darkswarm/style.css +++ b/app/assets/stylesheets/darkswarm/style.css @@ -1,10 +1,10 @@ @font-face { font-family: 'OFN'; - src:url('/OFN.eot?nugltz'); - src:url('/OFN.eot?#iefixnugltz') format('embedded-opentype'), - url('/OFN.woff?nugltz') format('woff'), - url('/OFN.ttf?nugltz') format('truetype'), - url('/OFN.svg?nugltz#OFN') format('svg'); + src:url('/OFN.eot?-zgemuq'); + src:url('/OFN.eot?#iefix-zgemuq') format('embedded-opentype'), + url('/OFN.woff?-zgemuq') format('woff'), + url('/OFN.ttf?-zgemuq') format('truetype'), + url('/OFN.svg?-zgemuq#OFN') format('svg'); font-weight: normal; font-style: normal; } @@ -23,150 +23,168 @@ -moz-osx-font-smoothing: grayscale; } -.ofn-i_049-web:before { +.ofn-i_055-point-left:before { content: "\e600"; } -.ofn-i_048-play-video:before { +.ofn-i_054-point-right:before { content: "\e601"; } -.ofn-i_047-youtube:before { +.ofn-i_053-point-up:before { content: "\e602"; } -.ofn-i_046-g:before { +.ofn-i_052-point-down:before { content: "\e603"; } -.ofn-i_045-pintrest:before { +.ofn-i_051-check-big:before { content: "\e604"; } -.ofn-i_044-facebook:before { +.ofn-i_050-mail-circle:before { content: "\e605"; } -.ofn-i_043-instagram:before { +.ofn-i_049-web:before { content: "\e606"; } -.ofn-i_042-linkedin:before { +.ofn-i_048-play-video:before { content: "\e607"; } -.ofn-i_041-twitter:before { +.ofn-i_047-youtube:before { content: "\e608"; } -.ofn-i_040-hub:before { +.ofn-i_046-g:before { content: "\e609"; } -.ofn-i_039-delivery:before { +.ofn-i_045-pintrest:before { content: "\e60a"; } -.ofn-i_038-takeaway:before { +.ofn-i_044-facebook:before { content: "\e60b"; } -.ofn-i_037-map:before { +.ofn-i_043-instagram:before { content: "\e60c"; } -.ofn-i_036-producers:before { +.ofn-i_042-linkedin:before { content: "\e60d"; } -.ofn-i_035-groups:before { +.ofn-i_041-twitter:before { content: "\e60e"; } -.ofn-i_034-timer:before { +.ofn-i_040-hub:before { content: "\e60f"; } -.ofn-i_033-open-sign:before { +.ofn-i_039-delivery:before { content: "\e610"; } -.ofn-i_032-closed-sign:before { +.ofn-i_038-takeaway:before { content: "\e611"; } -.ofn-i_031-alarm-clock:before { +.ofn-i_037-map:before { content: "\e612"; } -.ofn-i_030-money:before { +.ofn-i_036-producers:before { content: "\e613"; } -.ofn-i_029-shopping-basket:before { +.ofn-i_035-groups:before { content: "\e614"; } -.ofn-i_028-barcode:before { +.ofn-i_034-timer:before { content: "\e615"; } -.ofn-i_027-shopping-cart:before { +.ofn-i_033-open-sign:before { content: "\e616"; } -.ofn-i_026-trash:before { +.ofn-i_032-closed-sign:before { content: "\e617"; } -.ofn-i_025-notepad:before { +.ofn-i_031-alarm-clock:before { content: "\e618"; } -.ofn-i_024-mail:before { +.ofn-i_030-money:before { content: "\e619"; } -.ofn-i_023-refresh:before { +.ofn-i_029-shopping-basket:before { content: "\e61a"; } -.ofn-i_022-cog:before { +.ofn-i_028-barcode:before { content: "\e61b"; } -.ofn-i_021-tools:before { +.ofn-i_027-shopping-cart:before { content: "\e61c"; } -.ofn-i_020-search:before { +.ofn-i_026-trash:before { content: "\e61d"; } -.ofn-i_019-map-pin:before { +.ofn-i_025-notepad:before { content: "\e61e"; } -.ofn-i_018-unlocked:before { +.ofn-i_024-mail:before { content: "\e61f"; } -.ofn-i_017-locked:before { +.ofn-i_023-refresh:before { content: "\e620"; } -.ofn-i_016-group:before { +.ofn-i_022-cog:before { content: "\e621"; } -.ofn-i_015-user:before { +.ofn-i_021-tools:before { content: "\e622"; } -.ofn-i_014-menu:before { +.ofn-i_020-search:before { content: "\e623"; } -.ofn-i_013-help:before { +.ofn-i_019-map-pin:before { content: "\e624"; } -.ofn-i_012-warning:before { +.ofn-i_018-unlocked:before { content: "\e625"; } -.ofn-i_011-spinner:before { +.ofn-i_017-locked:before { content: "\e626"; } -.ofn-i_010-bullet:before { +.ofn-i_016-group:before { content: "\e627"; } -.ofn-i_009-close:before { +.ofn-i_015-user:before { content: "\e628"; } -.ofn-i_008-caret-left:before { +.ofn-i_014-menu:before { content: "\e629"; } -.ofn-i_007-caret-right:before { +.ofn-i_013-help:before { content: "\e62a"; } -.ofn-i_006-caret-up:before { +.ofn-i_012-warning:before { content: "\e62b"; } -.ofn-i_005-caret-down:before { +.ofn-i_011-spinner:before { content: "\e62c"; } -.ofn-i_004-x:before { +.ofn-i_010-bullet:before { content: "\e62d"; } -.ofn-i_003-check:before { +.ofn-i_009-close:before { content: "\e62e"; } -.ofn-i_002-arrow-right:before { +.ofn-i_008-caret-left:before { content: "\e62f"; } -.ofn-i_001-arrow-left:before { +.ofn-i_007-caret-right:before { content: "\e630"; } +.ofn-i_006-caret-up:before { + content: "\e631"; +} +.ofn-i_005-caret-down:before { + content: "\e632"; +} +.ofn-i_004-x:before { + content: "\e633"; +} +.ofn-i_003-check:before { + content: "\e634"; +} +.ofn-i_002-arrow-right:before { + content: "\e635"; +} +.ofn-i_001-arrow-left:before { + content: "\e636"; +} diff --git a/public/OFN.eot b/public/OFN.eot index cf85b7a5cbf175e005bca8ebe368c9ddf30bdb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Nl#bpH{-ko^?N4U*A0@n=JQ zRoUfzTDGMx?H?oUT9N^hev&mLt=a2+sOz%PXN0=pw`QX(xtx@s58DUKVNaWa(ZDXbmWoi;T=_7)sgBu<{P!`i=STn{gSVi_Sc11 z{1iK0e>tAEuO*9;UCD{$?+s5j9B*uFoM=ilO%Z_sn)p6(nLD_%?;R@5_oNf}55W>C Av;Y7A delta 1131 zcmbu6O-vJE5Qb;IZMX8%Ev0l@wN%`aB4|o&VGBen#)BLXBZ5I9LW5{EAdMiF8dD=C z#ETKvlks3EQo~Q8R1Hz$Q8|!!F@!`Ddm=_Xm>3TxD$cIba4>lAFyHLEvpdf_^DTVC zu`kGv4Fcp1j_|UMd-i<)NbM=}G62j`baeKFBAc2QhDT-{@jjUB1;7YE|5UgubOJ6t z@d6Au=sP(~FSw7)NV>2()nBq-RMN zoelML4d3zpAiYEkYoxcYA2_N&^s`zAjwy$+7QM_}$!H45XL}bY6I5sxMD3L%+j;p68@7>dis;o&&WS*1B z%oh`h%zvY!nQpW#gu7&+jVwqI2Q(14fHw#zxyuP&;jXNZE67g}ePoUC25cK2M@D^h zoDQee{y3chA`Y(sO^_YU0OA8JtIi3SAYg|E1dEMOnW5t=DP0C+W7^K><@tgO6a zS(sMRgXKb{R{nFKvNz^b4#sko_E^;Vn0{@bxJ!|ss8>Vz6x$TWo4BZR>zV!qFY-?f zWrq0;?{ivn=Z!&Aoh59|6-PH--+aX}SNMI)@uI1%yQDf7b1k}0ZmTJkOJ~aNZ14B{ q^giD?;JfW_k|*R3fvP|xa6gc)vRBPkd#dMZj?g^;RHkAV8}S!+hRL=7 diff --git a/public/OFN.svg b/public/OFN.svg index 7d3bcb93dc..8190e20cbf 100755 --- a/public/OFN.svg +++ b/public/OFN.svg @@ -7,53 +7,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/OFN.ttf b/public/OFN.ttf index ad8f6109bccf8950255f9ea440788175feea4825..a40786bc416aec4e0c25e910b7009d563bfa1f99 100755 GIT binary patch delta 1977 zcmZuxeQZ-z6hG(Q_tmYoV|(qJ3+rk(`ZhjF>Dt$BgJNLNfdq+4B8E-Mhnr+$Gs7{I zP=is4qCp$YMsON~uWU&4y_|RNIrqGC zf9Lb)uXyoK%m4yFF}wmC!jC_>G@=FmnkLC5qHR06(mfTMzkVA4=M%r7J>AexQ5z@z0P)kE z-8&l6OU5^D19(Xo?C(nV_dpx(Bz}r`|DJT$t~ZW{{|0!OSoHLC_wFU2^c*OE_hJgI z_i!~@*=Bq`gKz`h!X+4kQqqiuP;sLRb#E2=Fo`P=moP5zb&PYijy4R#Tw;u^XNscG zmobUwgkgm1WT&=Zr!1O8+k$Re3z41c|8FMqfE|QU$m3?z1ekargw{#|5wT6Va1l=Y z_wM|Ib_I}8_?&E%*bYT}1&0E`r5GYxO^BQRZ6s6h087Y>?GAm&%YsK9*nqbwMFFxZ zn<1vCE+(+BNWJAvVjPn!Xoe_UDt~$R(KsjLt-o6o8p21~>%_WGI3vNI(-nnI|4s4UehDP440z-N)kIB#T8u z%q-Jg%v3{s1xAxBZdg86iDpba-17d_ot109N>#>M*VfjqZH>*YM`f*8`AI3(9+PKx za(N3@^d{EhCjY|?a4~_sK2pG5?TPqE;9}K* z5IK`%^(dG6%U!N=e`%TDaJdYBnNu&(v=ZG}>~T9BZci~L#ObV-Sp5#S?sV$nxUd4n zt{DP&2?r%u39GZ4x_ud@d*)MF8$OIsVHrLyK*WX5 z@}3(O=@&bu${PEa)Fz3`>x_eJjIKTqTY~!P3YP)yGAYZ9wP5FcI^IiDm^c`)8)| zr(ZZI)ui{V(VulM{~e0$DF@$-y|Z8773<8*%n!_gx3VpLOBc|{x&H{4NdE@Wb)wOG z_?qDn{GQ>rBlyrON(utxlKh^P>>hPz%)$K9HuVO95_s=n55uc znCmLMFsEDi1LZPAtjqF3=q4m6$g7CDi9qPWviF?nFbJaq?|IJi{XNh7zUN#10b}1G zLVysWB142B&I=bELI%J62}f2jTHAU8p~DU9ql7>na(`!_FNCN?9z@LO>>ljsBXhmT zaXdU9Y!6%`cb+>5=@-{~f;hl@rE28$$cuwL;ej@guOlBo{Xr_xBJWIz&Q?Qz!^OY*OOaJqei|7 zQP@n@>AC=#k}vdiS0YPf3>v^m^rRFI5X@A`vDCubsm;f@Y&=Vi3Nv*HKI*kI78l6X zCanrUr8TKpPL~OgspDACm<=odYcOka^NixOF)tUOFe}HTR-1CN_E4)ff<-xM^ZKC7YO@2c(0~L=7W7;JNMJOB;5h{nq!z-{cme<@FfxWtPg4XW z0ExKxmgvlkG%3=`*lhYckw~qG;Evf?dgIho`Z%m1kV!PxjOKVGN)*;B&>jGFFq zpS7sv7F8V}mPg4_&KUcDy+7noFXAV|@C;6i8SXEw1GD6<7G5ECLhJ!%=<#0uTMGM+ z96rdAR8c<}LcQu#MQ!#LDHo~70w-`T!6UXf^%saGP5es{st=M(PKQTi#oX)jBUd$5 zTSP_0t3lq(Rj%ye&d$z9nhBdx|Dc0)OVhhAh&~#eiY(!lT8v4I7>0j02x2;<9a(sX z%rFicGOL`*Unw}nin3I>mhoBDl)a|*X=-#qLpC>c=-!dLd8_%`1ucd1MOA!_g<3YO z9mgt5JSB^z6UW2$U(S~&`-O+Dde5xq3-2xWhP;oxo8_kR diff --git a/public/OFN.woff b/public/OFN.woff index a8d4905798510ba14307bd91aa37477e6ebd1195..1b1d24bd459c228fbc0a3d65cd3ea33a33d06016 100755 GIT binary patch delta 1470 zcmYLJU2GIp6uz_N!Y!07mJFaEza*BF8Zl8MCMXGs`~+VV5=}7B$cw!sw+7FhwmO;b%)Q^7 z`ObIF%?sOv3d9IWoysz7C5H1FEx zBc$mGChV7B>!+U_=xjSq$o8GMck$Amo94l`6OtQ7j?H4pp^mn8bsv#C#W_7IL($vje%Ogea;+;(Yl( z$B&&ji9VS1=*^X<>B~qzE|&4>3m8cuh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k53z6U;2)5pXLO~X$4ipVWdZ7knO0R;uZ2Z;VHxPs2UnN(ZHYclnW+MYF%~aU}dezc+|L5S6F|@{MtI+ zAla7e)6U(_pmWaoyV21&)Hv%p*R-SQP4jqWOq=^@Wi0(Pe`68#A^lRLF~_I$DSSPO z!#La*4Z#wfz>|1#Vqy}r_>w+=Lm?c%fmCP)-@=nAJcDP#snf8B8SScPUa#1Qh1iLM z5k;KjBwifG9LFkF#jaS1o#CWm%<~+Fhee(xcEzFC6bqBfB`%4@xX6+QVkQlWnGyLU zmZY2zt0mu7%Rydo5S1c<1P4kWFS3dY3`c~7fJH2f3WC5A7jZM91bkkEPM!z81^B@I zZ>jD<2RN#Hl?VP@)8R(xtPRgLf~-% zCq@zpR&gsXhU0+fI$mewt4t9P1~KeskhM%n07W6XEh&@y*7FQ7Z}6K$a3nIZJ-hV9PZb!~0!EnP&t rlNWroT2pp=Jy3FG+tr$Bpd15S0bB#LuLHsQ4+wQ2WJ-T&vr&Hlr{`D5 From a7a8c3ecee14d6d4e613bd159ebade0b2c109597 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:30:52 +1000 Subject: [PATCH 023/130] Change icon for bullet point for list style --- app/assets/stylesheets/darkswarm/typography.css.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/typography.css.sass b/app/assets/stylesheets/darkswarm/typography.css.sass index aad9fa7237..8359419d54 100644 --- a/app/assets/stylesheets/darkswarm/typography.css.sass +++ b/app/assets/stylesheets/darkswarm/typography.css.sass @@ -43,7 +43,7 @@ ul.ofn-list line-height: 1.5 height: inherit li:before - content: "\e627" + content: "\e62d" font-family: "OFN" display: inline-block font-weight: normal From 4893679d120c3ff9d0aaa2dd9a91411216a99dbc Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:48:32 +1000 Subject: [PATCH 024/130] Adding in icons to checkout partial --- app/views/checkout/_billing.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/checkout/_billing.html.haml b/app/views/checkout/_billing.html.haml index dc48eadbe2..d1a0e589f0 100644 --- a/app/views/checkout/_billing.html.haml +++ b/app/views/checkout/_billing.html.haml @@ -4,9 +4,9 @@ %h5{"ng-class" => "{valid: billing.$valid, dirty: details.$dirty}"} %span.right %label.label.round.alert - %i.fi-x + %i.ofn-i_009-close %label.label.round.success - %i.fi-check + %i.ofn-i_051-check-big Billing info %accordion-group{"is-open" => "accordion.billing", @@ -19,9 +19,9 @@ {{ summary() | printArray }} .small-1.columns.right %span.accordion-up.right - %i.fi-arrow-up + %i.ofn-i_006-caret-up %span.accordion-down.right - %i.fi-arrow-down + %i.ofn-i_005-caret-down = f.fields_for :bill_address, @order.bill_address do |ba| .row From b4f14197fae4b34d80fcc1be7ef5d0e4828d097c Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:48:47 +1000 Subject: [PATCH 025/130] Adding in icons to checkout partial --- app/views/checkout/_details.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/checkout/_details.html.haml b/app/views/checkout/_details.html.haml index 76c5c32398..a4c43e57ac 100644 --- a/app/views/checkout/_details.html.haml +++ b/app/views/checkout/_details.html.haml @@ -4,9 +4,9 @@ %h5{"ng-class" => "{valid: details.$valid, dirty: details.$dirty}"} %span.right %label.label.round.alert - %i.fi-x + %i.ofn-i_009-close %label.label.round.success - %i.fi-check + %i.ofn-i_051-check-big Your details %accordion-group{"is-open" => "accordion.details", @@ -19,9 +19,9 @@ {{ summary() | printArray }} .small-1.columns.right %span.accordion-up.right - %i.fi-arrow-up + %i.ofn-i_006-caret-up %span.accordion-down.right - %i.fi-arrow-down + %i.ofn-i_005-caret-down .row .small-6.columns From cbc28f6da75389b318e505a86cebac78668d29b6 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:48:59 +1000 Subject: [PATCH 026/130] Adding in icons to checkout partial --- app/views/checkout/_payment.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/checkout/_payment.html.haml b/app/views/checkout/_payment.html.haml index 195ae9e42a..bfeb099354 100644 --- a/app/views/checkout/_payment.html.haml +++ b/app/views/checkout/_payment.html.haml @@ -4,9 +4,9 @@ %h5{"ng-class" => "{valid: payment.$valid, dirty: details.$dirty}"} %span.right %label.label.round.alert - %i.fi-x + %i.ofn-i_009-close %label.label.round.success - %i.fi-check + %i.ofn-i_051-check-big Payment %accordion-group{"is-open" => "accordion.payment", @@ -19,9 +19,9 @@ {{ Order.paymentMethod().name }} .small-1.columns.right %span.accordion-up.right - %i.fi-arrow-up + %i.ofn-i_006-caret-up %span.accordion-down.right - %i.fi-arrow-down + %i.ofn-i_005-caret-down - current_order.available_payment_methods.each do |method| .row From cca6a39476f688acbc81b8e5c4a71a66aecd667f Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:49:14 +1000 Subject: [PATCH 027/130] Adding in icons to checkout partial --- app/views/checkout/_shipping.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/checkout/_shipping.html.haml b/app/views/checkout/_shipping.html.haml index dfa69d43c5..800aea78a0 100644 --- a/app/views/checkout/_shipping.html.haml +++ b/app/views/checkout/_shipping.html.haml @@ -4,9 +4,9 @@ %h5{"ng-class" => "{valid: shipping.$valid, dirty: details.$dirty}"} %span.right %label.label.round.alert - %i.fi-x + %i.ofn-i_009-close %label.label.round.success - %i.fi-check + %i.ofn-i_051-check-big Shipping info %accordion-group{"is-open" => "accordion.shipping", @@ -19,9 +19,9 @@ {{ Order.shippingMethod().name }} .small-1.columns.right %span.accordion-up.right - %i.fi-arrow-up + %i.ofn-i_006-caret-up %span.accordion-down.right - %i.fi-arrow-down + %i.ofn-i_005-caret-down - for ship_method, i in current_distributor.shipping_methods.uniq .row From e064aa3173d455ac1be89264768ccfcb391f15a7 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:49:32 +1000 Subject: [PATCH 028/130] Restyling labels for new icons in checkout process --- app/assets/stylesheets/darkswarm/checkout.css.sass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/darkswarm/checkout.css.sass b/app/assets/stylesheets/darkswarm/checkout.css.sass index 64a7e2bd00..9caf28ae43 100644 --- a/app/assets/stylesheets/darkswarm/checkout.css.sass +++ b/app/assets/stylesheets/darkswarm/checkout.css.sass @@ -20,6 +20,10 @@ checkout padding: 0.65em background: #f7f7f7 + .label + font-size: 1em + padding: 0.3rem 0.35rem 0.275rem + // Logic to turn on & off the alerts for success against each fieldset label, label.alert, label.success, &.valid label.alert, &.dirty label.success From 474581211ba93c6c1f9d21ac0a31236b29653347 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:56:41 +1000 Subject: [PATCH 029/130] Add class right to icons --- app/views/checkout/_billing.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/checkout/_billing.html.haml b/app/views/checkout/_billing.html.haml index d1a0e589f0..6ab949e36e 100644 --- a/app/views/checkout/_billing.html.haml +++ b/app/views/checkout/_billing.html.haml @@ -3,9 +3,9 @@ %h5{"ng-class" => "{valid: billing.$valid, dirty: details.$dirty}"} %span.right - %label.label.round.alert + %label.label.round.alert.right %i.ofn-i_009-close - %label.label.round.success + %label.label.round.success.right %i.ofn-i_051-check-big Billing info From 34c4fc8aa1f00b1da3732fe8f8f02571c0f0dd20 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:56:52 +1000 Subject: [PATCH 030/130] Add class right to icons --- app/views/checkout/_details.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/checkout/_details.html.haml b/app/views/checkout/_details.html.haml index a4c43e57ac..5be6b84043 100644 --- a/app/views/checkout/_details.html.haml +++ b/app/views/checkout/_details.html.haml @@ -3,9 +3,9 @@ %h5{"ng-class" => "{valid: details.$valid, dirty: details.$dirty}"} %span.right - %label.label.round.alert + %label.label.round.alert.right %i.ofn-i_009-close - %label.label.round.success + %label.label.round.success.right %i.ofn-i_051-check-big Your details From 9cae581cda109bb1c5986d1c958b420efc2da005 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:57:06 +1000 Subject: [PATCH 031/130] Add class right to icons --- app/views/checkout/_payment.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/checkout/_payment.html.haml b/app/views/checkout/_payment.html.haml index bfeb099354..39b40675bf 100644 --- a/app/views/checkout/_payment.html.haml +++ b/app/views/checkout/_payment.html.haml @@ -3,9 +3,9 @@ %h5{"ng-class" => "{valid: payment.$valid, dirty: details.$dirty}"} %span.right - %label.label.round.alert + %label.label.round.alert.right %i.ofn-i_009-close - %label.label.round.success + %label.label.round.success.right %i.ofn-i_051-check-big Payment From 3fca8640fde402ac20abe4344afada6bfe755681 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 11:57:19 +1000 Subject: [PATCH 032/130] Add class right to icons --- app/views/checkout/_shipping.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/checkout/_shipping.html.haml b/app/views/checkout/_shipping.html.haml index 800aea78a0..3712b995ac 100644 --- a/app/views/checkout/_shipping.html.haml +++ b/app/views/checkout/_shipping.html.haml @@ -3,9 +3,9 @@ %h5{"ng-class" => "{valid: shipping.$valid, dirty: details.$dirty}"} %span.right - %label.label.round.alert + %label.label.round.alert.right %i.ofn-i_009-close - %label.label.round.success + %label.label.round.success.right %i.ofn-i_051-check-big Shipping info From 43cc77c88b901e29ff55295b58d3c38dd6f95a52 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:01:57 +1000 Subject: [PATCH 033/130] Adding icon into button --- app/views/checkout/_summary.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/checkout/_summary.html.haml b/app/views/checkout/_summary.html.haml index 06edeac8b5..c943964a9f 100644 --- a/app/views/checkout/_summary.html.haml +++ b/app/views/checkout/_summary.html.haml @@ -25,6 +25,6 @@ //= f.submit "Purchase", class: "button", "ng-disabled" => "checkout.$invalid", "ofn-focus" => "accordion['payment']" %a.button.secondary{href: cart_url} - %i.fi-arrow-left + %i.ofn-i_008-caret-left Back to Cart From 10418b6035dc554ba9fa46024e1a61b7b2a1b98a Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:17:44 +1000 Subject: [PATCH 034/130] Merge issues. Removing position fixed on modal window styling. --- app/assets/stylesheets/darkswarm/overrides.css.sass | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/overrides.css.sass b/app/assets/stylesheets/darkswarm/overrides.css.sass index 917d6dd2e3..fcec6b455d 100644 --- a/app/assets/stylesheets/darkswarm/overrides.css.sass +++ b/app/assets/stylesheets/darkswarm/overrides.css.sass @@ -1,5 +1,2 @@ .row max-width: 74em - -.reveal-modal - position: fixed From 589188d21ef1b5900f7eeacfb1239232665b9fdb Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:32:28 +1000 Subject: [PATCH 035/130] Update icons for Tabs on hub shopping page --- app/assets/stylesheets/darkswarm/tabs.css.sass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/tabs.css.sass b/app/assets/stylesheets/darkswarm/tabs.css.sass index 303e8515ff..4bfd2935f4 100644 --- a/app/assets/stylesheets/darkswarm/tabs.css.sass +++ b/app/assets/stylesheets/darkswarm/tabs.css.sass @@ -33,9 +33,12 @@ border-top: 4px solid transparent a:after padding-left: 8px - content: "\f109" + content: "\e632" visibility: hidden @include icon-font + dd:hover + a:after + visibility: visible // active nav link @@ -45,7 +48,7 @@ a color: $clr-brick-bright a:after - content: "\f10c" + content: "\e631" visibility: visible @include icon-font From 5a7df20a2e4f63c9dfdf41158084185c9e039764 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:32:46 +1000 Subject: [PATCH 036/130] Update icon font for mixins --- app/assets/stylesheets/darkswarm/mixins.sass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/mixins.sass b/app/assets/stylesheets/darkswarm/mixins.sass index aa44d4c4b5..a9894a5b10 100644 --- a/app/assets/stylesheets/darkswarm/mixins.sass +++ b/app/assets/stylesheets/darkswarm/mixins.sass @@ -54,13 +54,12 @@ // Assign content: "string" @mixin icon-font - font-family: "foundation-icons" + font-family: "OFN" display: inline-block font-weight: normal font-style: normal font-variant: normal text-transform: none - font-size: 80% // Background options \\ From 9a962f7445ba00e6a86f5d756dedd902233971e1 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:35:54 +1000 Subject: [PATCH 037/130] Add new icons to checkout & back to cart buttons --- app/views/spree/orders/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/spree/orders/edit.html.haml b/app/views/spree/orders/edit.html.haml index f0c6b95a78..76b22aeb36 100644 --- a/app/views/spree/orders/edit.html.haml +++ b/app/views/spree/orders/edit.html.haml @@ -30,12 +30,12 @@ .columns.large-8{"data-hook" => ""} %a.button.large.secondary{href: main_app.shop_path} - %i.fi-arrow-left + %i.ofn-i_008-caret-left Continue shopping .columns.large-4.text-right %a#checkout-link.button.large.primary{href: main_app.checkout_path} Checkout - %i.fi-arrow-right + %i.ofn-i_007-caret-right = render partial: "shared/footer" From a54b3f784915191e636080b102b934ff380734e8 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:39:44 +1000 Subject: [PATCH 038/130] Adding new icon for refresh --- app/views/spree/orders/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/orders/_form.html.haml b/app/views/spree/orders/_form.html.haml index bec495a458..70599a124e 100644 --- a/app/views/spree/orders/_form.html.haml +++ b/app/views/spree/orders/_form.html.haml @@ -32,7 +32,7 @@ %td %td = button_tag :class => 'neutral-btn dark expand small', :id => 'update-button' do - %i.fi-refresh + %i.ofn-i_023-refresh = t(:update) %td %h5.order-total.grand-total= @order.display_total From 00ac80bdbbcac6c942005822d4e8c6605213fe6e Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:56:56 +1000 Subject: [PATCH 039/130] Add new icons --- app/views/spree/orders/_form.html.haml | 2 +- app/views/spree/orders/_line_item.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/spree/orders/_form.html.haml b/app/views/spree/orders/_form.html.haml index 70599a124e..214823d4cf 100644 --- a/app/views/spree/orders/_form.html.haml +++ b/app/views/spree/orders/_form.html.haml @@ -31,7 +31,7 @@ %span.order-total.distribution-total= order_distribution_subtotal(@order) %td %td - = button_tag :class => 'neutral-btn dark expand small', :id => 'update-button' do + = button_tag :class => 'secondary radius expand small', :id => 'update-button' do %i.ofn-i_023-refresh = t(:update) %td diff --git a/app/views/spree/orders/_line_item.html.haml b/app/views/spree/orders/_line_item.html.haml index 6986caf100..42649c8bee 100644 --- a/app/views/spree/orders/_line_item.html.haml +++ b/app/views/spree/orders/_line_item.html.haml @@ -23,5 +23,5 @@ %td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"} {{ quantity }} - = link_to image_tag('icons/delete.png'), '#', :class => 'delete', - :id => "delete_#{dom_id(line_item)}" + %a.delete{href: "#", id: "delete_#{dom_id(line_item)}"} + %i.delete.ofn-i_026-trash From 2c334a01808514b1dd7b8702e8de6301bbffffe5 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 13:02:34 +1000 Subject: [PATCH 040/130] Styling for trash icon on checkout page --- app/assets/stylesheets/darkswarm/shopping-cart.css.sass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/darkswarm/shopping-cart.css.sass b/app/assets/stylesheets/darkswarm/shopping-cart.css.sass index a5314c3ef2..4bbd6a9a01 100644 --- a/app/assets/stylesheets/darkswarm/shopping-cart.css.sass +++ b/app/assets/stylesheets/darkswarm/shopping-cart.css.sass @@ -1,6 +1,11 @@ @import mixins @import branding +#cart-detail + .cart-item-delete + a.delete + font-size: 1.125em + #edit-cart button, .button margin: 0 From 179d9f609c26bd4d0006b638e65cb49450f72dc9 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 13:05:56 +1000 Subject: [PATCH 041/130] Adding in new lock icon to signed in --- app/views/shared/_signed_out.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_signed_out.html.haml b/app/views/shared/_signed_out.html.haml index f7442b13ff..cf5492487a 100644 --- a/app/views/shared/_signed_out.html.haml +++ b/app/views/shared/_signed_out.html.haml @@ -1,5 +1,5 @@ %li#login-link{"ng-controller" => "AuthenticationCtrl"} %a{"ng-click" => "open()"} - %i.fi-lock + %i.ofn-i_017-locked LOG IN From 49a39bb2407f4cdf48328d920a34e669bb1a238a Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 13:06:48 +1000 Subject: [PATCH 042/130] Adding unlock icon to signed in --- app/views/shared/_signed_in.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/shared/_signed_in.html.haml b/app/views/shared/_signed_in.html.haml index 1ac376879b..2e5dfc5b81 100644 --- a/app/views/shared/_signed_in.html.haml +++ b/app/views/shared/_signed_in.html.haml @@ -3,4 +3,5 @@ = spree_current_user.email %li.divider %li#sign-out-link + %i.ofn-i_018-unlocked = link_to "Sign Out", "/logout" \ No newline at end of file From 42a9f1680052ceb928d6a0e816bf10dd7a3eb917 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 13:08:18 +1000 Subject: [PATCH 043/130] Adding in new icon into producer partial --- app/views/producers/_fat.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/producers/_fat.html.haml b/app/views/producers/_fat.html.haml index 3313db6552..128795a9ba 100644 --- a/app/views/producers/_fat.html.haml +++ b/app/views/producers/_fat.html.haml @@ -15,4 +15,4 @@ .columns.small-1.text-right %a{"bo-href" => "hub.path"} - %i.fi-arrow-right + %i.ofn-i_007-caret-right From 5bdb38e293bf3ab06b12967d4d793055e9e21327 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:17:44 +1000 Subject: [PATCH 044/130] Merge issues. Removing position fixed on modal window styling. --- app/assets/stylesheets/darkswarm/overrides.css.sass | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/overrides.css.sass b/app/assets/stylesheets/darkswarm/overrides.css.sass index 917d6dd2e3..fcec6b455d 100644 --- a/app/assets/stylesheets/darkswarm/overrides.css.sass +++ b/app/assets/stylesheets/darkswarm/overrides.css.sass @@ -1,5 +1,2 @@ .row max-width: 74em - -.reveal-modal - position: fixed From 72c50486faa9548390b1b9d872868ea5a3b60dd3 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 14:29:08 +1000 Subject: [PATCH 045/130] ADding new icons into producer modal --- app/views/modals/_producer.html.haml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 13f8026195..58d661d8b5 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -12,27 +12,32 @@ %ul.small-block-grid-1{bindonce: true} %li{"ng-if" => "producer.website"} %a{"ng-href" => "http://{{producer.website | stripUrl}}", target: "_blank" } - %i.fi-web + %i.ofn-i_049-web {{ producer.website | stripUrl }} + %li{"ng-if" => "producer.email"} + %a{"ng-href" => "mailto:{{producer.email | stripUrl}}", target: "_blank" } + %i.ofn-i_050-mail-circle + {{ producer.email | stripUrl }} + %li{"ng-if" => "producer.twitter"} %a{"ng-href" => "http://twitter.com/{{producer.twitter}}", target: "_blank"} - %i.fi-social-twitter + %i.ofn-i_041-twitter {{ producer.twitter }} %li{"ng-if" => "producer.facebook"} %a{"ng-href" => "http://{{producer.facebook | stripUrl}}", target: "_blank"} - %i.fi-social-facebook + %i.ofn-i_044-facebook {{ producer.facebook | stripUrl }} %li{"ng-if" => "producer.linkedin"} %a{"ng-href" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"} - %i.fi-social-linkedin + %i.ofn-i_042-linkedin {{ producer.linkedin | stripUrl }} %li{"ng-if" => "producer.instagram"} %a{"ng-href" => "http://instagram.com/{{producer.instagram}}", target: "_blank"} - %i.fi-social-instagram + %i.ofn-i_043-instagram {{ producer.instagram }} From 31ae0cf2a9cecbda09af1f22f6d492ea80e630da Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:14:40 +1000 Subject: [PATCH 046/130] Tweak logic on contact us address line display --- app/views/shopping_shared/_contact.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index d4894357ad..ab4d98a952 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -7,7 +7,7 @@ %h4=current_distributor.name %p = current_distributor.address.address1 - - if current_distributor.address.address2 + - unless current_distributor.address.address2.blank? %br = current_distributor.address.address2 %br From b19ca3b9c489b8cf44d3767b7c8ba5f0b392d771 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:38:27 +1000 Subject: [PATCH 047/130] Remove whitespace --- app/assets/stylesheets/darkswarm/typography.css.sass | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/typography.css.sass b/app/assets/stylesheets/darkswarm/typography.css.sass index 69d16aef9e..9e5f80f585 100644 --- a/app/assets/stylesheets/darkswarm/typography.css.sass +++ b/app/assets/stylesheets/darkswarm/typography.css.sass @@ -70,7 +70,6 @@ table tr th, table tr td table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td color: #333333 - span.email direction: rtl unicode-bidi: bidi-override From ef5b36cddd3dd8275dab242bbd5edff8f2e923bc Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:39:07 +1000 Subject: [PATCH 048/130] Styling producers --- .../stylesheets/darkswarm/images.css.sass | 1 + .../stylesheets/darkswarm/producers.css.sass | 2 +- app/views/modals/_producer.html.haml | 19 +++++++------------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/images.css.sass b/app/assets/stylesheets/darkswarm/images.css.sass index 927e906842..90207a2239 100644 --- a/app/assets/stylesheets/darkswarm/images.css.sass +++ b/app/assets/stylesheets/darkswarm/images.css.sass @@ -17,6 +17,7 @@ .producer-hero-img background-color: #999 width: 100% + min-height: 160px height: inherit max-height: 260px overflow: hidden diff --git a/app/assets/stylesheets/darkswarm/producers.css.sass b/app/assets/stylesheets/darkswarm/producers.css.sass index 96a42a3a6b..3ad4e7de3a 100644 --- a/app/assets/stylesheets/darkswarm/producers.css.sass +++ b/app/assets/stylesheets/darkswarm/producers.css.sass @@ -4,4 +4,4 @@ .producers @include fullwidthbg background-image: url("/assets/producers/producers-pg-bg.jpg") - background-repeat: no-repeat + background-repeat: no-repeat \ No newline at end of file diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 13f8026195..a4dc687eee 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -1,39 +1,34 @@ %ofn-modal{title: "{{producer.name}}"} .row - .columns.small-12.producer-hero - %img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"} - / Will - scale large images down to 1200px wide, crop in to img aspect ratio 60W:13H + .small-12.columns.producer-hero %h3.producer-name {{ producer.name }} + %img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"} + .row - .columns.small-12.large-6{"ng-bind-html" => "producer.long_description"} - .columns.small-12.large-6 + .small-12.large-6.columns + %p{"ng-bind-html" => "producer.long_description"} + .small-12.large-6.columns %img.producer-logo{"ng-src" => "{{producer.logo}}", "ng-if" => "producer.logo"} - %h4 Stay in touch with {{ producer.name }} + %h5 Stay in touch with {{ producer.name }} %ul.small-block-grid-1{bindonce: true} %li{"ng-if" => "producer.website"} %a{"ng-href" => "http://{{producer.website | stripUrl}}", target: "_blank" } %i.fi-web {{ producer.website | stripUrl }} - %li{"ng-if" => "producer.twitter"} %a{"ng-href" => "http://twitter.com/{{producer.twitter}}", target: "_blank"} %i.fi-social-twitter {{ producer.twitter }} - %li{"ng-if" => "producer.facebook"} %a{"ng-href" => "http://{{producer.facebook | stripUrl}}", target: "_blank"} %i.fi-social-facebook {{ producer.facebook | stripUrl }} - %li{"ng-if" => "producer.linkedin"} %a{"ng-href" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"} %i.fi-social-linkedin {{ producer.linkedin | stripUrl }} - %li{"ng-if" => "producer.instagram"} %a{"ng-href" => "http://instagram.com/{{producer.instagram}}", target: "_blank"} %i.fi-social-instagram {{ producer.instagram }} - - %a.close-reveal-modal{"ng-click" => "$close()"} × From 8a3416071313974d573677f22951decc7fa94192 Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:18:43 +1000 Subject: [PATCH 049/130] No change --- app/views/layouts/_become_distributor.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_become_distributor.html.haml b/app/views/layouts/_become_distributor.html.haml index 79d3b4a0db..6d67ee9306 100644 --- a/app/views/layouts/_become_distributor.html.haml +++ b/app/views/layouts/_become_distributor.html.haml @@ -14,4 +14,4 @@ = text_area_tag :email_body, "", :input_html => { :rows => 10 } = submit_tag "Submit", class: "button" - = link_to "×".html_safe, "#", class: "close-reveal-modal" + = link_to "×".html_safe, "#", class: "close-reveal-modal" \ No newline at end of file From cd332c1eb1c72af9277f1aeea9d6ab6002d579ee Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:19:22 +1000 Subject: [PATCH 050/130] Implementing new X icon for modal window --- app/views/modals/_food_hub.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_food_hub.html.haml b/app/views/modals/_food_hub.html.haml index da3fe0bdda..ba0864b284 100644 --- a/app/views/modals/_food_hub.html.haml +++ b/app/views/modals/_food_hub.html.haml @@ -4,4 +4,5 @@ %h5 Our food hubs are the point of contact between you and the people who make your food! %p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logistics - so variations between hubs are to be expected. %p You can only shop at one food hub at a time. -%a.close-reveal-modal{"ng-click" => "$close()"} × +%a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close From d160f4fe51bc3dc2c02581ee722d43c501b528f7 Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:19:37 +1000 Subject: [PATCH 051/130] Implementing new X icon for modal window --- app/views/modals/_groups.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_groups.html.haml b/app/views/modals/_groups.html.haml index a97b9982c7..43be03bcc9 100644 --- a/app/views/modals/_groups.html.haml +++ b/app/views/modals/_groups.html.haml @@ -3,4 +3,5 @@ Groups / Regions %p These are the organisations and relationships between hubs which make up the Open Food Network. %p Some groups are clustered by location or council, others by non-geographic similarities. -%a.close-reveal-modal{"ng-click" => "cancel()"} × \ No newline at end of file +%a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close \ No newline at end of file From 73a68799be04ba4511e01af2509c664778d7055e Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:19:45 +1000 Subject: [PATCH 052/130] Implementing new X icon for modal window --- app/views/modals/_learn_more.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_learn_more.html.haml b/app/views/modals/_learn_more.html.haml index 4cb0534c6e..58a1bf260d 100644 --- a/app/views/modals/_learn_more.html.haml +++ b/app/views/modals/_learn_more.html.haml @@ -6,4 +6,5 @@ %h5 Learn more %p If you want to learn more about the Open Food Network, how it works, and get involved, check out: %a.button.neutral-btn.dark{:href => "http://www.openfoodnetwork.org" , :target => "_blank" } Open Food Network -%a.close-reveal-modal{"ng-click" => "$close()"} × +%a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close From c07ca67f29ebd450fd97ef696f9e4add732aa980 Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:19:56 +1000 Subject: [PATCH 053/130] Implementing new X icon for modal window --- app/views/modals/_producer.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 0f2bfd5c99..4b4421e8d8 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -43,4 +43,5 @@ %i.ofn-i_043-instagram {{ producer.instagram }} - %a.close-reveal-modal{"ng-click" => "$close()"} × + %a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close From 653120888f43b41645e8d74e27298fc573498dc2 Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:20:03 +1000 Subject: [PATCH 054/130] Implementing new X icon for modal window --- app/views/modals/_producers.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_producers.html.haml b/app/views/modals/_producers.html.haml index d3be6e56c3..069ec9e3b6 100644 --- a/app/views/modals/_producers.html.haml +++ b/app/views/modals/_producers.html.haml @@ -2,4 +2,5 @@ %i.ofn-i_036-producers Producers %p Our producers make all the delicious food you can shop for on the Open Food Network. -%a.close-reveal-modal{"ng-click" => "cancel()"} × \ No newline at end of file +%a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close \ No newline at end of file From 31bab3469e052ed2ee3b7f038136f2860063739b Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:20:15 +1000 Subject: [PATCH 055/130] Implementing new X icon for modal window --- app/views/modals/_product.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_product.html.haml b/app/views/modals/_product.html.haml index 9c071b51eb..b2281d64ca 100644 --- a/app/views/modals/_product.html.haml +++ b/app/views/modals/_product.html.haml @@ -7,4 +7,5 @@ %img{"ng-src" => "{{product.primary_taxon.icon}}"} {{product.name}} %p {{product.description}} - %a.close-reveal-modal{"ng-click" => "$close()"} × + %a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close From a6a86612c75a7a1d1cc41fa9cd5e9afe9a523292 Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:48:11 +1000 Subject: [PATCH 056/130] Adding X from new icon font to modal --- app/assets/javascripts/templates/authentication.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/templates/authentication.html.haml b/app/assets/javascripts/templates/authentication.html.haml index ab388a691e..3f219240e6 100644 --- a/app/assets/javascripts/templates/authentication.html.haml +++ b/app/assets/javascripts/templates/authentication.html.haml @@ -3,4 +3,5 @@ %ng-include{src: "'login.html'"} %ng-include{src: "'signup.html'"} %ng-include{src: "'forgot.html'"} -%a.close-reveal-modal{"ng-click" => "$close()"} × +%a.close-reveal-modal{"ng-click" => "$close()"} + %i.ofn-i_009-close \ No newline at end of file From 037769bfb183bf6f003fa1a7e2a92f1656ae636a Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:50:17 +1000 Subject: [PATCH 057/130] Adding new icons from icon font --- app/views/shopping_shared/_contact.html.haml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index ab4d98a952..89eff0a723 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -20,36 +20,36 @@ - unless current_distributor.website.blank? %li %a{href: current_distributor.website, target: "_blank" } - %i.fi-web + %i.ofn-i_049-web = current_distributor.website - unless current_distributor.email.blank? %li %a{href: current_distributor.email.reverse, mailto: true } - %i.fi-mail + %i.ofn-i_050-mail-circle %span.email = current_distributor.email.reverse - unless current_distributor.twitter.blank? %li %a{href: current_distributor.twitter, target: "_blank" } - %i.fi-social-twitter + %i.ofn-i_041-twitter = current_distributor.twitter - unless current_distributor.facebook.blank? %li %a{href: current_distributor.facebook, target: "_blank" } - %i.fi-social-facebook + %i.ofn-i_044-facebook = current_distributor.facebook - unless current_distributor.linkedin.blank? %li %a{href: current_distributor.linkedin, target: "_blank" } - %i.fi-social-linkedin + %i.ofn-i_042-linkedin = current_distributor.linkedin - unless current_distributor.instagram.blank? %li %a{href: current_distributor.instagram, target: "_blank" } - %i.fi-social-instagram + %i.ofn-i_043-instagram = current_distributor.instagram From fc4e20ffd49d6cd20d771ba710b6833ec830c20e Mon Sep 17 00:00:00 2001 From: summerscope Date: Tue, 3 Jun 2014 11:50:38 +1000 Subject: [PATCH 058/130] Adding new icons from new pretty icon font --- app/views/shared/menu/_cart.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml index d2854affb5..e34c17c559 100644 --- a/app/views/shared/menu/_cart.html.haml +++ b/app/views/shared/menu/_cart.html.haml @@ -1,5 +1,5 @@ %a.icon{href: cart_url, "ng-controller" => "CartCtrl"} - %i.fi-shopping-cart.nav-branded + %i.ofn-i_027-shopping-cart.nav-branded %span {{ CurrentOrder.cart_count }} items From 1ccfc46e50bbf8f1b0b4fc69f699b7a50cedd072 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 4 Jun 2014 14:27:05 +1000 Subject: [PATCH 059/130] Update primary taxons migration - take more care in setting the default primary taxon --- db/migrate/20140522044009_add_primary_taxon_to_products.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/migrate/20140522044009_add_primary_taxon_to_products.rb b/db/migrate/20140522044009_add_primary_taxon_to_products.rb index 28c27f820f..d985d7f1b8 100644 --- a/db/migrate/20140522044009_add_primary_taxon_to_products.rb +++ b/db/migrate/20140522044009_add_primary_taxon_to_products.rb @@ -6,7 +6,9 @@ class AddPrimaryTaxonToProducts < ActiveRecord::Migration add_foreign_key :spree_products, :spree_taxons, column: :primary_taxon_id Spree::Product.all.each do |p| - p.update_column :primary_taxon_id, (p.taxons.first || Spree::Taxon.first) + primary_taxon = p.taxons.where('spree_taxons.name != ?', 'specials').first + first_taxon = Spree::Taxonomy.find_by_name('Products').andand.root || Spree::Taxon.first + p.update_column :primary_taxon_id, (primary_taxon || first_taxon) end change_column :spree_products, :primary_taxon_id, :integer, null: false From a99e18990d229716d7ec82b0bde17ffe89f47ade Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 4 Jun 2014 14:27:17 +1000 Subject: [PATCH 060/130] Readability --- app/controllers/checkout_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 3879f16741..95fc059e06 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -26,7 +26,7 @@ class CheckoutController < Spree::CheckoutController if @order.next state_callback(:after) else - unless @order.errors.empty? + if @order.errors.present? flash[:error] = @order.errors.full_messages.to_sentence else flash[:error] = t(:payment_processing_failed) From 77f847dcbeda87eead6b537d612ca2bb2488c857 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:06:24 +1000 Subject: [PATCH 061/130] Adding in new icon fonts to menu system. Adding drop down cog to simplify top menu. --- .../stylesheets/darkswarm/menu.css.sass | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/menu.css.sass b/app/assets/stylesheets/darkswarm/menu.css.sass index 735a19e97b..54807e3977 100644 --- a/app/assets/stylesheets/darkswarm/menu.css.sass +++ b/app/assets/stylesheets/darkswarm/menu.css.sass @@ -1,11 +1,25 @@ @import branding @import mixins -.top-bar + +.fixed .top-bar @include box-shadow(0 2px 3px 0 rgba(0,0,0,0.25)) nav @include textpress + + // Default overrides - big menu + + .top-bar-section .has-dropdown > a + padding-right: 15px !important + + i.ofn-i_022-cog + font-size: 24px + line-height: 45px + + .top-bar-section .has-dropdown > a:after + display: none + .top-bar-section ul li > a font-size: 0.75rem height: 45px @@ -13,16 +27,40 @@ nav opacity: 0.8 &:hover, &:focus, &:active opacity: 1 + .nav-branded color: $clr-brick-light-bright + span + font-size: 13px .nav-primary @include avenir font-size: 0.875rem -nav.top-bar a.icon i - font-size: 22px + +// Mobile Menu + +.off-canvas-wrap.move-right .tab-bar .menu-icon + @include box-shadow(inset 0 0 6px 2px rgba(0,0,0,0.5)) + +.off-canvas-wrap .tab-bar .menu-icon + @include csstrans + @include box-shadow(none) + +.off-canvas-wrap.move-right .tab-bar .menu-icon span + -moz-box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666 + -webkit-box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666 + box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666 + +.off-canvas-wrap.move-right ul.off-canvas-list + font-size: 0.875rem + +.off-canvas-wrap.move-right ul.off-canvas-list i + font-size: 1.5rem + margin-right: 0.25rem + // Responsive + @media screen and (min-width: 1025px) body.off-canvas // padding required to placehold for fixed menu bar From 1e3c046368114e38c05ee9d8cbc859952c9f99e0 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:07:02 +1000 Subject: [PATCH 062/130] Adding in new icon fonts to signed in partial --- app/views/shared/_signed_in.html.haml | 34 +++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/app/views/shared/_signed_in.html.haml b/app/views/shared/_signed_in.html.haml index 2e5dfc5b81..967986f4f1 100644 --- a/app/views/shared/_signed_in.html.haml +++ b/app/views/shared/_signed_in.html.haml @@ -1,7 +1,27 @@ -%li#login-name - %a{"ng-click" => "toggle('/account')"} - = spree_current_user.email -%li.divider - %li#sign-out-link - %i.ofn-i_018-unlocked - = link_to "Sign Out", "/logout" \ No newline at end of file +/ %li#login-name +/ %a{"ng-click" => "toggle('/account')"} +/ = spree_current_user.email +/ %li#sign-out-link +/ %a{title: 'Log Out', href:'/logout' } +/ %i.ofn-i_018-unlocked +/ LOG OUT +/ = link_to "Sign Out", "/logout" +/ %li.divider +%li.has-dropdown.not-click + %a{href: "#"} + %i.ofn-i_022-cog + %ul.dropdown + %li + %a{href: spree.account_path} + %i.ofn-i_015-user + = spree_current_user.email + %li + %a{title: 'Log Out', href:'/logout' } + %i.ofn-i_018-unlocked + LOG OUT + + - if admin_user? or enterprise_user? + %li + %a{href: spree.admin_path} + %i.ofn-i_021-tools + Admin \ No newline at end of file From 6e4de586a908966b8aad6190f079784d6d0a9057 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:07:17 +1000 Subject: [PATCH 063/130] Adding in new icon fonts to signed out partial --- app/views/shared/_signed_out.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_signed_out.html.haml b/app/views/shared/_signed_out.html.haml index cf5492487a..a004344038 100644 --- a/app/views/shared/_signed_out.html.haml +++ b/app/views/shared/_signed_out.html.haml @@ -1,5 +1,5 @@ %li#login-link{"ng-controller" => "AuthenticationCtrl"} %a{"ng-click" => "open()"} %i.ofn-i_017-locked - LOG IN + %span LOG IN From 498559f70d54793536cc01f66c160222b8d24a97 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:07:41 +1000 Subject: [PATCH 064/130] Adding in new icon fonts to cart partial --- app/views/shared/menu/_cart.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml index e34c17c559..a7320554c6 100644 --- a/app/views/shared/menu/_cart.html.haml +++ b/app/views/shared/menu/_cart.html.haml @@ -1,5 +1,6 @@ %a.icon{href: cart_url, "ng-controller" => "CartCtrl"} - %i.ofn-i_027-shopping-cart.nav-branded + %span.nav-branded + %i.ofn-i_027-shopping-cart %span {{ CurrentOrder.cart_count }} items From 122ab01ce40e4395e65245939ec8b36ca52d7b05 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:08:02 +1000 Subject: [PATCH 065/130] Adding in new icon fonts to large menu partial --- app/views/shared/menu/_large_menu.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 945e28027b..4a81964211 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -1,7 +1,7 @@ -%nav.top-bar.show-for-large-up{'data' => 'topbar'} +%nav.top-bar.show-for-large-up{'data-topbar' => true} %section.top-bar-section %ul.left{} - %li= link_to image_tag("ofn_logo_small.png"), root_path + %li.ofn-logo= link_to image_tag("ofn_logo_small.png"), root_path %li.divider - if current_page? root_path %li @@ -27,7 +27,9 @@ - if admin_user? or enterprise_user? %li %a{href: spree.admin_path} - %span.nav-primary Admin + %span.nav-primary + %i.ofn-i_021-tools + Admin %li.divider %section.top-bar-section %ul.right From 33c276c7f744dd43ff92103a35a41e6df46814e0 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:08:16 +1000 Subject: [PATCH 066/130] Adding in new icon fonts to mobile menu partial --- app/views/shared/menu/_mobile_menu.html.haml | 31 +++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index b01671e6c4..e038c19eaf 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -1,7 +1,7 @@ %nav.tab-bar.show-for-medium-down %section.left %a.left-off-canvas-toggle.menu-icon - %span + %span %section.right = render partial: "shared/menu/cart" %a{href: main_app.shop_path} @@ -14,32 +14,41 @@ - if admin_user? or enterprise_user? %li %a{href: spree.admin_path} - %span.nav-primary Admin + %span.nav-primary + %i.ofn-i_021-tools + Admin %li - if spree_current_user.nil? = render 'shared/signed_out' - else - = render 'shared/signed_in' - - %li - %a{href: main_app.producers_path} Producers + = render 'shared/signed_in_offcanvas' - if current_page? root_path %li %a{"ofn-scroll-to" => "hubs"} - %span.nav-primary Hubs + %span.nav-primary + %i.ofn-i_040-hub + Hubs - else %li %a{href: root_path + "#/#hubs"} - %span.nav-primary Hubs + %span.nav-primary + %i.ofn-i_040-hub + Hubs %li %a{href: ""} - %span.nav-primary Map + %span.nav-primary + %i.ofn-i_037-map + Map %li %a{href: main_app.producers_path} - %span.nav-primary Producers + %span.nav-primary + %i.ofn-i_036-producers + Producers %li %a{href: main_app.groups_path} - %span.nav-primary Groups + %span.nav-primary + %i.ofn-i_035-groups + Groups From 814ee9847ea9441dbd9e01a500e2a1734787a739 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:09:15 +1000 Subject: [PATCH 067/130] Adding a new partial for mobile menu (off canvas) to restyle items in dropdown in big menu --- app/views/shared/_signed_in_offcanvas.html.haml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/views/shared/_signed_in_offcanvas.html.haml diff --git a/app/views/shared/_signed_in_offcanvas.html.haml b/app/views/shared/_signed_in_offcanvas.html.haml new file mode 100644 index 0000000000..e500646e62 --- /dev/null +++ b/app/views/shared/_signed_in_offcanvas.html.haml @@ -0,0 +1,14 @@ +%li + %a{href: spree.account_path} + %i.ofn-i_015-user + = spree_current_user.email +%li + %a{title: 'Log Out', href:'/logout' } + %i.ofn-i_018-unlocked + LOG OUT + +- if admin_user? or enterprise_user? + %li + %a{href: spree.admin_path} + %i.ofn-i_021-tools + Admin \ No newline at end of file From 37c780ed705e80d4244c28a2f3b3182eb48a44e8 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 4 Jun 2014 16:20:48 +1000 Subject: [PATCH 068/130] WIP: Send credit card details to server on checkout --- .../checkout/checkout_controller.js.coffee | 1 + .../checkout/payment_controller.js.coffee | 5 ++ .../darkswarm/services/order.js.coffee | 12 ++++ .../spree/checkout/payment/_gateway.html.haml | 8 +++ .../consumer/shopping/checkout_spec.rb | 66 ++++++++++++------- .../checkout_controller_spec.js.coffee | 11 ++++ .../darkswarm/services/order_spec.js.coffee | 49 ++++++++++---- 7 files changed, 116 insertions(+), 36 deletions(-) create mode 100644 app/views/spree/checkout/payment/_gateway.html.haml diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee index 64f0184e98..a8047d9199 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee @@ -2,6 +2,7 @@ Darkswarm.controller "CheckoutCtrl", ($scope, storage, CheckoutFormState, Order, $scope.Order = Order storage.bind $scope, "Order.order", {storeName: "order_#{Order.order.id}#{Order.order.user_id}"} $scope.order = Order.order # Ordering is important + $scope.secrets = Order.secrets $scope.enabled = if CurrentUser then true else false diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee index ee5ff84b4a..adbe9bb8d6 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee @@ -1,3 +1,8 @@ Darkswarm.controller "PaymentCtrl", ($scope) -> angular.extend(this, new FieldsetMixin($scope)) $scope.name = "payment" + + $scope.months = {1: "January", 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July", 8: "August", 9: "September", 10: "October", 11: "November", 12: "December"} + $scope.years = [moment().year()..(moment().year()+15)] + $scope.secrets.card_month = "1" + $scope.secrets.card_year = moment().year() diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index 8078cf8fc3..06a2c8fadb 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -1,6 +1,7 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, Navigation)-> new class Order errors: {} + secrets: {} constructor: -> @order = order @@ -30,6 +31,17 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N if CheckoutFormState.ship_address_same_as_billing munged_order.ship_address_attributes = munged_order.bill_address_attributes + + angular.extend munged_order.payments_attributes[0], { + source_attributes: + number: @secrets.card_number + month: @secrets.card_month + year: @secrets.card_year + verification_value: @secrets.card_verification_value + first_name: @order.bill_address.firstname + last_name: @order.bill_address.lastname + } + munged_order shippingMethod: -> diff --git a/app/views/spree/checkout/payment/_gateway.html.haml b/app/views/spree/checkout/payment/_gateway.html.haml new file mode 100644 index 0000000000..5cd25dafba --- /dev/null +++ b/app/views/spree/checkout/payment/_gateway.html.haml @@ -0,0 +1,8 @@ += validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off" + +%label{for: "secrets.card_month"} Expiry Date +%select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true} + +%select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true} + += validated_input "CVV", "secrets.card_verification_value", required: true diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index c24456b16a..dd84a1e8ca 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -96,37 +96,57 @@ feature "As a consumer I want to check out my cart", js: true do end place_order - page.should have_content "Your order has been processed successfully", wait: 10 + page.should have_content "Your order has been processed successfully" ActionMailer::Base.deliveries.length.should == 1 email = ActionMailer::Base.deliveries.last site_name = Spree::Config[:site_name] email.subject.should include "#{site_name} Order Confirmation" end - it "takes us to the order confirmation page when submitted with 'same as billing address' checked" do - toggle_shipping - choose sm1.name - toggle_payment - choose pm1.name - toggle_details - within "#details" do - fill_in "First Name", with: "Will" - fill_in "Last Name", with: "Marshall" - fill_in "Email", with: "test@test.com" - fill_in "Phone", with: "0468363090" + context "with basic details filled" do + before do + toggle_shipping + choose sm1.name + toggle_payment + choose pm1.name + toggle_details + within "#details" do + fill_in "First Name", with: "Will" + fill_in "Last Name", with: "Marshall" + fill_in "Email", with: "test@test.com" + fill_in "Phone", with: "0468363090" + end + toggle_billing + within "#billing" do + fill_in "City", with: "Melbourne" + fill_in "Postcode", with: "3066" + fill_in "Address", with: "123 Your Face" + select "Australia", from: "Country" + select "Victoria", from: "State" + end + toggle_shipping + check "Shipping address same as billing address?" end - toggle_billing - within "#billing" do - fill_in "City", with: "Melbourne" - fill_in "Postcode", with: "3066" - fill_in "Address", with: "123 Your Face" - select "Australia", from: "Country" - select "Victoria", from: "State" + + it "takes us to the order confirmation page when submitted with 'same as billing address' checked" do + place_order + page.should have_content "Your order has been processed successfully" + end + + context "with a credit card payment method" do + let!(:pm1) { create(:payment_method, distributors: [distributor], name: "Roger rabbit", type: "Spree::Gateway::Bogus") } + + it "takes us to the order confirmation page when submitted with a valid credit card" do + toggle_payment + fill_in 'Card Number', with: "4111111111111111" + select 'February', from: 'secrets.card_month' + select (Date.today.year+1).to_s, from: 'secrets.card_year' + fill_in 'CVV', with: '123' + + place_order + page.should have_content "Your order has been processed successfully" + end end - toggle_shipping - check "Shipping address same as billing address?" - place_order - page.should have_content "Your order has been processed successfully", wait: 10 end end end diff --git a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee index 8632cb49ec..ea9c28a82d 100644 --- a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee @@ -12,6 +12,9 @@ describe "CheckoutCtrl", -> navigate: -> order: id: 1 + public: "public" + secrets: + card_number: "this is a secret" describe "with user", -> beforeEach -> @@ -37,3 +40,11 @@ describe "CheckoutCtrl", -> it "is disabled", -> expect(scope.enabled).toEqual false + + it "binds order to local storage", -> + expect(localStorage.getItem("order_#{Order.order.id}#{Order.order.user_id}")).toMatch Order.order.public + + it "does not store secrets in local storage", -> + keys = (localStorage.key(i) for i in [0..localStorage.length]) + for key in keys + expect(localStorage.getItem(key)).not.toMatch Order.secrets.card_number diff --git a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee index 4f6c711f99..a485e7b90d 100644 --- a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee @@ -7,10 +7,13 @@ describe 'Order service', -> flash = null beforeEach -> - orderData = { + orderData = id: 3102 payment_method_id: null - bill_address: {test: "foo"} + bill_address: + test: "foo" + firstname: "Robert" + lastname: "Harrington" ship_address: {test: "bar"} shipping_methods: 7: @@ -23,7 +26,7 @@ describe 'Order service', -> payment_methods: 99: test: "foo" - } + angular.module('Darkswarm').value('order', orderData) module 'Darkswarm' @@ -76,14 +79,34 @@ describe 'Order service', -> $httpBackend.flush() expect(Order.errors).toEqual {error: "frogs"} - it "Munges the order attributes to add _attributes as Rails needs", -> - expect(Order.preprocess().bill_address_attributes).not.toBe(undefined) - expect(Order.preprocess().bill_address).toBe(undefined) - expect(Order.preprocess().ship_address_attributes).not.toBe(undefined) - expect(Order.preprocess().ship_address).toBe(undefined) + describe "data preprocessing", -> + beforeEach -> + Order.order.payment_method_id = 99 - it "Munges the order attributes to clone ship address from bill address", -> - CheckoutFormState.ship_address_same_as_billing = false - expect(Order.preprocess().ship_address_attributes).toEqual(orderData.ship_address) - CheckoutFormState.ship_address_same_as_billing = true - expect(Order.preprocess().ship_address_attributes).toEqual(orderData.bill_address) + Order.secrets = + card_number: "1234567890123456" + card_month: "10" + card_year: "2015" + card_verification_value: "123" + + it "munges the order attributes to add _attributes as Rails needs", -> + expect(Order.preprocess().bill_address_attributes).not.toBe(undefined) + expect(Order.preprocess().bill_address).toBe(undefined) + expect(Order.preprocess().ship_address_attributes).not.toBe(undefined) + expect(Order.preprocess().ship_address).toBe(undefined) + + it "munges the order attributes to clone ship address from bill address", -> + CheckoutFormState.ship_address_same_as_billing = false + expect(Order.preprocess().ship_address_attributes).toEqual(orderData.ship_address) + CheckoutFormState.ship_address_same_as_billing = true + expect(Order.preprocess().ship_address_attributes).toEqual(orderData.bill_address) + + it "creates attributes for card fields", -> + source_attributes = Order.preprocess().payments_attributes[0].source_attributes + expect(source_attributes).toBeDefined() + expect(source_attributes.number).toBe Order.secrets.card_number + expect(source_attributes.month).toBe Order.secrets.card_month + expect(source_attributes.year).toBe Order.secrets.card_year + expect(source_attributes.verification_value).toBe Order.secrets.card_verification_value + expect(source_attributes.first_name).toBe Order.order.bill_address.firstname + expect(source_attributes.last_name).toBe Order.order.bill_address.lastname From 6a8def3d76becfc89b46a7da933c58c73958e4cd Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 4 Jun 2014 16:30:57 +1000 Subject: [PATCH 069/130] Do not send attributes for card fields when no card is supplied --- .../darkswarm/services/order.js.coffee | 19 ++++++++++--------- .../darkswarm/services/order_spec.js.coffee | 5 +++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index 06a2c8fadb..80f639dcf2 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -32,15 +32,16 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N if CheckoutFormState.ship_address_same_as_billing munged_order.ship_address_attributes = munged_order.bill_address_attributes - angular.extend munged_order.payments_attributes[0], { - source_attributes: - number: @secrets.card_number - month: @secrets.card_month - year: @secrets.card_year - verification_value: @secrets.card_verification_value - first_name: @order.bill_address.firstname - last_name: @order.bill_address.lastname - } + if @secrets.card_number?.length > 0 + angular.extend munged_order.payments_attributes[0], { + source_attributes: + number: @secrets.card_number + month: @secrets.card_month + year: @secrets.card_year + verification_value: @secrets.card_verification_value + first_name: @order.bill_address.firstname + last_name: @order.bill_address.lastname + } munged_order diff --git a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee index a485e7b90d..c6d04087b9 100644 --- a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee @@ -110,3 +110,8 @@ describe 'Order service', -> expect(source_attributes.verification_value).toBe Order.secrets.card_verification_value expect(source_attributes.first_name).toBe Order.order.bill_address.firstname expect(source_attributes.last_name).toBe Order.order.bill_address.lastname + + it "does not create attributes for card fields when no card is supplied", -> + Order.secrets.card_number = '' + source_attributes = Order.preprocess().payments_attributes[0].source_attributes + expect(source_attributes).not.toBeDefined() From 54a70d9b08625239d1214001ab8d375084edd17f Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:50:26 +1000 Subject: [PATCH 070/130] Adding new icons into hubs fat view. Making it pretty --- app/views/home/_fat.html.haml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index caddc00d8a..b9338d5235 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -1,17 +1,25 @@ .row.active_table_row{"ng-show" => "open()"} .columns.small-4 - %strong Shop for + %h5 + %i.ofn-i_029-shopping-basket + Shop for %p.trans-sentence %img{"ng-repeat" => "taxon in hub.taxons", "bo-src" => "taxon.icon", name: "{{taxon.name}}", alt: "{{taxon.name}}"} .columns.small-4 - %strong Delivery options + %h5 Delivery options %ol - %li.pickup{"bo-if" => "hub.pickup"} Pickup - %li.delivery{"bo-if" => "hub.delivery"} Delivery + %li.pickup{"bo-if" => "hub.pickup"} + %i.ofn-i_038-takeaway + Pickup + %li.delivery{"bo-if" => "hub.delivery"} + %i.ofn-i_039-delivery + Delivery .columns.small-4 - %strong Our producers - %ul + %h5 + %i.ofn-i_036-producers + Our producers + %ul.ofn-list %li{"ng-repeat" => "producer in hub.producers"} = render partial: "modals/producer" From cb5948047bea0eed4d3de0a35941b7705eb8b5e3 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:50:51 +1000 Subject: [PATCH 071/130] Adding new icons into producer modal. Making it pretty --- app/views/modals/_producer.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 4b4421e8d8..e9808b09d7 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -1,7 +1,9 @@ %ofn-modal{title: "{{producer.name}}"} .row .small-12.columns.producer-hero - %h3.producer-name {{ producer.name }} + %h3.producer-name + %i.ofn-i_036-producers + {{ producer.name }} %img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"} .row From c2a2f2b3b8e4c2d7bc61af088ef1807d05e1f756 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:51:43 +1000 Subject: [PATCH 072/130] Adding icon for producers. Remove styling summary-header to distinguish between product and producer --- app/views/shop/products/_summary.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index 22ce416336..ca9557d42a 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -8,7 +8,8 @@ name: "{{product.primary_taxon.name}}"} = render partial: "modals/product" - .small-5.columns.summary-header + .small-5.columns + %i.ofn-i_036-producers = render partial: "modals/producer" .small-2.columns.summary-price.text-right.price From fc3402bbd05272989b001663491e756ff822f092 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 4 Jun 2014 16:55:27 +1000 Subject: [PATCH 073/130] Determine whether to send card field attributes by payment method type --- app/assets/javascripts/darkswarm/services/order.js.coffee | 2 +- app/views/checkout/_order.rabl | 3 ++- .../unit/darkswarm/services/order_spec.js.coffee | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index 80f639dcf2..bde2373aec 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -32,7 +32,7 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N if CheckoutFormState.ship_address_same_as_billing munged_order.ship_address_attributes = munged_order.bill_address_attributes - if @secrets.card_number?.length > 0 + if @paymentMethod()?.method_type == 'gateway' angular.extend munged_order.payments_attributes[0], { source_attributes: number: @secrets.card_number diff --git a/app/views/checkout/_order.rabl b/app/views/checkout/_order.rabl index 36e5a98eed..f18c2e0173 100644 --- a/app/views/checkout/_order.rabl +++ b/app/views/checkout/_order.rabl @@ -30,7 +30,8 @@ end node :payment_methods do Hash[current_order.available_payment_methods.collect { |method| [method.id, { - name: method.name + name: method.name, + method_type: method.method_type }] }] end diff --git a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee index c6d04087b9..d7233dae22 100644 --- a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee @@ -26,6 +26,10 @@ describe 'Order service', -> payment_methods: 99: test: "foo" + method_type: "gateway" + 123: + test: "bar" + method_type: "check" angular.module('Darkswarm').value('order', orderData) module 'Darkswarm' @@ -60,7 +64,7 @@ describe 'Order service', -> it 'Gets the current payment method', -> expect(Order.paymentMethod()).toEqual null Order.order.payment_method_id = 99 - expect(Order.paymentMethod()).toEqual {test: "foo"} + expect(Order.paymentMethod()).toEqual {test: "foo", method_type: "gateway"} it "Posts the Order to the server", -> $httpBackend.expectPUT("/checkout", {order: Order.preprocess()}).respond 200, {path: "test"} @@ -112,6 +116,6 @@ describe 'Order service', -> expect(source_attributes.last_name).toBe Order.order.bill_address.lastname it "does not create attributes for card fields when no card is supplied", -> - Order.secrets.card_number = '' + Order.order.payment_method_id = 123 source_attributes = Order.preprocess().payments_attributes[0].source_attributes expect(source_attributes).not.toBeDefined() From 8d24301c26659a112d673f0cbf121e6b04b12e9a Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 16:57:21 +1000 Subject: [PATCH 074/130] Changing shop link to correct /shop --- app/views/shared/_footer.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index ee13a29d47..713c95c769 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -21,7 +21,9 @@ %h4 Getting around %ul.ofn-list %li - %a{href: "/map"} Shop + %a{href: "/shop"} + %i.ofn-i_044-facebook + Shop %li %a{href: "/map"} Map %li From 825ec1bb6318770817190ba2d1e84e2e2e51f622 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 17:09:50 +1000 Subject: [PATCH 075/130] Adding in icons to home hubs fat and skinny views --- app/views/home/_fat.html.haml | 6 ++++-- app/views/home/_skinny.html.haml | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index b9338d5235..f888426d2e 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -4,8 +4,10 @@ %i.ofn-i_029-shopping-basket Shop for %p.trans-sentence - %img{"ng-repeat" => "taxon in hub.taxons", "bo-src" => "taxon.icon", - name: "{{taxon.name}}", alt: "{{taxon.name}}"} + %span{"ng-repeat" => "taxon in hub.taxons"} + %img{"bo-src" => "taxon.icon", + name: "{{taxon.name}}", alt: "{{taxon.name}}"} + {{taxon.name}} .columns.small-4 %h5 Delivery options %ol diff --git a/app/views/home/_skinny.html.haml b/app/views/home/_skinny.html.haml index 8798e504a6..8e68d7251c 100644 --- a/app/views/home/_skinny.html.haml +++ b/app/views/home/_skinny.html.haml @@ -6,9 +6,16 @@ {{ hub.address.city }} .columns.small-1 {{ hub.address.state | uppercase }} + .columns.small-3{"bo-if" => "hub.active"} {{ hub.orders_close_at | sensible_timeframe }} + + .columns.small-3{"bo-if" => "hub.active"} + {{ hub.orders_close_at | sensible_timeframe }} + .columns.small-3{"bo-if" => "!hub.active"} + %i.ofn-i_032-closed-sign Orders closed + .columns.small-1.text-right %i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"} From 3d64f883a0cf6ca0e90ebc3f95d4249921bcdca7 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 17:12:05 +1000 Subject: [PATCH 076/130] Fix issue with double up columns - delete duplicate --- app/views/home/_skinny.html.haml | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/home/_skinny.html.haml b/app/views/home/_skinny.html.haml index 8e68d7251c..768d16f2b6 100644 --- a/app/views/home/_skinny.html.haml +++ b/app/views/home/_skinny.html.haml @@ -10,9 +10,6 @@ .columns.small-3{"bo-if" => "hub.active"} {{ hub.orders_close_at | sensible_timeframe }} - .columns.small-3{"bo-if" => "hub.active"} - {{ hub.orders_close_at | sensible_timeframe }} - .columns.small-3{"bo-if" => "!hub.active"} %i.ofn-i_032-closed-sign Orders closed From 59c433881ee1fa9bc26220f42ec09e135530c87d Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 3 Jun 2014 13:06:27 +1000 Subject: [PATCH 077/130] Making the auto-closing more granular on checkout --- .../controllers/checkout/accordion_controller.js.coffee | 8 ++++---- .../controllers/checkout/billing_controller.js.coffee | 3 ++- .../controllers/checkout/details_controller.js.coffee | 5 +++-- .../controllers/checkout/payment_controller.js.coffee | 3 ++- .../controllers/checkout/shipping_controller.js.coffee | 3 ++- .../javascripts/darkswarm/mixins/fieldset_mixin.js.coffee | 8 ++++++-- .../checkout/accordion_controller_spec.js.coffee | 8 -------- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/accordion_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/accordion_controller.js.coffee index 38f41c6f6b..a0ba6f4e29 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/accordion_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/accordion_controller.js.coffee @@ -9,8 +9,8 @@ Darkswarm.controller "AccordionCtrl", ($scope, storage, $timeout) -> $scope.show = (name)-> $scope.accordion[name] = true - $timeout => - if $scope.checkout.$valid - for k, v of $scope.accordion - $scope.accordion[k] = false + #$timeout => + #if $scope.checkout.$valid + #for k, v of $scope.accordion + #$scope.accordion[k] = false diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/billing_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/billing_controller.js.coffee index 4dc4d8f88c..dcc397396c 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/billing_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/billing_controller.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.controller "BillingCtrl", ($scope) -> +Darkswarm.controller "BillingCtrl", ($scope, $timeout) -> angular.extend(this, new FieldsetMixin($scope)) $scope.name = "billing" $scope.nextPanel = "shipping" @@ -8,3 +8,4 @@ Darkswarm.controller "BillingCtrl", ($scope) -> $scope.order.bill_address.city, $scope.order.bill_address.zipcode] + #$timeout $scope.onTimeout diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/details_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/details_controller.js.coffee index 8153c24f92..e0fef8e343 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/details_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/details_controller.js.coffee @@ -1,6 +1,5 @@ -Darkswarm.controller "DetailsCtrl", ($scope) -> +Darkswarm.controller "DetailsCtrl", ($scope, $timeout) -> angular.extend(this, new FieldsetMixin($scope)) - $scope.name = "details" $scope.nextPanel = "billing" @@ -12,3 +11,5 @@ Darkswarm.controller "DetailsCtrl", ($scope) -> $scope.fullName = -> [$scope.order.bill_address.firstname ? null, $scope.order.bill_address.lastname ? null].join(" ").trim() + + $timeout $scope.onTimeout diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee index adbe9bb8d6..33a06e5d1f 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.controller "PaymentCtrl", ($scope) -> +Darkswarm.controller "PaymentCtrl", ($scope, $timeout) -> angular.extend(this, new FieldsetMixin($scope)) $scope.name = "payment" @@ -6,3 +6,4 @@ Darkswarm.controller "PaymentCtrl", ($scope) -> $scope.years = [moment().year()..(moment().year()+15)] $scope.secrets.card_month = "1" $scope.secrets.card_year = moment().year() + $timeout $scope.onTimeout diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/shipping_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/shipping_controller.js.coffee index a6a38329b4..1d0280842d 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/shipping_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/shipping_controller.js.coffee @@ -1,5 +1,6 @@ -Darkswarm.controller "ShippingCtrl", ($scope) -> +Darkswarm.controller "ShippingCtrl", ($scope, $timeout) -> angular.extend(this, new FieldsetMixin($scope)) $scope.name = "shipping" $scope.nextPanel = "payment" + $timeout $scope.onTimeout diff --git a/app/assets/javascripts/darkswarm/mixins/fieldset_mixin.js.coffee b/app/assets/javascripts/darkswarm/mixins/fieldset_mixin.js.coffee index ff01db5483..26b7ac3518 100644 --- a/app/assets/javascripts/darkswarm/mixins/fieldset_mixin.js.coffee +++ b/app/assets/javascripts/darkswarm/mixins/fieldset_mixin.js.coffee @@ -1,8 +1,12 @@ window.FieldsetMixin = ($scope)-> - $scope.next = (event)-> - event.preventDefault() + $scope.next = (event = false)-> + event.preventDefault() if event $scope.show $scope.nextPanel + $scope.onTimeout = -> + if $scope[$scope.name].$valid + $scope.next() + $scope.valid = -> $scope.form().$valid diff --git a/spec/javascripts/unit/darkswarm/controllers/checkout/accordion_controller_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers/checkout/accordion_controller_spec.js.coffee index d35fb93e86..8e59248806 100644 --- a/spec/javascripts/unit/darkswarm/controllers/checkout/accordion_controller_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers/checkout/accordion_controller_spec.js.coffee @@ -30,11 +30,3 @@ describe "AccordionCtrl", -> scope.order = id: 129 ctrl = $controller 'AccordionCtrl', {$scope: scope} - - it "automatically closes all sections if the entire form is valid", -> - waitsFor -> - (scope.accordion.details and - scope.accordion.shipping and - scope.accordion.payment and - scope.accordion.billing) == false - , "the accordion to close", 100 From d944c31d77301e677a18e8c1c4ce0a1dda1ab2f1 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 3 Jun 2014 13:11:39 +1000 Subject: [PATCH 078/130] Showing a loading products thing --- app/views/shop/products/_form.html.haml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 6212ef746d..95bfdac31d 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -17,13 +17,18 @@ "ng-repeat" => "product in data.products | filter:query | orderBy:ordering.order | limitTo: limit track by product.id"} %div = render partial: "shop/products/summary" - %div{"bo-if" => "hasVariants"} = render partial: "shop/products/variants" - .variants.row{"bo-if" => "!hasVariants"} = render partial: "shop/products/master" + + %product{"ng-show" => "data.loading"} + .row.summary + .small-12.columns.text-center + Loading products + .row .small-12.columns %input.button.primary.right.add_to_cart{type: :submit, value: "Add to Cart"} + From 2c43d5960d3e6ac43a895757c87487ac0ca7c10f Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 3 Jun 2014 13:21:15 +1000 Subject: [PATCH 079/130] Patching up url formatting, still need to normalize this on backend --- app/views/shopping_shared/_contact.html.haml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index d4894357ad..7bf85ea432 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -19,7 +19,7 @@ %ul.small-block-grid-1.large-block-grid-2{bindonce: true} - unless current_distributor.website.blank? %li - %a{href: current_distributor.website, target: "_blank" } + %a{href: "http://#{current_distributor.website}", target: "_blank" } %i.fi-web = current_distributor.website @@ -32,24 +32,24 @@ - unless current_distributor.twitter.blank? %li - %a{href: current_distributor.twitter, target: "_blank" } + %a{href: "http://twitter.com/#{current_distributor.twitter}", target: "_blank" } %i.fi-social-twitter = current_distributor.twitter - unless current_distributor.facebook.blank? %li - %a{href: current_distributor.facebook, target: "_blank" } + %a{href: "http://#{current_distributor.facebook}", target: "_blank" } %i.fi-social-facebook = current_distributor.facebook - unless current_distributor.linkedin.blank? %li - %a{href: current_distributor.linkedin, target: "_blank" } + %a{href: "http://#{current_distributor.linkedin}", target: "_blank" } %i.fi-social-linkedin = current_distributor.linkedin - unless current_distributor.instagram.blank? %li - %a{href: current_distributor.instagram, target: "_blank" } + %a{href: "http://instagram.com.#{current_distributor.instagram}", target: "_blank" } %i.fi-social-instagram = current_distributor.instagram From a6a4d28072900837ec2c62e4ef171b462cf41697 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 13:18:11 +1000 Subject: [PATCH 080/130] Fixing up bugs in the Checkout form --- .../checkout/checkout_controller.js.coffee | 8 +++---- .../services/checkout_form_state.js.coffee | 3 --- .../darkswarm/services/order.js.coffee | 24 +++++++++++++++---- app/views/checkout/_order.rabl | 5 +++- app/views/checkout/_shipping.html.haml | 4 ++-- .../checkout_controller_spec.js.coffee | 5 ++++ .../darkswarm/services/order_spec.js.coffee | 22 +++++++++++++---- 7 files changed, 50 insertions(+), 21 deletions(-) delete mode 100644 app/assets/javascripts/darkswarm/services/checkout_form_state.js.coffee diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee index a8047d9199..19d1810f38 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout/checkout_controller.js.coffee @@ -1,6 +1,7 @@ -Darkswarm.controller "CheckoutCtrl", ($scope, storage, CheckoutFormState, Order, CurrentUser) -> +Darkswarm.controller "CheckoutCtrl", ($scope, storage, Order, CurrentUser) -> $scope.Order = Order - storage.bind $scope, "Order.order", {storeName: "order_#{Order.order.id}#{Order.order.user_id}"} + Order.bindFieldsToLocalStorage($scope) + $scope.order = Order.order # Ordering is important $scope.secrets = Order.secrets @@ -9,6 +10,3 @@ Darkswarm.controller "CheckoutCtrl", ($scope, storage, CheckoutFormState, Order, $scope.purchase = (event)-> event.preventDefault() $scope.Order.submit() - - $scope.CheckoutFormState = CheckoutFormState - storage.bind $scope, "CheckoutFormState.ship_address_same_as_billing", { defaultValue: true} diff --git a/app/assets/javascripts/darkswarm/services/checkout_form_state.js.coffee b/app/assets/javascripts/darkswarm/services/checkout_form_state.js.coffee deleted file mode 100644 index 6fedb6b3c6..0000000000 --- a/app/assets/javascripts/darkswarm/services/checkout_form_state.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -Darkswarm.factory 'CheckoutFormState', ()-> - # Just a singleton place to store data about the form state - new class CheckoutFormState diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index bde2373aec..cea0f54d23 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -1,10 +1,23 @@ -Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, Navigation)-> +Darkswarm.factory 'Order', ($resource, order, $http, flash, Navigation, storage)-> new class Order errors: {} secrets: {} + order: order + ship_address_same_as_billing: true - constructor: -> - @order = order + #Whitelist of fields from Order.order to bind into localStorage + fieldsToBind: ["bill_address", "email", "payment_method_id", "shipping_method_id", "ship_address"] + + # Bind all the fields from fieldsToBind, + anything on the Order class + bindFieldsToLocalStorage: (scope)=> + prefix = "order_#{@order.id}#{@order.user_id}" + for field in @fieldsToBind + storage.bind scope, "Order.order.#{field}", + storeName: "#{prefix}_#{field}" + + storage.bind scope, "Order.ship_address_same_as_billing", + storeName: "#{prefix}_sameasbilling" + defaultValue: true submit: -> $http.put('/checkout', {order: @preprocess()}).success (data, status)=> @@ -25,11 +38,12 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N munged_order["ship_address_attributes"] = value when "payment_method_id" munged_order["payments_attributes"] = [{payment_method_id: value}] + when "form_state" # don't keep this shit else munged_order[name] = value - if CheckoutFormState.ship_address_same_as_billing + if @ship_address_same_as_billing munged_order.ship_address_attributes = munged_order.bill_address_attributes if @paymentMethod()?.method_type == 'gateway' @@ -52,7 +66,7 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N @shippingMethod()?.require_ship_address shippingPrice: -> - @shippingMethod()?.price + @shippingMethod()?.price || 0.0 paymentMethod: -> @order.payment_methods[@order.payment_method_id] diff --git a/app/views/checkout/_order.rabl b/app/views/checkout/_order.rabl index f18c2e0173..af37d2edf1 100644 --- a/app/views/checkout/_order.rabl +++ b/app/views/checkout/_order.rabl @@ -1,3 +1,6 @@ +#NOTE: when adding new fields for user input, it may want to be cached in localStorage +# If so, make sure to add it to Order.attributes_to_cache + object current_order attributes :id, :email, :shipping_method_id, :user_id @@ -18,7 +21,7 @@ child current_order.ship_address => :ship_address do end node :shipping_methods do - Hash[current_order.available_shipping_methods("front_end").collect { |method| + Hash[current_distributor.shipping_methods.uniq.collect { |method| [method.id, { require_ship_address: method.require_ship_address, price: method.compute_amount(current_order).to_f, diff --git a/app/views/checkout/_shipping.html.haml b/app/views/checkout/_shipping.html.haml index 215ea8ed61..67172ce392 100644 --- a/app/views/checkout/_shipping.html.haml +++ b/app/views/checkout/_shipping.html.haml @@ -42,10 +42,10 @@ = f.fields_for :ship_address, @order.ship_address do |sa| #ship_address{"ng-if" => "Order.requireShipAddress()"} %label - %input{type: :checkbox, "ng-model" => "CheckoutFormState.ship_address_same_as_billing"} + %input{type: :checkbox, "ng-model" => "Order.ship_address_same_as_billing"} Shipping address same as billing address? - %div.visible{"ng-if" => "!CheckoutFormState.ship_address_same_as_billing"} + %div.visible{"ng-if" => "!Order.ship_address_same_as_billing"} .row .small-12.columns = validated_input "Address", "order.ship_address.address1", "ofn-focus" => "accordion['shipping']" diff --git a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee index ea9c28a82d..0cb8e8d678 100644 --- a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee @@ -10,6 +10,7 @@ describe "CheckoutCtrl", -> Order = submit: -> navigate: -> + bindFieldsToLocalStorage: -> order: id: 1 public: "public" @@ -20,6 +21,7 @@ describe "CheckoutCtrl", -> beforeEach -> inject ($controller, $rootScope) -> scope = $rootScope.$new() + spyOn(Order, "bindFieldsToLocalStorage") ctrl = $controller 'CheckoutCtrl', {$scope: scope, Order: Order, CurrentUser: {}} it "delegates to the service on submit", -> @@ -32,6 +34,9 @@ describe "CheckoutCtrl", -> it "is enabled", -> expect(scope.enabled).toEqual true + it "triggers localStorage binding", -> + expect(Order.bindFieldsToLocalStorage).toHaveBeenCalled() + describe "without user", -> beforeEach -> inject ($controller, $rootScope) -> diff --git a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee index d7233dae22..4dd50b2575 100644 --- a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee @@ -2,9 +2,9 @@ describe 'Order service', -> Order = null orderData = null $httpBackend = null - CheckoutFormState = null Navigation = null flash = null + storage = null beforeEach -> orderData = @@ -15,6 +15,7 @@ describe 'Order service', -> firstname: "Robert" lastname: "Harrington" ship_address: {test: "bar"} + user_id: 901 shipping_methods: 7: require_ship_address: true @@ -34,18 +35,29 @@ describe 'Order service', -> angular.module('Darkswarm').value('order', orderData) module 'Darkswarm' - inject ($injector, _$httpBackend_)-> + inject ($injector, _$httpBackend_, _storage_)-> $httpBackend = _$httpBackend_ + storage = _storage_ Order = $injector.get("Order") Navigation = $injector.get("Navigation") flash = $injector.get("flash") - CheckoutFormState = $injector.get("CheckoutFormState") spyOn(Navigation, "go") # Stubbing out writes to window.location it "defaults to no shipping method", -> expect(Order.order.shipping_method_id).toEqual null expect(Order.shippingMethod()).toEqual undefined + it "has a shipping price of zero with no shipping method", -> + expect(Order.shippingPrice()).toEqual 0.0 + + it "binds to localStorage when given a scope", -> + spyOn(storage, "bind") + Order.fieldsToBind = ["testy"] + Order.bindFieldsToLocalStorage({}) + prefix = "order_#{Order.order.id}#{Order.order.user_id}" + expect(storage.bind).toHaveBeenCalledWith({}, "Order.order.testy", {storeName: "#{prefix}_testy"}) + expect(storage.bind).toHaveBeenCalledWith({}, "Order.ship_address_same_as_billing", {storeName: "#{prefix}_sameasbilling", defaultValue: true}) + describe "with shipping method", -> beforeEach -> @@ -100,9 +112,9 @@ describe 'Order service', -> expect(Order.preprocess().ship_address).toBe(undefined) it "munges the order attributes to clone ship address from bill address", -> - CheckoutFormState.ship_address_same_as_billing = false + Order.ship_address_same_as_billing = false expect(Order.preprocess().ship_address_attributes).toEqual(orderData.ship_address) - CheckoutFormState.ship_address_same_as_billing = true + Order.ship_address_same_as_billing = true expect(Order.preprocess().ship_address_attributes).toEqual(orderData.bill_address) it "creates attributes for card fields", -> From d384b18d1b4e4e04364410f9dec5f6594a639105 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 14:19:13 +1000 Subject: [PATCH 081/130] Adding social media data to producers biatch --- app/views/json/_producer.rabl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/json/_producer.rabl b/app/views/json/_producer.rabl index 4c0efae8e1..1f4a99cdfc 100644 --- a/app/views/json/_producer.rabl +++ b/app/views/json/_producer.rabl @@ -1,4 +1,4 @@ -attributes :name, :id, :description, :long_description +attributes :id, :name, :description, :long_description, :website, :instagram, :facebook, :linkedin, :twitter node :promo_image do |producer| producer.promo_image.url From df7ee03cbf418c9d7ccd24f1204b9116d5d112a9 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 15:25:46 +1000 Subject: [PATCH 082/130] Adding presenters to the social media fields --- app/models/enterprise.rb | 14 ++++++++++++++ spec/models/enterprise_spec.rb | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 7c54bb1f10..3c851bde45 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -149,6 +149,16 @@ class Enterprise < ActiveRecord::Base self.relatives.is_distributor end + def website + strip_url read_attribute(:website) + end + def facebook + strip_url read_attribute(:facebook) + end + def linkedin + strip_url read_attribute(:linkedin) + end + def suppliers self.relatives.is_primary_producer end @@ -180,6 +190,10 @@ class Enterprise < ActiveRecord::Base private + def strip_url(url) + url.andand.sub /(https?:\/\/)?(www\.)?/, '' + end + def initialize_country self.address ||= Spree::Address.new self.address.country = Spree::Country.find_by_id(Spree::Config[:default_country_id]) if self.address.new_record? diff --git a/spec/models/enterprise_spec.rb b/spec/models/enterprise_spec.rb index 23f300fba5..542d95a4b0 100644 --- a/spec/models/enterprise_spec.rb +++ b/spec/models/enterprise_spec.rb @@ -445,4 +445,18 @@ describe Enterprise do supplier.supplied_taxons.should == [taxon1, taxon2] end end + + describe "presentation of attributes" do + let(:distributor) { + create(:distributor_enterprise, + website: "http://www.google.com", + facebook: "www.facebook.com/roger", + linkedin: "http://linkedin.com") + } + it "strips http and www from url fields" do + distributor.website.should == "google.com" + distributor.facebook.should == "facebook.com/roger" + distributor.linkedin.should == "linkedin.com" + end + end end From 5bd7485ca61e2fe7a1e7a2a155f3fcdf85dae780 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 15:42:30 +1000 Subject: [PATCH 083/130] Restoring the image --- app/views/shopping_shared/_about.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/shopping_shared/_about.html.haml b/app/views/shopping_shared/_about.html.haml index e03eb05255..5e630b4d7f 100644 --- a/app/views/shopping_shared/_about.html.haml +++ b/app/views/shopping_shared/_about.html.haml @@ -2,7 +2,8 @@ .row .small-12.large-9.columns %p= current_distributor.long_description.andand.html_safe - .small-12.large-3.columns - / Hide image until image styles are working correctly: - / %img.about.right{src: current_distributor.promo_image.url(:large)} + + - if current_distributor.promo_image.exists? + .small-12.large-3.columns + %img.about.right{src: current_distributor.promo_image.url(:large)} From 874afb2d7efc05708399a5855305216e1100ba42 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 15:42:37 +1000 Subject: [PATCH 084/130] Hiding image if not present --- app/views/shopping_shared/_details.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_details.html.haml b/app/views/shopping_shared/_details.html.haml index 2a8e1b10b1..1b30627533 100644 --- a/app/views/shopping_shared/_details.html.haml +++ b/app/views/shopping_shared/_details.html.haml @@ -1,7 +1,8 @@ %navigation %distributor.details.row #distributor_title - %img.left{src: current_distributor.logo.url(:thumb)} + - if current_distributor.logo.exists? + %img.left{src: current_distributor.logo.url(:thumb)} %h3 = current_distributor.name %location= current_distributor.address.city From cd09f70ed34cb4e3ba59f51949a9307db4d7bab1 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 16:38:49 +1000 Subject: [PATCH 085/130] Compacting down our flash messages --- .../darkswarm/directives/flash.js.coffee | 14 +++++++++++--- .../darkswarm/services/current_order.js.coffee | 1 - .../javascripts/darkswarm/services/flash.js.coffee | 9 +++++++++ .../javascripts/darkswarm/services/order.js.coffee | 5 ++--- app/assets/javascripts/templates/flash.html.haml | 2 ++ app/controllers/checkout_controller.rb | 1 - app/views/layouts/darkswarm.html.haml | 2 +- 7 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 app/assets/javascripts/darkswarm/services/flash.js.coffee create mode 100644 app/assets/javascripts/templates/flash.html.haml diff --git a/app/assets/javascripts/darkswarm/directives/flash.js.coffee b/app/assets/javascripts/darkswarm/directives/flash.js.coffee index 86eb2a05a2..454c3304bd 100644 --- a/app/assets/javascripts/darkswarm/directives/flash.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/flash.js.coffee @@ -1,12 +1,20 @@ Darkswarm.directive "ofnFlash", (flash, $timeout)-> + typePairings = + info: "standard" + error: "alert" + success: "success" scope: {} restrict: 'AE' - template: "{{flash.message}}" + templateUrl: "flash.html" + controller: ($scope)-> + $scope.closeAlert = (index)-> + $scope.flashes.splice(index, 1) + link: ($scope, element, attr) -> $scope.flashes = [] - show = (message, type)-> + show = (message, type)=> if message - $scope.flashes.push({message: message, type: type}) + $scope.flashes.push({message: message, type: typePairings[type]}) $timeout($scope.delete, 5000) $scope.delete = -> diff --git a/app/assets/javascripts/darkswarm/services/current_order.js.coffee b/app/assets/javascripts/darkswarm/services/current_order.js.coffee index 6e329a38f9..9d8cbda9ef 100644 --- a/app/assets/javascripts/darkswarm/services/current_order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/current_order.js.coffee @@ -2,6 +2,5 @@ Darkswarm.factory 'CurrentOrder', (currentOrder) -> new class CurrentOrder constructor: -> @[k] = v for k, v of currentOrder - empty: => @line_items.length == 0 diff --git a/app/assets/javascripts/darkswarm/services/flash.js.coffee b/app/assets/javascripts/darkswarm/services/flash.js.coffee new file mode 100644 index 0000000000..2be131da1d --- /dev/null +++ b/app/assets/javascripts/darkswarm/services/flash.js.coffee @@ -0,0 +1,9 @@ +Darkswarm.factory 'Flash', (flash)-> + new class Flash + loadFlash: (rails_flash)-> + for type, message of rails_flash + switch type + when "notice" + flash.info = message + else + flash[type] = message diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index cea0f54d23..9af41c8a0b 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.factory 'Order', ($resource, order, $http, flash, Navigation, storage)-> +Darkswarm.factory 'Order', ($resource, order, $http, Flash, Navigation, storage)-> new class Order errors: {} secrets: {} @@ -24,8 +24,7 @@ Darkswarm.factory 'Order', ($resource, order, $http, flash, Navigation, storage) Navigation.go data.path .error (response, status)=> @errors = response.errors - flash.error = response.flash?.error - flash.success = response.flash?.notice + Flash.loadFlash(response.flash) # Rails wants our Spree::Address data to be provided with _attributes preprocess: -> diff --git a/app/assets/javascripts/templates/flash.html.haml b/app/assets/javascripts/templates/flash.html.haml new file mode 100644 index 0000000000..8767cf3743 --- /dev/null +++ b/app/assets/javascripts/templates/flash.html.haml @@ -0,0 +1,2 @@ +%alert{close: "closeAlert($index)", "ng-repeat" => "flash in flashes", type: "flash.type"} + {{ flash.message }} diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 95fc059e06..b0cdeebba2 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -15,7 +15,6 @@ class CheckoutController < Spree::CheckoutController end def update - if @order.update_attributes(params[:order]) fire_event('spree.checkout.update') while @order.state != "complete" diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index a7598e24a5..a9c9702ab2 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -23,7 +23,7 @@ .inner-wrap = render partial: "shared/menu/menu" - = display_flash_messages + -#= display_flash_messages %ofn-flash %section{ role: "main" } From 3c21ce8d99dc7735780c3dec144297240ad6d92a Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 17:11:02 +1000 Subject: [PATCH 086/130] Returning to the basic flash for now --- app/views/layouts/darkswarm.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index a9c9702ab2..a7598e24a5 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -23,7 +23,7 @@ .inner-wrap = render partial: "shared/menu/menu" - -#= display_flash_messages + = display_flash_messages %ofn-flash %section{ role: "main" } From 039108a07d65d7f16e9774661391cdf929c06558 Mon Sep 17 00:00:00 2001 From: summerscope Date: Wed, 4 Jun 2014 17:16:47 +1000 Subject: [PATCH 087/130] Styling label on taxons on fat view of active table for hubs (add a little padding to right) --- app/assets/stylesheets/darkswarm/hub_node.css.sass | 2 ++ app/views/home/_fat.html.haml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/hub_node.css.sass b/app/assets/stylesheets/darkswarm/hub_node.css.sass index eb30630ad6..d74eb35774 100644 --- a/app/assets/stylesheets/darkswarm/hub_node.css.sass +++ b/app/assets/stylesheets/darkswarm/hub_node.css.sass @@ -35,6 +35,8 @@ //Open row &.open + .fat-taxons + margin-right: 0.5rem .active_table_row:first-child border-top: 1px solid $clr-brick border-left: 1px solid $clr-brick diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index f888426d2e..30a9dd719a 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -4,7 +4,7 @@ %i.ofn-i_029-shopping-basket Shop for %p.trans-sentence - %span{"ng-repeat" => "taxon in hub.taxons"} + %span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"} %img{"bo-src" => "taxon.icon", name: "{{taxon.name}}", alt: "{{taxon.name}}"} {{taxon.name}} From 69e5459afd5c538fe21fdc080984d3679f54656c Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 4 Jun 2014 17:22:10 +1000 Subject: [PATCH 088/130] Finishing off the merge with localStorage refactoring with sekrets --- .../darkswarm/services/order.js.coffee | 5 +++-- .../checkout_controller_spec.js.coffee | 5 +---- .../darkswarm/services/order_spec.js.coffee | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/order.js.coffee b/app/assets/javascripts/darkswarm/services/order.js.coffee index 9af41c8a0b..cea0f54d23 100644 --- a/app/assets/javascripts/darkswarm/services/order.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.factory 'Order', ($resource, order, $http, Flash, Navigation, storage)-> +Darkswarm.factory 'Order', ($resource, order, $http, flash, Navigation, storage)-> new class Order errors: {} secrets: {} @@ -24,7 +24,8 @@ Darkswarm.factory 'Order', ($resource, order, $http, Flash, Navigation, storage) Navigation.go data.path .error (response, status)=> @errors = response.errors - Flash.loadFlash(response.flash) + flash.error = response.flash?.error + flash.success = response.flash?.notice # Rails wants our Spree::Address data to be provided with _attributes preprocess: -> diff --git a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee index 0cb8e8d678..edda65e0cf 100644 --- a/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers/checkout/checkout_controller_spec.js.coffee @@ -13,7 +13,7 @@ describe "CheckoutCtrl", -> bindFieldsToLocalStorage: -> order: id: 1 - public: "public" + email: "public" secrets: card_number: "this is a secret" @@ -46,9 +46,6 @@ describe "CheckoutCtrl", -> it "is disabled", -> expect(scope.enabled).toEqual false - it "binds order to local storage", -> - expect(localStorage.getItem("order_#{Order.order.id}#{Order.order.user_id}")).toMatch Order.order.public - it "does not store secrets in local storage", -> keys = (localStorage.key(i) for i in [0..localStorage.length]) for key in keys diff --git a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee index 4dd50b2575..f6a4112eef 100644 --- a/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/order_spec.js.coffee @@ -5,11 +5,13 @@ describe 'Order service', -> Navigation = null flash = null storage = null + scope = null beforeEach -> orderData = id: 3102 payment_method_id: null + email: "test@test.com" bill_address: test: "foo" firstname: "Robert" @@ -35,10 +37,12 @@ describe 'Order service', -> angular.module('Darkswarm').value('order', orderData) module 'Darkswarm' - inject ($injector, _$httpBackend_, _storage_)-> + inject ($injector, _$httpBackend_, _storage_, $rootScope)-> $httpBackend = _$httpBackend_ storage = _storage_ Order = $injector.get("Order") + scope = $rootScope.$new() + scope.Order = Order Navigation = $injector.get("Navigation") flash = $injector.get("flash") spyOn(Navigation, "go") # Stubbing out writes to window.location @@ -58,6 +62,18 @@ describe 'Order service', -> expect(storage.bind).toHaveBeenCalledWith({}, "Order.order.testy", {storeName: "#{prefix}_testy"}) expect(storage.bind).toHaveBeenCalledWith({}, "Order.ship_address_same_as_billing", {storeName: "#{prefix}_sameasbilling", defaultValue: true}) + it "binds order to local storage", -> + Order.bindFieldsToLocalStorage(scope) + prefix = "order_#{Order.order.id}#{Order.order.user_id}" + expect(localStorage.getItem("#{prefix}_email")).toMatch "test@test.com" + + it "does not store secrets in local storage", -> + Order.secrets = + card_number: "superfuckingsecret" + Order.bindFieldsToLocalStorage(scope) + keys = (localStorage.key(i) for i in [0..localStorage.length]) + for key in keys + expect(localStorage.getItem(key)).not.toMatch Order.secrets.card_number describe "with shipping method", -> beforeEach -> From 4a7609a83529cd1fdf2740011f17883c6b9f3981 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 11:17:53 +1000 Subject: [PATCH 089/130] Basic styling for checkout credit card form --- .../spree/checkout/payment/_gateway.html.haml | 18 +++++++++++++----- .../consumer/shopping/checkout_spec.rb | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/spree/checkout/payment/_gateway.html.haml b/app/views/spree/checkout/payment/_gateway.html.haml index 5cd25dafba..79e6725427 100644 --- a/app/views/spree/checkout/payment/_gateway.html.haml +++ b/app/views/spree/checkout/payment/_gateway.html.haml @@ -1,8 +1,16 @@ -= validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off" +.row + .small-6.columns + = validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off" + .small-6.columns + = validated_input "Security Code", "secrets.card_verification_value", required: true -%label{for: "secrets.card_month"} Expiry Date -%select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true} +.row + .small-12.columns + %label{for: "secrets.card_month"} Expiry Date -%select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true} +.row + .small-6.columns + %select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true} + .small-6.columns + %select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true} -= validated_input "CVV", "secrets.card_verification_value", required: true diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index dd84a1e8ca..fddda4e199 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -141,7 +141,7 @@ feature "As a consumer I want to check out my cart", js: true do fill_in 'Card Number', with: "4111111111111111" select 'February', from: 'secrets.card_month' select (Date.today.year+1).to_s, from: 'secrets.card_year' - fill_in 'CVV', with: '123' + fill_in 'Security Code', with: '123' place_order page.should have_content "Your order has been processed successfully" From f28d9f9d9bf4a180351d59a794c212cc1940fa7e Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 11:38:27 +1000 Subject: [PATCH 090/130] Fix distributor logo spec - Add a logo --- spec/features/consumer/shopping/shopping_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index ecc988f7ea..78937ecb47 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -20,6 +20,11 @@ feature "As a consumer I want to shop with a distributor", js: true do end it "shows a distributor with images" do + # Given the distributor has a logo + distributor.logo = File.new(Rails.root + 'app/assets/images/logo.jpg') + distributor.save! + + # Then we should see the distributor and its logo visit shop_path page.should have_text distributor.name find("#tab_about a").click From 2bedc431e8d1c076c6c80eb48651ae64523db377 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 13:43:41 +1000 Subject: [PATCH 091/130] Fix spec fragility - overlapping elements error --- .../admin/bulk_product_update_spec.rb | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index 0e15fbd2f4..f42993248c 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -134,7 +134,7 @@ feature %q{ v2 = FactoryGirl.create(:variant, product: p1, is_master: false, on_hand: 0, on_demand: true) visit '/admin/products/bulk_edit' - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should_not have_selector "span[name='on_hand']", text: "On demand", visible: true page.should have_field "variant_on_hand", with: "4" @@ -171,7 +171,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - all("a.view-variants").each{ |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_field "product_name", with: v1.product.name page.should have_field "product_name", with: v2.product.name @@ -185,7 +185,7 @@ feature %q{ v2 = FactoryGirl.create(:variant, product: p1, is_master: false, on_hand: 6) visit '/admin/products/bulk_edit' - all("a.view-variants").each{ |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_selector "span[name='on_hand']", text: "21" page.should have_field "variant_on_hand", with: "15" @@ -199,7 +199,7 @@ feature %q{ v2 = FactoryGirl.create(:variant, product: p1, is_master: false, price: 2.50) visit '/admin/products/bulk_edit' - all("a.view-variants").each{ |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_field "price", with: "2.0", visible: false page.should have_field "variant_price", with: "12.75" @@ -212,7 +212,7 @@ feature %q{ v2 = FactoryGirl.create(:variant, product: p1, is_master: false, price: 2.50, unit_value: 4800, unit_description: "(large bag)") visit '/admin/products/bulk_edit' - all("a.view-variants").each{ |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_field "variant_unit_value_with_description", with: "1.2 (small bag)" page.should have_field "variant_unit_value_with_description", with: "4.8 (large bag)" @@ -260,9 +260,9 @@ feature %q{ page.should have_selector 'a.add-variant', visible: true # When I add three variants - page.find('a.add-variant', visible: true).click - page.find('a.add-variant', visible: true).click - page.find('a.add-variant', visible: true).click + page.find('a.add-variant', visible: true).trigger('click') + page.find('a.add-variant', visible: true).trigger('click') + page.find('a.add-variant', visible: true).trigger('click') # They should be added, and should see no edit buttons page.all("tr.variant").count.should == 3 @@ -286,7 +286,7 @@ feature %q{ # And the variants should be saved visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_field "variant_unit_value_with_description", with: "4000 (12x250 mL bottles)" page.should have_field "variant_price", with: "4.0" @@ -368,14 +368,14 @@ feature %q{ page.should have_select "variant_unit_with_scale", selected: '' select "Weight (kg)", from: "variant_unit_with_scale" - first("a.view-variants").click + first("a.view-variants").trigger('click') fill_in "variant_unit_value_with_description", with: '123 abc' click_button 'Update' page.find("span#update-status-message").should have_content "Update complete" visit '/admin/products/bulk_edit' - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_select "variant_unit_with_scale", selected: "Weight (kg)" page.should have_field "variant_unit_value_with_description", with: "123 abc" @@ -434,7 +434,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_field "variant_price", with: "3.0" page.should have_field "variant_unit_value_with_description", with: "250 (bottle)" @@ -452,7 +452,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_field "variant_price", with: "4.0" page.should have_field "variant_on_hand", with: "10" @@ -467,7 +467,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_field "variant_price", with: "3.0" @@ -478,7 +478,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - first("a.view-variants").click + first("a.view-variants").trigger('click') page.should have_field "variant_price", with: "10.0" end From 05c62634fcad3ba610cc34f090539bebf3ac782e Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 14:49:41 +1000 Subject: [PATCH 092/130] Further overlapping elements fixes --- spec/features/admin/bulk_product_update_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index f42993248c..9e0f24cd15 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -596,7 +596,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - all("a.view-variants").each { |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_selector "a.delete-variant", :count => 3 @@ -606,7 +606,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - all("a.view-variants").select { |e| e.visible? }.each { |e| e.click } + all("a.view-variants").select { |e| e.visible? }.each { |e| e.trigger('click') } page.should have_selector "a.delete-variant", :count => 2 end @@ -636,7 +636,7 @@ feature %q{ visit '/admin/products/bulk_edit' page.should have_selector "a.view-variants" - all("a.view-variants").each { |e| e.click } + all("a.view-variants").each { |e| e.trigger('click') } page.should have_selector "a.edit-variant", :count => 3 From 2984cada53ac3d2fcc6978e96839f79a67431287 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 5 Jun 2014 15:51:23 +1000 Subject: [PATCH 093/130] Remove Admin link from left menu as this now lives in the drop-down menu for logged in users under Cog icon to right. --- app/views/shared/menu/_large_menu.html.haml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 4a81964211..3a019f49a1 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -24,13 +24,6 @@ %a{href: main_app.groups_path} %span.nav-primary Groups %li.divider - - if admin_user? or enterprise_user? - %li - %a{href: spree.admin_path} - %span.nav-primary - %i.ofn-i_021-tools - Admin - %li.divider %section.top-bar-section %ul.right %li.divider From 68311ca69962c673e8c9d4bc2b682d95b3826d0c Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 5 Jun 2014 15:53:23 +1000 Subject: [PATCH 094/130] Remove Facebook icon which appeared here - unnecessary. --- app/views/shared/_footer.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index 713c95c769..bdd51259c4 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -21,9 +21,7 @@ %h4 Getting around %ul.ofn-list %li - %a{href: "/shop"} - %i.ofn-i_044-facebook - Shop + %a{href: "/shop"} Shop %li %a{href: "/map"} Map %li From 7b1756fc98a547c06bd2ba64accb20dc95099650 Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 5 Jun 2014 16:19:35 +1000 Subject: [PATCH 095/130] Fix column layout issue for checkout page making content expand beyond page boundaries --- app/views/checkout/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/checkout/edit.html.haml b/app/views/checkout/edit.html.haml index ee5fdb7b52..b7a83bf09d 100644 --- a/app/views/checkout/edit.html.haml +++ b/app/views/checkout/edit.html.haml @@ -6,8 +6,8 @@ = render partial: "shopping_shared/details" - %accordion.row{"close-others" => "true"} - %checkout{"ng-controller" => "CheckoutCtrl"} + %accordion{"close-others" => "true"} + %checkout.row{"ng-controller" => "CheckoutCtrl"} .small-9.columns - unless spree_current_user = render partial: "checkout/authentication" From 3ae1eb863d4217aace490e7481be924f748c9bbc Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 5 Jun 2014 16:20:14 +1000 Subject: [PATCH 096/130] Update behaviour on Place Order Now button so it is disabled but not hidden when unavailable --- app/views/checkout/_form.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/checkout/_form.html.haml b/app/views/checkout/_form.html.haml index bd50200210..f1169505e9 100644 --- a/app/views/checkout/_form.html.haml +++ b/app/views/checkout/_form.html.haml @@ -10,7 +10,7 @@ -#%pre -#{{ Order.order}} - .small-12.columns + %div %h3.text-center.pad-top Checkout from = current_distributor.name @@ -20,7 +20,8 @@ = render partial: "checkout/shipping", locals: {f: f} = render partial: "checkout/payment", locals: {f: f} %p - %input.button.primary{type: :submit, - value: "Place order now", - "ng-click" => "purchase($event)", - "ng-show" => "checkout.$valid"} + %button.button.primary{type: :submit, + "ng-click" => "purchase($event)", + "ng-disabled" => "checkout.$invalid"} + Place order now + / {{ checkout.$valid }} From 590ac6aa6d43376758857ccf70ae2ac73d90bb99 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 12:56:54 +1000 Subject: [PATCH 097/130] Put orders and fulfilment report in grid layout --- .../reports/orders_and_fulfillment.html.haml | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml index 9d30ac445b..3b5d520978 100644 --- a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml +++ b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml @@ -1,33 +1,40 @@ = form_for @search, :url => spree.orders_and_fulfillment_admin_reports_path do |f| - = label_tag nil, t(:date_range) - %br - .date-range-filter + .row.date-range-filter + = label_tag nil, t(:date_range) + %br = label_tag nil, t(:start), :class => 'inline' = f.text_field :completed_at_gt, :class => 'datetimepicker datepicker-from' %span.range-divider %i.icon-arrow-right = f.text_field :completed_at_lt, :class => 'datetimepicker datepicker-to' = label_tag nil, t(:end), :class => 'inline' - %br - = label_tag nil, "Distributor: " - = f.collection_select(:distributor_id_eq, @distributors, :id, :name, :include_blank => @include_blank) - %br - = label_tag nil, "Supplier: " - = select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), :prompt => @include_blank) - %br - = label_tag nil, "Order Cycle: " - - order_cycles_select = [['No Order Cycle', '-1']] - - order_cycles_select += @order_cycles.collect {|oc| [ "#{oc.name}   (#{oc.orders_open_at.to_s(:short)} - #{oc.orders_close_at.to_s(:short)})".html_safe, oc.id ] } - = f.select(:order_cycle_id_eq, order_cycles_select, include_blank: @include_blank, selected: params[:q][:order_cycle_id_eq]) - %br - = label_tag nil, "Report Type: " - = select_tag(:report_type, options_for_select(@report_types, @report_type)) - %br - %br - = check_box_tag :csv - = label_tag :csv, "Download as csv" - %br + + .row + .alpha.two.columns= label_tag nil, "Distributor: " + .omega.fourteen.columns= f.collection_select(:distributor_id_eq, @distributors, :id, :name, :include_blank => @include_blank) + + .row + .alpha.two.columns= label_tag nil, "Supplier: " + .omega.fourteen.columns= select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), :prompt => @include_blank) + + .row + .alpha.two.columns= label_tag nil, "Order Cycle: " + .omega.fourteen.columns + - order_cycles_select = [['No Order Cycle', '-1']] + - order_cycles_select += @order_cycles.collect {|oc| [ "#{oc.name}   (#{oc.orders_open_at.to_s(:short)} - #{oc.orders_close_at.to_s(:short)})".html_safe, oc.id ] } + = f.select(:order_cycle_id_eq, order_cycles_select, include_blank: @include_blank, selected: params[:q][:order_cycle_id_eq]) + + .row + .alpha.two.columns= label_tag nil, "Report Type: " + .omega.fourteen.columns= select_tag(:report_type, options_for_select(@report_types, @report_type)) + + .row + = check_box_tag :csv + = label_tag :csv, "Download as csv" + + .row = button t(:search) + %br %br %table#listing_orders.index From f8fa01479681fa6e64c5a0a3d167c1113fd82428 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 14:29:40 +1000 Subject: [PATCH 098/130] LineItem.supplied_by_any --- app/models/spree/line_item_decorator.rb | 4 ++++ spec/models/spree/line_item_spec.rb | 28 +++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 32e54b6175..ba12d366be 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -18,4 +18,8 @@ Spree::LineItem.class_eval do joins(:product). where('spree_products.supplier_id = ?', enterprise) } + scope :supplied_by_any, lambda { |enterprises| + joins(:product). + where('spree_products.supplier_id IN (?)', enterprises) + } end diff --git a/spec/models/spree/line_item_spec.rb b/spec/models/spree/line_item_spec.rb index 1486b92aeb..ef25d139ac 100644 --- a/spec/models/spree/line_item_spec.rb +++ b/spec/models/spree/line_item_spec.rb @@ -3,21 +3,27 @@ require 'spec_helper' module Spree describe LineItem do describe "scopes" do + let(:o) { create(:order) } + + let(:s1) { create(:supplier_enterprise) } + let(:s2) { create(:supplier_enterprise) } + + let(:p1) { create(:simple_product, supplier: s1) } + let(:p2) { create(:simple_product, supplier: s2) } + + let(:li1) { create(:line_item, order: o, product: p1) } + let(:li2) { create(:line_item, order: o, product: p2) } + it "finds line items for products supplied by a particular enterprise" do - o = create(:order) - - s1 = create(:supplier_enterprise) - s2 = create(:supplier_enterprise) - - p1 = create(:simple_product, supplier: s1) - p2 = create(:simple_product, supplier: s2) - - li1 = create(:line_item, order: o, product: p1) - li2 = create(:line_item, order: o, product: p2) - LineItem.supplied_by(s1).should == [li1] LineItem.supplied_by(s2).should == [li2] end + + it "finds line items for products supplied by one of a number of enterprises" do + LineItem.supplied_by_any([s1]).should == [li1] + LineItem.supplied_by_any([s2]).should == [li2] + LineItem.supplied_by_any([s1, s2]).sort.should == [li1, li2].sort + end end end end From e5f0818065e97ba174076a23dffb0e7dd6b177e1 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 14:56:46 +1000 Subject: [PATCH 099/130] Order and fulfilment reports can filter by multiple hubs, producers and order cycles --- .../spree/admin/reports_controller_decorator.rb | 11 ++--------- .../reports/orders_and_fulfillment.html.haml | 15 +++++++-------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index 31ea232976..e28dc090ee 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -356,19 +356,12 @@ Spree::Admin::ReportsController.class_eval do end params[:q][:meta_sort] ||= "completed_at.desc" - q = params[:q].dup - if q[:order_cycle_id_eq] == '-1' - q[:order_cycle_id_null] = true - q[:order_cycle_id_eq] = nil - end - # -- Search - @search = Spree::Order.complete.not_state(:canceled).managed_by(spree_current_user).search(q) - + @search = Spree::Order.complete.not_state(:canceled).managed_by(spree_current_user).search(params[:q]) orders = @search.result @line_items = orders.map do |o| lis = o.line_items.managed_by(spree_current_user) - lis = lis.supplied_by(params[:supplier_id]) if params[:supplier_id].present? + lis = lis.supplied_by_any(params[:supplier_id_in]) if params[:supplier_id_in].present? lis end.flatten #payments = orders.map { |o| o.payments.select { |payment| payment.completed? } }.flatten # Only select completed payments diff --git a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml index 3b5d520978..62632d08ff 100644 --- a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml +++ b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml @@ -10,19 +10,18 @@ = label_tag nil, t(:end), :class => 'inline' .row - .alpha.two.columns= label_tag nil, "Distributor: " - .omega.fourteen.columns= f.collection_select(:distributor_id_eq, @distributors, :id, :name, :include_blank => @include_blank) + .alpha.two.columns= label_tag nil, "Distributors: " + .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Supplier: " - .omega.fourteen.columns= select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), :prompt => @include_blank) + .alpha.two.columns= label_tag nil, "Suppliers: " + .omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Order Cycle: " + .alpha.two.columns= label_tag nil, "Order Cycles: " .omega.fourteen.columns - - order_cycles_select = [['No Order Cycle', '-1']] - - order_cycles_select += @order_cycles.collect {|oc| [ "#{oc.name}   (#{oc.orders_open_at.to_s(:short)} - #{oc.orders_close_at.to_s(:short)})".html_safe, oc.id ] } - = f.select(:order_cycle_id_eq, order_cycles_select, include_blank: @include_blank, selected: params[:q][:order_cycle_id_eq]) + - order_cycles_select = @order_cycles.collect {|oc| [ "#{oc.name}   (#{oc.orders_open_at.to_s(:short)} - #{oc.orders_close_at.to_s(:short)})".html_safe, oc.id ] } + = f.select(:order_cycle_id_in, order_cycles_select, {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true}) .row .alpha.two.columns= label_tag nil, "Report Type: " From 1fab8c1e014645bba42e7d847626ddf4cc2db15d Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 15:02:54 +1000 Subject: [PATCH 100/130] In orders and fulfilment reports, rename distributor -> hub and supplier -> producer --- .../spree/admin/reports_controller_decorator.rb | 10 +++++----- .../admin/reports/orders_and_fulfillment.html.haml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index e28dc090ee..c6d4b07296 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -386,7 +386,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"] + header = ["Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"] columns = [ proc { |line_items| line_items.first.variant.product.supplier.name }, proc { |line_items| line_items.first.variant.product.name }, @@ -408,7 +408,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Supplier", "Product", "Variant", "To Distributor", "Amount", "Curr. Cost per Unit", "Total Cost", "Shipping Method"] + header = ["Producer", "Product", "Variant", "To Hub", "Amount", "Curr. Cost per Unit", "Total Cost", "Shipping Method"] columns = [ proc { |line_items| line_items.first.variant.product.supplier.name }, proc { |line_items| line_items.first.variant.product.name }, @@ -440,7 +440,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Distributor", "Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Total Shipping Cost", "Shipping Method"] + header = ["Hub", "Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Total Shipping Cost", "Shipping Method"] columns = [ proc { |line_items| line_items.first.order.distributor.name }, proc { |line_items| line_items.first.variant.product.supplier.name }, @@ -474,7 +474,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Distributor", "Customer", "Email", "Phone", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?", "Packed?", "Shipped?"] + header = ["Hub", "Customer", "Email", "Phone", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?", "Packed?", "Shipped?"] columns = [ proc { |line_items| line_items.first.order.distributor.name }, proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname }, @@ -516,7 +516,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"] + header = ["Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"] columns = [ proc { |line_items| line_items.first.variant.product.supplier.name }, proc { |line_items| line_items.first.variant.product.name }, diff --git a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml index 62632d08ff..0935c24cc7 100644 --- a/app/views/spree/admin/reports/orders_and_fulfillment.html.haml +++ b/app/views/spree/admin/reports/orders_and_fulfillment.html.haml @@ -10,11 +10,11 @@ = label_tag nil, t(:end), :class => 'inline' .row - .alpha.two.columns= label_tag nil, "Distributors: " + .alpha.two.columns= label_tag nil, "Hubs: " .omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true}) .row - .alpha.two.columns= label_tag nil, "Suppliers: " + .alpha.two.columns= label_tag nil, "Producers: " .omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true}) .row From 13e2da42eb70004c93b731f9b18675253b0d3e68 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 15:20:52 +1000 Subject: [PATCH 101/130] Add producer column, remove Packed? and Shipped? columns --- .../spree/admin/reports_controller_decorator.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index c6d4b07296..9657655735 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -474,20 +474,19 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Hub", "Customer", "Email", "Phone", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?", "Packed?", "Shipped?"] + header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?"] columns = [ proc { |line_items| line_items.first.order.distributor.name }, proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname }, proc { |line_items| line_items.first.order.email }, proc { |line_items| line_items.first.order.bill_address.phone }, + proc { |line_items| line_items.first.variant.product.supplier.name }, proc { |line_items| line_items.first.variant.product.name }, proc { |line_items| line_items.first.variant.options_text }, proc { |line_items| line_items.sum { |li| li.quantity } }, proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, proc { |line_items| "" }, proc { |line_items| "" }, - proc { |line_items| "" }, - proc { |line_items| "" }, proc { |line_items| "" } ] rules = [ { group_by: proc { |line_item| line_item.order.distributor }, @@ -498,15 +497,14 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| "" }, proc { |line_items| "" }, proc { |line_items| "" }, + proc { |line_items| "" }, proc { |line_items| "TOTAL" }, proc { |line_items| "" }, proc { |line_items| "" }, proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.ship_total } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.total } }, - proc { |line_items| line_items.map { |li| li.order.paid? }.all? { |paid| paid == true } ? "Yes" : "No" }, - proc { |line_items| "" }, - proc { |line_items| "" } ] }, + proc { |line_items| line_items.map { |li| li.order.paid? }.all? { |paid| paid == true } ? "Yes" : "No" } ] }, { group_by: proc { |line_item| line_item.variant.product }, sort_by: proc { |product| product.name } }, { group_by: proc { |line_item| line_item.variant }, From 673293f273974121a54c75317c6d788587fa432c Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 15:48:58 +1000 Subject: [PATCH 102/130] Add extra shipping columns --- .../admin/reports_controller_decorator.rb | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index 9657655735..d65a409d13 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -474,7 +474,11 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?"] + header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", + "Shipping", "Delivery?", "Ship street", "Ship street 2", "Ship city", "Ship postcode", "Ship state", + "Paid?"] + + rsa = proc { |line_items| line_items.first.order.shipping_method.andand.require_ship_address } columns = [ proc { |line_items| line_items.first.order.distributor.name }, proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname }, @@ -487,6 +491,16 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, proc { |line_items| "" }, proc { |line_items| "" }, + + proc { |line_items| line_items.first.order.shipping_method.andand.name }, + proc { |line_items| rsa.call(line_items) ? 'Y' : 'N' }, + + proc { |line_items| line_items.first.order.ship_address.andand.address1 if rsa.call(line_items) }, + proc { |line_items| line_items.first.order.ship_address.andand.address2 if rsa.call(line_items) }, + proc { |line_items| line_items.first.order.ship_address.andand.city if rsa.call(line_items) }, + proc { |line_items| line_items.first.order.ship_address.andand.zipcode if rsa.call(line_items) }, + proc { |line_items| line_items.first.order.ship_address.andand.state if rsa.call(line_items) }, + proc { |line_items| "" } ] rules = [ { group_by: proc { |line_item| line_item.order.distributor }, @@ -504,7 +518,16 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.ship_total } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.total } }, - proc { |line_items| line_items.map { |li| li.order.paid? }.all? { |paid| paid == true } ? "Yes" : "No" } ] }, + + proc { |line_items| "" }, + proc { |line_items| "" }, + proc { |line_items| "" }, + proc { |line_items| "" }, + proc { |line_items| "" }, + proc { |line_items| "" }, + proc { |line_items| "" }, + + proc { |line_items| line_items.all? { |li| li.order.paid? } ? "Yes" : "No" } ] }, { group_by: proc { |line_item| line_item.variant.product }, sort_by: proc { |product| product.name } }, { group_by: proc { |line_item| line_item.variant }, From 1a7b32d1ff6298e59c25bfadcdce602868afc610 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 16:02:09 +1000 Subject: [PATCH 103/130] Show hub and customer name on total row --- app/controllers/spree/admin/reports_controller_decorator.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index d65a409d13..f924d62676 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -494,7 +494,6 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| line_items.first.order.shipping_method.andand.name }, proc { |line_items| rsa.call(line_items) ? 'Y' : 'N' }, - proc { |line_items| line_items.first.order.ship_address.andand.address1 if rsa.call(line_items) }, proc { |line_items| line_items.first.order.ship_address.andand.address2 if rsa.call(line_items) }, proc { |line_items| line_items.first.order.ship_address.andand.city if rsa.call(line_items) }, @@ -507,8 +506,8 @@ Spree::Admin::ReportsController.class_eval do sort_by: proc { |distributor| distributor.name } }, { group_by: proc { |line_item| line_item.order }, sort_by: proc { |order| order.bill_address.lastname + " " + order.bill_address.firstname }, - summary_columns: [ proc { |line_items| "" }, - proc { |line_items| "" }, + summary_columns: [ proc { |line_items| line_items.first.order.distributor.name }, + proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname }, proc { |line_items| "" }, proc { |line_items| "" }, proc { |line_items| "" }, From 1d44cbf506c66df9553b8a1808c15df45f361992 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 16:52:39 +1000 Subject: [PATCH 104/130] Show distribution charge on report --- .../admin/reports_controller_decorator.rb | 4 ++- app/models/spree/order_decorator.rb | 8 ++++- spec/models/spree/order_spec.rb | 31 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index f924d62676..66f6b265a3 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -474,7 +474,7 @@ Spree::Admin::ReportsController.class_eval do table_items = @line_items @include_blank = 'All' - header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", + header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Dist ($)", "Ship ($)", "Total ($)", "Shipping", "Delivery?", "Ship street", "Ship street 2", "Ship city", "Ship postcode", "Ship state", "Paid?"] @@ -491,6 +491,7 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, proc { |line_items| "" }, proc { |line_items| "" }, + proc { |line_items| "" }, proc { |line_items| line_items.first.order.shipping_method.andand.name }, proc { |line_items| rsa.call(line_items) ? 'Y' : 'N' }, @@ -515,6 +516,7 @@ Spree::Admin::ReportsController.class_eval do proc { |line_items| "" }, proc { |line_items| "" }, proc { |line_items| line_items.sum { |li| li.quantity * li.price } }, + proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.distribution_total } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.ship_total } }, proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.total } }, diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index d37a84ce1d..9d38c19d20 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -127,7 +127,11 @@ Spree::Order.class_eval do end def line_item_variants - line_items.map { |li| li.variant } + line_items.map(&:variant) + end + + def distribution_total + adjustments.eligible.where(originator_type: 'EnterpriseFee').sum(&:amount) end # Show payment methods for this distributor @@ -140,6 +144,8 @@ Spree::Order.class_eval do def available_shipping_methods(display_on = nil) Spree::ShippingMethod.all_available(self, display_on) end + + private def shipping_address_from_distributor diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 4fe1eb4f64..8aea12af76 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -141,6 +141,37 @@ describe Spree::Order do end end + describe "getting the distribution charge" do + let(:o) { create(:order) } + let(:li) { create(:line_item, order: o) } + + it "returns the sum of eligible enterprise fee adjustments" do + ef = create(:enterprise_fee) + ef.calculator.set_preference :amount, 123.45 + a = ef.create_locked_adjustment("adjustment", li.order, li, true) + + o.distribution_total.should == 123.45 + end + + it "does not include ineligible adjustments" do + ef = create(:enterprise_fee) + ef.calculator.set_preference :amount, 123.45 + a = ef.create_locked_adjustment("adjustment", li.order, li, true) + + a.update_column :eligible, false + + o.distribution_total.should == 0 + end + + it "does not include adjustments that do not originate from enterprise fees" do + sm = create(:shipping_method) + sm.calculator.set_preference :amount, 123.45 + sm.create_adjustment("adjustment", li.order, li, true) + + o.distribution_total.should == 0 + end + end + describe "setting the distributor" do it "sets the distributor when no order cycle is set" do d = create(:distributor_enterprise) From 634af96a66d2f2837deb60a6479637ab37f12691 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 5 Jun 2014 17:02:50 +1000 Subject: [PATCH 105/130] Update reports controller spec for multi-order-cycle params --- spec/controllers/spree/admin/reports_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/spree/admin/reports_controller_spec.rb b/spec/controllers/spree/admin/reports_controller_spec.rb index 8b4d80fcab..0afe63c634 100644 --- a/spec/controllers/spree/admin/reports_controller_spec.rb +++ b/spec/controllers/spree/admin/reports_controller_spec.rb @@ -107,7 +107,7 @@ describe Spree::Admin::ReportsController do end it "only shows the selected order cycle" do - spree_get :orders_and_fulfillment, q: {order_cycle_id_eq: ocA.id} + spree_get :orders_and_fulfillment, q: {order_cycle_id_in: [ocA.id.to_s]} assigns(:search).result.should include(orderA1) assigns(:search).result.should_not include(orderB1) From 82ab14a33eb198f0e82d4d9f8d741b8c7bbf72e6 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 5 Jun 2014 12:18:26 +1000 Subject: [PATCH 106/130] Starting on on the map --- .../javascripts/darkswarm/all.js.coffee | 2 + .../controllers/map_controller.js.coffee | 7 + .../javascripts/darkswarm/darkswarm.js.coffee | 1 + .../services/map_configuration.js.coffee | 5 + app/assets/stylesheets/darkswarm/map.css.sass | 5 + app/controllers/map_controller.rb | 6 + app/helpers/map_helper.rb | 2 + app/views/layouts/darkswarm.html.haml | 3 +- app/views/map/index.html.haml | 5 + app/views/shared/menu/_large_menu.html.haml | 2 +- .../initializers/comfortable_mexican_sofa.rb | 1 + config/routes.rb | 2 + spec/controllers/map_controller_spec.rb | 8 + spec/helpers/map_helper_spec.rb | 15 + .../javascripts/angular-google-maps.min.js | 8 + .../assets/javascripts/lodash.underscore.js | 4979 +++++++++++++++++ 16 files changed, 5049 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee create mode 100644 app/assets/javascripts/darkswarm/services/map_configuration.js.coffee create mode 100644 app/assets/stylesheets/darkswarm/map.css.sass create mode 100644 app/controllers/map_controller.rb create mode 100644 app/helpers/map_helper.rb create mode 100644 app/views/map/index.html.haml create mode 100644 spec/controllers/map_controller_spec.rb create mode 100644 spec/helpers/map_helper_spec.rb create mode 100644 vendor/assets/javascripts/angular-google-maps.min.js create mode 100644 vendor/assets/javascripts/lodash.underscore.js diff --git a/app/assets/javascripts/darkswarm/all.js.coffee b/app/assets/javascripts/darkswarm/all.js.coffee index 2c07d069c4..4727f7282a 100644 --- a/app/assets/javascripts/darkswarm/all.js.coffee +++ b/app/assets/javascripts/darkswarm/all.js.coffee @@ -7,6 +7,8 @@ #= require angular-cookies #= require angular-sanitize #= require angular-resource +#= require lodash.underscore.js +#= require angular-google-maps.min.js #= require ../shared/mm-foundation-tpls-0.2.0-SNAPSHOT #= require ../shared/bindonce.min.js #= require ../shared/ng-infinite-scroll.min.js diff --git a/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee new file mode 100644 index 0000000000..5e35f3eb94 --- /dev/null +++ b/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee @@ -0,0 +1,7 @@ +Darkswarm.controller "MapCtrl", ($scope, MapConfiguration)-> + $scope.map = + center: + latitude: 45 + longitude: -73 + zoom: 8 + styles: MapConfiguration.options diff --git a/app/assets/javascripts/darkswarm/darkswarm.js.coffee b/app/assets/javascripts/darkswarm/darkswarm.js.coffee index 8d26384c14..2f07a327cb 100644 --- a/app/assets/javascripts/darkswarm/darkswarm.js.coffee +++ b/app/assets/javascripts/darkswarm/darkswarm.js.coffee @@ -6,6 +6,7 @@ window.Darkswarm = angular.module("Darkswarm", ["ngResource", 'angular-flash.service', 'templates', 'ngSanitize', + 'google-maps', 'backstretch']).config ($httpProvider, $tooltipProvider, $locationProvider, $anchorScrollProvider) -> $httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content') $httpProvider.defaults.headers.put['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content') diff --git a/app/assets/javascripts/darkswarm/services/map_configuration.js.coffee b/app/assets/javascripts/darkswarm/services/map_configuration.js.coffee new file mode 100644 index 0000000000..bdcd6c8346 --- /dev/null +++ b/app/assets/javascripts/darkswarm/services/map_configuration.js.coffee @@ -0,0 +1,5 @@ +Darkswarm.factory "MapConfiguration", -> + new class MapConfiguration + # From http://snazzymaps.com/style/15/subtle-grayscale + options: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}] + diff --git a/app/assets/stylesheets/darkswarm/map.css.sass b/app/assets/stylesheets/darkswarm/map.css.sass new file mode 100644 index 0000000000..fa51344f0f --- /dev/null +++ b/app/assets/stylesheets/darkswarm/map.css.sass @@ -0,0 +1,5 @@ +// Place all the styles related to the map controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ +.angular-google-map-container + height: 600px diff --git a/app/controllers/map_controller.rb b/app/controllers/map_controller.rb new file mode 100644 index 0000000000..e4c4627f5f --- /dev/null +++ b/app/controllers/map_controller.rb @@ -0,0 +1,6 @@ +class MapController < BaseController + layout 'darkswarm' + def index + @enterprises = Enterprise.visible + end +end diff --git a/app/helpers/map_helper.rb b/app/helpers/map_helper.rb new file mode 100644 index 0000000000..65a9561697 --- /dev/null +++ b/app/helpers/map_helper.rb @@ -0,0 +1,2 @@ +module MapHelper +end diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index a7598e24a5..794089a8dc 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -8,9 +8,11 @@ = favicon_link_tag "favicon.png" %link{href: "http://fonts.googleapis.com/css?family=Open+Sans:400,700", rel: "stylesheet", type: "text/css"}/ + = yield :scripts = stylesheet_link_tag "darkswarm/all" = javascript_include_tag "darkswarm/all" + = render "layouts/bugherd_script" = csrf_meta_tags @@ -30,4 +32,3 @@ = yield #footer - = yield :scripts diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml new file mode 100644 index 0000000000..06e4cda6b8 --- /dev/null +++ b/app/views/map/index.html.haml @@ -0,0 +1,5 @@ +- content_for :scripts do + %script{src: "//maps.googleapis.com/maps/api/js?sensor=false"} + +%map{"ng-controller" => "MapCtrl"} + %google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles"} diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 3a019f49a1..63b4a55928 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -13,7 +13,7 @@ %span.nav-primary Hubs %li.divider %li - %a{href: ""} + %a{href: map_path} %span.nav-primary Map %li.divider %li diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb index e526ab48ed..279648a093 100644 --- a/config/initializers/comfortable_mexican_sofa.rb +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -36,6 +36,7 @@ ComfortableMexicanSofa.configure do |config| # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem config.upload_file_options = { :storage => 's3', + :s3_protocol => :https, :s3_credentials => { :bucket => Spree::Config[:s3_bucket], :access_key_id => Spree::Config[:s3_access_key], diff --git a/config/routes.rb b/config/routes.rb index 973cb288cc..b0cf6c6f15 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,6 +3,8 @@ Openfoodnetwork::Application.routes.draw do get "/#/login", to: "home#index", as: :spree_login + get "/map", to: "map#index", as: :map + resource :shop, controller: "shop" do get :products post :order_cycle diff --git a/spec/controllers/map_controller_spec.rb b/spec/controllers/map_controller_spec.rb new file mode 100644 index 0000000000..dedb534b1b --- /dev/null +++ b/spec/controllers/map_controller_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe MapController do + it "loads all visible enterprises" do + Enterprise.should_receive(:visible) + get :index + end +end diff --git a/spec/helpers/map_helper_spec.rb b/spec/helpers/map_helper_spec.rb new file mode 100644 index 0000000000..32faad3d5a --- /dev/null +++ b/spec/helpers/map_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the MapHelper. For example: +# +# describe MapHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +describe MapHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/vendor/assets/javascripts/angular-google-maps.min.js b/vendor/assets/javascripts/angular-google-maps.min.js new file mode 100644 index 0000000000..84af2d8ff7 --- /dev/null +++ b/vendor/assets/javascripts/angular-google-maps.min.js @@ -0,0 +1,8 @@ +/*! angular-google-maps 1.1.0 2014-05-17 + * AngularJS directives for Google Maps + * git: https://github.com/nlaplante/angular-google-maps.git + */ +function InfoBox(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&(a.visible="undefined"==typeof a.isHidden?!0:!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function ClusterIcon(a,b){a.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=b,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function Cluster(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,a.getStyles())}function MarkerClusterer(a,b,c){this.extend(MarkerClusterer,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.imagePath_=c.imagePath||MarkerClusterer.IMAGE_PATH,this.imageExtension_=c.imageExtension||MarkerClusterer.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||MarkerClusterer.IMAGE_SIZES,this.calculator_=c.calculator||MarkerClusterer.CALCULATOR,this.batchSize_=c.batchSize||MarkerClusterer.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function inherits(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function MarkerLabel_(a,b){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=MarkerLabel_.getSharedCross(b)}function MarkerWithLabel(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new MarkerLabel_(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}(function(){angular.module("google-maps.directives.api.utils",[]),angular.module("google-maps.directives.api.managers",[]),angular.module("google-maps.directives.api.models.child",["google-maps.directives.api.utils"]),angular.module("google-maps.directives.api.models.parent",["google-maps.directives.api.managers","google-maps.directives.api.models.child"]),angular.module("google-maps.directives.api",["google-maps.directives.api.models.parent"]),angular.module("google-maps",["google-maps.directives.api"]).factory("debounce",["$timeout",function(a){return function(b){var c;return c=0,function(){var d,e,f;return f=this,d=arguments,c++,e=function(a){return function(){return a===c?b.apply(f,d):void 0}}(c),a(e,0,!0)}}}])}).call(this),function(){angular.element(document).ready(function(){return(google||("undefined"!=typeof google&&null!==google?google.maps:void 0)||null!=google.maps.InfoWindow)&&(google.maps.InfoWindow.prototype._open=google.maps.InfoWindow.prototype.open,google.maps.InfoWindow.prototype._close=google.maps.InfoWindow.prototype.close,google.maps.InfoWindow.prototype._isOpen=!1,google.maps.InfoWindow.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},google.maps.InfoWindow.prototype.close=function(){this._isOpen=!1,this._close()},google.maps.InfoWindow.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},window.InfoBox)?(window.InfoBox.prototype._open=window.InfoBox.prototype.open,window.InfoBox.prototype._close=window.InfoBox.prototype.close,window.InfoBox.prototype._isOpen=!1,window.InfoBox.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},window.InfoBox.prototype.close=function(){this._isOpen=!1,this._close()},window.InfoBox.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a}):void 0})}.call(this),function(){_.intersectionObjects=function(a,b,c){var d;return null==c&&(c=void 0),d=_.map(a,function(a){return _.find(b,function(b){return null!=c?c(a,b):_.isEqual(a,b)})}),_.filter(d,function(a){return null!=a})},_.containsObject=_.includeObject=function(a,b,c){return null==c&&(c=void 0),null===a?!1:_.any(a,function(a){return null!=c?c(a,b):_.isEqual(a,b)})},_.differenceObjects=function(a,b,c){return null==c&&(c=void 0),_.filter(a,function(a){return!_.containsObject(b,a)})},_.withoutObjects=function(a,b){return _.differenceObjects(a,b)},_.indexOfObject=function(a,b,c,d){var e,f;if(null==a)return-1;if(e=0,f=a.length,d){if("number"!=typeof d)return e=_.sortedIndex(a,b),a[e]===b?e:-1;e=0>d?Math.max(0,f+d):d}for(;f>e;){if(null!=c){if(c(a[e],b))return e}else if(_.isEqual(a[e],b))return e;e++}return-1},_["extends"]=function(a){return _.reduce(a,function(a,b){return _.extend(a,b)},{})}}.call(this),function(){var a;a={each:function(a,b,c,d,e,f){var g;return null==e&&(e=100),null==f&&(f=0),void 0===a||(null!=a?a.length:void 0)<=0?void c():(g=function(){var h,i;for(h=e,i=f;h--&&ib;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("google-maps.directives.api.utils").factory("BaseObject",function(){var b,c;return c=["extended","included"],b=function(){function b(){}return b.extend=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this[d]=e);return null!=(f=b.extended)&&f.apply(this),this},b.include=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this.prototype[d]=e);return null!=(f=b.included)&&f.apply(this),this},b}()})}.call(this),function(){angular.module("google-maps.directives.api.utils").factory("ChildEvents",function(){return{onChildCreation:function(){}}})}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.utils").factory("FitHelper",["BaseObject","Logger",function(a){var c,d;return c=function(a){function c(){return d=c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.fit=function(a,b){var c,d;return b&&a&&a.length>0?(c=new google.maps.LatLngBounds,d=!1,_async.each(a,function(a){return a?(d||(d=!0),c.extend(a.getPosition())):void 0},function(){return d?b.fitBounds(c):void 0})):void 0},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.utils").service("GmapUtil",["Logger","$compile",function(a,b){var c,d;return c=function(a){return Array.isArray(a)&&2===a.length?new google.maps.LatLng(a[1],a[0]):angular.isDefined(a.type)&&"Point"===a.type?new google.maps.LatLng(a.coordinates[1],a.coordinates[0]):new google.maps.LatLng(a.latitude,a.longitude)},d=function(a){if(angular.isUndefined(a))return!1;if(_.isArray(a)){if(2===a.length)return!0}else if(null!=a&&(null!=a?a.type:void 0)){if("Point"===a.type&&_.isArray(a.coordinates)&&2===a.coordinates.length)return!0}else if(a&&angular.isDefined((null!=a?a.latitude:void 0)&&angular.isDefined(null!=a?a.longitude:void 0)))return!0;return!1},{getLabelPositionPoint:function(a){var b,c;return void 0===a?void 0:(a=/^([-\d\.]+)\s([-\d\.]+)$/.exec(a),b=parseFloat(a[1]),c=parseFloat(a[2]),null!=b&&null!=c?new google.maps.Point(b,c):void 0)},createMarkerOptions:function(a,b,e,f){var g;return null==f&&(f=void 0),null==e&&(e={}),g=angular.extend({},e,{position:null!=e.position?e.position:c(a),icon:null!=e.icon?e.icon:b,visible:null!=e.visible?e.visible:d(a)}),null!=f&&(g.map=f),g},createWindowOptions:function(d,e,f,g){return null!=f&&null!=g&&null!=b?angular.extend({},g,{content:this.buildContent(e,g,f),position:null!=g.position?g.position:angular.isObject(d)?d.getPosition():c(e.coords)}):g?g:(a.error("infoWindow defaults not defined"),f?void 0:a.error("infoWindow content not defined"))},buildContent:function(a,c,d){var e,f;return null!=c.content?f=c.content:null!=b?(e=b(d)(a),e.length>0&&(f=e[0])):f=d,f},defaultDelay:50,isTrue:function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},isFalse:function(a){return-1!==["false","FALSE",0,"n","N","no","NO"].indexOf(a)},getCoords:c,validateCoords:d,validatePath:function(a){var b,c;if(c=0,angular.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;cc;c++)b=a[c],e.push(this.add(b));return e},f.prototype.remove=function(a,b){var c,d;return this.handleOptDraw(a,b,!1),b?(c=void 0,null!=this.gMarkers.indexOf?c=this.gMarkers.indexOf(a):(d=0,_.find(this.gMarkers,function(b){d+=1,b===a&&(c=d)})),null!=c?this.gMarkers.splice(c,1):void 0):void 0},f.prototype.removeMany=function(){var a=this;return this.gMarkers.forEach(function(b){return a.remove(b)})},f.prototype.draw=function(){var a,b=this;return a=[],this.gMarkers.forEach(function(c){return c.isDrawn?void 0:c.doAdd?c.setMap(b.gMap):a.push(c)}),a.forEach(function(a){return b.remove(a,!0)})},f.prototype.clear=function(){var a,b,c,d;for(d=this.gMarkers,b=0,c=d.length;c>b;b++)a=d[b],a.setMap(null);return delete this.gMarkers,this.gMarkers=[]},f.prototype.handleOptDraw=function(a,b,c){return b===!0?(a.setMap(c?this.gMap:null),a.isDrawn=!0):(a.isDrawn=!1,a.doAdd=c)},f.prototype.fit=function(){return f.__super__.fit.call(this,this.gMarkers,this.gMap)},f}(d)}])}.call(this),function(){angular.module("google-maps").factory("array-sync",["add-events",function(a){return function(b,c,d){var e,f,g,h,i,j,k,l,m;return h=!1,l=c.$eval(d),c["static"]||(i={set_at:function(a){var c;if(!h&&(c=b.getAt(a)))return c.lng&&c.lat?(l[a].latitude=c.lat(),l[a].longitude=c.lng()):l[a]=c},insert_at:function(a){var c;if(!h&&(c=b.getAt(a)))return c.lng&&c.lat?l.splice(a,0,{latitude:c.lat(),longitude:c.lng()}):l.splice(a,0,c)},remove_at:function(a){return h?void 0:l.splice(a,1)}},"Polygon"===l.type?e=l.coordinates[0]:"LineString"===l.type&&(e=l.coordinates),f={set_at:function(a){var c;if(!h&&(c=b.getAt(a),c&&c.lng&&c.lat))return e[a][1]=c.lat(),e[a][0]=c.lng()},insert_at:function(a){var c;if(!h&&(c=b.getAt(a),c&&c.lng&&c.lat))return e.splice(a,0,[c.lng(),c.lat()])},remove_at:function(a){return h?void 0:e.splice(a,1)}},k=a(b,angular.isUndefined(l.type)?i:f)),j=function(a){var c,d,e,f,g,i,j;if(h=!0,g=b,a){for(c=0,i=g.getLength(),e=a.length,d=Math.min(i,e),f=void 0;d>c;)j=g.getAt(c),f=a[c],"function"==typeof f.equals?f.equals(j)||g.setAt(c,f):(j.lat()!==f.latitude||j.lng()!==f.longitude)&&g.setAt(c,new google.maps.LatLng(f.latitude,f.longitude)),c++;for(;e>c;)f=a[c],g.push("function"==typeof f.lat&&"function"==typeof f.lng?f:new google.maps.LatLng(f.latitude,f.longitude)),c++;for(;i>c;)g.pop(),c++}return h=!1},g=function(a){var c,d,e,f,g,i,j,k;if(h=!0,i=b,a){for("Polygon"===l.type?c=a.coordinates[0]:"LineString"===l.type&&(c=a.coordinates),d=0,j=i.getLength(),f=c.length,e=Math.min(j,f),g=void 0;e>d;)k=i.getAt(d),g=c[d],(k.lat()!==g[1]||k.lng()!==g[0])&&i.setAt(d,new google.maps.LatLng(g[1],g[0])),d++;for(;f>d;)g=c[d],i.push(new google.maps.LatLng(g[1],g[0])),d++;for(;j>d;)i.pop(),d++}return h=!1},c["static"]||(m=angular.isUndefined(l.type)?c.$watchCollection(d,j):c.$watch(d,g)),function(){return k&&(k(),k=null),m?(m(),m=null):void 0}}}])}.call(this),function(){angular.module("google-maps").factory("add-events",["$timeout",function(a){var b,c;return b=function(b,c,d){return google.maps.event.addListener(b,c,function(){return d.apply(this,arguments),a(function(){},!0)})},c=function(a,c,d){var e;return d?b(a,c,d):(e=[],angular.forEach(c,function(c,d){return e.push(b(a,d,c))}),function(){return angular.forEach(e,function(a){return google.maps.event.removeListener(a)}),e=null})}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child").factory("MarkerLabelChildModel",["BaseObject","GmapUtil",function(b,d){var e;return e=function(b){function e(b,c){this.destroy=a(this.destroy,this),this.draw=a(this.draw,this),this.setPosition=a(this.setPosition,this),this.setZIndex=a(this.setZIndex,this),this.setVisible=a(this.setVisible,this),this.setAnchor=a(this.setAnchor,this),this.setMandatoryStyles=a(this.setMandatoryStyles,this),this.setStyles=a(this.setStyles,this),this.setContent=a(this.setContent,this),this.setTitle=a(this.setTitle,this),this.getSharedCross=a(this.getSharedCross,this);var d,f,g;e.__super__.constructor.call(this),d=this,this.marker=b,this.marker.set("labelContent",c.labelContent),this.marker.set("labelAnchor",this.getLabelPositionPoint(c.labelAnchor)),this.marker.set("labelClass",c.labelClass||"labels"),this.marker.set("labelStyle",c.labelStyle||{opacity:100}),this.marker.set("labelInBackground",c.labelInBackground||!1),c.labelVisible||this.marker.set("labelVisible",!0),c.raiseOnDrag||this.marker.set("raiseOnDrag",!0),c.clickable||this.marker.set("clickable",!0),c.draggable||this.marker.set("draggable",!1),c.optimized||this.marker.set("optimized",!1),c.crossImage=null!=(f=c.crossImage)?f:document.location.protocol+"//maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",c.handCursor=null!=(g=c.handCursor)?g:document.location.protocol+"//maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",this.markerLabel=new MarkerLabel_(this.marker,c.crossImage,c.handCursor),this.marker.set("setMap",function(a){return google.maps.Marker.prototype.setMap.apply(this,arguments),d.markerLabel.setMap(a)}),this.marker.setMap(this.marker.getMap())}return c(e,b),e.include(d),e.prototype.getSharedCross=function(a){return this.markerLabel.getSharedCross(a)},e.prototype.setTitle=function(){return this.markerLabel.setTitle()},e.prototype.setContent=function(){return this.markerLabel.setContent()},e.prototype.setStyles=function(){return this.markerLabel.setStyles()},e.prototype.setMandatoryStyles=function(){return this.markerLabel.setMandatoryStyles()},e.prototype.setAnchor=function(){return this.markerLabel.setAnchor()},e.prototype.setVisible=function(){return this.markerLabel.setVisible()},e.prototype.setZIndex=function(){return this.markerLabel.setZIndex()},e.prototype.setPosition=function(){return this.markerLabel.setPosition()},e.prototype.draw=function(){return this.markerLabel.draw()},e.prototype.destroy=function(){return null!=this.markerLabel.labelDiv_.parentNode&&null!=this.markerLabel.eventDiv_.parentNode?this.markerLabel.onRemove():void 0},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child").factory("MarkerChildModel",["ModelKey","GmapUtil","Logger","$injector","MarkerEventHelper",function(b,d,e,f,g){var h;return h=function(b){function h(b,c,d,f,g,i,j,k){var l,m=this;this.model=b,this.parentScope=c,this.gMap=d,this.$timeout=f,this.defaults=g,this.doClick=i,this.gMarkerManager=j,this.idKey=k,this.watchDestroy=a(this.watchDestroy,this),this.setLabelOptions=a(this.setLabelOptions,this),this.isLabelDefined=a(this.isLabelDefined,this),this.setOptions=a(this.setOptions,this),this.setIcon=a(this.setIcon,this),this.setCoords=a(this.setCoords,this),this.destroy=a(this.destroy,this),this.maybeSetScopeValue=a(this.maybeSetScopeValue,this),this.createMarker=a(this.createMarker,this),this.setMyScope=a(this.setMyScope,this),l=this,this.model[this.idKey]&&(this.id=this.model[this.idKey]),this.iconKey=this.parentScope.icon,this.coordsKey=this.parentScope.coords,this.clickKey=this.parentScope.click(),this.labelContentKey=this.parentScope.labelContent,this.optionsKey=this.parentScope.options,this.labelOptionsKey=this.parentScope.labelOptions,h.__super__.constructor.call(this,this.parentScope.$new(!1)),this.scope.model=this.model,this.setMyScope(this.model,void 0,!0),this.createMarker(this.model),this.scope.$watch("model",function(a,b){return a!==b?m.setMyScope(a,b):void 0},!0),this.$log=e,this.$log.info(l),this.watchDestroy(this.scope)}return c(h,b),h.include(d),h.include(g),h.prototype.setMyScope=function(a,b,c){var d=this;return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("icon",a,b,this.iconKey,this.evalModelHandle,c,this.setIcon),this.maybeSetScopeValue("coords",a,b,this.coordsKey,this.evalModelHandle,c,this.setCoords),this.maybeSetScopeValue("labelContent",a,b,this.labelContentKey,this.evalModelHandle,c),_.isFunction(this.clickKey)&&f?this.scope.click=function(){return f.invoke(d.clickKey,void 0,{$markerModel:a})}:(this.maybeSetScopeValue("click",a,b,this.clickKey,this.evalModelHandle,c),this.createMarker(a,b,c))},h.prototype.createMarker=function(a,b,c){var d=this;return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("options",a,b,this.optionsKey,function(a,b){var c;return void 0===a?void 0:(c="self"===b?a:a[b],void 0===c?c=void 0===b?d.defaults:d.scope.options:c)},c,this.setOptions)},h.prototype.maybeSetScopeValue=function(a,b,c,d,e,f,g){var h,i;return null==g&&(g=void 0),void 0===c?(this.scope[a]=e(b,d),void(f||null!=g&&g(this.scope))):(i=e(c,d),h=e(b,d),h===i||this.scope[a]===h||(this.scope[a]=h,f)?void 0:(null!=g&&g(this.scope),this.gMarkerManager.draw()))},h.prototype.destroy=function(){return this.scope.$destroy()},h.prototype.setCoords=function(a){return a.$id===this.scope.$id&&void 0!==this.gMarker?null!=a.coords?this.validateCoords(this.scope.coords)?(this.gMarker.setPosition(this.getCoords(a.coords)),this.gMarker.setVisible(this.validateCoords(a.coords)),this.gMarkerManager.remove(this.gMarker),this.gMarkerManager.add(this.gMarker)):void this.$log.error("MarkerChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(this.model)):this.gMarkerManager.remove(this.gMarker):void 0},h.prototype.setIcon=function(a){return a.$id===this.scope.$id&&void 0!==this.gMarker?(this.gMarkerManager.remove(this.gMarker),this.gMarker.setIcon(a.icon),this.gMarkerManager.add(this.gMarker),this.gMarker.setPosition(this.getCoords(a.coords)),this.gMarker.setVisible(this.validateCoords(a.coords))):void 0},h.prototype.setOptions=function(a){var b,c=this;if(a.$id===this.scope.$id&&(null!=this.gMarker&&(this.gMarkerManager.remove(this.gMarker),delete this.gMarker),null!=(b=a.coords)?b:"function"==typeof a.icon?a.icon(null!=a.options):void 0))return this.opts=this.createMarkerOptions(a.coords,a.icon,a.options),delete this.gMarker,this.gMarker=this.isLabelDefined(a)?new MarkerWithLabel(this.setLabelOptions(this.opts,a)):new google.maps.Marker(this.opts),this.setEvents(this.gMarker,this.parentScope,this.model),this.id&&(this.gMarker.key=this.id),this.gMarkerManager.add(this.gMarker),google.maps.event.addListener(this.gMarker,"click",function(){return c.doClick&&null!=c.scope.click?c.scope.click():void 0})},h.prototype.isLabelDefined=function(a){return null!=a.labelContent},h.prototype.setLabelOptions=function(a,b){return a.labelAnchor=this.getLabelPositionPoint(b.labelAnchor),a.labelClass=b.labelClass,a.labelContent=b.labelContent,a},h.prototype.watchDestroy=function(a){var b=this;return a.$on("$destroy",function(){var a,c;return null!=b.gMarker&&(google.maps.event.clearListeners(b.gMarker,"click"),(null!=(c=b.parentScope)?c.events:void 0)&&_.isArray(b.parentScope.events)&&b.parentScope.events.forEach(function(a,b){return google.maps.event.clearListeners(this.gMarker,b)}),b.gMarkerManager.remove(b.gMarker,!0),delete b.gMarker),a=void 0})},h}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("PolylineChildModel",["BaseObject","Logger","$timeout","array-sync","GmapUtil",function(b,d,e,f,g){var h,i;return h=d,i=function(b){function d(b,c,d,e,g){var i,j,k,l=this;this.scope=b,this.attrs=c,this.map=d,this.defaults=e,this.model=g,this.buildOpts=a(this.buildOpts,this),k=this,j=this.convertPathPoints(this.scope.path),this.polyline=new google.maps.Polyline(this.buildOpts(j)),this.isTrue(this.attrs.fit)&&extendMapBounds(d,j),!b["static"]&&angular.isDefined(b.editable)&&b.$watch("editable",function(a,b){return a!==b?this.polyline.setEditable(a):void 0}),angular.isDefined(b.draggable)&&b.$watch("draggable",function(a,b){return a!==b?this.polyline.setDraggable(a):void 0}),angular.isDefined(b.visible)&&b.$watch("visible",function(a,b){return a!==b?this.polyline.setVisible(a):void 0}),angular.isDefined(b.geodesic)&&b.$watch("geodesic",function(a,b){return a!==b?this.polyline.setOptions(this.buildOpts(this.polyline.getPath())):void 0 +}),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.weight)&&b.$watch("stroke.weight",function(a,b){return a!==b?this.polyline.setOptions(this.buildOpts(this.polyline.getPath())):void 0}),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.color)&&b.$watch("stroke.color",function(a,b){return a!==b?this.polyline.setOptions(this.buildOpts(this.polyline.getPath())):void 0}),angular.isDefined(b.icons)&&b.$watch("icons",function(a,b){return a!==b?this.polyline.setOptions(this.buildOpts(this.polyline.getPath())):void 0}),i=f(this.polyline.getPath(),b,"path"),b.$on("$destroy",function(){return l.polyline.setMap(null),l.polyline=null,l.scope=null,i?(i(),i=null):void 0}),h.info(this)}return c(d,b),d.include(g),d.prototype.buildOpts=function(a){var b,c=this;return b=angular.extend({},this.defaults,{map:this.map,path:a,icons:this.scope.icons,strokeColor:this.scope.stroke&&this.scope.stroke.color,strokeOpacity:this.scope.stroke&&this.scope.stroke.opacity,strokeWeight:this.scope.stroke&&this.scope.stroke.weight}),angular.forEach({clickable:!0,draggable:!1,editable:!1,geodesic:!1,visible:!0,"static":!1},function(a,d){return b[d]=angular.isUndefined(c.scope[d])||null===c.scope[d]?a:c.scope[d]}),b["static"]&&(b.editable=!1),b},d.prototype.destroy=function(){return this.scope.$destroy()},d}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child").factory("WindowChildModel",["BaseObject","GmapUtil","Logger","$compile","$http","$templateCache",function(b,d,e,f,g,h){var i;return i=function(b){function i(b,c,d,f,g,h,i,j,k){this.model=b,this.scope=c,this.opts=d,this.isIconVisibleOnClick=f,this.mapCtrl=g,this.markerCtrl=h,this.element=i,this.needToManualDestroy=null!=j?j:!1,this.markerIsVisibleAfterWindowClose=null!=k?k:!0,this.destroy=a(this.destroy,this),this.remove=a(this.remove,this),this.hideWindow=a(this.hideWindow,this),this.getLatestPosition=a(this.getLatestPosition,this),this.showWindow=a(this.showWindow,this),this.handleClick=a(this.handleClick,this),this.watchCoords=a(this.watchCoords,this),this.watchShow=a(this.watchShow,this),this.createGWin=a(this.createGWin,this),this.watchElement=a(this.watchElement,this),this.googleMapsHandles=[],this.$log=e,this.createGWin(),null!=this.markerCtrl&&this.markerCtrl.setClickable(!0),this.handleClick(),this.watchElement(),this.watchShow(),this.watchCoords(),this.$log.info(this)}return c(i,b),i.include(d),i.prototype.watchElement=function(){var a=this;return this.scope.$watch(function(){var b;if(a.element&&a.html)return a.html!==a.element.html()&&a.gWin?(null!=(b=a.opts)&&(b.content=void 0),a.remove(),a.createGWin(),a.showHide()):void 0})},i.prototype.createGWin=function(){var a,b=this;return null==this.gWin&&(a={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),a=this.opts),this.element&&(this.html=_.isObject(this.element)?this.element.html():this.element),this.opts=this.createWindowOptions(this.markerCtrl,this.scope,this.html,a)),null==this.opts||this.gWin?void 0:(this.gWin=this.opts.boxClass&&window.InfoBox&&"function"==typeof window.InfoBox?new window.InfoBox(this.opts):new google.maps.InfoWindow(this.opts),this.googleMapsHandles.push(google.maps.event.addListener(this.gWin,"closeclick",function(){var a;return null!=(a=b.markerCtrl)&&a.setVisible(b.markerIsVisibleAfterWindowClose),b.gWin.isOpen(!1),null!=b.scope.closeClick?b.scope.closeClick():void 0})))},i.prototype.watchShow=function(){var a=this;return this.scope.$watch("show",function(b,c){return b!==c?b?a.showWindow():a.hideWindow():null!=a.gWin&&b&&!a.gWin.getMap()?a.showWindow():void 0},!0)},i.prototype.watchCoords=function(){var a,b=this;return a=null!=this.markerCtrl?this.scope.$parent:this.scope,a.$watch("coords",function(a,c){var d;if(a!==c){if(null==a)return b.hideWindow();if(!b.validateCoords(a))return void b.$log.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(b.model));if(d=b.getCoords(a),b.gWin.setPosition(d),b.opts)return b.opts.position=d}},!0)},i.prototype.handleClick=function(){var a=this;return null!=this.markerCtrl?this.googleMapsHandles.push(google.maps.event.addListener(this.markerCtrl,"click",function(){var b;return null==a.gWin&&a.createGWin(),b=a.markerCtrl.getPosition(),null!=a.gWin&&(a.gWin.setPosition(b),a.opts&&(a.opts.position=b),a.showWindow()),a.initialMarkerVisibility=a.markerCtrl.getVisible(),a.markerCtrl.setVisible(a.isIconVisibleOnClick)})):void 0},i.prototype.showWindow=function(){var a,b=this;return a=function(){return!b.gWin||!b.scope.show&&null!=b.scope.show||b.gWin.isOpen()?void 0:b.gWin.open(b.mapCtrl)},this.scope.templateUrl?(this.gWin&&g.get(this.scope.templateUrl,{cache:h}).then(function(a){var c,d;return d=b.scope.$new(),angular.isDefined(b.scope.templateParameter)&&(d.parameter=b.scope.templateParameter),c=f(a.data)(d),b.gWin.setContent(c[0])}),a()):a()},i.prototype.showHide=function(){return this.scope.show?this.showWindow():this.hideWindow()},i.prototype.getLatestPosition=function(){return null!=this.gWin&&null!=this.markerCtrl?this.gWin.setPosition(this.markerCtrl.getPosition()):void 0},i.prototype.hideWindow=function(){return null!=this.gWin&&this.gWin.isOpen()?this.gWin.close():void 0},i.prototype.remove=function(){return this.hideWindow(),_.each(this.googleMapsHandles,function(a){return google.maps.event.removeListener(a)}),this.googleMapsHandles.length=0,delete this.gWin},i.prototype.destroy=function(a){var b;return null==a&&(a=!1),this.remove(),null!=this.scope&&(this.needToManualDestroy||a)&&this.scope.$destroy(),b=void 0},i}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("IMarkerParentModel",["ModelKey","Logger",function(b,d){var e;return e=function(b){function e(b,c,f,g,h){var i,j=this;if(this.scope=b,this.element=c,this.attrs=f,this.mapCtrl=g,this.$timeout=h,this.linkInit=a(this.linkInit,this),this.onDestroy=a(this.onDestroy,this),this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),this.onTimeOut=a(this.onTimeOut,this),e.__super__.constructor.call(this,this.scope),i=this,this.$log=d,!this.validateScope(b))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=angular.isDefined(f.click),null!=b.options&&(this.DEFAULTS=b.options),this.$timeout(function(){return j.onTimeOut(b),j.watch("coords",j.scope),j.watch("icon",j.scope),j.watch("options",j.scope),b.$on("$destroy",function(){return j.onDestroy(b)})})}return c(e,b),e.prototype.DEFAULTS={},e.prototype.onTimeOut=function(){},e.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},e.prototype.watch=function(a,b){var c,d=this;return c=function(c,e){return c!==e?d.onWatch(a,b,c,e):void 0},b.$watch(a,c,!0)},e.prototype.onWatch=function(){throw new String("OnWatch Not Implemented!!")},e.prototype.onDestroy=function(){throw new String("OnDestroy Not Implemented!!")},e.prototype.linkInit=function(){throw new String("LinkInit Not Implemented!!")},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent").factory("IWindowParentModel",["ModelKey","GmapUtil","Logger",function(a,c,d){var e;return e=function(a){function e(a,b,c,f,g,h,i,j){var k;e.__super__.constructor.call(this,a),k=this,this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,null!=a.options&&(this.DEFAULTS=a.options)}return b(e,a),e.include(c),e.prototype.DEFAULTS={},e}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("LayerParentModel",["BaseObject","Logger",function(b,d){var e;return e=function(b){function e(b,c,e,f,g,h,i){var j=this;return this.scope=b,this.element=c,this.attrs=e,this.mapCtrl=f,this.$timeout=g,this.onLayerCreated=null!=h?h:void 0,this.$log=null!=i?i:d,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.gMap=void 0,this.doShow=!0,void this.$timeout(function(){return j.gMap=f.getMap(),angular.isDefined(j.attrs.show)&&(j.doShow=j.scope.show),j.doShow&&null!=j.gMap&&j.layer.setMap(j.gMap),j.scope.$watch("show",function(a,b){return a!==b?(j.doShow=a,j.layer.setMap(a?j.gMap:null)):void 0},!0),j.scope.$watch("options",function(a,b){return a!==b?(j.layer.setMap(null),j.layer=null,j.createGoogleLayer()):void 0},!0),j.scope.$on("$destroy",function(){return j.layer.setMap(null)})}))}return c(e,b),e.prototype.createGoogleLayer=function(){var a=this;return this.layer=null==this.attrs.options?void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),this.$timeout(function(){var b;return null!=a.layer&&null!=a.onLayerCreated&&(b=a.onLayerCreated(a.scope,a.layer))?b(a.layer):void 0})},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("MarkerParentModel",["IMarkerParentModel","GmapUtil","MarkerEventHelper",function(b,d,e){var f;return f=function(b){function f(b,c,d,e,g,h,i){var j;this.gMarkerManager=h,this.doFit=i,this.onDestroy=a(this.onDestroy,this),this.setGMarker=a(this.setGMarker,this),this.onWatch=a(this.onWatch,this),this.onTimeOut=a(this.onTimeOut,this),f.__super__.constructor.call(this,b,c,d,e,g),j=this}return c(f,b),f.include(d),f.include(e),f.prototype.onTimeOut=function(a){var b,c=this;return b=this.createMarkerOptions(a.coords,a.icon,a.options,this.mapCtrl.getMap()),this.setGMarker(new google.maps.Marker(b)),google.maps.event.addListener(this.scope.gMarker,"click",function(){return c.doClick&&null!=a.click?c.$timeout(function(){return c.scope.click()}):void 0}),this.setEvents(this.scope.gMarker,a,a),this.$log.info(this)},f.prototype.onWatch=function(a,b){switch(a){case"coords":return this.validateCoords(b.coords)&&null!=this.scope.gMarker?(this.scope.gMarker.setMap(this.mapCtrl.getMap()),this.scope.gMarker.setPosition(this.getCoords(b.coords)),this.scope.gMarker.setVisible(this.validateCoords(b.coords)),this.scope.gMarker.setOptions(b.options)):this.scope.gMarker.setMap(null);case"icon":if(null!=b.icon&&this.validateCoords(b.coords)&&null!=this.scope.gMarker)return this.scope.gMarker.setOptions(b.options),this.scope.gMarker.setIcon(b.icon),this.scope.gMarker.setMap(null),this.scope.gMarker.setMap(this.mapCtrl.getMap()),this.scope.gMarker.setPosition(this.getCoords(b.coords)),this.scope.gMarker.setVisible(this.validateCoords(b.coords));break;case"options":if(this.validateCoords(b.coords)&&null!=b.icon&&b.options)return null!=this.scope.gMarker&&this.scope.gMarker.setMap(null),this.setGMarker(new google.maps.Marker(this.createMarkerOptions(b.coords,b.icon,b.options,this.mapCtrl.getMap())))}},f.prototype.setGMarker=function(a){return this.scope.gMarker&&(delete this.scope.gMarker,this.gMarkerManager.remove(this.scope.gMarker,!1)),this.scope.gMarker=a,this.scope.gMarker&&(this.gMarkerManager.add(this.scope.gMarker,!1),this.doFit)?this.gMarkerManager.fit():void 0},f.prototype.onDestroy=function(){var a;return this.scope.gMarker?(this.scope.gMarker.setMap(null),this.gMarkerManager.remove(this.scope.gMarker,!1),delete this.scope.gMarker,a=void 0):void(a=void 0)},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("MarkersParentModel",["IMarkerParentModel","ModelsWatcher","PropMap","MarkerChildModel","ClustererMarkerManager","MarkerManager",function(b,d,e,f,g,h){var i;return i=function(b){function i(b,c,d,f,g){this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.pieceMealMarkers=a(this.pieceMealMarkers,this),this.reBuildMarkers=a(this.reBuildMarkers,this),this.createMarkersFromScratch=a(this.createMarkersFromScratch,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this),this.onTimeOut=a(this.onTimeOut,this);var h,j=this;i.__super__.constructor.call(this,b,c,d,f,g),h=this,this.scope.markerModels=new e,this.$timeout=g,this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!0,this.setIdKey(b),this.scope.$watch("doRebuildAll",function(a,b){return a!==b?j.doRebuildAll=a:void 0})}return c(i,b),i.include(d),i.prototype.onTimeOut=function(a){return this.watch("models",a),this.watch("doCluster",a),this.watch("clusterOptions",a),this.watch("clusterEvents",a),this.watch("fit",a),this.watch("idKey",a),this.gMarkerManager=void 0,this.createMarkersFromScratch(a)},i.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll?this.reBuildMarkers(b):this.pieceMealMarkers(b)},i.prototype.validateScope=function(a){var b;return b=angular.isUndefined(a.models)||void 0===a.models,b&&this.$log.error(this.constructor.name+": no valid models attribute found"),i.__super__.validateScope.call(this,a)||b},i.prototype.createMarkersFromScratch=function(a){var b=this;return a.doCluster?(a.clusterEvents&&(this.clusterInternalOptions=_.once(function(){var c,d,e,f;return c=b,b.origClusterEvents?void 0:(b.origClusterEvents={click:null!=(d=a.clusterEvents)?d.click:void 0,mouseout:null!=(e=a.clusterEvents)?e.mouseout:void 0,mouseover:null!=(f=a.clusterEvents)?f.mouseover:void 0},_.extend(a.clusterEvents,{click:function(a){return c.maybeExecMappedEvent(a,"click")},mouseout:function(a){return c.maybeExecMappedEvent(a,"mouseout")},mouseover:function(a){return c.maybeExecMappedEvent(a,"mouseover")}}))})()),a.clusterOptions||a.clusterEvents?void 0===this.gMarkerManager?this.gMarkerManager=new g(this.mapCtrl.getMap(),void 0,a.clusterOptions,this.clusterInternalOptions):this.gMarkerManager.opt_options!==a.clusterOptions&&(this.gMarkerManager=new g(this.mapCtrl.getMap(),void 0,a.clusterOptions,this.clusterInternalOptions)):this.gMarkerManager=new g(this.mapCtrl.getMap())):this.gMarkerManager=new h(this.mapCtrl.getMap()),_async.each(a.models,function(c){return b.newChildMarker(c,a)},function(){return b.gMarkerManager.draw(),a.fit?b.gMarkerManager.fit():void 0})},i.prototype.reBuildMarkers=function(a){return a.doRebuild||void 0===a.doRebuild?(this.onDestroy(a),this.createMarkersFromScratch(a)):void 0},i.prototype.pieceMealMarkers=function(a){var b=this;return null!=this.scope.models&&this.scope.models.length>0&&this.scope.markerModels.length>0?this.figureOutState(this.idKey,a,this.scope.markerModels,this.modelKeyComparison,function(c){var d;return d=c,_async.each(d.removals,function(a){return null!=a?(a.destroy(),b.scope.markerModels.remove(a.id)):void 0},function(){return _async.each(d.adds,function(c){return b.newChildMarker(c,a)},function(){return b.gMarkerManager.draw(),a.markerModels=b.scope.markerModels})})}):this.reBuildMarkers(a)},i.prototype.newChildMarker=function(a,b){var c;return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),c=new f(a,b,this.mapCtrl,this.$timeout,this.DEFAULTS,this.doClick,this.gMarkerManager,this.idKey),this.scope.markerModels.put(a[this.idKey],c),c)},i.prototype.onDestroy=function(){return _.each(this.scope.markerModels.values(),function(a){return null!=a?a.destroy():void 0}),delete this.scope.markerModels,this.scope.markerModels=new e,null!=this.gMarkerManager?this.gMarkerManager.clear():void 0},i.prototype.maybeExecMappedEvent=function(a,b){var c,d;return _.isFunction(null!=(d=this.scope.clusterEvents)?d[b]:void 0)&&(c=this.mapClusterToMarkerModels(a),this.origClusterEvents[b])?this.origClusterEvents[b](c.cluster,c.mapped):void 0},i.prototype.mapClusterToMarkerModels=function(a){var b,c,d=this;return b=a.getMarkers(),c=b.map(function(a){return d.scope.markerModels[a.key].model}),{cluster:a,mapped:c}},i}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("PolylinesParentModel",["$timeout","Logger","ModelKey","ModelsWatcher","PropMap","PolylineChildModel",function(b,d,e,f,g,h){var i;return i=function(e){function i(c,e,f,h,j){var k,l=this;this.scope=c,this.element=e,this.attrs=f,this.gMap=h,this.defaults=j,this.modelKeyComparison=a(this.modelKeyComparison,this),this.setChildScope=a(this.setChildScope,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.watch=a(this.watch,this),i.__super__.constructor.call(this,c),k=this,this.$log=d,this.plurals=new g,this.scopePropNames=["path","stroke","clickable","draggable","editable","geodesic","icons","visible"],_.each(this.scopePropNames,function(a){return this[a+"Key"]=void 0}),this.models=void 0,this.firstTime=!0,this.$log.info(this),b(function(){return l.watchOurScope(c),l.createChildScopes()})}return c(i,e),i.include(f),i.prototype.watch=function(a,b,c){var d=this;return a.$watch(b,function(a,e){return a!==e?(d[c]="function"==typeof a?a():a,_async.each(_.values(d.plurals),function(a){return a.scope[b]="self"===d[c]?a:a[d[c]]},function(){})):void 0})},i.prototype.watchModels=function(a){var b=this;return a.$watch("models",function(c,d){return _.isEqual(c,d)?void 0:b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)},!0)},i.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.plurals.length>0&&b},i.prototype.rebuildAll=function(a,b,c){var d=this;return _async.each(this.plurals.values(),function(a){return a.destroy()},function(){return c&&delete d.plurals,d.plurals=new g,b?d.createChildScopes():void 0})},i.prototype.watchDestroy=function(a){var b=this;return a.$on("$destroy",function(){return b.rebuildAll(a,!1,!0)})},i.prototype.watchOurScope=function(a){var b=this;return _.each(this.scopePropNames,function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c],b.watch(a,c,d)})},i.prototype.createChildScopes=function(a){return null==a&&(a=!0),angular.isUndefined(this.scope.models)?void this.$log.error("No models to create polylines from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},i.prototype.watchIdKey=function(a){var b=this;return this.setIdKey(a),a.$watch("idKey",function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0})},i.prototype.createAllNew=function(a,b){var c=this;return null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),_async.each(a.models,function(a){return c.createChild(a,c.gMap)},function(){return c.firstTime=!1})},i.prototype.pieceMeal=function(a,b){var c=this;return null==b&&(b=!0),this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.plurals.length>0?this.figureOutState(this.idKey,a,this.plurals,this.modelKeyComparison,function(a){var b;return b=a,_async.each(b.removals,function(a){var b;return b=c.plurals[a],null!=b?(b.destroy(),c.plurals.remove(a)):void 0},function(){return _async.each(b.adds,function(a){return c.createChild(a,c.gMap)},function(){})})}):this.rebuildAll(this.scope,!0,!0)},i.prototype.createChild=function(a,b){var c,d,e=this;return d=this.scope.$new(!1),this.setChildScope(d,a),d.$watch("model",function(a,b){return a!==b?e.setChildScope(d,a):void 0},!0),d["static"]=this.scope["static"],c=new h(d,this.attrs,b,this.defaults,a),null==a[this.idKey]?void this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},i.prototype.setChildScope=function(a,b){var c=this;return _.each(this.scopePropNames,function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}),a.model=b},i.prototype.modelKeyComparison=function(a,b){return _.isEqual(this.evalModelHandle(a,this.scope.path),this.evalModelHandle(b,this.scope.path))},i}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent").factory("WindowsParentModel",["IWindowParentModel","ModelsWatcher","PropMap","WindowChildModel","Linked",function(b,d,e,f,g){var h;return h=function(b){function h(b,c,d,f,i,j,k,l,m){var n,o=this;this.$interpolate=m,this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMealWindows=a(this.pieceMealWindows,this),this.createAllNewWindows=a(this.createAllNewWindows,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopesWindows=a(this.createChildScopesWindows,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.watch=a(this.watch,this),h.__super__.constructor.call(this,b,c,d,f,i,j,k,l),n=this,this.windows=new e,this.scopePropNames=["show","coords","templateUrl","templateParameter","isIconVisibleOnClick","closeClick"],_.each(this.scopePropNames,function(a){return this[a+"Key"]=void 0}),this.linked=new g(b,c,d,f),this.models=void 0,this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.$log.info(n),this.parentScope=void 0,this.$timeout(function(){return o.watchOurScope(b),o.doRebuildAll=null!=o.scope.doRebuildAll?o.scope.doRebuildAll:!0,b.$watch("doRebuildAll",function(a,b){return a!==b?o.doRebuildAll=a:void 0}),o.createChildScopesWindows()},50)}return c(h,b),h.include(d),h.prototype.watch=function(a,b,c){var d=this;return a.$watch(b,function(a,e){return a!==e?(d[c]="function"==typeof a?a():a,_async.each(_.values(d.windows),function(a){return a.scope[b]="self"===d[c]?a:a[d[c]]},function(){})):void 0})},h.prototype.watchModels=function(a){var b=this;return a.$watch("models",function(c,d){return _.isEqual(c,d)?void 0:b.doRebuildAll||b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):b.createChildScopesWindows(!1)})},h.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.windows.length>0&&b},h.prototype.rebuildAll=function(a,b,c){var d=this;return _async.each(this.windows.values(),function(a){return a.destroy()},function(){return c&&delete d.windows,d.windows=new e,b?d.createChildScopesWindows():void 0})},h.prototype.watchDestroy=function(a){var b=this;return a.$on("$destroy",function(){return b.rebuildAll(a,!1,!0)})},h.prototype.watchOurScope=function(a){var b=this;return _.each(this.scopePropNames,function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c],b.watch(a,c,d)})},h.prototype.createChildScopesWindows=function(a){var b,c;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,angular.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),this.gMap=this.linked.ctrls[0].getMap(),null!=this.linked.ctrls[1]&&(b=this.linked.ctrls.length>1?this.linked.ctrls[1].getMarkersScope():void 0),c=angular.isUndefined(this.linked.scope.models),!c||void 0!==b&&void 0!==b.markerModels&&void 0!==b.models?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNewWindows(this.linked.scope,!1):this.pieceMealWindows(this.linked.scope,!1)):(this.parentScope=b,this.watchIdKey(this.parentScope),a?this.createAllNewWindows(b,!0,"markerModels",!1):this.pieceMealWindows(b,!0,"markerModels",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derrived from markers!")},h.prototype.watchIdKey=function(a){var b=this;return this.setIdKey(a),a.$watch("idKey",function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0})},h.prototype.createAllNewWindows=function(a,b,c,d){var e=this;return null==c&&(c="models"),null==d&&(d=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),_async.each(a.models,function(d){var f;return f=b?a[c][[d[e.idKey]]].gMarker:void 0,e.createWindow(d,f,e.gMap)},function(){return e.firstTime=!1})},h.prototype.pieceMealWindows=function(a,b,c,d){var e=this;return null==c&&(c="models"),null==d&&(d=!0),this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.windows.length>0?this.figureOutState(this.idKey,a,this.windows,this.modelKeyComparison,function(b){var d;return d=b,_async.each(d.removals,function(a){return null!=a?(a.destroy(),e.windows.remove(a.id)):void 0},function(){return _async.each(d.adds,function(b){var d;return d=a[c][b[e.idKey]].gMarker,e.createWindow(b,d,e.gMap)},function(){})})}):this.rebuildAll(this.scope,!0,!0)},h.prototype.setContentKeys=function(a){return a.length>0?this.contentKeys=Object.keys(a[0]):void 0},h.prototype.createWindow=function(a,b,c){var d,e,g,h,i=this;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a,b){return a!==b?i.setChildScope(e,a):void 0},!0),g={html:function(){return i.interpolateContent(i.linked.element.html(),a)}},h=this.createWindowOptions(b,e,g.html(),this.DEFAULTS),d=new f(a,e,h,this.isIconVisibleOnClick,c,b,g,!0,!0),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.windows.put(a[this.idKey],d),d)},h.prototype.setChildScope=function(a,b){var c=this;return _.each(this.scopePropNames,function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}),a.model=b},h.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=this.$interpolate(a),d={},h=this.contentKeys,f=0,g=h.length;g>f;f++)e=h[f],d[e]=b[e];return c(d)}},h}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("ILabel",["BaseObject","Logger",function(b,d){var e;return e=function(b){function e(b){this.link=a(this.link,this);var c;c=this,this.restrict="ECMA",this.replace=!0,this.template=void 0,this.require=void 0,this.transclude=!0,this.priority=-100,this.scope={labelContent:"=content",labelAnchor:"@anchor",labelClass:"@class",labelStyle:"=style"},this.$log=d,this.$timeout=b}return c(e,b),e.prototype.link=function(){throw new Exception("Not Implemented!!")},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("IMarker",["Logger","BaseObject",function(b,d){var e;return e=function(d){function e(c){this.link=a(this.link,this);var d;d=this,this.$log=b,this.$timeout=c,this.restrict="ECMA",this.require="^googleMap",this.priority=-1,this.transclude=!0,this.replace=!0,this.scope={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit"}}return c(e,d),e.prototype.controller=["$scope","$element",function(){throw new Exception("Not Implemented!!")}],e.prototype.link=function(){throw new Exception("Not implemented!!")},e}(d)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api").factory("IPolyline",["GmapUtil","BaseObject","Logger",function(a,c,d){var e;return e=function(c){function e(){var a;a=this}return b(e,c),e.include(a),e.prototype.restrict="ECA",e.prototype.replace=!0,e.prototype.require="^googleMap",e.prototype.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=","static":"="},e.prototype.DEFAULTS={},e.prototype.$log=d,e}(c)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("IWindow",["BaseObject","ChildEvents","Logger",function(b,d,e){var f;return f=function(b){function f(b,c,d,f){var g;this.$timeout=b,this.$compile=c,this.$http=d,this.$templateCache=f,this.link=a(this.link,this),g=this,this.restrict="ECMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require=void 0,this.replace=!0,this.scope={coords:"=coords",show:"=show",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options"},this.$log=e}return c(f,b),f.include(d),f.prototype.link=function(){throw new Exception("Not Implemented!!")},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Map",["$timeout","Logger","GmapUtil","BaseObject",function(b,d,e,f){"use strict"; +var g,h,i;return g=d,h={mapTypeId:google.maps.MapTypeId.ROADMAP},i=function(b){function d(){this.link=a(this.link,this);var b;b=this}return c(d,b),d.include(e),d.prototype.restrict="ECMA",d.prototype.transclude=!0,d.prototype.replace=!1,d.prototype.template='
',d.prototype.scope={center:"=center",zoom:"=zoom",dragging:"=dragging",control:"=",windows:"=windows",options:"=options",events:"=events",styles:"=styles",bounds:"=bounds"},d.prototype.controller=["$scope",function(a){return{getMap:function(){return a.map}}}],d.prototype.link=function(a,b,c){var d,e,f,i,j,k,l,m,n=this;if(!this.validateCoords(a.center))return void g.error("angular-google-maps: could not find a valid center property");if(!angular.isDefined(a.zoom))return void g.error("angular-google-maps: map zoom property not set");if(e=angular.element(b),e.addClass("angular-google-map"),j={options:{}},c.options&&(j.options=a.options),c.styles&&(j.styles=a.styles),c.type&&(l=c.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(l)?j.mapTypeId=google.maps.MapTypeId[c.type.toUpperCase()]:g.error('angular-google-maps: invalid map type "'+c.type+'"')),m=new google.maps.Map(e.find("div")[1],angular.extend({},h,j,{center:this.getCoords(a.center),draggable:this.isTrue(c.draggable),zoom:a.zoom,bounds:a.bounds})),d=!1,google.maps.event.addListener(m,"dragstart",function(){return d=!0,_.defer(function(){return a.$apply(function(a){return null!=a.dragging?a.dragging=d:void 0})})}),google.maps.event.addListener(m,"dragend",function(){return d=!1,_.defer(function(){return a.$apply(function(a){return null!=a.dragging?a.dragging=d:void 0})})}),google.maps.event.addListener(m,"drag",function(){var b;return b=m.center,_.defer(function(){return a.$apply(function(a){return angular.isDefined(a.center.type)?(a.center.coordinates[1]=b.lat(),a.center.coordinates[0]=b.lng()):(a.center.latitude=b.lat(),a.center.longitude=b.lng())})})}),google.maps.event.addListener(m,"zoom_changed",function(){return a.zoom!==m.zoom?_.defer(function(){return a.$apply(function(a){return a.zoom=m.zoom})}):void 0}),k=!1,google.maps.event.addListener(m,"center_changed",function(){var b;return b=m.center,k?void 0:_.defer(function(){return a.$apply(function(a){if(!m.dragging)if(angular.isDefined(a.center.type)){if(a.center.coordinates[1]!==b.lat()&&(a.center.coordinates[1]=b.lat()),a.center.coordinates[0]!==b.lng())return a.center.coordinates[0]=b.lng()}else if(a.center.latitude!==b.lat()&&(a.center.latitude=b.lat()),a.center.longitude!==b.lng())return a.center.longitude=b.lng()})})}),google.maps.event.addListener(m,"idle",function(){var b,c,d;return b=m.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),_.defer(function(){return a.$apply(function(a){return null!==a.bounds&&void 0!==a.bounds&&void 0!==a.bounds?(a.bounds.northeast={latitude:c.lat(),longitude:c.lng()},a.bounds.southwest={latitude:d.lat(),longitude:d.lng()}):void 0})})}),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)){i=function(b){return function(){return a.events[b].apply(a,[m,b,arguments])}};for(f in a.events)a.events.hasOwnProperty(f)&&angular.isFunction(a.events[f])&&google.maps.event.addListener(m,f,i(f))}return a.map=m,null!=c.control&&null!=a.control&&(a.control.refresh=function(a){var b;if(null!=m)return google.maps.event.trigger(m,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.latitude:void 0)?(b=n.getCoords(a),n.isTrue(c.pan)?m.panTo(b):m.setCenter(b)):void 0},a.control.getGMap=function(){return m}),a.$watch("center",function(b,e){var f;return f=n.getCoords(b),b===e||f.lat()===m.center.lat()&&f.lng()===m.center.lng()?void 0:(k=!0,d||(n.validateCoords(b)||g.error("Invalid center for newValue: "+JSON.stringify(b)),n.isTrue(c.pan)&&a.zoom===m.zoom?m.panTo(f):m.setCenter(f)),k=!1)},!0),a.$watch("zoom",function(a,b){return a!==b&&a!==m.zoom?_.defer(function(){return m.setZoom(a)}):void 0}),a.$watch("bounds",function(a,b){var c,d,e;if(a!==b)return null==a.northeast.latitude||null==a.northeast.longitude||null==a.southwest.latitude||null==a.southwest.longitude?void g.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),e=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(e,d),m.fitBounds(c))}),a.$watch("options",function(a,b){return _.isEqual(a,b)||(j.options=a,null==m)?void 0:m.setOptions(j)},!0),a.$watch("styles",function(a,b){return _.isEqual(a,b)||(j.styles=a,null==m)?void 0:m.setOptions(j)},!0)},d}(f)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Marker",["IMarker","MarkerParentModel","MarkerManager",function(b,d,e){var f;return f=function(b){function f(b){this.link=a(this.link,this);var c;f.__super__.constructor.call(this,b),c=this,this.template='',this.$log.info(this)}return c(f,b),f.prototype.controller=["$scope","$element",function(a){return{getMarkerScope:function(){return a}}}],f.prototype.link=function(a,b,c,f){var g;return a.fit&&(g=!0),this.gMarkerManager||(this.gMarkerManager=new e(f.getMap())),new d(a,b,c,f,this.$timeout,this.gMarkerManager,g)},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Markers",["IMarker","MarkersParentModel",function(b,d){var e;return e=function(b){function e(b){this.link=a(this.link,this);var c;e.__super__.constructor.call(this,b),this.template='',this.scope.idKey="=idkey",this.scope.doRebuildAll="=dorebuildall",this.scope.models="=models",this.scope.doCluster="=docluster",this.scope.clusterOptions="=clusteroptions",this.scope.clusterEvents="=clusterevents",this.scope.labelContent="=labelcontent",this.scope.labelAnchor="@labelanchor",this.scope.labelClass="@labelclass",this.$timeout=b,c=this,this.$log.info(this)}return c(e,b),e.prototype.controller=["$scope","$element",function(a){return{getMarkersScope:function(){return a}}}],e.prototype.link=function(a,b,c,e){return new d(a,b,c,e,this.$timeout)},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Polyline",["IPolyline","$timeout","array-sync","PolylineChildModel",function(b,d,e,f){var g,h;return g=function(b){function e(){return this.link=a(this.link,this),h=e.__super__.constructor.apply(this,arguments)}return c(e,b),e.prototype.link=function(a,b,c,e){var g=this;return angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void this.$log.error("polyline: no valid path attribute found"):d(function(){return new f(a,c,e.getMap(),g.DEFAULTS)})},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Polylines",["IPolyline","$timeout","array-sync","PolylinesParentModel",function(b,d,e,f){var g;return g=function(b){function e(){this.link=a(this.link,this),e.__super__.constructor.call(this),this.scope.idKey="=idkey",this.scope.models="=models",this.$log.info(this)}return c(e,b),e.prototype.link=function(a,b,c,e){var g=this;return angular.isUndefined(a.path)||null===a.path?void this.$log.error("polylines: no valid path attribute found"):a.models?d(function(){return new f(a,b,c,e.getMap(),g.DEFAULTS)}):void this.$log.error("polylines: no models found to create from")},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Window",["IWindow","GmapUtil","WindowChildModel",function(b,d,e){var f;return f=function(b){function f(b,c,d,e){this.link=a(this.link,this);var g;f.__super__.constructor.call(this,b,c,d,e),g=this,this.require=["^googleMap","^?marker"],this.template='',this.$log.info(g)}return c(f,b),f.include(d),f.prototype.link=function(a,b,c,f){var g=this;return this.$timeout(function(){var d,h,i,j,k,l,m,n;return i=!0,angular.isDefined(c.isiconvisibleonclick)&&(i=a.isIconVisibleOnClick),j=f[0].getMap(),k=f.length>1&&null!=f[1]?f[1].getMarkerScope().gMarker:void 0,d=null!=a.options?a.options:{},h=null!=a&&g.validateCoords(a.coords),m=h?g.createWindowOptions(k,a,b.html(),d):d,null!=j&&(n=new e({},a,m,i,j,k,b)),a.$on("$destroy",function(){return n.destroy()}),null!=f[1]&&(l=f[1].getMarkerScope(),l.$watch("coords",function(a,b){return g.validateCoords(a)?angular.equals(a,b)?void 0:n.getLatestPosition():n.hideWindow()},!0)),null!=g.onChildCreation&&null!=n?g.onChildCreation(n):void 0},d.defaultDelay+25)},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api").factory("Windows",["IWindow","WindowsParentModel",function(b,d){var e;return e=function(b){function e(b,c,d,f,g){this.link=a(this.link,this);var h;e.__super__.constructor.call(this,b,c,d,f),h=this,this.$interpolate=g,this.require=["^googleMap","^?markers"],this.template='',this.scope.idKey="=idkey",this.scope.doRebuildAll="=dorebuildall",this.scope.models="=models",this.$log.info(this)}return c(e,b),e.prototype.link=function(a,b,c,e){return new d(a,b,c,e,this.$timeout,this.$compile,this.$http,this.$templateCache,this.$interpolate)},e}(b)}])}.call(this),function(){angular.module("google-maps").directive("googleMap",["Map",function(a){return new a}])}.call(this),function(){angular.module("google-maps").directive("marker",["$timeout","Marker",function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps").directive("markers",["$timeout","Markers",function(a,b){return new b(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps").directive("markerLabel",["$timeout","ILabel","MarkerLabelChildModel","GmapUtil",function(b,d,e,f){var g;return new(g=function(b){function d(b){this.link=a(this.link,this);var c;d.__super__.constructor.call(this,b),c=this,this.require="^marker",this.template='',this.$log.info(this)}return c(d,b),d.prototype.link=function(a,b,c,d){return this.$timeout(function(){var b,c;return c=d.getMarkerScope().gMarker,null!=c&&(b=new e(c,a)),a.$on("$destroy",function(){return b.destroy()})},f.defaultDelay+25)},d}(d))(b)}])}.call(this),function(){angular.module("google-maps").directive("polygon",["$log","$timeout","array-sync","GmapUtil",function(a,b,c,d){var e,f;return f=function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},e={},{restrict:"ECA",replace:!0,require:"^googleMap",scope:{path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=","static":"=",events:"=",zIndex:"=zindex"},link:function(g,h,i,j){return angular.isUndefined(g.path)||null===g.path||!d.validatePath(g.path)?void a.error("polygon: no valid path attribute found"):b(function(){var a,b,h,k,l,m;if(b=function(a){var b;return b=angular.extend({},e,{map:l,path:a,strokeColor:g.stroke&&g.stroke.color,strokeOpacity:g.stroke&&g.stroke.opacity,strokeWeight:g.stroke&&g.stroke.weight,fillColor:g.fill&&g.fill.color,fillOpacity:g.fill&&g.fill.opacity}),angular.forEach({clickable:!0,draggable:!1,editable:!1,geodesic:!1,visible:!0,"static":!1,zIndex:0},function(a,c){return b[c]=angular.isUndefined(g[c])||null===g[c]?a:g[c]}),b["static"]&&(b.editable=!1),b},l=j.getMap(),m=new google.maps.Polygon(b(d.convertPathPoints(g.path))),f(i.fit)&&d.extendMapBounds(l,pathPoints),!g["static"]&&angular.isDefined(g.editable)&&g.$watch("editable",function(a,b){return a!==b?m.setEditable(a):void 0}),angular.isDefined(g.draggable)&&g.$watch("draggable",function(a,b){return a!==b?m.setDraggable(a):void 0}),angular.isDefined(g.visible)&&g.$watch("visible",function(a,b){return a!==b?m.setVisible(a):void 0}),angular.isDefined(g.geodesic)&&g.$watch("geodesic",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.stroke)&&angular.isDefined(g.stroke.opacity)&&g.$watch("stroke.opacity",function(){return m.setOptions(b(m.getPath()))}),angular.isDefined(g.stroke)&&angular.isDefined(g.stroke.weight)&&g.$watch("stroke.weight",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.stroke)&&angular.isDefined(g.stroke.color)&&g.$watch("stroke.color",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.fill)&&angular.isDefined(g.fill.color)&&g.$watch("fill.color",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.fill)&&angular.isDefined(g.fill.opacity)&&g.$watch("fill.opacity",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.zIndex)&&g.$watch("zIndex",function(a,c){return a!==c?m.setOptions(b(m.getPath())):void 0}),angular.isDefined(g.events)&&null!==g.events&&angular.isObject(g.events)){k=function(a){return function(){return g.events[a].apply(g,[m,a,arguments])}};for(h in g.events)g.events.hasOwnProperty(h)&&angular.isFunction(g.events[h])&&m.addListener(h,k(h))}return a=c(m.getPath(),g,"path"),g.$on("$destroy",function(){return m.setMap(null),a?(a(),a=null):void 0})})}}}])}.call(this),function(){angular.module("google-maps").directive("circle",["$log","$timeout","GmapUtil",function(a,b,c){"use strict";var d;return d={},{restrict:"ECA",replace:!0,require:"^googleMap",scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"="},link:function(e,f,g,h){return b(function(){var f,g,i;return f=function(){var b;return c.validateCoords(e.center)?(b=angular.extend({},d,{map:i,center:c.getCoords(e.center),radius:e.radius,strokeColor:e.stroke&&e.stroke.color,strokeOpacity:e.stroke&&e.stroke.opacity,strokeWeight:e.stroke&&e.stroke.weight,fillColor:e.fill&&e.fill.color,fillOpacity:e.fill&&e.fill.opacity}),angular.forEach({clickable:!0,draggable:!1,editable:!1,geodesic:!1,visible:!0},function(a,c){return b[c]=angular.isUndefined(e[c])||null===e[c]?a:e[c]}),b):void a.error("circle: no valid center attribute found")},i=h.getMap(),g=new google.maps.Circle(f()),e.$watchCollection("center",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watchCollection("stroke",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watchCollection("fill",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("radius",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("clickable",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("editable",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("draggable",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("visible",function(a,b){return a!==b?g.setOptions(f()):void 0}),e.$watch("geodesic",function(a,b){return a!==b?g.setOptions(f()):void 0}),google.maps.event.addListener(g,"radius_changed",function(){return e.radius=g.getRadius(),b(function(){return e.$apply()})}),google.maps.event.addListener(g,"center_changed",function(){return angular.isDefined(e.center.type)?(e.center.coordinates[1]=g.getCenter().lat(),e.center.coordinates[0]=g.getCenter().lng()):(e.center.latitude=g.getCenter().lat(),e.center.longitude=g.getCenter().lng()),b(function(){return e.$apply()})}),e.$on("$destroy",function(){return g.setMap(null)})})}}}])}.call(this),function(){angular.module("google-maps").directive("polyline",["Polyline",function(a){return new a}])}.call(this),function(){angular.module("google-maps").directive("polylines",["Polylines",function(a){return new a}])}.call(this),function(){angular.module("google-maps").directive("rectangle",["$log","$timeout",function(a,b){var c,d,e,f,g;return g=function(a){return angular.isUndefined(a.sw.latitude)||angular.isUndefined(a.sw.longitude)||angular.isUndefined(a.ne.latitude)||angular.isUndefined(a.ne.longitude)?!1:!0},d=function(a){var b;return b=new google.maps.LatLngBounds(new google.maps.LatLng(a.sw.latitude,a.sw.longitude),new google.maps.LatLng(a.ne.latitude,a.ne.longitude))},e=function(a,b){return a.fitBounds(b)},f=function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},c={},{restrict:"ECA",require:"^googleMap",replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"="},link:function(h,i,j,k){return angular.isUndefined(h.bounds)||null===h.bounds||angular.isUndefined(h.bounds.sw)||null===h.bounds.sw||angular.isUndefined(h.bounds.ne)||null===h.bounds.ne||!g(h.bounds)?void a.error("rectangle: no valid bound attribute found"):b(function(){var b,g,i,l,m;return b=function(a){var b;return b=angular.extend({},c,{map:i,bounds:a,strokeColor:h.stroke&&h.stroke.color,strokeOpacity:h.stroke&&h.stroke.opacity,strokeWeight:h.stroke&&h.stroke.weight,fillColor:h.fill&&h.fill.color,fillOpacity:h.fill&&h.fill.opacity}),angular.forEach({clickable:!0,draggable:!1,editable:!1,visible:!0},function(a,c){return b[c]=angular.isUndefined(h[c])||null===h[c]?a:h[c]}),b},i=k.getMap(),l=new google.maps.Rectangle(b(d(h.bounds))),f(j.fit)&&e(i,bounds),g=!1,google.maps.event.addListener(l,"mousedown",function(){google.maps.event.addListener(l,"mousemove",function(){return g=!0,_.defer(function(){return h.$apply(function(a){return null!=a.dragging?a.dragging=g:void 0})})}),google.maps.event.addListener(l,"mouseup",function(){return google.maps.event.clearListeners(l,"mousemove"),google.maps.event.clearListeners(l,"mouseup"),g=!1,_.defer(function(){return h.$apply(function(a){return null!=a.dragging?a.dragging=g:void 0})})})}),m=!1,google.maps.event.addListener(l,"bounds_changed",function(){var a,b,c;return a=l.getBounds(),b=a.getNorthEast(),c=a.getSouthWest(),m?void 0:_.defer(function(){return h.$apply(function(a){l.dragging||null!==a.bounds&&void 0!==a.bounds&&void 0!==a.bounds&&(a.bounds.ne={latitude:b.lat(),longitude:b.lng()},a.bounds.sw={latitude:c.lat(),longitude:c.lng()})})})}),h.$watch("bounds",function(b,c){var d;if(!_.isEqual(b,c))return m=!0,g||((null==b.sw.latitude||null==b.sw.longitude||null==b.ne.latitude||null==b.ne.longitude)&&a.error("Invalid bounds for newValue: "+JSON.stringify(b)),d=new google.maps.LatLngBounds(new google.maps.LatLng(b.sw.latitude,b.sw.longitude),new google.maps.LatLng(b.ne.latitude,b.ne.longitude)),l.setBounds(d)),m=!1},!0),angular.isDefined(h.editable)&&h.$watch("editable",function(a){return l.setEditable(a)}),angular.isDefined(h.draggable)&&h.$watch("draggable",function(a){return l.setDraggable(a)}),angular.isDefined(h.visible)&&h.$watch("visible",function(a){return l.setVisible(a)}),angular.isDefined(h.stroke)&&(angular.isDefined(h.stroke.color)&&h.$watch("stroke.color",function(){return l.setOptions(b(l.getBounds()))}),angular.isDefined(h.stroke.weight)&&h.$watch("stroke.weight",function(){return l.setOptions(b(l.getBounds()))}),angular.isDefined(h.stroke.opacity)&&h.$watch("stroke.opacity",function(){return l.setOptions(b(l.getBounds()))})),angular.isDefined(h.fill)&&(angular.isDefined(h.fill.color)&&h.$watch("fill.color",function(){return l.setOptions(b(l.getBounds()))}),angular.isDefined(h.fill.opacity)&&h.$watch("fill.opacity",function(){return l.setOptions(b(l.getBounds()))})),h.$on("$destroy",function(){return l.setMap(null)})})}}}])}.call(this),function(){angular.module("google-maps").directive("window",["$timeout","$compile","$http","$templateCache","Window",function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){angular.module("google-maps").directive("windows",["$timeout","$compile","$http","$templateCache","$interpolate","Windows",function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps").directive("layer",["$timeout","Logger","LayerParentModel",function(b,c,d){var e;return new(e=function(){function b(b){this.$timeout=b,this.link=a(this.link,this),this.$log=c,this.restrict="ECMA",this.require="^googleMap",this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return null!=c.oncreated?new d(a,b,c,e,this.$timeout,a.onCreated):new d(a,b,c,e,this.$timeout)},b}())(b)}])}.call(this),InfoBox.prototype=new google.maps.OverlayView,InfoBox.prototype.createInfoBoxDiv_=function(){var a,b,c,d=this,e=function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},f=function(a){a.returnValue=!1,a.preventDefault&&a.preventDefault(),d.enableEventPropagation_||e(a)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),"undefined"==typeof this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;ag&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){{b.getCenter()}b.panBy(d,e)}}},InfoBox.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);"undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},InfoBox.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""),a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},InfoBox.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.div_.style.visibility=this.isHidden_?"hidden":"visible"},InfoBox.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},InfoBox.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},InfoBox.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},InfoBox.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},InfoBox.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},InfoBox.prototype.getContent=function(){return this.content_},InfoBox.prototype.getPosition=function(){return this.position_},InfoBox.prototype.getZIndex=function(){return this.zIndex_},InfoBox.prototype.getVisible=function(){var a;return a="undefined"==typeof this.getMap()||null===this.getMap()?!1:!this.isHidden_},InfoBox.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},InfoBox.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},InfoBox.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},InfoBox.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;af&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="",this.div_.innerHTML=a+"
"+this.sums_.text+"
",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display="" +}this.visible_=!0},ClusterIcon.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},ClusterIcon.prototype.setCenter=function(a){this.center_=a},ClusterIcon.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.join("")},ClusterIcon.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;ad)a.getMap()!==this.map_&&a.setMap(this.map_);else if(cb;b++)this.markers_[b].setMap(null);else a.setMap(null);return this.updateIcon_(),!0},Cluster.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},Cluster.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},Cluster.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(a0))for(a=0;ac&&(f=c,g=d));g&&g.isMarkerInClusterBounds(a)?g.addMarker(a):(d=new Cluster(this),d.addMarker(a),this.clusters_.push(d))},MarkerClusterer.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);g + * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre ES5 environments */ + var undefined; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = {}; + + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ + var keyPrefix = +new Date + ''; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports` */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Used by `sortBy` to compare transformed `collection` elements, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ac = a.criteria, + bc = b.criteria, + index = -1, + length = ac.length; + + while (++index < length) { + var value = ac[index], + other = bc[index]; + + if (value !== other) { + if (value > other || typeof value == 'undefined') { + return 1; + } + if (value < other || typeof other == 'undefined') { + return -1; + } + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to return the same value for + // `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 + // + // This also ensures a stable sort in V8 and other engines. + // See http://code.google.com/p/v8/issues/detail?id=90 + return a.index - b.index; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used instead of `Array#slice` to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|string} collection The collection to slice. + * @param {number} start The start index. + * @param {number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Used for `Array` method references. + * + * Normally `Array.prototype` would suffice, however, using an array literal + * avoids issues in Narwhal. + */ + var arrayRef = []; + + /** Used for native method references */ + var objectProto = Object.prototype; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = root._; + + /** Used to resolve the internal [[Class]] of values */ + var toString = objectProto.toString; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + String(toString) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/toString| for [^\]]+/g, '.*?') + '$' + ); + + /** Native method shortcuts */ + var ceil = Math.ceil, + floor = Math.floor, + hasOwnProperty = objectProto.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, + nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = root.isFinite, + nativeIsNaN = root.isNaN, + nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeRandom = Math.random; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps the given value to enable intuitive + * method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * Chaining is supported in custom builds as long as the `value` method is + * implicitly or explicitly included in the build. + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, + * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, + * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, + * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, + * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, + * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, + * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, + * and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, + * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, + * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, + * `template`, `unescape`, `uniqueId`, and `value` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * provided, otherwise they return unwrapped values. + * + * Explicit chaining can be enabled by using the `_.chain` method. + * + * @name _ + * @constructor + * @category Chaining + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(num) { + * return num * num; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return (value instanceof lodash) + ? value + : new lodashWrapper(value); + } + + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap in a `lodash` instance. + * @param {boolean} chainAll A flag to enable chaining for all methods + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value, chainAll) { + this.__chain__ = !!chainAll; + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + + /** + * An object used to flag environments features. + * + * @static + * @memberOf _ + * @type Object + */ + var support = {}; + + (function() { + var object = { '0': 1, 'length': 1 }; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + * + * @memberOf _.support + * @type boolean + */ + support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]); + }(1)); + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.bind` that creates the bound function and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new bound function. + */ + function baseBind(bindData) { + var func = bindData[0], + partialArgs = bindData[2], + thisArg = bindData[4]; + + function bound() { + // `Function#bind` spec + // http://es5.github.io/#x15.3.4.5 + if (partialArgs) { + // avoid `arguments` object deoptimizations by using `slice` instead + // of `Array.prototype.slice.call` and not assigning `arguments` to a + // variable as a ternary expression + var args = slice(partialArgs); + push.apply(args, arguments); + } + // mimic the constructor's `return` behavior + // http://es5.github.io/#x13.2.2 + if (this instanceof bound) { + // ensure `new bound` is an instance of `func` + var thisBinding = baseCreate(func.prototype), + result = func.apply(thisBinding, args || arguments); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisArg, args || arguments); + } + return bound; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(prototype, properties) { + return isObject(prototype) ? nativeCreate(prototype) : {}; + } + // fallback for browsers without `Object.create` + if (!nativeCreate) { + baseCreate = (function() { + function Object() {} + return function(prototype) { + if (isObject(prototype)) { + Object.prototype = prototype; + var result = new Object; + Object.prototype = null; + } + return result || root.Object(); + }; + }()); + } + + /** + * The base implementation of `_.createCallback` without support for creating + * "_.pluck" or "_.where" style callbacks. + * + * @private + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function baseCreateCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + // exit early for no `thisArg` or already bound by `Function#bind` + if (typeof thisArg == 'undefined' || !('prototype' in func)) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 2: return function(a, b) { + return func.call(thisArg, a, b); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + } + return bind(func, thisArg); + } + + /** + * The base implementation of `createWrapper` that creates the wrapper and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new function. + */ + function baseCreateWrapper(bindData) { + var func = bindData[0], + bitmask = bindData[1], + partialArgs = bindData[2], + partialRightArgs = bindData[3], + thisArg = bindData[4], + arity = bindData[5]; + + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + key = func; + + function bound() { + var thisBinding = isBind ? thisArg : this; + if (partialArgs) { + var args = slice(partialArgs); + push.apply(args, arguments); + } + if (partialRightArgs || isCurry) { + args || (args = slice(arguments)); + if (partialRightArgs) { + push.apply(args, partialRightArgs); + } + if (isCurry && args.length < arity) { + bitmask |= 16 & ~32; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + } + } + args || (args = arguments); + if (isBindKey) { + func = thisBinding[key]; + } + if (this instanceof bound) { + thisBinding = baseCreate(func.prototype); + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + return bound; + } + + /** + * The base implementation of `_.difference` that accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to process. + * @param {Array} [values] The array of values to exclude. + * @returns {Array} Returns a new array of filtered values. + */ + function baseDifference(array, values) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (indexOf(values, value) < 0) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.flatten` without support for callback + * shorthands or `thisArg` binding. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns a new flattened array. + */ + function baseFlatten(array, isShallow, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value && typeof value == 'object' && typeof value.length == 'number' + && (isArray(value) || isArguments(value))) { + // recursively flatten arrays (susceptible to call stack limits) + if (!isShallow) { + value = baseFlatten(value, isShallow, isStrict); + } + var valIndex = -1, + valLength = value.length, + resIndex = result.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[resIndex++] = value[valIndex]; + } + } else if (!isStrict) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.isEqual`, without support for `thisArg` binding, + * that allows partial "_.where" style comparisons. + * + * @private + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `a` objects. + * @param {Array} [stackB=[]] Tracks traversed `b` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(a, b, stackA, stackB) { + if (a === b) { + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + if (a === a && + !(a && objectTypes[type]) && + !(b && objectTypes[otherType])) { + return false; + } + if (a == null || b == null) { + return a === b; + } + var className = toString.call(a), + otherClass = toString.call(b); + + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + return +a == +b; + + case numberClass: + return a != +a + ? b != +b + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + return a == String(b); + } + var isArr = className == arrayClass; + if (!isArr) { + var aWrapped = a instanceof lodash, + bWrapped = b instanceof lodash; + + if (aWrapped || bWrapped) { + return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, stackA, stackB); + } + if (className != objectClass) { + return false; + } + var ctorA = a.constructor, + ctorB = b.constructor; + + if (ctorA != ctorB && + !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && + ('constructor' in a && 'constructor' in b) + ) { + return false; + } + } + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var result = true, + size = 0; + + stackA.push(a); + stackB.push(b); + + if (isArr) { + size = b.length; + result = size == a.length; + + if (result) { + while (size--) { + if (!(result = baseIsEqual(a[size], b[size], stackA, stackB))) { + break; + } + } + } + } + else { + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + size++; + return !(result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, stackA, stackB)) && indicatorObject; + } + }); + + if (result) { + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + return !(result = --size > -1) && indicatorObject; + } + }); + } + } + stackA.pop(); + stackB.pop(); + return result; + } + + /** + * The base implementation of `_.random` without argument juggling or support + * for returning floating-point numbers. + * + * @private + * @param {number} min The minimum possible value. + * @param {number} max The maximum possible value. + * @returns {number} Returns a random number. + */ + function baseRandom(min, max) { + return min + floor(nativeRandom() * (max - min + 1)); + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * or `thisArg` binding. + * + * @private + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function} [callback] The function called per iteration. + * @returns {Array} Returns a duplicate-value-free array. + */ + function baseUniq(array, isSorted, callback) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = [], + seen = callback ? [] : result; + + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * Creates a function that aggregates a collection, creating an object composed + * of keys generated from the results of running each element of the collection + * through a callback. The given `setter` function sets the keys and values + * of the composed object. + * + * @private + * @param {Function} setter The setter function. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter) { + return function(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + setter(result, value, callback(value, index, collection), collection); + } + } else { + forOwn(collection, function(value, key, collection) { + setter(result, value, callback(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a function that, when called, either curries or invokes `func` + * with an optional `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of method flags to compose. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` + * 8 - `_.curry` (bound) + * 16 - `_.partial` + * 32 - `_.partialRight` + * @param {Array} [partialArgs] An array of arguments to prepend to those + * provided to the new function. + * @param {Array} [partialRightArgs] An array of arguments to append to those + * provided to the new function. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new function. + */ + function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + isPartial = bitmask & 16, + isPartialRight = bitmask & 32; + + if (!isBindKey && !isFunction(func)) { + throw new TypeError; + } + if (isPartial && !partialArgs.length) { + bitmask &= ~16; + isPartial = partialArgs = false; + } + if (isPartialRight && !partialRightArgs.length) { + bitmask &= ~32; + isPartialRight = partialRightArgs = false; + } + // fast path for `_.bind` + var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized, this method returns the custom method, otherwise it returns + * the `baseIndexOf` function. + * + * @private + * @returns {Function} Returns the "indexOf" function. + */ + function getIndexOf() { + var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; + return result; + } + + /** + * Checks if `value` is a native function. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. + */ + function isNative(value) { + return typeof value == 'function' && reNative.test(value); + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {string} match The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass || false; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (!isArguments(arguments)) { + isArguments = function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; + }; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass || false; + }; + + /** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ + var shimKeys = function(object) { + var index, iterable = object, result = []; + if (!iterable) return result; + if (!(objectTypes[typeof object])) return result; + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + result.push(index); + } + } + return result + }; + + /** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + return nativeKeys(object); + }; + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), + reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite property assignments of previous + * sources. If a callback is provided it will be executed to produce the + * assigned values. The callback is bound to `thisArg` and invoked with two + * arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var object = { 'name': 'barney' }; + * defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + function assign(object) { + if (!object) { + return object; + } + for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) { + var iterable = arguments[argsIndex]; + if (iterable) { + for (var key in iterable) { + object[key] = iterable[key]; + } + } + } + return object; + } + + /** + * Creates a clone of `value`. If `isDeep` is `true` nested objects will also + * be cloned, otherwise they will be assigned by reference. If a callback + * is provided it will be executed to produce the cloned values. If the + * callback returns `undefined` cloning will be handled by the method instead. + * The callback is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var shallow = _.clone(characters); + * shallow[0] === characters[0]; + * // => true + * + * var deep = _.clone(characters, true); + * deep[0] === characters[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value) { + return isObject(value) + ? (isArray(value) ? slice(value) : assign({}, value)) + : value; + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var object = { 'name': 'barney' }; + * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + function defaults(object) { + if (!object) { + return object; + } + for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) { + var iterable = arguments[argsIndex]; + if (iterable) { + for (var key in iterable) { + if (typeof object[key] == 'undefined') { + object[key] = iterable[key]; + } + } + } + } + return object; + } + + /** + * Iterates over own and inherited enumerable properties of an object, + * executing the callback for each property. The callback is bound to `thisArg` + * and invoked with three arguments; (value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forIn(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) + */ + var forIn = function(collection, callback) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + for (index in iterable) { + if (callback(iterable[index], index, collection) === indicatorObject) return result; + } + return result + }; + + /** + * Iterates over own enumerable properties of an object, executing the callback + * for each property. The callback is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) + */ + var forOwn = function(collection, callback) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + if (callback(iterable[index], index, collection) === indicatorObject) return result; + } + } + return result + }; + + /** + * Creates a sorted array of property names of all enumerable properties, + * own and inherited, of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified property name exists as a direct property of `object`, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to check. + * @returns {boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, key) { + return object ? hasOwnProperty.call(object, key) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'fred', 'second': 'barney' }); + * // => { 'fred': 'first', 'barney': 'second' } + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass || false; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value && typeof value == 'object' && toString.call(value) == dateClass || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value && value.nodeType === 1 || false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + if (!value) { + return true; + } + if (isArray(value) || isString(value)) { + return !value.length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If a callback is provided it will be executed + * to compare values. If the callback returns `undefined` comparisons will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var copy = { 'name': 'fred' }; + * + * object == copy; + * // => false + * + * _.isEqual(object, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b) { + return baseIsEqual(a, b); + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite` which will return true for + * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value == 'function' && toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN` which will return `true` for + * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || + value && typeof value == 'object' && toString.call(value) == numberClass || false; + } + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/fred/); + * // => true + */ + function isRegExp(value) { + return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('fred'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || + value && typeof value == 'object' && toString.call(value) == stringClass || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` omitting the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The properties to omit or the + * function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'fred', 'age': 40 }, 'age'); + * // => { 'name': 'fred' } + * + * _.omit({ 'name': 'fred', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'fred' } + */ + function omit(object) { + var props = []; + forIn(object, function(value, key) { + props.push(key); + }); + props = baseDifference(props, baseFlatten(arguments, true, false, 1)); + + var index = -1, + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[key] = object[key]; + } + return result; + } + + /** + * Creates a two dimensional array of an object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` picking the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The function called per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name'); + * // => { 'name': 'fred' } + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'fred' } + */ + function pick(object) { + var index = -1, + props = baseFlatten(arguments, true, false, 1), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + return result; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] (property order is not guaranteed across environments) + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if a given value is present in a collection using strict equality + * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the + * offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {*} target The value to check for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.contains('pebbles', 'eb'); + * // => true + */ + function contains(collection, target) { + var indexOf = getIndexOf(), + length = collection ? collection.length : 0, + result = false; + if (length && typeof length == 'number') { + result = indexOf(collection, target) > -1; + } else { + forOwn(collection, function(value) { + return (result = value === target) && indicatorObject; + }); + } + return result; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through the callback. The corresponding value + * of each key is the number of times the key was returned by the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + + /** + * Checks if the given callback returns truey value for **all** elements of + * a collection. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if all elements passed the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes']); + * // => false + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(characters, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(characters, { 'age': 36 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + forOwn(collection, function(value, index, collection) { + return !(result = !!callback(value, index, collection)) && indicatorObject; + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning an array of all elements + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(characters, 'blocked'); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + * + * // using "_.where" callback shorthand + * _.filter(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + forOwn(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning the first element that + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect, findWhere + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.find(characters, function(chr) { + * return chr.age < 40; + * }); + * // => { 'name': 'barney', 'age': 36, 'blocked': false } + * + * // using "_.where" callback shorthand + * _.find(characters, { 'age': 1 }); + * // => { 'name': 'pebbles', 'age': 1, 'blocked': false } + * + * // using "_.pluck" callback shorthand + * _.find(characters, 'blocked'); + * // => { 'name': 'fred', 'age': 40, 'blocked': true } + */ + function find(collection, callback, thisArg) { + callback = createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + return value; + } + } + } else { + var result; + forOwn(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return indicatorObject; + } + }); + return result; + } + } + + /** + * Examines each element in a `collection`, returning the first that + * has the given properties. When checking `properties`, this method + * performs a deep comparison between values to determine if they are + * equivalent to each other. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * var food = [ + * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, + * { 'name': 'banana', 'organic': true, 'type': 'fruit' }, + * { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + * ]; + * + * _.findWhere(food, { 'type': 'vegetable' }); + * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } + */ + function findWhere(object, properties) { + return where(object, properties, true); + } + + /** + * Iterates over elements of a collection, executing the callback for each + * element. The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * Note: As with other "Collections" methods, objects with a `length` property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); + * // => logs each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + * // => logs each number and returns the object (property order is not guaranteed across environments) + */ + function forEach(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (typeof length == 'number') { + while (++index < length) { + if (callback(collection[index], index, collection) === indicatorObject) { + break; + } + } + } else { + forOwn(collection, callback); + } + } + + /** + * This method is like `_.forEach` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); + * // => logs each number from right to left and returns '3,2,1' + */ + function forEachRight(collection, callback) { + var length = collection ? collection.length : 0; + if (typeof length == 'number') { + while (length--) { + if (callback(collection[length], length, collection) === false) { + break; + } + } + } else { + var props = keys(collection); + length = props.length; + forOwn(collection, function(value, key, collection) { + key = props ? props[--length] : --length; + return callback(collection[key], key, collection) === false && indicatorObject; + }); + } + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of a collection through the callback. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of the collection through the given callback. The corresponding + * value of each key is the last element responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keys = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keys, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method named by `methodName` on each element in the `collection` + * returning an array of the results of each invoked method. Additional arguments + * will be provided to each invoked method. If `methodName` is a function it + * will be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|string} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {...*} [arg] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the collection + * through the callback. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (property order is not guaranteed across environments) + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(characters, 'name'); + * // => ['barney', 'fred'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0; + + callback = createCallback(callback, thisArg, 3); + if (typeof length == 'number') { + var result = Array(length); + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + result = []; + forOwn(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of a collection. If the collection is empty or + * falsey `-Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.max(characters, function(chr) { return chr.age; }); + * // => { 'name': 'fred', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.max(characters, 'age'); + * // => { 'name': 'fred', 'age': 40 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + var index = -1, + length = collection ? collection.length : 0; + + if (callback == null && typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = createCallback(callback, thisArg, 3); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of a collection. If the collection is empty or + * falsey `Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.min(characters, function(chr) { return chr.age; }); + * // => { 'name': 'barney', 'age': 36 }; + * + * // using "_.pluck" callback shorthand + * _.min(characters, 'age'); + * // => { 'name': 'barney', 'age': 36 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + var index = -1, + length = collection ? collection.length : 0; + + if (callback == null && typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = createCallback(callback, thisArg, 3); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the collection. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {string} property The name of the property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.pluck(characters, 'name'); + * // => ['barney', 'fred'] + */ + var pluck = map; + + /** + * Reduces a collection to a value which is the accumulated result of running + * each element in the collection through the callback, where each successive + * callback execution consumes the return value of the previous execution. If + * `accumulator` is not provided the first element of the collection will be + * used as the initial `accumulator` value. The callback is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + if (!collection) return accumulator; + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg, 4); + + var index = -1, + length = collection.length; + + if (typeof length == 'number') { + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + forOwn(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is like `_.reduce` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg, 4); + forEachRight(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter` this method returns the elements of a + * collection that the callback does **not** return truey for. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that failed the callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(characters, 'blocked'); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + * + * // using "_.where" callback shorthand + * _.reject(characters, { 'age': 36 }); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + */ + function reject(collection, callback, thisArg) { + callback = createCallback(callback, thisArg, 3); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Retrieves a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Allows working with functions like `_.map` + * without using their `index` arguments as `n`. + * @returns {Array} Returns the random sample(s) of `collection`. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + if (collection && typeof collection.length != 'number') { + collection = values(collection); + } + if (n == null || guard) { + return collection ? collection[baseRandom(0, collection.length - 1)] : undefined; + } + var result = shuffle(collection); + result.length = nativeMin(nativeMax(0, n), result.length); + return result; + } + + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates + * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = baseRandom(0, ++index); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the callback returns a truey value for **any** element of a + * collection. The function returns as soon as it finds a passing value and + * does not iterate over the entire collection. The callback is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if any element passed the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(characters, 'blocked'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(characters, { 'age': 1 }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + forOwn(collection, function(value, index, collection) { + return (result = callback(value, index, collection)) && indicatorObject; + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through the callback. This method + * performs a stable sort, that is, it will preserve the original sort order + * of equal elements. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an array of property names is provided for `callback` the collection + * will be sorted by each property value. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 26 }, + * { 'name': 'fred', 'age': 30 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(_.sortBy(characters, 'age'), _.values); + * // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]] + * + * // sorting by multiple properties + * _.map(_.sortBy(characters, ['name', 'age']), _.values); + * // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg, 3); + forEach(collection, function(value, key, collection) { + result[++index] = { + 'criteria': [callback(value, key, collection)], + 'index': index, + 'value': value + }; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + result[length] = result[length].value; + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (isArray(collection)) { + return slice(collection); + } + if (collection && typeof collection.length == 'number') { + return map(collection); + } + return values(collection); + } + + /** + * Performs a deep comparison of each element in a `collection` to the given + * `properties` object, returning an array of all elements that have equivalent + * property values. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} props The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given properties. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.where(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }] + * + * _.where(characters, { 'pets': ['dino'] }); + * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }] + */ + function where(collection, properties, first) { + return (first && isEmpty(properties)) + ? undefined + : (first ? find : filter)(collection, properties); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array excluding all values of the provided arrays using strict + * equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {...Array} [values] The arrays of values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + return baseDifference(array, baseFlatten(arguments, true, true, 1)); + } + + /** + * Gets the first element or first `n` elements of an array. If a callback + * is provided elements at the beginning of the array are returned as long + * as the callback returns truey. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); + * // => ['barney', 'fred'] + */ + function first(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[0] : undefined; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `isShallow` + * is truey, the array will only be flattened a single level. If a callback + * is provided each element of the array is passed through the callback before + * flattening. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + * + * var characters = [ + * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * // using "_.pluck" callback shorthand + * _.flatten(characters, 'pets'); + * // => ['hoppy', 'baby puss', 'dino'] + */ + function flatten(array, isShallow) { + return baseFlatten(array, isShallow); + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the array is already sorted + * providing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + if (typeof fromIndex == 'number') { + var length = array ? array.length : 0; + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); + } else if (fromIndex) { + var index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element or last `n` elements of an array. If a + * callback is provided elements at the end of the array are excluded from + * the result as long as the callback returns truey. The callback is bound + * to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); + * // => ['barney', 'fred'] + */ + function initial(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Creates an array of unique values present in all provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of shared values. + * @example + * + * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2] + */ + function intersection() { + var args = [], + argsIndex = -1, + argsLength = arguments.length; + + while (++argsIndex < argsLength) { + var value = arguments[argsIndex]; + if (isArray(value) || isArguments(value)) { + args.push(value); + } + } + var array = args[0], + index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + outer: + while (++index < length) { + value = array[index]; + if (indexOf(result, value) < 0) { + var argsIndex = argsLength; + while (--argsIndex) { + if (indexOf(args[argsIndex], value) < 0) { + continue outer; + } + } + result.push(value); + } + } + return result; + } + + /** + * Gets the last element or last `n` elements of an array. If a callback is + * provided elements at the end of the array are returned as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.last(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.last(characters, { 'employer': 'na' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function last(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[length - 1] : undefined; + } + } + return slice(array, nativeMax(0, length - n)); + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. If `start` is less than `stop` a + * zero-length range is created unless a negative `step` is specified. + * + * @static + * @memberOf _ + * @category Arrays + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = (+step || 1); + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so engines like Chakra and V8 avoid slower modes + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / step)), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * The opposite of `_.initial` this method gets all but the first element or + * first `n` elements of an array. If a callback function is provided elements + * at the beginning of the array are excluded from the result as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.rest(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.rest(characters, { 'employer': 'slate' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which a value + * should be inserted into a given sorted array in order to maintain the sort + * order of the array. If a callback is provided it will be executed for + * `value` and each element of `array` to compute their sort ranking. The + * callback is bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + (callback(array[mid]) < value) + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Creates an array of unique values, in order, of the provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of combined values. + * @example + * + * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2, 3, 5, 4] + */ + function union() { + return baseUniq(baseFlatten(arguments, true, true)); + } + + /** + * Creates a duplicate-value-free version of an array using strict equality + * for comparisons, i.e. `===`. If the array is sorted, providing + * `true` for `isSorted` will use a faster algorithm. If a callback is provided + * each element of `array` is passed through the callback before uniqueness + * is computed. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); + * // => ['A', 'b', 'C'] + * + * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2.5, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + // juggle arguments + if (typeof isSorted != 'boolean' && isSorted != null) { + thisArg = callback; + callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted; + isSorted = false; + } + if (callback != null) { + callback = createCallback(callback, thisArg, 3); + } + return baseUniq(array, isSorted, callback); + } + + /** + * Creates an array excluding all provided values using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {...*} [value] The values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + return baseDifference(array, slice(arguments, 1)); + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second + * elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @alias unzip + * @category Arrays + * @param {...Array} [array] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + function zip() { + var index = -1, + length = max(pluck(arguments, 'length')), + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = pluck(arguments, index); + } + return result; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Provide + * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` + * or two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @alias object + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */ + function zipObject(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + if (!values && length && !isArray(keys[0])) { + values = []; + } + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that executes `func`, with the `this` binding and + * arguments of the created function, only after being called `n` times. + * + * @static + * @memberOf _ + * @category Functions + * @param {number} n The number of times the function must be called before + * `func` is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('Done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'Done saving!', after all saves have completed + */ + function after(n, func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * provided to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'fred' }, 'hi'); + * func(); + * // => 'hi fred' + */ + function bind(func, thisArg) { + return arguments.length > 2 + ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) + : createWrapper(func, 1, null, null, thisArg); + } + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all the function properties + * of `object` will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...string} [methodName] The object method names to + * bind, specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { console.log('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), + index = -1, + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = createWrapper(object[key], 1, null, null, object); + } + return object; + } + + /** + * Creates a function that is the composition of the provided functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {...Function} [func] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var realNameMap = { + * 'pebbles': 'penelope' + * }; + * + * var format = function(name) { + * name = realNameMap[name.toLowerCase()] || name; + * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); + * }; + * + * var greet = function(formatted) { + * return 'Hiya ' + formatted + '!'; + * }; + * + * var welcome = _.compose(greet, format); + * welcome('pebbles'); + * // => 'Hiya Penelope!' + */ + function compose() { + var funcs = arguments, + length = funcs.length; + + while (length--) { + if (!isFunction(funcs[length])) { + throw new TypeError; + } + } + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. + * Provide an options object to indicate that `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. Subsequent calls + * to the debounced function will return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {number} wait The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * var lazyLayout = _.debounce(calculateLayout, 150); + * jQuery(window).on('resize', lazyLayout); + * + * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * }); + * + * // ensure `batchLog` is executed once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * source.addEventListener('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * }, false); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + wait = nativeMax(0, wait) || 0; + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = options.leading; + maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); + trailing = 'trailing' in options ? options.trailing : trailing; + } + var delayed = function() { + var remaining = wait - (now() - stamp); + if (remaining <= 0) { + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + var isCalled = trailingCall; + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + } else { + timeoutId = setTimeout(delayed, remaining); + } + }; + + var maxDelayed = function() { + if (timeoutId) { + clearTimeout(timeoutId); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (trailing || (maxWait !== wait)) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + }; + + return function() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + return result; + }; + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { console.log(text); }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */ + function defer(func) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay execution. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { console.log(text); }, 1000, 'later'); + * // => logs 'later' after one second + */ + function delay(func, wait) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it will be used to determine the cache key for storing the result + * based on the arguments provided to the memoized function. By default, the + * first argument provided to the memoized function is used as the cache key. + * The `func` is executed with the `this` binding of the memoized function. + * The result cache is exposed as the `cache` property on the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + * + * fibonacci(9) + * // => 34 + * + * var data = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // modifying the result cache + * var get = _.memoize(function(name) { return data[name]; }, _.identity); + * get('pebbles'); + * // => { 'name': 'pebbles', 'age': 1 } + * + * get.cache.pebbles.name = 'penelope'; + * get('pebbles'); + * // => { 'name': 'penelope', 'age': 1 } + */ + function memoize(func, resolver) { + var cache = {}; + return function() { + var key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + }; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those provided to the new function. This + * method is similar to `_.bind` except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('fred'); + * // => 'hi fred' + */ + function partial(func) { + return createWrapper(func, 16, slice(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` function + * at most once per every `wait` milliseconds. Provide an options object to + * indicate that `func` should be invoked on the leading and/or trailing edge + * of the `wait` timeout. Subsequent calls to the throttled function will + * return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {number} wait The number of milliseconds to throttle executions to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + * + * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? options.leading : leading; + trailing = 'trailing' in options ? options.trailing : trailing; + } + options = {}; + options.leading = leading; + options.maxWait = wait; + options.trailing = trailing; + + return debounce(func, wait, options); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Additional arguments provided to the function are appended + * to those provided to the wrapper function. The wrapper is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('Fred, Wilma, & Pebbles'); + * // => '

Fred, Wilma, & Pebbles

' + */ + function wrap(value, wrapper) { + return createWrapper(wrapper, 16, [value]); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name the created callback will return the property value for a given element. + * If `func` is an object the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // wrap to create custom callback shorthands + * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { + * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); + * return !match ? func(callback, thisArg) : function(object) { + * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * }; + * }); + * + * _.filter(characters, 'age__gt38'); + * // => [{ 'name': 'fred', 'age': 40 }] + */ + function createCallback(func, thisArg, argCount) { + var type = typeof func; + if (func == null || type == 'function') { + return baseCreateCallback(func, thisArg, argCount); + } + // handle "_.pluck" style callback shorthands + if (type != 'object') { + return property(func); + } + var props = keys(func); + return function(object) { + var length = props.length, + result = false; + + while (length--) { + if (!(result = object[props[length]] === func[props[length]])) { + break; + } + } + return result; + }; + } + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Fred, Wilma, & Pebbles'); + * // => 'Fred, Wilma, & Pebbles' + */ + function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'name': 'fred' }; + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds function properties of a source object to the destination object. + * If `object` is a function methods will be added to its prototype as well. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Function|Object} [object=lodash] object The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options] The options object. + * @param {boolean} [options.chain=true] Specify whether the functions added are chainable. + * @example + * + * function capitalize(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * + * _.mixin({ 'capitalize': capitalize }); + * _.capitalize('fred'); + * // => 'Fred' + * + * _('fred').capitalize().value(); + * // => 'Fred' + * + * _.mixin({ 'capitalize': capitalize }, { 'chain': false }); + * _('fred').capitalize(); + * // => 'Fred' + */ + function mixin(object) { + forEach(functions(object), function(methodName) { + var func = lodash[methodName] = object[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + + var result = func.apply(lodash, args); + return this.__chain__ + ? new lodashWrapper(result, true) + : result; + }; + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + root._ = oldDash; + return this; + } + + /** + * A no-operation function. + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var object = { 'name': 'fred' }; + * _.noop(object) === undefined; + * // => true + */ + function noop() { + // no operation performed + } + + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var stamp = _.now(); + * _.defer(function() { console.log(_.now() - stamp); }); + * // => logs the number of milliseconds it took for the deferred function to be called + */ + var now = isNative(now = Date.now) && now || function() { + return new Date().getTime(); + }; + + /** + * Creates a "_.pluck" style function, which returns the `key` value of a + * given object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} key The name of the property to retrieve. + * @returns {Function} Returns the new function. + * @example + * + * var characters = [ + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 36 } + * ]; + * + * var getName = _.property('name'); + * + * _.map(characters, getName); + * // => ['barney', 'fred'] + * + * _.sortBy(characters, getName); + * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] + */ + function property(key) { + return function(object) { + return object[key]; + }; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number will be + * returned. If `floating` is truey or either `min` or `max` are floats a + * floating-point number will be returned instead of an integer. + * + * @static + * @memberOf _ + * @category Utilities + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating=false] Specify returning a floating-point number. + * @returns {number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max) { + if (min == null && max == null) { + max = 1; + } + min = +min || 0; + if (max == null) { + max = min; + min = 0; + } else { + max = +max || 0; + } + return min + floor(nativeRandom() * (max - min + 1)); + } + + /** + * Resolves the value of property `key` on `object`. If `key` is a function + * it will be invoked with the `this` binding of `object` and its result returned, + * else the property value is returned. If `object` is falsey then `undefined` + * is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to resolve. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, key) { + if (object) { + var value = object[key]; + return isFunction(value) ? object[key]() : value; + } + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'fred' }); + * // => 'hello fred' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '