��c��RDUCK3 �A ���8^_�0v��q)?PQtR� [�}1NU�� �  @`� � � � @Pp���� "0$P&p(�*�,�.�0204P6p8�:�<�>�@ A C@E`G�I�K�D�N�/Q S@U`W�Y�[�] ^�`b0dPfph�j�l�n�pr0tPvpx�z�|�~���0 @�`��������� � �@ �` �� �� �� �� � � �@ �` �� �� �� V� �� � �0 �P ���� �� �� �� � � ���P �p Ȑ ʰ �� �� ��� �@ �` ׀ ٠ D@D� �� ���� �@�`��� ������0�P�p����V�����1Qq� � ��1�@a����!!#A%a'�)�+�-�/1!~04Q6q8�:�<�>�@� �0DQFqH�J�L�N�OQ!SAUaW�Y�[�\�^�_a!cAeag�h�j�l�n�pr1tQvqx�z�|�~���1�Q�q�����aV�����1�Q������� ������!�A�a��������������!�A�a������Q�����1�Q�qȑ��������!�A�aׁ١������!�A�a��������!�A�a���!������� " B b � � � � !"!�1!R!"�!��!2�!�!�!"!""#B"%b"'�")�"+B2 ,�".� /#1"#34R#6r#D�#9�#;�#=�#?$A"$CB$Eb$G�H�$J�$L�$N�$P%R2%TBDP%V�#��W�%Y�%[�%]�%_&a"&cB&e�fr&h�&j�&��&m�&��&p'r2'tR'>b'�p'x�yrz�'|�'~�(�"(��R(�r(��(��(���0 ��(�)�")�B)�b)Bq)��)��)��)��)�*�2*�2�b*��*��*q�*��*��*�+�2+�!�b+�r+��+��+��+V�+�,�",�B,�b,ǂ,ɢ,��,��,Z�,�-�"-�B-�b-ׂ-٢-��-��-I�-�.�2.�R.��.�.��.V�.��/�"/�b�R/����/��/��/��/��/�0#0C0c0Bq0�0g�0 �0 �01�31S1s13 �1�1C$K�12!#2#C2%c2'�2'�2*�2,�2��23�20�#1#33C35c3�r38�3:�3<�3>�33��4A#4�04D�&Ec4G�4I�4K�4M�4B!O5Q#5L25TS5Vs5X�5Z�5\�5^�5�6a#6cC6e3 fs6h�6j�6l�6n�6p7r37tS7vs7x�7z�7|�7~��8�38���c8��8��8Ȳ8��8��8�9�39��*�c9��9��9����9��9��9�#:�C:�c:^q:��:��:����:�;�#;�C;�c;��;D@I�;��;��;��;�<�#<�C<�c<�r<ȓ<ʳ<��< �<�=�#=V`נ�31�CBQ=�s=ؓ=ڳ=��=��=�>���>�3>�3 �c>�>�>��>��>��>;?�:�#?n0?�S?�b?��?I�?��?��?��?�@$@D@t@D0 �@'�@ �@��@��@A4A@AdA�A��A�&��A�A B"4B$TB&tB(�B*�B,�-�B/C1$C3DC5dC7� 8�C:�C�S@TB�I0TD�4I�E�FuTH�TJ�TL���TN�TPUR5UVTUUVuU8" X�UZ�6[e��\�U^�U`Vb5VdUVfuVh�Vj�k�Vm�VoWq%WsEW�QWvbWw�@x�y�W{�W��W��WX�%X�5���E�uX��X��X��X�E<��+�Y�5Y�UY�uY��Y��Y��Y���Y�Y�Z��V�2Z�UZ�uZ��Z��Z��Z��Z�[���%[���U[�u[��[��[���%3��[�\�%\�E\�e\Dž\ܒ\ʵ\̥7��\�]�%]�E]�e]ׅ]٥��%�E��]��]�^�5^�U^�u^�^��^ð^��^��^�_��@]t1_mT0D_�P_�u_��_��_��_��_�`&`F`f`W�` �` �`Fa�a6"aFafaf6�aҤa�a�a��Ab!&b#Fb%fb'�b)�b?�V+�b-�b/�0c26c�Cc5fc7f0e�c�c:�c<�c��c?dA�TB6dD�7EHFvdH�/I�J�dL�dNF �dPe#eSFe�TeceWc�HX�eZVW[�e]�e��e`fb6fdVffvf��h�=iFj68��f��fm�n�ogg�%gsFgufg�pgx6 y�g{�g}�>~�g��-�&h�0h�Vh����h��S��h�Fe��h�iVi�v@4i�Vi��;����i��i�A<��i����i�j�&j�Fj�fj��jX�j��j�&��j�k�&k�Fk�fksk��k���k��e����k��A�&l4l�Vl�vlȖɦl��l(�l��l�m�p^�$�)�Fm�fm׆m٦m��m��m�n�&n�FnMTn��m�vnFL�n�n�n��n�F0�o�"o�Fo�fo�&�FP��o��o��o��o�"FI���N7pFgp�p �p � �p�pqI q0qWqwq�q\�q�q��I�qf�q �;!'r#Gr%gr'�r��#)���r+�r-�r/s1's3Gs5gs7�s9�s;�so�s��r>�s@G<�tB7tDWtF�oG�t��tJ�tL�t��tOwOPuR7uTWuVwuX�u��LZ�u\�u^�u`�a'vcGvegvg�vc�vj�vA�vm�vo'Epwr7w�DwuG^a�*vwwx�wz�w|�w~�w�x��jl5x���gx��x��xV�x��x��xy�W!�7y�Wy��_�7��y��y��y��yQ� �z�7z�Wz�wz��6 !>�'>0� ��z��z�g��z�{�7{D@{�g{��{,�d����{��{��{�|�7|���g|�wI�|ɧ|����|X&/��|�q�}ч\X�� }�G}�g}ח ;#B�}٧}��}��},F�~�~�7~(@~�g~�~T����~��~�F(��~��'�G�g����(��������@��"�$3��qD�UEh�G��I���@]K�IL؄N��g���!��0�,G�Uh�W��x��Z����&�…]�h�`�=a(�c��D�eh�gWh��⡆k(l؆n��4�;�r8�tX�vx���hx��z��|؇Q#x~����?��8���X��`����;����+^��1�%�؈����8a�(��2��X��x�������x��T�x �剟��x� ���k�Bp�X��y����`/���H�Ȋ��������(��X�HB�h�#�������x1�؋�����e���!��5��X��x�Dm}��ɨ��Ȍ��(@?��N��C8�8��X��x�ؘ�ڸ�ƍ�����%I �5��X��x����騎�Ȏ��}���(p�h�8��@��h�u��茺������؏���yh�}�79�Y�y�߅�s�� � ɐ � �'�9�I0Y� `��w�����ّ�� ��R0!)�#I�%i &y�(u)��+ɒ-�/�E0�29�4)�P�0g� q�8��:y);Ɂ<ٓ>������@�B9�DY�Fy�H��J��LٔN��P�R9�TY��f�W��Y������•]镌�?_ ���b9�dY�Kh�g��i��kɖDЖn��p���sr9�UD�u!vy�x��z��|yk}�$񗀙���9��Y��y��������٘�)����YB�)��i��A�i��������ə�陟 ��)��I�Hi;C�T��y��IX���er�ɚ�ؚ(㚯 ��)�Y�?�I��T������i����(���雿� ��%� ©�I��i�lj�ɩ���i�ɜ� !���� ��)�9�F��i� w���@��Fؙ�ڹ���#�ٝ�*ߩ����z�9�MB��IF�i����驞�`6[���ž�О�������9��9B!�i��Bq��������)e��� �*�J��:��� �� � ڠ��0�z�� �*��0��h�Uj�� ���� eMԡ���@0�! �P'�#J��Y���&z��1(:)��+ʢ-* �/ ���2:�4�)5j��p�8z9��;�M^ɣ=�?�@�BJD0�h�w�~DZ�c��q�H��J�KzLڤ��OzEPJQ*�@Q S�Y��@�Uj�lu�X������\ڥ^���!&`j�a�b��0�Y�d*ej��q�h:i����kʦm���o �q1���r:�tZ�+*3vz�x��z�Xv�{ʧ}*[~��j䚀���*��z�Z��z�j�����L�t�ʨ��x����2%��J��j�Ar��������ک��zM�������*��J��jM`�Dz���������j^�ZH�ڪ������:8���j1����Z���9�������ʫ�ӫ�Jo eYE:�ٕ��8������ ��J��j��JG��$��ʺ��ڬ9�� �oRb�J�:��Z�ha�׊�٪��ʭ��� ��*��V0�J��#�b�犮骮�ʮ���:`���j:��Z��z���g�Z��������ʯ����b�+� �[�BA]Di��� �� ˰ � �+���A��{���ˢ���a�۱��m�!+�{�#K�%+N&{�(��*��,۲B�/;.0�e1�G2���0��H��W�6�s���9��;��<۳�VH>����A� ����0��13A���Y�X�FK0G���J��Oȴ>�?M�O �Q+�S;�T��R�Uk�W��Y�Z�=[˵]�_ �a+�cK��W�f�D�g�h��j��l�Nm붌�p����6r;�t[�v��p�I�B!Dx����{˷���Rhѷ~�����'��K��k�������#���۸������ ��7�I�G��G�~�k�r����BaU%��ǁjB(-���۹��� �����;���#�[����{)�������;��9�׺�[E�;w����K��6�;��[��{��������ۻM仿 ��Kx�;��[�(`�@q�ț����[��ȼ��9f�� ��+�V0�0G���{���{�؛��k$�˽?˖$�#L���ӽ���F">��W�Q�1��;��F�ё��� �{��髾$����۾���+���;��{�k��ˮ���B������ۿM�� ���<�!� \��`�Vp���� ����� � ;��L����'�<��K�l���������� �7��F� �L����P���N�s��LD�V٬=ڼ�������0w�������r�LR�<�VK�\���nI���|��Ό���Xv�2 �,��Ό��;���%���s3�M)��L��lυx���Ϝ �<�s��V����3���� �L�D��=�]��8P ��������� �� �� ]�� B�cBA/� �9�I(�M�m�s��Ѫ�ѽ��ò��Ѭ��H��N�dI�"=�$]� �3�f�'��ҏ��*�1���,m���.�|/m��10�1-�3M�EX���6m;�p�8m�9��;��=��A�Ӯ ��B]rCm+' ��xhD]�D`�sp��$��)H��l������MzL-M��O=)P�)&�S��[QT]�V}#W}�kX����[]����\��^��`m���b=�d]�`�g��i�Y���'�f��k��m�]n��p����r 3�#�sM�um�w��y��{$|��~�����P�S��3�-؃M؅ /�}؈=(�M��،]a��؏ �i�B!�14��# G�V�m�;s�N�ٙ�ٍrO��ٝ�٫�٪ ڡE� �Mڥmڧ y��ڄ���Q ��ڬ�ڮ�8�����{%�$!۳]bG۵m۷�ۊ��l��\�ۼ��N�ľ��< ��-��M��m�hT�Ǎ�ɭ���������Эc�-�b:��-,�m��}���٭�Q��������� �ʎ�iQ�-�-&5�M޹pR;�b�}�}���w���r������ ��-��M�yY��}��=�������)�(�m����>��C���&eY~������w .� ����-�>�qE�n��bί������������?�� �0!.�#N�%n�'��)��+��,��.��0�2>�4�5n�Ip�8��:^I ��<��>��� �A.�CN�@�S�F~�H��J����L����O�QN0R>�T^�V~�X��*��ij�[��]��_�`�c-�cN�en�g��i��͵�l��n�����r>�t^�v�wޛxn}y^wz��|��~��޿�.�.̄^����艮��荾C����.�N�]ҕn闎���^�o�s��������>��B��-�~ꨞꪾ���}b�������l%�N�n뷞����D��U��������>��^��~�f��ɮ�ˎ����������>�o�=�^��~�׎�Q��ھ����������>��.�n���������"쾡��������W��^��~Q��������������/�ߜ @�o��� �� �� ��/��?�_������D�����!��"?�$_�&_'��(�� �R*��,��.|/�1/�3O�,P�6�<����:��<��=��?�A��B?�|N�Eo�G�����J��LO2M��O���R�(S�T_�V�X�Y��[��]��_�a�b��cWd_�f����g����h��z��k�M� ��m��o�q�nr��Y>�t_�v�x?]yOz��|��,��]����/�������o�������������������-�]l8�����?����;�������w������/���_�����8�^��-Eh���!8���)@W�����:Qe���4Gu����+D|����6Md|����)@p���.T���� B f r � � : L � � �   R � � � �  / o � � �  . `  � � � D^����&E_x���5f����� ;m���d|�� Y���� :t����:p����7E���+Q����+F����0es����=u���.i���&K����� 7`��]���#=Wr���( F � � � %!a!|!�!�!�!�!4"~"�"�"�" #Y#�#�#�#�##$i$�$ %%%y%�%�%&X&�&�&''9'{'�'�'�'(b(|(�(�()I)�)�)�)�)�)*6*{*�*�*+E+�+�+�+,I,�,�,4-O-]-�-�-�-.?.�.�.�. //+/H/�/�/�/�/ 050T0s0�0�0�0141g1�1�1�12,2G2T2�2�2�2�233$3B3T3f3�3�3�3�3�34?4P4o4�4�4�4�4�4 5+5b5�5�5�5�5�5�5 636H6_6|6�6�6�6�6�6�6707o7�7�7�7�7�78#878W8t8�8�8�8�89959U9o9�9�9�9�9�9:8:L:`:�:�:�:�:;3;I;j;�;�;�;�;�;�;<><U<l<�<�<�<>=S=y=�=�=�=�=>S>h>x>�>�>�>�> ?.?Q?f?{?�?�? @)@K@a@}@�@�@�@�@APAeA{A�A�A�A�AB=BOBrB�B�B�BCC/CEC�C�C�C�C D,DSD�D�D�D�DE@EeE�E�E�E�E�E5F\FwF�F�F�F�F G.GEGjG�G�G�G HMH�H�H�H�H1IgI�I�I�IJ*JRJiJ�J�J�J�JKKK�K�K�K�K L3LhLL�L�L�L#M4MLMdM�M�M�M�M�MN:NRNdN�N�N�N�NO5O[O�O�O�OPPAP`PvP�P�PQ:QtQ�Q�Q�Q�QR!RHRpR�R�R�R�R&S?SgS�S�S�STDTlTzT�T�T�TUCU\U�U�U�UVVBVjV�V�V�V�V$WEWXW|W�W�WX/XFXYX�X�X�XY"Y5Y`Y�Y�Y�Y Z'ZQZmZ�Z�Z�Z [7[Q[q[�[�[�[�[\0\W\n\�\�\�\ ]7]b]�]�]�]�]�] ^\^�^�^�^�^_M_x_�_�_�_`/`^`�`�`�`�`�`a4aDa_a�a�a�ab*bFbTbxb�b�b�b c5ccc�c�c d9d�d�d�deGebewe�e�e�ef%fWf�f�f�fg7gjg�g�g�g�g h+hGhdh�h�h�h iiZi�i�i�i!jRj�j�j�jkPkvk�k�k l&l[l�l�l�l�lm#m/mbm�m�m n%n4nAnNn�n�n�n�no'o]o�o�o�o)p;p\p�p�p�p�p+qdq�q�q�qrTr�r�r�r�rs=sss�s�st*t;tZtjt�t�t�t�t�t u(u\uzu�u�u�u vOv_v}v�v�vw#wKwsw�w�w�wx+xhxyx�x�xy@y�y�y�yz:zez�z�z�z@{~{�{�{|>|h|�|�|�|%}e}�}�}@~�~�~O����A�����؀�E�������5�}����,�s�����Ӄ���^����4�Y�����˅���I�l�������)�>���ه*�?�T�r�����È�;�U���������ʼn�D�g�}���ߊ8�Z�|�������ы��'�9�K�����ό�"�F�s�����ύ��%�K�o����� ��5�[�~�����̏����� �4�X�p�������Ր���0�A�U�n��������N�b�����ג�"�<�R�x�����Ǔ֓� �"�6�]�����ޔ��B�U�o�����ԕ�,�T�i����������R�l�����̗��%�:�c�p�����֘���8�X�o�������+�k�������Ԛ�����H�T�}���ћ��$�Q�i�����؜���4�P�j�����Ýݝ��&�>�V����������a���͟��%�=�O�{�����ˠ��;�]�����!�B�T�����ݢ��(�U�p����������-�P�n�|�������8�l���������+�H�~���֦(�>�W�n���ԧ��?�c�����̨��3�M�v�����©�)�C�]�i������B�]�w���ȫ٫��E�k�������.�N�f�����ԭ �'�X���®���K������ �(�e�����ڰ���$�E�|�������/�K�c���²�8�M�i���س��0�l������W�m���ҵ�K�t������������X�w������G�_���ʸ�]�����ҹ��(�c��������?�[�t���û��6�W�z���ڼ���S�l�����ν�N�����ξ�.�9�O�t�ȿ���u����������,�n����������,�Z�x���������O�g��������6����������<�i�z����������d�����������R�j����� �1�P�p������)��������0�J�f�x��������&�G�o������?�]�|����������1�D�g��������'�F�Y�j�{������������-�L�����������/�X�z������������ �2�F�]����������+�S������)�R�j��������*�M�w�������� �3�k��������V��������� �)�H�{������������@�S�b�����*�`��������3�v��������� �>�u����������g�{�������������-�T�{��������*�n�����������=�]�t����������5�D�\������� �P��������C�X�x���������#�[�s�������;�]�|��� ��X�|������� �2�T�v�������4�J�l���������7�M�c�y���������>�d�|��������.�T�o���������!�8�e����������3�V�m����������G�^�u���������^��������2�L�p������������)�Y��������S�m�����.�>�Y�v��������$�T������� �<�W��������'�:�O�������������C�x�������-�I��������B�q��������������@�O���������-�N����������>�[�x�����9�V�s��������W��������L�z��������!�_�������8O�����&���?Tr���+b���(Sd��8P~����#?l�����+_~�/Zv�� M � �  ( h z � � �   ? � � � �  A a � � � �  * H [ j � � � � � � >_z��� )@s���� +Au��[����):W����5l���� Ad�� ":Vn���$au����,Q���2i���/p�����?\q���2G^���9^{����>W���6�����J_~��� 6 ^ � � � �  !!@!W!g!�!"9"j"�"�"�"�"#>#g#�#�#�#�#$8$a$�$�$�$�$"%Q%q%�%�%�%�%�%&C&x&�&�&�&'2'\'u'�'�'�'("(M(k(�(�(�(�(�()8)d)u)�)�)�)�) *6*Y*j*�*�*�*�*�*+/+M+k+�+�+�+,,,F,i,�,�,-<-O-n-�-�-�-�-�-.-.U.�.�.�.�. /'/K/�/�/�/�/0X0q0�0�0�0�01C1z1�1�1�1�12Y2t2�2�2�2�23)3n3�3�3�34;4`4o4�4�4�45F5o5�5�5�5696R6s6�6�67r7�7�7�7 8&8A8\8l8�8�8�89G9]9n9�9�9�9.:I:�:�:�:7;q;�;�;<A<{<�<�<�<�<�<!=_=�=�=�=>/>n>�>�>?/?o?�?�?�?@:@d@�@�@�@A'AFAcA�A�AB:BeB�B�BC?CfC�C�C�CD@D�D�D�D"E?ENE�E�E�EF`FF�F�FG$GCG`G�G�G�G:HWH�H�H�H�HI!I8ILIsI�I�I�I�I3JTJdJ{J�J�J KTKuK�K�K�K�KLL[L�L�L�LM+M@M�M�M�MN#N=N^N�N�N�N O1ONO�O�O�O�O$P@PcPqP�P�P�PQ2QCQ�Q�Q�Q RLReR�R�R�R�RS?S�S�S�S�S5TcTuT�T�T�T�TPUvU�U�U�U�U�UV7VjV�V�V�V�VW=W`W�W�W�W X$Xkakyk�k�k�k�klDl[lrl�l�l�l�l�lm!mNm|m�m�mn$n6n]nnn�n�n�n�no3oNoto�o�o p.p=pWpyp�p�p qCqbq�q�q�qr&r9rGrtr�r�r�rs=sVsqs�s�s�stGt�t�t�t�tu!uWumu�u�u�u�uvFv\vpv�v�vw7wQw�w�w�w x>xpx�x�x�x&y_y}y�y�y�y'z7zqz�z�z�z {A{�{�{�{|B|u|�|�| }.}E}d}�}�}�}(~9~x~�~�~6]���6�I�z���ǀ��'�E�w���ā�O�d�����˂�6�c�y���ƃ݃�)�R�{�����Ԅ��N�`���� �,�\���ņ׆����8�~���ȇڇ#�l�������/�S�q���Չ�(�M���ъ���3�Q��������9�S�k�~�����،����2�]���������&�8�X���Վ��9�N�w�������#�8�o�����Ɛߐ�.�]������� �5�G�b�}���Ւ��]�s��������P�f�u���ɔ����,�>�T�k�����ӕ���*�^�u���Ŗ��P�������)�R�������Ҙ��0�`�r����������%�<�r��������'�K�o���ś��,�g������֜����$�0�U�v���ϝ� �(�8�U�������О�3�Y�r�����ܟ���i�~�������8�K�e�~���١���@�V�v���Ģ���4�S�q�����ԣ �#�<�v���Ҥ�&�~������Z�s�������2�O���ҧ��8�O�s�����̨ڨ��A�g�����������0�[�������٪N�i�������� �2�I�c������#�P�}�����ҭ �%�P�t�����ۮ�.�M�������ү��8�Z�|�����ް�!�M�}��������>�p�����Ͳ�3�G�f�������ٳ���0�x���´��X��������� �,�M�w�����ƶ��>�a������ �6�@�������Ƹ���$�N�x��������a�����Ӻ���%�F�v�Ļ$�>�r�������ܼ �B�U�u�����ؽ���L�_�s�����Ծ��:�b�����ڿ��#�F�q��������-�C�Y�z�����1�J�i�������2�J�n��������S�m������� �!�G����������� �2�n�����3�Z����������X����������#�6�x���������������2�L�h�|�����������A�R�x����������9�e�������������*�A�`�r������������#�J�o��������?�P�g������������9�[������������[�j����������"�[�z������a����������"�9�m��������0�G�[�k����������7�W����������9�q��������%�E�w������F�f������ �[�o����������8�K�h�x�����!�A�\�}���������#�[�{��������$�@�y���������"�K�t������#�[�o����������.�Q��������&�E�j���������@�t��������-�p������� �+�j�~����������,�K�t���������(�F�q��������� �$�C����������,�N������� �?�h�}������*�P�s����������)�O�s���������=�S�h����������3�a����������� �-�Q�b����������� �;�X�m�~����������0�P�h���������<�n��������6�L����������M�r��������#�G�k�������������+�H�`��������:�I�o��������I�i��������&�:�b�v��������@�k��������@�W�y�������(�]��������T������E�j������� �J�w�������R���2Ve{��=k���/ax��� ;q��&\��[����$Gy���'Z���� Q � � �  ; o � �  6 I � � � � 0 X � � �  B a  � � � � 4\w�"@h��Gu��� $IY��1Mf���3X~�����3Ee��� 9\v��� <`���1La�����Ebz���D]����)\����3g��.L��)Ss���'Bes���� #?l��� 0 n � � !I!z!�!�!�!�!" ":"a"x"�"�" #)#`#�#�#�#$$|$�$�$�$%g%�%�%�%�%�% &%&E&e&�&�&�& '!'V''�'�'�'�'(<(�(�(�(�(()A)})�)�)�)*>*m*�*�*�*++>+~+�+�+�+�+,D,d,�,�,�,�,-6-q-�-�-�-�-0.h.�.�.�.�.�./*/A/l/�/�/�/�/ 070]0�0�0�01.1a1�1�1�122P2r2�2�2�2�23Q3�3�3�3�34G4^4u4�4�4�4�45*5H5]5{5�5�5�5�576]6v6�6�6 737o7�7�7858^8t8�8�8�89A9Y9t9�9�9�90:T:_:t:�:�:�:�:;?;N;u;�;�;�;�;�;<#<M<b<w<�<�< =Z=q=�=�=�=�=7>n>�>�>�>'?B?U?n?�?�?�?�?7@Y@u@�@�@�@�@@ASAmA�A�A�A�A�A!BIBkB�B�B�B�B�B>CxC�C�C�CDKDfD~D�D�D�D!E_E�E�E�E�E.FHFwF�F�F�FG&GkG�G�G�G�G HCH[H�H�HI+I[I|I�I�I�I*JXJ�J�J�J�JK,KPKyK�K�KL?LQLdL�L�L�L�L&MPMgM�M�M�M�MN1Nmenus/settings-view.csonsrc/browser/squirrel-events.coffeeexamples/coffeescript/camera-face-detect-max-frames.coffeeclient/src/scripts/util.global.coffeelib/a_to_z.coffeeapp/scripts/alchemy/start.coffeescripts/convert._coffeefb_instant_articles/fb_generator_tags.cjsxapp/assets/javascripts/darkswarm/directives/off_canvas_wrap.js.coffeecontrib/state-machine.coffeeapp/lib/custom_exception.coffeespec/atom/app-spec.coffeesrc/spec/producttypegenerator.spec.coffeetest/closing.coffeespec/Rotate.coffeeapp/assets/javascripts/issuable_context.js.coffeeapp/assets/javascripts/facebook_login_hash_fix.js.coffeetest/integration/prepare-execute-statements-test.coffeespec/incompatible-packages-spec.coffeeroadmapplanningboard/BaseModelSpec.coffeeserver/startup/migrations/v11.coffeesrc/scripts/clojure.coffeesrc/scripts/spot.coffeespec/javascripts/spec_helper.js.coffeedefault_sensors/countdown.coffeebuild/tasks/output-long-paths-task.coffeeapp/assets/javascripts/services/state_service.coffeeservices/document-updater/expire_docops.coffeeservices/web/test/acceptance/coffee/RegistrationTests.coffeeutils/dataUpdate.coffeeapp/assets/javascripts/procedure.js.coffeeapps/artwork_2/components/commercial/query.coffeeapps/artist/test/templates.coffeeapp/assets/javascripts/media/preloader.js.coffeesrc/packages/fuzzy-finder/index.coffeeapp/assets/javascripts/darkswarm/directives/registration_limit_modal.js.coffeeapp/controllers/interactive/navigator.coffeesource/javascripts/tests/eventsource_spdy.coffeespec/command-spec.coffeepackages/rocketchat-ui/lib/recorderjs/audioRecorder.coffeesrc/coffee/messenger-theme-flat.coffeetest/object-expression.coffeesrc/test/data/all-data.coffeesrc/coffee/client.coffeeapp/assets/javascripts/roles.js.coffeemigrations/20140410202000-time-entries-negative-duration-check.coffeeclient/stacks/lib/routehandler.coffeetest/components/activity/activity_table_row.coffeeservices/contacts/prepopulate.coffeeassets/js/vote.js.coffeesrc/keymap-extensions.coffeetest/javascripts/unit/public_api_test.js.coffeelib/shared/payments.coffeeapp/assets/javascripts/controllers/users/index.coffeepackages/rocketchat-ui-login/login/header.coffeespec/app/theme-spec.coffeeapp/assets/javascripts/coffee/chrome.js.coffeesrc/atom/vim-mode/operators.coffeelib/appBaseComponents/views/grid/CustomServersideFilter.coffeesrc/scripts/github-issue-link.coffeeapp/coffeescripts/TreeChildItemDemandLinkView.coffeelib/execution-manager.coffeeapp/assets/javascripts/merge_requests.js.coffeespec/grammar-spec.coffeemiddleware/subdomain.coffeeapp/assets/javascripts/hyper_admin/angularjs/states.js.coffeeapp/assets/javascripts/s3_relay.coffeelib/SocketIOLimiter.coffeeapp/assets/javascripts/collection.js.coffeetest/src/unit/mutation_observer_test.coffeedocs/app/src/api/comment_section/comment_section.ng.coffeespec/javascripts/unit/admin/filters/unlocalize_currency_spec.js.coffeenode.js/server.coffeespec/node/contexts.coffeespec/latexmk-spec.coffeecomponents/CanvasToBuffer.coffeeSingularityUI/app/models/Request.coffeetest/registerTemplates-test.coffeedesktop/assets/editorial_features.coffeespec/projects-list-view-spec.coffeetest/helpers.coffeetest/spec/tt.ui.spec.coffeesrc/app/installed-packages-config-panel.coffeesrc/focusable.coffeeserver/controllers/filters.coffeelib/git-status-view.coffeespec/Subtree.coffeesrc/desktop/apps/artwork/components/metadata/test/templates/index.coffeelib/workspace-utils.coffeespec/javascripts/extensions/array_spec.js.coffeesrc/scripts/whos-turn.coffeetest/unit/metadataTest.coffeescripts/name-expander.coffeeplugins/github-issues/index.coffeejs-library/app/js/jail_iframe/classes/performance_measurement.coffeeapp/assets/javascripts/courses.js.coffeelib/actions/textfile.coffeelib/shared/lib/stats.coffeedev/tests/angular-database-model.coffeespec/specs/doerror.coffeehelper/stamp.coffeekeymaps/vertical-align.csonpackages/rocketchat-livechat/app/client/methods/sendMessageExternal.coffeemenus/open-on-github.csonapps/artwork/test/routes.coffeesrc/desktop/components/auth_modal/test/templates.coffeeserver-ce/migrations/6_add_track_changes_feature.coffeeclient/admin/lib/views/invitations/invitationslistcontroller.coffeejs-library/app/js/publisher_poc/publisher_plugin.user.coffeeapp/src/utils/object.coffeeplugins/i18n.coffeemenus/autosave-delay.csonutil/places2yaml.coffeejs-library/app/js/jail_iframe/classes/ready_promise.coffeeservices/web/test/unit_frontend/coffee/ide/editor/directives/cmEditorTests.coffeestylesheets/__tests__/layout-test.coffeesource/javascripts/tests/simple_cors_spdy.coffeetest/node-test.coffeesrc/programmer.coffeesrc/mobile/components/filter2/index.coffeespec/db-spec.coffeemodels/featured_link.coffeescripts/dialog.coffeescripts/mcstatus.coffeespec/token-iterator-spec.coffeespec/Component.coffeespec/api-desktop-capturer.coffeelib/assets/javascripts/bobcat.js.coffeejs/utils.coffeeapp/assets/javascripts/radio_buttons.coffeesrc/notification.coffeeclient/app/modules/store2.coffeeSingularityUI/app/lib/view_helper.coffeetest/rewind/rewinder.coffeecomponents/artwork_filter/index.coffeetest/auth-spec.coffeeinit.coffeesrc/coffee/kopi/utils/jsonrpc.coffeeapp/js/publisher_poc/publisher_plugin.user.coffeeassets/javascripts/react_nodes/bootstrap_slider.coffeeclient/app/lib/stacks/basestacktemplatelistitem.coffeesrc/scripts/reddit-jokes.coffeesrc/scripts/newrelic.coffeeapps/artist/index.coffeedesktop/apps/partnerships/client/router.coffeeapp/assets/javascripts/admin/views/home/index.js.coffeetest/unit/preprocessor.spec.coffeetasks/download-github-releases-task.coffeetest/spec/invoke.spec.coffeehome/.atom/init.coffeequests/outputexample/outputexample.coffeesrc/spec/integration/states.spec.coffeeserver/models/requests.coffeebackend/spec/javascripts/comable/admin/order_item_builder_spec.coffeeFramework/Views/Controls/ImageButton_Framework_Android.coffeecore/htdocs_source/src/pods/oxisection-main/component.coffeescript/list-options-and-languages.coffeecomponents/commercial_filter/filters/category/category_filter_view.coffeesrc/app/api/models/rollover-unit.coffeespec/rubocop-auto-correct-spec.coffeesrc/daemon/app/env.coffeesrc/lib/dbc/entities/area-table.coffeeapp/assets/javascripts/components/moving_records/charts.js.coffeespec/messages-spec.coffeecomponents/ResizeBuffer-node.coffeebase/assets/javascripts/tumblr.coffeemenus/command-palette.csonspec/minimap-model-spec.coffeesrc/vars/index.coffeemenus/debugger-ui-default.csonclient/test/src/indicator_model.coffeespec/viewCacheSpec.coffeescripts/pjc.coffeetasks/publish-packages.coffeeapp/assets/javascripts/views/auto-save-checkbox.coffeespec/Graph.coffeesrc/scripts/lolz.coffeetest/system-spec.coffeeapp/assets/javascript/the_merger/insert_field.js.coffeeapp/assets/javascripts/housing_locations.js.coffeesrc/scripts/thanks-obama.coffeelib/move-dialog.coffeeclient/app/models/settings.coffeeservices/web/public/coffee/filters/wrapLongWords.coffeeapp/assets/javascripts/backbone/views/chatbox.js.coffeespec/linter-indie-api.coffeekeymaps/git-plus.csonclient/skr/components/SalesOrderFinder.cjsxtest/unit/bin.coffeesrc/mobile/apps/artwork/components/meta_data/view.coffeespec/linter-helperexec-spec.coffeeapp/assets/javascripts/views/paper_edit_view.js.coffeescripts/worldcup.coffeeclient/admin/lib/views/stacksv2/definestackview.coffeecomponents/commercial_filter/models/params.coffeesrc/infinite_scroll.coffeespecs/unit/type_error_spec.coffeesource/javascripts/tests/preflight_cors_spdy.coffeetest/javascripts/letterclick_test.coffeeSingularityUI/app/collections/TasksActive.coffeeapp/assets/javascripts/login_menu.coffeetest/test-cmp.coffeetest/javascripts/components/question_component_test.js.coffeespec/color-project-element-spec.coffeeSingularityUI/app/collections/Webhooks.coffeesrc/scripts/pgsql.coffeecomponents/simple_contact/views/index.coffeesrc/tools/github.coffee_source/client/helpers/dependency-fix.coffeesrc/coffee-cache.coffeescript/translate-crash-log-addresses.coffeespec/config-spec.coffeescripts/keepalive.coffeeserver/methods/loadLocale.coffeeapp/routes/main-tab.coffeemenus/keybinding-resolver.csonapp/api/package.coffeetest/coffiew/config.coffeeapp/components/resource-input.cjsxapp/assets/javascripts/outpost/context_options.js.coffeeshared/test/components/exercise/two-step-help-mixin.spec.coffeesrc/packages/gists/lib/gists.coffeeserver/controllers/index.coffeecomponents/zoom/index.coffeesrc/coffee/kopi/utils/klass.coffeeapp/assets/javascripts/extensions/custom_file_inputs.coffeeapp/scripts/lib/fuzzy-search.coffeelib/processor._coffeejs/tests/changelog-tests.coffeeapp/assets/javascripts/dot_ledger/collections/index.js.coffeetest/common-utils.spec.coffeespec/grammar-registry-spec.coffeetest/signers/presign.spec.coffeepackages/rocketchat-highlight-words/client.coffeelib/simpleAuth.coffeeatom/common/api/lib/shell.coffeeapp/assets/javascripts/store/checkout.js.coffeesrc/scripts/github-issues.coffeedev/standard.csonapp/coffeescripts/react_files/components/FriendlyDatetime.coffeetest/error-func-undefined.coffeespec/CanvasToBuffer.coffeeapps/artist/queries/cv.coffeespec/coffeescripts/jsx/assignments/ModerationAppSpec.coffeecomponents/saveProgress.coffeeserver/models/model-events.coffeesrc/Witness/specs/SpecificationDirectory.coffeeapp/frontend/javascripts/views/visualization-canvas.js.coffeeapp/assets/javascripts/sidebar.js.coffeeJakefile.coffeecoffee_test/spec/directives/supermanDirective.coffeesrc/storage-folder.coffeespec/dummy/spec/javascripts/validatable_input_spec.js.coffeeapi/routes/gallery.coffeeapp/assets/javascripts/rglossa/react/main_area.js.jsx.coffeecomponents/Rotate-node.coffeespec/archive-editor-spec.coffeesrc/packages/tree-view/keymaps/tree-view.csonapp/assets/javascripts/rails/add_ons/application/acts-as-list.js.coffeesrc/spec/integration/channels.spec.coffeesrc/scripts/ruby.coffeesrc/scripts/cat.coffeetest/unit/prettify-response-test.coffeelib/special-stored-procedure.coffeeserver/methods/migrate.coffeetest/create_build_directories_spec.coffeemigrations/20140502015332_allow_null_for_teams.coffeescripts/hubot.coffeeapp/assets/javascripts/dialog.js.coffeetest/server/conditions/unreleased_ban_spec.coffeespec/OutPort.coffeeresources/assets/coffee/react/_components/beatmap-icon.coffeesrc/browser/atom-portable.coffeepages/ui_component_server.coffeetest/hangout.spec.coffeebenchmark/browser-process-startup.coffeetest/message.coffeetest/kwargs.coffeetest/e2e/sessionDetailSpec.coffeehelper/swf.coffeeatom/browser/api/lib/app-command.coffeeteaspoon-jasmine/lib/teaspoon/jasmine/assets/teaspoon/jasmine1/fixture.coffeeclient/routes/filters.coffeespec/app/git-spec.coffeeservices/web/public/coffee/ide/review-panel/directives/reviewPanelCollapseHeight.coffeemenus/git-diff.csonservices/web/test/unit_frontend/coffee/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.coffeeserver/spendflow.coffeeapp/assets/javascripts/bookmarklet.js.coffeelib/assets/javascripts/nyulibraries/hide.js.coffeerun.coffeecore/app/backbone/views/users/react_sidebar_login.coffeeclient/ide/views/statusbar/chatheadwatchitemview.coffeelib/shared/lib/spendflow.coffeeapp/assets/javascripts/components/button_disable_with.coffeespec/palette-spec.coffeeapp/assets/javascripts/neighborly/admin/channels/new.js.coffeemenus/python-isort.csonapps/artist/prerender/reflection.coffeespec/installer-spec.coffeespec/countries/NANP-spec.coffeelib/replay/index.coffeesrc/scripts/github-pulls.coffeesrc/scripts/megusta.coffeesrc/spec/createdir.spec.coffeetest/document_test.coffeeapp/js/jail_iframe/util/postFactlinkObject.coffeesrc/extensions/markdown-preview/src/keymap.coffeeapp/assets/javascripts/martian_components/components/utils/smooth_scroll.coffeeapp/assets/javascripts/prettify-via-curl.coffeeclient/app/lib/util/hasManagedVMStack.coffeeworkers/social/lib/social/models/socialapi/notification.coffeesrc/components/reference-book/page-shell.cjsxexamples/extract-text.coffeesrc/scripts/wits.coffeejs-library/app/js/jail_iframe/util/postFactlinkObject.coffeespec/git-repository-provider-spec.coffeespec/integration/question_to_html_spec.coffeetest/unit/routes_spec.coffeescripts/populate-db.coffeesrc/misc/queue.coffeeapp/components/Scriptable.coffeetools/extract_rdfa_context_def.coffeedocs/nwdrome_effector_plugin_spec.coffeescripts/tired.coffeesrc/wai.coffeebuild/tasks/create-installer.coffeetests/test_new_squad.coffeeapp/assets/javascripts/neighborly/images/new.js.coffeesrc/scripts/lastfm_np.coffeesrc/stdlib/git-repository.coffeeSingularityUI/app/components/common/atomicFormItems/FormField.cjsxspec/MicroFloPortalLights.coffeetests/integration/image_from_mobile.coffeebuild/tasks/output-build-filetypes.coffeetemplates/language/snippets/language-__package-name__.csonapp/assets/javascripts/neighborly/channels/profiles/edit.js.coffeeapp/assets/javascripts/effective_assets/cocoon.js.coffeeplugins/uservoice/index.coffeetest/source_file.coffeegrunt/util.coffeespec/javascripts/metric_collector_spec.js.coffeeapp/assets/javascripts/metrics/accuracy_stats.js.coffeetest/javascripts/map_editor_reactive_measure_test.coffeespec/javascripts/websocket_rails/channel_spec.coffeespec/dummy/spec/javascripts/image_viewer_spec.js.coffeespec/onig-scanner-spec.coffeetest/src/specs/app/Routers/AppRouterSpecs.coffeepublic/js/sample-proportion.coffeelib/assets/javascripts/cable/connection.js.coffeeclient/pricing/lib/views/branchtabhandleview.coffeebuild/tasks/output-for-loop-returns.coffeeapp/assets/javascripts/styleguide/kss.js.coffeeapp/js/jail_iframe/classes/ready_promise.coffeesrc/scripts/harvest.coffeesrc/dashing.net/Scripts/application.coffeescripts/steam-info.coffeeresources/assets/coffee/_classes/hits.coffeeapps/show/test/helpers/view_helpers.coffeescripts/robot_roll_call.coffeeexamples/airbrake-shim.coffeeapp/assets/javascripts/rahani/collections/index.js.coffeesrc/backbone.heap.coffeescripts/wish-commander.coffeedocs/nwdrome_renderer_plugin_spec.coffeesrc/util/graphql.coffeespec/GetMetadata.coffeedot-atom/snippets.csonexamples/options_.coffeeutils/docCheck.coffeetest/jobs/vm-clean-reboot-spec.coffeesrc/scripts/mailchimp-subscribe.coffeesrc/atom/range.coffeescripts/sync-schemas.coffeeapp/assets/javascripts/darkswarm/directives/smooth_scroll_to.js.coffeespec/spec-helper-platform.coffeesrc/spec/integration/categories.spec.coffeeapps/galleries_institutions/queries/partners_filter_query.coffeesrc/scripts/reddit-random-top.coffeesrc/01_tinycpu/features/mm/support/pages.coffeesettings/language-csound.csonbokehjs/test/models/transforms/linear_interpolator_transform.coffeecomponents/GetGIFFrame.coffeesrc/map-state-model.coffeesrc/app/keymaps/git.coffeetest/mocha/kissmetrics-batch.coffeesrc/extensions/strip-trailing-whitespace.coffeesrc/scripts/pivotalstorylisten.coffeeapp/assets/javascripts/backbone/plugins/user_list.js.coffeesrc/request_animation_frame.coffeetest/javascripts/test_helper.coffeetest/string-interpolation.coffeekeymaps/apple.csonapp/assets/javascripts/backbone/plugins/youtube_embed.js.coffeesrc/scan-handler.coffeeexpire_docops.coffeesrc/alphabet.coffeeguides/download_archive.coffeesrc/coffee/mixins/q.coffeespec-runner/utils/spec-matchers.coffeelib/utilities/multiTabSessions.coffeerenderer/lib/override.coffeeclient/ide/lib/views/collaboration/limitedvideocollaborationfree.coffeetests/test_expansions.coffeespec/javascripts/support/ember-auth-patch.coffeesrc/coffee/orderservice.coffeesrc/sinks/moz-sink.coffeesrc/user/status-mixin.coffeeapp/assets/javascripts/admin/line_items/directives/scale_by_as_currency.js.coffeeapp/assets/javascripts/neighborly/projects/backers/create.js.coffeecomponents/commercial_filter/filters/paginator/paginator_view.coffeeapp/merge.coffeetests/unit_tests/commands_test.coffeesrc/menu-manager.coffeedesktop/components/partner_buttons/show_buttons.coffeecomponents/SCDDetect.coffeesrc/extensions/wrap-guide/src/wrap-guide.coffeetests/test_wave_8.coffeeassets/javascripts/views/layout/resizer.coffeereview_front/app/components/auto-select-input.coffeeapp/pwchange.coffeetest/unit/aws_request.spec.coffeesource/javascripts/tests/preflight_cors.coffeetest/javascripts/integration/dashboard_paper_collaboration_test.js.coffeespec/extensions/outline-view-spec.coffeeapp/modules/tool_loader.coffeesrc/widgets/views/select2.coffeecore/app/backbone/views/popovers/react_signin_popover.coffeeapp/assets/javascripts/species/mixins/geo_entity_auto_complete_lookup.js.coffeecommon/queries.hooks.coffeesrc/scripts/modules/header/header.coffeesnowblocks/atom/packages.csonserver/utils/constants.coffeemenus/floobits.csonsrc/Witness/_witness/Scripts/witness/AsyncAction.coffeespec/components/pickers.cjsxsrc/pushbullet.coffeeconfig/amd/gulp-options.coffeeassets/js/src/i18n/index.coffeeapp/assets/javascripts/i18n_dashboard/translations.js.coffeeapp/assets/javascripts/pages.coffeecomponents/ManageSteps/ManageSteps.coffeeclient/templates/user_profile/user_profile.coffeeapp/assets/javascripts/routes/map.route.js.coffeeapp/assets/javascripts/scoreboard.coffeesource/assets/javascripts/components/photo_gallery.coffeesrc/uploader.coffeeresources/assets/coffee/react/contest-entry/user-entry.coffeeapp/core/services/segment.coffeeclient/angular/components/progress_chart/progress_chart.coffeelib/linter-map.csonlib/tool-bar-button-view.coffeeapp/assets/javascripts/controllers/player_controller.js.coffeebuild/tasks/generate-module-cache-task.coffeeapp/assets/javascripts/components/bootstrap-tooltip.js.coffeeclient/source/controllers/settings_controller.coffeelib/mixed-indent-warning.coffeehomedisplay/info_weather/static/js/weather_door.coffeetutor/src/components/task-plan/footer/help-tooltip.cjsxsrc/turbolinks/error_renderer.coffeeclient/Environments/views/scene/environmentruleitem.coffeecore/app/assets/javascripts/base/social-services.coffeeangular/core/services/session.coffeesrc/login/config/routes.coffeeserver/s3manager/s3manager.coffeelib/assets/javascripts/models/post/status.js.coffeesrc/scripts/modules/media/body/body.coffeelib/assets/javascripts/jack_up/drag_and_drop.coffeecore/app/backbone/views/react_user_tabs.coffeeapp/templates/app/coffee/main.coffeeapps/middleware/authenticate.coffeeBackofficeBundle/Resources/public/coffee/blockView.coffeeapp/assets/javascripts/jobbr/application.js.coffeetest/unit/helper/schema-spec.coffeeservices/clsi/app/coffee/DraftModeManager.coffeescoped-properties/language-restructuredtext.csonspec/skr/models/CustomerSpec.coffeesrc/views/keyboardHelp.coffeeserver/methods/getRoomIdByNameOrId.coffeeclient/app/lib/commonviews/applicationview/applicationtabview.coffeecore/app/backbone/views/extended_fact_view.coffeeapp/assets/javascripts/darkswarm/services/filter_selectors.js.coffeeapp/assets/javascripts/georgia/views/links/link_form_content.js.coffeelib/assets/javascripts/websocket_rails/event.js.coffeeapp/assets/javascripts/placeholder_element.js.coffeeapp/assets/javascripts/add-playlist-option.js.coffeeclient/landing/CollaborativeWorkspace/panes/sharableclientterminalpane.coffeeapp/assets/javascripts/services/product_service.coffeeaphrodite/app/assets/javascripts/import.js.coffeeclient/redux/actions.coffeeapp/assets/javascripts/sugar/facebook.js.coffeeapp/assets/javascripts/app/check_icon.js.coffeetest/battle_server.coffeesrc/dbController.coffeesource/js/controllers/dictionary_controller.coffeeapp/templates/extras/mvc-coffee/model-index.coffeeapp/assets/javascripts/views/wip_event_view.coffeeapp/assets/javascripts/panels/image_library.coffeeangular/core/services/user_help_service.coffeeapp/assets/javascripts/autocompleter.js.coffeeinternal_packages/message-list/lib/message-toolbar-items.cjsxlib/assets/javascripts/views/post/post_action_repost.js.coffeeapp/assets/javascripts/components/yale-login.cjsxsrc/list-string.coffeescripts/clojure.coffeesrc/save.coffeecollections/connection_blocks.coffeesrc/app/api/models/project.coffeecontrollers/temperature-controller.coffeeclient/app/collections/application.coffeelib/to-the-hubs.coffeeapp/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffeecore/spec/javascripts-konacha/views/conversations/start_conversation_view_spec.coffeeapp/assets/javascripts/sprangular/controllers/cart.coffeeapp/routes/accounts/index.coffeecomponents/inquiry_questionnaire/index.coffeeapp/assets/javascripts/comply/index.js.coffeelib/sensu-dashboard/assets/javascripts/collections/base.coffeeBackofficeBundle/Resources/public/coffee/mediatheque/orchestraMediaType.coffeepublic/html.coffeestorage/lib/geolog/index.coffeedeployment/grouptoenvmapping.coffeeapp/assets/javascripts/welcome.coffeenode_modules_koding/koding-config-manager/config.coffeeclient/landing/app/Applications/WebTerm.kdapplication/AppController.coffeesrc/scripts/pages/browse-content/browse-content.coffeespec_app/spec/javascripts/helpers/show_lib_versions.coffeecore/app/assets/javascripts/frontend/framedFactlinkCoreClient.coffeeclient/skr/screens/locations/Locations.cjsxsite/server/indexes.coffeebuild/tasks/compile-packages-slug-task.coffeejs-library/app/js/jail_iframe/util/annotated_site_receiver.coffeeapp/assets/javascripts/visualization/simple.js.coffeeapp/assets/javascripts/admin/utils/directives/date_picker.js.coffeeapp/lib/config.coffeeapp/js/filters/format_votes.coffeeapp/assets/javascripts/partystreusel/slider.js.coffeeserver/lib/presenters/theme.coffeetest/base58_test.coffeeapp/assets/javascripts/rocket_job_mission_control/base.js.coffeesrc/ubret/subject_viewer.coffeecoffee/core/util.coffeetest/integration/instance-lookup-test.coffeeclient/source/controllers/install_controller.coffeesrc/ext/components/stacktrace-output.coffeeapp/assets/javascripts/views/application.js.coffeelib/minimap-editor-view.coffeelib/transforms/renderFileTree.coffeeclient/templates/editor/date/date.js.coffeeclient/src/scripts/scoring-list-view.coffeesrc/cacheable.coffeepackages/rocketchat-gitlab/common.coffeelib/json2json.coffeeapp/models/Event.coffeesrc/components/WebService/CouchDB/SaveObject.coffeecore/app/backbone/views/facts/recently_viewed_facts.coffeesrc/view.coffeedesktop/test/models/artwork_inquiry.coffeespec/deprecation-cop-spec.coffeedesktop/apps/gallery_partnerships2/routes.coffeeapp/assets/javascripts/models/category.js.coffeeapp/assets/javascripts/controllers/matchers-show-controller.js.coffeetest/error_messages.coffeeclient/source/routes.coffeesrc/trix/config/text_attributes.coffeesrc/client.cjsxsrc/extensions/command-interpreter.coffeeapp/assets/javascripts/app/spaces/new.js.coffeesrc/components/student-dashboard/reading-row.cjsxapps/settings/components/form_card/index.coffeecoffee/cilantro/ui/exporter.coffeesrc/scripts/store.coffeescripts/models/Subject.coffeeserver/test/integration/indicator_index.coffeesrc/extensions/resolve.coffeebody-class.coffeecoffee/src/util/test.coffeecoffeescript/wordcount.coffeeapp/coffee/utils.coffeetest/time.spec.coffeesrc/dom_element/children_list.coffeesrc/beautifiers/formatR/index.coffeesrc/components/navbar/signout.cjsxsrc/spec/product-import.spec.coffeetest/gozer_test.coffeeclient/lanes/components/grid/Toolbar.cjsxsrc/coffee/cilantro/ui/context/actions.coffeeraw/newspring:core/lib/apollos.coffeesrc/controllers/authenticate-controller.coffeecomponents/block_v2/queries/block.coffeeapp/assets/javascripts/games.js.coffeepublic/theme/portalshit/script.coffeeapp/assets/javascripts/dashboard.coffeevendor/assets/javascripts/fustrate/components/tabs.coffeelib/eslint-view.coffeesrc/language/modules/setters.coffeeapp/assets/javascripts/book.js.coffeeapp/assets/javascripts/admin/froala_editor.coffeevendor/assets/javascripts/form_backup.coffeelib/engines/closure-compiler.coffeebokehjs/src/coffee/models/annotations/label.coffeecontrols/TypeAhead/Match.jsx.coffeelib/assets/javascripts/vendor-legacy.coffeeapp/assets/javascripts/tracks.js.coffeesrc/coffee/choice.coffeecore/app/backbone/views/react_user_search.coffeekeymaps/image-view.csonsrc/server/server.coffeesrc/atom-protocol-handler.coffeegrunt/config/less.coffeeapp/js/jail_iframe/util/annotated_site_receiver.coffeelib/parser.coffeecoffee/example.coffeelib/messagestream.coffeesrc/components/tabs-with-children.cjsxserver/app.coffeesrc/coffee/qbn.coffeecomponents/SendRequest.coffeelib/tasks/actions/build_to_speech_action.coffeeclient/views/events/event_new.coffeedeployment/mongomigrationconfig.coffeegulp/tasks/watch.coffeesrc/fetcher.coffeesrc/linker.coffeeapp/assets/javascripts/snippets.coffeelib/client.coffeeclient/lanes/views/SaveNotify.coffeeapp/components/change-listener.cjsxlib/insert-nl-jsx.coffeesrc/step.coffeesrc/event_emitter/lifecycle_events.coffeesrc/initialize-test-window.coffeecomponents/Gate.coffeesrc/modules/app/maker/index.coffeeangular/core/services/exception_handler.coffeeapp/assets/javascripts/rglossa/data/adapter.coffeeclient/Main/providers/computeeventlistener.coffeespec/basic.spec.coffeetest/run-qunit.coffeesrc/protractor.conf.coffeelib/atom-ternjs-view-manager.coffeesrc/ls-archive.coffeespec/indie-spec.coffeesrc/app/common/pdf-viewer/pdf-viewer.coffeeapi/games.coffeeapp/assets/components/core.coffeespec/ReadFile.coffeeapp/assets/javascripts/neighborly/users/payments.js.coffeecoffees/src/streaming_api.coffeeapp/assets/javascripts/app.js.coffeesrc/view/bindings/route_binding.coffeesrc/trix/filters/gallery_filter.coffeesrc/coffee/metric-updater.coffeesrc/coffee/producttypegenerator.coffeeapp/controllers/home_page.coffeesrc/scripts/ive.coffeesrc/tools/Pan.coffeeserver/startup/migrations/v7.coffeelib/assets/javascripts/_link.js.coffeeapp/src/utils/storage/secure_store.coffeeapp/assets/javascripts/supplies.js.coffeeapp/assets/javascripts/app/jobs.js.coffeeapp/assets/javascripts/copy_to_clipboard.js.coffeelib/panel-view.coffeeapps/artwork/client/below-the-fold.coffeesrc/command-palette-view.coffeeapp/assets/javascripts/species/routes/taxon_concept_documents_route.js.coffeelib/react_components/hello_world.cjsxgrammars/weave_md.csonapp/assets/javascripts/admin/payments/directives/stripe_elements.js.coffeepeople/default/scripts/main.coffeesrc/tooltips.coffeespec/lanes/models/CollectionSpec.coffeesrc/controls/mixins/Validation.coffeeapps/contact/client/index.coffeeapp/client/js/react/pages/notfound.coffeeclient/app/Applications/Viewer.kdapplication/AppController.coffeewebserver/static/js/main.coffeeclient/lib/callApi.coffeesrc/phalange.coffeesrc/lib/Port.coffeesrc/components/DuplicateProperty.coffeeapp/frontend/javascripts/app.js.coffeesnippets/language-restructuredtext.csonpublic/app/common/components/icon/icon.cjsxcoffees/src/application.coffeejs/echo.coffeeapp/scripts/game.coffeeapp/assets/javascripts/c4_game.js.coffeelib/wp-phptidy.coffeeapp/assets/javascripts/sequence.js.coffeeapp/assets/javascripts/realtime.js.coffeeapp/assets/javascripts/accounts.js.coffeeassets/javascripts/timer.coffeeserver/prerender/index.coffeespec/linter/rubocop-spec.coffeeslide/index.coffeeapp/assets/javascripts/cartas.js.coffeeweb/js/router.coffeecollections/recent_connections.coffeecoffee/system.coffeeapp/assets/javascripts/ab_admin/inputs/datetime_input.js.coffeeapp/controllers/Toolbox.coffeelib/request.coffeepackages/rocketchat-slashcommands-invite/server.coffeeclient/controllers/reactiveTable.coffeeapp/packages/surveys/imports/activation.coffeeapp/assets/javascripts/web/controllers/message_controller.js.coffeeclient/app/lib/util/trackEvent.coffeesite/modules/media/media.module.coffeeapp/assets/javascripts/event_stream_actions.js.coffeelib/layervault/nodes/folder.coffeelib/actions/info.coffeeapp/scripts/components/ViewportRelativeMotion.coffeeserver/services/twilioService.coffeespec/welcome-spec.coffeespecs/smoke.spec.coffeespec/parser_spec.coffeelib/package-list-custom-list-view.coffeeapp/assets/javascripts/darkswarm/filters/localize_currency.js.coffeeapp/src/restclients/restclient.coffeeapp/static/coffee/models.coffeelib/project-manager-add-view.coffeetopics/atom.symlink/config.csonlib/Strategy/DBStrategy/Save/CollisionCheckTemporaryTable.coffeespec/integrations/command.coffeeassets/javascripts/routes/users_new_route.js.coffeeapp/templates/spec/name-spec.coffeesrc/trigger.coffeelib/go-to-line-element.coffeelib/skeleton/option_parser.coffeesrc/defines.coffeesrc/commentList.coffeeserver/components/indicatorator/indicatorators/ede_indicatorator.coffeetest/handmade.coffeelib/assets/javascripts/marbles/middleware/hawk.js.coffeesrc/columns.coffeesrc/crash-reporter-start.coffeeapp/assets/javascripts/controllers/message_task_controller.js.coffeeapp/assets/javascripts/prevent_double_submission.js.coffeeserver/configuration/accounts_meld.coffeescripts/test-instance/instance-ami.coffeesrc/app/general-config-panel.coffeelib/cli.icedmodels/mixins/dimensions.coffeecore/app/backbone/views/users/user_statistics_view.coffee4-dual-target/brunch-config.coffeeapp/assets/javascripts/routes/application_route.js.coffeeengine/glmatrix_extra.coffeetest/spec/controllers/main.coffeekeymaps/git-experiment.csonsrc/app/null-grammar.coffeecomponents/MarqueeBranding.cjsxapp/assets/javascripts/components/todos/app.js.cjsxlib/autoprefixer/selector.coffeeassets/javascripts/evaluator/structure_identifier.coffeeapp/assets/javascripts/admin/order_cycles/controllers/simple.js.coffeelib/common-utils.coffeeexamples/hello-server/app.coffeelib/fs-util.coffeegrunt/tasks/test.coffeekeymaps/foldingtext-markdown.csontest/unit/model/view.coffeeassets/js/add_observation.coffeeapp/assets/javascripts/resolve/load_permalink.js.coffeeapp/assets/javascripts/controllers/manuscript_manager_template_edit_controller.js.coffeesrc/scripts/servant.coffeetasks/gyp.coffeeclient/ide/fs/fsfolder.coffeesrc/rabbitmq.coffee.config/atom/snippets.csonapp/assets/javascripts/langtrainer_frontend_backbone/views/unit_selector.js.coffeespec/appSpec.coffeesrc/date-format.coffeebattle-detail.coffeekeymaps/debugger-ui-default.csonjigs/grid/jig.coffeeapp/assets/javascripts/eventplug/app/events/_form.js.coffeetrinary/trinary_test.spec.coffeecore/app/backbone/views/messages/conversation_item_view.coffeeshared/specs/components/change-student-id-form.spec.coffeeapp/coffee/DraftModeManager.coffeeserver/middleware/contact.coffeescripts/models/content/inherits/base.coffeeapp/assets/javascripts/neighborly/devise/registrations/new.js.coffeeapp/assets/javascripts/controllers/transactions-controller.js.coffeekeymaps/project-manager.csonspec/templates/methods/prototypical_methods.coffeekeymaps/keybinding-resolver.csonatom/atom.symlink/keymap.csonscripts/phabricator.coffeepackages/rocketchat-lib/server/methods/sendMessage.coffeefeatures/support/test_system.coffeesrc/local_modules/typescript.icedspec/coffeescripts/models/transactions/month_spec.coffeeapp/assets/javascripts/store.js.coffeeapp/scripts/services/domains.coffeelib/content._coffeespec/skr/models/SoLineSpec.coffeelib/assets/javascripts/services/entity_search.js.coffeepackages/rocketchat-highlight/highlight.coffeeconfig/social/jkn2-reddit.coffeeapp/assets/javascripts/stores/notification_store.coffeecomponents/modalize/view.coffeeroles/fedora_laptop/files/atom/config.csoncollections/user_interests.coffeesrc/bang.coffeelib/Watchers/Template.coffeelib/image.coffeelib/utilities.coffeecommand-register.coffeeroles/developer-atom/templates/atom/init.coffeeapp/assets/javascripts/bsat/sidebar.js.coffeesrc/coffee/cilantro/utils.coffeeapp/assets/javascripts/util/url.js.coffeeviews/outer/about/_team.coffeeapp/assets/javascripts/darkswarm/darkswarm.js.coffeeapp/views/dialog.coffeescripts/configs/github.coffeesrc/scripts/Syntho.coffeecomponents/ConvertStreetLight.coffeesrc/biskoto.coffeeapp/assets/javascripts/priority.js.coffeeclient/Main/navigation/navigationlist.coffeecomponents/logged_in_navigation/components/channel_create/view.coffeelib/assets/javascripts/cable/connection.coffeeworkers/social/lib/social/traits/filterable.coffeeapp/assets/javascripts/sprangular/directives/checkoutButton.coffeeapp/pages/lab/science-case.cjsxapp/assets/javascripts/all_aboard/routes/slides.js.coffeelib/debug.coffeelib/pty.coffeeapi/v0/models/keys.coffeetest/src/system/canceled_input_test.coffeetest/browser/helper.coffeeclient/controller/wish-controller.coffeetest/test-util.coffeeSettings.coffeeapp/assets/javascripts/cmsimple/panels/images/selection.coffeesrc/ks/github/models/repo.coffeelib/algorhythmic.coffeelib/models/git-init.coffeespec/jquery.turbolinks_spec.coffeeserver/routes/reports.coffeeSingularityUI/app/collections/TasksScheduled.coffeesrc/clinical/encounter.data.coffeeapp/assets/rui/Form.coffeeapps/tools/components/send_invitation/index.coffeesrc/updateconfig.coffeeapp/assets/javascripts/toast.js.coffeesrc/core/logger.coffeekeymaps/simple-flake8.csonsrc/deploy-monitor.coffeelib/tintan/tasks.coffeeapp/js/app.coffeeSingularityUI/app/views/request.coffeelib/observejs/app/assets/javascripts/observejs/creator.js.coffeeeditor-app/main.coffeelib/status-bar-manager.coffeeapp/frontend/javascripts/models/visualization.js.coffeeserver/startup/i18n-validation.coffeeapp/assets/javascripts/ws.helper.coffeetable.coffeesrc/aggregate/aggregate.coffeeserver/code/lib/throttle.coffeesrc/static/guid-convert.coffeesrc/filter.coffeespec/emmet-spec.coffeebrowser/api/lib/auto-updater.coffeeroutes/main.coffeeclient/views/posts/posts.coffeeapp/pages/classify.cjsxapp/assets/javascripts/logo.js.coffeeapp/gem/actions.coffeemenus/jekyll.csonclient/Bongo/includes.coffeegrunt/config/requirejs.coffeelib/config.coffeelib/walrus/ast.coffeesrc/components/header.cjsxapp/assets/javascripts/admin/admin.js.coffeeserver/browserpolicy.coffeesrc/extensions/wrap-guide/wrap-guide.coffeesrc/config-schema.coffeesrc/relative-resolve.coffeelib/barista_test.coffeeviews/components/ship-parts/slotitems-data.coffeeclient/lanes/testing/BeforeEach.coffeesrc/msgflo.coffeetest/src/specs/app/TestHelpers.coffeeclient/ide/routes.coffeetest/lib/when-test.coffeesrc/ui/entry/entry.coffeesrc/JournalStore.coffeecoffee/cilantro/models/concept.coffeesrc/scripts/views/app.cjsxlib/git-write.coffeeshared/accountButtons.coffeesrc/snippets-reader.coffeesrc/scripts/oblique.coffeespec/apm-cli-spec.coffeesrc/templates.coffeelib/grammars.coffeelib/gazedata.coffeesrc/csonc.coffeelib/background-tips.coffeeoptions.coffeesrc/scripts/ids.coffeeapp/assets/javascripts/ember_cart/ember/models/cart_item.js.coffeesrc/dnsimple.coffeesrc/buildbot.coffeesrc/cli/cmdz/openssl.coffeesrc/adapters.coffeeapp/assets/javascripts/models/farm.coffeebuild/tasks/bootstrap-atom.coffeeapp/assets/javascripts/angular/controllers/member_ctrl.js.coffeeapp/assets/javascripts/voluntary_core_module_emberjs/router.js.coffeelib/styles/index.coffeelib/package-updates-status-view.coffeetest/demo-mock.coffeekeymaps/fuzzy-finder.csonclient/app/lib/components/sidebarstacksection/sidebarstackheadersection.coffeeatom/dot-atom/projects.leopard-jkg.csonservices/web/public/coffee/ide/review-panel/controllers/TrackChangesUpgradeModalController.coffeecomponents/artwork_filter/collections/artwork_columns.coffeeapp/assets/javascripts/banners.js.coffeeapp/assets/javascripts/species/mixins/event_lookup.js.coffeeapp/assets/javascripts/users.js.coffeelib/Acho.coffeelib/nsync/web-window.coffeeapp/controllers/index.coffeesrc/languages/yaml.coffeesrc/languages/jsx.coffeeapp/assets/javascripts/rglossa/controllers/cwb/search_inputs_controller.coffeeapp/assets/javascripts/pager.js.coffeespec/coffeescript.coffeecomponents/__tests__/Slider.spec.cjsxapp/core/Component.coffeepackages/rocketchat-oembed/client/oembedUrlWidget.coffeeui/app/scripts/services/Channel.coffeeclient/lanes/Config.coffeeapp/assets/javascripts/routes/paper_index_route.js.coffeeapp/assets/javascripts/neighborly/rewards/index.js.coffeelib/sort-lines.coffeesrc/components/qa/exercise-card.cjsxapps/artist_2/components/current_show_auction/query.coffeeserver/stream/streamBroadcast.coffeesrc/RuleProcessor.coffeeservers/lib/server/handlers/api/gitlab/testhelpers.coffeeapp/assets/javascripts/tenon/features/date_time_picker.js.coffeesrc/view/bindings/insertion_binding.coffeespec/javascripts/fixtures/users.coffeeapps/artist/client/index.coffeesrc/routing/params.coffeeapp/assets/javascripts/admin/products/controllers/edit_units_controller.js.coffeeclient/app/js/collections/user_list.coffeeapp/assets/javascripts/helpers/formatted_timestamp.js.coffeelms/static/coffee/src/main.coffeesrc/util/render.coffeekeymaps/tree-view.csonapp/assets/javascripts/polls.js.coffeeapp/assets/javascripts/neighborly/modules/infinite-scroll.js.coffeesrc/rebuild-module-cache.coffeelib/deprecation-cop-view.coffeelib/app/logout.coffeeapp/assets/javascripts/residences.js.coffeesrc/app/components/directive.coffeesrc/views/service-map-disclaimers.coffeeworkers/auth/lib/auth/main.coffeecore/app/backbone/models/evidence.coffeeclient/lanes/extension/Extensions.coffeecoffee/cilantro/ui/concept/search.coffeeapp/assets/utensils/detect/detect.coffeeapp/assets/javascripts/common.js.coffeesrc/app/text-mate-scope-selector.coffeelib/utils/web-entry.cjsxcomponents/inquiry_questionnaire/views/inquiry.coffeeprotractor.conf.coffeehome/.atom/config.csonKVEnumeration.coffeeserver/entry.coffeescripts/views/workspace/content/search-results-item.coffeeapp/assets/javascripts/jazz.js.coffeewebpack.config.coffeesrc/assets/javascripts/backdrop.coffeemenus/latex-friend.csonclient/components/LangCorrector.coffeeconfig/plugins/coffeelint.coffee.config/config.csonapp/assets/javascripts/asset_gallery/agbase.js.coffeeapp/assets/javascripts/notebook/magic/tabs.coffeeapp/assets/javascripts/components/shortcut.coffeesrc/message.coffeesrc/librato.coffeespec/body-spec.coffeecore/app/backbone/factlink/tooltip_marionette.coffeesrc/scripts/corgime.coffeeclient/landing/app/Applications/Chat.kdapplication/Controllers/conversationlistcontroller.coffeesrc/app/units/unit-student-plagiarism-list/unit-student-plagiarism-list.coffeeclient/controllers/smartEvents/smartEvent.coffeeclient/ide/workspace/panel.coffeepublic/js/main.coffeelib/sockets.coffeeclient/skr/components/PrintFormChooser.cjsxclient/source/views/base/mixins/form.coffeeclient/src/views/section_view.coffeetest/integration/upload-test.coffeeapp/assets/javascripts/workbench/workbench/views/datastream/show_view.js.coffeetest/unit/runner.spec.coffeeapp/assets/javascripts/sapphire_cms/client/providers/viewBuilder.coffeemethods/feeds.coffeecomponents/DetectAnimatedGif.coffeeclient/src/views/visualisation_view.coffeeatom/browser/lib/guest-view-manager.coffeeapp/assets/javascripts/main_form.js.coffeelib/adapter.coffeesnippets/paper-input-elements.csonsrc/upload.coffeelib/middleware/locals.coffeesrc/configs/projects.csonclient/admin/lib/views/integrations/adminintegrationsview.coffeeapi.coffeeatom/common/api/lib/callbacks-registry.coffeeapp/scripts/views/board_view.coffeeclient/skr/components/CustomerFinder.cjsxapp/assets/javascripts/services/heartbeat_service.js.coffeeport/EditableText.Editable.coffeelib/helpers/custom_exception.coffeebuild/tasks/generate-license-task.coffeelib/adapters/nest/NestThermostatNode.coffeesource/scripts/views/list/item.coffeesrc/io/tty/log.coffeetest/has_one_chage_test.coffeelib/package-menu-view.coffeepublic/javascripts/game.photography.coffeespec/keybinding-panel-spec.coffeesrc/FileManager/Selection.coffeetest/impromptu.coffeecomponents/inquiry_questionnaire/views/specialist.coffeeapp/javascript/src/notice.coffeemodels/organization.coffeeassets/scripts/app/controllers/account.coffeelineman/app/components/thread_page/position_buttons_panel/position_buttons_panel.coffeelib/autocomplete-provider.coffeelib/linter-python-flake8.coffeeapp/assets/javascripts/discourse.js.coffeelib/coffee-compile-editor.coffeeassets/javascripts/controllers/room_user_state_item_controller.js.coffeesrc/atom/atom/config.csonclient/app/scripts/users.coffeesrc/space-pen-extensions.coffeecollections/collaborators.coffeeclient/app/books/model.coffeelib/stack-ide-atom.coffeeapi/resources/schedule.coffeetests/smtp-testing/index.coffeesrc/test/mock.coffeesrc/scripts/helpers/backbone/views/attached/tooltip/tooltip.coffeeapp/assets/javascripts/toc.js.coffeecomponents/block_v2/view.coffeeapps/home_2/view_helpers.coffeetest/e2e/imageDetailSpec.coffeeclient/ide/workspace/workspacelayoutbuilder.coffeeextension/packages/hints.coffeeexamples/listnr-examples.coffeeapi/models/UserPassword.coffeeapp/assets/javascripts/answers.js.coffeegrammars/vp.csonsrc/coffee/controllers/starting-points.coffeeapp/assets/javascripts/events_calendar.js.coffeeclient/controller/speakers-controller.coffeesrc/read_aggregate_root.coffeesrc/utils/query-string-encoder.coffeeassets/javascripts/custom_rx_operators.coffeeresources/choices.coffeelib/parsers/log-parser.coffeesrc/language/modules/shapes.coffeesrc/app/editor-config-panel.coffeelib/pdf-status-bar-view.coffeeserver/calculations/ratingConstants.coffeeconfigs/test/jest.setup.coffeelib/project-config.coffeetest/index.coffeeserver/classrooms/Classroom.coffeeresources/assets/coffee/_classes/profile-page-hash.coffeesrc/beans/MongooseLogger.coffeeapp/assets/javascripts/links.js.coffeesrc/components/cc-dashboard/blank-course.cjsxresources/assets/coffee/bootstrap-modal.coffeealgo/binary-search.coffeelib/markdown-preview-view.coffeetest/integration/home_nologin.coffeeserver/controllers/stack_application.coffeeapps/pro_buyer/index.coffeeapp/assets/javascripts/sprangular/services/status.coffeetest/runtime_test.coffeesrc/set/set_proxy.coffeeplugins/bitbucket-issues/index.coffeesrc/extensions/outline-view/src/keymap.coffeeapp/assets/javascripts/repositories.js.coffeejs/binding/src/binding.coffeeapp/assets/javascripts/admin/orders/controllers/bulk_invoice_controller.js.coffeeapp/assets/javascripts/events.coffeeapp/js/jail_iframe/classes/notification.coffeetest/user/menu.spec.coffeesrc/api/settings.coffeelib/builder.coffeeapp/assets/javascripts/components/GlobalHeader.js.cjsxpublic/coffee/views/databaseItemView.coffeesrc/config-observer.coffeetest/user/model.spec.coffeeconcerns/observes-viewport.coffeesrc/PaginationStream.coffeecommunity/server/src/main/coffeescript/test/neo4j/webadmin/modules/databrowser/views/TestPropertyContainerView.coffeesrc/the-more-you-know.coffeeserver/methods/updateRoom.coffeesrc/core/types/utils.coffeeangular/core/models/stance_model.coffeeapp/assets/javascripts/todo_lists.js.coffeetest/test_client.coffeegrammars/generic-config.csoncomponents/RandomUuid.coffeecomponents/form/utilities.coffeetest/specs/Piece.spec.coffeesrc/scripts/sheits.coffeesrc/filters/moment-date.filter.coffeeapp/assets/javascripts/projects.coffeesrc/app/common/user-icon/user-icon.coffeespec/header-cells/string-cell-spec.coffeejs/outer/error.coffeesrc/tab.coffeeclient/views/tasks/add_task.coffeesrc/reactGUI/ReactDOM-shim.coffeecoffee/simulate.coffeeclient/DevTools/AppController.coffeebin/tourney-time.coffeeapp/assets/javascripts/backbone/views/work/job_form_view.coffeeclient/lanes/react/mixins/Screen.coffeeapp/assets/javascripts/components/add_author_form_component.js.coffeeapp/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffeesrc/deployment-monitor.coffeecoffee/node_readline.coffeesrc/trix/controllers/level_2_input_controller.coffeeapp/assets/javascripts/admin/order_cycles/order_cycles.js.erb.coffeesrc/client/docs.coffeesrc/filings-cli.coffeelib/language-idris.coffeeapp/assets/javascripts/views/overlays/figure_overlay_view.js.coffeesrc/atom-fsharp/keymaps/core.csonclient/app/lib/commonviews/buttonviewwithprogressbar.coffeeapp/assets/javascripts/hyper_admin/angularjs/config.js.coffeeapp/src/controllers/wallet/pairing/wallet_pairing_progress_dialog_view_controller.coffeesrc/scripts/workbench/views/datastream/show_view.js.coffeesrc/api/visualizers.coffeeapp/assets/javascripts/sprangular/controllers/account.coffeelib/atom-python-test-view.coffeeapp/assets/javascripts/views/forms/chosen-select.js.coffeeapp/utils/location.coffeelib/path_finder.coffeeapp/assets/javascripts/components/truncate_text.js.coffeeclient/templates/results/chart/chart.js.coffeelib/status-bar-view.coffeeapp/middlewares/auth.coffeeapp/server/js/react/app.coffeeapp/controllers/sessions.coffeeapp/src/controllers/update/update_index_view_controller.coffeecoffee/db/mongo.coffeestatic/scripts/models.coffeekeymaps/rubocop.csonapp/assets/javascripts/active_admin/lib/per_page.js.coffeeapp/coffee/filters/common.coffeetest/js/totodoo.coffeetest/javascripts/paper_test.coffeeapp/client/questions/questions.coffeeclient/Finder/fs/fsfolder.coffeesrc/code/stores/nodes-store.coffeejs-library/app/js/jail_iframe/classes/notification.coffeeviews/coffee/timer.coffeeapp/lib/view-helper.coffeeObjectLogger.coffeecgFileUploadWorker.coffeeclient/landing/app/MainApp/sidebar/groupavatar.coffeeapp/assets/javascripts/offline/synchronizer.js.coffeeserver/models/entry.coffeespec/path-scanner-spec.coffeetest/testMount.coffeeapp/assets/javascripts/views/components/status-filter-button.component.js.coffeetest/elvis-backbone-test.coffeeplugins/pagerduty/index.coffeeclient/landing/app/CommonViews/linkviews/applinkview.coffeesrc/calculator.coffeejs/libs/placeholder.coffeetest/forecast-test.coffeeapp/assets/components/TraceInfo.coffeeapp/assets/javascripts/angular/controllers/result_controller.js.coffeesettings/language-xquery.csonscripts/custom.coffeetest/deadline_test.coffeesrc/task-bootstrap.coffeesrc/coffee/controller/SyllabusItemsController.coffeekeymaps/find-and-replace.csonapi/index.coffeeapp/models/DialogManager.coffeescripts/programmer-excuses.coffeehubot-dotnet/index.coffeeapps/authentication/routes.coffeecore/app/backbone/contrib/monkey_backbone_history.coffeemodules/atom/settings/config.csonclient/app/MainApp/fs/fsfolder.coffeeutils.coffeetest/parser.coffeesrc/panel-element.coffeelib/general-panel.coffeekeymaps.csonsrc/components/icon.cjsxmenus/atom-sys-angular.csontest/exercise/collection.spec.coffeecoffee/views/menu.coffeesrc/app/admin/states/teachingperiods/teachingperiods.coffeecake/lib/scaffold.coffeelib/models/git-checkout-current-file.coffeeplugins/pivotal-tracker/index.coffeeapp/assets/javascripts/download-menu.coffeeansible/roles/atom/config_files/config.csonclient/src/scripts/frame-view.coffeeclient/app/lib/datadogmetrics.coffeecore/app/backbone/factlink/local_storage_text_model.coffeesrc/main/webapp/coffeescripts-hidden/landing.coffeesrc/tools/Eraser.coffeeapp/static/coffee/index.coffeesrc/projects.coffeeapp/assets/javascripts/components/team-table.js.coffeeassets/js/client.coffeeGulpfile.coffeeserver/redis.coffeesrc/rate_limiter.coffeeapp/assets/javascripts/application-coffee.js.coffeeatom/keymaps/import-js.csontest/test_thing.coffeesrc/app/package.coffeelib/tracker.coffeeclient/app/lib/util/sortEnvironmentStacks.coffeelib/d-struct.coffeesrc/coffee/cilantro/ui/workflows/workspace.coffeespec/core/core_spec.coffeelib/update.coffeesrc/cache/instance.coffeesrc/components/buttons/back-button.cjsxclient/account/lib/views/leavegroupmodal.coffeeserver/initializers/authentication.coffeelib/views/analysis_status_view.coffeetest/remind-test.coffeeassets/scripts/app/controllers/account_index.coffeesrc/models/claim.coffeeapp/assets/javascripts/langtrainer_frontend_backbone/views/navbar_control.js.coffeeapp/src/controllers/onboarding/device/onboarding_device_pin_view_controller.coffeeapp/assets/javascripts/views/journal_index_view.js.coffeeapps/block/routes.coffeejs-library/app/js/jail_iframe/classes/content_box.coffeelib/getThrottles.coffeeapp/assets/javascripts/controllers/activities.coffeesrc/Timer.coffeelib/chat_channel.coffeescripts/kerb.coffeedrawing-tools/pinpoint.coffeeapp/assets/javascripts/models/paper.js.coffeesrc/draggable-mixin.coffeeapp/scripts/models/command.coffeelib/shuss-config.coffeelib/js_refactor.coffeekonecty:nrr.coffeeweb/src/views/main-menu.cjsxresource_helper.coffeegulp/specs.coffeesrc/buffered-node-process.coffeecoffeescript/object_example.coffeeapp/assets/javascripts/application-admin.js.coffeesrc/type.coffeelib/all-headers.coffeesrc/components/contextmenu/contextmenuitem.coffeeclient/app/lib/flux/actions/user.coffeeapp/assets/javascripts/backbone/views/transition_view.js.coffeeclient/views/CalendarItem.coffeesrc/scripts/code-name-generator.coffeekeymaps/agda-mode.csonsrc/Witness/_witness/Scripts/witness-ui/ScenarioViewModel.coffeeclient/helpers.coffeescripts/views/workspace/content/content-edit.coffeecore/app/backbone/models/argument_votes.coffeesrc/scripts/pages/app/modals/legacy.coffeejs/coffee/foundation.coffeesrc/styles/ui/labels.coffeemodels/user.coffeelib/incompatible-packages-status-view.coffeeclient/accounts.coffeelib/main-v4.coffeecomponents/iframe_popover/index.coffeeclient/lanes/components/shared/FieldSet.cjsxapp/assets/javascripts/components/feed_view.coffeeclient/src/views/indicator_selector_view.coffeesrc/code/views/modal-view.coffeeapps/show/components/related_shows/index.coffeesrc/scripts/app.js.coffeesrc/coffee/cilantro/ui/field/stats.coffeesrc/lib/Platform.coffeesrc/button/index.coffeevendor/assets/javascripts/pushable_collection.js.coffeelib/status-bar.coffeelib/attachment.coffeeatom/browser/api/lib/exports/electron.coffeeapp/assets/javascripts/cmsimple/panels/images/list.coffeeclient/views/login/layout.coffeeroutes/auth.coffeelib/models/branches/current-branch.coffeejs/libs/github.coffeeserver/test/helpers.coffeeclient/landing/gulptasks/task.build.all.coffeespec/body-parser-spec.coffeeapp/assets/javascripts/admin/products/controllers/variant_units_controller.js.coffeeangular/core/services/time_service.coffeeapp/classify/subject-viewer.cjsxEnumeration.coffeeapp/views/dashboard_dialog.coffeestatic/src/scripts/app/main.coffeeapp/assets/javascripts/views/phase_header_view.js.coffeebuild/gh-pages.coffeesrc/init.coffeeclient/skr/components/LocationChooser.cjsxapp/client/survey_admin/survey_admin.coffeelib/models/git-stash-pop.coffeetasks/task-helpers.coffeesrc/logger.coffeesrc/lieber.coffeesource/assets/javascripts/footer.js.coffeesrc/parsers/slackapp.coffeeconsole/runner.coffeelib/tab-view.coffeesrc/app/directory.coffeeassets/logic/router.coffeeapp/collections/Products.coffeelib/list-edit.coffeeexamples/coffeescript/example.coffeelib/plugin-api/hydrogen-provider.coffeeblueprints/service/files/app/services/__name__.coffeeapp/assets/javascripts/rglossa/translations/en.coffeelib/linter-languagetool.coffeeresources/assets/coffee/react/modding-profile/stats.coffeekeymaps/minimap.csonetc/atom/keymap.csonclient/app/Applications/Chat.kdapplication/Views/conversationlistitemtitle.coffeeapp/assets/javascripts/backend/receptions.js.coffeeapp/frontend/scripts/upload.js.coffeelib/dart-tools.coffeevendor/assets/javascripts/neat/renderer/infinite_reveal.coffeeapp/assets/javascripts/sprangular/models/user.coffeeassets/javascripts/views/profile_stats.js.coffeesrc/ui/views/typinginfo.coffeeapp/scripts/ansible/reporters.coffeereview_front/app/controllers/project/commits.coffeesrc/main/webapp/coffeescripts-hidden/weeks-performance-graph.coffeesrc/code/views/alert-dialog-view.coffeejs-library/app/js/util/annotate.coffeepackages/rocketchat-authorization/server/functions/addUsersToRoles.coffeeapp/assets/javascripts/effective_orders/shipping_address_toggle.js.coffeeapp/js/main.coffeetest/integration/dynamodb.spec.coffeespec/deserializer-manager-spec.coffeeangular/core/components/poll/poll/vote_form/poll_poll_vote_form.coffeelibraries/settings/Settings.coffeesrc/scripts/dimmerworld.coffeelib/link.coffeelib/metrics.coffeesrc/package.coffeeapp/assets/javascripts/locations.js.coffeecore/app/backbone/views/channels/suggested_channels_view.coffeesrc/atom/command-interpreter/substitution.coffeesrc/beautifiers/prettier.coffeesrc/ext/components/log-file-output.coffeeclient/app/Applications/WebTerm.kdapplication/AppController.coffeeapp/assets/javascripts/lib/managers/select_group_manager.js.coffeeutil.common.coffeeapp/src/controllers/wallet/send/wallet_send_mobile_dialog_view_controller.coffeeclient/lanes/screens/CommonComponents.cjsxsrc/scripts/ping.coffeeapp/assets/javascripts/devtools.coffeesrc/coffee/game/enums.coffeeapp/src/utils/storage/chrome_store.coffeeapp/src/base/navigation_controller.coffeeassets/javascripts/helpers.js.coffeespec/javascripts/role_jquery_spec.coffeeparts/bottom-alert.cjsxsrc/app/api/models/teaching-period.coffeejavascripts/components/Layout.coffeetest/index.spec.coffeeapp/assets/javascripts/campo_editor.js.coffeeservices/web/public/coffee/ide/references-search/ReferencesSearchManager.coffeelib/applyDependencies.coffeescripts/testing.coffeesrc/scripts/modules/media/title/title.coffee_includes/coffeescript/scripts.coffeejs/application.coffeesrc/desktop/apps/galleries_institutions/queries/partner_categories_query.coffeeapp/assets/javascripts/magic_word/validatable_form.js.coffeecore/app/backbone/views/evidence/evidence_bottom_view.coffeetest/front.coffeeapp/assets/javascripts/models/lite_paper.js.coffeespec/compile-cache-spec.coffeesrc/app/api/models/group-set.coffeelib/walker.coffeeassets/javascripts/views/misc/updates.coffeecoffee/cilantro/models/exporter.coffeelib/utilities/viewsSerialization.coffeeapp/assets/javascripts/views/event_view.js.coffeesrc/Boundary.coffeeapp/assets/javascripts/collections/clouds/users.js.coffeeapp/assets/javascripts/chosen.js.coffeeapp/assets/javascripts/routes/application.route.js.coffeeapp/assets/javascripts/rglossa/routes/corpus/result_route.coffeespec/openers/preview-opener-spec.coffeeapp/assets/javascripts/objects/requests_number.js.coffeepackages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.coffeesrc/app/tasks/task-definition-selector/task-definition-selector.coffeelineman/app/js/controllers/proposal_pie_chart_controller.coffeesimpletabs.coffeeapp/assets/javascripts/admin/utils/services/errors_parser.js.coffeeassets/javascripts/application.coffeeservices/web/public/coffee/main/account-upgrade.coffeeapp/assets/javascripts/forms.js.coffeelib/restructured-preview.coffeetest/parser_spec.coffeetest/integration/system-int.coffeecommon/static/coffee/src/xblock/core.coffeeapplication/chrome/content/wesabe/io/Downloader.coffeeapp/assets/javascripts/routes/application_route.coffeelineman/app/services/message_channel_service.coffeeapp/assets/javascripts/directives/gravatar_directive.coffeesensor.coffeelib/models/diffs/diff-chunk.coffeelib/assets/javascripts/views/profile_component/avatar.js.coffeeapp/assets/javascripts/admin/subscriptions/controllers/subscription_controller.js.coffeeapp/assets/javascripts/modules/maps/base_layer.coffeelib/model/user.coffeeapp/assets/javascripts/mixingpanel/cookies.js.coffeeclient/app/lib/util/trackInitialTurnOn.coffeebuild/tasks/generate-asar-task.coffeeapp/assets/javascripts/initializers/session_restore.coffeemenus/term2.csonvendor/assets/javascripts/fustrate/generic_table.coffeesrc/lib/sync.coffeeapp/cells/markdown_readonly/markdown_readonly.coffeeprod/src/coffee-script/node/camparser.coffeekeymaps/autocomplete-plus.csonapp/assets/javascripts/views/components/toolbar.js.coffeeapp/assets/javascripts/shared/directives/question_mark_tooltip.js.coffeeapp/assets/javascripts/breakpoints.coffeeraspberrypi2.coffeeclient/landing/Workspace/panes/terminalpane.coffeeapp/assets/javascripts/components/flash_bar.coffeeapps/user/profile/index.coffeetest/javascripts/views/paper_edit_view_test.js.coffeeapp/assets/javascripts/budget_edit_associations.js.coffeecore/app/backbone/modules/overlay.coffeeapp/assets/javascripts/backbone/views/tree_view.js.coffeelib/convert-options.coffeeapp/assets/asset/view.coffeeapp/assets/javascripts/angular_app/directives/uoGraph.js.coffeevendor/assets/javascripts/fustrate/generic_page.coffeetest/javascripts/helpers/display_line_breaks.js.coffeetest/api_test.coffeekeymaps/list-edit.csonclient/test/src/report_edit_visualisation_view.coffeeapp/assets/javascripts/controllers/editor.coffeesrc/test/coffee/MeducationFrontEndSpec.coffeeraw-socket.coffeesrc/app/routes/search.coffeeactions/hdp_yarn_nm.coffeeconfig/env/vars.coffeeapp/assets/javascripts/cartilage/application.js.coffeelib/rails/beforesend.coffeeclient/app/CommonViews/linkviews/applinkview.coffeelib/base.coffeespec/minimap-spec.coffeesrc/app/api/models/task-alignment.coffeeapp/assets/javascripts/sprangular/directives/promoForm.coffeeclient/ide/lib/views/tabview/idetabhandleview.coffeesrc/trix/models/managed_attachment.coffeecore/app/backbone/views/generic/tourstepbox.coffeeapp/assets/javascripts/show_hide_checkboxes.coffeehome/atom/keymap.csonSource/ExpectedWrite.coffeeapp/scripts/pocket.coffeeapp/talk/lib/create-subject-default-button.cjsxapp/assets/javascripts/views/flash-messages.view.js.coffeetest/routes/api_v1-spec.coffeelib/polytexnic/server/views/refresh.js.coffeesrc/coffee/app.coffeedocs/source/javascripts/application.js.coffeesrc/src.coffeelib/messages.coffeelib/openers/atompdf-opener.coffeesrc/composite-disposable.coffeelib/git-add.coffeeapp/assets/javascripts/views/question_form_view.js.coffeeapp/assets/javascripts/users/notification_rules.js.coffeesrc/deserializer-manager.coffeecore/app/backbone/collections/search_collection.coffeesrc/scripts/workbench/views/sensor/map_view.js.coffeeapp/assets/javascripts/active_admin/cinematron.js.coffeeapp/assets/javascripts/graphs.js.coffeeclient/app/lib/util/tracker.coffeecoffee/model/config.coffeesrc/auth.coffeeapp/assets/volume/editLinks.coffeesrc/packages/collaboration/lib/ws-channel.coffeeapp/assets/javascripts/bootstrap-custom.js.coffeeclient/ide/finder/idefindercontextmenucontroller.coffeesrc/components/cc-dashboard/index.cjsxapp/pages/lab/glossary.cjsxscript/msgpackify.coffeespec/project-manager-spec.coffeeserver/serversystem/lobbyfind.coffeeclient/app/lib/util/shortenUrl.coffeeapp/assets/javascripts/models/track.js.coffeemodels/indicator.coffeetest/basic.coffeeclient/Ace/aceapplicationtabview.coffeelib/cleaner.coffeeapp/collections/manager-icon.cjsxcomponents/modals/KDBlockingModalView.coffeeclient/ide/workspace/panes/finderpane.coffeecore/app/assets/javascripts/intermediate.coffeeclient/lanes/components/shared/RadioField.cjsxspec-nylas/stores/namespace-store-spec.coffeesrc/index.cjsxfrontend/app/app.coffeesrc/library.coffeekeymaps/ide-haskell-repl.csonsrc/model/validations/exclusion_validator.js.coffeelib/server.coffeespec/search-spec.coffeesrc/game/example.coffeesrc/coffee/index.coffeeapp/collections/ThangNamesCollection.coffeeapp/views/editor/campaign/SaveCampaignModal.coffeetests/poo-tracker_test.coffeebuzzer.coffeelib/repositories.coffeesrc/packages/wrap-guide/src/wrap-guide.coffeesrc/invoke/invoke.coffeeclient/tx/lib/blockchain/bci.coffeeassets/javascripts/routers/profile.js.coffeesrc/handlers/frontpage/IndexHandler.coffeeapp/js/jail_iframe/classes/loading_promises.coffeesrc/input-component.coffeesrc/flux/stores/database.coffeesrc/app/sessions/states/sign-out/sign-out.coffeespec/validate-schemas.coffeeapp/assets/javascripts/ab_admin/components/in_place_edit.js.coffeeapp/assets/javascripts/models/commit.js.coffeekeymaps/tree-ignore.csonapp/views/toolbox.coffeeapp/assets/javascripts/reload_changes.js.coffeelib/generators/backbone/scaffold/templates/views/index_view.coffeeapp/assets/javascripts/angular/controllers/form_ctrl.js.coffeesrc/pulsar-api.coffeescripts/github.coffeeserver/dataMethods.coffeeapp/assets/javascripts/admin/index_utils/directives/select2_min_search.js.coffeeserver/methods.coffeeapp/assets/javascripts/error_handler.coffeelib/atomatigit.coffeeapp/assets/javascripts/all_aboard/components/perspective_assignment.js.coffeeangular/core/components/poll/common/start_poll/poll_common_start_poll.coffeeapp/assets/javascripts/favourites.js.coffeegulp/tasks/style.coffeesrc/heroku-git.coffeeserver/libs/container/createVolume.coffeegrunt/6to5.coffeeapp/views/application.coffeeassets/js/src/main.coffeesrc/views/ui/nav_group/index.coffeeAtom/snippets.csoncore/app/backbone/models/fact_relation.coffeelib/tree.coffeesrc/trix/core/logger.coffeeapp/coffee/translations.coffeeapp/assets/javascripts/bounties.js.coffeemodels/mixins/relations/user.coffeewww/client/user/controllers/login.coffeesrc/trix/input.coffeescripts/util/http-promise.coffeespec/api-app-spec.coffeeapp/assets/javascripts/mixins/views/redirects_on_editable.js.coffeeapps/settings/routes.coffeeapp/assets/javascripts/organization.coffeesrc/coffee/cilantro/models/query.coffeetest/html-parse.coffeetest/dependency.coffeesrc/plugins/jsonparser.coffeeserver/lib/tasks/backupIndicatorData.coffeesrc/toilet-list.coffeesrc/stdlib/task.coffeeapp/assets/javascripts/shipit.js.coffeesrc/events.init.coffeesrc/build-cache.coffeeapp/system/trigger/impl/push.coffeeapp/assets/javascripts/modules/dashboard/views/account.coffeelib/panel.coffeeaccounts/server/provider_secrets.coffeeapp/assets/javascripts/bikeways.js.coffeekeymaps/atom-repl.csontest/remote-channel.coffeelib/app.coffeefrontend/view_index.coffeesrc/components/reference-book/teacher-content-toggle.cjsxapp/assets/service/upload.coffeeclient/Terminal/vmselectionview.coffeelib/mycha.bin.coffeeapp/assets/javascripts/views/overlays/new_ad_hoc_task_overlay_view.js.coffeecore/app/backbone/views/facts/fact_bottom_view.coffeevendor/assets/javascripts/jquery.sticky_footer.js.coffeeimports/collections/promedPosts.coffeeclient/src/scripts/frame-list-view.coffeemenus/merge-conflicts.csonsrc/components/Output.coffeesrc/transactions.coffeeclient/ide/lib/views/statusbar/idechatheadwatchitemview.coffeeapp/choose-subject-set.cjsxsrc/namespace.coffeesrc/pane-axis.coffeespec/keybinding-resolver-view-spec.coffeespec/spec_helper.coffeescripts/govuk_app_owners.coffeelib/resource-combiner.coffeetest/models/indicator.coffeeapp/assets/javascripts/components/overview/inline_users.cjsxservices/web/public/coffee/ide/editor/directives/toggleSwitch.coffeesrc/entities/toast.coffeespec/link-spec.coffeeassets/javascripts/routers/posts.js.coffeebackend/app/assets/javascripts/spree/backend/store_credits.js.coffeeapp/coffeescripts/StudentInCourse/ParticipationData.coffeecomponents/Cache.coffeecore/app/backbone/models/comment.coffeesrc/web/model/book.coffeesrc/extensions/outline-view/src/tag-generator.coffeespec/javascripts/tabs_spec.js.coffeelib/rubymotion.coffeeapp/assets/javascripts/rating.js.coffeesrc/app/keymaps/command-panel.coffeeconfig/grunt/karma.coffeeapp/assets/javascripts/components/question_component.js.coffeesrc/compiler-flags.coffeesrc/adapters/shell.coffeeapp/scripts/app.js.coffeeapp/data/workflows.coffeejs/tests/process-test-results.coffeeweb/app/models/users.coffeeassets/js/gimme/gimme.coffeeapp/src/controllers/update/update_done_view_controller.coffeeapp/assets/javascripts/application/views/users/edit.js.coffeebenchmark/benchmark-bootstrap.coffeetest/integration/setup_teardown.coffeeapp/assets/javascripts/admin/services/query_persistence.js.coffeemenus/language-idris.csontest/spec_helpers.coffeetutor/src/components/no-periods.cjsxsrc/languages/python.coffeemenus/list-edit.csonpackages/rocketchat-chatops/client/tabBar.coffeesrc/flux/performance.coffeeclient/app/lib/providers/computeplansmodalfooterlink.coffeeserver/oneWaySync.coffeelib/open-on-github.coffeesrc/components/Group.coffeetest/snapshot.coffeeserver/lib/tasks/create-user.coffeeapp/assets/javascripts/routers/ships_router.js.coffeeapp/coffeescripts/badge_counts.coffeesrc/beautifiers/clojure-beautifier/index.coffeeassets/scripts/app/helpers/urls.coffeeapp/assets/javascripts/todos.js.coffeesrc/scripts/github-credentials.coffeescripts/stamp.coffeeapp/server/js/middleware.coffeesrc/test/test-esm.coffeeexamples/quadtree.coffeesrc/view/bindings/view_binding.coffeetest/prompts.coffeeclient/landing/app/CommonViews/avatarviews/avatarview.coffeeapp/assets/javascripts/legislation_allegations.js.coffeesrc/particles/timers/instant.coffeelib/helpers/formatter_helper.coffeesrc/test/shared/process-results.coffeelib/nord-atom-ui-vertical-tabs.coffeeserver/publications/activeUsers.coffeesrc/local-api/index.coffeecms/static/coffee/spec/helpers.coffeefrontend-admin/src/app/views/user.controller.coffeeapp/js/util/annotate.coffeevendor/assets/javascripts/tao.coffeeapp/controllers/language_picker.coffeelib/config-schema.coffeelib/layervault/organization.coffeesrc/loader.coffeespec/NoFlo.coffeeapp/assets/javascripts/utils.js.coffeeapp/assets/javascripts/oxalis/view/settings/setting_views/slider_setting_view.coffeesrc/scripts/gangnam.coffeeapp/assets/javascripts/components/posts.js.cjsxassets/scripts/app/routes/job.coffee_coffee/person-list.coffeegrammars/roff.csonapp/views/admin/OutcomeReportResultView.coffeecore/app/assets/javascripts/jquery_ujs_override.coffeelibraries/metrics/event_loop.coffeekeymaps/linter.csontapestry-core/src/main/coffeescript/META-INF/modules/core/zone.coffeejs-library/app/js/jail_iframe/initializers/scrollbarSuppressor.coffeesettings/language-powershell.csonlib/minimap-pigments-binding.coffeeclient/landing/app/MainApp/fs/fsfolder.coffeesrc/rivets.coffeesrc/desktop/apps/home/queries/initial.coffeesrc/components/learning-guide/info-link.cjsxserver/models/user.coffeeapp/assets/javascripts/controllers/product_detail_controller.coffeesrc/processors/maxRetries.processor.coffeeapp/assets/javascripts/neighborly/modules/payment.js.coffeesrc/spec/integration.spec.coffeeapp/assets/javascripts/neighborly/projects/backers/edit.js.coffeesrc/runner.coffeesrc/brave-mouse/validate.coffeecommon/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffeeapp/client/js/react/header.coffeesrc/trix/views/document_view.coffeesrc/set-helpers.coffee_mdwriter.csonserver/methods/addUserToRoom.coffeesrc/coffee/xmlhelpers.coffeeclient/ide/views/chat/chatparticipantview.coffeeapp/assets/javascripts/spina/switch.js.coffeesrc/yayson.coffeegulp/tasks/icon-font.coffeeapp/assets/javascripts/rglossa/controllers/cwb/result/table_controller.coffeeapi/tools/optionsroute.coffeeapp/views/users/verify_paypal.js.coffeesrc/app/units/states/tasks/viewer/directives/task-sheet-view/task-sheet-view.coffeegulp/watch.coffeesrc/scripts/loader.coffeeapp/assets/javascripts/admin/settings.js.coffeeservices/track-changes/app.coffeespec/side-view-spec.coffeescripts/moo.coffeeapp/assets/javascripts/views/discussion_view.js.coffeelib/modals/json-modal.coffeeclient/lanes/models/mixins/HasCodeField.coffeeapp/assets/javascripts/species/views/documents/batch_download_component.js.coffeetasks/nof-task.coffeeapp/client/js/app.coffeesrc/storyboard.coffeeservices/web/app/coffee/Features/Labels/LabelsController.coffeecore/app/backbone/factlink/react_loading_indicator.coffeecore/app/assets/javascripts/spree.js.coffeeapplication/chrome/content/wesabe/fi-scripts/com/chase/errors.coffeelib/prompt.coffeelib/error-view.coffeelib/editor-registry.coffeesrc/dom-element-pool.coffeeclient/components/RegisteredUsers.coffeeapp/components/file-list.coffeescripts/hash-web-resources.coffeecore/app/backbone/factlink/caching_controller.coffeeapp/assets/javascripts/rglossa/views/cwb/result/table_view.coffeetutor/src/components/student-dashboard/event-info-icon.cjsxapp/controllers/session-controller.coffeesrc/galao/number.coffeejs/plugin.coffeegulp/development/webserver.coffeeBackofficeBundle/Resources/public/coffee/page/viewportChannel.coffeeapp/utils/favicon-manager.coffeesrc/browser/Application.coffeekeymaps/snippets-2.csonsrc/app/admin/states/users/users.coffeescripts/views/workspace/menu/add.coffeetest/node_gyp.coffeelib/hacks/filter.coffeetests/denorm-tests.coffeetests/src/document/utils.coffeeapp/assets/javascripts/reports.js.coffeetest/jira-linkifier-test.coffeesrc/Browser/Browser.coffeesrc/app/units/states/task-inbox/task-inbox.coffeespec/code-context-spec.coffeecore/app/backbone/views/users/user_popover_content_view.coffeeapp/assets/javascripts/admin/views/parameters/edit.js.coffeeutil/atom-language-ait/grammars/ait.csoncore/app/backbone/initializers/client_initializer.coffeelib/atom/project-paths.coffeesrc/script/countries/IRQ.coffeelib/changes/changes-view.coffeetimeAsyncMethod.coffeeapp/assets/javascripts/sprangular/controllers/checkout/deliveryAndPayment.coffeesrc/smc-webapp/chat/store.coffeeexpress/routes/collector.coffeeapp/assets/javascripts/components/moving_records/moving_volume_panel.js.coffeeapp/views/courses/StudentLogInModal.coffeeapp/assets/javascripts/segmentio.js.coffeeapp/assets/javascripts/views/movies/index_view.js.coffeeapp/assets/javascripts/routes/paper_edit_route.js.coffeesrc/maps.coffeespec/color-search-spec.coffeeapp/assets/javascripts/darkswarm/controllers/checkout/accordion_controller.js.coffeesrc/app/pasteboard.coffeesrc/script/EnemyManager.coffeeapp/assets/javascripts/admin/variant_overrides/filters/hub_permissions_filter.js.coffeespec/skr/models/SalesOrderSpec.coffeeapp/src/controllers/wallet/message/wallet_message_index_dialog_view_controller.coffeespec/color-scanner-spec.coffeereview_front/app/models/commit.coffeelib/models/application.coffeeapp/views/admin/update_paypal.js.coffeeapp/src/wallet/sweep_private_key.coffeeapp/assets/javascripts/hyper_admin/angularjs/directives/form/form_actions.js.coffeesrc/kato-http-api.coffeeapp/assets/javascripts/oxalis/controller/abstract_tree_controller.coffeeapp/scripts/components/entities/Mine.coffeesrc/provider/twitch-vod.coffeeapp/assets/javascripts/hyper_admin/angularjs/controllers/form_ctrl.js.coffeeapp/assets/javascripts/projects.js.coffeesrc/Lidsys/Application/Controller/assets/lidsys/app-models.js.coffeeapps/home/client/index.coffeeapp/components/user-search.cjsxassets/javascripts/mac_auth.js.coffeeservices/web/app/coffee/models/Subscription.coffeetest/integration/helper.coffeeapp/assets/javascripts/components/league.js.coffeeexamples/basic/server.coffeecomponents/__tests__/ProgressBar.spec.cjsxtest/e2e/collectionDetailSpec.coffeecore/app/backbone/factlink/text_area_view.coffeeapp/client/js/songs/edit/react/page.coffeejs/ab_test_definitions.coffeeapp/classifier/tasks/survey/annotation-view.cjsxwww/webapp/static/webapp/js/app/views/tenants/tenantsShow.coffeeapps/apply/client/modes.coffeeapp/assets/javascripts/modules/timelet/models/timelet.js.coffeeapp/assets/javascripts/admin/enterprises/enterprises.js.coffeeapp/assets/javascripts/feeds.js.coffeeclient/landing/app/MainApp/filetree/itemviews/folderitem.coffeedoc/src/main.coffeesrc/packages/collaboration/lib/session-utils.coffeespec/sort-lines-spec.coffeeclient/landing/app/MainApp/filetree/itemsubviews/copyurlview.coffeecommon/static/coffee/spec/logger_spec.coffeecomponents/notifications_menu/client/notifications_view.coffeeclient/lanes/models/ChangeSet.coffeelib/rich-description.coffeeapp/classifier/tasks/crop/index.cjsxapps/helpers.coffeescripts/do-you.coffeesrc/components/Split.coffeetutor/src/components/course-calendar/past-assignments.cjsxcore/htdocs_source/src/pods/oxisection-keyvalue/component.coffeesrc/widgets/components/datetime-picker.coffeeapp/assets/javascripts/admin/neuron_form.js.coffeetest/src/specs/app/Helpers/ElementWrapSpec.coffeeapp/assets/javascripts/lib/forms/input_validator.js.coffeelib/assets/javascripts/cable/subscriber_manager.js.coffeelib/generators/utensils/utensil/templates/behavior.coffeecore/app/backbone/views/subchannels_view.coffeeservices/web/app/coffee/Features/PasswordReset/PasswordResetController.coffeetest/missing-support.coffeetest/components/learning-guide/practice-button.spec.coffeeapp/assets/javascripts/controllers/user_controller.js.coffeeassets/scripts/lib/travis/expandable_record_array.coffeesrc/channel.coffeesrc/window.coffeecoffee/document.coffeecommunity/browser/app/scripts/directives/helpTopic.coffeescripts/views/layouts/workspace/menu.coffeeapp/assets/javascripts/import_button.js.coffeesrc/components/question/formats-listing.cjsxsrc/scripts/views/link.coffeelib/utils.coffeesrc/cache/repository.coffeesettings/language-viml.csonserver/route_bindings.coffeelib/atom-perl6-editor-tools-hyperclick.coffeeclient/skr/screens/time-tracking/PopoverMiniControls.cjsxlib/script.coffeesrc/client/formatters/html.coffeeapp/assets/javascripts/martian_components/components/utils/full_height_header.coffeeapp/assets/javascripts/backbone/models/commit_request.js.coffeeapp/assets/javascripts/voluntary_ranking/routes/profile/rankings_route.js.coffeeevesrp/static/js/util.coffeelib/table-header-component.coffeespec/settings-spec.coffeesrc/app/common/partials/directives/grade-icon.coffeesrc/scripts/manatee.coffeeapp/models/bookmark.coffeekirppu/static_src/js/checkout/itemcheckinmode.coffeeapp/assets/javascripts/models/author.js.coffeeh2o-web/src/main/steam/scripts/xhr.coffeeapp/assets/javascripts/modules/global_hooks.js.coffeesrc/model/associations/association_set.coffeesrc/app/grammar-view.coffeeapp/assets/javascripts/kublog/shared.js.coffeeapp/assets/javascripts/entities/order.coffeelib/fran.coffeeweb/js/views/search_input_view.coffeeworkers/social/lib/social/render/statuswidget.coffeelib/loggers/console-logger.coffeesrc/modules/app/maker/makerController.coffeesrc/packages/symbols-view/lib/tag-generator.coffeesrc/error_formatter.coffeeinternal_packages/account-sidebar/lib/components/account-sidebar.cjsxlib/otter/renderer.coffeebokehjs/src/coffee/models/widgets/multiselect.coffeejs/routers/AppRouter.coffeeroutes/index.coffee_includes/coffee/benchmark_table.coffeelib/reporter.coffeeassets/agent_spawner.coffeecore/app/backbone/views/sub_comments/sub_comments_list_view.coffeeaddon/initializers/youtube.coffeespec/builders/latexmk-spec.coffeeapp/forgot-password-controller.coffeeapp/assets/javascripts/account.coffeesrc/9.coda.coffeeapp/assets/javascripts/application/app_router.js.coffeebokehjs/src/coffee/models/transforms/jitter.coffeesrc/coffee/cilantro/setup.coffeeapp/assets/javascripts/embeditor/adapter.js.coffeesrc/view/view_store.coffeesrc/scripts/urban.coffeeapps/fair_info/routes.coffeekeymaps/python-isort.csonapp/assets/javascripts/neighborly/admin/modules/sort.js.coffeevendor/assets/javascripts/active_admin.js.coffeeapps/user/client/channels.coffeeassets/javascripts/string_score.js.coffeeapp/resources/main.coffeeapp/assets/javascripts/darkswarm/directives/on_hand.js.coffeeapp/assets/javascripts/lights.coffeelib/linter-pyflakes.coffeelib/assets/javascripts/unified_collection.js.coffeeapp/lib/splits.coffeelib/pg-hoff-types.coffeewidgets/textcarousel/textcarousel.coffeeclient/app/lib/util/isVideoFeatureEnabled.coffeesrc/views/ui/form/editors/factory.coffeeimpls/browser/index.coffeesource/javascripts/application.js.coffeetest/progress/index.spec.coffeespec/format-spec.coffeelib/csv-progress-element.coffeetest/languages.coffee.atom/packages.csontest/helpers/fake-window.coffeescripts/butt.coffeetest/javascripts/support/mock_server.js.coffeelib/sensu-dashboard/assets/javascripts/handlebars_helpers.coffeesrc/scripts/views/gui/SourceFileMarkup.coffeecore/app/backbone/collections/evidence_collection.coffeebase/assets/javascripts/base.coffeesrc/flux/ecosystems.coffeesrc/coffee/cilantro.coffeeproject_template/app/application.coffeesrc/components/task/viewing-as-student-name.cjsxlib/minimap-find-and-replace.coffeevendor/assets/javascripts/qrious-ui.js.coffeesrc/search-subscription.coffeesrc/pry/commands/xecute.coffeekeymaps/to-the-hubs.csonclient/skr/components/TermsChooser.cjsxlib/side-view.coffeeplugins/owned-list/index.cjsxapp/views/home_page_view.coffeelib/linter-scalac.coffeelib/toolbar-button-view.coffeelib/linter.coffeelib/soft-wrap-indicator-view.coffeeservices/chat/config/settings.defaults.coffeecommunity/browser/app/scripts/init/httpHeaders.coffeeassets/coffee/app.coffeespec/metrics-spec.coffeelib/package-readme-view.coffeesrc/errors.coffeespec/Parse.coffeetests/batman/navigator/navigator_test.coffeeapp/components/svg-image.cjsxapp/client/delete_survey_modal/delete_survey_modal.coffeelib/scope-helpers.coffeelib/git-log-class.coffeesrc/core/Pointer.coffeesrc/scripts/ascii.coffeesrc/tasks/drawing.coffeeapp/utils/connector-rfb.coffeesrc/components/reference-book/exercise.cjsxtest/node_http_client.spec.coffeeapp/assets/javascripts/keyboard_shortcuts.js.coffeefiles/.atom/config.csonkeymaps/line-jumper.csonsrc/coffee/cilantro/ui/concept/info.coffeesrc/tools/junction.coffeeclient/app/lib/util/getMessageOwner.coffeeapp/assets/javascripts/rglossa/utils.coffeeapp/assets/javascripts/peek/views/active_record.coffeescripts/boomtown.coffeesrc/FileManager/BreadcrumbDirective.coffeecoffee/lib/router.coffeeapp/assets/javascripts/components/load-more.js.coffeefrontend/registration_tz_selection.coffeecomponents/main_layout/footer/view.coffeelib/open-terminal-here.coffeemenus/spell-check.csonsrc/code/utils/hash-parameters.coffeelib/dialog.coffeesrc/pointer-tool.coffeesrc/scripts/helpers/links.coffeesrc/packages/collaboration/lib/bootstrap.coffeelib/minimap-highlight-selected.coffeespec/linter-behavior-spec.coffeeapp/assets/javascripts/date_chooser.coffeecoffee/cilantro/ui/concept/columns.coffeeapp/assets/javascripts/startups.js.coffeeapp/assets/javascripts/app_core.js.coffeecontrollers/time_entries.coffeeclient/controllers/users.coffeecoffee/models/base/model.coffeeserver/coffee/src/schema_validator.coffeesrc/coffee/AnimationSequence.coffeesrc/scripts/lib/zooniverse/config.coffeesrc/trix/config/selection_elements.coffeeapp/assets/javascripts/routing.js.coffeesrc/helpers/durations.coffeesrc/app/fold.coffeeapp/assets/javascripts/action_cable_notifications/default_callbacks.coffeelib/tooltip-view.coffeesrc/scripts/hubot-zoi.coffeelineman/app/models/group_records_interface.coffeeclient/Main/navigation/navigationmachineitem.coffeeapp/assets/javascripts/overlay.js.coffeesrc/app/projects/states/dashboard/directives/task-dashboard/directives/task-plagiarism-card/task-plagiarism-card.coffeesrc/watch.coffeecoffee/db/sentry.coffeesrc/core/components/browser.coffeescripts/common.coffeejavascripts/lib.coffeeapp/assets/javascripts/tryEvalGD.coffeetest/acceptance.coffeeapps/show/components/follow_artists/index.coffeeapp/assets/javascripts/buckets.js.coffeeapp/assets/javascripts/popover.js.coffeeclient/ide/workspace/panes/previewpane.coffeetest/noServices.coffeeassets/javascripts/fetch_pool.js.coffeesrc/scripts/achievement_unlocked.coffeesrc/components/navbar/account-link.cjsxtests/leveldb-async-test.coffeelib/csv-config.coffeeapp/assets/javascripts/admin/order_cycles/controllers/incoming_controller.js.coffeesrc/tds-versions.coffeelib/find-results-view.coffeesrc/shem-cli.coffeeapp/lib/get-tutorial-subject.coffeespec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.cjsxaddon/initializers/data-complex.coffeescripts/say.coffeeclient/Social/Activity/views/privatemessage/privatemessagelistitem.coffeelib/minimap-selection-view.coffeeassets/javascripts/controllers/users_new_controller.js.coffeelib/elvis-backbone.coffeelib/views/branch-list-view.coffeelib/appBaseComponents/views/BaseView.coffeesrc/mobile/apps/user/routes.coffeeconfig/application.coffeespec/helpers/require_helper.coffeetest/support/common.coffeetest/global_scope_spec.coffeesrc/browser/auto-updater-win32.coffeesrc/javascript/view.coffeesrc/keyboard-layout.coffeecomponents/BufferToCanvas-node.coffeeapp/assets/javascripts/sprangular/directives/addressSelection.coffeesrc/user/model.coffeeviews/services/sortieFreeSlotCheck.coffeeapps/feed/routes.coffeecomponents/Title.cjsxspec/about-spec.coffeeapp/assets/javascripts/surveys.coffeeapp/assets/javascripts/adapter.coffeebuild/tasks/mkdeb-task.coffeeapp/assets/javascripts/components/search/material_link.js.jsx.coffeeapp/api/config.coffeemodels/mixins/parallel.coffeeresources/assets/coffee/react/contest.coffeeapp/assets/javascripts/initializers/authentication.coffeeapp/lib/soundcloud.coffeesrc/impromptu.coffeehome/atom/init.coffeeserver/secret.coffeespec/examples.coffeeMediaAdminBundle/Resources/public/coffee/WysiwygSelectView.coffeetapestry-core/src/main/coffeescript/META-INF/modules/core/grid.coffeeapp/controllers/x3d_controller.coffeeclient/landing/app/MainApp/sidebar/virtualizationcontrols.coffeesrc/models/reputation.coffeeservices/web/test/unit_frontend/coffee/test-main.coffeeservices/web/app/coffee/Features/Dropbox/DropboxWebhookHandler.coffeemenus/execute-as-ruby.csonapp/assets/javascripts/admin/extensions/change_tracker.js.coffeeapp/assets/javascripts/farmbot_app/directives/syncbutton.js.coffeeapp/client/js/react/pages/home.coffeeapp/assets/javascripts/active_admin/lib/batch_actions.js.coffeelib/potato.coffeeresources/assets/coffee/react/_components/user-avatar.coffeetest/test_helper.coffeegui/Gruntfile.coffeeframer/Config.coffeeapp/assets/javascripts/modules/protected_areas/base.js.coffeegrammars/jisonlex-injection.csonservices/web/app/coffee/Features/Analytics/AnalyticsRouter.coffeesnippets/js-polymer-declaration.csoncontrols/_Version.coffeetest/pathview_test.coffeecoffee/patchboard.coffeeapp/views/footer-view.coffeeclient/view/setup.coffeesrc/lib/amazon.coffeeapps/galleries_institutions/queries/partner_fragment.coffeecoffee/config.coffeeservices/web/public/coffee/directives/bookmarkableTabset.coffeetest/test_coffeelint.coffeecontrollers/user_credentials.coffeeangular/core/components/polls_page/polls_page.coffeetest/spec.coffeesrc/scripts/modules/search/advanced/advanced.coffeeclient/client_flag.coffeeweb/lib/coffeescripts/filter.coffeesrc/scripts/github-activity.coffeespec/javascripts/application/seeds_store_spec.js.coffeespec/integration/smoke-spec.coffeeapp/assets/javascripts/articles.js.coffeeviewer/app.coffeeapp/assets/javascripts/ontology_version-state.js.coffeesrc/build.coffeeapp/assets/javascripts/spree/backend/translations.js.coffeeapp/scripts/scenes/New.coffeesrc/router.coffeelib/tasks/scan-paths-handler.coffeeapp/assets/javascripts/local_time/page_observer.coffeekeymaps/bookmarks.csonsrc/modules/app/index.coffeescripts/xcode-server.coffeeapp/assets/javascripts/members.js.coffeeservices/web/app/coffee/Features/SudoMode/SudoModeHandler.coffeecore/app/backbone/contrib/default_click_handler.coffeebokehjs/src/coffee/tool/actions/preview_save_tool.coffeebokehjs/src/coffee/models/widgets/abstract_button.coffeeapp/assets/javascripts/models/data/project.js.coffeeapp/application.coffeeclient/lib/cordova/push.coffeeclient/app/lib/useritem.coffeeapp/assets/javascripts/activate_chosen.js.coffeesubject-metadata.coffeebrunch-config.coffeesrc/app/config/restangular.coffeeclient/app/MainApp/sidebar/sidebarcontroller.coffeecontent_manifest.coffeelib/project/result-view.coffeeapps/artwork_2/lib/inquire.coffeecms/static/coffee/src/main.coffeeserver/materials/data/topics/sparse_tables.coffeesrc/wrappers/enumerable.coffeesrc/object-selection.coffeeapps/auction_support/index.coffeesrc/scripts/models/content/page.coffeetest/bundle.coffeesrc/ng-iban.coffeeapp/controllers/about_page.coffeeapp/assets/javascripts/app.coffeesynchronize.coffeesrc/catalog.coffeeclient.coffeescripts/bugzilla.coffeelib/misc.coffeedefault-config.csoncomponents/GetUserToken.coffeemenus/hydrogen.csonsrc/routes/backend-static.coffeeapps/about/client/index.coffeeclient/CollaborativeWorkspace/panes/sharableclientterminalpane.coffeespec/schemas.coffeelib/viewers/okular-viewer.coffeetest/task/collection.spec.coffeeapp/assets/javascripts/neighborly/static/learn.js.coffeeapp/assets/javascripts/dynamic_fields_for.coffeeapp/mixins/dateable.coffeesite/lib/utils.coffeeindex.cjsxangular/core/components/memberships_page/pending_invitations_card/pending_invitations_card.coffeeapp/controllers/Dashboard.coffeeastroid-web.coffeesrc/site-header.coffeespec/specs/once.coffeetest/pass-through-if-length-greater-than-min-spec.coffeeapp/assets/javascripts/lib/models/gquery.coffeeclient/boot.coffeespec/fixtures/packages/package-with-config-defaults/index.coffeeplugins/campfire/index.coffeecomponents/DispatchAction.coffee_assets/javascripts/frontend/homepage.js.coffeesrc/app/projects/states/dashboard/directives/task-dashboard/directives/task-status-card/task-status-card.coffeelineman/app/components/legacy_trial_expired_modal/legacy_trial_expired.coffeetest/nesting.coffeecoach/specs/concept-coach/coach.spec.coffeeapp/assets/javascripts/admin/utils/directives/variant_autocomplete.js.coffeelib/snippets-provider.coffeeapp/assets/javascripts/playground.js.coffeetest/javascripts/unit/local_time_test.js.coffeeapp/assets/javascripts/routes/categories-show-route.js.coffeecore/app/backbone/views/opinionators/opinionators_avatars_view.coffeeclient/app/modules/store.coffeeapp/scripts/controllers/user-violations-prefs.coffeeapp/assets/javascripts/views/fake-map.view.js.coffeesrc/cli/argv.coffeegulp/server.coffeeapp/classify/subject-tools.cjsxclient/view/agenda.coffeesource/server/infrastructure/projection.coffeeapp/assets/javascripts/page_initialise.coffeesrc/ubret/fits_viewer.coffeecompilation/gulp-i18n.coffeesrc/kissmetrics-batch.coffeesrc/scripts/rajinikanth.coffeesrc/components/SplitStr.coffeelib/line-jumper.coffeesrc/window-bootstrap.coffeeapp/assets/javascripts/quick_add_url.js.coffeesrc/tb/views/base.coffeeapp/client/js/routes.coffeesingleplayerlistener.coffeebokehjs/src/coffee/models/widgets/div.coffeekeymaps/latex.csonlib/assets/javascripts/websocket_rails/websocket_connection.js.coffeemenus/grammar-selector.csonjob-registry.csonsource/javascripts/_posts_factory.js.coffeeapp/assets/javascripts/components/question/check_component.js.coffeeapp/assets/javascripts/admin/utils/services/status_message.js.coffeelib/cursor-position-view.coffeecomponents/__tests__/utils.cjsxapp/js/components/tabs/find/controllers/FindCtrl.coffeesrc/metacoffee/command.coffeeexamples/express/lib/app.coffeespec/javascripts/dot_ledger/views/transactions/table_spec.js.coffeewrite_posts.coffeelibraries/metrics/timeAsyncMethod.coffeesrc/validate-parameters.coffeelib/linter-php.coffeeapp/components/cropped-image.cjsxlib/iridium/casperjs/lib/iridium/qunit_adapter.coffeeclient/Social/Activity/views/comments/listviewcontroller.coffeepackages/rocketchat-mentions/server.coffeeangular/core/components/thread_page/previous_proposals_card/previous_proposals_card.coffeelib/shuss-cli.coffeespec/async-spec-helpers.coffeestatic/scripts/application.coffeetest/test.coffeesrc/lib/utils/utils.coffeespec/python-tools-spec.coffeesrc/components/task-plan/builder/time-zone-settings-link.cjsxsrc/scripts/maps.coffeeapp/js/controllers/account_balances.coffeeassets/javascripts/controllers/user_item_controller.js.coffeelib/sumatra/runtime.js.coffeelib/palette-element.coffeesrc/natives/classes/sun.net.spi.DefaultProxySelector.coffeeapp/assets/javascripts/plugins/awesome-share-buttons.js.coffeelib/ThenableCollection.coffeeapp/assets/javascripts/application/routers/users.js.coffeekeymaps/atom-latex.csonbuild/tasks/codesign-task.coffeesource/core/output.coffeeapp/src/tasks/transaction_observer_task.coffeeapp/assets/pg/level/round/gender/gender.controller.js.coffeeapp/assets/javascripts/neighborly/balanced/creditcard/payments.js.coffeekeymaps/python-debugger.csonsrc/services/dogeparty.coffeeassets/javascripts/views/profile_follow_button.js.coffeeapp/assets/javascripts/routes/paper_task_route.js.coffeeclient/landing/Workspace/panes/pane.coffeeclient/app/MainApp/VirtualizationController.coffeemenus/test-navigator.csonresources/assets/coffee/_classes/loading-overlay.coffeesnippets/polymer-element.csontest/smoke/typing-test.coffeeapp/assets/javascripts/darkswarm/directives/validate_stock_quantity.js.coffeeapp/assets/javascripts/views/dashboard_link_view.js.coffeeapp/assets/javascripts/admin/routers/connections.js.coffeesrc/client/track/index.coffeelib/project/match-view.coffeeapp/scripts/controllers/nav-bar.coffeeapp/assets/javascripts/ui/utils.js.coffeespec/table-edit-spec.coffeeconfig/env/production.coffeespecs/unit/type/proxy_type/is_super_type_of_spec.coffeesrc/app/config/privacy-policy/privacy-policy.coffeeclient/lanes/lib/Templates.coffeeassets/javascripts/react/components/build_area.coffeesrc/size.coffeeapp/assets/javascripts/instruments.js.coffeecore/app/backbone/factlink/make_tooltip_for_view.coffeecore/app/assets/javascripts/base/feedback_button.coffeelib/util.coffeestatic/src/scripts/app/views/IssuesListView.coffeesrc/helpers.coffeesrc/scripts/httpd.coffeesrc/ls-archive-cli.coffeelib/file.coffeestatic/js/party-list.coffeelib/spell-check.coffeegulp/webpack_config.coffeeclient/lanes/components/shared/ToggleField.cjsxclient/app/lib/util/formatQuotes.coffeeapp/assets/javascripts/strut_builder/textbox.js.coffeesrc/coffee/cilantro/changelog.coffeelib/views/select-stage-hunk-file-view.coffeeservices/web/public/coffee/ide/chat/controllers/ChatMessageController.coffeescripts/lockstep-cron.coffeesrc/scripts/modules/media/tabs/contents/leaf.coffeesrc/scripts/modules/media/latest/latest.coffeeLoggerFactory.coffeeclient/admin/lib/views/stacks/editors/variableseditorview.coffeeworkers/social/lib/social/models/sharedmachine.coffeeserver/lib/token_authentication.coffeelib/directory-view.coffeeconfig/generateShellEnv.coffeeevent_loop.coffeesrc/coffee/cilantro/ui/query/loader.coffeesrc/tub.coffeelib/validators/format.coffeeapp/assets/javascripts/channels/page_update.coffeetest/all-tests.coffeesrc/atom/app.coffeeclient/source/models/template.coffeeapp/assets/asset/display.coffeecore/app/backbone/views/evidence/top_fact_evidence_view.coffeespec/lint-spec.coffeeresources/assets/lib/components/notification-banner.coffeelib/hashingFunctions.coffeesrc/packages/fuzzy-finder/keymaps/fuzzy-finder.csonnpm2nix.coffeeapp/assets/javascripts/modules/filter_form.coffeepackages/rocketchat-lib/server/methods/restartServer.coffeepackages/rocketchat-lib/server/functions/setUsername.coffeetest/src/system/installation_process_test.coffeejs/test.coffeesrc/coffee/product-component.coffeesrc/coffee/csv/importer.coffeeapp/assets/javascripts/services/file_upload.coffeeapp/assets/javascripts/player/brush.js.coffeelib/gocov/gocov-parser.coffeesupport/spec_helpers.coffeesrc/model.coffeeapp/src/controllers/wallet/send/wallet_send_preparing_dialog_view_controller.coffeeclient/controllers/incidentReports/incidentTable.coffeeassignments/coffeescript/binary/binary_test.spec.coffeespec/hashparamsSpec.coffeeapp/assets/javascripts/controllers/overlays/message_overlay_controller.js.coffeeapp/assets/javascripts/rails_admin/ra.i18n.coffeeapp/views/play/level/tome/ProblemAlertView.coffeeserver/routes/admin.coffeeapp/assets/javascripts/strut_builder.js.coffeesrc/packages/collaboration/lib/buddy-list.coffeesrc/scripts/index.coffeeapp/assets/javascripts/channels/posts.coffeecontrollers/auth.coffeelib/spell-check-task.coffeelib/dev-live-reload.coffeesrc/action-creator.coffeegruntfile.coffeeclient/lanes/access/Extension.coffeecontainers/Form.jsx.coffeeclient/app/lib/util/proxifyTransportUrl.coffeeserver/server_timeout.coffeesrc/phantomtask.coffeeclient/app/Applications/Chat.kdapplication/Views/mainchatpanel.coffeesource/assets/javascripts/history-api.js.coffeeapp/assets/javascripts/components/activity/recent_activity_handler.cjsxkeymaps/go-to-line.csonapp/assets/javascripts/modules/mobilemenu.coffeelib/util/configuration-form-view.coffeesrc/module-cache.coffeelib/highlight-selected.coffeelib/image-editor.coffeekeymaps/table-edit.csonapp/assets/javascripts/plugins/cookie_adult_validation.js.coffeeclient/controllers/downloadCSVModal.coffeetest/server_spec.coffeespec/javascripts/thumb_selector_spec.coffeesrc/svg-document.coffeesrc/routes/index.coffeeassets/js/script.coffeecomponents/GetRemoteProjects.coffeespec/toobar-spec.coffeeclient/ide/workspace/panes/terminalpane.coffeelib/linter-clang.coffeetest/routes/projects.coffeesrc/extensions/autocomplete/keymap.coffeeclient/app/lib/payment/paymentconstants.coffeesrc/app/api/models/task-completion-csv.coffeemenus/symbols-view.csonapp/assets/javascripts/donations.coffeeresources/assets/coffee/_classes/osu-audio.coffeelib/db.coffeepublic/js/range.coffeeapp/assets/javascripts/darkswarm/services/map.js.coffeemenus/ide-haskell-repl.cson_includes/coffeescripts/contact.coffeeapp/pages/projects.cjsxkapuut/lib/constants.coffeetest/util/data-gen.coffeespec_app/spec/javascripts/helpers/reset_path.js.coffeeapp/assets/javascripts/app/manage/users.js.coffeesrc/parsers/index.coffeeservices/web/public/coffee/base.coffeeservices/web/app/coffee/Features/StaticPages/HomeController.coffeetest/globalConfig.coffeebokehjs/src/coffee/models/transforms/step_interpolator.coffeesrc/tools/addpath.coffeetests/loud_test.coffeetest/configfile.coffeesrc/modal/index.coffeesrc/link-lister.coffeeclient/components/connectionStatus/connectionStatus.coffeeapp/assets/javascripts/temp_controls.coffeeapp/assets/javascripts/crm_chosen.js.coffeelib/tips.coffeeclient/Social/Activity/views/likeview.coffeeui/scripts/views/styleguide.coffeeapp/talk/config.coffeecore/app/assets/javascripts/local_storage_polyfill.coffee.atom/default-config.coffeecore/app/backbone/collections/feed_activities.coffeepackages/rocketchat-lib/server/methods/joinRoom.coffeesrc/app/admin/states/states.coffeesource/scripts/utils/config.coffeetests/server/GoogleTranslateTest.coffeeapp/assets/javascripts/dispatcher.js.coffeelib/views/panel.coffeeapp/assets/javascripts/ships.js.coffeepackages/rocketchat-tutum/startup.coffeesrc/scripts/pages/about/about.coffeecore/app/assets/javascripts/base/account_popup_opener.coffeeapp/config.coffeeapp/assets/javascripts/effective_datatables/scopes.js.coffeeservices/web/public/coffee/ide/clone/controllers/CloneProjectModalController.coffeelib/selection-count-view.coffeefrontend/app/js/browse-ctrl.coffeeworkers/social/lib/social/models/computeproviders/handlers/usernamechanged.coffeeapp/assets/javascripts/routers/movies_router.js.coffeeapp/assets/javascripts/datepicker.js.coffeeapp/assets/main.coffeeclient/TestRunner.coffeeapp/assets/javascripts/routes/categories-route.js.coffeeapp/assets/javascripts/lib/util/flexibility_order.coffeelib/linter-jshint.coffeekeymaps/textmate.csoncoffee/image_list_widget.coffeelib/resin/data/fs-utils/fs-utils.coffeesrc/scripts/heroku-status.coffeesrc/crowdstart.coffeeapp/assets/javascripts/rounds.js.coffeeapp/assets/javascripts/papers.js.coffeeclient/Main/CommonViews/applicationview/applicationtabhandleholder.coffeeangular/core/services/record_loader.coffeesrc/scripts/helpers/backbone/views/editable.coffeeapp/assets/javascripts/darkswarm/directives/darker_background.js.coffeesrc/scripts/redis-brain.coffeelineman/app/components/group_page/subgroups_card/subgroups_card.coffeesrc/presenters/form/index.coffeeclient/controller/about-controller.coffee_resources/manifest.csonsrc/test.coffeeapp/assets/javascripts/wca-autocomplete.js.coffeekeymaps/encoding-selector.csonapp/assets/javascripts/trade/mixins/flash.js.coffeeserver/assets.coffeeframer/MIDIInput.coffeeroutes/params.coffeeWsseDynamicValue.coffeespec/variable-parser-spec.coffeescripts/test-instance/aws.coffeeexamples/rails.coffeetasks/test-task.coffeeapp/javascripts/filters.coffeesrc/quo.style.coffeeapp/assets/javascripts/navigation.coffeesrc/view/bindings/add_class_binding.coffeepackages/rocketchat-importer/client/admin/adminImportProgress.coffeeconfig/config.coffeesrc/streak-podium.coffeeapp/talk/lib/project-linker.cjsxapp/assets/javascripts/protected_branches.js.coffeeservers/lib/server/handlers/validateemail.coffeetutor/src/components/navbar/logout.cjsxapp/assets/javascripts/report.js.coffeeapp/assets/javascripts/replace_self_on_load.js.coffeelib/spec-runner.coffeetest/cabin-spec.coffeelib/api.coffeetasks/jasmine.coffeeatom/keymap.csonapps/auction_lots/routes.coffeesrc/core/math.coffeeBackofficeBundle/Resources/public/coffee/formBehavior/ValidateHidden.coffeeapp/assets/javascripts/lesson_header_onScroll.coffeesrc/businesscat.coffeelib/process-config.coffeepublic/js/utils.coffeecore/app/backbone/collections/followers.coffeeapp/assets/javascripts/common/components/body.js.coffeekirppu/static_src/js/checkout/vendorfindmode.coffeeapps/page/index.coffeeserver/index.coffeesrc/app/common/services/analytics-service.coffeeclient/source/views/fields/edit.coffeegrunt/amd_tamer.coffeeapp/assets/javascripts/angular/controllers/RegistryLoginCtrl.coffeekeymaps/pdf-view.csondesktop/apps/artsy_primer/personalize/client/views/price_range.coffeeserver/packages/user/login.coffeeapp/assets/javascripts/active_admin/base.js.coffeeapp/assets/javascripts/front.js.coffeepackages/rocketchat-message-pin/server/settings.coffeeapp/assets/javascripts/controllers/paper_manage_controller.js.coffeesrc/code/views/wireframes/inspector-panel-view.coffeeapp/assets/javascripts/voluntary_ranking/routes/arguments/index_route.js.coffeemenus/tabs.csonsrc/demo/index.cjsxsrc/renderer/scripts/views/main/layout.coffeeelements/league-controller.coffeeatom/.atom/keymap.csonlib/ui-watcher.coffeetest/blob.test.coffeesrc/scripts/views/site-menu.coffeedashboard_spec.coffeelib/assets/javascripts/bug_file_formatter.js.coffeeapp/stores/subject-store.coffeemodels/user_credential.coffeelibraries/metrics/http.coffeetests/training1st_test.coffeelib/langs/sql-beautify.coffeeclient/source/views/users/edit.coffeeclient/landing/app/MainApp/VirtualizationController.coffeeapp/assets/javascripts/rglossa/react/components/app.jsx.coffeeclient/Workspace/panes/terminalpane.coffeelib/views/cherry-pick-select-branch-view.coffeefindaconf/blueprints/site/coffeescript/init.coffeefrontend/app/scripts/Router.coffeecore/app/backbone/views/tour/tour_users_list_view.coffeecoffee/lib/callback-data-source.coffeedocpad.coffeespec/module-cache-spec.coffeesource/core/attributes.coffeespec/panel-container-spec.coffeeapp/assets/javascripts/videos/destroy.js.coffeeserver/methods/setAvatarFromService.coffeetest/src/trix/text_view_test.coffeemenus/sort-lines.csonsrc/app/Objects/StrictObject.coffeeapp/assets/javascripts/kiitos/messages_dashboard.js.coffeeDaily_Apple/da.coffeesrc/components/learning-guide/chapter-section-type.coffeespec/modules-spec.coffeelib/grammar-utils/operating-system.coffeesrc/utilities/set_drag_image.coffeeapp/assets/javascripts/components/revisions/revision_list.cjsxsrc/app/config/vendor-dependencies/vendor-dependencies.coffeeapp/assets/javascripts/neighborly/projects/new.js.coffeengtuvok/src/app/blog/blog.service.coffeesrc/scripts/models/role-acceptances.coffeeapp/api/client.coffeeapp/assets/javascripts/autosave.js.coffeeSingularityUI/app/models/RequestHistory.coffeelib/base_task.coffeeapp/scripts/components/BsPill.coffeetest/test_daemon.coffeelib/broadcast.coffeemodels/base.coffeeserver/routes/indicators.coffeelib/psc-ide.coffeetasks/clean-task.coffeegulp/dev.coffeesrc/layout.coffeeLearn-server/handleImage.coffeeapp/src/bitcoin/networks.coffeeclient/Workspace/panes/pane.coffeepackages/rocketchat-api/server/api.coffeejquery.transparency.coffeelib/views/general/admin.coffeeapp/shrink.coffeelib/minimap-pigments.coffeeapp/assets/javascripts/backbone/views/home_view.js.coffeeclient/index.coffeeapp/assets/javascripts/initialize_foundation.coffeesrc/Models/ProjectIssues.coffee.atom/snippets.csontest/src/link_grabber_test.coffeetest/command.coffeeapp/assets/javascripts/typeahead.js.coffeescripts/arnie-quotes.coffeelib/commands.coffeelib/autosave.coffeelib/reader.coffeelib/imager.coffeeexports/atom.coffeeclient/ide/AppController.coffeestorage/test/unit-access-service.coffeescripts/routers/router.coffeegrammars/language-ipkg.csonassets/javascripts/views.js.coffeeexamples/todo-vuejs/app/assets/javascripts/channels/todo.coffeeclient/Main/addworkspaceview.coffeemodels/state.coffeemenus/titanium.csonresources/assets/coffee/_classes/form-toggle.coffeeclient/entry.coffeeserver/lib/download.coffeesrc/components/EntryDetails.coffeesrc/scripts/tweet-content.coffeetest/core/customhtmlview.coffeesrc/languages/ux_markup.coffeebokehjs/src/coffee/models/layouts/basebox.coffeecore/app/backbone/modules/discussion_modal_on_frontend.coffeesrc/components/learning-guide/progress-bar.cjsxsrc/main/webapp/coffeescripts-hidden/register.coffeelib/action_handlers/action_series.coffeeapp/assets/asset/pdfViewer.coffeelib/Task/ActivityTask/Download.coffeeservices/real-time/app/coffee/DrainManager.coffeespec/util.coffeeapp/assets/javascripts/sounds2.js.coffeetutorial/test/Logger.test.coffeekeymaps/rails.csonlib/models/diffs/diff.coffeeapp/video_socket_io.coffeescripts/resume.coffeetest/support/test_helpers.coffeetest/src/system/attachment_test.coffeetest/spec/controllers/node_tool.coffeeengines/upload_manuscript/app/assets/javascripts/upload_manuscript/controllers/overlays/upload_manuscript_overlay_controller.js.coffeesrc/smc-webapp/register-editors.coffeeapp/routes/dashboard/repositories.coffeeapp/pages/lab/field-guide/article-list-item.cjsxapp/assets/javascripts/directives/kassa_state_toggle.coffeetemplate/base/app/helpers.coffeesrc/stdlib/child-process.coffeeapp/assets/javascripts/pages.js.coffeeapp/scripts/config.coffeeangular/core/components/profile_page/profile_page_controller.coffeeservices/web/public/coffee/ide/AutoCompileOnboardingController.coffeeassets/game_state.coffeeengines/standard_tasks/app/assets/javascripts/standard_tasks/controllers/funder_controller.js.coffeelib/imgur2rss.coffeeclient/views/voltagePage.coffeekeymaps/symbols-view.csonclient/views/admin.coffeesrc/code/views/proto-node-view.coffeeapp/assets/javascripts/workbench/workbench/views/datastream/chart_view.js.coffeejs/tests/inner-tests.coffeeapps/show/client/index.coffeelib/minimap-find-results-view.coffeetests/helpers/acceptance.coffeemodels/collector_profile.coffeelib/bubble.coffeeassets/javascripts/evaluator/evaluator.coffeeapp/js/jail_iframe/classes/content_box.coffeeapp/assets/javascripts/controllers/submissions.js.coffeesrc/performance-now.coffeesrc/github/pullrequests.coffeesrc/modules/todo/module.coffeeapp/assets/javascripts/darkswarm/controllers/offcanvas_controller.js.coffeeconfig/settings.defaults.coffeeapp/assets/javascripts/interaction_web_tools/app.coffeeapp/assets/javascripts/backbone/views/rooms/show_view.js.coffeeapps/legacy_routes/index.coffeebin/tangle-app-build.coffeewebpack/src/index.coffeeapp/assets/javascripts/controllers/overlays/authors_overlay_controller.js.coffeestatic/tests/test_controllers.coffeeapp/assets/javascripts/darkswarm/directives/page_view.js.coffeeconfig/routes.coffeedist/config.csontest/dummy-project/gulp.coffeesrc/scripts/modules/media/header/header.coffeemodel/Recipe/ListenToYourHeart.coffeeapp/collections/show-list.cjsxapp/cells/select/select.coffeespec/countries/CAN-spec.coffeecomponents/EnsureLocalRuntimes.coffeelib/load-paths-task.coffeeapp/assets/javascripts/sprangular/directives/creditCardForm.coffeeapp/js/jail_iframe/util/create.coffeeapp/assets/javascripts/custom.coffeesrc/vocabulary/disclose.coffeelib/viewers/skim-viewer.coffeecollections/items.coffeemenus/coffee-refactor.csonclient/app/Applications/Chat.kdapplication/Controllers/conversationlistcontroller.coffeesource/server/events.coffeetest/index_spec.coffeesrc/models/InteractiveSubject.coffeeapp/assets/javascripts/dot_ledger/views/reports/income_and_expenses/filter.js.coffeeapp/components/loading-indicator.cjsxsrc/ac-webhooks.coffeemain.coffeeapp/assets/javascripts/spree/backend/solidus_virtual_gift_card.coffeekeymaps/coffee-compile.csontest/models/time_entry.coffeespec/custom-element-spec.coffeeapp/assets/javascripts/spree/frontend/spree_multi_currency.js.coffeeapp/assets/javascripts/routes/admin_route.js.coffeeclient/landing/app/Applications/Chat.kdapplication/Views/mainchatpanel.coffeeclient/Login/AppController.coffeesrc/code/data/migrations/migrations.coffee_coffee/keyboard.coffeesrc/fs_utils/write.coffeeapp/assets/javascripts/resolve/holding_requests.js.coffeeSingularityUI/app/utils.coffeeapp/coffee/modules/projects.coffeeapp/assets/javascripts/backbone/routers/trees_controller.js.coffeelib/snippet-body-parser.coffeeapp/scripts/controllers/main.coffeesrc/trix/models/attachment.coffeesrc/common/finish_game.coffeeapp/assets/javascripts/stores/article_store.coffeeapp/assets/javascripts/ppt.js.coffeeapp/assets/javascripts/map.js.coffeeclient/views/locations/location_edit.coffeescripts/hot-topics.coffeesrc/course/registration.cjsxsrc/components/buttons/browse-the-book.cjsxapp/routes/application.coffeedesktop/apps/artwork/components/inquire_via_phone/index.coffeelib/bindings.coffeeapp/assets/javascripts/backbone/views/messages/index_view.js.coffeeclient/landing/app/MainApp/sidebar/sidebarcontroller.coffeegulp_config/common/webpack.coffeeroutes/api/v2/authentication.coffeesrc/rebuild.coffeeapp/assets/javascripts/followable.js.coffeesrc/ncn.coffeeapp/assets/javascripts/tenon/features/quick_search.js.coffeeapp/assets/javascripts/components/inline_edit_body_part.js.coffeeapp/assets/javascripts/rglossa/controllers/search/result_toolbar_controller.coffeetest/lib/algorhythmic.coffeeservices/web/public/coffee/ide/review-panel/directives/reviewPanelToggle.coffeesrc/vcs/Mercurial.coffeeapp/assets/javascripts/cfp/backbone/views/ranking_view.js.coffeeapp/assets/javascripts/exo/widgets/auto_complete_token_field.js.coffeelib/collections.coffeeapp/assets/javascripts/pgdatagraph/palette.js.coffeesrc/spec/fetchstock.spec.coffeeapp/assets/javascripts/jobs_list/views/jobs_list_view.js.coffeebrowser/api/lib/window.coffeevendor/assets/javascripts/editable/rails/editable_form.js.coffeesrc/coffee/base64.coffeelib/css.coffeemodel.coffeeapp/gem/component.cjsxapp/assets/javascripts/application.coffeeapp/assets/javascripts/neighborly/modules/map.js.coffeetest/javascripts/models/manuscript_manager_template_test.js.coffeeserver/analytics/AnalyticsLogEvent.coffeelib/generators/rails_script/install/templates/base.js.coffeekeymaps/task-list.csonapp/assets/javascripts/backbone/models/tree_fetcher.js.coffeetext-fade-in-demo.js.coffeeplugins/shared_filesystem_storage/app/assets/javascripts/shared_filesystem_storage/components/shares/access_item.coffeesrc/cursors-component.coffeecore/htdocs_source/src/pods/oxifield-select/component.coffeecomponents/related_links/types/artist_representations.coffeesrc/collections/users.coffeecms/static/coffee/src/views/module_edit.coffeeapp/assets/javascripts/components/author_view_component.js.coffeespec/stdlib/task-spec.coffeespec/EditGraph.coffeeapp/assets/javascripts/darkswarm/directives/stripe_elements.js.coffeeapp/assets/javascripts/backend/accounts.js.coffeeapps/partner2/components/hero_artworks_carousel/view.coffeeapp/assets/javascripts/global.coffeerenderer/lib/init.coffeelib/minimap-bookmarks.coffeesaveCompletedTaskset.coffeeapp/assets/javascripts/slack_ready_function.coffeecore/app/backbone/factlink/add_model_to_collection_mixin.coffeelib/observe.coffeelib/file-utils.coffeebokehjs/test/test_mapper/test_categorical_mapper.coffeeclient/room_list/room_list.coffeeconfig.coffeeapps/artist_new/client/cta.coffeesrc/core/modules/html.coffeesrc/view/bindings/event_binding.coffeeapp/assets/javascripts/routes/anime_route.js.coffeecoffee/Resources/init.coffeelib/written/app/assets/javascripts/written/core/cursor.coffeeapp/pages/profile/stats.cjsxtest/lib/pesudo_random.coffeeapps/settings/components/home_path_field/view.coffeeapp/scripts/components/behaviors/shoot_on_sight.coffeeapp/assets/javascripts/ng-services/ng-CookiesSvc.js.coffeeclient/app/MainApp/filetree/itemsubviews/copyurlview.coffeesources/shdr/Models.coffeecore/app/backbone/views/related_channels_view.coffeeapp/assets/javascripts/overlay_dimensions.js.coffeeapp/assets/javascripts/app/collections/movies.js.coffeesrc/javascript/controllers/IndexController.coffeesrc/keypath_observer.coffeeresources/tools/list-templates/heading-controller.coffeesrc/lib/LocationGrid.coffeetest/codenames-test.coffeedesktop/apps/artwork/components/partner_stub/index.coffeesrc/components/html.cjsxworkers/runartifactserver.coffeeclient/app.coffeenode_modules_koding/bongo/lib/expressify.coffeeapp/src/restclients/unspent_outputs_restclient.coffeeapp/assets/javascripts/mixins/paginated_route.coffeeserver/startup/cron.coffeeassets/javascripts/models/entry.coffeeapp/assets/javascripts/domready.coffeesrc/scripts/router.coffeesrc/app/units/states/tasks/inbox/inbox.coffeesrc/postie.coffeelib/table-component.coffeeclient/Social/Activity/sidebar/sidebarmachinebox.coffeelib/config/provider.coffeegrunt/jasmine_nodejs.coffeeapp/assets/javascripts/admin/index_utils/controllers/columns_controller.js.coffeeservices/web/app/coffee/Features/Wiki/WikiController.coffeeapp/assets/javascripts/services/cache_service.coffeeweb/service/upload.coffeeasync.coffeeexamples/web_server.coffeeexamples/collection.coffeeservices/web/app/coffee/Features/Analytics/AnalyticsManager.coffeeextension/login/authentication.coffeeapp/server/index.coffeedemo/app/application.coffeelib/wrap-guide-view.coffeesrc/intermediate/IntermediateModel.coffeecoffee/furatto-demo.coffeepackages/emberella/lib/mixins/focusable_mixin.coffeeapp/assets/javascripts/rails_admin/custom/ui.coffeetest/e2e/support/world.coffeeprototypes/load_maps/coffeescripts/main.coffeelib/autocomplete/syntax.coffeelib/assets/javascript/init.js.coffeecore/app/backbone/views/react_install_extension_button.coffeedot-atom/init.coffeelib/changes/changes.coffeeapp/assets/javascripts/views/map_view.js.coffeeclient/lanes/components/record-finder/RecordFinder.cjsxscripts/turtleme.coffeecode/some_pleasant.coffeeapp/models/task.coffeeapp/assets/javascripts/voluntary_music_metadata_enrichment/library/index.js.coffeeannotran/static/scripts/annotator/plugin/sentenceselection.coffeejavascript/outer.coffeeapp/assets/javascripts/views/node-popup.view.js.coffeesrc/io/web-keyhandling.coffeesrc/generation/items.coffeesnippets/objects.csonsrc/stats.coffeeapp/assets/javascripts/foundation_extras.js.coffeeclient/src/views/section_navigation_view.coffeespec/editor-linter-spec.coffeesrc/app/pages/tasks/tsTaskEdit.directive.spec.coffeeapp/talk/comment-help.cjsxapp/assets/javascripts/views/textarea.js.coffeeclient/ide/lib/views/collaboration/limitedvideocollaborationmodal.coffeetest/helper.coffeesrc/coffee/quality.coffeejs/main.coffeelib/search-results-view.coffeesrc/views/feature-tour-start.coffeepackages/rocketchat-ui/lib/cordova/urls.coffeesrc/util.coffeeresources/assets/coffee/react/contest-voting.coffeelib/diff-list-view.coffeelib/tempfile-repo-lib.coffeelib/toggle-quotes.coffeeclass/BaseController.coffeesrc/scripts/helpers/handlers/analytics.coffeeclient/skr/components/CustomerProjectFinder.cjsxapp/scripts/services.coffeeclient/lanes/components/grid/Selections.cjsxatom/dot-atom/projects.glasbren-oryxpro.csonapp/assets/javascripts/google-analytics.js.coffeeclient/html.coffeesrc/utils/register-foreign.coffeelib/helpers.coffeelib/update-package-dependencies.coffeeapp/assets/javascripts/rglossa/react/components/centre/search_inputs/cwb_simple_input.jsx.coffeeapp/assets/javascripts/photographs.js.coffeetest/features/support/setup.coffeeclient/app/lib/activity/sidebar/sidebarsharedmachineslist.coffeeapp/assets/javascripts/rglossa/data/store.coffeespec/title-bar-spec.coffeeapp/imports/models.coffeegulp/development/index.coffeelib/js/integrations/slack_integration.coffeecoffee/main.coffeesrc/coffee/routes.coffeeresources/assets/coffee/sticky-header.coffeeapp/assets/javascripts/jiffy_enums.js.coffeeclient/src/scripts/model-selection-view.coffeesrc/scripts/workbench/controllers/sensors_controller.js.coffeebackend/app/assets/javascripts/spree/backend/number_field_updater.coffeeapp/client/js/react/layout.coffeesrc/scripts/modules/search/results/filter/filter.coffeeapp/assets/javascripts/admin/catalogs.coffeedot-inbox/config.csonplugins/dotstorm/test/thumbail.spec.coffeegrunt/config/jade.coffeegeneric/Gruntfile.coffeemain/static/src/script/common/util.coffeeshared/db/schemas/message.coffeeatom/projects.courage.csonclient/lanes/components/shared/Input.cjsxmodel/Checkmark.coffeelib/variable-marker.coffeelib/message-manager.coffeesrc/coffee/categories.coffeespec/notational-velocity-spec.coffeetest/unit/accept.coffeesrc/components/HTTP/Server.coffeeapp/assets/javascripts/food_trucks.coffeeapp/client/js/storage.coffeeapp/assets/javascripts/wymeditor.js.coffeecoffee/calculator.coffeesrc/trix/elements/trix_toolbar_element.coffeesrc/app/repository-status-handler.coffeelib/tasks/scan-buffer-colors-handler.coffeeclient/admin/lib/views/members/teammemberscommonview.coffeesrc/scope-selector.coffeesrc/core/components/confirm-dialog.coffeeusers.coffeeapp/assets/javascripts/kuva/kuva.js.coffeelib/view/error-view.coffeeatom.csonroutes/teamdata.coffeesrc/server.coffeetasks/lib/github.coffeesrc/slide-pack-navigation.coffeehome/atom/snippets.csonti/src/ui/views/base.coffeeresources/assets/coffee/react/contest/voting/vote-summary.coffeeapp/assets/javascripts/views/toolbar.js.coffeelineman/app/components/discussion_form/discussion_form.coffeeapp/assets/javascripts/app/join_requests/invite.js.coffeesrc/coffee/engine.coffeegrammars/pweave_md.csonsrc/components/ScrapeHtml.coffeerenderer/api/lib/ipc.coffeelib/whitespace.coffeesrc/app/atom-package.coffeebots/libs/HexBot.coffeetest/codio_spec.coffeeserver/lib/session_authentication.coffeeclient/components/FindMistakeList.coffeerouter.coffeeapp/assets/javascripts/register.js.coffeesrc/pasteboard.coffeeapp/assets/javascripts/routes/sessions.coffeemain/version-check/leap.version-check.coffeeclient/clonewars.coffeeapp/assets/javascripts/bootstrap.js.coffeebuild/tasks/install-task.coffeemenus/bracket-matcher.csonsrc/main/coffeescript/tests/integration/showActivity.coffeesrc/scripts/collections/subjects.coffeeapp/app.coffeeapp/assets/javascripts/legend.js.coffeespec/emitter-spec.coffeesrc/atom/layout.coffeelib/minimap-bookmarks-binding.coffeelib/tag-reader.coffeesrc/scripts/modules/media/nav/nav.coffeeapp/assets/javascripts/views/event/artists_view.js.coffeelib/helpers/bean_builder.coffeeserver/security.coffeeclient/Main/providers/vendorview.coffeeclient/controller/vote-controller.coffeeapp/views/SalesView.coffee.config/init.coffeeapp/assets/javascripts/helpers.js.coffeeassets/javascripts/views/pages/base.coffeelib/twitter.coffeeassets/scripts/app/controllers/profile.coffeecommon/api/lib/callbacks-registry.coffeesrc/config/initializers/tasks/package.coffeeapp/collections/get-favorites-name.cjsxserver/router.coffeewidgets/list/list.coffeeserver/lib/presenters/indicator.coffeemanager.coffeesrc/i18n.coffeesrc/browser/atom-protocol-handler.coffeelib/action.coffeeassets/js/share.coffeeapp/assets/javascripts/votes.js.coffeecontrollers/app.coffeeapp/models/fan_mark.coffeecore/app/backbone/views/subchannel_item_view.coffeespec/helpers-spec.coffeeapp/assets/javascripts/components/users/base.js.coffeecoffeescripts/app.coffeecms/static/coffee/spec/main_spec.coffeesrc/publisher.coffeeapp/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffeesrc/scripts/result.coffeeapp/assets/javascripts/labels.js.coffeespec/javascripts/foobar_spec.js.coffeeapp/assets/javascripts/posts.js.coffeespec/checkout-spec.coffeelib/collector.coffeesrc/base58.coffeesrc/models/Screen.coffeelib/script-view.coffeestatic/js/feed.coffeelib/tag-generator.coffeekeymaps/spell-check.csonwebpack/autoload.coffeetests/setup.coffeepackages/rocketchat-cors/cors.coffeebuild/tasks/shell.coffeeclient/lib/cordova/user-state.coffeemenus/tree-view.csonsrc/docs.coffeesrc/stdlib/task-shell.coffeelib/calculator.coffeeserver/config.coffeesrc/components/published-modal.cjsxgrammars/runoff.csonkeymaps/code-links.csonapp/scripts/components/Enemy.coffeetests/session/user.factory.spec.coffeesrc/key-handling.coffeelib/projects.coffeesrc/cleaner.coffeesrc/app/projects/states/dashboard/directives/task-dashboard/directives/task-assessment-card/task-assessment-card.coffeelib/provider.coffeelib/services/TrafficSituation.coffeeapp/classifier/mini-course-button.cjsxsrc/aliasify.coffeeapp/assets/javascripts/app/tabs.js.coffeelib/analytics_hooks.coffeelib/component.coffeeapp/client/js/validationerror.coffeeapps/apply/client/models/form.coffeeclient/app/lib/kite/klienteventmanager.coffeeapp/javascripts/imageSequence.coffeesrc/cli/zog.coffeeclient/admin/lib/views/invitations/acceptedinvitationsview.coffeesrc/components/learning-guide.cjsxsrc/browser/squirrel-update.coffeeapp/assets/javascripts/darkswarm/directives/map_search.js.coffeekeymaps/emmet.csonstatic-mock.coffeesettings/rust.csonsrc/address.coffeeapp/scripts/components/entities/PlayerClone.coffeespec/spec-suite.coffeelib/command.coffeeLearn-terminal/index.coffeesrc/filters.coffeecomponents/progress_bar/index.cjsxlib/buffer_update_component.coffeeclient/landing/app/Applications/Chat.kdapplication/Views/conversationlistitemtitle.coffeeapp/assets/javascripts/shortcuts_issueable.coffeeapp/assets/javascripts/lib/models/scenario.coffeesrc/coffee/edsl.coffeeapp/classifier/tutorial-button.cjsxsrc/app/projects/project-portfolio-wizard/portfolio-review-step/portfolio-review-step.coffeeapp/assets/javascripts/calls.coffeecli-rs-dev.coffeetest/suite.coffeeapp/clients.coffeetest/specs.coffeecore/app/backbone/views/channel_view.coffeelib/web/scripts/App.coffeesrc/audio/sound.directional.coffeeservices/web/public/coffee/ide/test-controls/controllers/TestControlsController.coffeeserver/packages/repl/index.coffeesrc/coffee/cilantro/main.coffeesrc/rcedit.coffeelib/baconjs/from-resize.coffeesrc/spec_setup.coffeespec/util-spec.coffeeapp/assets/javascripts/workbench/workbench/views/datastream/latest_view.js.coffeeapp/assets/javascripts/controllers/admin_journal_user_controller.js.coffeeservices/web/public/coffee/ide/history/controllers/HistoryV2DiffController.coffeelib/table-edit.coffeecoffee/cilantro/models/base.coffeecomponents/LoggingMiddleware.coffeeapp/assets/javascripts/tandem/pages.js.coffeeapp/assets/javascripts/kss.coffeeapp/assets/javascripts/image_upload.coffeeassets/javascripts/models.js.coffeesrc/components/scores/concept-coach-cell.cjsxsrc/model/validations/email_validator.coffeetest/core/eventemitterwildcard.coffeeplugins/slack/index.coffeesource/molecule/navigation.coffeespec/dummy/app/assets/javascripts/dummy/dummy.js.coffeespec/conf/protractor.spec.conf.coffeelib/assets/javascripts/views/004_mentions_auto_complete_textarea.js.coffeeapp/assets/javascripts/views/react/graph/graphQuestionList.js.jsx.coffeesrc/main/webapp/coffeescripts-hidden/weekly-performance-graph.coffeeapp/assets/javascripts/components/permission_cell_component.js.coffeetasks/index.coffeelib/wav-editor-view.coffeelib/scripts/mercure.coffeesrc/content.coffeeserver/controllers/deploy.coffeeannotran/static/scripts/annotator/guest.coffeeapp/assets/javascripts/lib/mobile/select_group_manager_mobile.js.coffeevendor/assets/javascripts/partystreusel/translations.js.coffeeclient/admin/lib/views/stacks/editors/stacktemplateeditorview.coffeetest-integration/helpers/course-select.coffeecilantro/static/cilantro/scripts/coffeescript/models/datacontexts.coffeeserver/methods/registerUser.coffeeapp/assets/javascripts/auth.coffeeapp/assets/javascripts/controllers/flash-messages.controller.js.coffeesrc/draw_grid.coffeeapp/assets/javascripts/rglossa/react/components/centre/main_area_bottom.jsx.coffeecore/app/backbone/factlink/collection.coffeeservices/web/public/coffee/ide/FeatureOnboardingController.coffeeapp/assets/javascripts/orders.coffeeapp/scripts/local-setup.coffeesrc/app/units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.coffeeapp/assets/javascripts/backbone/views/add_to_home_screen_view.coffeesrc/tb/lib/backbone-extensions/index.coffeespec/singleton-window-spec.coffeesrc/domain_event_service.coffeespec/fixtures/package-with-deprecated-selectors/menus/old-menu.csoncomponents/commercial_filter/filters/location/location_map.coffeeapp/assets/javascripts/spree_outlet/helpers/date_helper.js.coffeeapp/assets/javascripts/workbench/workbench/routers/workbench_router.js.coffeepackages/rocketchat-lib/server/startup/settingsOnLoadSMTP.coffeesrc/app/teaching-periods/states/edit/directives/teaching-period-units/teaching-period-units.coffeeapp/assets/javascripts/species/views/elibrary_search_form/elibrary_search_form_view.js.coffeelib/open-last-project.coffeeapp/assets/javascripts/georgia/routers/edit_page_panel.js.coffeeapp/assets/javascripts/controllers/paper_controllers.js.coffeeapps/user/queries/profile.coffeeatom/common/lib/asar_init.coffeeapp/assets/javascripts/controllers/TodoListController.js.coffeereview_front/app/routes/application.coffeescoped-properties/language-haskell.csonweb/js/views/search_view.coffeeapp/assets/javascripts/sprangular/controllers/checkout.coffeeapp/assets/javascripts/replace_self_on_ajax_success.js.coffeesrc/packages/markdown-preview/lib/markdown-preview-view.coffeecore/app/assets/javascripts/lib/prevent_scroll_propagation.coffeesrc/task/review.cjsxapp/assets/javascripts/components/search/results.js.jsx.coffeetapestry-core/src/test/coffeescript/META-INF/modules/palette-demo.coffeeapp/assets/javascripts/layout_nav.js.coffeesrc/components/tags/cnx-mod.cjsxsrc/app/projects/projects.coffeeapp/frontend/javascripts/visualization-story.js.coffeecore/app/backbone/views/users/auto_complete_search_users_view.coffeeapp/assets/javascripts/uploadcare/widget/tabs/file-tab.js.coffeeapp/assets/javascripts/static.js.coffeeapp/assets/javascripts/mixins/controllers/participants.js.coffeespec/javascripts/analytics/virtual_pageview_spec.coffeeapp/scripts/lib/handlebars-helpers.coffeeapp/routes.coffeecore/app/backbone/views/sub_comments/react_sub_comment.coffeebokehjs/src/coffee/action/open_url.coffeelib/command-palette-view.coffeeapp/assets/javascripts/mixins/controllers/saves_delayed.js.coffeelib/archive-edit-session.coffeesrc/parse.coffeesrc/ext/components/predict-output.coffeesrc/coffee/cilantro/ui/query/item.coffeesrc/jquery.turbolinks.coffeeapp/assets/javascripts/active_admin/application.js.coffeeworkers/social/lib/social/models/user/emailsanitize.coffeesrc/validate-ssh.coffeelib/notational-velocity.coffeesrc/lunch.coffeeassets/javascripts/routes/index_route.js.coffeeapp/assets/javascripts/settings.js.coffeeapp/assets/javascripts/cmtool/application.js.coffeelib/beantest.coffeesrc/packages/spell-check/lib/spell-check-handler.coffeetest/error-pattern-type.coffeeresources/assets/coffee/_classes/landing-hero.coffeesrc/desktop/models/page.coffeesrc/beautifiers/crystal.coffeekeymaps/git.csonlib/validate.coffeeGitIssueView.coffeesrc/app.coffeecore/app/backbone/mixins/update_on_sign_in_or_out_mixin.coffeelib/about.coffeecomponents/RotateElement.coffeejobs/index.coffee.config/atom/config.csonkirppu/static_src/js/overseer/receipt_list_mode.coffeeclient/views/patients/instancesOfProcurement.coffeeapp/assets/javascripts/videos/infinitescroll.js.coffeeapp/assets/javascripts/rich_editable_element.js.coffeetest/unit/transactions/TransactionManager.spec.coffeekarma.conf.coffeesrc/loophole.coffeecomponents/inquiry_questionnaire/views/basic_info.coffeesrc/definitions/skills.coffeeapp/assets/javascripts/catalog-admin/summernote_init.coffeeassets/javascripts/views/post/post_reply_form.js.coffeedesktop/components/auction_reminders/blacklist.coffeecore/app/backbone/views/extended_fact_title_view.coffeesettings/language-roff.csoncore/app/backbone/factlink/collection_utils.coffeeservices/web/public/coffee/ide/labels/LabelsMaster.coffeesrc/packages/fuzzy-finder/lib/fuzzy-finder.coffeebokehjs/test/models/transforms/jitter_transform.coffeeserver.coffeeinternal_packages/thread-list/lib/draft-buttons.cjsxclient/src/scripts/geyser.global.coffeeclient/skr/models/Location.coffeelib/motions.coffeeapp/assets/javascripts/views/paper_index_view.js.coffeeapp/assets/javascripts/advanced_search.js.coffeeclient/src/views/report_edit_visualisation_view.coffeecore/app/backbone/views/interactors_view.coffeevendor/assets/javascripts/progressive_render.js.coffeeapp/assets/javascripts/butler.js.coffeeapp/client/js/facebook.coffee.atom/config.csoncomponents/connect_v2/components/create/view.coffeelib/grammar-status-view.coffeeapp/assets/javascripts/routes/popup.route.js.coffeeapp/main.cjsxprojects.csonsrc/Game.coffeeserver/models/contact.coffeeassets/javascripts/views/permissions_fields_toggle.js.coffeeapp/assets/javascripts/uploadcare/widget/live.js.coffeeservices/web/public/coffee/directives/mathjax.coffeeapp/assets/javascripts/protected_area_map.js.coffeeproxy.coffeeSingularityUI/config.coffeejs/libs/browser.coffeeservices/web/public/coffee/ide/labels/LabelsManager.coffeetest/helpers/index.coffeenewsroom.coffeeapp/assets/javascripts/application/widget_edit.coffeeapp/assets/javascripts/app/lib/app_init/log.js.coffeekeymaps/bracket-matcher.csonapp/js/jail_iframe/initializers/scrollbarSuppressor.coffeeapp/scripts/services/shareddata.coffeebackend/app/assets/javascripts/admin/progress.coffeeapp/assets/javascripts/emoji.js.coffeesrc/packages/fuzzy-finder/lib/load-paths-task.coffeeapp/assets/javascripts/components/FeedList.coffeestatic/src/scripts/app/views/IndexStatsView.coffeesrc/packages/wrap-guide/lib/wrap-guide-view.coffeeapp/assets/javascripts/models/admin_journal.js.coffeesrc/packages/editor-stats/lib/editor-stats.coffeecomponents/logged_in_navigation/components/notifications/view.coffeemenus/encoding-selector.csonlib/written/app/assets/javascripts/written.coffeesrc/atom/command-interpreter/select-all-matches.coffeeapp/assets/javascripts/controllers/application_controller.js.coffeecosmo.coffeeconfig/config.coffee-dist.coffeecomponents/SetLayerProperties.coffeelineman/app/services/key_event_service.coffeecore/app/backbone/controllers/client_controller.coffeemenus/decoration-example.csonlib/views/status-view.coffeeapp/scripts/models/link.coffeeapp/controllers/actions.coffeesrc/webpackConfigBase.coffeesrc/trans-eventsource.coffeeengine/node_fetch_file.coffeeapp/assets/javascripts/pods/pods_store.js.coffeespecs/unit/type_factory/factory/js_type_spec.coffeeservices/web/app/coffee/models/ProjectInvite.coffeecoach/src/task/errors.cjsxweb/site/src/javascript/scatter/ScatterDrawer.coffeesource/assets/javascripts/application.coffeecore/app/backbone/factlink/cross_fade_region.coffeesrc/scripts/modules/media/tabs/content/node.coffeesrc/bgg.coffeeapp/scripts/lib/LocationGrid.coffeeapp/assets/javascripts/custom-bootstrap.js.coffeelib/minimap-selection.coffeeapp/assets/javascripts/date_time_input.js.coffeesource/js/main.coffeesrc/plugins/markdown.coffeesrc/scripts/helpers/backbone/views/base.coffeetest/api/loader.spec.coffeecore/app/backbone/views/channels/add_channel_to_channels_button_view.coffeejs-library/app/js/jail_iframe/util/create.coffeeservices/web/app/coffee/Features/Notifications/NotificationsBuilder.coffeeapp/js/jail_iframe/classes/proxy_message.coffeeapp/frontend/javascripts/visualization.js.coffeeapp/assets/javascripts/controllers/map.js.coffeeapp/assets/javascripts/rglossa/views/current_paginator_page_view.coffeeapp/assets/javascripts/chapter-carousel.coffeelib/styleguide.coffeehighlights/highlight-filename-from-stdin.coffeeclient/code/view/view/tile.coffeetests/batman/testing/model_test_case_test.coffeesrc/components/task-step/step-mixin.cjsxassets/scripts/mandrill_merge.coffeebin/www.coffeeclient/app/books/book.coffeekeymaps/command-palette.csonspec/javascripts/jquery.paginator_spec.coffeeapp/assets/javascripts/rahani/helpers/pagination.js.coffeelib/extension-helper.coffeeapp/assets/javascripts/project_show.js.coffeecoffeescript/greeter.coffeelib/index.coffeecoffee/cilantro/ui/base.coffeeapp/assets/javascripts/views/search-tab.coffeemodels/report/remodel-item.coffeesnippets.csonsrc/cli.coffeeapp/controllers/guide_page.coffeeservices/clsi/config/settings.defaults.coffeeBHCDatabase/app/assets/javascripts/users.coffeescripts/newuserparty.coffeeapp/assets/javascripts/calendar.js.coffeeapp/assets/javascripts/darkswarm/services/authentication_service.js.coffeedesign.coffeeadmin/server/validate.coffeeassets/scripts/app/models/extensions.coffeecore/app/backbone/modules/facebook_renewal.coffeeclient/admin/lib/views/members/adminmembersview.coffeeapp/assets/javascripts/shoppe/products.coffeecoffee/serrano/field.coffeetest/sphere.test.coffeesrc/helper/paramHandler/paramHandler.coffeesrc/SumoCoders/FrameworkCoreBundle/Resources/assets/coffee/framework.flash.coffeeserver/lib/cordova.coffeesrc/overlay-manager.coffeeapp/assets/javascripts/jasminerice.js.coffeetest/log.coffeelib/modal/modal-form.coffeebokehjs/src/coffee/config.coffeesrc/packages/tree-view/lib/file-view.coffeelms/static/coffee/spec/requirejs_spec.coffeesrc/coffee/cilantro/ui/concept/panel.coffeesrc/packages/collaboration/lib/prompt.coffeecomponents/RunTests.coffeespec/config/status-icon-position-spec.coffeelib/utils/editor.coffeesrc/scripts/workbench/strings.js.coffeesnippets/language-apl.csonmenus/tree-view-finder.csonapp/assets/javascripts/contracts.js.coffeetest/battle_queue.coffeeapps/artwork_2/components/auction/query.coffeesrc/pulsar-api-rest.coffeeapp/views/polls/answer.js.coffeesrc/coffee/refining.coffeesrc/components/student-dashboard/index.cjsxconfig/errors.coffeesrc/trix/observers/selection_observer.coffeeserver/publications.coffeeapp/assets/javascripts/sprangular/static_content/services/page.coffeespec/line-jumper-spec.coffeecoffee/controllers/posts_controller.coffeesrc/scene/sceneView.coffeeapp/assets/javascripts/editor.js.coffeeapp/assets/javascripts/divisions.js.coffeeapp/assets/javascripts/stanza_search.js.coffeeapp/assets/javascripts/data-tables-init.coffeeapp/assets/javascripts/activities.js.coffeesrc/ButtonLink.cjsxlib/execute-as-ruby.coffeeapp/assets/javascripts/pages/worktimes.coffeesrc/coffee/cilantro/ui/workflows/query.coffeesrc/coffee/controllers/history-step.coffeesrc/beautifiers/typescript-formatter.coffeesrc/reporter.coffeelib/date_support.coffeesrc/coffee/storylet.coffeesrc/resources-packaged/ops/javascript/orbeon/xforms/server/AjaxServer/nextAjaxResponse.coffeetest/mailers/mailerTest.coffeesrc/flux/course-listing.coffeelib/providers/coffee-provider.coffeemenus/git-plus.csonbokehjs/gulp/tasks/default.coffeelib/selection-handle-component.coffeelib/operators/indent-operators.coffeeclient/components/Material.coffeeassets/scripts/app/routes/main.coffeescripts/views/workspace/sidebar/toc.coffeeapp/scripts/client/webgl/renderer.coffeeapp/assets/javascripts/pagination.coffeecoffee/application.coffeeapp/assets/javascripts/profiles.js.coffeeapp/assets/javascripts/problems.js.coffeeapps/inquiry/index.coffeesrc/totem/client/totem-simple-auth/app/routes/index.coffeesrc/app/atom-theme.coffeeclient/ide/workspace/panes/editorpane.coffeeapp/assets/javascripts/player/data_unpacker.js.coffeesrc/coffee/cilantro/models/exporter.coffeelib/data_converter.coffeesrc/reactGUI/StrokeWidthPicker.coffeelib/get.coffeeapp/assets/javascripts/commits.js.coffeeassets/javascripts/application.js.coffeeclient/app/lib/activity/sidebar/sidebarownmachineslist.coffeespec/ref-counted-token-list-spec.coffeesource/changers/MoveExecution.js.coffeelib/minimap-highlight-selected-view.coffeeapp/assets/javascripts/lib/router.coffeespec/grammars-spec.coffeesrc/trix/views/image_attachment_view.coffeeapp/assets/javascripts/controllers/toolbar.js.coffeelib/langs/perl-beautify.coffeelib/package-keymap-view.coffeelib/FreshdeskBinding.coffeesrc/scripts/models/search-results.coffeeapp/assets/javascripts/custom.js.coffeekeymaps/autocomplete.csonapp/assets/javascripts/tags.js.coffeesrc/css.coffeesrc/cute-me.coffeescripts/crashlytics-notifications.coffeelib/mixins/decoration-management.coffeeapp/scripts/viewmodels/drawings/node_canvas_element.coffeeapp/assets/javascripts/date_picker.coffeemodels/game_point.coffeeapp/assets/javascripts/multi_shipping_address/same_as_billing/copy_bill_to_ship.js.coffeespec/buffer-modifying-provider-spec.coffeesrc/flux/errors.coffeelib/rubocop-auto-correct.coffeespec/markdown-preview-view-spec.coffeespec/StateToColor.coffeeapp/assets/javascripts/sharing_tags/share/base.js.coffeelib/views/pull-branch-list-view.coffeeSingularityUI/app/initialize.coffeesrc/angularD3/services/d3service.coffeeclient/src/common/config/routes.coffeetest/integration/free_trial.coffeelib/linter/coffeelint.coffeesrc/swag.numbers.coffeejs-library/app/js/views/prepare.coffeeapp/js/modules/tabs/Tabs.coffeeapp/assets/javascripts/partystreusel/readmore.js.coffeeMeteorNoops.coffeesrc/in-state-menu.coffeeapp/assets/javascripts/e_tahi.js.coffeelib/go-back-view.coffeesrc/coffee/locale.coffeebuild/tasks/check-licenses-task.coffeeapp/models/blogy/post.coffeeapp/routes/twilio.coffeeapp/assets/javascripts/items.js.coffeebase/makeMetaTags.coffeeapp/scripts/store.coffeesrc/Router.coffeeapp/assets/javascripts/editable.js.coffeepackages/rocketchat-lib/server/models/_Base.coffeepackages/rocketchat-internal-hubot/settings.coffeesrc/qr-generator.coffeeatom/config/keymap.csoncore/app/backbone/models/opinionaters_evidence.coffeeapp/assets/javascripts/router.js.coffeeapp/assets/javascripts/events.js.coffeeapp/assets/javascripts/glimpse.coffeesrc/null-grammar.coffeeapp/assets/javascripts/admin.js.coffeeapp/assets/javascripts/models/page/access_page.js.coffeepackages/rocketchat-ui-sidenav/side-nav/listPrivateGroupsFlex.coffeetutor/src/helpers/notifications.coffeesrc/public/app._.coffeetest/spec/controllers/contact.coffeesrc/scripts/models/content/node.coffeespec/client_spec.coffeespec/keytar-spec.coffeelib/assets/javascripts/channel.js.coffeecomponents/logged_out_cta/index.coffeelib/plugins/completer.coffeesrc/ext/components/rdds-output.coffeeapp/assets/javascripts/problems.coffeeapp/scripts/lazerscripts/stage2/train_assaulter.coffeeapp/assets/javascripts/neighborly/neighborly.js.coffeesrc/coffee/cilantro/ui/field/controls/number.coffeecore/app/backbone/views/react_feed_selection.coffeeapp/coffee/DockerRunner.coffeeapp/models/subject.coffeeapp/assets/javascripts/neighborly/balanced/creditcard/payment.js.coffeecore/spec/javascripts/factlink/format_as_short_number_spec.coffeeapp/scripts/components/BsBtnGroup.coffeesrc/models/torrents.coffeeangular/core/components/previous_polls_page/previous_polls_page.coffeespec/Initialization.coffeeapp/assets/javascripts/home.js.coffeecontrollers/site.coffeelib/project/search-result-view.coffee.atom/keymap.csonapp/assets/javascripts/browserlog/logs.js.coffeelib/resin/ui/patterns/patterns.coffeetest/wordnet_test.coffeeIDE/atom/init.coffeescripts/movie-quotes.coffeedemos/visualizer-lazy/visualizer.coffeelib/assets/javascripts/jasmine_helpers/ajax_spec_helpers.js.coffeesrc/state.coffeecore/app/backbone/models/topic.coffeecoffee/presentation.coffeeassets/scripts/init.coffeeapp/components/collection-search.cjsxapp/assets/javascripts/mapping.coffeeclient/ide/views/statusbar/statusbarmenu.coffeebuild/tasks/install-unpublished-packages.coffeesrc/components/MQ/SendMessage.coffeesrc/wrap-guide.coffeelib/indentation-indicator-view.coffeesrc/components/performance/cell-status-mixin.cjsxapp/assets/javascripts/global.js.coffeedevice-manager-socket-client.coffeewebpack/cmdize.coffeelib/pod-file-pane.coffeeclient/render-record.coffeelib/sensu-dashboard/assets/javascripts/views/events/list.coffeeapp/assets/javascripts/active_admin/select2/select2.js.coffeesnippets/promises.csonsrc/coffee/save.coffeelib/device.coffeescripts/educast.coffeesrc/lib/index.coffeeapp/assets/javascripts/sprangular/static_content/routes.coffeeapp/assets/javascripts/ajax_hijacker.js.coffeeapp/assets/javascripts/ui.js.coffeeviews/roads.coffeeserver/prepaids/Prepaid.coffeesrc/server/routes/post/login.coffeesrc/string_inquirer.coffeeclient/activity/lib/components/publicchatpane/index.coffeeapp/src/fup/utils.coffeesrc/pow/server.coffeelib/save-dialog.coffeesrc/ogp_parser.coffeeclient/ide/lib/views/chat/idechatparticipantheads.coffeescripts/controllers/routing.coffeeclient/skr/screens/fresh-books-import/FreshBooksImport.cjsxlib/image-editor-status-view.coffeeapp.coffeeapp/meetup.coffeescripts/captain-quail.coffeesrc/hello-world.coffeeapps/atom/atom.symlink/init.coffeeplugins/bugherd/index.coffeecontrollers/stock-controller.coffeesrc/scripts/modules/media/footer/metadata/metadata.coffeesrc/code/data/migrations/23_add_simulation_type.coffeesrc/core/utils.coffeesrc/app/server.coffeetasks/update-atom-shell-task.coffeeapp/components/markdown-editor.cjsxsrc/PreferPoetMode.coffeesrc/view/bindings/radio_binding.coffeespec/minimap-view-spec.coffeesrc/coffee/run.coffeetest/spec/lib/command-store.coffeelib/break.coffeekeymaps/hydrogen.csonapp/assets/javascripts/flyover_comments/comments.coffeeclient/rider/eta/displayETA.coffeekeymaps/markdown-preview.csonpackages/landsofillusions/memory/actions/move.coffeeconfig/webpack/base-config.coffeelib/init.coffeeclient/lib/cordova/keyboard-fix.coffeelib/go-to-view.coffeeapp/assets/javascripts/modules/timelet/views/composites/timelets.js.coffeemodules/atom/config/keymap.csontapestry-core/src/main/coffeescript/META-INF/modules/t5/core/init.coffeeserver/initializers/config.coffeelib/linter-govet.coffeelib/bottom-views.coffeetest/conf/protractor-conf.coffeesrc/judge/install-package.coffeesrc/code/utils/link-colors.coffeelib/citeproc.coffeeserver/migrations/migrate.coffeeserver/database.coffeeframer/Compat.coffeeatom/.atom/config.csonsrc/atom/keybindings/emacs.coffeeapp/scripts/app.coffeeapp/views/repos-list.coffeeworkers/social/lib/social/models/computeproviders/machine.coffeeapp/assets/javascripts/home.coffeeclient/views/widget/latest.coffeesrc/stopwords.coffeeapp/talk/comment-report-form.cjsxsrc/js/router.coffeesrc/jira/user.coffeeapp/assets/javascripts/claim_route.coffeetest/integration/new_view.coffeeguts/getControllers.coffeecomponents/auth_modal/maps.coffeesrc/Document.coffeesrc/storage.coffeelib/analysis_api/edit_api.coffeedotfiles/.atom/config.csonspec/models/git-show-spec.coffeecollections/search_blocks.coffeelib/latexer.coffeegrammars/manref.csonassets/index.coffeelib/autocomplete/provider.coffeegulp/helper/child_process.coffeeassets/javascripts/helpers/url.js.coffeesrc/coffee/fetchstocks.coffeetests/mocha/rock/person/_.coffeesrc/file-view.coffeetest/app.spec.coffeelib/base-theme-watcher.coffeetutor/src/components/icon.cjsxweb/lib/coffeescripts/layout.coffeedot-atom/keymap.csonsrc/runas.coffeesrc/components/Template.coffeebackend/app/assets/javascripts/spree/backend/taxonomy.js.coffeeassets/script/StrokeMesh.coffeelayouts/Body.coffeelib/latex.coffeeatom/snippets.csonplugins/xmatters/index.coffeeclient/skr/Extension.coffeelib/ascii-art.coffeeWeb/gruntfile.coffeemobile/apps/auth/index.coffeesrc/base/convert.coffeeapp/coffee/app.coffeesrc/scripts/actions/user-actions.coffeespec/helper-spec.coffeelib/latexmk.coffeesrc/rpgdice.coffeemodels/artwork_inquiry.coffeeclient/skr/components/Currency.cjsxtest/items.coffeesrc/turbolinks/snapshot.coffeesrc/extensions/command-interpreter/regex-address.coffeegulp/development/vendor.coffeesrc/pane-container-model.coffeeclient/lanes/react/mixins/Access.coffeesrc/settings.coffeeviews/2574.coffeelib/dev-mode-view.coffeeserver/models/Checkin.coffeeapp/client/js/react/link.coffeesrc/prompt.coffeecoffee/cilantro/ui/field/controls/number.coffeelib/exception-reporting.coffeelib/services/disturbance.coffeeworkflows/filter-habitats.coffeepublic/views/cart_view.coffeeAlchemyTasks.coffeekeymaps/grammar-selector.csontest/sample.coffeesrc/js/tael.coffeecoffee/controller/cabin.coffeeshow-counts.coffeesrc/config.coffeeatom/config.csonlib/go-plus.coffeestress_test.coffeecore/app/backbone/factlink/tooltip_mixin.coffeetapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffeescript.coffeescripts/card-fetcher.coffeesrc/less-compile-cache.coffeeclient/views/signIn/signIn.coffeesrc/app/units/states/tasks/viewer/directives/unit-task-list/unit-task-list.coffeecode/hash-create.coffeecomponents/embedly/index.coffeeapp/assets/javascripts/lib/utils/local_store.coffeelib/utils/post-build.coffeetapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffeelib/router.coffeesrc/scripts/uptime.coffeesrc/scripts/thought.coffeesrc/components/WriteFile.coffeescripts/pivotal-listener.coffeetest/coffeescripts/Pieces3D_spec.js.coffeelib/calatrava/templates/web/app/source/init.coffeetest/data_tests.coffeetest/spec/overload.spec.coffeesrc/historystep.coffeesrc/javascript/game/entity/samus/systems/samus_controller_action.coffeespec/search-model-spec.coffeesrc/top.coffeesrc/search.coffeelib/load-paths-handler.coffeelib/spell-check-handler.coffeeservices/web/app/coffee/Features/Project/ProjectTokenGenerator.coffeepackages/rocketchat-oauth2-server-config/oauth/server/default-services.coffeeapps/galleries_institutions2/routes.coffeesrc/theme-converter.coffeecouchbot/scripts/dogatcomputer.coffeesrc/plugins/jade-template.coffeeapp/assets/javascripts/admin/enterprise_groups/controllers/side_menu_controller.js.coffeemetrics.coffeesrc/scripts/gemwhois.coffeeapp/assets/javascripts/admin/order_cycles/controllers/simple_edit.js.coffeeapp/assets/javascripts/login_prompt.js.coffeesrc/app/projects/states/dashboard/directives/task-dashboard/directives/task-outcomes-card/task-outcomes-card.coffeelib/rails/generators/coffee/assets/templates/javascript.js.coffeeapp/assets/javascripts/components/annual_report_uploads.js.coffeesrc/code/data/initial-palette.coffeetest/presenters_spec.coffeelineman/app/components/thread_page/comment_form/comment_form.coffeesrc/coffee/experimental-controller.coffeelineman/app/components/profile_page/profile_page_controller.coffeecore/app/backbone/app.coffeeapp/assets/javascripts/species/mixins/document_tag_lookup.js.coffeeresources/assets/coffee/react/beatmap-discussions/message-icon.coffeesrc/view/text_button.js.coffeeclient/views/blog/blog.coffeeapp/assets/javascripts/auto_scroll.js.coffeecoffee/app.coffeebenchmark/benchmark-suite.coffeetest/pending_test.coffeeservices/web/app/coffee/infrastructure/PackageVersions.coffeet2-people/app/controllers/person/edit.coffeeapp/assets/javascripts/components/tutorial-text/yale-mark-tutorial-text.cjsxsrc/support/index.coffeeapp/assets/javascripts/backbone/plugins/me_announce.js.coffeelib/merge-conflicts.coffeeapp/assets/javascripts/controllers/journal_thumbnail_controller.js.coffeecore/app/backbone/views/channels/favourite_topic_button_view.coffeeapp/assets/javascripts/models/comment.js.coffeesrc/blueprints/deploy.coffeesrc/utils.coffeeapp/assets/javascripts/neighborly/projects/updates/index.js.coffeeextensions/tabs/key-bindings.coffeelib/main.coffeespec/fixtures/packages/package-with-rb-filetype/grammars/rb.csoncollection-behaviours.coffeeapp/assets/javascripts/rglossa/speech/components/centre/results/wfplayer.jsx.coffeeapp/packages/results/controllers/types/basic_results_info.coffeevendor/assets/javascripts/gmaps4rails/yandex/objects/map.coffeespec/dummy/spec/javascripts/validation_message_spec.js.coffeebokehjs/src/coffee/node_main.coffeeapp/assets/javascripts/rglossa/controllers/search/cwb/cwb_searches_controller.coffeespec/file-icons-spec.coffeeapp/assets/javascripts/admin/products/directives/set_variant_on_demand.js.coffeelineman/app/components/thread_preview_collection/thread_preview_collection.coffeeinternal_packages/account-sidebar/lib/components/account-switcher.cjsxinternal_packages/thread-list/lib/draft-list-store.coffeeapp/assets/javascripts/select2-rails.coffeelib/panes.coffeelib/model.coffeeapp/assets/javascripts/neighborly/projects/contributions/new.js.coffeeservices/web/public/coffee/ide/review-panel/directives/reviewPanelSorted.coffeeatom/init.coffeelib/providers/abstract-provider.coffeemenus/markdown-preview.csonapp/assets/javascripts/uploadcare/utils/image-loader.coffeeapp/assets/javascripts/common/components/episodeRatingStateChart.js.coffeesource/assets/javascripts/components/_components.anchor-navigation.coffeelib/line-focus-stats.coffeemeteor/server/api.coffeelib/broadcast-target.coffeelib/models/localhost-proxy.coffeescripts/popular-news.coffeeapp/assets/javascripts/darkswarm/services/variants.js.coffeeapp/assets/javascripts/farmbot_app/services/data.js.coffeelib/grammar-utils/lisp.coffeeapp/assets/javascripts/dot_ledger/views/sorting_rules/list_item.js.coffeeservices/web/app/coffee/Features/Referal/ReferalFeatures.coffeeserver/cron/sendMetrics.coffeebackend/app/assets/javascripts/comable/admin/navigations.coffeespec/main-spec.coffeeapp/assets/javascripts/mixins/ScrollToOnMountMixin.coffeesrc/code/stores/app-settings-store.coffeeclient/layout/layout.coffeesrc/framework/index.coffeesrc/browser/mutator.coffeeapp/assets/javascripts/users/user.controller.js.coffeevendor/assets/javascripts/brainstem/loaders/model-loader.coffeeapps/atom/atom.symlink/config.csonsrc/components/learning-guide/weaker-panel.cjsxlib/assets/javascripts/oojspec/reporter/html-multi-level.js.coffeeapp/assets/javascripts/components/overview/tag_button.cjsxjs-library/app/js/jail_iframe/classes/loading_promises.coffeelineman/app/js/controllers/mini_proposal_pie_chart_controller.coffeeclient/app/components/toolbox_move.coffeeapp/assets/javascripts/models/user.js.coffeesrc/api.coffeeatom/.atom/packages.csonsrc/main.coffeecore/app/backbone/collections/ndp_evidence_collection.coffeeapp/example/index.coffeeapp/assets/javascripts/ui_components/chosen_init.coffeeconfig/social/jkn2-google-plus.coffeecomponents/MigrateLocalStorage.coffeetests/batman/object/delegate_test.coffeelib/compatible-view.coffeesrc/scripts/modules/media/editbar/modals/list/section.coffeesrc/scrollbar-style.coffeejs-library/app/js/jail_iframe/classes/control_iframe.coffeeapp/assets/javascripts/blob/template_selector.js.coffeesrc/run.coffeeapp/assets/javascripts/backbone/views/project_view.js.coffeeapp/assets/javascripts/backbone/water_backbone.js.coffeeapp/assets/javascripts/application/models/user.js.coffeeapp/assets/javascripts/sprangular/services/orders.coffeeposition.coffeemenus/find-and-replace.csonsrc/scripts/youtube.coffeesrc/glue.coffeeapp/assets/javascripts/sprangular/directives/addressForm.coffeeindexer.coffeesrc/app/config/root-controller/root-controller.coffeeservers/embed/index.coffeeapp/assets/javascripts/admin/views/notifications/index.js.coffeeconfig.csonapp/assets/javascripts/ui_components/sticky_header.coffeelib/upnp.coffeeapp/assets/javascripts/farmbot_app/factories/socket.js.coffeecomponents/tips/view.coffeeapp/static/script/app.coffeespec/collector-spec.coffeeapp/assets/javascripts/application/pods_progress_bar.js.coffeeproject.coffeeaggregator/aggregator.coffeevirtual-file-system/message-strategies/custom-command.coffeewidgets/lecturelist/lecturelist.coffeeapp/assets/javascripts/species/views/search_form/taxon_concept_search_text_field.js.coffeekeymaps/stata-dyndoc.csonapp/assets/javascripts/darkswarm/services/geo.js.coffeeapp/assets/javascripts/components/inline_edit_text.js.coffeemenus/git.csontests/HelpersTest.coffeeapp/assets/javascripts/species/routes/search_route.js.coffeet9n.coffeelib/archive-editor.coffeesrc/jasmine-focused.coffeeangular/core/components/user_avatar/user_avatar.coffeesrc/packages/collaboration/lib/participant-view.coffeesrc/desktop/components/split_test/running_tests.coffeetest/crc.spec.coffeejs-library/app/js/jail_iframe/classes/proxy_message.coffeeapp/talk/lib/roles.coffeeapp/routes/explore.coffeeGruntfile.coffeeresources/assets/coffee/_classes/turbolinks-disable.coffeespec/spec-bootstrap.coffeesrc/index.coffeet/compiler/harness.coffeelib/markdown-preview.coffeeapplication/chrome/content/wesabe/ofx/Status.coffeelib/gutter-component.coffeeapp/assets/javascripts/models/data/granules.js.coffeefrontend-admin/src/app/components/mnoe-api/api.svc.coffeeapp/assets/javascripts/services/session_service.coffeeservices/web/app/coffee/Features/Errors/Errors.coffeeapp/assets/javascripts/showboat/plugins/page_title.coffeemenus/atom-solidity.csonapp/assets/javascripts/sprangular/directives/shippingRatesSelection.coffeeapp/assets/javascripts/pages/project_wizard.coffeesrc/liquid/engine.coffeecomponents/SWTDetect.coffeeservices/web/app/coffee/Features/Subscription/SubscriptionLocator.coffeeapps/personalize/client/mixins/gene_artists.coffeeapp/talk/search-result.cjsxapp/assets/javascripts/pants.js.coffeekeymaps/simple-align.csongrunt/config/watch.coffeelib/router/main.coffeesrc/theme-package.coffeesrc/tests/components/inputs/test_toggleSwitch.coffeeapp/assets/javascripts/views/circles/admin.coffeespec_app/spec/javascripts/helpers/to_have_opacity.coffeejs/outer.coffeelib/assets/javascripts/views/navigation_active.js.coffeepackages/rocketchat-statistics/server/models/Statistics.coffeelib/adwaita-pro-ui.coffeesrc/views/exporting.coffeesrc/application-delegate.coffeeSingularityUI/app/collections/TaskLogFiles.coffeeclient/router.coffeeservices/web/app/coffee/infrastructure/Features.coffeescripts/poo-tracker.coffeeserver/materials/data/topics/greedy_advanced.coffeesrc/util/xhrpromise.coffeespec_app/spec/javascripts/helpers/to_match_list.coffeetests/batman/view/partial_rendering_test.coffeesrc/command.coffeeapp/assets/javascripts/components/cookies.coffeelib/autocomplete-emojis.coffeelib/php-debug-panel-view.coffeetest/javascripts/unit/relative_date_test.js.coffeeclient/lanes/components/shared/FormGroup.cjsxclient/app/MainApp/sidebar/groupavatar.coffeeapp/assets/javascripts/watch_form_changes.js.coffeeplayer.coffeecoffees/src/request_middleware.coffeeapp/assets/javascripts/components/inline_edit_checkbox.js.coffeegulpfile.coffeescripts/magnum-ci.coffeeapp/controllers/connect.coffeeapp/components/tag-search.cjsxsrc/course/model.coffeelineman/app/components/lmo_href/lmo_href.coffeepackages/rocketchat-ui/views/404/roomNotFound.coffeeapp/assets/javascripts/modules/country/base.js.coffeelib/love-provider.coffeeconfig.coffee-dist.coffeesrc/scripts/wowser/ui/screens/authentication.coffeelib/tests_finder.coffeeapp/src/controllers/common/dialogs/common_dialogs_qrcode_dialog_view_controller.coffeeatom/packages.csonclient/app/views/config_application_list.coffeeapp/assets/javascripts/sprangular/controllers/header.coffeeapp/assets/javascripts/table_sortable.js.coffeeapp/assets/javascripts/peek/views/resque.coffeeindex.coffeecommon/api/lib/crash-reporter.coffeeapp/assets/javascripts/photo_overlay.js.coffeesrc/plugins/eowcs.coffeeassets/javascripts/controllers/index_controller.js.coffeesnippets/handlebars.csonsrc/lib/middleware/locals.coffeeapp/assets/javascripts/views/search_results_grid.coffeelib/generators/templates/app.js.coffeesrc/app/projects/states/tutorials/tutorials.coffeecomponents/inquiry_questionnaire/views/step.coffeeapp/assets/javascripts/routes/flow_manager_route.js.coffeeroutes/time_entries/index.coffeeapp/js/jail_iframe/classes/control_iframe.coffeeconfig/atom_config.csonclient/app/MainApp/sidebar/virtualizationcontrols.coffeestatic/script.coffeeapp/scripts/route.coffeeatom.symlink/config.csonworkers/social/lib/social/models/workspace.coffeelib/zombie/sizzle.coffeespec/participant.coffeetest/unit/widget.coffeecomponents/mixins/transition.coffeespec/spec-helper.coffeeapp/lib/get_tutorial_subject.coffeesrc/events.register.coffeelib/fuzzy-finder.coffeeapp/assets/javascripts/application.js.coffeeapp/assets/javascripts/controllers/projects/index.coffeebin/layer-template.coffeeatom.symlink/keymap.csonplugins/email/index.coffeeapp/assets/javascripts/avatars.coffeelib/snippet.coffeetests/dom_tests/chrome.coffeeapp/assets/javascripts/resque_poll/poller.coffeeservers/lib/server/handlers/impersonate.coffeetest/neither.coffeelib/actions/auth.coffeespec/mocha/support/expectation_helper.js.coffeevarify/static/scripts/coffeescript/ui/workflows.coffeespec/package-deps-spec.coffeesrc/packages/jump-to-line/lib/jump-to-line-view.coffeelib/file-view.coffeelib/range-finder.coffeesrc/Witness/Scripts/specs/Dsl.coffeelib/autocomplete.coffeecomponents/Store.coffeespec/helper/setup.coffeefrontend/config/application.coffeelib/assets/javascripts/routers/main.js.coffeeapp/assets/javascripts/questions.js.coffeeapp/scripts/main.coffeeapp/lib/subjects.coffeescripts/pr-status.coffeeapp/packages/tinytests/tests/Tinytests.coffeecore/app/backbone/components/time_ago.coffeeapp/assets/javascripts/models/task_template.js.coffeebackend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffeekeymaps/megafinder.csonspec/package-updates-status-view-spec.coffeeapp/assets/javascripts/presentation.js.coffeeclient/file-list.coffeeclient/landing/app/Applications/Viewer.kdapplication/AppController.coffeetest/get-supported-languages.coffeejs/outer/versions.coffeesrc/trix/controllers/editor_controller.coffee�2�H��sH<�dbP���pH4�LBsI"���,�c�p(� �p�<&����4��Q0 !�����SI,��DR�X"�ñ0P0 �"R�,���a`����a�8:�B�X ���1H*Gb Y ��)R�,C� * M�p) I� "�F&A�`" ΀` (Ń�d B!�2� �!$E��X06�#Bq��C��F��9DH!Sh M���L,ɠ�`�4���CH@,`c� ���8 ��(�(` ��)���"�h, �K�@ �C�Y,���QH, CD��8 �` D�h0�BbbQ F�`�,�Aax<���P0� �q(@�à8,E��@(�UDs�(H�� 4�F�Ѩ��a4&��A�@-���, �R)��Q0�ĥ�xh,�F��t2 B�@@ ��(q���Ba �Ń�@,�I�P$�M#��$ C�`4*�P$&����D����1�J �PXÁpp ��ш(���H �DDYd��� ��`�x," GcA; %�h(�aqXL ����D�#Aa,�ǂ��( ��h Ŋ@XX�F�q4��B�aFc�p0: Da�`&�'��$*��!-��cQ�4 ��x"$qH��� D.��T�NB��H ���I8�e@� �I!� D !Q�T�ƒ�h6���`0F�(h�Jga�0 ����0$�L�sx$$CC���QhX�N��LO�Q  ��``6� ��@���@Ef� �3j8&���HD �a Q8L%Q0$ �Ԉ�@ �P ��@e2���Y$D��c`($[�����G�a0($�aa�D��p4��0 ���(�E�h��qh@�p0(��b�p$ '�(4���(�� 4� ��04�aQ4�2�$ 1 86��a Bd�8  �a8 P�1Z4 AAPBDѹL&���H@�CCa<(ƅ�h\�ME� ��`0����h��H��.��b�@d��18 ��c��0��9D:�a��$��A 8ɣ�QD���,��e°|��p0<,��B�4�FB�P,6��#Bq|*L�!�$ ��axd�G8�ÆqQ(&�Ef��9�Dz� ��0l$�Cr�D$��3�4,���8@& �ð0 ���q88 �d@i4*�ñx0#HfAJ��AAE�1(��A , I�Y0 K�QPT����p8$ ���0GeP��D� 4 �c�`-<�ā@`4��ѡL��ǃ00D ��P�D0��ӱx��`�x( �fQpd���@��a`D�1P8��8��!� ��8X��cA�x. "��L!aq4��p`���2�0���IP "�h<��pi@4#��(B�yL$�Db�:4 B� $�"Y,JEB�@0���8DB#A8 ��)8��@,,�#A�$ Ed�P�*A���E��x* �e�p��r8  ��@0����X8"�I���8FfBQ0�a80��A�I0�G"�8��"�H�.d�X ��� ((��f�ql2��(1�<����0 ��r�x�g�< Aqp, �0A4 ����,��CR�P��b1��P!0 !�(&�O�X0�$""0 ��E2�,&N�� $ BD�ȌƢ)��!�H$\ �1@,� �r�8�#��,#��a@@���H(�ƃ�P��(��E�`8@���;���8p�NB� 4\cB� CH�X8�BA� ( E�a0(��Q���H0 ����d: �!Ѩ8$����&G��4��a�I0�C�pP O²�TA�c�84�HdQX6��)�0 �E$AHL ��@D��0� C!Y �Ţ�`��M�80�N""�<�Ad�� �‚��(��`Th&���P��`$�"AQ4*E�`�8�FD�H,��@@ƒ@XP��cp ("�X,�� c($�2�#q�,  ��H,�#��P:�C�) ��x����8,�’p4&��!Ҁƒ��@.��!�4 A�pXP����X"��#"Q ��!1t��£0d0�cT�xB�be��P�&H��@8�c��(D����p|( �2JxBAa<� �`T �����,J���H&����0�G��( ���&�!�4� ��P|@ B䱰 <��" Ȃ@�`$G$�`h�c��@ ��<��h1���BY<��b�0 P#�A8�Bta<���p$H��J�4��AA9$��p. c"9T, "B������H ��H|�$�` F��P, ��#qD0����`���\��h04 M�`HG�<( d�8( ��H�&��@à��8 ���x,$D�P0�%4@8c�I0���X Eတ4 �@��$�Nq$����8�D� ,���@��Ą�88�ɢ�x`�e�,. C�S!( �!� d&š@)T& �drqI��P<��C�$.��C@L�A��,"!�2��`!4$P��X �2�� b@ * ̓�x,�e0HP��,��@&��hP�b�yHB����P*���U���R� �G�@0�C�bQh.L�t� �`0HH>�Űx ��`8@ F�s�,V R`��ÀA�4" "Q$ ��H @$�E䳈�Mb10�d�8 H�P >� �,��#�I8 �Gc�‚�Y$�Cep� �QP,��Ph�˄� $a�8&��q! DbQ�D,��%AHD ��⡐XC��8<4���0F �b��D �1P��$RP8����P �F��( �c�@t ��%"� �Ϥ��>��2�<$�Q90.��@�B�Px ͦ��<$ M��Q ��8�#�(� FAb ��"q�T ���<� �094�C�@l�Gb`@0 ��A�4�����$"��� yH& ��`����YX8�B�q�0e�Q<J��(� �0�d�CQH(,�Fc�8,��@��ǂ1 M,�!�� �D�Q�( ���h0��%a9@:�@Ax@�!�x0�BBhH��@ I"�0,ȃq�FB�p ��`!�8�J� �T �1I8(� �Ѱ �CR�"�2IH�A��0,��$ah,��Ih�FBBA ɋqBh C���L ��`0 �F"S($�D���4&�DdB�L�CB"�$(�Q,���t�DBq�L>K�SP(�%�hD>��@�L��aA E�8 ��AI,4+���"ƣp�X(�"B �!S(( ��!a�(�Á0<��b�@8��a90�D�aX���p8<�"�@ ���0ADbx�ǣ@�(�RHF���,��B1(����h$��AhG�(0(���0�a�0��c�iT "B�  ʃ�`0 �C�� � < N��P �Ɇ!� �!�L����L6 e� 4� �Ҡ K��Ht< ��X ��D�8(���P4ƣ�x<��b4��2Q8��ð�$ ��a�(, ��Ap  ����F�xX � ����L&�������a�q08 ���@|��B�` ��B��,���Q0D�ĢQ�2�E�T��#ӈ| aB(0C�P$$ GQX ��"a(�E�bl0��8�FdQH �K���0$�Bf�X ��Q! E�pXL���0! $��842��@�p0, ��) (�`� 8&�� ��@q( ���@ �E9@b@C� , ���XL* G$�p4 �D²�0$Kf�@0���X< #�H���hH �!� "��!�P*��bI�:��QH�0�H�Ҁ� �D�H8H��08'��ф��0"��&�) I�Q�<0 c"�h%J��x�2jb�D"��#�$8P�P,� %�@A�Bs�d��P8*��$�b�XD �B�p8 Jd�`$(����,:�B�0<��X .��g�PH  BrP(� "��4"��%�H4D �A�D<�B�"a��Ba�0Ida�( H�`yl(��Ai80Jd 1Lh��$J�#A�< �B3a$ ��"*,.���`8��"��0""�� >��&�L��n�2$�[1,��� ��"cIV��cB(D ��d��,> ˣpP@8 ���8��e�04�B�4�F�ay�!y0�@ 6�e�y. �a�qd GE�`8*���2)5�E�p0 �a8L�łbP8��Ay$ ��E$")�Lb�iH2 �"�t$�B��0 H�� & ���h�å�(q�F�eF���D�E�H@Dã�(<D"�X(& C�2yD ���AD �#Q!���p<��B�xx ����l���ai4��aa`<��2Y|&ǃ�Pd(�E&�2�I%�Y8 ��Cq0Lƃ��(�$aH ��/ 49N! metioreenent/sitvechboiltotaularoucepllaloe/caantrssrc_cie/lmiuphaacnd-tgeal/m_png/tppe_d/ric/daruexprmoencresdilesebaatraliroicerp/ctonpacointemadestreaps/fee/cos/sperer/js/pro-lis/cs/mteres/ageinginss/rlers/alinpreureatectidatreaendbinentrs/ialontautextsrc/lib/ffeeservviewspeceditbackstatworkseledingruntifra-conlectp/cotest/.cson/app/atom/.cjsxmodelation/view_viewrolle_testmanageration.coffeecripts/client/coffee/packagecontrolelementapp/assets/javass.coffeescripts/.js.coffcomponen-view.coindex.cos.js.cofr.coffeee.coffeefile.cofmain.cofp.coffeet.coffeeer.coffeder.coffassets/j-spec.col.coffeeon.coffenfig.csomponentsices/webk.coffeey.coffeen.coffeese.coffejavascrisetacil/promn.-fdub_gvhkyjwxSCzAVqEFGB2DMWIO3LRTU789:HNP¼������*��������MGJ�ȳ�Q��� , ��V�I��ƾ#�����P��(��s�o�>�9��÷�K����1��YEq�5����<��!��IGB�H���<��o�����:�����WL�u�fd���b��p�� �ЍLA�% ��� ���E�����q���\ ��8M���$< �� Ʋ����/�ɲ���7KdM���ǵ���<��E-� G�H F�LAp��J���1���oLAɳ�H�M��o�V�� ��Ĺ ��J<�t��L��qot�T��B�ʺ�$< ��t����[�t�� G�oɳ�� "`ƍ����õ�8ln�����!� ����F� �����͘�FGƌ�aDK�1���G�w��#6�o�<(�t�FE�D�8����qo ��� ��J<�>��H*��[ ,׵9ڼI�κ���rRJ�&�ƌM��1�1�o�V�� ���6��C�������8C�ȳ�I��C�5���o���b�o�M�<���÷I�Ĺ�<���÷I�qo�����LAS���=��@'�.���=��@'���F��9�t����P����ȳ�Q�I����9��V¼̮�� , ��M��ô�(�D�Ȳ#������r?Yw+r?�r?Y¼���eR1��K�¼E��t���K�����TǷI��qr�)6��!� �Oq��ƷJ��6����Me��e����T�b�L�_��x��O�O�k���@�L�_�J)6�)��c����7��a�I��o�M�������FI���qo;����� �Aɳ�H�V�����/�ɲ���7Kd]�ƷJ��=��3/��p�������F�L�jFX!���Ƿ�;�����MGJM��+��­tO�H"�q�]��ɳ� ;�÷�ĹKE�I�S��7��E��o�4$�#ȳ������˳B�1a����EK���J��ȴ��s�o�K�7��˼�6����wÖo�e��%��e��o��=i����>8�NƌM��0�1�4�0�4�1�0��0��0�0�0#��i-6��;���Ì� ����q�J!�Mp>�G "^�L�_�dC��]G����_d�ʹ!��� �8�>̍r?YE!�Ma���c��MǼG�oɳ�H��n4��C�����Mþ����=��L���p� K,D���� , ��M��ô��� ��� ��ʺ6��� , ��M��ô��� ��� ��ʺ6�����^M�9j�qo�F¼�� ��J<��]��ɳ� ;�÷��F��F�ȳ��t��ȳ�q���� >�o�Ƿ��3I��Q;�pL�׵9ϼ��M�-,��J���@���I� X�o�������óU��t���J�����qL�_ ��;����ʽ`�O��oLA;��#ȳ�o�qLq��K��� ��G�ٳH"�F��̍p1���C����� , ��W�I�#�������$�K��6��Nt��<�H��q�>g�śq���9�D������HF������8����¼�NsMX�� ô��G���o��Ѝ�{�N�����Qŵ����Sw6�������K�pμ�ɳ���߷X�����üG����E�~�C��� �&�I�VC���oþ&� Cż�r@�����ȼ�¼�_*�L�O��9dCO��9dC�(�t����Mþ������ XMþ=�+�ûK����t���I�Sr��t���IOn�tcͽɦq��M�ǵ���������[��܂�M���6��KƷJ@᳽c�#6�I�� A���Muk���;b�o�ų�X����ʶ8ų�t�T˳B�UJ�s�q�ȳ�Q��t)��÷�t�oLA\ �8����}����D�o���ò��8��� F��õ �rR�^M� X�o������p��wò�qt������osMF7 ��yB��oI�� AL�_��xO�&� e�)6�)��cM�qpx�D����t����Mn4��C_�<��t�o��ȼ�#û�o�P����� ���������� ���� "^��þ&� e��6�����1D"����\��������Y�q˲U�<�ʂS˵ �|��YQ�H����b���M�<�ɳ��H� @����Eû9�Np!CMGʹ�Np� K,pw�I�)6�_(�e�:9���t���M¼@>�t�\ �^�qȳ�Q ��ɳ�H�M���%�ƾ��ԾǷ>�MsP�4Ƿ>�08����]��ɳ� ;U ;���ȼ�Pg�6�Z��X�%���M��4�C����āL�_��x)6��>�G�oI�� ��m��3/�)6�)��c�r@�&�ƌM�6ŵ���!� (6���;b�˲U�<�ʂS���=��@'�.���=��@'���F��9������ćMF��MF���=J�^�˲U�<�ʂS���=��@'�.���=��@'���F��9�LAo��M��˳B���\���1�o�M�������FI��Ĺ�������F���_� ���Iʁ��EI�r�����!6�ʵ��˲U�<�ʂS˵ �|��Yf��'>��r�)6��þ��>gOq��I�u�7KdV��7 ��6��t����ȳ�Q�J�8���MŊ������#6�����MGJP��+E��Ų�­���I#6�oT�<��o3� ��M� Xع�qt��ĦqtFX�ij Ƿ�q�M��;b��`��7%�ƍ���wÖt)��4�@;�qt�ϼ��Ci����FX!C�̳�� ��_*��L�t�L��I�� ����b�p��ǵ� ���t�\ �^�qS���;����ʽ`ɹɳ�H�����<7���ô ��o���?���LA3�YJ�؍�[��܂ps�ȳ�Q��K�F,K�F�t�\ �^�q��_��x�� X��q�mȦqF�o�ɼ�����M˲C����LAS���=��@'�.���=��@'���F��9���ǵ�fBž�IM ��J<�Ų=��q�LApJ!�M:9J!�G�c=J���o�K�7��˼�6�o��K=��L�_�J��qI�� AL�MD����ȷ�V=i�>�X��������Mȼ�FI͘�þ�aT�t� ��M¼̾��������K8�9�#����t�FǼɳ�t�ȼ���F���6�M���G͵����G͵��ot�FGƌ G��t����T˳B�NrR�]���6��vg��.���V�H�8�����I������� I��t��<x���M�l>�M�H$�ô ���<x��">�EK�ȴ¼��Ųo���M�ͷ9dC�HFO��Ci��5����J���C����(�Z���V��k�� X�� XVc�ʹG���� X��oLAL�&�I�]����þ�t�0 E��m��E�KB�qo/�3��4Ǎop��.i_f#��8������W��[�KE��V ���Nt&6�Z��q�2�wÖpZ���M�6�г����@���I�:9���ǵ��ýĸ���V��H"�D8�G�t&F�H����qo�M�q��MI���$��÷�I������oF7 �Ņ�t��!ȳκ�����˶� ��M���=��������s_� ���� ��� ͍t��<�ȍo��Ѝp���D�Ȳ#������J���q��5���)�+�$��\@����˜�����[�C�Np�������F�o�� �ɲ��:H����v �Mȼ��p3�7%�ƍ�LA�P��(�r�����=.�� XM�<��C��–����9��N���v �V � ͘tFX�F7��L��ɳ�H�M��ò��]��ɳ� ;U��� ����(�ݾ߼����⻧��ɻO���%6ݻI��FI��t�����@�37��[�TǷI��qT˳B�����HF�����þ�h�o3� L�_��xO�&� �e���tFX�ȳ�Q1���q���sMDQ�u�����¶������ćP �ɲ�عI�F6 ��s���V��k�� X&�I�MD<�����r?Y9�C�r?�oF�F+�5���tMþ)ʺ+@>��t�����MGJMa�=�ȴ�Ų�­����M8�X�=�Ɋ��[��܂E�~�CMᵲɲ�d�����F��Í�GJ��������V�����6C���Ci��tO��T˳B���q�[��܂E�~�CM۳�ȼ�ɖo��Ʋӧ��P��+E!��M�q�¼���T˳B�����K����T�o ��M���čŲ�ȳ�QMI�g4�����͍�����������oEq� ��5���)<��G�5���������K6�tO���Ʀq���ǼG�N¼���ɳ�H����D=�rR�ȼ�M��߼8�LA>�GW�F#�č��Mɳ�hz�K�����LAL�����E���O���ƍL��K���F�ô�������JOnż�C�N�����MG��#��8�� K,���M1@��9)̼�J���ȳ����F�t�o�MƷJMpƷJ�rR�^M�q��Mм����qoJ�p ��o�ɼ�����M�����n4��CV�J���� +F�ô�LA�p������9 �pT��qSGJV (��#6�����¼��8�$�O�~�CMFI͘�E�3������t�p���D�Ȳ#���t��<�H��KƷJ�ʦq����ja��ƾ�t��]��ɳ� ;�ȷ��=�ȴ���V=i�p�����ôȍ�E�3��L���ȳ�����J ������EK���J��ȴ��s�o��������6�pȳ�Q�I� "��M���ٳGB�Lq�fB�� Y��M�-g���c�o�q�@>���þ���"��F�t��ǵ��������L�_�J���@VǍtOq�˲͹��ƾMڼI��*κ�����P��>�K�rR�W�I����1��_ ��o����Mκ����?�ٷKB�ɳ�H�_� E��G�ò�LA�>g����MsMǷ��%�І��ǵ�N���TGB����<� 6������I:���J�ɳ�N���N���*��M(�Z�L��Eq���.7KdP@H�ٷKd�oJZ�����t��ý����.���M�%�e��8�F�ô�t�L��>�GM�%^��������fB&�F����˲�˲͍��M� G���I�t� ��u�qo�M�s�ɳ�H�M�s�o�M�������FI�������D�Ȳ#������< _���C_*=C�!�����UJ�ot�FGƌ� ���t�����^_*=Cl���o�0ĭo���þ�a����K��C9#6�ptk�J���T�b�rR�ȼ�W���9��;���� �8�D$M÷���Ci�r��� (��t�t�F7��q��I�3�6�ɼz�ɼz}������O���ƍ�4 H�ɹ�>�9��T�J���Z����Ɩ���9�Cٳ κ���ȳ�Q�����>�9��L��ĹL��E�H"�G����C�˵���)�����C�˵�����MG����C�˵��1���ʹb�EK�ȴ¼��Ųo���M�ͷ����yBO��Ci�LA�SfB����>�GM� X�t���qr�����=.��I�Ks�D��7Kd]�s���ϼ��9糷�Ȣ��M��7���r�)6��þ��>gOq��I�u�!��7 ������ ��ɹκ����ȳ���Z��6��rR��g�̍��� ��H��8���{�Np��ǵ�����<-YȷI�0�EK�v �M�9jfBŲ�I:���F��GJ�\ ��\ ������I�P �ò:�� ;ȳ���; ��s�p� K,p��g�̍�����M�ô ��7���8��ȍ�]��ɳ� ;����ij,����ij�⻸۷�$�t�D8�G�q������ ��ʹ���� �M̘��M�ʴ�C�����L�_�J�aK"RK�~���t�\ �^�qtO�-Y����qpK�ʹ�q���Fk��@_ô�i?��o������������ɳ� �Ų���ô�No���J����� ��J<����J���ot�5�c7��t����L?���¼����LAS˵ �|������J�!�`���˳B�on4��CW�¼̾�as�ɳ�H����H���O����P3���Ų5������a����Ƿ���û��LAp��� ��Z���� ��t&��6�qx@P��k����k&�I�P��kL�����?��p��ǵ�̳IJ��ɳ��< M̳IJ��ɳ�CdC�o��]��@4� �ɹD$��ȳ���1��Yn�G��t�����c��čo�.�óÞL���5�� �8� ��Mnų���B'���F�t��Ko̵��o¼�œ� �K��=J��� , ��VfG�\ �^�GJMGJ��Ų�õvg���ǵ��avg�����m�E��G������� ��ʹ�H$M̘o�J��ž�oJ�p��K�����[��܂��V��3��;�����G�M����„t��?>�� �߷�ȴ��]��ɳ� ;U��� ����(�ݾ߼����⻧��M�s�GJMFGƌ��H$��>��3� ��LApE�3�sM�ô �s��T�K:��� , ��M��ô��� ��� ��ʺ6�G�cM(�Z��*��M(�Z��'!�Z����Ł������ ��ʹ �MT� Yu��������dŵ��V�EC���\��r�?�q��+�N�{���t����W�?��~�t�r�����?_���<���w�N����WL�u�fd���b��t����M̳IJ��ɳ��< V ���t�t��ý����.���M�H$�@�t���\�����K��qt�C�������q�ot_*��XM�*�Xκ����ot_*��6�糸Q��� , ��V�I��ƾ#������=.S�����T���p��ǵ��8O�dC��2?[�ćM�<� � "8s��� , ��M��ô������K�û�����J�8�÷I���LAS˵ �|��Yf��'>��o� �J�oJ�p ����ȳ���� , ��M\ ��#����{�No/��[���ΎL?���J����F���K�Y���V�q�Y��L�Pȼ�)6��ȳ�QMs�ȳ�Q��> ��>��%��GJ�\ ��\ ����1��Y����<ɳ��ȷ�����< ��O�~�CMFI͘ov �ȳL��̷���E�H"��¼�M���>�K"@@'���F�t��¼���T˳B��8�D�����Ɓ��ǵ��Mi��o����<��ӧt�ֳ�ڳ e��¼������*����1��Y��C�ō������M¼��ȳ���˼�Mǽ��8�K ���q������ ��ʹ�9jD��No�H ������IJ5�Ğo�<(���ʾ��� �H����/�ɲ���7KdP3���Ų5���� �t����ȳ�Q�;���ot�FGƌ�G���t�L�M�%^��\��CM��@MD������ X���@�o�K�7��<"��#��o�0�1��ʶ�ù��;bW����D$��LAڵF�*��M������9�(M(�Z���"� ɳ�S��M���M`��FX�� ��������Mֳ�����<�oH��w����oLAɳ�H�M���3 ��ɷ?��:� �on4��CP��#< [���6D�o���Ǽ �J�=J4����v ���\��9��=J�oK��6���HC��<�����MGJ�ȳ�Q���MF�÷�����6C���K�M:�?�F����J-(�FX����ɳ�H�_*8����Ƽ����v ���\�����+��ij˜ot�FGƌ�t�o��� "^�I���}��Ɓ1��K�¼E��o%� ij��÷IM¼̾��� ��o��\�Ӎt�0�����P����H� @�T,oEq��5������I��D�9�9�(M(�Z����@ʁp�=Y����6��C�����e��$�o������K"@Rp��-I���I�ćV�� ��G�ǷI�E� ��K�GJMGJ�1D���C�����üG�t����P������@�m��D� �o�I�r?�o�F�W����F�o�9� �ò��F��]��ɳ� ;��m���r@}��ƹ�m�@��I����r?6�rRJ�&�ƌM�㍔�����F+��M7KdP8���ŵ�ûK��ʘ������ ��ʹT˳BMv@VfG���V��k�� X�� XMD�F;�D�F;��LA�$��(�Z�GJMþ�V��H"���oI�� ���0��[��¼���F�o�����t&��6�qI�� ��D�����ô �Pȼ���ô ����M���ٳGB�on4��CM�<���÷I��<���÷I�GJMGJ�̵��t&��6�qL�M8�!��>�GM�q�GJ=i���ǵ�sM���K��У�Ks��>���_� �yB�F�ât�ȳ�Q��qGJM¼��V�>�LA�� $�p�c�ʹ���c�ʹε�ϼ�=��C�ȳ��᳽����8��þ��̲�K��6��t�����MGJMa�=�ȴ�����MFGƌ�/�� �'L@�� ���t�n4��CM�`��s�qLA3�Y �������� �8Ų �8�o̷�$�MsP�~؍rRpE�¼ǵ�p�������F�EK�v �M����jfBŲ�ƾF'�������tW��\�$��i��m����G����E�3����@��ȼ�ɖo�3�Yȳ�I��ȳ��oI���3���������_ �����rR��VCJ����M�����o�����Ύ��Ѳʾ��d��EK�v &�I�M�!��K��tO���?�@��o�ò��8�E���ƹ��,�����C��P���1侹�q�����1��/�� ,�C�N���D$�����2��7KdPȷ*[�c�γ~�����M�Z�G�M�Z�G���G�cM�9�'>� �9�'>�N���>�GWL�>�G���P .�o�N����EK ���ǵ���M�ȼ ��%^����/�ɲ���/�ɲ���o��K�Y���V�q�fBO6��i�ʹ�9��i��LK@�?Y9����O��T�K ���T�K ��r���F���K"@���ԾǷ>�MsP�4Ƿ>�08������T� 6�EK���ǵ�:9��k�r?6��OK@�?Y9���:��8�I �o�FO���ƹ>�G�o��Mӵ�1@��9��„rR�ދ�ދ�p��ǵ��M��J �ÜNo�3�Y7�� �ʹ ­EK�v ��!�`ɹ5����I�KƷ��p��ǵ��!����<�����>�EK�v �]�!���9�� Ė�LA�*=CM� ���/*=C���VC���=J���8�LAG�c_*Oq&�F�L�W���8�m�i?c�oLAL�&�I�M ���E��C���Ǎ�!ɼ��?���"8��6Y���=.�����̍���˼�Ļ�L?���þ�ȳ�Q �H�qr?Y�������<��ڼI�Z��E����TQY(�Z�KJ0Bb�Gʹ�tɻ&�I�M��J��κ���oLA ��M ���I�F�C�yB)����I�F�C�yB�osMɳ� �糸�rR�ȼ�M$�༼������ݻ��LApE�3�s_*=Cs�L?� �s�EK�v �Mng����!�������^W6�Z� ��l�������"��n<�N���/�ɲ��@�?Y� X�yB�N���$Ʒ��M`�M`����li�p��ǵ�̳IJ��ɳ��< M�����!�ȼ�I�œ����������=J���C��"[�ϼ� <�ɲD�DP <�8�=iX�%D����r?YT��B�r?��sM ��_��� ��L�>7G���ǵ�������K��͹!C�p��r�S�����r�S5�;�E��þ�@�&�FOq�5���)6����4˹̳:��&��Ye��>�9��M�6��>Q���l�F@�̍��������!� �ɘ���LA ����?C��:��8�r��r���ճ;bMѾ%��MѾ%����X�o���l��o�� �&�I�M��@��S�^M7dC�l��t���� ��J<�LAG�cMn����o���E�~�CVCdC���ɖoLAL�&�I�MT˳B��^MG�Q;b}��^��L�~�C_*=��p ��u���M�$��� ��qp #ȳ���Ė��P .�t�K�÷K˲�t����/�ɲ��O�jm�i?��ƾl���p�<�H��wò�qp��H��ydC�qEK��.������C! �VC���P ��C�����t�����2�O�j��LA>�G_�E�M�q��MF�÷�����6C���K��q���E�ʹFI͘��ǵ��^MFI�l���p9����/�� ,��ǵ�E�~�CM:���¼���T˳B�����K����T��!ɼ��?���"8��6Y���=.�7;ȳ�� 6�ڳ7��ʺ����=.ȴ��oFḮJZ�Ĺ$�ƹ�q��sM�9ju�I����> 4�H*[����̳�E���I�3�6�ɼz�ɼz}������O���ƍ�"[��*=CM۳��@���/*=C��*�l��LA��^W�F�oȳ�Q�D<���^�D<���^�o�D$M�>�9}G��>�9}G�t�LAt����Mȳ�QPȼ��=�����C�EK���ǵ��>g��<��!�`����=i��t���ɻ5�MCM߼C�����w?��rRFI�6�os�hz]G�hz��� , ��V��� ���������#���L���ƍ˲U�<�ʂS˵ �|������ G�Ų+K���J>���̳čo�͇M�H$�; ������� ����Ƿ��%�І�����V�� K,ܾ�ô����������M7KdMe+�?�@��E��LApE���ƍo��LAS� XM�H��ǼG����D���JK�9�=I��rRpa9@M�ȳ��:9�5䊍GJP@��ּ��8�<��G�6����>�ɳ��˼���Cl>��:9�o��K���˳B����EK����ôM$��l����FGƌ�\ ����#6�o�� ��÷O����D����^M\ ��l��onO� ��!����â���s_*=C���ǵ�sMQ�C����²� ��8�p��H��u�qp���]g@� ��K��G�cMu�ee���o��E-(UJ�qo ���8����w?��]��ɳ� ;���O�3����MƵ�w�LA�SfBF�p˲C�˲�����p�P�������=�ȴ�LA�M��o��M۳��@�?� �׹ε��˳B�EK�v �M�!�]��ʈ����!��p��H��ȷ��=�ȴ�yB�šqos�I�� A��_��x�F�÷��t�IaC�E��qI�� AL�M�%^�'���ȷ��ع>�G�����Vc�ʘ����^W; @���ȼ�}��^��@>��Z���>�G�o��O����)n�;���G�o�=i���^�ǼG}��^�onO��a7B���âoķ�ɼ �on4��CV��H"�FXaX�p��H�������hz�LA�>g����_*����LA�DM̘o��P��I�/�� ,fz�>̄L�P��(V�����,�qoJf����7ý��� ��÷�1�X�o�J���M���˳B�rR�FGƌ�F7 �śq����#<�ɣ����T˳B�N������%�ٍo�L�o�=��Ǎ��P�U��on4��C]6��� ������o��)6�Eq�5������E��LA��NLq������t�o¼�œ� �K��=J�oijm��j�H�๛qo��M���:��ƾ���W�I�W��\�絲ϼI������MDQ�ot�T��B������t��Ƽ�@���V����-,Ἴ�:��o�� ��÷On�!C�<̹̲2[�EK�ĹL���p��U�r�����=.��I�ȷJ�O�j�J���ٷ���l���� �&�I�M1�X�o�^_ô�i?c}��^���M�����ع��@M���o�� �������Ƶ�N���=.�ȳ�� ���5����LAڵF�*�ҷ���%�І�l���GJ�\ ���̖�F����/�� ɳ�H�_� E��G�"���ǵ���J%��u���:��C��ƍ"���ǵ����v�p4�FY��b�E�� �����P�LA�Mn4��C� ɳ�So��_��� CMij��M�ʺ��ȳ�,�; �˲͍p��ǵ�"�8�!��E�����!ɜN������� O��K�K��M����@�˲͍p`�o� �?���E��EK�v �]�!���9��9 �������N���Nɳ�H�M�������FI��ɳ�H�M�H$�s�orRr��o�=�LAw?5����L�ofB��ܹ��ɳ۷´��?ɣ�o��M�5L�紽�o;���T E�� "^�o�ȳ����{O����6��qLAS˵ �|������ G�Ų+K��pD�9�x@P��k����k&�I�P K�H F�Ks��>��V����I3�3��p���-G�˲U�<�ʂS˵ �|����5�c��1���o��Vli�D$�pZJf��o��M IJ���� �K��������NrRL���I�x�D�DM�FI�D�o��ĮtFɦq��M�g���6�p ��_dCM�� �� Ų� �!���sM�M��̍I��&CƼƌE���ƍ�A ��M�; �o��� ��L���qo`ɣ�������*����{�NpTǷ�p�=i��{�Np��H��ȷ��=�ȴ�yB��MsMε���p�5���L�� $UJ4@�p\@�����˲͍oJ��o�ų�X����ʶ8ų���I�x�D�x�D���� �oFk�г#6���F¼̍oL�o�M�<���÷I�Ĺ�<���÷I�q���N��M�c��>g�KƷJ�Ŵ��yd��o3�YLAH�R�q�OK@�?Y1�C� "^�ȼ���E�����N�������e���/�X��ڵF�TǷIjE���G�=J4���ȳ�Q�ɳ�H�M��t�:�?�t��0���þ�LA�L�oT! ��E���p������<��F7 ��qp�H$�u�wò�qp;��#@�˲�s���o��� ��o��č���w?����>�X�t�F7��qoL�3������sR����s��L��Ƶ���V��OK�t�೵�� �ɳ�H�M �8�u�ɳ�H�MƼ#�U�E��þ�@�&�FOq�5���)6����4˹̳:��&��Ye��>�9��M�6��>Q���l�F@�̍������ ��ʹ�9jD��N��M�s�p�<���÷I�qEqP��(�L�����L�������ʘos�hz]G�hz�o�͹� XM�%^��� X�o��M8�[��÷I�F��U�Ʉ���ǵ�L?��o�?�e��p��H��yd��o�T��B�ʺ�$< �o�0�L�jȼ'Z�o���o ��M��ɳ�H�M��rRJ�&�ƌM��p��ǵ��`ɘLAo��P <$��b�J������N���LA˼ĜN9�(M(�Z�Ƿ������E��� =� ˜o��P� �K���pD��qL�_��x��ij�#ȳ�����{�NoE�H"�D8�G�qLAHF��E���LApD��D�E�J���E���E��p�>��J#$�o�x�4 �P4�&L�����t]GM �CC���¼����>�G�pfB���ȳ����„�<�Hj̳�ށ�������D�M7KdP��+��N���I�����No ����p�NL���LAp��)<��ܾk�û�ݮp�NtY�Mϼ�~�Cκ����{�N�GJ�\ ��\ ����os�hzMs�hz�o�W��\��%�e�������a�>ga+�ûK��ʘ �6��EK&�FOq�5������������&��YEK��C�L�Vl!����qLA�SfB�D$M����"��LA�*=CM��@��/*=C��*�l��̳�rRw?�S�N�p��Ѻ��o�0�����ȼ �<�ȜN��I�x�D�DMuD�o� (�op��o��M�=G�>Q��LA�>g����_*����w?����8$"����*��M(�Z�KJ0Bb�Gʹ����N���=.L�3�O��?C�?C�o�ȳ���o(�ZM˲͍EqP�L?��T˳B�o�=�S� ��LA�Ƶ������4�Ƶ�LA���MiM�F�p̺��Ⱥ­���9��4����f�����!E��N��ǵ����I�ćP �ò:���I ;ȳ���; ��s����!E��p�$}�=B�LA>�G�GJP���rRaK"R�qtFX�0 E��q�E��ɳ�H�M4Ez�yB��=I��q���w?����� �N�{�N̳ĹS>�X�E�~�C]�CdC�;����ʽ`�O�����J���o�NT˳B��LA�SfB�D$Mȼ�˲U�<�ʂS˵ �|�Fk��@P5���:��a������ŵ���F�ôMe��F�ô�����O�j����L�jἼ� ͍pK��6��]��ɳ� ;����E�H"��F�r����^]�!��8�EK�v �M�9j�9��w�J?�������oɷ?��:� ����L?��LA�Pû�M����_ddž����̳�O�jZl����qoL���(��LAp��)<�����3�Y7�&�7��3��̳�D����q�����Jf��!C�NoL���ƹKJ���=i�EK�v &�I�M�!��K��p�@ǵ����IM�����{�N�{�NoJ� �0� }��ƍp!CMF���LA���M�̺��ڼ��rRr?Y�� ���@�?�t�̳�E�qtP3ɳ�t�t�D�9��t������M�9j:9�p�UJ���J��UJ�qpm�����q�q���/�ɲ���� XM=�+�ûK��ʘLAoKJ�=i]6��=i�p ��f�LA>�G_*=��LAw?Oq&�I��pT˳B������šqp�NL�&�¼̾�u�rR�q �?_ ���ʽ`�O��p�c�ʹ���c�ʹε�ϼ�=��C�ȳ��᳽����8��pE�¼ǵ�ɳ� ����͍t�FGƌV��H"������K���M�H$���o��M�����ǵ�>�GM�9�����>�G�LA>�G�LAG�cP��.���qo��$�pƼ#�U���p�ɳ8 ����C'9�oI�F6�oE�߷J�rR��MF7 < ��F7 < j�I�F7 < ����MƵ�w�� "HI�̳��W�F��Äp��ǵ�H��8W���8� �ɘoE�ý��o�J�8�o5����K�X�J�o����<�H�����^W6�Z� ��l������a���8Ų���C�rRE����Ì�!E�����GJ�\ ��\ ����oLA$<�}����D�p�=�?�…W��\�7���C��qEK�v �M�9j�9��w�J?����4���%#$���0� }��ƍ���>�G_*=C�>�G�4�FƸH���n<�oE�H"��tO�j�Nɳ�H�M��1Q��ɳ�H�V�q�E�� ��oLA����<�H���M����<"[������M ¼_*�˲�pm�a���RyB���ǵ���%�;�BbŷI����������I�ʶ8Vl�j�����˼�M�qpE�3�����1��Yȳ��rRL�p������{)���MGJ�ɳ�H�M���zGʹ�H��¼̾��q�pE�¼ǵ��òȍ�þ&�I���L���ƍ߼�$��! ���_��ż�r�����K������'@H`ɘ����^Wò5���ŋ��G�c�ul���o�r�E���ƍ ��M�ʡ�����������I��M������o<���Ӎo�q�E���ƹ����*����pH��¼̾�as�p$< j< �Ų5����\ ��)��cM:9����(�F@��>g�v �Mþ�yB�t�L�κ���oe���H�o�; �:��8�I �ɳ�H�MI���$��÷�I����o�M�������FI�������D�Ȳ#���˷�M�-,˷ƍp�q�����Ƃ�M����F�)-�ʊ�t�EK�v �W6�ZVC��������LAD$M����9�� K,tV��� $�J�I�������t�L�Lq��<��ڼI�Z�rR��8�E!�������Vli�F�@M:�������� ��ʹIǷ9�KƷJ�M̘����^M�!C�}��^�ɳ�H�MT˳B�������M�?�>�X�t)��cW��ȼ�MT �ʺ?%��ȼ–ɳ�H�Mɳ�hz�K������;����ʽ`ɹɳ�H��o�/�XPȳ��p��e6�wò�q�� �- ���� ¼�=J�N�]��ɳ� ;U�@�&��ȼ�Pg�6�Z��N��;bP��)6�Ų�J���o��3�Y�ʺ65����?��tOq��M�!CWl��t����J����M�>�9���q�]��ɳ� ;����ij,����ij�⻸۷�$�"���ǵ��H���4< M�I͹��˳BWL�LA�r?Y¼H\�pEi��qtɻ&�I�Mμ�F�κ���p��ǵ�r?Yi��9 �pE�H"�D8�G�q�]��ɳ� ;�ȷ��=�ȴ�ȷ��=�ȢE������k��ɾ��K�7����JY���?��J�o���1��_ ����W�/=�s�%Ƽ�h��9 �>8M������ A� Y�E��p ĚqEK�v O�~�CM"�ųǷI���~�������e��$������M�9j:9�E�~�CM�9��FX6��o:(��p�����_�������̣�p�; @M᳽c��"[��*=CM� ���/*=C���VC���=J���8�p�H$�o���p�=6�p�NE�H"�KƷJ��>8MIQ��G�c_ ��F����IJ;�I:��p ��f�L�Pȼ�O��KG�Ųȼ�M�qo���o�� �����������û��S=�M���čEK�v �V ��_�� ���  �����ô ���sMX�� ô��G������/�ɲ���/�ɲ���LAsM7%�ƍ�E����M���čo���ȼ������M��s�F`+�9����E����M�C����߷�Ȣoķ�ɼ �����2�@�?YI���s�Z"�����2�ʘ�ڵF���ǷƆ���ǷƆ=J�o�F¼�� ��J<���M�$��Fž�ǷƆO�� �fG��o��˳B�yd��p��ǵ��8O�d��h��@#��c�x@P��k����k)<M� X��8��{�NS�Ċ�I�F�C�����2��7KdVȳ����ô �LAD$M����9���\��H ��qo���0� }��ƍ���%�ŵ ,>�GP=I�Nt����ȳ�Q����M=čpI��ƍ�<�HjǺ�p��H��ydC�qp���LA�E���ƍL����0&�I�Mɳʖ�o��J����8��F�ô��t���� ��J<����N��>�9��ȳ�Q�ɳ�H�M #ȳ���IJ�o�����q��^�̷��}��^��GJ���p:9� ��γ�(�p���ȼ��#ʺ6��E����M IJ���������D�M�H$P�~���p�No�M����&�I�]����p%��ʴ���p�M��F�oɷ?��:� �o�ü�J�8��{�Nt����@ʿ�û `ɲ�t�rR>�G]�����[��܂E�~�CMᵲɲ� ���o�`?%�4E�@�e����]÷����p�NL�M ��V��g�F����q ��MGJ#���oe�E���ƍo�q��� �J�oEK��$�rR5Cgڳ?�ɳ�H�P�����ɳ�pH��¼̾�as�LA�M ��p?�ɳ�H�M �8�u�o�3�Y7��ȳ�I��ȳ��oI���3��pijGJ�p)��ɖLASL��[��܂s]���6�p��r�S�����r�S5�;�u�LA�Nɳ�H�Pʽ ���s�L�j!C�pwò�:����LA�>g����W�I�MǷ��%�І�rRJ����1���%�e���p?�pȷ��=�ȴ�yB�������u��/�X����̲�ȳ�Q� �8�o��1�o���K�c����K�c�pK�X����*��M�����������N�H�E���rREI��)�>��8�ow?��÷�}��o� X�t�����q�>�9��L��Ĺm��e��>�GW�F�p���7%�ƍ�sM��JM��J�p� ��qLAD$V��ʄ1��_ �����Ƽ����Ƽ�LA$��!C����=.S�N��M˳�ʸ����CƼ�F���I�oɷ?��:� ��{O���ƹK�÷K˖pE���ƍp�%0_J����No��Mȳ�I�����L?�����L?�������������Lq�L�o!�̳�ȼ�ɖpȳ�Q�rR�>�9���=��on4��CM�<���÷I��<���÷I��a9@��t�pH��¼̾�as�oE������ �H�oK�K����p:-J���sV��ȷ��D��PG���e����W�¼̾�as�S>�XM�*�X�SL?���MGJ[�׳���!ȍo������ot_*��6�糸Q���I�>�G��p��4#6�o÷�i�ʹi��o�J��%� K�p�q���M�qp�N�� �&�I�VC��o�s_*�p���-G�� K,!E��ô ��o���͹�E��J���o���*����f�o���=�Þ�{�N�����І��OK@�?YKE�����o�4�F�t�L���=�qoG�c�p�<�H��pƵгe��o��C��pv�>�"#�����C�o��–������@�����R�V�����p�� �o¾����o�� � �o�=����й��4�o�/�X�;���rR�qr���F��X�pJ�8M�q�5���psM����<� UJ�qp��e6�wò�q�I3�3��ɳ�H�M�������FI���LAp��P�I:�J!�9dC�I:�J!�ȳ�I�9d��o�qLA ��9����˳B�9���¼���T˳B��8�D�����Ɓ���w?����>�X�r�����=.��I�Ks�D�O�j�<��� (6���GMDQ�FI��>�G������� ��ʹK��MFI͘�E��p��U���MF�÷�����6C���K�P���k�J�oD����o��Mӵ�1@��9��„L�_�J��O���ûKŲȼ�ŵ�dC���@�rRJf�����>��J�����^MT˳BM�qo���>�r@MprR "^_�����)6�ȳ�Q����G�C���;bMe+'?�@�os�hzM\@C�hz�t����M��ʹbM�9��;����ʽ`�O��L�_�J���qo>�(�D<��o����������T��BVl�ju�þ�l����LASE�~�CM�9��=J������� ��ʹ��� ��ʘ���ȳ�QM�H�G��J������ �O���I�/�� ,��F���?C����ǷI�MF�F65����p��H��ȷ��=�ȴ�yB�šq��M� K���P .�o�No���K"������*����ɳ�H�M�s���������N������ ���&��YF�F���5����̷�$�M~b=J�Bb=J�oK�� ��3��� �`�H��S�^MT���%' ��l��p9����/�� ,��ǵ�sM�M=J�pIaC�E��qp`X��ȡpLA�����K��I��NoL��7Kd��V�� K,ܾ�ô�L�M�9��T� �q���ȼ����v �Mȼ��osP@�?��H��7�����o�>�9��;���T E�� "^����E���Nx@_ô��Ĺm�&�F�EK�v &�I�M�ǷI���Mn4��C���G���C���M�s�o��M?C�����)6��ȳ�Q�o��P� �K���oLAK�����wò� "^�o�� �&�I�M��@�t�ȳ�I����P[����q�� ��÷O���� ���M�G�� MIGB�IGB����E���N���E�3��oLAGʹ�HG��E���yB�p��M̳��i�ʄ��MF�÷�����6C���K�MF�÷��T! ��E����>�X�p�H$�u�wò�q���J��Nȼ���E���K�Ծ����0� }��ƍrRi�����N�sMx�DOi� �K����������˵�И̳�D�ɿE���ƍo��ǵ�v�>����N��Pʽ ���s���MG���-g����M���KB�E���ƹ��\Oq`�������No�x�4 �P4�&L���E����O���������������%^ʹ��:9������G ��&��?)�Ė�����P���âoZ�JK��o=�< ����L?��t� �ʦqEK�v ��!�`�)�����H-C��G�o�E�Ʒ��"[��*=CM� ���/*=C��l�jE����=J�^�oɳ� ����oLAþMþ�J�I��Ʒ���UJ�þ�J�I��Ʒ���UJ���^PH���PH������I�x�D�D����=.S�Npȳ�Q�p���ɳ����ɻO���-���ȼ�9����sM:9&��\�����osP�dC���FGƌ���#6����x�4 �x�4 �Me�Jf�ȼ̈��þ�0���t�����L�ȷK�V=i�TǷIjs�� ��ȼ�MN–��MٳGBѾ�HG�ַ���osMǷ��%�������>�9��Ĺ��6��s��������ćP ��MuP ��G�cus�¼�Dw?5������HF����o��\�˲CD�9�p�/�X�o��T���Í���*��MDQ�F�ô����o�ȳ�QM "^_�%���o�p��8���:9���ǵ�:��o��²�oE����MT˳B��oE���ƍ�����ćMFGƌ_��FGƌ�s�L���E�3��L��Ĺ��v��KƷJ��LA�sM ˆ���ɻO����J���FI�����8"����r?Yȳ�ij;�r?��o�3�Y7�)8)8���P .�t�K�÷K˲�t�����7 �8�n��7 �8�pȳ�QV�J���1���o�͇M�H$�; ��oʵʲ���� , ��M$����N�E��p1�C�K�(�����o��M��@��J-(�4E����yB��< ��{�N��ǵ���J��Ż�żQ;�K�Y �?6�pD�9j��D�9�o(�Z&��Y� �6�oLAu}����D�r�����=.��I�ճ;bݾ z�l��pTǷ��{�N�{�Np����wò�:��qrR���];[�CJ��E����M��6��9���{�NpT˳B}��ƍ��qLA>�G_*=��rR�>��M�>���K�Y���V�q�YT� ��D$� �ȍoijM�CƼ�9߼�$����`ɜNo��V��/�� ,����Eû9����L?��K�Y���V�q� ��J<��3/�p�N�qp�N%Ƽ�h��9 �pH��¼̾�as�q���I�ȴ��=i�t��FGƌ�ȼž��F�rR�^P ���L?��L�MT����R�q����2�@�?YwÖ�{���o9���'>ͭ��\���öɳ����Y�qon4��CM�`��s�ɳ�H����K����NShz�hz�t�ȳ�Q��q�������Ij�^M���FǼ?+�^��2�wÖ�����LAS˵ �|��Y���?����9�&4ÿt�oL���(�p�� �p�� ���P .�t�K�÷K˲�t������� ��ʹ��� ��ʘ�����M�:�糵I��˲����H���O����M���ȳ��ȴ�ȳ�����=.�sMe�:9�G��̍oE�������r����9�&�I��t�E���M��r6�s��o��F������E��þ�@�&�FOq�5���)6����4˹̳:��&��Ye��>�9��M�6��>Q���l�F@�̍o�ȳ�3K���ɾ�̍��M�<�ɳ��H� @�o�͇M�H$�; ��rR�ȼ�Me�༼���sM��Mx�D&4ÍoEK)ʺY����OK&�I�P �Ņ���� ¼�=J�Nt�� ��?C��q�GJ=i��<�Hj$-�}��Ɓr����M�¼��÷��M����=6������Qŵ����S�^M����rR�ȼ�P����;�>��@�?�t��������tM��t�p>�X��H�E���p��H�������hz�o��ȳ���M�F����K!��p< Mij�6g�����2��7Kd_��Kγ~���o� XW��e��� X�p�NpF����T˳B�oL�3���9��?C��9��?���{�Nt�ȳ�I����P[����qSX�@>�r���ճ;bMѾ%��MѾ%����Z�EK�v �M��F�C;M��F�C;�ŵ�;���o č�sM ��_��� ���4 H�ɹ�4 H��� ��J<�ofB��ܹ�!������ȷ������c��ٳ�Ἴ�M�*�l��h)��#��EK�v �V ��M���-G� �?��ô ������v �Mx�˼������o�>�9��;���T E�� "^�pF��]�!�&��\��5������_���m�������Ci����M=č�����<�&Cɳ�'; Ŵû `ɜN�������V�ĹK��)��8��oI���3��˲U�<�ʂS˵ �|��Y��|�oFḮ���I�f�`�EK�v �]�!��\ ���n4��C��ô �o��O�j8����F�ôl��pI�U�K��������I�ʶ8MI�ʶ8��˲�@čLAS˵ �|�Fk��@P5���:��a�o�¼��o� [���=��E��p(�Z���-����sM���M���bż�ʈ�o;����� �Aɳ�H�V���LApE�3�sM�ô �s��T�K:������Qŵ����SE���ƘLAo�^M�%8��D�-(��%8�'��-('>�K�7%�ƈl��o�x�4 �Me�Jf�ȼ̈�oL��Ƿ��%��@������MF`+u� ��'������2�O�j!E��p;����ʴ�C#6��q���sM��Vȼ9��yB�tFɦqT �ʺY���H�V�q��NLA��M��pD����F������MþG�Gʹ�rR�^MI���G�c]6�V ��� ��pwò�:��qLA��8�YmȍLArRSfB�L���ͺ�B���-G�Lq�ټ��@�þ�L�j9�C���Mٷ�D� �d��EK�v �M�ǷI���ǷI�� � ���LAo�^Mee+FI͈l�����&CƼ�w?���ɳ�H�]� E�����!ŵ���ĹQ'Z��Aȳ�Q� �'>�Lq�� XV��3��S ¼�����E��o�q����MDQ��LA���6CM��6C���FI���M������oEI KM��I��J�˲U�<�ʂS˵ �|��Y���?��sV�q)��LAps�ȳ�Q���˳B߼�$���� ������ɣ��"[�ڵF�*�I:���>��;�������`�ʾ >���@�rR�Mi��t�D�������q�GJ�������M��s�F`+�9����ɳ�H���E�����sV�� �ò�� X��ô ��������Ƿ��v #6���W@$}�=B����\�D$��ôʹ�q�"[�ϼ�3���M`�s_*`�s�o��;��{�NS=�M!�ȼ������e��$����J#6���V����<ܾ�������O�jK��l���9�(M(�Z����@ʁ���J����I��`+GJ��O�� R ��o ��� ��J<�o��^��ʸ�ò�G���l��o���� KMe�:��oD����o�L�E���ƍɳ�H�M�F����K!��L���qLA�M�k���Z��T�<���1��9��� ��¼����q�]��ɳ� ;U��� ����(�ݾ߼����⻧���NL�_ô�i?��>�G�EK�v O-�&Cɳ��v �ȷJ�3�Y�9�(VC��Ɓ���p����8ͷ� ����LAڵF�*��M����������D�9�oD����p$<��D�ɳ�H���o��M?C���_ ���ʲ����1@��9O�~�C�t��sW4ÍT˳B��p��ɳ�H��qoLA��� GMG!�[Q���MG!�[Q��–�p�����p�M�� ������ûK��N ɳ�S��M���M�X�����oɷ?��:� ���\���Ǽ �#<��R�q���¼̾����Í���8�>8_ �O������ YE���o��<�q�LApe�¼�?�EK�v ��!�`����JZ�GʹŅ�oHF�̳:*Oq�5�����ȷ�I�z�o ��M�<9�LAw?Oq��qoT˳B������MG��#��8��V=i����N����*����rRK7�o�� �ɖ��Pʽ ���s�p��J0B�o�� ��÷�x��Mx�D�tOKOK�t�pe�o \ ��o�P����� ���������� ���� "^�o��M�ô �Mv��ô ���>gO���ƹL?���V���KE����FI���E���FI���!E��ćM8��>3/�rRFk��@_ô�i?��ps_�%ʲ���wò���K"#6����P�L�j!E�śqLAo�^MC z�I�?C z�I�?+�F�l��o�V���vg���ǵ��avg�����m�E��G����ȼ�LA��NEK�v O�~�CM����@����(�F@��>g�v �M���:�l>��LAo�^MC z�I�?C z�I�?+�F�l����M߼��[ڷ��8��� �� ̮�FGƌ���G¼̮���K!+9���C��˜���sM���%�FI͈���MF�÷�����6C���K�PG�o�ȳ�QM "^_�%�������ȷ�����E��vg���ǵ��avg�����m�E��G�o�=��ǍL�M��ɹ>�G�˲U�<�ʂS˵ �|��YEi� ͍t����M���:��t�p$���>��8�����^_d��o��p ; ����@č�<�[#���M�F��F�o��²�����MDQ�o�<�Ƶ�8��F�LA��V��H"�o�0�p ����qp���}��ƍ��M׼­��MǼ���u�Fɖp��I�qp �8�u�p˲�K�! ��C�B�澻�̳��W�F��ÄK�+ȳ�Q��At�o����@�����I�T�Eq�5������˳B�1���r���ճ;bMѾ%��MѾ%����Z����L?������ ��MGJ#���o�ʺ�p%��ȳ�I��o�q�¼���o��Vln��On���������p�F��K����q�LAp���͹!CM�9����p�jyB��>ŋ�����v �M��C��LAp���˳B�"���ǵ�u��8�< Mu��8�����sM�%g�G��o�EI����$< �ɳ�H�_�/�3I�o�����Ύ��÷�������ڼI��ȳ�Q��ȳ�Q�������̵�8��sMx�DOiOi�u�L�EK�v &�I�_����ǼG��K����ڵF���ǷƆ���ǷƆH F����o�D$_*&�/�M8�!�S��"��oJ�8M÷�ij���M�9�pFE�D�8����wò�q�!E��pHF���4���M|'������qp��H��ȷ��=�ȴ�yB�šq�V�� K,���γ�������MNˆ��osMF7 ��yB��oEI�W�/��qL�Pȼ�O��KG�Ųȼ�M�q�V��~'>�No�L��o�� ��÷���,w�op�����p�o�ô ���q"���ǵ��ò �8��~�C�pwò�:�p; �t����_*=C²�J+t�LA ��9����˳B�9����>�9��L��Ĺ1��M�~>���������D�M�H$M=J��sM�F�����M׼­>�G_ôȍp�M�<� Y�ûK��<� �S=�M���črR�ȳ�Q��F��"[��� ��M �ɿ�� ¿%�t� ���D�9��q�������T��BVl�j����þ�l���L�j9�C}��^��OK@�?Y�r?���I�x�D�DM�FI�D����*��M��˳B��LA������˳B�s@�Ծ���/�� ��t�LAsM/�� ��7%�ƍw?�LA�N���sM� 9�ȳ�I���oI9-%��@����{�N������ ,���D$�oF���ɻO��߼C�ȼ�9��LA��û�ŵ��û�ŵ��p�M��J�������p ��u�9�����>� ��M ���ȳ�Q�o�$�o=�ģ����ǵ����X�oI�� AL�Mȼ���@MFk��F��H�E���oD�9j���L�E���8�0��p ĚqoLA7KB�rR>�X��{�N���M�?�>�X�L�~�CM�>��B�p=J�u�1��YEq�5����1���p:9� ��p�Np��F�L�����>$��TǷ�oE���ƍĸó2F�P@�?� YLAr?Y�ž��ō������)<��CM4�L�p`X�(�Z ��K�Y���V�q�fB&��z�T� w��E��ɳ�H�WF�H���{�No��]��@4� ��)�!�@}G#���8���.�ɳ�H��o���o�q�LA�*=CM� ���/*=C���VC���=J���8�p�N���vg�K�C�N�LAp���G�⻧LA�>g��˜oK�X�Lq�ټ��@�þ�p/��#����"���ǵ�;�K"@RF�F+K%�����2�&�I�M�9���ǵ�sMT� +w�No÷�M�ʺ[F���˲U�<�ʂS˵ �|�Fk��@P5���:��a�LA����8�K�X�����öɳ��NKs��>��^MT˳BO���oHF�̳:*Oq�5�����ȷ�I���ɲ�Q�H���<�ȍoEI�_^��7%�ƚq1��_ ��˲U�<�ʂS����� G��]��ɳ� ;�m��І@���þdC_���9����8��������d�Ij�ȷ*[ŵ��K� ��8��{�N�{�N�ʣ�����LAS�N���v ��c��v �JK���FGƌ��ʾ�3�Ŀt�t�I9-%��@����q�q�OKO������������ǼG��������'����ǼG����p ��8��üG�=�<-Y9�(Mγ�(�o�7����pTǷ�p`�p?������o���O�� R �����C�NEK�v �V ��P��$J�� �����o�E�H"�FXaX��J���oijm��ja���LA�L�onO����� ����â�E���ƹ�E���LA�*=CM۳��@���/*=C��*�l�����p�jyB��>ŋ��L�����H$�rR�q����/�X�����*�������E�3��q�qLAo�^M�%8�g��%8��9"�3� +7%�ƈl���P5�Mϼ�3�ϼ��o��[�p� ��q���I� ���o�Ƶ�4ý�LAo��P <$� >�J�LAo:9���ǷƆl�����ķɳ̵ʜN���˼IJ�=J�M˼IJ�=J����ǵ�ȳ�Q�Nt����]�8����@��t�D��M � ��%@��LAS˵ �|��Y��|�oLAL�&�I�MG!�[�Q�����V���ߵ��p�N�FIͿt��������u�o�=�r�����=.��I�K�@4��9 ���@4�γ �Z�pL�ٳ�g4���GJ[�o�3�Y7�)8)8������Qŵ����S�^M�����F���IV�q�5���5����SL?��oI�� AL�M�%^��\��CM��@MD���c�����@� �M=�M�1׼�EK�v O�~�CM"�ųǷI���~������H�?��,�%�e��8����EK�v �M�ǷI���ǷI�� � �����>�����M=G'L@�tO�� �� ��qoE���ƍoLAL�&�I�M�>�9�oE���ƍ���E��p�%ɣ���ǵ�sW��.e6�o߷²�M�*=C��l������M=²�_*���Nɳ�H�M4Ez�yB��� �&�I�M1�X�rR�ȼ–p�=Ys��@k�І����sM���o�"������� ��� .8���"[��*=CM� ���/*=C���W�F ;D�I3MǷ��%��@��ʹǷ��%�У�EK�v �V ��M���-G� �?��ô ������E�~�CV��M�9��N��� �9��r��r��o�q���>�G_*=C�>�G��������>�GV��]6��>�G�t���4@Mas���4@�qpȳ�Q������_d�ʹK�!��� "^������˳B]���6��žý�@��]��ɳ� ;U��� ����(�ݾ߼����⻧oLA ��M ���I�F�C�yB)����I�F�C�yB�`�H��S�^MT���%' ��l������ Ė����2��7Kd_��K������������P@�?Y@>��'9����ǵ�L?��r�����=.�HF�!E���Oi��6�����ټ̾�����>�G_*=C�>�G��{�NoEKO���>�9�LA�S>�G���� �����ý���G�F�o��`�H��r?YZ ���r?����7KdM�<�;�7Kd�o�q9���p�M7��M7��� þ�p��ǵ�sMT� +�����;��������IJ5��CVl�j��IJ5��Cl������3�YH�M:9�ʣ�r�����=.��I�u�7KdM ��8�� �p���9�p�N����[D�O���N�LAp��)<��ܾk�û�ݮ�� , ��M$˳B��>˳B��4�4@;�����MsMDQ�u���������$��uŵ�����NEK�v &��Y���o�qp���D�Ȳ#������v �M��pE������C���_���������LA7KdMü�<�Ș"���ǵ���J�"κ������N<�����ɳ�LA ��O��ȳ���oLA>�GP� �!CM�º���ž��oLA;��#ȳ�E���ƹ4ǹ������$�L?���ڵF���ǷƆ���ǷƆH F����p< Mij�6g��LAϼ�3���M`�s_*`�s�p�Np�Np:��p�qt&F�H��qoLAL�&�I�M ���%�ƾ�����2��7KdMT3�������^M ��:���{�N��I�ćM �s��I � "8s�o��&�I�WZ��; �EK�v �M$-. ûJ�� ͍����ȼ��ȷIȳ�� �6�����"��n<�N�{�Np��6D���ȼ��ɳ�H��L�jٵ�� ��ͺ�B���-G�LA����ɳ�LA ���Ĺ5�c����˳B�I�����ô �����p����8ͷ� ������sM����Z��s��>�G_�����1�q�E��p����G;?@��]��K�Șo�L�LAS˵ �|��Y�z'>9�¼�P���_*=C�o���]��ɳ� ;U�@�&�I�M�׵��pZ�p��4@_ �������4��oE������7������8�o�ȴ��o�=�p�������sM��6C���������9j���?��08�NoI9-%��@���EK�v O�~�CP� ��~���o�x�4 �P4�&L�����!ŵ����F�HC�����<�ȜNp�N�LAp��)<�ɣ���M��o�͹�M��� ��:�œ���O���ƍomȍo��M8�[��÷I�̳��@�D����MǼ���u�Fɖo�V�� ��Ĺ̲� ���� ��J<����J�����I��FI���I�FIln�Ò^����L?��o��V��/�� ,FḮLAD$MĹ�ʄot�FGƌ�t��5���&��D�ɷ��t�T˳B����qrRr@��J�������F�� �O��?C��LAp���G�⻧����M!ɘoɳ�D��ż�r���MF7 ��:�?�p��H�� ��H�ɲ�hz��ʣ����!�L?� �s�p�8��L�~�CWZ��?C���W�/�M�K����[ڼ/��̍��I�x�D�DM�FI�D���ǵ�>�GMFI��>�G�EK���ǵ�FX7c��<�Hj>����V�� K,�7���„t���P KM���D�J��q���L�LA����)���V>AFḮoFḮ�>g�L� ��V8#���o=�<��ɳ�H�M�I� �ɳ���K�o���%�e�CM1��ò�C��%�e�pr����� ��J<������*����o>�GM�qpTǷ�t����ȳ�Q�t� �qoƵ�1���o��qL�~�CM� (��ϼ�~���LAsMu��D�ƾ�εϵ�D�ƾڼ/�GJM���#<��@�����У�pK����o�M�<���÷I��<���÷I�oFǼ�FǼɞ����Ĺ��� �F�Ķ����ǵ�>�XMT� ��o "^M�>D$��"1��^�LAS˵ �|��Y�z'>9�oF�ô���o���� KMe�:��or��oLA9�CP GP�ƾ���ƾ��E���ƹ;��C��Ɓt��%�e��� �H������ŵ��O��F'�u�����V����o�͹�M��� ��:�œ�ɳ�H�M��ƾ��LAsM �� ͍߳��rR "8�H$�p���*�����K�� (6�p$< jv ����,G�cMsMFI͈�����O�j����o���L������črRe�ڳ�ȼ–�������FI����M7KdP�~����9 �rR�ȼ–���@>�� "^�p;�H�����%�ŵ ,��MQtŵ�ƾ��OKO������O�3� ��'����������3��J�'���������-G�NL��A ��P��8�����o�@������rR=�Vl�FR5�cҼ���p������ ���� "^��{��6 �5�LAs_*=�������� ��ʹ:�,5u�,D��N�P&�F�osM÷������>��q� ���*����EK�v &�I�M�!��K��p�o��OK��$�Lq)<��C����u��8���� ��N�W��\�KCM�9�o�ȳ�QM "^_�%�����̹��9�O�j�F�o�͹F�âr���ճ;bM��¼ڼI���¼ڼI��^�p �8�u�����ȴ���T��t�L��L��q����\�]�7KB��C�u��8�L�P��(]G������І��qo�� �&�I�M��@��ȴ���D����I�g4��o��\�˲CD�9�rRp ��Mv�"?;�;��o ��UJ�oJ�p ��p�������ȷ��o���F�o�� �� �LA��J��)-�$������òȍ���3�Y/�� ,s_�E������2��7Kd_��Kγ~���pD�!E�P@��TǷI��95�����M�<�ɳ��H� @��{�N���ķɳ̵ʜNɳ�H�_ ��K��K3G� �LAS˵ �|�Fk��@P5���:��a�pL�LA>�G_*=���>g�śqo��]��@4� ��)�!�@}G#���8���P@�?���@�%�ǽydCs�p�� ��h�p�N���sM���M�ŵ��ȼ�� ��ż�ʈ�EK�v �M�!�M�!�� � ���"���ǵ����@ʿJ?������X�����V��~�CMT��J��o��<UJ�q��W@$}�=B��o��M�ô�âo�!C���I�ćP �ò:���I ;ȳ���; ��s�LA ��9����˳B�9��o���D�oD��ͷ�t�ɳ�hz�K�����s�qt����ȳ�Q��Ƽ����L�ż���pK���E�h����MF7 ������M��s�F`+�9���r�����=.��I�u�7KdM ��8�� �oiM �J�tFɦq��ǵ�>�XM��J�Nvg���ǵ��avg KK7��N��M�þ�6��p���p�qp� ��qLq�δ�Iܾ��9����DC�;����M�!ȞEK�v &�I�V��� ɳ�So��M���M�X�o̳�&�I�� �����8"�on4��CM�`��s)���$< �t����M IJ�t�p0��3�����<(��4 H�ɹ�4 H������oLAɳ�H�V��H"�D��0� }��ƍE���ƹ�{��H�p�N�E�������M��6C���Ci�oE�� @��Ɩo�/�XPȳ��LA�L��LAe��x�̖S�NSGJMT#6��K���̳Ă�M�9���MƷ��Ʒ��LAo�^Mee+�C+sl�����L?��M�9ju��4 H�ɹ�4 H��� ��J<��FGƌ���G¼̮�GJ�q`�������@�?Y��@�'@��J4���M(�Z���-���t�ȳ�Q��宴� �O�����Q��²�o(�ZM�ʴȨ���M=J�u��]��ɳ� ;� ;��V=i)����o���͹Q�H�� ɳ�S��M���M�X�����pn4��C�ȳ�Q��LApTǷIjE���G�3/����X`�rRC�۵��ʾ��p��4�C����č���ǼG�No��M�>����L�ȼ�rRp ��VfG��9����>�XPȷ���>�X�Lq�:�$�oijm��j��b�ijm�����q���P�LAȳ�QMû��E���ƹL?����� ¼�N�2�wÖo������5�Ik��T����r���J���LArRS��8��o�GJ�6��1��Y�õ��>�GM�qos�hzMs�hz��T�����"[�ϼ�3���_�;s_�;s����8Ʒ�C�%8Ɔ�NoD��8Mj\ �pȳ�QM�H�X�ȳ�Q�E� ��¼�;E���X�o�� K,T�K���p���;���÷���#�Ėo�ȳ���rR���=C_d�9��oJf����7ý�o��L���q��P .�t�ȳ�Q��>g�����sM�9���^�LAS����� G�"���ǵ� ��L�j(�Z'?ɣ���ǵ���N��ǵ���NpE������ �H���I���}��ƍx@P��k����k&�I�P K�H F�p�@ǵ����І�o��t����������N�����%�Ms��(P��(�P=I��9�(��o��ƾ��������M��J��˲����P�LA>�GM˼čL��3���q�Q�CUJ��<�Hj>���LAS˵ �|����5�c�LAs_����ôE೺��6��̍EK���ǵ����@���˲ż�-I�=�<-Y?M����E�~�C�ij Ƿ��ɳ�H�M`X� �6��EK&�FOq�5������������&��YEK��C�E���ƹ;��C��Ɓ˲U�<�ʂS˵ �|�Fk��@P5���:��a�ť�ǵ��>g�ȼD$�9�(M(�Z����@�ȳ���p��H�������hz�t�� ô�q�"[�ڵF�*��M������o-��oI�� AL�Mȼ���@MFk�o��M8�[��÷I�F��U�ɄrR�M�9�����^MT��B�I l��oTW�����T�p��H��ydC�q������ ���&��YD��ot�FGƌ�t������� ��ʹT˳BMv@Mu�o0��o�<�3�9��%�e������J���E�3��Ĺ�3��3�StO�h�¼�4g�,7����t����� ɳ�S�A ��MI���LA�SfB�ȳ��o�͇M¼����o9��ȳ�Q�Ž��-X�rR�ȼ�_���9��༼��o�ͽ�ȳ�Q�psMD���I�V �� ;D���Ds������F�� �oʵʲ���A ��M?C��l�������O�j��ĹK��)��8l��L�)���M��C�>�G�LAsM�9j-��'��D��oLAþP GM ��MsR7KdM �������s)��������q�A�; �o���r�����=.��I�ȷJ�O�j�J���ٷ���l�����LA ĜN��������(�Np�TǷ�r?Y!�� $_*�t�I�s�qpȳ�QMij��� ����L?���3�����sM7����C��p3/�M˲C�3/��W�I�W��\�絲ϼI�����tMsM¼��M:� �¼̾�����Ci� ��M���#���LA�SL���ǵ���Np�-7ý��QSp�-7ý��þŵ/�X��qoJ� r���ճ;bMߵij�Mߵij���l��EK�v ��!�`ɹfB��z�F7 �EK���ǵ��a��L?�� >Oi��6������E�� �9�@>������^MDQŋl���pT���L�p@>��qpu�KƷJ��pI�U�K�1��YE�~���o¼�����������M�ƷJ@���9��L��� �UJ�� ���̳��K�6��E���ƹ�E��EK�v ��!�`ɹ [l���������V�ĹK��)��8���� �O���I�/�� ,��F���?C�L�j9�C}��^�o�%����ýģ�ow�p� âS��F��AI��̳�r��oLAK�����wò� "^��!ɼ��?���"8��6Y���=.�D$���� ��"���ǵ��H���4< M�I͹��˳BWL�LA��M���?C���o�>�9���*=��ɳ�H�P��*����؁oLA��� GM�9j�9���sMx�D&4ù�����I��ʡ���r?Y9�C�r?��{�Np ��M� X�GJMI��#6��GJP�¼������p������ ���� "^����K���No�q�˷�9���>�9�oLAþP GM ���F �)����F ͍p��H��ydC�qtOI}Gʹ�qEK�v �M�9j�9�'����li���������MD<XMu���\�����K��qp�q�� , ��V�I��ƾ#������;���(�Z����<�Hj��EK�v �Fk��@V=i�Fk�У��{�N�F�p�T˳B�D�Ȗo�5���O�-Y���Q�p $V (6�qѲʾ�ڳ�ȼ�ɳ�H��p������2�O�j �����I=���"�������)6��ȳ�Q�o����̳:*� ; K�r���F��GV��~������W��[�KE��W��[�Ǽ��'���������NLAsV�9Mδ�I߼�ܾڼ/����9�������sW��MFI͈����>�GMDQ�u�>�G�oH��tO��9 �q���/�ɲ��O�j �����!E�7Cl���ȷ��=�ȴMȷ��=�ȴ�� 4���>��J7�oLADJ� o�5��������Z�psMD�����������ż�-IM� XM���'@�C��� X�tɻ&�I�M�%6ݻI�κ���LAo�^M�%8�&6�Z��%8��Z�FI��7%�ƈl��tO������qKs��>��V��� ɳ�S�A ��MI���̳ĹSsP� �F�ô��p�_*=��o��qo�ȳ�QMv �M:��LAs_���e+D�D��LAo�%8���'-�c�ɳ����w?������Qŵ����S7KdM������!C�No�;��ȴ���L�������%�Vl�����J�K��t����E�~�Cٳ κ��������ćP ��MuM����897 �s�r���ճ;bMѾ%��MѾ%����Z�EK�v ��!�`�)n�����LA�S�C�Mu�fB�D$�S�Ċ�I�F�C�LA����)���Pûʹ�� C�s���̹̳:* .̳:*�SLAsMG��MG����ȼ̍L�_*�ʹ�3I����3�Y8�&�I�M8��p��ɳ�H��q�������i@2�9Mi@2�9�Np��H���F��K����q���NœN�"[�ڵF�*�� ����sM���I-G��¼.o�No�V�� ���6��C����;����ʽ`�O��t�U��q�"[�ڵF�*�� �������sV���û�s�ow�E�3� .�t��$��t���M���?����ù����?��������üG��W�I�M� (�γ�p- �I�5����LA����)���V>AFḮL�Mȳ�Q��[��܂���o�0��¼���o��M���� �O�Oû9�8"�DJ���ƾ��t�ȳ�Q��qEK�ȴ¼��Ųo���M�ͷ9dC�ɳ��%���o̷�$�V���e���?ɣ�����"��n<�N��������>������ot_*�糸QM�8�<�κ������p��MF�ô��%�e�ȷ��=�ȴMȷ��=�ȴ�� 4���>��J7����e�#��8��F�p���*����TǷ�p��ǵ��8�IJ5��@ŋ��p$< j�G�� M�G�� )��cMij Ƿ�EK�v �P�� ����EK�v �]�!��\ ���n4��C��ô �r���ճ;bM����6�������6���l���[�������M8�[��÷I�2!��ô ��t�����^M�9�l������P�p�ǷM1D"��8�KE���<�pT˳B�K���qo ��>g�������W����L��L���Ƕ�o�F¼̍o�1Q�%}��^��¼���o�����E��þʹ�>�9���7KdMȳ��Ἲ?�r���F��G�hz�p;���Q��6�u#�������Q�=����ɻ5�M#<��[�鼺���F��l>���p�5���o��M8�[��÷I�T�K�:��o��H�XMȴ���F�ɳ�H�W�¼̾�as����H���O����M���ȳ��ȴ�ȳ��o�P����� ���������� ���� "^����v &�I�V����K��6����E�����Ǽ����<��[�>�GMT� <��[��>�G����Aw?�S��p �8�ȳ�I����t��(��qoL�3��D�%M7KdM����H�X�FX�%'!�Z_�E����I:���O��!E����I:��˼�M�qpm����p��X�K"@��p�q ɳ�So��M̷�$�WyB�S>�XM�*�X����*��>�GM�qos�hzM��hz��q�F���IV�q��4 H��� �8�pK�X����_$ŲD��EK�v �P����P������=J�����C�Fk��@M���Ğt��� IjGͽɦqLA�Ƽ��D��}��^����!E��o�E/�oLAT˳BP GM�� -%M�� -%����L?��L��>�X� ɳ�So��M���M�X�o�� ����o�� ����������u��/�X��{�NrR�qos��J�o�û:�L�M�����F���>�G�p��̵��T�÷�ɳ�H�M�ʴ�C�����o�K�F[���ǵ��^M�9����l��������� ��ʹ���&��Y���"���ǵ�!ŵ���L�M�9��� ����ǵ�J-(ŲEK�LAK�Y�N���/�ɲ���7KdMC� "����=�ȴ�p`X�����6�p��ǵ�þ�����~�C����@ʿ�DK���t�� ��?C��qLAp��p���ȼ��#ʺ6�̷�$�MGʹ>�9�)n>�9�LAL�O���ƍ�LAp�����ҷI�ճ;bԾ��8osM÷����uM�! ����M�>�9���q���N����_*=C��T�K�FIͿt�t��H��qp����T�K���oEi�����2��7KdVK7�������L?���(�Z�������ȳ�QM��ɳ��F¼̍��ô����E���NGJP�������P��&����r@�p9����/�� ,��ǵ� "8:���ȳ�Q�o�sM�÷���� ����EK�v O�~�CM�ǷI���~���:9���ǵ�:��o������o���͹�E��J���o�� ��T˳B�G�c�L?��o��M �ɇ[����J�I����p��H���F����K!�"���ǵ��-��÷�o9 ���IJ5����o2�O�H"Mͳ��G�ɳ�H�M #ȳ���IJ���ɻO���@���ȼ�9��p��I�q��\����UJ�FḮLAsMȼ'Z����P .�t�K�÷K˲�t��s�Z"��p`X����p ��:���ô ��qp`X�p������<��F7 ��qt�ܾk�І�L�o����L�M�%^��\��CM��@MD�����<��r?Y ;O������(��I����E��þʹ�>�9���F�ȴ��糵I�����V�q�L�t&�?��qp��f��q���L?��o@>��t����GJM:�H����Ƿ�;���Ƿ�;��L�L�����H$�LA�I8GŲû��3/��I8GŲû��3/�o���%�t����ȳ�Q�p�E���ȳ�Q�p������oEK��FX�o�������o ��M�<�[�LA��VCB���čo��]��@4� �ɹ1@��9��E���E�����w?�E�����I�ȴ��=i�t����ɳ� �Ų���ô�N� Y��E��ɳ�H�M`���ýQ�o�� ��÷O����F���o ��M�þd���{�N�{�Np�Q;MFI��Q;�rR�q�LAp���$��6�Z�����������������ɇ_d�KE������ ������ �� �� ̮pD�oֵ��{�No� ��Z���f�5ý�ٷKd��p>�X�p�TǷ������M���3K��>g�KƷJ�Ŵ��yd����W�F�������X��p��4#@�%��@�ɳ�H�M �8�u��F���P����� ��ɁoEI���M ���D<X�p7%�ƍ�{�No��FX#���o�ȳ�QM`ɖo�V�� ��Ĺ ��J<�p��H��ȷ��=�ȴ�yB�tFX�ij Ƿ�q���e+ ��9��� ��÷O���O�ý�����J��N���L����^M�i-6���^M�9��L���M:9&�I�ɳ�H�M �8�u�t����ȳ�Q�rR�o� �H��%�e�o�Ѿ�HCγ��4�o�pмC��9O���ƍo��O�����~�Cœ����>�(��qoȳ�QM�Ì�oLA������!C��8ž��?�MI���%�v�p ����qo��� ��м��`�H���M�>�KE�²�FX�!�EK�v �]�!��N��yd���ڵF���ǷƆ���ǷƆH F���������ʘoLAT˳BP GM/�� ,7KdM ���/�� ,7KdM ����Ʒ�����, ����Ʒ�����o�; �o�9�&�I�E��onO��a7B���âo�>�9��;���T E�� "^����i��o�>�9��;���T E�� "^�o�ȳ}�X�GJ�FGƌ�ȳ�QV�9�yB�oEKO���>�9��E�3����M=č������%�ٍ�!� ��L�Pȼ�O�������JM�q����öɳ��N�����������I�x�D�DMasD�E��`�H����M�3��K�3��K������@�?6���ǵ���� '����o�!��þ�ɳo��M���:��!E�U�ɄGJM8������ʾ�#6�p���}��ƍ�������I�ʶ8Vl�jFE(l���o�²����C�oE���ƍp�F��K����q���DQ�No�ȳ���=�LAp$�#� -%����˳B�tO�H"�K�@4�� Y�5���L���LA�5�]�����9��Ƽ�೵��γ�ּ����C�Fk��@Me��E�1�����������N�μ�k��d�ʇM2��cZ�2��cZ=J���p��H��ydC�q����VC��ƍ��ǵ��^M�9����l���p��Ƿ��v �psM�<� UJ�qpL�׵9ϼ��M׵9�̍o3� L�M�9��>�G����NE���ƹL?��t�ȳ�Q]��÷K�ȳ�Q�����O�3���:�ŲE�+t�o�>�9��m��e@��F�؍o�����o8�E�� �� �oɳ� ������M����@��ǵ����I�1��_ �����*��M������������2��7Kd_��Kγ~���o�9�&�I�sP@�?Y���K����ȳ��L�MN,>�G���M�8�t�� ô�q����ûʖ����/�X��� , ��W�I�#��������P� &c-%�`ɿ˲�˲͍LAL�O���ƍ�W��\�D<�8�K�Y���V�q�fBO6�pJ�8�÷I��i��o�ü�J�8����Fk��@_ô�i?��LAp�"��p�<���÷I�qo��T���Íȼ��F�rR95��t�1��6��V����-,γ~�C��ڳ7������"8��6Y���=.��ʲ����γ~�̍ �6��EK&�FOq�5������������&��YEK��-L�j���l���"[�ڵF�*�I:��Ƿ���%�І��p��H��ȷ��=�ȴ�yB�šqo�]��� ��r�)6��þ��>gOq)6���Nr���ճ;bM�>� ͹�>� �۳�ȼ����^�o�<���-��M1���G����0�ʁ�������n4��CV (+!�@������ ��LA7KdPʾ��ô ��LA�SfB�D$Mȼ����!ŵ���Ĺ:� �!C�Np�� �K�Y���V�q�fB�����9����;��GJ�ȳ�Q�L��÷��{�N�<���C��ƍ���3�YTGB�����M:9��<�Hj˷�C8��F˳dC�r���ճ;bMѾ%��MѾ%����X����*��M˲�������I����M��@����p$< j< �Ų5����\ ��)��cM:9����L?���D��s���D� LAsM���X�q�s���op�HШ�L�M�%^��\��CM��@MD�����<���E���ƍr�����=.�7KdM ��H�ɵ�8��9��GJ�q`��^M�9�KIk�LA��^W�F��OKO�������'Z������'Z��t�p`X��ȡo�3�Y9 ����,�����=i��ƍ̳���Oq�� X�o������!��t����_*=C²�J+t�o��M8�[��÷I�t�FGƌ3ɳ�q����8�Np���*����TǷ�sRL����l�������C�w��o�� ����avg)<��C�NLA��M�̍o>�X�rR�q��M�s�p ��P��D�Ȳ� "^�������D$ż�r��ɳ�H�M ��H�ɲ�rRHXkMe�)��?PD�9� �8�p�H$�u�wò�qo3�YLA�qpm������EI�r�������@�Nr���ճ;bM��¼ڼI���¼ڼI��^�EK�v O-ĹI���=��� "^� ɳ�So� ���!CMasŲ�� �� ɳ�So��M̷�$�_�J��Оo ƍ����#<�ɣ��=i������ �I�� AL�_��xO��D����J�Ĺ�q�M:��p���I���}��Ɓ��Mֳ��9���4�pTǷIjEq�TǷ���M���>$��o>�GMvg�w?�L�_ ô���q�ϼ� <�ɲD�DP <�8�=iX�%D�t �H�ps@M���s��� ��O�~�C�t�p� ��q������ ��� .8����������ʾ�����²���LA�\�e���8��p���FḮ�OKO�&���@�ȷ��'Z��g[�F���,�g[�F���L�jٵ�� �����J>���̳čo���ȳ��t���MC��D#�>�������8(����fX# ����q���p�M���@�� ��t���ʹbM�M����}����I���M�qo���%���\�����K��q��Mٷ�D� �d��ť�ǵ��>g�ȼD$�LA>�G_*=��o�����������o���%�oLAT˳BP GM/�� ,7KdM ���/�� ,7KdM ���wò��, ���wò������Ųȷ*[ŵ��K�ŵ��� `�O���� �� Ųȷ��`�H����M8�!��k�1��K��3/���!��k�1��K�J[�E!����VC���E!�O!ȿt����������M7KdM����m�E��G�p���*����TǷ�������>�"�p ��u�����Mþ��������>�GVc����ȼ��>�G�t���J�����qEK�v �M��F�C;M��F�C;�ŵ�;����E���LA3�YJ�LA��^M�9��Ƿ�C��a�����sM��ɳ�H��s�o�=��Ǎ�Ar��LA������˳B#������ȳ�QM�q�s�Z"���rRF��G�pȳ�Q��[8��@=J4�� ɳ�So��M̷�$�M7Ǎɳ�H�MǴp��ǵ�̳IJ��ɳ��< M̳IJ��ɳ�CdC���M�<�H��yB�˼��KƷJ�ʁ����M'�J���! �ʘ�����M��6C� ������Ci����������P@�?Ywò�Z�p�û������C�q��MŊ��Ź����LAS��M �M�F,�^M�F���o �E�H"�1��Y1a�ĹL�t����M¼��8�$��M�!CM �8�t��-G'�J�=�<-Y?MѲʾ�ڳ�ȼo�%�e��D<X������ćW���@_����@�s�p`X��ȡ;����ʽ`�O��p�<���÷I�q1��Y< �o�qL��5�*����H$�p�-7ý��QSp�-7ý��þŵ/�X��μ�k��d�ʇV��M=Js�^��]��ɳ� ;��CP@��OKO�)�f�'Z�aǷ�'>���%�,aǷ�'>���%����L?��p�����=�t���ʾ��t�ȳ�Q�w?�L?���GJ�o�qop��M���t��ʴ�C#�����qo��M ������ I�)���C��9�(�U�Ʉo�H��LAS�^_�E��:����ǵ��^M�9����l������ ��J<��p��H��{��pD8�G���ps�@>��qo�;�VY�þ�������ٳ����>��γ~������\���6��� K��ô ��Np��4��8ϼ�~���L����L?��>�XM�9��N�{�Nɳ�H�_ ��Ǵ�� , ��V�I��ƾ#���T˳B���{�N�EK���âLAo ��M�!Cż�r@� ����M�����>�"�$"R$"@��^������� ��ʹ:�,5u�,D��N�H�E���ɳ�H�M�ʴ�C�I���$��or?Y¼$D�����ǵ�sMT� +������ô �����>�GMDQ� ���>�G��"[��ɲD�DMD��LAڵF�*�ҷ���%�І�l����MGJ���Ƿ�;�K�Y���V�q�Y�z�������*��M����������3��ʺ[#6��E�����/�ɲ���7KdM�%�e+J�������ʘ���sM/�� ��`Ɉ��������>�XVCdC�No�!ɹ�q�{�NpT˳B&; �qLA��^M����:����÷����Nt)��8�u�qE���ƹ4ǹT��d��tMþ)ʺT��Ŵʺ��Ų@Ŵʺ+���t�oL���ƹ2��!����=�ʹ2��!����=���Mp᳽c���ǵ�fBO���� ������ɳ�H��o��О���\��N���L?���{�NEK�v ��!�`�&��+ �������EK���ǵ�:9�N�v��ô ���M�s����*��MT9��p��w?�LAsM��6߷J�̍oȳ�Q�o�ȴ��EK�v �V ��M���-G� �?��ô ���o��� ���=�SX����w?�p�Np�Nw?�SD���UJ�p������ ����A̳�D��C��ƍ>�X�>�X��V�� K,���8��„�LAp����H��QüG����N���J0���� I�)n ͘o�� �� $ƍpsP�~�JZ��þ��� ��qr�����=.��I� ;O�j� ��6�Z�l��rRr@�����J���5��o�3�Y7�)��VliM8���o�3�Y7�cJcJ�ɳ�H�Pʽ ���s�߼�$��! �������ćP ��MuM����897 �s�x@P��k����k&�I�P K�H F�LA�L�rRp �4�m�i?��p7KBʚqE���ƹ$����g[��SGJ�o�T��B���p�No���ǹ���X�p�N���r?Y� +������R�0�ȘL�pƼEǹƼE��D�9�o�3�Y7�����X&� e�&� e��p �8�u��������ȳ�Q�p������ ���� "^�o��t�ȳ�Q��qLAo�^M�%8�g��%8��9"'KD-(�7%�ƈl��o�qo�q��^MF��I೺�MF��I��8���ƾV�q�5����hʹhʊ�t�t� ��D<��κ�������^M���W6�Zż��l������< �ŵ���<���1�LAsM����)���>�8��^��̍rR>�G_�����J0���� I��o�V�� ��Ĺ�����UJ�rRJ��5��o��q��� �M��J��^_ôȍp������ ���#��������*����pI�U�K�o!C�5�;��{�Np�<���÷I�qp�<���÷I�qLAD$MT˳B���_����G�����E�F@M���˲͍r���LAp���Tͷ���<����⻧EK�ȴ¼��Ųo���M�ͷ����yBO��Ci�rRr@��o� �� ���LA�*=CM� ���/*=C���W�F ;D��E���ƹ�E�����ǵ�ȷJ��L�������_d�ʹK�!��� "^�ɳ�H�MƼ#�U�rRp9�C�m�i?���q���3�Y3� ��Íp��O����Ì����qo3��� �pȷ��=�ȴ�yB�p�H$�u�o�qɳ�H�M �8�u�����ô^������\O��ŵ����%�e�C���^M¼̾�����ڼ/��r@�t�p�<���÷I�qt����M��ý��yB�t�����H$��o����¼���o>�GM�q�P5����o��J���; ����Mֳ��3G�>˳B�t)��:��q��I�x�D�DMX�%D�p`X��(�pE���ƹTǷ��>�GMT˳B�on4��C_� E��G�ɳ�H��LApD��D�E�J��oLAL�&�I�M ���E��C���Ǎ��Pʽ ���s�r������C���ڵF����x�Ds�o�M�������FI��Ĺ�������F�K�Y���V�q�Y������7��p�č���=.S<(����/�ɲ��@�?YH��pTǷ���M�I� �ɳ���K��F���IV�q�E!�LAD$MT˳B���L�ô��O�J���{�N����e��$�t�LAt����Mȳ�Q]6��';Ș���LA���9��NoD�9j�qr�����=.�:��1��_ ��t��<�H���qr���ճ;bM� ��ZM��l����:��C��ƍ ɳ�So��M���PG��FX�� �o ��_��D�ȍGJM�Š��E���ƟNo3/���qo`�UJ�����VCdC� ��VCdC� �Ö���G��l>�����5�ȼ9��p��;����μ�k��d���I:��I:�H F� ͍�μ�k��d�ʇM=ɳs�÷�sP��8�÷I�LA ��O���ƍEK���ǵ���JZ'���� ���I���}��ƍLA$�O��Ci�EK�v O�~�CMN��!���]��ɳ� ;U�@�&��ȼ�M˼F༼��rR�ȼ�]�ƷJ@�9�oLA��� GP G�����VC��ƍGJP@��ּ��8�<��G�6����7�D� @�psMD�����ȷ��N��� ƜN�]��ɳ� ;#ôý ���ɳ�H�P����� ��Ɂo�D$_ ô�� âEK���ǵ�:9�!E�'��ż�4���qL���ƍ�������d�e;��8PE�6�r�����=.��I��O�j��>˳Bڼ/��l��pydC�E��q�>g�S�>�9�B��x@P��k����k&�I�V����GTǷIj "^M�9��� $���>�XW����>�X�����üG����e��?�@���W�F���6��þ����>�GVc���>�G����p����8ͷ� ���p`X�˲�F�ɳ�H�MGʹHG���H$�=J�̷�$�p�NpK�F�e�������M������o��@����wÖo5���J����>�"�N���DQ�N�ڵF�ϼ�3���_*=Cs�L?� � "8ȼ���OK@�?YKE�����o�ȳ�QMv �Mu��8����/�ɲ���7KdM/��@�v�>�"�o�K7���'Z���>�,����>�LA1���qoa9@M����qor�� ɳ�S��M���M�X��������sM��I�����s���^�� ô}��^�o� ��q�ɳ�H���F����L?���K�YH���6��oGJ������m�E��G�ɳ�H�M4Ez�yB�����I&��\���ȘrR�����<������ܾ�â>�GMD<��o�N���ʾ���%Þp�Nt�����8�D�9��q�GJ�\ ���̖1��Y< � ��MGJ#���LA���M� X�o�ü�J�8������ǷƆ�os�hz_���hz��]��ɳ� ;����X���������ܽ���>�K�E����O���ƍoJf����7ý�LA ���ĹT˳BU��@����TGB����<� 6�r@MprR "^M�%�eH ��q�� �O�����:�����pTǷIjEq�TǷ����K���L����K!+9���C��˜pt�0���h�qpL�� ��M˵���ɳ�H��L�_�dC��]G�oEK&;ȍ�!ɼ��?���"8��6Y���=.���׳ Ƿ��%�e���I����8C�ȳ�I��C�5���o�òF6��pT}��ƍ���=.S����EK����X� ��EK�v O�~�CM����@����E�3�O�� �ʘɷ�*� ��oS �����"�F�3I�L�MD$��qo�M�<���÷I�Ĺ�<���÷I�qrR�qoL�3�@�?Y%����r?���sM���Mu��{����� �����O�j�ƷJ��߼�F��ɳ�H�M����s�I�� AL�_����'-��Q�C%���sM2?+<(�rR�M�9���F����!ŵ���:9�����>��]��ɳ� ;�Z��F@���(�����^MDQŋl���p ��u�9���oEI�M̷K�<M\��B�D��qo�0�o�0����Ǽ����<��[�>�G_���MFI��>�G���M IJ�oI3�FḮoK"@R�sW�F����M8��ó}��^����ɳ�H��p÷��; ����ĿGJ�EK�v O�)�ŵƼ�o�sP���Í/�� ��t�p��ǵ������ +�H�X����L?��˲U�<�ʂS˵ �|����5�c�LAJY���˳B�J��M�9�KIk�=�<-Y?Mȴ��GJM�F[�1J��p(PӸ�ijm�����sM�9ju��"[�ڵF�*�ҷ���%�І�l��p�N�������fBO��L��˲͍��ɲD�DMX�%D�psV�@����?��yB��<� �q�F/E���ĸó2F�PEq�5����F��>g���X�EK�v �M û)���9���=J���p��v�e��������3˷�1��_ ��¼�Dt&���� ��q�EK�;���G�t�D�} F@�qp���D�Ȳ#������ǷI�MIJ>ʘrR�ȼ�P����;�>��@�?����L?��;����o��)n���Gʹ���I�F�I3���P�U��oLA��˳BM�?���˳B����ɷ�W6�Z��/�� ˜ٵ ���*8�/�o��M8�[��÷I� LX�9dC#ʺ�t&��6�qp�<�H����M�Q;[���J���o�=Y9���<�ŷH$������]�Ƿ��C]�Ƿ��C�=J�oL���ƹ"�I�g4�M"�I�g4�������� ��ʹT˳BM̘(��Ǽ���ƹ�ƿr?�p��H��yd��o��]�8�!� ����M�s�LAL���=i����m�����[��܂�M���6��J�p:9� ��LA���Mײ� ��GJ�/�3�p�>��J��M:��rR>�GMF7 ��ɳ�H�W�¼̾�as�p�����I�p�N ��V8#���sM��5��4��AIǍo��߳��rR "8�H$�LAo�EF��x���ɲD�DMD��]��ɳ� ;�L�@��L��EK�v O�j�=il�����@ʿ�DK���rRE���ƍpsM$<�����LA��-��p��H���������v �Mȼ�����yB��< ���qp��6D����Fk��+�"��oڼI�M�>˳B��6�o�K�F[������*�����-I��� �7�����э�o`���<��@���E�H"�����ʺ��ȳ�˜����üG�pE�H"�pm����pf�p�H$�1��_ ����I��*�l���{�NJZ)6��þ�!�r?��>�X]X��<�Hj(�Z����Ɓ��ǵ�s�N1��Y ¼��óS��� �M ¼��ڵF����x�Ds��P G���M ��ý�K�Y���V�q�Y��#���8��i��rRp¼̾�o��M���ٳ �o����}G��EK���J��ȴ��s�o(�ZM���H���p�Np�N���N ɳ�So��M��M:9 ͍rR�^MI��EK�v &��Y7����C�3/��C��>g�o��M8�[��÷I�T�K�:��oHF�̳:*Oq�5�����ȷ�I��KƷJ��EK�v O�~�CM"�ųǷI���~��������J���p!C� "^_dC�9-6���_�������̣�pᵲɹ�d��ᵲɹټ̾�r?Yf�#�����GM/�� ,K����LAD$MĹ�����÷I��8UJ����p�H$�u�wò�q���7KdMɵ��w+ ��8�����*��������L�M�9����@MT�NG�c�:9�ȳ�Q�oJ�p ��T������������D$�NLA�E���ƍ�OKO��T� +D$�T� +D$l��r�����=.��I��� ϼ�� �ݾ z�l�����MƵ�w�4�FYJ/��� ��_*���ǵ�J/��� ��Vl�j��"@l���p���ûػ��sMǼ� $�Z�ɳ�H�Pʽ ���s��s_��oEI�MT ���I�q���x�4 �x�4 �Me�Jf�� ����{�N�{�NSGJMF�#6��L�Pȼ̹��qp��H���F��K����qE���ƍGJMȳ�Q_�� ���V��~'>�Np����8���ǵ���%�;���%�;��5���o�NLAS˵ �|��YEi� ͍����^P���C�Np�Np�NoQ�H����̍o���Ĺ��K��6��t����ȳ�Q�o3�Y ¼&������/�ɲ��O�j����ǵ�l���E������(��I�������FX!C�̳�� ��_*����v �]���Pȼ̈�L�M8�!��>�GM�qh)�8�L���� ̳�D����q����^M���_ô��ż��l���p���D�Ȳ� "^�I��Ʈw?)6�MGJl���pG��� ��K��Uč���/�ɲ���7KdMD$��E���ƹ>�G�7JO����ý���T˳B���o�3�Y7��ȳ�I��ȳ����೶��߷J4��Y���t���� ��J<�L�~�CPȼ�UJ�LA��P�~�~�tO�-Y���q��MԾ�b߼�����p���D�Ȳ#�������2��7KdVK7������LAS˵ �|����5�c������J���oǼ�ʹ7����ps@Pɷ��s���{�N�{�No����Oû9UJ[�;����ʽ`�O��pG͍oɳ�D��ż�r����M��E�~�CM���p�qp�q��V�q�K�! ���LA�*=CM� ���/*=C��l�jE����=J�^��rR��Lq�ټ��@�þ��FI��t�o�M�@!���˳B����¼��8�$��]���MFE���1�49M� X��F�L���z�F7 ��o!�̳�ȼ�ɖ�N����avg�=�ò�Ƿ���%�Ʒ��ɳ�H�V�q�E�� ���{�N��M�i��r�����=.��I�Ks�D��7Kd]�s������8�t���J�����q����a�>ga+�ûK��ʘ���>�G_���>�G��"[��*=CM� ���/*=C���W�F ;D��ȳ�QM�q�߼�F��*�l��oEI�e�&�ƌW�ƌ��q�ɳ� Lq�ټ��@�þ�o�����M�-G�p�Np�N���K����ȼ�z�K��6��N�[��܂���Lq&��YT˳B����v �>�XM�l���p�Np���*��� ���D�9�LA��^W�F�o��&�I�_� �oE�3���F����Ƶ����JY�8�J����*�����H���sMCMC�u�r���ȼ�#��?�oL���E��oEû9�KƷJ��o��M�ô �M�>�9#ȳ� �ɄLA>�G_*=��I�� AL�_��xO��F�÷K�Ƿ�'�C�qphz����v �W6�ZMFI͈��"[�ڵF�*�I:��I:l����C���O�3��̳�D��>�G_����عm�i?��oK�� ��M4Ez�yB��{�N�{�N������̵�8�o������G�C���;bM��?��9 �p�H$�u�wò�q����2��7KdPȷ*[�c�γ~��������MF`+u� ��'��������O�j9 �K��� ��:�l��E���ƍ�p%��ʴ���r�����=.��I�Ks�D��7Kd]�s������8�oǶM�@��-%������Av �]�[�����1��̷�$�_� ���G� �4���˜pE�~�C������e��<�ȹD8�G�ot���� J��ɿt����˼IJ�=J�M˼IJ�=J��LAHF��>�9��L��Ĺ�F¼̍"���ǵ�u��8�< Mu��8����pGͽ�o�:9�6�4�ɳ�H�V��H"�D8�G�p�����N��LA$�O��Ci����L?�������� ���&��YH������W�I�Wò5���ŋ��G�c��rR%��MѾ%���߼���p$< j< �Ų5����\ ��)��cM:9�ɳ�H�M ��UJ����v &�I�M���� @�Gʹ���I�F�I3�o���@ʿ�û `ɖ��\ K��� 6�J���JZ���ǵ�� K��� 6�J���JZO� K_�����o�û�����EK�ȴ¼��Ųo���M�ͷ����yBO��Ci���]�G��`�M�ʺYJ�Ka9��oE�~�CM�9����P .�osW��+u������_ô�����Ci�t��p �ɦqt��7��<�ȍ���/�ɲ���7KdP��+��N���vg�!E��NL�MD����O���@���x�9�������:��!����O�����=� ;D��qK"@RpF�p��H�� ��H�ɖ��ϼ��G�ᵲ�9���M�$��Fž�ǷƆO�����?�Ms��������f����þd��EK�v ��!�`ɹ���Ņ� ��~�C��F�L�p��r�p� ����� ɳ�S�GJ�H*RGJc�?%�H*���>���=J�>���=J�E���ƍL�_�J�̹�B��oEK&��Yȴ��os�hzM��hz�E�~�C�ij Ƿ�����>�G_���>�G���6YF�p�-�G����ǵ��-�G�OK��û�������Re��þD��@�LAD$MT� w���p�6�¼�<"���L�P��(V���ȼ';����,s�LA���Mij ǷPȼ���CŲ��Ȣ���(�r?Y(�ϼ����Ƕ��LAڵF�*�� �������sV���û�s��Y��»�ڼI��EK�v �]�G� ������������7���C�N���L�~�CW���No���O�j�"1�l��oɳ�D��ż�r��K�Y ��M=J#��cMȳ�z}��^�op߼C�-�EI���#6�oLA;�����I�� AL�_��xO��D����J�Ĺ�qo��Mȴ���x@]þ�!�r���L���I�3�6�ɼz� (��Ĺ1a���E�3�LAoKJ�=iMþ��i���ô��KJ�=i�����\�D�Fc��>�G�rRJ��5����ǵ��Mi�����¼�f­o�>�X�oLAþP GM ��MF ͹F ͍���*��M(�Z�L��o��J�p �8���oE���ƍ�μ�k��d���I:��I:�H F� ͍p�<���÷I�qpE���ƹTǷ��{�˵�ž�I˖�������FI����Vl�jE�ý��l���r���ճ;bM۷ɷ�۷ɷ�l�����r?Y +r?�EK�v �]�!��N��yd�������� ��ʹ��� ��ʘ̳�@�?���ʾ��1��Y̳��r��1��YE�~��������Re��þD��@�r���ճ;bMѾ%��MѾ%����Z�n4��C��F�m�i?��LArR�qI3�L?��LAS˵ �|��YT���Z�p�<���÷I�qoFX7c��@7cڼI����<� �I3��M���@����&��\����ò��8��F����< �ŵ�����J���÷����������T �ʺY���H�V�q��N�q�qpm�E��G��͍�{�N�{�Np��ǵ�5����F��H @W� @�6�EK�v �]�!��\ ���n4��C��ô �¼���F�p $V (6����sWL���V���KE����FI���E���FI����û�8�EI�'8���LA�M �����Ǽ���Žò?� e��4- ��<�ʹFI͘LAS˵ �|��Y��|��� .��� ����Fi4yd��r@MprR "^M��Q�Cc�����X����sM��I�����s�o���̳��ɳ� "`ƍ��P .�t�K�÷K˲�t�o$��������*��M��˳B��ow�����"��n<�N�osP�dCž�ǷƆ��t�uU@�qoLAD$M ��M��ᵲ��7��7Kd�t�LA ��O��ȳ������sMG� f���I�ćV�� ��G�ǷI�E� �3/��ȳ�Q�o%������o���%�S�Np9 �K����qosM��;b#��J��]��ɳ� ;�÷��O�¼ǵ�û��o�ȳ���o��K�Y���V�q�fBO6��Ǽ(�p7��UJ�qpG��� ��K��Učp ��8��üG���׵9�l��o�ȳ�QM "^_�%��������ćP ��MuP ��G�cus���ɻO����J���>˳B�FI��LA�r?6��V����-,γ~�C���¼���T˳B�����K����T����Ƽ��8�%���N�ȴ��o��]�ƷJ@����Ʈpȳ�Q�pe����I�g4���������fBO��K� �F�ôV��Ų��+F�ô�˲͍����ȼ �<�ȜN���;bP�����p��H��ȷ��=�ȴ�yB�šq�LAp!���I:��I:�� K�H F6=J��������e� K�t)8�:��q�Hƾý����LA����W�I���AI���qt����ȳ�Q�oS ��pSFGƌP���FGƌ�pSFGƌP���FGƌ�oF�w���Í��No�>�G�K�Y���V�q����ȳ�����˷����4ý�N�o���ydC�qo�x�4 O�j9���l������x�4 �x�4 �>�XMx�4 �>�X�vg���ǵ��avg��ý�@�����e��LA�SfB���o�3�Y9 �K��M� X�� X�������� Ɩ¼��F �O��˲U�<�ʂS˵ �|��Y�z'>9���\�¼�J�)6�)�ý: �t��{O���ƹ˵I�$-.�{�NHF .o�5���O�3����� K,�� �HW6�Z��T˳B��E�<$��V�� K,ܾ�ô����ȳ��H��p����8�H�ɣ�pZ���o�G������t��� C%��ʦq�þ�!��o��M�����@���������öɖLA�SJZ������7 �����;�o�͹�M��� ��:�œ�oLAK�����wò� "^�p ��P������@�E��� "^������ćW���@MG����@�E�3�s�o�E���yB�oEKO�O������7%�ƍ�9�������ǵ���ǵ�ps�@>��q�{�N���!��N;���>�GMG��e��or��t�D���D� ��Mp���čo�=I�D�����ǷƆ�ȼ�����*�����÷�M:��K�Y���V�q�fBO6��Ǽ(�ǼG��ýH�����sM ��:��pm�E��G�`�H����M7����C����7����C�������LA˼F�K��6�MF���o�4�F��<�Hj�̳�ށo��M�5L�紽����v ��c��v �K"@RL��Ĺ����t����M���@ʿD�F;�t�p��6D�oLA;����� �M=�M�1׼�o ��E7��t�rRp9�C�m�i?��r�����M�F�ڷJ�ɳ߷J�>�X����KƷJ@�oE�H"�oDJ� ���>�GP6��C�HF����C� ����L����C� ���������� ��J<���� , ��M\ ��#�����M�<�ɳ��H� @�oHFOq�5���)6�MFGƌȼ��d��o�E�~�CP��˳B�LAL�o�q���8$"�t���X�qo���̳ĹSsP� ��p��H�� ��H�ɲ�hz�p ��f�o�3�Y7����ǹ��Ǎo��M ���J�AJ����F����sM��J���pȳ�QMij��� �rR9��-��p��ǵ�sM��ǷƆ�!��ڵF�TǷIj"s���^�ǼG}��^�t�������̷�$�M~b=J�Bb=J�LAsM�%6�̍���w?��E���ƹF��{�N���ȳ�Q�N��ǵ�sMD$M:��p��X����P�L�jT�NE�3��L��Ĺ��v��KƷJ��oE���ƹFk��@M ��M��L�~�CM$�����6����rR>�X�̷�$�M=J�J�rRpa9@MF7 �o�N��o��1�o�>�9��;���T E�� "^�p!��p�Np�NpF��P K����ǼG�N�^_*�LA�M��H��EK�v �P�� ������rRe�:��t�ȳ�Q��q�����M�9j:9�Eq�L���P .�t&�F�t�o���=�ȣ��������i@2�9Vl�ji@2�9l���o�K���E��ɳ�H�W�¼̾�as����ij��N���- �u��8œ�t����M���:��t�p�NrR5Cgڳ?����N���N�����J�Nt� �����qpE�~�o:9�5�o�M�5����>�X�p�5����qw?�SNp ��$< �ɳ�H�P����� ��Ɂ̳�D�ɹm��GJP����]��ɳ� ;�EjE��EK�v ��!�`ɹ5����I�KƷ���� , ��Pȳ���pE�¼ǵ��9��w���M�s�o¼��oJ�p ����ȳ��p��;�rRE���ƍo��M���=�ȳ��3/���<�Hj0�����p��H��yd��ɳ�H�V�IU�ɲ�LA���M���GJP6��C��9���! �ʿt�oɳ�� "`ƍpT˳B������q�qo�8��oLAT˳BP GM/�� ,7KdM ���/�� ,7KdM ����6���, ����6���pTǷ�pr?Y�<��?�Æ�LA����&F��Eû9��ô ��o%���������LA ĜNp%����ȼ�ɖp��LA�S�%�e�C@>�L�_*�ʹ��M����LAp��=i����>�X�LA���M�H$γ��4�o�=�мƍ�����ćMF��_��G7����s�o��M8�[��÷I�o�>�9��÷�K��e����/�ɲ���7KdWL�9 �pGͽ�ɳ�H�M����w?�3��9�(]�J�o���K�LA���MiM��@��t�������o��²�pE�H"�߳�#@�%��qo� X���MT�K�:��FḮp����@�e+����ɻO���ûK��ʄ�"[��*=CM� ���/*=C���VC���=J���8��������ô�ŷó��8����p�P����o��²�LA����)� -%��ô ��oLAT˳BMT˳B�����=��̷�,����=��Ks�J�A����=��Ks�J��������pJ�8�÷I��=����IǍ����LA�=i��t�EK�v �V ����p̳���*�o��7�"�7KdC%�r�����=.��I)6�}��Vl�j�6��l>���l��rR�]���qo�� �&�F�������M��²�J��ou�p:E�S�>��K��Оot�9��t����q���x�4 �x�4 �Me�Jf�cJ������^_������%��9�l���r�����=.��I�Ks�D��7Kd]�s����Gr�����=.��I�ȷJ�O�j�J���ٷ���l��p �8�u��� �&�I�M:����M߼��[ڷ��8����� "���D$�N���ȼ�����������6C�N����H$����ǵ���No��PEKVC���E!�����o���%�e�CM�H ��%�e��EK����X� ����\�ɹ�q�38���ǷƆ�t��ý�ʂ��ǵ��ý�ʹ�ý�ʘtO���T! ��t�E���p��ǵ�sM�0�0�4��C��m����G�G� f����s]�!���<�ȹ�<���Q�6C߷J�˲�˲͍oHF�̳:*Oq�5�����ȷ�I���ɸ��Q�H���<�ȍ�����MQ�C������Ci� ��M�qp̵��u�qp�b�oEi�rR�^MI���� .��� ����6����p3� yB��>ŋ��3� ��"���ǵ�D���JK�9�)<��C�N�����ćP ��MuP ��G�cus�GJ�FGƌ�ȳ�QV�9�yB�� � .� ��Eq�5���&�I�Me!ln�rR�ȼ�]�ƷJ@�9�o�N���mȍ����^M����Z���^�o�<���-�������fBO��K&�F���� � ��˲͍EK�v ��!�`�O�~���r�����=.��I�ճ;bݾ z�l��`�H��S�^WF�'>���%' ��l�����I��LA���9��oLAþW�/�Mþ�J�I�4>��3/��þ�J�I�4>��3/����v �_��� �ȼŲ5���o���Ĺv �n4��CM�qt[8 ���F¼̦qo¼HFų�r?�t���ʹbM�����IaG��yBW4�M�����Á��V��k�� X�� XMC�C�H�����a+�8��ȳ�QMe+ȳ�Q����x�4 �x�4 �>�XMx�4 �>�X��]��ɳ� ;U�@� ����(�ݾ߼������oLAG!�[�Q���P GMu�7KdMG!�[�Q����þMG!�[�Q����þ���I�x�D�DMuD����tMsM�=�<���9 �����=�<���9 �����p��4�J�T˳B����$Ʒ��>�XMu'Z'�������^MDQl���N�E���E��L�M�9����@MT�N�E�3��Ĺ���F�����^M�¼߷J�l���Ks��>�>�G_*=���E����TQY(�Z� �ɳ���̳ĹSsP� ������2�O�j �������K!+9���Cŵ˵�Ųö�o�W�¼̾�as��&�¼̾�as�qEK���ǵ�paŲ5���'>DƆ���^M��J�l��o �ɹKs������P� �K����˲�˲͍���L?����²'>�K�:�� �6��EK)6�Oq�5������������&��YD8�G�I3������ž�ǘo��M �V���3„�{�N�{�Np>�X�oLAT˳BMT˳B�LA�>g����MǷ��%�І�JʘEK�v �M�9jm����G�9 ��9���������K�̷�$�)��M� �#�Ę���w?�����\O�jD���D�Nt����_�%��MǷ���%'Zs�t�LA�p "8:���ȳ�Q�LA>�G���E��EK�v �P����]�!�Ų����� ɳ�So�!C���4�û�pE�H"�D8�G�q����\O�j����Iʳ˜p ��u�9���oD���o��P� �K���onO��a7B���âo�� ��÷���@ʹ����5��ȸ�������?��o���@ʿ�û `ɖo������!ŵ���L?��x@P��k����k&�I�M�9���H ��Оo�%�e��ȍp�� C%���o�þ �o ���ǵ�>�GMFI��>�G����9�(�N����� ���L?��pijGJ�o�P����� ���������� ���� "^��@>��D�X�#ʺ�K�Y���V�q�Y"[��@��oI�� A�MD$�oijm��j5�J%�ɳ�H�M��p�%�e�pGJ���F��LAp!���I:��I:>̾H F6=J���ó�̍oL�EK�v &��\�e+CŲ�ƾ�F�����F�p� â��M� G�8�����2�@�?YI��˼�M�q�E���ƹ�E��ɷ�*� ��oS��9RK����=J�3I��sMDiM\ �����>�b����ǷI�MF�F65�������- �u��8œ��þ)<��!CM�<��!C�Z��t�pG͍�H�E���o��ȼ8���MF�÷�����6C���K�M:�?�F���oI�F�CP� ����� �����ý���G�F���ǵ�sM��J���J�K�����I�� ����dC�K"@M���=J�EK�v �Mng����!���8��r���F����EK�v ��!�`�O�~�C����r�����=.��I�ij�Mߵij��ڵJ���E��o�M�������FI��Ĺ�������F� ɳ�S��M���M�X�����r��FX�%'!�ZM��f�UJ�Ĺ�<����ô ����o�$�9���:���ɻ&�I�M߼��p3C����sMDQ�FI͈���������9 ��os]����u�Ƿ��%�����EK�v �MFX! ����"���ǵ�T�K��K"@�����ô^��{�NLA�S�!� �������� ��ʹ��� ��ʘ��E����VCB���O��5�c���{�Np�<�H��wò�q���>�GM����>�G�LAHF�EK�v �]�!��N��yd��T˳B��oֵ�rR�Vl!���ǵ�sMQ�C����²� ��8������K�̷�$���o�qr�����=.�7KdW;�˵͍���TGB������H�����NTͭ�[���O���ƍS=�M�>�9�r�����=.��I�ij�Mߵij���Z��ȳ�QM�q̲>���p�N���L?��̷�$��u����LApL��F�Ƙɳ�H�M�<�ɳ��H� @�LAS˵ �|�Fk��@P5���:��a�LA�r?Y� K�e��vg���ǵ�����T�K�����3˷�o�M�������FI�������D�Ȳ#������������M��߷J�w?�LAsM�"1� ���̍o�M�<���÷I�Ĺ�<���÷I�q����_������%�o�Mu�wMpu�w���M�$��Fž�ǷƆO�����?�Ms���M4Ez�yB�p�-�G����ǵ��-�G�o�E�H"�FXaX�~�%��H� 6�����^_*=Cl���E�3�E����O���ƍ�7J���Mγ�ߵ�@�>Q6�`�H��r?Yɳ�ų�r?�EK�v O�j�=il���{�N��MIE��1��������psP �ò�qLA��M`�L�j!C�o̳�D���C���׵��o�����4�F��I���� şN������M��²�J��tMþ)ʺ+�! �ʹ�! �ʹ˲Ŵʺ+t�r����M�>˳Bܾ��E!�)��ɹ@>���̳�o����X���X�<̣����ǵ�L?��EK�v ��!�`ɹ5����I�KƷ��o�3�Y7�)��Vli���I�o��ƍLA�p߼C�-�����J��� ��J<�����Np��H��yd�����e+�F�ô��S�No��\&�¼̮o�ȳ�QMv �M:���L���I��t�EK�v �V ��_�� ���  �����ô ���ȷ��=�ȴMȷ��=�ȴ�� 4���>��J7�˲U�<�ʂS˵ �|����5�c�r���ճ;bM��?�M��?���� ����u��8�LAS˵ �|��YT���Z�LA�>g����MǷ��%�І�����^WL��������VûK'��F;'Z����� LX�>�9�pJ�8�÷I�ȷ��=�ȴMȷ��=�ȴ�� 4���>��J7��EI��) �GJM:�H�)6(&�I���9��o��M ���J�AJ����F�����2� �li@�?YD$����P�H"-����$�h���̍�LA ��M ��ɳ�H�V��H"�D8�G�t����M���@ʿD�F;�t����< ���ȳ�QMD�F���>g�������W����L��L���Ƕ�pn4��C�ȳ�Q����T˳BŲȼ̘Eq�5�����K�X�p�q�� ��÷�:�����sP� #�č�]����K��������*����o�=�L�j�÷I'Z�r?Y����O������(��I��������;�:9���ǵ��9�����9�D������8"��E�����/�ɲ��@�?Ym�i?��r?��I��Ʈ���@���%�e����P�LA�Mn4��C�EK�v &��Y�!� ���K�%������ćW���@_����@�s�����ȼ*T��B��9�<���������@��GJ�oȳ�Q�D<���^�D<���^�o���=.L��ō�{�N�{�No��3ϼIj�<x����"8��6Y���V�q��<x���ȍrRpE�¼ǵ�o���������˵�-��ƍp3/�&�/����� ɳ�So�E���ƍo�M�s�Ĺ� ��q��P .�t�K�÷K˲�t�p��ǵ�>�XW�F�o�� ��÷O����D�o�V�� ��ĹT�����M�þ�6��tO���� �ò�?C�����C�qp��Mu��{�No�x�4 [�N���*��M(�Z�L����M�s��FI�����E��o�͹��r@P�~�Cż�r��rR���=C�����2� �li@�?YD$�tF���ýQ�q��^M��J�l�����÷������ȳ��o��̍���u����7Ƿ��C�N�{�N���Jе�9 ����e�#��8��F����!��No�ô ��FɄp1���G����0ĭ���D$Mx����L?��o�� ��÷�x��M��@�o��^MȷJ��J��oijm��j�ʺ65�����H�X�oK�X�pe+���o�J�8�oK�6��,��M����ijC����P@���˵��@��ʹ�˵��6�C���H @W� @�6�o����Oû9UJ[�pTǷIjEq�TǷ���M��ò� ɳ�S�A ��MI���pydC� "8���p�Q;MFI��Q;����M�c-%�p�Np�No��P� �K������P�LA>�GW�F��sMx�D�I:�)����q�qLA��̳�Ƹ�K"@�����D�F���L?�����T� 6����T�8��NL�MF�÷�ʹ�qo G��� G�������mȂ>�GM�qoLA;��#ȳ���I�x�D�DMuD������Re��þD��@�o�� �&�I�M1�X�pe�C�X�ofB��ܹ��ɳ۷´��?ɣ����L?��p$����E���N��ǵ�L?���LAp!���I:��I:>̾H F6=J�t�K��E���#��4UJ�q� $jڼ�ͳ��C�p��H��ȷ��=�ȴ�yB�šq���p>�X�t��<�H���qo�͇M�H$�; ������^M ��:��p(MQ��ijm���p��ɳ�H��qp�K��I���Fz�o��P� �K��������J����qɳ�H�_� E��G���� ƜNo��o��G��oE�H"��5��ȸ�������?��p�\�IE����LA�s�M�<�[M��Iǵ�œ����e+�?ɣ��MƵ'�F������N����Ųȷ*[ŵ��K�ŵ��� `�O���� �� Ųȷ��t�����@�37��[�TǷI��qo���͹@>��pI��3I�q;����ʽ`�O�� �6��EK)6�Oq�5����ƹL!� �6��5�FGƌ�L��1�D$MGJ���IJ�čp0 E��m��E�KB�t&�¼̾�as�s�qt�� G�ϼ����� -(� �P K�:9�psM����<� UJ�q�[��܂Fk�Оo���@�?Y��r?��oE�3�O���ƹ>�G��FGƌ��K+k�p`XOq`�o�̵ƿ�ý�@�˲U�<�ʂSsMaDK�LAS3�Y �M�Ė���D���JK�9��f�3K�ڳG輼��oF�w���Í���+ ȷ�pƼ�v�q;����ʽ`�O��o�8��pE�¼ǵ�ɳ� ����͍�� , ��Vȳ��U�9�#���LA�M��ʹ��J�;����ʽ`�O��LA>�GM�� ���������N:9&�ɳڳ �ƖLA�J�o�0�o�X����u��8��]��ɳ� ;U�@�&�I�M�׵���]��ɳ� ;�FX�%��� ���(�oӻ�$< ��E���ƹɳ�H��EK�v &�I�M��F�Cc��ųǷI�����>�X������N����=����o����<�H������������MD$�!'Z��]��ɳ� ;�÷���I����I�����J�-�c�>��8͍�� ��ȳ�QM���?��o���=.L��ō�tO�jE!�o��Vli���I�t��=i�t�t�ɳ� ��qp��ǵ� ����M�$��� ��qp��\O��X�onO����²���âL����T�8��;����ʽ`�O��LA��@�JZ�)�o�M �K��OKO��aǷ�'����'Z�aǷ�'����'Z�t�ܾk�І����ȼ��^P�pT˳B� �K���q��ɳ�H������>�9���ƜNpK�F�÷�D�X�MD�X����������Թ�F��3���üG�I3MǷ��%��@��ʹǷ��%�У�p��ǵ�˵��ȳ�Q_˵��t�ȳ�Q�Now�EK�v &�I�M �?��a9�����P�F�L�O�~�C�9 ����H*[���I�P �ò:� �ò:��Í�� , ��M\ ���þ���=�ȳ����o��M��Q��g�6�Z�o�<���÷I�pFI��F7 ��qo��MQ�H�����wò��F�����:��I�?��������ɳ���=i�̳�D�ɹ��7Оp����� ��D��K"@�KE�p9����/�� ,��ǵ�sM�M=J����!ŵ���~��~ؘ���*��MT9��o����pI�?�����J�op�qLA�L�����2� �li�>�G�����˵��ȷ�!�@����÷�s]��–rRaD��M�KD�orR>�GM��J��F�oJ-(�F�÷K��!����O�����=� ;D��qLAo�����o���@�p���7%�ƍo�ƺ'9���I�ćV ���I ;D���Dȳ�–��^](�rR�M�ȳ��F���ɻ5�M�K��� �ɲ�������K��׼�ɲܽ���p�H$�u�wò�qL�LA����� F��õ �oȳ����L�_ ��;����ʽ`ɹF���\�����@,�q�^P ��}��^�o�3�Y7�����X&� e�&� e��oEI�e�&�ƌM��ŵ��Ų���Ŵʺ�pƼ#��qLA�L��{�NoEK����oLAr�� ��Me��;����ȳ��#��� ɳ�So���IŠNL�&�¼̾�u�o�K�@鼳�ڼI�os�hz]�7��hz�t&F�H��s�qo�0��t��O�H"�J�p�f�ɳ�H�M���>$�������ʼ���V����-I��� �7�����эɳ�H�W�¼̾�as��M"��� �ò�CW�3�ʹ!CW��E���ƹ̳�D�ɹ:9}��ƍpF��pE�¼ǵ�ɳ� ����͍pƼ#��q���3�Y8��V�����Y8��N3�Y�E���ƹɳ�H�� �6��EK&�FOq�5������������&��Y��5OK�F�rRFk��@VC��ƍ�E������M�9��p`X�Ƽ�p � ��s��E���T! �}��o���$�\ ��������yB��< �oEI���M`��E��p��T��rRƌW���X�o˷<��9��������>�G��FGƌ�̈��ôM$��l�����_ô��3/�&L�oټ���oJZ�p%ʲ���L��u�L��¼�� Y��E��t&�I�M���ȼ̦qE�~�CP� ���ɖpGͣ��<�HjH�K�����M�qpm�E��G�TǷ��Aȳ�Q� �'>���ǵ�ȳ�QMû��o���� J��ɖGJW� ��>�ɹQ�C�ōo� ��q�L��t�p:9#ȳ��; ���� �O��?C�̳���Oq���¼���ɳ�H��o0���o��M᳽c�vg���ǵ��avg)��C��ʘ���P5������ɳ�6ȍ��M׼­pG͍����*����������\��H�XM�q��ɻ���G�����p�������۳Ĺ�{�N3� L�_ôȹ�qo:9O���Lq�L�o�!CM�9��!C�t�ȳ�Q�qo�qpGͽ�o���7��_��x�F�÷��E���ƍ�7J���ɻO���ûK��ʄ����o�û `�P�L�ȼ�on4��CV��H"�FXaX�K$�����K��AI��"�oD} F@����]�!�&��\�Ѷ�o9�(�sM��5��4�pI��3I�qrR�M�ȳ��F�LA�SfBF�oT���o8�E�� �� ��� ��÷���,�M�ýģ�p1�C�K�(�pr?Y7Jû:��x��M� X� �;����=.sV���Ѹ ���ᵲɖɳ�H�M�<�H��yB������oS ����^�h��ȼ��E��oE���ƍ�F��E���{�NpƼ�ÖJK��EK�v ��!�`�)������F� �6��EK&�FOq�5������������&��Y��5OK�~��5���������� ��o8�E�� �� ��sP�ƾܾ�ƾܮoLAþP GM ��MsR7KdMþ#���UJ�þ#���UJ�EI� ���5�c���M��ij¸ʹ�q���p��M��J�p��M��J���  �6��EK)6�Oq�5����ƹL!� �6��5�FGƌ�L��1�D$MGJ���IJ�čp>�X�����2��7KdPȷ*[�c�γ~���o��o����Ȣo��M�-G� ����Ǽ �UJ4���Eq������t�p�ǵ)��cM̳Ă�F��e����t����¿t�oȷJ�J��o����Ƶ�i����P�J��P��òl���!��t� ���qo �o9 �p���D�Ȳ� "^�p������ ���� "^�r���ճ;bM�>˳B��>˳B��4�4@;��]��ɳ� ;��m���r@}��ƹ�m�@��I����r?6�L�M�%^��\��C�ع>�G�o�ȳ}�X�E� ��¼�;E���X�o��\�˵I#��c��������i@2�9��>Vl�j��I���l���?�o�$��ȼ���������I�ʶ8Vl�j���+u�����F'>����oLAT˳BP GM/�� ,7KdM ���/�� ,7KdM ����E���, ����E���p< M$< j����MG�cM���������_���%�K����œNoEI�e��Fk�D8�G��a9@��t��{�N`�H����M��f�'ZO����O�����o�1Q�%}��^�`�H����MT� +D$�T� +D$l��EK�v �L����tW��\�¼��� �����K�Y���V�q�fB�ij;H��7����CW6�Z�?��os)n��ô ���sM�ƹ�ƍ���m�Ų5�����L��4 H�ɹ�4 H��������g[��r���F���J#$��{�Np�M�ȼJ�Tͭ�����̖���/�ɲ��@�?Y����N����� ��LAr?Ye���q�q�qp�<�H����M=�����¼��8�$��P(�08M=J����r���ճ;bM��@%���@%ճ;b�rR5Cgڳ?�vg���ǵ�EH�8�������ǷƆ�t&�F�q����\��5����ݾ�ڷ�F�oEI K_*�9�(��J�������o�<x��q�{�No�>�9�&� �����9j�9���^�"���ǵ��<\G���Ij����L�_ ��;����ʽ`�O��o��M8�[��÷I�̳��@�D��p��ǵ����t�K�X�ȴ�����8�������M��s)����ô ��˲U�<�ʂS˵ �|��Y�z'>9�`�H��S�^WF�'>���%' ��l���L�)��� ��3�����M�9��oL��������SX�o�NEK�v O�~�CM"�ųǷI���~���LA1���q���÷��� �9��F�E������k��ɾ��Ƽ��8�Ö��Mڷ���}��^�>��}��^�r@M��ij,�q�������M���?�MFI͘E�����÷������ȳ��p������� ��LA�! -Y���ɳ����M�Ms�LAw?5����L�tO�~�q���L?����²'>�K�:��T˳B����K�;����K�;�Ƿ���%�� ����J��&6�Z�J�G���p ��u�o˵������9�OKO���9�ŵ�;��9�ŵ�;�o�V�� ��ĹD���D�qoI�� ���0��[���5��t�˲U�<�ʂS˵ �|��YT���Z�LA ���Ĺ>8�LA>�GM1��{�NK�Y���V�q�Y�û `ɲ�7���8�t���� ��J<�o�q�O�� R ��pH��¼̾�as�L?�� >Oi��6����͹� �Öp�ôX�������Me���<�6�vg���ǵ��avg�����m�E��G��>g�������W����L��L���Ƕ����r?Y9�C�r?�r���ճ;bMԻ>jԻ>������ȼ� ;���\�D$��8���_ ����=7�ʁ����2��7KdPȷ*[�c�γ~������D$MT˳B�̷�o=�÷,4�F���M���ٳGB�r���ճ;bM��IJ5��C���IJ5��C߼ �L�MQ�C%����\�$�J�LA ��� �K������D�Nɳ�H�P����%�ƾ��{O���ƹ�; �p>�X&�F�o�ȳ���oGJV���F�ôMGJ� ��8�� ����sV�8_��t�LAt����Mȳ�QM � żD��SX�p��ǵ�sM��ǷƆ�!��]��ɳ� ;�w�J?P@�&�I�M� J?�p��̵��T�÷�osM1�(�oL?��I8�c��[��܂E�~�CMᵲ�߼�� 6��>�X�r���F���LAڵF�*�I:���>��;�����; ��� (6��ʣ�EqP�K��6����8�������MF`+uȳ�� ͘���N�Hƾý����L�jE�B�L�)���9 �oEû9&�I�`�H����M�3��K�3��K���]��ɳ� ;�÷�M�4�0�4�>��輴�"�t�D���D����3�YE��ʹ:9�p�TǷ�E���ƍ�7J��qo�̼�9��÷5�_ô�i?��pGJ���F�LAo�^V��3��7%��V��3��7%�Ʋ���I�7%�ƈl�������LAsVC����L?��=J�����2�O�jȳ����� �8Ų �8�����ɇ]6�Þ�qE�3��L��Ĺ5����K�X�����ȼ ż�ʘo��\���̶�;����ʽ`�O����ǵ��^MFI�l������*��M "8:���op��8������sP� �K�����-p$< jG�c_*�oLAT˳BP GM�� -%M�� -%���MF�÷�����6C���K�PG����>�GM��ŋ��>�G�>�GM�i-Y�qLAS˵ �|��Y��|�E���ƹ;��C��Ɓ�LAڵF�*�I:��Ƿ���%�І��w?5���LA�>�G�;����ʽ`�O��x@P��k����k&�I�Mx�D�pм�����8�t�D���D��þ�̷�$���W��\)<�����t����ȳ�Q�LAp$�Ŵ� -%Ų��˳B�o���KƷJ��p�������F����L?������^MT˳BM�qh��@#��c�;����ʽ`ɹɳ�H����\��H ��q�����;�p���*��GJM¼��V�>����K���+��������^�r@MprR "^M��Q�Cc��ȣ�p!C_ôȍt&� ����1��B��ȳ�Q����� .�Eq�5����÷�x�̖t���I���qo�M�ý�#�U�Ĺ�ý�#�U�qp� ��qp<(���F�o��ΎtMٲ�pm�E��G���M� K���M� K�t�ȳ�Q����>gO���ƹL?��p��ǵ�>�XW�F������6C�NLA��NLAp���˳B��2�wÖLA�M��GJMGJM�F�GJ�EK�v O�)�ŵƼ�����M ���G�c�vg���ǵ��avg�����m�E��G�ɳ�H�W�Ƶ�FI��t���e6�wò�s�q���a9���� �UJ��"[��*=CM��@��/*=C��*�l���$����G��(�Z�SX����C�o��O�jul��ԛٶ��l����uCQ �CvS�"�#;'u*.a1 46�7�;I>DA�D�GGIMnR�WZgZ�[c`�e�ilnro0tAw�x8|�|����3���P�ȓ����<���X�������+���������r�v�=�2����L���]�Z�����I�!�Y���H��������kn� � i �iFn, �%�(2,�0A2:45o6M:6<?A C�GHL�P6R�U�Y�^�b�e�fwkLo�qBv�|�}ˀO��'���ב4�w���%�ܤЧw������n�p���0���Z��������v�4������������b�7�2Zg | �z)��!�"'%;)P.0�0z1'4�8_=@DEG�I�NYPTS�V�X^Z�]ya�f�l(q�s�tIy�{r��9�Ȉ�� �����x�\�m���+�[�ګ8�7��:�*�h����� �=���J�~�.�$���������������.������|�2w � 3U �#G% &�+y0C2�4�7�:�=~A�F�H�KQ�Q6W0YZ�]i_�b�cAd�fwl�mo�swy+{�{�|�}(�`��\�U���ؓ��f�0��w�P�5�3�w�ĺY�����*�/�k�I�������h��X��{�'���o�z�h�l�2 L&6-num'X����nuk6:/to�HN1�*�B2�releases�� 14�a.I.R_:aX2J� >#!-�')�'P�JPe=!Uy$Bc.� (# Description: # Receives Pivotal story activity and emits to pivotal-story-tagger # when a new story is created # Dependencies: # None # # Configuration: # None # # Commands: # None # # URLS: # '/hubot/pivotal-listener' module.exports = (robot) -> robot.router.post "/hubot/pivotal-listener", (req, res) -> try reqBody = req.body catch error robot.logger.error "Error parsing json: #{error}" reqBody = null return if reqBody res.send 'OK' activityType = reqBody["kind"] projectName = reqBody["project"]["name"] projectPrefixMap = "District Portal": "DTP-", "CCK12": "CCK12-", "IRT": "IRT-", "Salesforce": "SF-", "Data Integration": "DI-", "CCK12 Design": "CCK12Design-", "Data Warehouse": "DW-" "Ecto/Material Girl": "ECTO-", "Fiber Toolkit": "FTK-", "SOTS Progress Tracking": "SOTS-", "TechDebt": "TD-", project = projectId: reqBody["project"]["id"] projectPrefix: projectPrefixMap[projectName] if activityType == 'story_create_activity' && project.projectId robot.logger.info "Emitting create story for project: #{projectName}" robot.emit 'story_create_activity', project #= require three.min #= require roofpig/Pieces3D mock_scene = { add: -> } mock_settings = { hover: 1.0, colors: { to_draw: -> { real: true, color: 'red'} } } describe "Pieces3D", -> it ".make_stickers() creates Pieces3D.UBL, Pieces3D.UL, Pieces3D.F etc", -> pieces = new Pieces3D(mock_scene, mock_settings) for piece in [pieces.UBL, pieces.UL, pieces.U] expect(piece).to.be.defined for piece in [pieces.BLU, pieces.WTF, pieces.LU] expect(piece).to.be.undefined root = this root.calatrava ?= {} calatrava = root.calatrava # Hide all the sub-pages when first launching the app $(document).ready -> $('body > .container > .page').hide() window.onpopstate = (event) -> if event.state tw.bridge.changePage event.state.page should = require('should') async = require('async') Client = require('../common/test/client').Client app = require('../server') client = new Client("http://localhost:8888/") describe "Test section", -> before (done) -> app.listen(8888) done() after (done) -> app.close() done() describe "Existence", -> it "When I send a request to check existence of Note with id 123", \ (done) -> client.get "data/exist/123/", (error, response, body) => @body = JSON.parse body done() it "Then {exist: false} should be returned", -> should.exist @body.exist @body.exist.should.not.be.ok describe "Overloading functions", -> overloadableFunc = null; beforeEach -> overloadableFunc = new Overloadable(); it "should not allow for passing incorrect arguments to 'overload' function", -> expect( -> overloadableFunc.overload() ).toThrow() expect( -> overloadableFunc.overload null ).toThrow() expect( -> overloadableFunc.overload null, null ).toThrow() it "should not allow overloads on non-extensible object", -> expect( -> overloadableFunc.overload "null", -> ).not.toThrow() Object.preventExtensions overloadableFunc expect( -> overloadableFunc.overload "null", -> ).toThrow() it "should accept string arguments", -> expect( -> overloadableFunc.overload "null", -> ).not.toThrow() it "should accept array arguments", -> expect( -> overloadableFunc.overload ["null", "null"], -> ).not.toThrow() it "should accept function arguments", -> expect( -> overloadableFunc.overload Object, -> ).not.toThrow() it "should accept regexp arguments", -> expect( -> overloadableFunc.overload /\./, -> ).not.toThrow()$ -> $('#reload-consts').on 'click', ReloadK sources = Bacon.combineTemplate history: GameState.history position: GameState.historicalPosition sources.onValue (x) -> {history, position} = x $('#history').empty() prevElement = null prevElementCount = 0 prevElementType = null for element, elPosition in history type = element[0] if type is prevElementType object = prevElement else object = $('
  • ') $('#history').prepend(object) prevElementCount = 0 prevElementCount += 1 object.text "#{prevElementCount} x #{type} " restoreLink = $('') restoreLink.text 'restore' do (elPosition) -> restoreLink.on 'click', -> GameState.back elPosition object.append restoreLink object.css('font-weight', 'bold') if elPosition is position prevElement = object prevElementType = type module.exports = config: filters: ['samus','short_beam','controller'] update: (comps,input,u) -> samus = comps.get('samus') ctrl = comps.getIn(['controller','states']) aim = if ctrl.get('up') then 'up' else 'straight' direction = if ctrl.get('left') 'left' else if ctrl.get('right') 'right' else samus.get('direction') sideways = ctrl.get('right') or ctrl.get('left') action = switch samus.get('motion') when 'standing' if ctrl.get('action2') 'jump' else if sideways 'run' when 'running' if ctrl.get('action2') 'jump' else if sideways # If we don't re-iterate the run action, mid-run direction changes will not register 'run' else 'stop' when 'falling' if sideways 'drift' else 'stop' when 'jumping' if !ctrl.get('action2') 'fall' else if sideways 'drift' u.update(samus .set('aim', aim) .set('direction', direction) .set('action', action)) # TODO is this really necessary? Because this is kinda jank, updating the controller states like this... if samus.get('motion') == 'falling' u.update(comps.get('controller').setIn(['states','jump'], false)) RootView = require 'root-view' SearchModel = require 'search-in-buffer/lib/search-model' describe 'SearchModel', -> [goToLine, editor, subject, buffer] = [] beforeEach -> window.rootView = new RootView rootView.open('sample.js') rootView.enableKeymap() editor = rootView.getActiveView() buffer = editor.activeEditSession.buffer subject = new SearchModel() describe "setPattern()", -> it "kicks out an event", -> subject.on 'change', spy = jasmine.createSpy() subject.setPattern('items') expect(spy).toHaveBeenCalled() expect(spy.mostRecentCall.args[0]).toEqual subject expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex require("./primitive") require("./es6compat") require("./es7compat") require("./bbjscompat") require("./bootbox-promise") require("./windowcontroller") MainController = require("./maincontroller") MainController.instance.activate() # List of boards require("./peridotboard") require("./wakayamarbboard") require("./grcitrusboard") # List of engines require("./mrubyengine") require("./duktapeengine") require("./luaengine") require("./micropythonengine") # List of editors require("./rubyeditor") require("./mrbviewer") require("./javascripteditor") require("./luaeditor") require("./sketch") define 'app/search', ['typeahead.bundle', 'app/p13n', 'app/settings'], (ta, p13n, settings) -> lang = p13n.get_language() engine = new Bloodhound name: 'suggestions' remote: url: sm_settings.backend_url + "/search/?language=#{lang}&input=%QUERY" ajax: settings.applyAjaxDefaults {} filter: (parsedResponse) -> parsedResponse.results datumTokenizer: (datum) -> Bloodhound.tokenizers.whitespace datum.name[lang] queryTokenizer: Bloodhound.tokenizers.whitespace promise = engine.initialize() promise.done -> true promise.fail -> false return engine: engine fs = require 'fs' _ = require 'underscore' module.exports = loadPaths: (rootPath, ignoredNames, excludeGitIgnoredPaths) -> if excludeGitIgnoredPaths Git = require 'git' repo = Git.open(rootPath, refreshOnWindowFocus: false) paths = [] isIgnored = (path) -> for segment in path.split('/') return true if _.contains(ignoredNames, segment) repo?.isPathIgnored(fs.join(rootPath, path)) onFile = (path) -> paths.push(path) unless isIgnored(path) onDirectory = (path) -> not isIgnored(path) fs.traverseTree(rootPath, onFile, onDirectory) repo?.destroy() callTaskMethod('pathsLoaded', paths) SpellChecker = require 'spellchecker' module.exports = findMisspellings: (text) -> wordRegex = /(?:^|[\s\[\]])([a-zA-Z']+)(?=[\s\.\[\]:]|$)/g row = 0 misspellings = [] for line in text.split('\n') while matches = wordRegex.exec(line) word = matches[1] continue unless SpellChecker.isMisspelled(word) startColumn = matches.index + matches[0].length - word.length endColumn = startColumn + word.length misspellings.push([[row, startColumn], [row, endColumn]]) row++ callTaskMethod('misspellingsFound', misspellings) module.exports = ProjectTokenGenerator = readOnlyToken: () -> length = 12 tokenAlpha = 'bcdfghjkmnpqrstvwxyz' result = '' for _n in [1..length] i = Math.floor(Math.floor(Math.random() * tokenAlpha.length)) result += tokenAlpha[i] return result readAndWriteToken: () -> numerics = Math.random().toString().slice(2, 12) token = ProjectTokenGenerator.readOnlyToken() return "#{numerics}#{token}" if not RocketChat.models.OAuthApps.findOne('default-zapier') RocketChat.models.OAuthApps.insert _id: 'default-zapier' name: 'Default: Zapier' default: true clientId: 'default-zapier' clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr' redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/AppIDAPI/' _createdAt: new Date _createdBy: _id: 'system' username: 'system' PartnerCategories = require '../../collections/partner_categories' Backbone = require 'backbone' Q = require 'bluebird-q' PrimaryCarousel = require './components/primary_carousel/fetch' CategoryCarousel = require './components/partner_cell_carousel/fetch' _ = require 'underscore' fetchCategories = (type) -> categories = new PartnerCategories() categories.fetchUntilEnd cache: true, data: category_type: type .then -> Q.all categories.map (category) -> carousel = new CategoryCarousel(category: category) carousel.fetch() .then (carousels) -> _.select carousels, (carousel) -> carousel.partners.length > 0 @galleries = (req, res, next) -> carousel = new PrimaryCarousel Q.all([ carousel.fetch() fetchCategories('Gallery') ]) .spread (shows, carousels) -> res.render 'index', type: 'gallery' shows: shows carousels: carousels .catch next .done() @institutions = (req, res, next) -> carousel = new PrimaryCarousel Q.all([ carousel.fetch() fetchCategories('Institution') ]) .spread (shows, carousels) -> res.render 'index', type: 'institution' shows: shows carousels: carousels .catch next .done()path = require 'path' url = require 'url' request = require 'request' fs = require './fs' TextMateTheme = require './text-mate-theme' # Convert a TextMate theme to an Atom theme module.exports = class ThemeConverter constructor: (@sourcePath, destinationPath) -> @destinationPath = path.resolve(destinationPath) readTheme: (callback) -> {protocol} = url.parse(@sourcePath) if protocol is 'http:' or protocol is 'https:' request @sourcePath, (error, response, body) => if error? if error.code is 'ENOTFOUND' error = "Could not resolve URL: #{@sourcePath}" callback(error) else if response.statusCode isnt 200 callback("Request to #{@sourcePath} failed (#{response.statusCode})") else callback(null, body) else sourcePath = path.resolve(@sourcePath) if fs.isFileSync(sourcePath) callback(null, fs.readFileSync(sourcePath, 'utf8')) else callback("TextMate theme file not found: #{sourcePath}") convert: (callback) -> @readTheme (error, themeContents) => return callback(error) if error? TextMateTheme = require './text-mate-Theme' theme = new TextMateTheme(themeContents) fs.writeFileSync(path.join(@destinationPath, 'index.less'), theme.getStylesheet()) callback() # Description: # Displays a "I Have No Idea What I'm Doing" image # # Dependencies: # None # # Configuration: # None # # Commands: # hubot no idea # # Notes: # No idea... # # Author: # Brian Shumate noidea = "http://i.imgur.com/hmTeehN.jpg" module.exports = (robot) -> robot.hear /(dunno|I don\'t know|beats me|no idea)/i, (msg)-> r = Math.random() if r <= 0.05 msg.send noidea robot.respond /dunno|I don\'t know|beats me|no idea/i, (msg) -> msg.send noidea async = require 'async' jade = require 'jade' fs = require 'fs' {TemplatePlugin} = require './../templates' class JadeTemplate extends TemplatePlugin constructor: (@fn) -> render: (locals, callback) -> try callback null, new Buffer @fn(locals) catch error callback error JadeTemplate.fromFile = (filename, callback) -> async.waterfall [ (callback) -> fs.readFile filename, callback (buffer, callback) -> try rv = jade.compile buffer.toString(), filename: filename callback null, new JadeTemplate rv catch error callback error ], callback module.exports = JadeTemplate angular.module("admin.enterprise_groups") .controller "sideMenuCtrl", ($scope, SideMenu) -> $scope.menu = SideMenu $scope.select = SideMenu.select $scope.menu.setItems [ { name: 'Primary Details', icon_class: "icon-user" } { name: 'About', icon_class: "icon-pencil" } { name: 'Images', icon_class: "icon-picture" } { name: 'Contact', icon_class: "icon-phone" } { name: 'Web', icon_class: "icon-globe" } ] $scope.select(0) StatsD = require('lynx') statsd = new StatsD('localhost', 8125, {on_error:->}) name = "unknown" hostname = require('os').hostname() buildKey = (key)-> "#{name}.#{hostname}.#{key}" module.exports = initialize: (_name) -> name = _name set : (key, value, sampleRate = 1)-> statsd.set buildKey(key), value, sampleRate inc : (key, sampleRate = 1)-> statsd.increment buildKey(key), sampleRate timing: (key, timeSpan, sampleRate)-> statsd.timing(key, timeSpan, sampleRate) Timer : class constructor :(key, sampleRate = 1)-> this.start = new Date() this.key = buildKey(key) this.sampleRate = sampleRate done:-> timeSpan = new Date - this.start statsd.timing(this.key, timeSpan, this.sampleRate) gauge : (key, value, sampleRate = 1)-> statsd.gauge key, value, sampleRate mongodb: require "./mongodb" http: require "./http" # Whois for gems, because gem names are like domains in the 90's # # gem whois - returns gem details if it exists # module.exports = (robot) -> robot.respond /gem whois (.*)/i, (msg) -> gemname = escape(msg.match[1]) msg.http("http://rubygems.org/api/v1/gems/#{gemname}.json") .get() (err, res, body) -> try json = JSON.parse(body) msg.send " gem name: #{json.name}\n owners: #{json.authors}\n info: #{json.info}\n version: #{json.version}\n downloads: #{json.downloads}\n" catch err msg.send "Gem not found. It will be mine. Oh yes. It will be mine. *sinister laugh*"angular.module('admin.order_cycles').controller "AdminSimpleEditOrderCycleCtrl", ($scope, $location, OrderCycle, Enterprise, EnterpriseFee) -> $scope.orderCycleId = -> $location.absUrl().match(/\/admin\/order_cycles\/(\d+)/)[1] $scope.enterprises = Enterprise.index() $scope.enterprise_fees = EnterpriseFee.index() $scope.order_cycle = OrderCycle.load $scope.orderCycleId(), (order_cycle) => $scope.init() $scope.loaded = -> Enterprise.loaded && EnterpriseFee.loaded && OrderCycle.loaded $scope.init = -> $scope.outgoing_exchange = OrderCycle.order_cycle.outgoing_exchanges[0] $scope.enterpriseFeesForEnterprise = (enterprise_id) -> EnterpriseFee.forEnterprise(parseInt(enterprise_id)) $scope.removeDistributionOfVariant = angular.noop $scope.addCoordinatorFee = ($event) -> $event.preventDefault() OrderCycle.addCoordinatorFee() $scope.removeCoordinatorFee = ($event, index) -> $event.preventDefault() OrderCycle.removeCoordinatorFee(index) $scope.submit = -> OrderCycle.mirrorIncomingToOutgoingProducts() OrderCycle.update() $(document).on 'ajax:error', (event, xhr, status, error) -> if error == 'Unauthorized' $.fancybox.open href: '#js-login-prompt' scrolling: 'visible' # for button outlines and shadows $('.js-login-confirm').click -> window.location = '/auth/facebook' $('.js-login-cancel').click -> $.fancybox.close() angular.module('doubtfire.projects.states.dashboard.directives.task-dashboard.directives.task-outcomes-card', []) # # Describes more about ILO linkages between a task # .directive('taskOutcomesCard', -> restrict: 'E' templateUrl: 'projects/states/dashboard/directives/task-dashboard/directives/task-outcomes-card/task-outcomes-card.tpl.html' scope: task: '=' controller: ($scope, $filter, listenerService, outcomeService) -> listeners = listenerService.listenTo($scope) listeners.push $scope.$watch('task.id', -> filteredAlignments = _.map($scope.task.staffAlignments(), (alignment) -> alignment.label = outcomeService.alignmentLabels[alignment.rating] alignment ) $scope.alignments = filteredAlignments ) ) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ {div, h1, h2, p, i, a} = React.DOM window.AnnualReportUploads = class AnnualReportUploads extends React.Component constructor: (props, context) -> super(props, context) @state = { data: [], pageName: props.pageName, page: props.page, sandboxEnabled: props.sandboxEnabled adminUrl: props.adminUrl userType: props.userType } render: -> uploads = @generateUploads() div className: 'annual-report-uploads' @generateUploads() componentDidMount: -> @getData() componentWillReceiveProps: (nextProps) -> @getData(nextProps) generateUploads: -> return '' unless @state.data for annualReportUpload in @state.data div( { className: 'annual-report-upload', key: annualReportUpload.id } React.createElement(AnnualReportUpload, { key: annualReportUpload.id, annualReportUpload: annualReportUpload, sandboxEnabled: @state.sandboxEnabled adminUrl: @state.adminUrl userType: @state.userType } ) ) getData: (props) -> props = props || @props $.ajax({ url: window.location.origin + '/api/v1/annual_report_uploads' data: props.pageName + "=" + props.page dataType: 'json' success: (response) => data = response.annual_report_uploads @setState({data: data[props.pageName]}) error: (response) -> console.log("Something went wrong") }) module.exports = [ { "id": "1", "title": "" "image": "" }, { "id": "2", "title": "Egg", "image": "img/nodes/egg.png", "metadata": { "source": "internal", "title": "Egg", "link": "https://openclipart.org/detail/166320/egg", "license": "public domain" } }, { "id": "3", "title": "Chick" "image": "img/nodes/chick.png", "metadata": { "source": "internal", "title": "Chick", "link": "https://openclipart.org/detail/131641/Funny%20Chick%20Cartoon%20Newborn/", "license": "public domain" } }, { "id": "4", "title": "Chicken" "image": "img/nodes/chicken.png", "metadata": { "source": "internal", "title": "Chicken", "link": "http://pixabay.com/en/rooster-cock-chicken-bird-farm-312602", "license": "public domain" } } ] Presenters = require "../lib/presenters" helpers = require "./helpers" describe "Presenters", -> before -> @prediction1 = new helpers.PredictionStub stopName: "Michigan & 29th Street" @prediction2 = new helpers.PredictionStub {stopName: "Michigan & 28th Street", minutesFromNow: 1} @allPredictions = [@prediction1, @prediction2] describe "WebPresenter", -> beforeEach -> @presenter = new Presenters.WebPresenter(@allPredictions) describe "formatPredictions", -> it "returns an object with values for the given prediction data", -> @presenter.formatPrediction(@prediction2).should.eql stopName: '28th Street' estimate: 1 percentComplete: 90 describe "generateTitle", -> it "returns an object with route data", -> @presenter.generateTitle().should.eql routeNumber: '1' routeDirection: 'North Bound' busNumber: '1234' # describe "generateBody", -> # describe "respond", -> describe "SMSPresenter", -> beforeEach -> @presenter = new Presenters.SMSPresenter(@allPredictions) describe "formatPredictions", -> it "returns a string for the given prediction", -> @presenter.formatPrediction(@prediction2).should.equal "In 1m: 28th Street" describe "generateTitle", -> it "returns a string with route data", -> @presenter.generateTitle().should.equal "Rt 1:" # describe "generateBody", -> # describe "respond", -> module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: compile: files: 'drop.js': 'drop.coffee' 'docs/welcome/js/welcome.js': 'docs/welcome/coffee/welcome.coffee' watch: coffee: files: ['*.coffee', 'sass/*', 'docs/**/*'] tasks: ['coffee', 'uglify', 'compass'] uglify: drop: src: 'drop.js' dest: 'drop.min.js' options: banner: '/*! drop.js <%= pkg.version %> */\n' compass: dist: options: sassDir: 'sass' cssDir: 'css' welcomeDocs: options: sassDir: 'docs/welcome/sass' cssDir: 'docs/welcome/css' bower: install: options: targetDir: 'deps' cleanup: true layout: 'byComponent' bowerOptions: forceLatest: true production: true grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.loadNpmTasks 'grunt-bower-task' grunt.registerTask 'default', ['bower', 'coffee', 'uglify', 'compass'] angular.module('loomioApp').directive 'commentForm', -> scope: {comment: '='} restrict: 'E' templateUrl: 'generated/components/thread_page/comment_form/comment_form.html' replace: true controller: ($scope, FormService, Records, CurrentUser) -> group = $scope.comment.discussion().group() discussion = $scope.comment.discussion() applyFormService = (=> $scope.submit = FormService.submit $scope, $scope.comment, flashSuccess: 'comment_form.messages.created' successCallback: => $scope.comment.body = '' $scope.comment.newAttachmentIds = [] )() $scope.$on 'replyToCommentClicked', (event, parentComment) -> $scope.comment.parentId = parentComment.id $scope.removeAttachment = (attachment) -> ids = $scope.comment.newAttachmentIds ids.splice ids.indexOf(attachment.id), 1 Records.attachments.destroy(attachment.id) $scope.updateMentionables = (fragment) -> allMentionables = _.filter group.members(), (member) -> member.id != CurrentUser.id and \ (~member.name.search(new RegExp(fragment, 'i')) or \ ~member.label.search(new RegExp(fragment, 'i'))) $scope.mentionables = _.take allMentionables, 5 # filters are being annoying $scope.fetchByNameFragment = (fragment) -> $scope.updateMentionables(fragment) Records.memberships.fetchByNameFragment(fragment, group.key).then -> $scope.updateMentionables(fragment) qbnApp = angular.module 'qbnApp', [] class Quality constructor: (@name, @defaultValue) -> initInstance: () -> @value = @defaultValue instantiate = (proto) -> instance = Object.create proto instance.initInstance() return instance class Storylet constructor: (@title, @text, @choices) -> class Choice constructor: (@text, @requirements, @nextStorylet) -> qbnApp.controller 'QBN', ($scope) -> $scope.qualities = [ instantiate new Quality 'Punchiness', 7 instantiate new Quality 'Thinkyness', 2 ] $scope.storylets = [ new Storylet 'The Thinker\'s Apprentice', 'You do some thinking.' new Storylet 'Change Location', 'Yeah, but where to go?' new Storylet 'A Mysterious Occurrence', 'So mysterious, you don\'t even know about it.' ] $scope.eventText = 'Event' $scope.choices = [ new Choice 'Choice A', 'Requires Punchiness 7' new Choice 'Choice B', 'Requires Thinkyness 5' ] $scope.currentStorylet = null; return angular.module('loomioApp').controller 'ProfilePageController', ($rootScope, Records, FormService, $location, AbilityService, ModalService, ChangePictureForm, ChangePasswordForm, DeactivateUserForm, $translate, CurrentUser, AppConfig) -> @user = CurrentUser @init = -> $translate.use(@user.locale) @init() @availableLocales = -> AppConfig.locales @submit = FormService.submit @, @user, flashSuccess: 'profile_page.messages.updated' submitFn: Records.users.updateProfile successCallback: @init @changePicture = -> ModalService.open ChangePictureForm @changePassword = -> ModalService.open ChangePasswordForm @deactivateUser = -> ModalService.open DeactivateUserForm @canDeactivateUser = -> AbilityService.canDeactivateUser() return class FactlinkAppClass extends Backbone.Marionette.Application startAsSite: -> @startSiteRegions() @addInitializer @automaticLogoutInitializer @addInitializer @notificationsInitializer @addInitializer @scrollToTopInitializer @linkTarget = '_self' @addInitializer (options)-> new ProfileRouter controller: new ProfileController # first, as then it doesn't match index pages such as "/m" using "/:username" new SearchRouter controller: new SearchController new ChannelsRouter controller: new ChannelsController new ConversationsRouter controller: new ConversationsController new TourRouter controller: new TourController @start() startAsClient: -> @startClientRegions() @addInitializer (options)-> new ClientRouter controller: ClientController @addInitializer @clientCloseDiscussionModalInitializer @modal = true @onClientApp = true parent.remote.setFeatureToggles Factlink.Global.can_haz @start() isCurrentUser: (user) -> Factlink.Global.signed_in and user.id == currentUser.id window.FactlinkApp = new FactlinkAppClass Species.DocumentTagLookup = Ember.Mixin.create selectedProposalOutcome: null selectedProposalOutcomeId: null selectedReviewPhase: null selectedReviewPhaseId: null initDocumentTagsSelectors: -> if @get('selectedProposalOutcomeId') po = @get('controllers.documentTags.proposalOutcomes').findBy('id', @get('selectedProposalOutcomeId')) @set('selectedProposalOutcome', po) proposalOutcomeDropdownVisible: ( -> @get('selectedDocumentType.id') == 'Document::Proposal' ).property('selectedDocumentType') actions: handleProposalOutcomeSelection: (proposalOutcome) -> @set('selectedProposalOutcome', proposalOutcome) handleProposalOutcomeDeselection: (proposalOutcome) -> @set('selectedProposalOutcome', null) ### # Copyright 2015 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### {span} = React.DOM el = React.createElement bn = 'beatmap-discussions-post-icon' BeatmapDiscussions.MessageIcon = React.createClass mixins: [React.addons.PureRenderMixin] render: -> name = switch @props.messageType when 'praise' then 'heart' when 'suggestion' then 'circle-o' when 'problem' then 'exclamation-circle' el Icon, name: name class CB.TextButton extends CB.Control constructor: (frame) -> super(frame) @_labelView = new CB.LabelView() @_labelView.frame = new CB.Rect(0, 0, 0, 0) this.addSubview(@_labelView) @property "readonly", "labelView" sizeThatFits: (size) -> return @labelView.sizeThatFits(size) layoutSubviews: () -> @_labelView.frame = new CB.Rect(0, 0, @labelView.sizeThatFits().width, @labelView.sizeThatFits().height) Template.blogShowBody.rendered = -> # Hide draft posts from crawlers if not @data.published $('', { name: 'robots', content: 'noindex,nofollow' }).appendTo 'head' # Twitter base = "https://twitter.com/intent/tweet" url = encodeURIComponent location.origin + location.pathname author = @data.author() text = encodeURIComponent @data.title href = base + "?url=" + url + "&text=" + text if author.profile and author.profile.twitter href += "&via=" + author.profile.twitter $(".tw-share").attr "href", href # Facebook base = "https://www.facebook.com/sharer/sharer.php" url = encodeURIComponent location.origin + location.pathname title = encodeURIComponent @data.title summary = encodeURIComponent @data.excerpt() href = base + "?s=100&p[url]=" + url + "&p[title]=" + title + "&p[summary]=" + summary if @data.thumbnail() href += "&p[images][0]=" + encodeURIComponent @data.thumbnail() $(".fb-share").attr "href", href jQuery -> if User.current().data_object.staff == true scroll(0,$(".row.osu-purple").offset().top)express = require 'express' bodyParser = require('body-parser') app = express() port = process.env.PORT || 5000 app.use express.static __dirname .use bodyParser.urlencoded {extended: true} .use bodyParser.json() require('./routes/routes.js')(app) app.listen(port) console.log "Listening on port #{port}" fs = require 'fs' require 'benchmark-helper' describe "Editor", -> editor = null beforeEach -> window.rootViewParentSelector = '#jasmine-content' window.startup() editor = rootView.editor afterEach -> window.shutdown() benchmark "inserting and deleting a character", -> editor.hiddenInput.textInput('x') editor.backspace() describe 'Pending', -> it 'Should test skipHeader option' it 'Should test initWith option' it 'Should embed plain JS files' version = { "pdfjs": "1.8.188" "moment": "2.9.0" "ace": "1.2.5" } module.exports = { version: version lib: (name) -> if version[name]? return "#{name}-#{version[name]}" else return "#{name}" } `import Ember from "ember";` `import { EMPLOYEE_ROLES } from "t2-people/utils/constants";` PersonEditController = Ember.ObjectController.extend needs: ['application'] employeeRoles: EMPLOYEE_ROLES actions: save: (-> model = @get('model') if model.get('errors') model.send('becameValid') model.save().then (=> @transitionToRoute 'people'), ((error) ->) ) `export default PersonEditController;` module.exports = { header: 'Help Mark Fields', pages: [ { pageNumber: 0, text: "One Lorem ipsum dolor sit amet, posuere a mauris, nostra quam nonummy, facilisis amet neque. Ut lacus eros venenatis ipsum, erat ut turpis, aliquam metus vitae volutpat sit sed. Eros maecenas malesuada quam leo laoreet, vel curabitur maecenas neque quam et libero, ut libero, vitae vel eros vestibulum, sagittis etiam nunc. Nonummy risus mattis, sed nisl. Quis non quis quis ultricies non facilisi." }, { pageNumber: 1, text: "Two Lorem ipsum dolor sit amet, posuere a mauris, nostra quam nonummy, facilisis amet neque. Ut lacus eros venenatis ipsum, erat ut turpis, aliquam metus vitae volutpat sit sed. Eros maecenas malesuada quam leo laoreet, vel curabitur maecenas neque quam et libero, ut libero, vitae vel eros vestibulum, sagittis etiam nunc. Nonummy risus mattis, sed nisl. Quis non quis quis ultricies non facilisi." }, { pageNumber: 2, text: "Three Lorem ipsum dolor sit amet, posuere a mauris, nostra quam nonummy, facilisis amet neque. Ut lacus eros venenatis ipsum, erat ut turpis, aliquam metus vitae volutpat sit sed. Eros maecenas malesuada quam leo laoreet, vel curabitur maecenas neque quam et libero, ut libero, vitae vel eros vestibulum, sagittis etiam nunc. Nonummy risus mattis, sed nisl. Quis non quis quis ultricies non facilisi." } ] }module.exports = -> @logger = require './logger' @visit = (path) => @driver.get "#{@host}#{path}" _Before = @Before _After = @After @_inFlow = (code, callback) -> $.createFlow (flow) => flow.execute => code.call(@) .then _.partial(callback, null), (err) -> throw err @Before = (code) -> _Before (callback) => @_inFlow code, callback @After = (code) -> _After (callback) => @_inFlow code, callback @BeforeAll = (code) -> unless @_ranBeforeAll @_ranBeforeAll = true @Before code @AfterAll = (code) -> unless @_ranAfterAll @_ranAfterAll = true @After code @Given = @When = @Then = @And = (pattern, code) => @defineStep pattern, (args..., callback) => start = new Date callforth = => $ .createFlow (flow) => flow.execute => code.apply(@, args) .then _.partial(callback, null), (error) => if new Date - start > @timeout callback(error) else $.delayed(1000).then -> callforth() callforth() @Before -> @driver = new Driver.Builder().withCapabilities(Driver.Capabilities.chrome()).build() @After -> @driver.close() @driver.quit() class Kandan.Plugins.MeAnnounce @regex: /^\/me / @init: ()-> Kandan.Modifiers.register @regex, (message, state)=> message.content = message.content.replace @regex, "#{message.user.first_name} " return Kandan.Helpers.Activities.build_from_base_template(message) # Kandan.Plugins.register "Kandan.Plugins.MeAnnounce"MergeConflictsView = require './merge-conflicts-view' SideView = require './side-view' NavigationView = require './navigation-view' Conflict = require './conflict' module.exports = activate: (state) -> atom.workspaceView.command "merge-conflicts:detect", -> MergeConflictsView.detect() deactivate: -> serialize: -> ETahi.JournalThumbnailController = Ember.ObjectController.extend needs: ['application'] currentUser: Ember.computed.alias 'controllers.application.currentUser' isEditing: (-> @get 'model.isDirty').property() thumbnailId: (-> "journal-logo-#{@get 'model.id'}").property() logoUploadUrl: (-> "/admin/journals/#{@get 'model.id'}/upload_logo").property() nameErrors: null descriptionErrors: null logoPreview: null journal: null resetErrors: -> @setProperties nameErrors: null descriptionErrors: null actions: editJournalDetails: -> @set 'isEditing', true logoUploading: -> @set 'logoUploading', true saveJournalDetails: -> #if the logo has changed save it here too. if updateLogo = @get('uploadLogoFunction') updateLogo() resetJournalDetails: -> @get('model').rollback() @set 'isEditing', false @resetErrors() logoUploaded: (data) -> @set 'model.logoUrl', data.admin_journal.logo_url @set 'logoUploading', false @get('model').save() .then => @set 'isEditing', false .catch (response) => @set 'nameErrors', response.errors.name?[0] @set 'descriptionErrors', response.errors.description?[0] showPreview: (file) -> @set 'logoPreview', file.preview uploadReady: (uploadLogoFunction) -> @set('uploadLogoFunction', uploadLogoFunction) class window.FavouriteTopicButtonView extends ActionButtonView mini: true onRender: -> @updateButton() initialize: -> @user = currentUser @bindTo @user.favourite_topics, 'add remove change', @updateButton, @ templateHelpers: => disabled_label: Factlink.Global.t.favourite.capitalize() disable_label: Factlink.Global.t.unfavourite.capitalize() enabled_label: Factlink.Global.t.favourited.capitalize() buttonEnabled: -> # @model.id is the Topic slug_title @model.id in @user.favourite_topics.pluck('slug_title') primaryAction: (e) -> @model.favourite() secondaryAction: (e) -> @model.unfavourite() ETahi.Comment = DS.Model.extend commenter: DS.belongsTo('user') body: DS.attr('string') messageTask: DS.belongsTo('messageTask') Whitespace = require './whitespace' module.exports = configDefaults: removeTrailingWhitespace: true ignoreWhitespaceOnCurrentLine: true ensureSingleTrailingNewline: true activate: -> @whitespace = new Whitespace() deactivate: -> @whitespace.destroy() {statusCreated, statusNoContent, statusOk} = require '../utils' endpoint = (x) -> "/site/#{x.siteId}/deploy" byId = (x) -> "#{endpoint x}/#{x.id ? x.deployId}" upload = (x) -> "#{byId x}/#{x.path}" module.exports = (blueprints) -> blueprints.deploy = create: url: endpoint method: 'POST' expects: statusCreated update: url: byId method: 'PATCH' expects: statusOk delete: url: byId method: 'DELETE' expects: statusNoContent restore: url: byId method: 'POST' expects: statusOk upload: url: upload method: 'PUT' expects: statusOk headers: 'Content-Type': 'application/octet-stream' streams: (x) -> fs.createReadStream x.absolutePath followRedirects: true fun = (f) -> typeof f is 'function' str = (s) -> typeof s is 'string' arr = (a) -> a instanceof Array obj = (o) -> o instanceof Object and not fun(o) and not arr(o) exports.is = fun: fun str: str arr: arr obj: obj exports.normalize = (params, options, fn) -> if fun params fn = params params = null options = null else if fun options fn = options options = null if not fun fn fn = -> {params, options, fn}Neighborly.Projects = {} if Neighborly.Projects is undefined Neighborly.Projects.Updates = {} if Neighborly.Projects.Updates is undefined Neighborly.Projects.Updates.Index = init: Backbone.View.extend _.extend( el: '.updates' events: "ajax:success form#new_update": "onCreate" "ajax:success .update": "onDestroy" onCreate: (e, data) -> this.$('.new_update').trigger('reset') @$results.prepend data onDestroy: (e)-> $(e.currentTarget).remove() initialize: -> this.$loader = this.$('.updates-loading img') this.$loaderDiv = this.$('.updates-loading') this.$results = this.$('.list') this.path = this.$el.data('path') this.filter = { page: 2 } this.setupScroll() this.$el.on 'scroll:success', this.parseXFBML parseXFBML: -> FB.XFBML.parse() if this.$el.is(":visible") , Neighborly.InfiniteScroll) gulp = require 'gulp' uglify = require 'gulp-uglify' rename = require 'gulp-rename' gulp.task 'compress', -> gulp.src 'dist/position-sticky.js' .pipe uglify() .pipe rename('position-sticky.min.js') .pipe gulp.dest 'dist' tabs: 'cmd-shift-{': (tabs) -> tabs.pane.prevTab() 'cmd-shift-}': (tabs) -> tabs.pane.nextTab() 'cmd-1': (tabs) -> tabs.pane.switchToTab 1 'cmd-2': (tabs) -> tabs.pane.switchToTab 2 'cmd-3': (tabs) -> tabs.pane.switchToTab 3 'cmd-4': (tabs) -> tabs.pane.switchToTab 4 'cmd-5': (tabs) -> tabs.pane.switchToTab 5 'cmd-6': (tabs) -> tabs.pane.switchToTab 6 'cmd-7': (tabs) -> tabs.pane.switchToTab 7 'cmd-8': (tabs) -> tabs.pane.switchToTab 8 'cmd-9': (tabs) -> tabs.pane.switchToTab 9 CompositeDisposable = null Range = null module.exports = TranslatorPlusDictionary = subscriptions: null activate: (state) -> # Initialize modules and classes CompositeDisposable ?= require('atom').CompositeDisposable Range ?= require('atom').Range # Initialize fields @subscriptions = new CompositeDisposable # Register the commands @subscriptions.add atom.commands.add 'atom-workspace', 'translator-plus-dictionary:translate': => @translate() deactivate: -> @subscriptions.dispose() serialize: -> translate: -> editor = atom.workspace.getActiveTextEditor() return unless editor? texts = [] # Get texts from selected texts for range in editor.getSelectedBufferRanges() if (range.start.row == range.end.row) && (range.start.column == range.end.column) continue text = editor.getTextInRange(range) texts.push({ range: range text: text }) if texts.length == 0 # Get words from cursor positions if no text are selected for cursor in editor.getCursors() beginWord = cursor.getBeginningOfCurrentWordBufferPosition() endWord = cursor.getEndOfCurrentWordBufferPosition() range = new Range(beginWord, endWord) texts.push({ range: range text: editor.getTextInRange(range) }) 'name': 'Test Ruby' 'scopeName': 'test.rb' 'firstLineMatch': '^\\#!.*(?:\\s|\\/)(?:testruby)(?:$|\\s)' 'fileTypes': [ 'rb' ] 'patterns': [ { 'match': 'ruby' 'name': 'meta.class.ruby' } ] behaviours = {} share.attach = attach = (behaviour, args...) -> check behaviour, Match.OneOf Function, String if Match.test behaviour, String options = behaviours[behaviour].options behaviour = behaviours[behaviour].behaviour if Match.test behaviour, Function context = collection: @ options: options or {} behaviour.apply context, args else console.warn 'Behaviour not found' return class CollectionBehaviours @attach: (collections, args...) -> check collections, Match.OneOf Mongo.Collection, [Mongo.Collection] if Match.test collections, Mongo.Collection collections = [collections] attach.apply collection, args for collection in collections @configure: (name, options) -> check name, String check options, Object if name of behaviours behaviours[name].options = options else console.warn 'Configure failed, behaviour not found' @define: (name, behaviour, options) -> check name, String check behaviour, Function optionsPattern = Match.ObjectIncluding replace: Boolean check options, optionsPattern if name of behaviours and not options?.replace console.warn 'Behaviour already defined, use {replace: true} to override' else behaviours[name] = behaviour: behaviour ###* @jsx React.DOM ### window.WFplayer = React.createClass componentDidMount: -> $node = $(@getDOMNode()) mediaObj = @props.mediaObj $(document).tooltip content: -> $node.prop('title') corpus_id = mediaObj.corpus_id line_key = mediaObj.mov.line_key mov = mediaObj.mov.movie_loc path = mediaObj.mov.path $("#movietitle").text(mediaObj.title) start = mediaObj.divs.annotation[parseInt(mediaObj.start_at)].from stop = mediaObj.divs.annotation[parseInt(mediaObj.end_at)].to $node.find("#waveframe").attr('src', "wfplayer-#{corpus_id}-#{line_key}-#{start}-#{stop}") render: -> `
    ` { formatQuestionType } = require 'meteor/gq:helpers' Template.basic_results_info.helpers hasRange: -> @type in ['number', 'scale'] formatQuestionType: -> formatQuestionType(@type) Template.type_icon.helpers icon: -> type = Template.instance().data.type switch type when 'checkboxes' 'check-square-o' when 'datetime' 'clock-o' when 'date' 'calendar' when 'longAnswer' 'align-left' when 'multipleChoice' 'list-ul' when 'number' 'hashtag' when 'scale' 'sliders' when 'shortAnswer' 'minus' class @Gmaps4Rails.Yandex.Map extends Gmaps4Rails.Common @include Gmaps4Rails.Interfaces.Map @include Gmaps4Rails.Map @include Gmaps4Rails.Yandex.Shared @include Gmaps4Rails.Configuration CONF: disableDefaultUI: false disableDoubleClickZoom: false type: "ROADMAP" # HYBRID, ROADMAP, SATELLITE, TERRAIN mapTypeControl: null constructor:(map_options, controller) -> @controller = controller defaultOptions = @setConf() @options = @mergeObjects map_options, defaultOptions yandexOptions = center: @createLatLng(@options.center_latitude, @options.center_longitude) zoom: @options.zoom behaviors: @options.behaviors mergedYandexOptions = @mergeObjects map_options.raw, yandexOptions @serviceObject = new ymaps.Map(@options.id, mergedYandexOptions) extendBoundsWithMarker : (marker)-> @boundsObject.extend(@createLatLng(marker.lat,marker.lng)) extendBoundsWithPolyline: (polyline)-> extendBoundsWithPolygon: (polygon)-> extendBoundsWithCircle: (circle)-> extendBound: (bound)-> fitBounds: -> @serviceObject.zoomToExtent(@boundsObject, true) adaptToBounds: -> @fitBounds() centerMapOnUser : (position)-> @serviceObject.setCenter position #= require magic_word describe 'ValidationMessage', -> messageBox = $('
    Stuff
    ') m = new MagicWord.ValidationMessage messageBox describe '#constructor', -> it 'creates a validation message div', -> expect(messageBox.siblings('.validation-msg').length).toBe(1) describe '#successMessage', -> it "sets the validation message's class to success", -> m.successMessage() expect(messageBox.siblings('.validation-msg').attr('class')).toBe('validation-msg success') describe '#errorMessage', -> it "sets the validation message's class to error", -> m.errorMessage() expect(messageBox.siblings('.validation-msg').attr('class')).toBe('validation-msg error') describe '#resetMessage', -> it 'sets the given message', -> m.resetMessage('Your validation passed!') expect(messageBox.siblings('.validation-msg').text()).toBe('Your validation passed!') path = require "path" assert = require "assert" rootRequire = require("root-require") root = rootRequire.packpath.parent() pkg = rootRequire("./package.json") module.constructor.prototype.require = (modulePath) -> assert(modulePath, 'missing path') assert(typeof modulePath == 'string', 'path must be a string') load = (modulePath) => this.constructor._load(modulePath, this) overridePath = pkg.browser[modulePath] if overridePath? modulePath = path.join(root, overridePath) return load(modulePath) if not (global.window? and global.document?) jsdom = require('jsdom').jsdom global.document = jsdom() global.window = document.defaultView for own name, object of global.window if not global[name]? global[name] = object Bokeh = require './main' module.exports = Bokeh App.CwbSearchesController = Em.ArrayController.extend needs: 'corpus' # This will be bound to properties on views for for simple search, multiword # search and regex search. query: '' corpus: null corpusBinding: 'controllers.corpus.content' createCwbSearch: -> metadataValueIds = {} metadataValueIds[@get('corpus.id')] = [1,2,3] # TODO: Add support for simultaneous search in different "editions" within # the same corpus (e.g. different languages in a parallel corpus). Each # edition will have a distinct shortName. queries = [ corpusEdition: @get('corpus.shortName') query: @get('query') ] search = App.CwbSearch.createRecord( metadataValueIds: metadataValueIds queries: queries) @pushObject(search)DefaultFileIcons = require '../lib/default-file-icons' FileIcons = require '../lib/file-icons' describe 'FileIcons', -> afterEach -> FileIcons.setService(new DefaultFileIcons) it 'provides a default', -> expect(FileIcons.getService()).toBeDefined() expect(FileIcons.getService()).not.toBeNull() it 'allows the default to be overridden', -> service = new Object FileIcons.setService(service) expect(FileIcons.getService()).toBe(service) it 'allows the service to be reset to the default easily', -> service = new Object FileIcons.setService(service) FileIcons.resetService() expect(FileIcons.getService()).not.toBe(service) angular.module("admin.products").directive "setOnDemand", -> link: (scope, element, attr) -> onHand = element.context.querySelector("#variant_on_hand") onDemand = element.context.querySelector("#variant_on_demand") if onDemand.checked onHand.disabled = 'disabled' onHand.dataStock = onHand.value onHand.value = t('admin.products.variants.infinity') onDemand.addEventListener 'change', (event) -> if onDemand.checked onHand.disabled = 'disabled' onHand.dataStock = onHand.value onHand.value = t('admin.products.variants.infinity') else onHand.removeAttribute('disabled') onHand.value = onHand.dataStock angular.module('loomioApp').directive 'threadPreviewCollection', -> scope: {query: '=', limit: '=?'} restrict: 'E' templateUrl: 'generated/components/thread_preview_collection/thread_preview_collection.html' replace: true controller: ($scope, Records, CurrentUser) -> $scope.lastVoteByCurrentUser = (thread) -> thread.activeProposal().lastVoteByUser(CurrentUser) $scope.markAsRead = (thread) -> thread.markAsRead() return React = require 'react' {Actions} = require 'nylas-exports' {RetinaImg} = require 'nylas-component-kit' AccountCommands = require '../account-commands' class AccountSwitcher extends React.Component @displayName: 'AccountSwitcher' @propTypes: accounts: React.PropTypes.array.isRequired focusedAccounts: React.PropTypes.array.isRequired _makeMenuTemplate: => template = AccountCommands.menuTemplate( @props.accounts, @props.focusedAccounts, clickHandlers: true ) template = template.concat [ {type: 'separator'} {label: 'Manage Accounts...', click: @_onManageAccounts} ] return template # Handlers _onManageAccounts: => Actions.switchPreferencesTab('Accounts') Actions.openPreferences() _onShowMenu: => remote = require('electron').remote Menu = remote.Menu menu = Menu.buildFromTemplate(@_makeMenuTemplate()) menu.popup() render: =>
    module.exports = AccountSwitcher NylasStore = require 'nylas-store' Reflux = require 'reflux' _ = require 'underscore' {Message, Actions, DatabaseStore, AccountStore, FocusedContentStore, DestroyDraftTask, DatabaseView} = require 'nylas-exports' class DraftListStore extends NylasStore constructor: -> @listenTo DatabaseStore, @_onDataChanged @listenTo AccountStore, @_onAccountChanged # It's important to listen to sendDraftSuccess because the # _onDataChanged method will ignore our newly created draft because it # has its draft bit set to false (since it's now a message)! @listenTo Actions.sendDraftSuccess, => @_view.invalidate() @_createView() view: => @_view _createView: => account = AccountStore.current() if @unlisten @unlisten() @_view = null return unless account @_view = new DatabaseView Message, matchers: [ Message.attributes.accountId.equal(account.id) Message.attributes.draft.equal(true) ], includes: [Message.attributes.body] orders: [Message.attributes.date.descending()] @unlisten = @_view.listen => @trigger({}) _onAccountChanged: => @_createView() _onDataChanged: (change) => return unless change.objectClass is Message.name containsDraft = _.some(change.objects, (msg) -> msg.draft) return unless containsDraft and @_view @_view.invalidate({change: change, shallow: true}) module.exports = new DraftListStore() window.Binco.Select2 = load: (selector) -> selector = if typeof selector == 'undefined' then '.select2-rails' else selector $(selector).select2() $(document).on 'ready page:load', window.Binco.Select2.load 'editor': 'showIndentGuide': true 'fontFamily': 'Menlo' 'fontSize': 15 'core': 'excludeVcsIgnoredPaths': true 'ignoredNames': [ '.bundle' '.git' 'log' 'repositories' 'tmp' 'vendor' ] 'themes': [ 'unity-ui' 'glacier-syntax' ] 'hideGitIgnoredFiles': true 'disabledPackages': [ 'background-tips' 'exception-reporting' 'metrics' ] 'spell-check': 'grammars': [ 'text.plain' 'source.gfm' 'text.git-commit' ] 'welcome': 'showOnStartup': false 'release-notes': 'viewedVersion': '0.89.0' 'tree-view': {} class FocusAction constructor: -> isComplete: -> true isRecordable: -> false focusCursor: -> editor = atom.workspaceView.getActivePaneItem() editorView = atom.workspaceView.getActiveView() if editor? and editorView? cursorPosition = editor.getCursorBufferPosition() editorView.scrollToBufferPosition(cursorPosition) class FocusPaneViewOnLeft extends FocusAction execute: -> atom.workspaceView.focusPaneViewOnLeft() @focusCursor() class FocusPaneViewOnRight extends FocusAction execute: -> atom.workspaceView.focusPaneViewOnRight() @focusCursor() class FocusPaneViewAbove extends FocusAction execute: -> atom.workspaceView.focusPaneViewAbove() @focusCursor() class FocusPaneViewBelow extends FocusAction execute: -> atom.workspaceView.focusPaneViewBelow() @focusCursor() class FocusPreviousPaneView extends FocusAction execute: -> atom.workspaceView.focusPreviousPaneView() @focusCursor() module.exports = { FocusPaneViewOnLeft, FocusPaneViewOnRight, FocusPaneViewAbove, FocusPaneViewBelow, FocusPreviousPaneView } { flatten } = require('sdk/util/array'); class Model constructor : (@sources, @filters) -> @feeds = flatten(source.getFeeds() for source in @sources) feed.on("updated", @onFeedUpdated) for feed in @feeds @requestUpdate() onFeedUpdated : (feed) => for item in feed.items console.log(item.link) # TODO requestUpdate : => feed.requestUpdate() for feed in @feeds exports.Model = Model Neighborly.Projects.Contributions = {} if Neighborly.Projects.Contributions is undefined Neighborly.Projects.Contributions.New = modules: -> [] init: ->( initialize: -> $('.maturity-option .header').click this.boxClicked $('.order-size-input').on 'keyup', this.orderSizeChanged boxClicked: (event) -> $('.maturity-option').removeClass('selected') $box = $(event.currentTarget).parents('.maturity-option:first') $box.addClass('selected') orderSizeChanged: (event) -> $input = $(event.currentTarget) if $input.val() != '' $box = $(event.currentTarget).parents('.maturity-option:first') minimum_investment = $input.data('minimum-investment') amount = parseInt($input.val()) * parseFloat($input.data('minimum-investment')) $box.find('.value-input').val(amount) $box.find('.purchase-amount .amount').html(numeral(amount).format('$0,0')) ).initialize() define [ "base" ], (App) -> App.directive "reviewPanelSorted", ($timeout) -> return { link: (scope, element, attrs) -> layout = () -> entries = [] for el in element.find(".rp-entry") entries.push { el: el scope: angular.element(el).scope() } entries.sort (a,b) -> a.scope.entry.offset - b.scope.entry.offset previousBottom = 28 # This should start at the height of the toolbar for entry in entries height = $(entry.el).height() top = entry.scope.entry.screenPos.y top = Math.max(top, previousBottom + 12) previousBottom = top + height entry.scope.top = top scope.$watch "reviewPanel.entries", (value) -> return if !value? layout() scope.$on "review-panel:layout", () -> $timeout () -> layout() }# Your init script fs = require 'fs' path = require 'path' DEFAULT_WORKON_HOME = path.join(process.env.HOME, '.virtualenvs') # Get path to directory containing all Python virtualenvs getVirtualenvHome = -> if process.env.WORKON_HOME return process.env.WORKON_HOME else return DEFAULT_WORKON_HOME # Activate Python virtualenv for this project directory if it exists activateVirtualenv = -> project = atom.project.getPaths()[0] if project virtualenv = path.join(getVirtualenvHome(), path.basename(project)) # Do not activate virtualenv if project is itself a virtualenv if virtualenv isnt project fs.lstat(virtualenv, (err, stats) -> if not err and stats.isDirectory() process.env.PATH = [virtualenv, process.env.PATH].join ':' process.env.VIRTUAL_ENV = virtualenv console.log "Activated virtualenv at #{virtualenv}" ) # Explicitly define PATH and detect project virtualenvs process.env.PATH = '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' activateVirtualenv() # Ensure that Python correctly outputs Unicode characters process.env.PYTHONIOENCODING = 'utf_8' # Prevent Python from generating bytecode (.pyc, .pyo) files process.env.PYTHONDONTWRITEBYTECODE = '1' module.exports = class AbstractProvider regex: '' selector: '.source.php' inclusionPriority: 1 excludeLowerPriority: true # Build the snippet from the suggestion getFunctionSnippet: (word, elements) -> body = word + "(" lastIndex = 0 # Non optional elements for arg, index in elements.parameters body += ", " if index != 0 body += "${" + (index+1) + ":" + arg + "}" lastIndex = index+1 # Optional elements. One big same snippet if elements.optionals.length > 0 body += "${" + (lastIndex + 1) + ":[" body += "," if lastIndex != 0 lastIndex += 1 for arg, index in elements.optionals body += ", " if index != 0 body += arg body += "]}" body += ")$0" return body # Return the prefix to delete if press enter getPrefix: (editor, bufferPosition) -> # Get the text for the line up to the triggered buffer position line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition]) # Match the regex to the line, and return the match matches = line.match(@regex) # Looking for the correct match if matches? for match in matches start = bufferPosition.column - match.length if start >= 0 word = editor.getTextInBufferRange([[bufferPosition.row, bufferPosition.column - match.length], bufferPosition]) if word == match return match return '' 'menu': [ 'label': 'Packages' 'submenu': [ 'label': 'Markdown' 'submenu': [ 'label': 'Toggle Preview' 'command': 'markdown-preview:toggle' ] ] ] 'context-menu': '.markdown-preview': 'Copy': 'core:copy' 'Save As HTML\u2026': 'core:save-as' { jQuery: $ } = uploadcare uploadcare.namespace 'utils', (ns) -> trackLoading = (image, src) -> def = $.Deferred() if src image.src = src if image.complete def.resolve(image) else $(image).one 'load', => def.resolve(image) $(image).one 'error', => def.reject(image) def.promise() ns.imageLoader = (image) -> # if argument is an array, treat as # load(['1.jpg', '2.jpg']) if $.isArray(image) return $.when.apply(null, $.map(image, ns.imageLoader)) if image.src return trackLoading(image) else return trackLoading(new Image(), image) ns.videoLoader = (src) -> def = $.Deferred() $('
    ") @$el.html($section) $section.addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1]) for subview in @subviews $section.append(subview.render().$el) @ #= require_self #= require_tree ./templates #= require_tree ./models #= require_tree ./views #= require_tree ./routers window.Water = Models: {} Collections: {} Routers: {} Views: {} $ -> fetcher = window.tree_fetcher = new Water.TreeFetcher(repository_path: gon.repository_path, ref: gon.ref) tree_view = window.tree_view = new Water.TreeView(el: $("#spine"), model: window.tree_fetcher) breadcrumb_set = window.breadcrumb_set = new Water.BreadcrumbSet() breadcrumb_view = window.breadcrumb_view = new Water.BreadcrumbView( el: $("#breadcrumbs") model: breadcrumb_set template: JST['backbone/views/breadcrumb'] ) controller = window.tcl = new Water.TreesController(fetcher: fetcher, breadcrumbs: breadcrumb_set) Backbone.history.start() # Fetch the root tree view controller.trigger("root") class App.Models.User extends App.Model urlRoot: 'users', defaults: user_settings: { avatar: 'http://i.imgur.com/i31E9hh.jpg', username: '', website: '', email: '', interests: '', name: '', skills: '', github_handle: '', twitter_handle: '', linkedin_handle: '', description: '', positions: '' }, user_github: { }, user_tweets: { }Sprangular.service "Orders", ($http) -> service = find: (number) -> $http.get("/api/orders/#{number}") .then (response) -> service._loadOrder(response.data) all: -> $http.get("/api/orders") .then (response) -> _.map response.data, (record) -> service._loadOrder(record) _loadOrder: (data) -> order = new Sprangular.Order order.load(data) service # BeamWars - A multiplayer in-browser remake of the Mac game of the same name # Copyright (C) 2013 Aaron Hill # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see http://www.gnu.org/licenses/. define([], -> class Position constructor: (@pos, @direction, @time) -> @x = pos[0] @y = pos[1] Position ) 'menu': [ 'label': 'Find' 'submenu': [ { 'label': 'Find in Buffer', 'command': 'find-and-replace:show'} { 'label': 'Replace in Buffer', 'command': 'find-and-replace:show-replace'} { 'type': 'separator' } { 'label': 'Find in Project', 'command': 'project-find:show'} { 'type': 'separator' } { 'label': 'Find Next', 'command': 'find-and-replace:find-next'} { 'label': 'Find Previous', 'command': 'find-and-replace:find-previous'} { 'label': 'Replace Next', 'command': 'find-and-replace:replace-next'} { 'label': 'Replace All', 'command': 'find-and-replace:replace-all'} { 'type': 'separator' } ] ] 'context-menu': '.tree-view > li.directory': 'Search in this directory': 'project-find:show-in-current-directory' # Description: # Youtube Feeds # # Dependencies: # None # # Configuration: # None # ## Commands: # hubot yf add # hubot yf remove # hubot yf list # # Author: # Eluinhost module.exports = (robot) -> robot.respond /yf add (.*?)$/, (msg) -> # do stuff robot.respond /yf remove (.*?)$/, (msg) -> # do stuff robot.respond /yf list$/, (msg) -> # do stuffcamelCase = (s) -> (-> console.log 'foo' )() isString = (obj) -> obj.constructor == String isjQuery = (obj) -> obj.constructor == jQuery createTemplate = (tmpl) -> tmpl = tmpl.html() if isjQuery tmpl div = document.createElement 'div' div.innerHTML = tmpl jQuery div findDataAttr = (field, key) -> dataAttr = '' if field.dataset dataAttr = field.dataset['glue' + key[0].toUpperCase() + key.split('').splice(1,key.length).join ''] else dataAttr = attr for attr in field.attributes when attr.name == 'data-glue-' + key dataAttr.value || dataAttr parse = (field, key, value) -> field = field.cloneNode true dataAttr = findDataAttr field, key if(dataAttr) field[dataAttr] = value else field.textContent = value field glue = (template, data) -> return data if !data || !data.length data.reverse() res = [] tmpl = createTemplate template while data.length curr = data.pop() for own key, value of curr field = tmpl.find('[data-glue-' + key.toLowerCase() + ']').get 0 if field res.push parse field, key, value res jQuery.fn.extend glue: (data) -> jQuery glue this, data this.glue = glueSprangular.directive 'addressForm', -> restrict: 'E' templateUrl: 'addresses/form.html' scope: address: '=' countries: '=' controller: ($scope) -> $scope.selectedCountry = null $scope.$watch (-> $scope.address.countryId), (newCountryId) -> return unless newCountryId $scope.selectedCountry = _.find($scope.countries, (country) -> country.id == newCountryId) $scope.address.country = $scope.selectedCountry $scope.$watch (-> $scope.address.stateId), (newStateId) -> return unless newStateId state = _.find($scope.selectedCountry.states, (state) -> state.id == newStateId) $scope.address.state = state fs = require 'fs' child_process = require 'child_process' module.exports = Indexer = getCondaPackages: () -> output = child_process.execSync ' conda search ".*" --names-only ' names = output.toString().split('\n').slice(1) names.map (name) -> {name: name, description: null} getPipPackages: () -> output = child_process.execSync ' pip search ".*" ' lines = output.toString().split('\n') lines.map (line) -> words = line.split /\s+-/ {name: words[0], description: words[1]} build: () -> index = indexBuiltAt: new Date().toISOString() packages: python: {} r: {} return index args = process.argv.slice(2) result = Indexer.build() if '--save' in args result_json = JSON.stringify(result, null, 2) fs.writeFileSync(__dirname + '/data/packageIndex.json', result_json) console.log result gulp = require 'gulp' coffee = require 'gulp-coffee' browserify = require 'browserify' runSequence = require 'run-sequence' source = require 'vinyl-source-stream' del = require 'del' closureCompiler = require 'gulp-closure-compiler' gulp.task 'coffee', -> gulp.src('*.coffee') .pipe(coffee()) .pipe(gulp.dest('.')) gulp.src('src/*.coffee') .pipe(coffee()) .pipe(gulp.dest('src')) gulp.task 'browserify', -> browserify( entries: 'src/Vibrant.js' ) .bundle() .pipe(source('Vibrant.js')) .pipe(gulp.dest('dist')) gulp.task 'default', -> runSequence 'coffee', 'browserify', 'cleanup', 'closure' gulp.task 'cleanup', (cb) -> del ['src/Vibrant.js'], cb gulp.task 'closure', -> gulp.src('dist/Vibrant.js') .pipe(closureCompiler( compilerPath: 'bower_components/closure-compiler/lib/vendor/compiler.jar', fileName: 'Vibrant.min.js', continueWithWarnings: true )) .pipe(gulp.dest('dist')); gulp.task 'watch', -> gulp.watch ['**/*.coffee'], ['scripts']angular.module('doubtfire.config.root-controller', []) # # The Doubtfire root application controller # .controller("AppCtrl", ($rootScope, $state, $document, $filter, ExternalName) -> # Automatically localise page titles # TODO: (@alexcu) consider putting this in a directive? suffix = $document.prop "title" setPageTitle = (state) -> $document.prop "title", $filter("i18n")(state.data.pageTitle) + " | " + suffix # $rootScope.$on "i18nReady", -> # setPageTitle $state.current # $rootScope.$on "$stateChangeSuccess", (evt, toState) -> setPageTitle toState # Get the confugurable, external name of Doubtfire $rootScope.externalName = ExternalName ) coffee = require("coffee-script") less = require("less") jade = require("jade") express = require("express") gzippo = require("gzippo") assets = require("connect-assets") nconf = require("nconf") request = require("request") module.exports = app = express.createServer() apiUrl = nconf.get("url:api") ###s # Configure the server ### app.use assets(src: "#{__dirname}/assets", minifyBuilds: true) app.use express.static("#{__dirname}/assets") app.use require("./middleware/expose").middleware "url": nconf.get("url") "package": require("./package") app.use express.bodyParser() app.use app.router app.use express.logger() app.set "views", "#{__dirname}/views" app.set "view engine", "jade" app.set "view options", layout: false app.post "/", (req, res, next) -> res.set "X-XSS-Protection", 0 if req.body.files for filename, file of req.body.files if typeof file is "string" req.body.files[filename] = filename: filename content: file req.body.files[filename].filename ||= filename res.locals.plunk = req.body res.render "embed" app.get "/:id", (req, res, next) -> res.locals.plunk = "" res.render "embed" Augury.Views.Notifications.Index = Backbone.View.extend( initialize: -> _.bindAll @, 'renderTable' Augury.notifications.bind 'reset', @renderTable events: 'click button[type=submit]': 'search' render: -> @$el.html JST["admin/templates/notifications/index"]() @$el.find('#filter-reference-type, #filter-level').select2() @renderTable() @ renderTable: -> @$el.find('#notifications-view').html JST["admin/templates/notifications/notifications_table"](notifications: Augury.notifications) @$el.find('#notifications-table').find('td.actions a').on 'click', -> @parent().parent().next().toggle() @parent().parent().toggleClass('without-border') SyntaxHighlighter.all() search: -> reference_type = @$el.find('#filter-reference-type').select2('data').text.toLowerCase() reference_id = @$el.find('#filter-reference-id').val().toLowerCase() level = @$el.find('#filter-level').select2('data').text.toLowerCase() query = reference_type: reference_type reference_id: reference_id level: level Augury.notifications.query(query) ) "*": Zen: softWrap: false width: 160 core: disabledPackages: [ "notebook" "language-gfm" "wrap-guide" ] telemetryConsent: "limited" themes: [ "one-dark-ui" "zenburn-theme" ] "default-language": defaultLanguage: "Pandoc markdown" editor: fontSize: 16 showIndentGuide: true softWrap: true tabLength: 4 "exception-reporting": userId: "9d2cc651-880b-ad49-90cb-e8e61ea9a2b1" "markdown-preview": breakOnSingleNewline: true nvatom: directory: "~/Dropbox/notes" welcome: showOnStartup: false ".gfm.nvatom.source": editor: tabLength: 4 ".gfm.source": editor: tabLength: 4 $(document).on 'uic:domchange', -> margin_top = $('.navbar-fixed-top, .navbar-static-top').height() $('table[data-toggle=sticky-header]').floatThead useAbsolutePositioning: false scrollingTop: margin_top devices = MediaServer: require "./devices/MediaServer" upnp = createDevice: (name, type) -> new devices[type](name) module.exports = upnp socket = io.connect 'ws://45.55.200.178' angular.module("FarmBot").factory 'socket', ($rootScope) -> on: (eventName, callback) -> socket.on eventName, -> args = arguments $rootScope.$apply -> callback.apply socket, args emit: (eventName, data, callback) -> socket.emit eventName, data, -> args = arguments $rootScope.$apply -> callback.apply(socket, args) if callback connected: -> socket.connected Backbone = require 'backbone' Cookies = require 'cookies-js' analytics = require '../../lib/analytics.coffee' Promise = require 'bluebird-q' module.exports = class TipView extends Backbone.View events: 'click': 'onClick' 'click .js-close' : 'close' initialize: ({ @user }) -> # onClick: (e) -> e.preventDefault() e.stopPropagation() @collection.remove @model switch @model.get 'trigger' when 'new:channel' # Opens the new channel dialog $dropdown = $('.js-triggerable-channel-create') $dropdown.addClass hoverClass = 'DropdownHover--hover' # Closes it when the body is clicked $('body').one 'click', (e) -> $dropdown.removeClass hoverClass @maybeDisable() .finally => @maybeRedirect() @remove() maybeDisable: -> if @collection.length Promise.resolve() else Promise @user.save(show_tour: false) maybeRedirect: -> if @model.has 'href' window.location = @model.get 'href' close: (e) -> e.preventDefault() e.stopImmediatePropagation() @collection.remove @model @maybeDisable() .finally => @remove() remove: -> Cookies.set @model.id, true analytics.track.click 'Block tip closed', id: @model.id super 'use strict' $(document).foundation() angular .module('app', [ 'ngAnimate', # 'ngAria', 'ngCookies', 'ngMessages', 'ngResource', 'ngRoute', 'ngSanitize', # 'ngTouch', 'angular-growl', 'angularSpinner', ]) .config [ '$routeProvider', '$httpProvider', '$logProvider', 'growlProvider', ( $routeProvider, $httpProvider, $logProvider, growlProvider, ) -> $logProvider.debugEnabled false $routeProvider .when '/', templateUrl: 'static/view/listing.html' controller: 'ListingCtrl' .otherwise redirectTo: '/' growlProvider.globalPosition 'top-center' growlProvider.globalInlineMessages true growlProvider.globalTimeToLive success: 4000 info: 4000 warning: 4000 error: 4000 growlProvider.globalDisableCountDown true growlProvider.globalDisableIcons true $httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor) ] _ = require 'underscore' Collector = require '../lib/collector' describe "Collector", -> subject = null beforeEach -> subject = new Collector describe "getData", -> beforeEach -> it "creates a request with the proper options", -> keys = _.keys(subject.getData()) expect(keys).toContain 'user_agent' expect(keys).toContain 'screen_resolution' expect(keys).toContain 'pixel_ratio' expect(keys).toContain 'browser_resolution' expect(keys).toContain 'window_path' expect(keys).toContain 'session_id' expect(keys).toContain 'actor_login' #= require nanobar.js class @PodsProgressBar update: (factor) -> progress = factor * 100 @nanobar.go(progress) start: -> @nanobar = new Nanobar target: $('.progress-container').get(0) id: 'pods-progress' Pinpoint = require './pinpoint' t7e = require 't7e' enUs = require './en-us' t7e.load enUs translate = t7e module.exports = id: 'penguin' producer: translate 'div', 'producer' title: translate 'div', 'title' summary: translate 'div', 'summary' description: translate 'div', 'description' background: 'penguins-fpo.jpg' pages: [ {'Science': translate 'div', 'science'} ] tasks: penguins: type: 'drawing' question: translate 'div', 'whatToDo' choices: [{ value: Pinpoint label: translate 'div', 'choices.penguin' color: 'cyan' }, { value: Pinpoint label: translate 'div', 'choices.eggs' color: 'magenta' }, { value: Pinpoint label: translate 'div', 'choices.chick' color: 'yellow' }, { value: Pinpoint label: translate 'div', 'choices.other' color: 'black' details: [{ type: 'radio' question: 'What is this?' key: 'size' choices: [{ value: 'walrus' label: translate 'div', 'choices.seal' }, { value: 'seal' label: translate 'div', 'choices.shark' }, { value: 'shark' label: translate 'div', 'choices.walrus' }] }] }] dotenv = require 'dotenv' amqp = require 'amqp' MongoClient = require('mongodb').MongoClient dotenv.load() if !process.env.AMQP_URL or process.env.AMQP_URL.length < 1 console.error "Missing required environment variable AMQP_URL!" process.exit 1 if !process.env.AMQP_QUEUE_NAME or process.env.AMQP_QUEUE_NAME.length < 1 console.error "Missing required environment variable AMQP_QUEUE_NAME!" process.exit 1 if !process.env.MONGODB_URL or process.env.MONGODB_URL.length < 1 console.error "Missing required environment variable MONGODB_URL!" process.exit 1 MongoClient.connect process.env.MONGODB_URL, (err, db) -> if err console.log err process.exit 1 collection = db.collection 'events' connection = amqp.createConnection url: process.env.AMQP_URL connection.on 'ready', -> connection.queue process.env.AMQP_QUEUE_NAME, { passive: true }, (queue) -> queue.subscribe (msg) -> event = JSON.parse msg.data.toString('utf-8') minified_event = actor: country_iso: event.actor.country_iso created_at: new Date(event.created_at) collection.insert minified_event, (err, docs) -> if err console.log err process.exit 1 connection.on 'error', (err) -> console.error err process.exit 1 shell = require 'shell' module.exports = customCommand = (virtualFileSystem, {payload}) -> payload = JSON.parse(payload) switch payload.command when 'browser_open' shell.openExternal(payload.url) when 'learn_submit' # open atom browser window else console.log 'Unhandled custom command:', payload.command class Dashing.Lecturelist extends Dashing.Widget ready: -> @currentIndex = 0 @items = $(@node).find('li') @nextItem() @startCarousel() onData: (data) -> @currentIndex = 0 i = 0 if data.items.length == 0 @set 'empty', true while i < data.items.length capacity = data.items[i].capacity tickets = data.items[i].tickets people = "" x = capacity - tickets while x-- people += "" while tickets-- people += "" data.items[i].people = people i++ startCarousel: -> @items.hide() setInterval(@nextItem, 10000) nextItem: => items = @get('items') if items console.log(items[@currentIndex]) $(items[@currentIndex]).fadeOut => @currentIndex = (@currentIndex + 1) % items.length $(items[@currentIndex]).fadeIn() Species.TaxonConceptSearchTextField = Em.TextField.extend value: '' currentTimeout: null attributeBindings: ['autocomplete'] focusOut: (event) -> @.$().attr('placeholder', @get('placeholder')) @hideDropdown() if !@get('parentView.mousedOver') keyUp: (event) -> Ember.run.cancel(@currentTimeout) @currentTimeout = Ember.run.later(@, -> @showDropdown() @set('query', event.target.value) , 500) hideDropdown: () -> $('.search fieldset').removeClass('parent-focus parent-active') showDropdown: () -> if @.$().val().length > 2 $('.search fieldset').addClass('parent-focus parent-active') '.platform-darwin atom-text-editor[data-grammar="source dyndoc md stata"]': 'cmd-shift-x': 'markdown:toggle-task' '.platform-win32 atom-text-editor[data-grammar="source dyndoc md stata"]': 'ctrl-shift-x': 'markdown:toggle-task' '.platform-linux atom-text-editor[data-grammar="source dyndoc md stata"]': 'ctrl-shift-x': 'markdown:toggle-task' 'atom-text-editor[data-grammar="source dyndoc md stata"]': 'tab': 'markdown:indent-list-item' 'shift-tab': 'markdown:outdent-list-item' '_': 'markdown:emphasis' '*': 'markdown:strong-emphasis' '~': 'markdown:strike-through' '@': 'markdown:link' '!': 'markdown:image' Darkswarm.service "Geo", -> new class Geo OK: google.maps.GeocoderStatus.OK # Usage: # Geo.geocode address, (results, status) -> # if status == Geo.OK # console.log results[0].geometry.location # else # console.log "Error: #{status}" geocode: (address, callback) -> geocoder = new google.maps.Geocoder() geocoder.geocode {'address': address}, callback distanceBetween: (locatable, location) -> latLng = new google.maps.LatLng locatable.latitude, locatable.longitude google.maps.geometry.spherical.computeDistanceBetween latLng, location ETahi.InlineEditTextComponent = Em.Component.extend editing: false hasNoContent: (-> Em.isEmpty(@get('bodyPart.value')) ).property('bodyPart.value') focusOnEdit: (-> if @get('editing') Em.run.schedule 'afterRender', @, -> @$('textarea').focus() ).observes('editing') actions: toggleEdit: -> if @get('isNew') @set('bodyPart', null) else @get('model').rollback() @toggleProperty 'editing' save: -> unless @get('hasNoContent') if @get('isNew') @get('model.body').pushObject(@get('bodyPart')) @set('bodyPart', null) @get('model').save() @toggleProperty 'editing' 'menu': [ { 'label': 'View' 'submenu': [ { 'label': 'Toggle Git Panel' 'command': 'github:toggle-git-panel' } ] } { 'label': 'Packages' 'submenu': [ { 'label': 'GitHub', 'submenu': [ { 'label': 'Toggle' 'command': 'github:toggle-git-panel' } ] } ] } ] 'context-menu': '.github-FilePatchListView-item': [ { 'label': 'Open File' 'command': 'github:open-file' } ] describe "Munit.spies", -> it "should exist", -> expect(Munit.spies).to.be.an 'object' expect(Munit.spies.restoreAll).to.be.a 'function' describe "Munit.stubs", -> it "should exist", -> expect(Munit.stubs).to.be.an 'object' expect(Munit.stubs.restoreAll).to.be.a 'function' Species.SearchRoute = Ember.Route.extend serialize: (model) -> {params: '?' + $.param(model)} model: (params) -> geoEntitiesController = @controllerFor('geoEntities') geoEntitiesController.set('content', Species.GeoEntity.find()) # what follows here is the deserialisation of params # this hook is executed only when entering from url queryString = params.params #remove the questionmark if queryString[0] == '?' queryString = queryString.slice(1,queryString.length) params = $.deparam(queryString) params setupController: (controller, model) -> # this hook is executed whether entering from url or transition controller.setFilters(model) @controllerFor('taxonConcepts').set('content', Species.TaxonConcept.find(model)) renderTemplate: -> taxonConceptsController = @controllerFor('taxonConcepts') searchController = @controllerFor('search') # Render the `taxon_concepts` template into # the default outlet, and display the `taxonConcepts` # controller. @render('taxonConcepts', { into: 'application', controller: taxonConceptsController }) # Render the `search_form` template into # the outlet `search`, and display the `search` # controller. @render('searchForm', { into: 'taxonConcepts', outlet: 'search', controller: searchController }) @render('taxonConceptsResultsCount', { into: 'searchForm', outlet: 'count', controller: taxonConceptsController }) if Meteor.isClient if Package.ui Handlebars = Package.ui.Handlebars Handlebars.registerHelper 't9n', (x, prefix='') -> T9n.get(x, prefix) class T9n @get: (x, prefix='') -> _get(x, prefix) @map: (language, map) -> if not i18n._maps[language] i18n._maps[language] = {} _extend(i18n._maps[language], map) i18n._dep.changed() _get = (x, prefix='') -> prefix = (if prefix then prefix + '.' else '') # console.log "_get: " + (i18n prefix + _killDots x) (i18n prefix + _killDots x) || x _killDots = (x) -> x.replace(/\./g, '') _extend = (dest, from) -> props = Object.getOwnPropertyNames(from) props.forEach (name) -> if (typeof from[name]) is 'object' if (typeof dest[name]) is 'undefined' dest[name] = {} _extend(dest[name],from[name]) else destination = Object.getOwnPropertyDescriptor(from, name) Object.defineProperty(dest, name, destination) @T9n = T9n path = require 'path' {allowUnsafeNewFunction} = require 'loophole' archive = allowUnsafeNewFunction -> require 'ls-archive' {File} = require 'pathwatcher' fs = require 'fs-plus' Serializable = require 'serializable' module.exports= class ArchiveEditor extends Serializable atom.deserializers.add(this) @activate: -> atom.workspace.registerOpener (filePath='') -> # Check that the file path exists before opening in case something like # an http: URI is being opened. if archive.isPathSupported(filePath) and fs.isFileSync(filePath) new ArchiveEditor(path: filePath) constructor: ({path}) -> @file = new File(path) serializeParams: -> path: @getPath() deserializeParams: (params={}) -> if fs.isFileSync(params.path) params else console.warn "Could not build archive editor for path '#{params.path}' because that file no longer exists" getPath: -> @file.getPath() destroy: -> @file?.off() getViewClass: -> require './archive-editor-view' getTitle: -> if @getPath()? path.basename(@getPath()) else 'untitled' getUri: -> @getPath() isEqual: (other) -> other instanceof ArchiveEditor and @getUri() is other.getUri() setGlobalFocusPriority = (priority) -> env = jasmine.getEnv() env.focusPriority = 1 unless env.focusPriority env.focusPriority = priority if priority > env.focusPriority focusMethods = fdescribe: (description, specDefinitions, priority=1) -> setGlobalFocusPriority(priority) suite = describe(description, specDefinitions) suite.focusPriority = priority suite ffdescribe: (description, specDefinitions) -> @fdescribe(description, specDefinitions, 2) fffdescribe: (description, specDefinitions) -> @fdescribe(description, specDefinitions, 3) fit: (description, definition, priority=1) -> setGlobalFocusPriority(priority) spec = it(description, definition) spec.focusPriority = priority spec ffit: (description, specDefinitions) -> @fit(description, specDefinitions, 2) fffit: (description, specDefinitions) -> @fit(description, specDefinitions, 3) globals = [] globals.push(global) if global? globals.push(window) if window? for methodName, methodBody of focusMethods object[methodName] = methodBody for object in globals jasmine.getEnv().specFilter = (spec) -> env = jasmine.getEnv() globalFocusPriority = env.focusPriority parent = spec.parentSuite ? spec.suite if !globalFocusPriority true else if spec.focusPriority >= globalFocusPriority true else if not parent false else env.specFilter(parent) angular.module('loomioApp').directive 'userAvatar', ($window) -> scope: {user: '=', coordinator: '=?', size: '@?'} restrict: 'E' templateUrl: 'generated/components/user_avatar/user_avatar.html' replace: true controller: ($scope) -> unless _.contains(['small', 'medium', 'medium-circular', 'large', 'large-circular', 'featured'], $scope.size) $scope.size = 'small' _2x = -> $window.devicePixelRatio >= 2 $scope.gravatarSize = -> size = switch $scope.size when 'small' then 30 when 'medium', 'medium-circular' then 50 when 'large', 'large-circular' then 80 when 'featured' then 175 if _2x() then 2*size else size $scope.uploadedAvatarUrl = -> return unless $scope.user.avatarKind == 'uploaded' size = switch $scope.size when 'small' if _2x() then 'medium' else 'small' when 'medium', 'medium-circular' if _2x() then 'large' else 'medium' when 'large', 'large-circular' 'large' when 'featured' 'original' $scope.user.avatarUrl[size] return crypto = require 'crypto' {View} = require 'space-pen' module.exports = class ParticipantView extends View @content: -> @div class: 'collaboration-participant overlay floating large', => @video autoplay: true, outlet: 'video' @div class: 'volume-container', outlet: 'volumeContainer', => @div class: 'volume', outlet: 'volume' initialize: (@session, {id, email}) -> @session.waitForStream (stream) => @video[0].src = URL.createObjectURL(stream) @video.click => @toggleClass('large') # emailMd5 = crypto.createHash('md5').update(email).digest('hex') # @avatar.attr('src', "http://www.gravatar.com/avatar/#{emailMd5}?s=32") attach: -> rootView.append(this) # Centralizes configuration for currently running split tests # # eg. # header_design: # key: 'header_design' # outcomes: # old: 8 # new: 2 # # Or, `outcomes` can be an array, when you specify `weighting: 'equal'. # weighting: 'equal' # outcomes: [ # 'old' # 'new' # ] # edge: 'new' # dimension: 'dimension1' # Optional GA dimension # scope: 'local' # Optionally disable global initialization # control_group: 'old' #Defaults to `control`, Reflection sees this. # # For equal weighting, add `weighting: 'equal'` and `outcomes` as an array. # # Note: if there are no running tests # this should export empty Object # module.exports = {} module.exports = { # Used for cookie-ing and gradual roll out. # We'll start at 1 and work our way up, users in groups # less than that number will receive the new artwork page. new_artwork_page: key: 'new_artwork_page', outcomes: [ 0 1 2 3 4 5 6 7 8 9 ] weighting: 'equal' edge: 0 control_group: 9 } require './test_helpers' crc = require('../src') describe 'CRC', -> it 'should have a shortcut hexdigest', -> string = '1234567890' expected = '0d' crc.crc1(string).should.equal expected FactlinkJailRoot.showProxyMessage = -> content = """
    Factlink Browser
    """ frame = new FactlinkJailRoot.ControlIframe content frame.$el.css top: '10px' left: '10px' position: 'relative' frame.fadeIn() module.exports = [ # Role | Can access: "admin" # admin, moderator, ream, all "moderator" # moderator, team, all "team" # team, all "all" # all * ] express = require 'express' xmler = require 'node-xmler' router = express.Router() # GET: /explore router.get '/', (req, res) -> # TODO: Show latest letters res.render 'explore/index', title: req.config.title # GET: /explore/search router.get '/search', (req, res) -> client = req.baseXClient query = text: 'declare namespace tei="http://www.tei-c.org/ns/1.0"; ' + '//tei:title[. = "' + req.query.q + '"]' client.query query, (results) -> # TODO: Convert XML to JS object res.render 'explore/search', title: req.config.title query: req.query.q results: results module.exports = router module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['**/*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' indentation: level: 'ignore' src: ['src/*.coffee'] test: ['spec/*.coffee'] gruntfile: ['Gruntfile.coffee'] shell: test: command: 'node --harmony_collections node_modules/.bin/jasmine-focused --coffee --captureExceptions spec' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.registerTask 'clean', -> require('rimraf').sync('lib') grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['coffee', 'lint']) grunt.registerTask('test', ['coffee', 'lint', 'shell:test']) ### # Copyright 2015-2017 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### internal = [ 'admin' 'api/v2' 'beatmaps' 'beatmapsets' 'community' 'help' 'home' 'oauth' 'session' 'store' 'users' ].join('|') class @TurbolinksDisable constructor: -> addEventListener 'turbolinks:click', @cancelIfExternal cancelIfExternal: (event) -> prefix = "#{document.location.protocol}//#{document.location.host}/" unless RegExp("^(?:#{internal})(?:$|/)").test event.data.url.substr(prefix.length) event.preventDefault() # Start the crash reporter before anything else. require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub') path = require 'path' try require '../src/window' Atom = require '../src/atom' window.atom = Atom.loadOrCreate('spec') # Show window synchronously so a focusout doesn't fire on input elements # that are focused in the very first spec run. atom.getCurrentWindow().show() unless atom.getLoadSettings().exitWhenDone {runSpecSuite} = require './jasmine-helper' # Add 'exports' to module search path. exportsPath = path.join(atom.getLoadSettings().resourcePath, 'exports') require('module').globalPaths.push(exportsPath) # Still set NODE_PATH since tasks may need it. process.env.NODE_PATH = exportsPath document.title = "Spec Suite" runSpecSuite './spec-suite', atom.getLoadSettings().logFile catch error if atom?.getLoadSettings().exitWhenDone console.error(error.stack ? error) atom.exit(1) else throw error sysPath = require 'path' compileHBS = require './ember-handlebars-compiler' module.exports = class EmberHandlebarsCompiler brunchPlugin: yes type: 'template' extension: 'hbs' precompile: off root: null modulesPrefix: 'module.exports = ' constructor: (@config) -> if @config.files.templates.precompile is on @precompile = on if @config.files.templates.root? @root = sysPath.join 'app', @config.files.templates.root, sysPath.sep if @config.modules.wrapper is off @modulesPrefix = '' null compile: (data, path, callback) -> try tmplPath = path.replace @root, '' tmplPath = tmplPath.replace /\\/g, '/' tmplPath = tmplPath.substr 0, tmplPath.length - sysPath.extname(tmplPath).length tmplName = "Ember.TEMPLATES['#{tmplPath}']" if @precompile is on content = compileHBS data.toString() result = "#{@modulesPrefix}#{tmplName} = Ember.Handlebars.template(#{content});" else content = JSON.stringify data.toString() result = "#{@modulesPrefix}#{tmplName} = Ember.Handlebars.compile(#{content});" catch err error = err finally callback error, result {Client} = require "mysql" fs = require "fs" context = compiler: require "../../lib/compiler" object: { id: 1, rgt: 1, lft: 2, permalink: "home" } reflector: (callback) -> configuration = JSON.parse fs.readFileSync("#{__dirname}/../../configuration.json", "utf8") mysql = configuration.databases.mysql client = new Client() client.host = mysql.hostname client.user = mysql.user client.password = mysql.password client.database = mysql.name schema = {} client.query """ SELECT columns.* FROM information_schema.tables AS tables JOIN information_schema.columns AS columns USING (table_catalog, table_schema, table_name) WHERE table_type = 'BASE TABLE' AND tables.table_schema NOT IN ('pg_catalog', 'information_schema') """, (error, results, fields) => if error callback error else for column in results (schema[column.TABLE_NAME] or= []).push(column.COLUMN_NAME) client.destroy() console.log schema callback null, schema module.exports = require("proof") context MarkdownPreviewView = require './markdown-preview-view' module.exports = activate: -> atom.workspaceView.command 'markdown-preview:show', => @show() atom.workspace.registerOpener (uriToOpen) -> fs = require 'fs-plus' url = require 'url' {protocol, pathname} = url.parse(uriToOpen) return unless protocol is 'markdown-preview:' and fs.isFileSync(pathname) new MarkdownPreviewView(pathname) show: -> editor = atom.workspace.getActiveEditor() unless editor? and editor.getGrammar().scopeName is "source.gfm" console.warn("Can not render markdown for '#{editor?.getUri() ? 'untitled'}'") return previousActivePaneView = atom.workspaceView.getActivePaneView() uri = "markdown-preview://#{editor.getPath()}" atom.workspace.open(uri, split: 'right', searchAllPanes: true).done (markdownPreviewView) -> markdownPreviewView.renderMarkdown() previousActivePaneView.focus() # Helper class to contain status messages from the OFX response. type = require 'lang/type' class Status constructor: (@code, @status, @message) -> isSuccess: -> @code in ["0", "1"] isError: -> not @isSuccess() isGeneralError: -> @code is '2000' isAuthenticationError: -> @code is '15500' isAuthorizationError: -> @code is '15000' or @code is '15502' isUnknownError: -> @isError() and not @isGeneralError() and not @isAuthenticationError() and not @isAuthorizationError() wesabe.util.privacy.registerTaintWrapper detector: (o) -> type.is(o, wesabe.ofx.Status) getters: ["code", "status", "message"] module.exports = Status React = require 'react-atom-fork' {div} = require 'reactionary-atom-fork' module.exports = React.createClass render: -> {firstRow, lastRow, totalRows, gutter, height, parentView} = @props rows = for row in [firstRow...lastRow] classes = ['table-edit-row-number'] classes.push 'active-row' if parentView.isActiveRow(row) classes.push 'selected' if parentView.isSelectedRow(row) div { className: classes.join(' ') key: "row-number-#{row}" style: height: "#{parentView.getRowHeightAt(row)}px" top: "#{parentView.getRowOffsetAt(row)}px" }, row + 1 rows.unshift div className: 'table-edit-gutter-filler', totalRows div { className: 'table-edit-gutter' style: {height} }, rows #= require models/data/xhr_model ns = @edsc.models.data ns.Granules = do (ko, getJSON=jQuery.getJSON, XhrModel=ns.XhrModel, extend=$.extend) -> class GranulesModel extends XhrModel constructor: (query, @parentQuery) -> super('/granules.json', query) _toResults: (data) -> results = data.feed.entry for result in results if result.browse_flag == "true" result.edsc_browse_url = "https://api.echo.nasa.gov/browse-scaler/browse_images/granules/#{result.id}?h=170&w=170" results _computeSearchResponse: (current, callback) -> if @query?.validQuery() && @parentQuery?.validQuery() params = @params() params.page_num = @page = 1 @_load(params, current, callback) params: -> parentParams = @parentQuery.params() params = {} for param in ['spatial', 'temporal'] parentValue = parentParams[param] params[param] = parentValue if parentValue? extend(params, @query.params()) exports = GranulesModel# variant autocompletion $(document).ready -> if $("#variant_autocomplete_template").length > 0 window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text()) window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text()) window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text()) return formatVariantResult = (variant) -> variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined` variantTemplate variant: variant $.fn.variantAutocomplete = -> @select2 placeholder: Spree.translations.variant_placeholder minimumInputLength: 3 initSelection: (element, callback) -> $.get Spree.routes.variants_search + "/" + element.val(), {}, (data) -> callback data ajax: url: Spree.url(Spree.routes.variants_api) quietMillis: 200 datatype: "json" data: (term, page) -> q: product_name_or_sku_cont: term token: Spree.api_key results: (data, page) -> window.variants = data["variants"] results: data["variants"] formatResult: formatVariantResult formatSelection: (variant) -> if !!variant.options_text variant.name + " (#{variant.options_text})" else variant.name angular.module 'frontendAdmin' .factory 'MnoeApiSvc', ($log, Restangular, inflector) -> return Restangular.withConfig((RestangularProvider) -> RestangularProvider.setBaseUrl('/mnoe/jpi/v1') RestangularProvider.setDefaultHeaders({Accept: "application/json"}) # Unwrap api response RestangularProvider.addResponseInterceptor( (data, operation, what, url, response, deferred) -> extractedData = null if (operation == 'getList') extractedData = data[what] else if (operation == 'put' || operation == 'post') what = inflector.singularize(what) extractedData = data[what] else extractedData = data return extractedData ) ) angular.module('kassa').service('SessionService',[ '$http' '$q' '$window' ($http, $q, $window)-> currentUser = null equal = angular.equals setAuthenticated = (promise)-> promise.then (resp)-> currentUser = resp.data.user checkStatus = -> setAuthenticated $http.get('/users/me') signIn = (email, password, rememberMe=true)-> setAuthenticated $http.post('/user/sign_in', user: {email, password, rememberMe}) signOut = -> setAuthenticated($http.delete('/user/sign_out')).then -> #hacky way of redirecting since base-tag supported routing will hijack this via $location $window.location.href = '/user/sign_in' #load the current user if signed in and set to promise that will be resolved and watched automatically currentUser = checkStatus() isCurrentUser = (user)-> equal(currentUser, user) { checkStatus: checkStatus signIn: signIn signOut: signOut currentUser: (ensurePromise=true)-> if ensurePromise then $q.when(currentUser) else currentUser isCurrentUser: isCurrentUser } ])NotFoundError = (message) -> error = new Error(message) error.name = "NotFoundError" error.__proto__ = NotFoundError.prototype return error NotFoundError.prototype.__proto__ = Error.prototype ServiceNotConfiguredError = (message) -> error = new Error(message) error.name = "ServiceNotConfiguredError" error.__proto__ = ServiceNotConfiguredError.prototype return error ServiceNotConfiguredError.prototype.__proto__ = Error.prototype TooManyRequestsError = (message) -> error = new Error(message) error.name = "TooManyRequestsError" error.__proto__ = TooManyRequestsError.prototype return error TooManyRequestsError.prototype.__proto__ = Error.prototype InvalidNameError = (message) -> error = new Error(message) error.name = "InvalidNameError" error.__proto__ = InvalidNameError.prototype return error InvalidNameError.prototype.__proto__ = Error.prototype UnsupportedFileType = (message) -> error = new Error(message) error.name = "UnsupportedFileType" error.__proto__ = UnsupportedFileType.prototype return error UnsupportedFileType.prototype.__proto___ = Error.prototype module.exports = Errors = NotFoundError: NotFoundError ServiceNotConfiguredError: ServiceNotConfiguredError TooManyRequestsError: TooManyRequestsError InvalidNameError: InvalidNameError UnsupportedFileType: UnsupportedFileType class window.PageTitle constructor: (@reveal, @prefix) -> @title = document.querySelector 'title' @prefix ?= @title.innerHTML @total = document.querySelectorAll(".reveal .slides > section:not(.stack)").length + 1 @reveal.addEventListener 'slidechanged', => @render arguments... @render(indexh: @reveal.getIndices().h) render: (e) -> @title.innerHTML = "#{@prefix}: #{e.indexh} of #{@total}" # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': 'atom-text-editor': [ { 'label': 'Toggle atom-ethereum-interface' 'command': 'eth-interface:toggle' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Atom Ethereum Interface' 'submenu': [ { 'label': 'Compile code' 'command': 'eth-interface:compile' } { 'label': 'Build compiled' 'command': 'eth-interface:build' } { 'label': 'Togggle view' 'command': 'eth-interface:toggle' } { 'label': 'Create' 'command': 'atom-solidity:toggle' } ] ] } ] Sprangular.directive 'shippingRateSelection', -> restrict: 'E' templateUrl: 'shipping/rates.html' scope: order: '=' controller: ($scope, Cart) -> $scope.loading = false $scope.rates = [] $scope.$watch 'order.shipping_method_id', (shippingMethodId) -> rate = _.find($scope.rates, (rate) -> rate.shippingMethodId == shippingMethodId) if rate $scope.order.shipTotal = rate.cost else $scope.order.shipTotal = 0 $scope.order.updateTotals() # use $scope.$watchGroup when its released for expr in ['order.actualShippingAddress().country', 'order.actualShippingAddress().state', 'order.actualShippingAddress().zipcode'] $scope.$watch expr, -> return if $scope.loading $scope.loading = true order = $scope.order address = order.actualShippingAddress() Cart.shippingRates({countryId: address.countryId, stateId: address.stateId, zipcode: address.zipcode}) .then (results) -> $scope.rates = results order.shipping_method_id = null unless _.find(results, (rate) -> rate.shippingMethodId == order.shipping_method_id) $scope.loading = false Testributor.Pages ||= {} class Testributor.Pages.ProjectWizard show: ()-> $(".multi-select").select2() $fetchRepos = $('.js-fetch-repos') $fetchingRepos = $('.js-fetching-repos') currentPath = $fetchRepos.data('current-path') Pace.ignore(-> jqxhr = $.get(currentPath, (data, xhr)-> $fetchRepos.hide() $fetchingRepos.hide() $fetchRepos.append(data).fadeIn('slow') ).fail(-> $fetchingRepos.hide() alert('Connection with github interrupted!') $fetchRepos.append('We were not able to complete this action.').fadeIn('slow') )) Liquid = require "../liquid" Promise = require "bluebird" module.exports = class Liquid.Engine constructor: -> @tags = {} @registerFilter Liquid.StandardFilters isSubclassOf = (klass, ofKlass) -> unless typeof klass is 'function' false else if klass == ofKlass true else isSubclassOf klass.__super__?.constructor, ofKlass for own tagName, tag of Liquid continue unless isSubclassOf(tag, Liquid.Tag) isBlockOrTagBaseClass = [Liquid.Tag, Liquid.Block].indexOf(tag.constructor) >= 0 @registerTag tagName.toLowerCase(), tag unless isBlockOrTagBaseClass registerTag: (name, tag) -> @tags[name] = tag registerFilter: (obj) -> Liquid.Strainer.globalFilter obj parse: (source) -> template = new Liquid.Template template.parse @, source noflo = require 'noflo' path = require 'path' utils = require '../utils' # @runtime noflo-nodejs # @name SWTDetect exports.getComponent = -> c = new noflo.Component c.icon = 'font' c.description = 'Stroke Width Transform text detector' c.inPorts.add 'canvas', datatype: 'object' description: 'Canvas of image to be detected' c.outPorts.add 'out', datatype: 'object' description: 'Bounding boxes of detected text' c.outPorts.add 'error', datatype: 'object' required: false noflo.helpers.WirePattern c, in: 'canvas' out: ['out', 'error'] forwardGroups: true async: true , (canvas, groups, outPorts, callback) -> utils.writeCanvasTempFile canvas, (err, tmpFile) -> if err outPorts.error.send err do callback return bin = path.join __dirname, "../build/Release/swtdetect" cmd = "#{bin} #{tmpFile.path}" utils.runCmd cmd, tmpFile, (err, val) -> if err outPorts.error.send err do callback return outPorts.out.send val do callback Subscription = require('../../models/Subscription').Subscription logger = require("logger-sharelatex") ObjectId = require('mongoose').Types.ObjectId module.exports = getUsersSubscription: (user_or_id, callback)-> if user_or_id? and user_or_id._id? user_id = user_or_id._id else if user_or_id? user_id = user_or_id logger.log user_id:user_id, "getting users subscription" Subscription.findOne admin_id:user_id, (err, subscription)-> logger.log user_id:user_id, "got users subscription" callback(err, subscription) getMemberSubscriptions: (user_id, callback) -> logger.log user_id: user_id, "getting users group subscriptions" Subscription.find(member_ids: user_id).populate("admin_id").exec callback getSubscription: (subscription_id, callback)-> Subscription.findOne _id:subscription_id, callback getSubscriptionByMemberIdAndId: (user_id, subscription_id, callback)-> Subscription.findOne {member_ids: user_id, _id:subscription_id}, {_id:1}, callback getGroupSubscriptionMemberOf: (user_id, callback)-> Subscription.findOne {member_ids: user_id}, {_id:1, planCode:1}, callback_ = require 'underscore' Backbone = require 'backbone' Genes = require '../../../../collections/genes.coffee' { Following } = require '../../../../components/follow_button/index.coffee' priceBuckets = require '../mixins/price_buckets.coffee' module.exports = initializeGeneArtists: -> @geneFollowing = new Following null, kind: 'gene' @geneFollowing.fetch data: size: 5 success: (collection, response, options) => @setupGenes collection setupGenes: (collection) -> @genes = new Genes collection.pluck('gene') $.when.apply(null, @genes.map (gene) => gene.trendingArtists.fetch data: size: 5 ).then => @renderGeneSuggestions() renderGeneSuggestions: -> @genes.each (gene) => @suggestions.add @createGeneSuggestionSet gene @renderSuggestions() createGeneSuggestionSet: (gene) -> new Backbone.Model id : gene.id name : "Suggested for you in #{gene.get 'name'}" suggestions : gene.trendingArtists React = require 'react' DiscussionPreview = require './discussion-preview' CommentLink = require './comment-link' CommentPreview = require './comment-preview' PromiseRenderer = require '../components/promise-renderer' parseSection = require './lib/parse-section' apiClient = require '../api/client' # This isn't very reuseable as it's prop is a comment resource with it's # linked discussion added on. Probably a better way to approach this. module.exports = React.createClass displayName: "TalkSearchResult" render: -> {discussion} = @props.data section = parseSection(discussion.section)
    Comment #{discussion.links.comments.indexOf(@props.data.id) + 1} in {discussion.title} {if section is 'zooniverse' else {(project) => } }
    initPage = -> # Fix stupid Chrome bug. # See https://code.google.com/p/chromium/issues/detail?id=388664 # $('form').each -> $(this).attr('action', this.action); # Autofocus form fields with autofocus. We need to do this even though # browsers do it natively because (due to Turbolinks), we're always just # on the same single page. Duh! # $('[autofocus="autofocus"]').focus() # Run dem trackers if available. # _gs('track') if (_gs?) ga('send', 'pageview') if (ga?) $(document) .on 'page:load', initPage .on 'ready', initPage # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/behind-atom-keymaps-in-depth 'atom-workspace': 'ctrl-cmd-a': 'simple-align:align' module.exports = (grunt) -> return { express: files: [ 'Gruntfile.coffee' 'server-src/*.coffee' 'config/*.yml' ] options: spawn: false tasks: ['copy:app', 'coffee:server', 'express:dev'] client: files: [ '<%= src %>/*.coffee' '<%= src %>/views/*.coffee' '<%= src %>/util/*.coffee' ] tasks: ['copy:app', 'publish'] coffee2css: files: [ 'grunt/tasks/color2css.coffee' '<%= src %>/color.coffee' ] tasks: ['coffee2css', 'publish'] less: files: ['<%= styles %>/**/*.less'] tasks: ['less', 'publish'] i18n: files: ['<%= locales %>/*.yaml'] tasks: ['i18next-yaml', 'publish'] jade: files: ['<%= views %>/**/*.jade'] tasks: ['jade', 'publish'] livereload: options: livereload: true files: [ '<%= watch.express.files %>' '<%= watch.client.files %>' '<%= watch.coffee2css.files %>' #'<%= watch.less.files %>' 'static/css/*.css' '<%= watch.i18n.files %>' '<%= watch.jade.files %>' ] } Router.map -> @route "home", path: "/" layoutTemplate: "homeLayout" @route "dashboard", path: "/dashboard" waitOn: -> [ subs.subscribe 'events' ] data: -> events: Events.find().fetch() @route "eventsplan", path: "/events/plan" waitOn: -> [ Meteor.subscribe 'events' ] data: -> events: Events.find().fetch() @route "memberimport", path: "/member/import" waitOn: -> [ Meteor.subscribe 'user' ] data: -> members: Meteor.users.find().fetch() Router.waitOn -> [ Meteor.subscribe 'user' Meteor.subscribe 'events' Meteor.subscribe 'helpertasks' Meteor.subscribe 'helpertaskTypes' Meteor.subscribe 'skills' ]AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @metadata.name) disable: -> atom.config.removeAtKeyPath('core.themes', @metadata.name) goog = goog or goog = require: -> goog.require 'spark.components.ToggleSwitch' describe 'spark.components.ToggleSwitch', -> toggle = null element = null beforeEach -> toggle = new spark.components.ToggleSwitch name: 'agreed' element = toggle.getElement() it 'should extend spark.components.LabeledInput', -> expect(toggle instanceof spark.components.LabeledInput).toBeTruthy() options = toggle.getOptions() expect(options.name).toBe 'agreed' it 'should default options', -> toggle = new spark.components.ToggleSwitch expect(toggle.getOptions()).toBeDefined() expect(toggle.getOptions().checked).toBe no it 'should be checked if checked passed in options', -> toggle = new spark.components.ToggleSwitch checked: yes expect(toggle.input.isChecked()).toBeTruthy() it 'should check/uncheck input and return the correct state', -> expect(toggle.isChecked()).toBeFalsy() toggle.check() expect(toggle.input.isChecked()).toBeTruthy() toggle.uncheck() expect(toggle.isChecked()).toBeFalsy() it 'should has extra class names', -> toggle = new spark.components.ToggleSwitch cssClass: 'blue custom' expect(toggle.hasClass('blue')).toBeTruthy() expect(toggle.hasClass('custom')).toBeTruthy() it 'should emit StateChanged event with proper state', -> state = null toggle.on 'StateChanged', (e) -> state = e.data toggle.check() expect(state).toBeTruthy() toggle.check() # try to check again to test state change expect(state).toBeTruthy() toggle.uncheck() expect(state).toBeFalsy() $(document).on 'page:load ready', -> $('#circle_role_role_type').on 'change', (e)-> $type = $(e.target) $name = $type.siblings('#circle_role_name') console.log(e) console.log($type.val()) if $type.val() == "circle.custom" $name.removeClass("hidden") else $name.addClass("hidden") $name.val("") $('#add-role a').on 'click', (e)-> $('#add-role').addClass('hidden') $('#add-role-fields').removeClass('hidden') clipboard = new Clipboard('button[type="submit"]'); clipboard.on 'success', (e)-> e.clearSelection() Lale.Flash.info I18n.t('workflow.copied') $('.activate_pending_user').closest('form') .on 'ajax:success', (event)-> $(event.target.closest('tr')).fadeOut 'duration': 1000, complete: -> badge = $('#admin_link').children('span.badge') task_count = parseInt(badge.text()) if (task_count == 1) badge.fadeOut() $('.tab-nav .invite .before-icon').fadeOut() else badge.text(task_count - 1) Lale.Flash.info I18n.t('workflow.activation_success') .on 'ajax:error', (event)-> Lale.Flash.error I18n.t('workflow.activation_error') u = up.util e = up.element $ = jQuery beforeEach -> jasmine.addMatchers toHaveOpacity: (util, customEqualityTesters) -> compare: (element, expectedOpacity, tolerance = 0.0) -> element = e.get(element) actualOpacity = e.styleNumber(element, 'opacity') result = {} result.pass = Math.abs(expectedOpacity - actualOpacity) <= tolerance unless result.pass result.message = u.sprintf("Expected %o to have opacity %o, but it was %o (tolerance ±%o)", element, expectedOpacity, actualOpacity, tolernace) return result # Navigation (($) -> circle = $.sammy("body", -> # Page class Page constructor: (@name, @title) -> render: -> document.title = "Circle - " + @title $("body").attr("id",@name).html HAML['header'](renderContext) $("body").append HAML[@name](renderContext) $("body").append HAML['footer'](renderContext) load: (show) -> self = this $.getScript "assets/views/outer/#{@name}/#{@name}.hamlc", -> self.render() if show? display: -> if HAML? and HAML[@name]? @render() else @load(true) # Pages home = new Page("home", "Continuous Integration made easy") about = new Page("about", "About Us") # Navigation @get "/", (context) -> home.display() @get "/#about", (context) -> about.display() ) # Run the application $ -> circle.run "/" ) jQuery # Placeholder Polyfill $(window).load -> $("input, textarea").placeholder() Marbles.Views.NavigationActive = class NavigationActiveView extends Marbles.View @view_name: 'navigation_active' @buildMappingRegexp: (mapping) -> new RegExp("#{mapping.replace("*", ".*?")}") initialize: -> @active_class = Marbles.DOM.attr(@el, 'data-active-class') @active_selector = Marbles.DOM.attr(@el, 'data-active-selector') @buildActiveMapping() @markActiveItem() Marbles.history.on 'route', (router, name, args) => @markActiveItem() buildActiveMapping: => @active_mapping = [] for el in Marbles.DOM.querySelectorAll(@active_selector, @el) continue unless mapping = Marbles.DOM.attr(el, 'data-match-url') reg = @constructor.buildMappingRegexp(mapping) @active_mapping.push([reg, el]) @active_mapping = _.sortBy(@active_mapping, ( (item) => item[0].source.length * -1 )) markActiveItem: => path = window.location.pathname matched = false for item in @active_mapping [reg, el] = item if !matched && reg.test(path) matched = true Marbles.DOM.addClass(el, @active_class) else Marbles.DOM.removeClass(el, @active_class) RocketChat.models.Statistics = new class extends RocketChat.models._Base constructor: -> @_initModel 'statistics' # FIND ONE findOneById: (_id, options) -> query = _id: _id return @findOne query, options findLast: -> query = {} options = sort: createdAt: -1 return @find(query, options).fetch()?[0]module.exports = config: fontFamily: description: 'Experimental: set to gtk-3 to load the font settings from ~/.config/gtk-3.0/settings.ini' type: 'string' default: 'Cantarell' enum: [ 'Cantarell', 'Sans Serif', 'DejaVu Sans', 'Oxygen-Sans', 'gtk-3' ] fontSize: description: 'Set to -1 for auto' type: 'number' default: '-1' iconTheme: type: 'string' default: 'No Icons' enum: [ 'No Icons', 'Octicons', # 'Adwaita', # 'Breeze' ] activate: (state) -> # code in separate file so deferral keeps activation time down atom.themes.onDidChangeActiveThemes -> Config = require './config' Config.apply() define ['URI', 'app/views/base', 'app/p13n'], (URI, base, p13n) -> class ExportingView extends base.SMLayout template: 'exporting' events: 'click .exporting-button': 'exportEmbed' exportEmbed: (ev) -> EXPORT_PREVIEW_HOST = 'localhost' url = URI window.location.href url.host EXPORT_PREVIEW_HOST query = url.search true query.bbox = @getMapBoundsBbox() background = p13n.get('map_background_layer') if background not in ['servicemap', 'guidemap'] query.map = background url.search query window.location.href = url.toString() getMapBoundsBbox: -> # TODO: don't break architecture thusly __you_shouldnt_access_me_like_this = window.mapView.map wrongBbox = __you_shouldnt_access_me_like_this.getBounds().toBBoxString().split ',' rightBbox = _.map [1,0,3,2], (i) -> wrongBbox[i].slice(0,8) rightBbox.join ',' ipc = require 'ipc' remote = require 'remote' shell = require 'shell' {Emitter} = require 'event-kit' got = require 'got' module.exports = emitter: new Emitter showWindow: -> ipc.send('call-window-method', 'show') closeWindow: -> ipc.send("call-window-method", "close") focusWindow: -> ipc.send("call-window-method", "focus") maximizeWindow: -> ipc.send("call-window-method", "maximize") isWindowMaximized: -> remote.getCurrentWindow().isMaximized() minimizeWindow: -> ipc.send("call-window-method", "minimize") restoreWindow: -> ipc.send("call-window-method", "restore") shell: (method, args...) -> shell[method](args...) beep: -> shell.beep() query: (sql) -> new Promise((resolve, reject) -> got "http://localhost:9000/query/#{encodeURIComponent(sql)}", (err, body) -> return reject(err) if err try resolve(JSON.parse(body)) catch err reject(err) ) connect: (data) -> new Promise((resolve, reject) -> got "http://localhost:9000/connect/#{data.host}/#{data.user}/#{data.password}/#{data.database}", (err, body) -> return reject(err) if err or body is 'fail' resolve() ) Collection = require './collection' class TaskLogFiles extends Collection url: => fullPath = "#{ @directory }/#{ @path ? ''}" "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?" initialize: (models, { @taskId, @offerHostname, @directory, @path }) => parse: (taskLogFiles) => _.map taskLogFiles, (taskLogFile) => taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0] taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from() taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size) taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }" taskLogFile.isDirectory = taskLogFile.mode[0] is 'd' taskLogFile.relPath = taskLogFile.path.replace(@directory, '') taskLogFile.taskId = @taskId taskLogFile comparator: 'size' module.exports = TaskLogFilesparse_pararms = (querystring) -> params = {} querystring = querystring.split('&') for qs in querystring continue if not qs pair = qs.split('=') params[decodeURIComponent pair[0]] = decodeURIComponent pair[1] params Meteor.Router.add '/': -> Session.set('params', parse_pararms @querystring) return 'all' '/new': 'new_event' '/login': 'login' '/event/:title_id': (title_id) -> event_id = Events.findOne(title_id: encodeURIComponent(title_id)) # Backwards compatible: if title_id does not exist, assume the url is an event_id if not event_id event_id = title_id Session.set("event_id", event_id) return 'event_info' '/user/:user_id': (user_id) -> Session.set("user_id", user_id) return 'show_user' '/settings': () -> if Meteor.user() then 'edit_user' else 'login' '/search': (q) -> Session.set('params', parse_pararms @querystring) return 'search' Settings = require 'settings-sharelatex' module.exports = Features = externalAuthenticationSystemUsed: -> Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth? hasFeature: (feature) -> switch feature when 'registration' return not Features.externalAuthenticationSystemUsed() else throw new Error("unknown feature: #{feature}") Redis = require 'redis' Url = require 'url' info = Url.parse process.env.POO_REDIS_URL or "redis://localhost:6379/0" redis_client = Redis.createClient(info.port, info.hostname) redis_client.auth info.auth.split(":")[1] if info.auth module.exports = (robot) -> POO_TRACKER_KEY = "poops" POO_LATEST_KEY = "poops:latest_message" checkRedisForShit = -> redis_client.rpop POO_TRACKER_KEY, (err, reply) -> return console.error("Failed lindex with key '#{POO_TRACKER_KEY}' and index -1: #{err}") if err return if !reply room = process.env.HUBOT_IRC_ROOMS or "#arrakis" envelope = {} envelope.user = {} envelope.user.room = envelope.room = room envelope.user.type = 'groupchat' robot.send envelope, reply redis_client.set POO_LATEST_KEY, reply robot.respond /poo tracker( me)?/i, (res) -> redis_client.get POO_LATEST_KEY, (err, reply) -> return console.error("Failed get with key '#{POO_TRACKER_KEY}': #{err}") if err return if reply == null return res.send "Latest poo: #{reply}" robot.on 'registered', (message) -> setInterval -> checkRedisForShit() , 1000 import contest from "../../lib/contest" import label from "../../lib/label" import link from "../../lib/link" import page from "../../lib/page" import problem from "../../lib/problem" import topic from "../../lib/topic" export default greedy_2 = () -> return { topic: topic("Жадные алгоритмы", "Задачи на жадность", [ label("

    Довольно продвинутая теория (про коды Хаффмана можете не читать, можете прочитать \"для сведения\"). Еще вспомните теорию с уровня 2Б, и можете еще погуглить.

    "), problem(3356), problem(3380), problem(3589), problem(411), problem(1744), problem(2978), ], "greedy_advanced"), advancedProblems: [ problem(1987), problem(1782), problem(641), problem(583), problem(112096), ] }# Pre dependencies # (none) ###* @class XhrPromise Promise-based XMLHttpRequest ### module.exports = class XhrPromise null @get: (url, options) -> return _get("text", url, options) @getAsText: (url, options) -> return _get("text", url, options) @getAsArrayBuffer: (url, options) -> return _get("arraybuffer", url, options) @getAsBlob: (url, options) -> return _get("blob", url, options) @getAsJSON: (url, options) -> return _get("json", url, options) DEFAULT_OPTIONS = { data: null timeout: 0 headers: {} user: "" password: 0 } _get = (type, url, options = {}) -> options.method = "GET" return _send(type, url, options) _send = (type, url, options = {}) -> for k, v of DEFAULT_OPTIONS options[k] = v unless options[k]? return new Promise((resolve, reject) -> xhr = new XMLHttpRequest() xhr.onload = -> resolve(xhr) xhr.onerror = -> reject(xhr) xhr.responseType = type xhr.timeout = options.timeout xhr.open(options.method, url, true, options.user, options.password) xhr.setRequestHeader(k, v) for k, v of options.headers xhr.send(options.data) ) # return new Promise() # Post dependencies # (none) u = up.util beforeEach -> jasmine.addMatchers toMatchList: (util, customEqualityTesters) -> compare: (actualList, expectedList) -> actualList = u.toArray(actualList) if actualList expectedList = u.toArray(expectedList) if expectedList pass: actualList && expectedList && actualList.length == expectedList.length && u.all(expectedList, (elem) -> u.contains(actualList, elem)) helpers = if typeof require is 'undefined' then window.viewHelpers else require './view_helper' class MockRequest extends MockClass @chainedCallback 'success' @chainedCallback 'error' oldRequest = Batman.Request QUnit.module 'Batman.View partial rendering' setup: -> MockRequest.reset() Batman.Request = MockRequest teardown: -> Batman.View.viewSources = {} Batman.Request = oldRequest asyncTest "preloaded/already rendered partials should render", -> Batman.View.viewSources['test/one.html'] = "
    Hello from a partial
    " source = '
    ' node = helpers.render source, {}, (node) -> delay => equals node.children(0).html(), "
    Hello from a partial
    " asyncTest "unloaded partials should load then render", 2, -> source = '
    ' # Callback below doesn't fire until view's ready event, which waits for the partial to be fetched and rendered. node = helpers.render source, {}, (node) -> equal node.children(0).html(), "
    Hello from a partial
    " QUnit.start() setTimeout -> deepEqual MockRequest.lastInstance.constructorArguments[0].url, "views/test/one.html" MockRequest.lastInstance.fireSuccess('
    Hello from a partial
    ') , 25 numeral = require("numeral") balance = require("./crypto-balance") module.exports.run = -> addr = process.argv[2] unless addr console.log "Usage: balance
    " process.exit 1 balance addr, (error, items) -> if error console.error error process.exit 1 else for item in items if item.status == 'success' console.log "#{numeral(item.quantity).format("0,0.00000000")} #{item.asset}" else console.error item @createCookie = (name, value, days) -> expires = undefined if days date = new Date() date.setTime date.getTime() + (days * 24 * 60 * 60 * 1000) expires = "; expires=#{date.toGMTString()}" else expires = '' document.cookie = "#{encodeURIComponent(name)}=#{encodeURIComponent(value)}#{expires}; path=/" return @readCookie = (name) -> nameEQ = "#{encodeURIComponent(name)}=" ca = document.cookie.split(';') i = 0 while i < ca.length c = ca[i] c = c.substring(1, c.length) while c.charAt(0) is ' ' return decodeURIComponent(c.substring(nameEQ.length, c.length)) if c.indexOf(nameEQ) is 0 i++ null @eraseCookie = (name) -> createCookie name, "", -1 return $(document) .on("click", "[data-object~=set-cookie]", -> createCookie($(this).data("cookie-key"), $(this).data("cookie-value")) ) .on("click", "[data-object~=cookie-accept]", -> $(".cookie-consent").remove() createCookie("accepted_cookies", "1") false ) provider = require('./emojis-provider') module.exports = configDefaults: enableUnicodeEmojis: true enableMarkdownEmojis: true activate: -> provider.loadProperties() atom.commands.add 'atom-workspace', 'autocomplete-emojis:show-cheat-sheet': -> require('./emoji-cheat-sheet').show() getProvider: -> provider {View} = require 'atom' module.exports = class PhpDebugPanel extends View @content: -> @div class: "php-debug panel", => @div class: "panel-heading", "Node Debugger" @div class: "panel-body padded" "*": "exception-reporting": userId: "da976a4b-6a5d-3f34-7d9b-6bfdb74474ed" welcome: showOnStartup: false "one-dark-ui": {} core: themes: [ "native-ui" "base16-tomorrow-dark-theme" ] disabledPackages: [ "ex-mode" "vim-mode" ] editor: invisibles: {} tabLength: 4 fontSize: 12 "vim-mode": {} linter: {} "linter-clang": execPath: "/usr/bin/clang" verboseDebug: true "linter-pylint": executable: "/usr/local/bin/pylint" module "relative date" test "this year", -> now = moment() el = addTimeEl type: "date", datetime: now.toISOString() run() equal getText(el), now.format("MMM D") test "last year", -> before = moment().subtract("years", 1).subtract("days", 1) el = addTimeEl type: "date", datetime: before.toISOString() run() equal getText(el), before.format("MMM D, YYYY") class Lanes.Components.FormGroup extends Lanes.React.Component mixins: [ Lanes.React.Mixins.ReadEditingState Lanes.React.Mixins.FieldErrors ] propTypes: align: React.PropTypes.oneOf([ 'right', 'left', 'center' ]) bindDataEvents: -> model: "invalid-fields invalid-field:#{@getInvalidFieldName()}" render: -> className = _.classnames(className, @props.className, "field" editing: @props.editing display: false == @props.editing 'has-error': @isFieldValueInvalid() ) colProps = _.omit(@props, 'name', 'label', 'type', 'editing', 'display') valueClassNames = _.classnames('value', { "align-#{@props.align}": @props.align })
    {@props.children}
    class GroupAvatar extends JView constructor:(options = {}, data)-> options.cssClass = 'group-avatar-drop' groupsController = KD.getSingleton 'groupsController' super options, groupsController.getCurrentGroupData() groupsController.on 'GroupChanged', @bound 'render' render:(slug, group)-> if group @setTooltip title : """You are now in #{group.title} group.
    Click here to see group's homepage""" if slug is 'koding' @$().css backgroundImage : "url(images/logos/50.png)" else @$().css backgroundImage : \ "url(#{group.avatar or 'http://lorempixel.com/60/60/?' + @utils.getRandomNumber()})" click:-> super if KD.config.groupEntryPoint? KD.getSingleton('lazyDomController').showLandingPage() App.WatchFormChanges = forms: -> return $("form[data-watch-changes]") msg: -> if($("[data-watch-form-message]").length) return $("[data-watch-form-message]").data("watch-form-message") checkChanges: -> changes = false App.WatchFormChanges.forms().each -> form = $(this) if form.serialize() != form.data("watchChanges") changes = true if changes return confirm(App.WatchFormChanges.msg()) else return true initialize: -> if App.WatchFormChanges.forms().length == 0 || App.WatchFormChanges.msg() == undefined return $(document).off("page:before-change").on("page:before-change", -> App.WatchFormChanges.checkChanges()) App.WatchFormChanges.forms().each -> form = $(this) form.data("watchChanges", form.serialize()) # BeamWars - A multiplayer in-browser remake of the Mac game of the same name # Copyright (C) 2013 Aaron Hill # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see http://www.gnu.org/licenses/. define(['fabric'], (fabric) -> fabric = fabric.fabric if fabric.fabric? class Player constructor: (@name, pos, @canvas) -> @positions = [] @positions.push(pos) @current_line = new fabric.Polyline([], { stroke: 'blue', strokeWidth: 5, fille: 'white' left: 200 top: 200 }) lastPos: -> @positions[@positions.length - 1] currentLine: -> @current_line.points.slice() # Copy array currentLinePos: -> @current_line.points[@current_line.points.length - 1] addToLine: (pos) -> @current_line.points.push(pos) Player ) errors = require './errors' bodyParser = require 'body-parser' defaultHeaders = (request, response, next) -> response.header 'Content-Type', 'application/json; charset=utf-8' next() serverErrorHandling = (err, request, response, next) -> if err if err instanceof errors.HttpError response.status(err.statusCode).send(err.message) else console.error err response.sendStatus 500 jsonParser = (request, response, next) -> bodyParser.json() request, response, (err) -> if err next new errors.BadRequest 'Invalid JSON' else next() module.exports = defaultHeaders: defaultHeaders serverErrorHandling: serverErrorHandling jsonParser: jsonParser ETahi.InlineEditCheckboxComponent = Em.Component.extend editing: false isNew: false hasContent: Em.computed.notEmpty('bodyPart.value') hasNoContent: Em.computed.not('hasContent') checked: ((key, value, oldValue) -> if arguments.length > 1 #setter @set('bodyPart.answer', value) else #getter answer = @get('bodyPart.answer') answer == 'true' || answer == true ).property('bodyPart.answer') actions: toggleEdit: -> @sendAction('cancel', @get('bodyPart')) if @get('editing') @toggleProperty 'editing' save: -> if @get('hasContent') @sendAction('save', @get('bodyPart')) @toggleProperty 'editing' deleteItem: -> @sendAction('delete', @get('bodyPart')) saveModel: -> @sendAction('saveModel') gulp = require 'gulp' connect = require 'connect' httpProxy = require 'http-proxy' harp = require 'harp' http = require 'http' url = require 'url' livereload = require 'gulp-livereload' server = livereload() laerehost = if gulp.env.local then 'laeredev.co' else 'laere.co' target = host: laerehost port: 80 proxy = httpProxy.createProxyServer(target: target) proxyMiddleware = (req, res) -> proxy.web req, res gulp.task "connect", ["watch"], -> app = connect() .use(connect.logger('dev')) .use(harp.mount('./src')) .use(connect.logger('proxy :: :method :url :status - :response-time ms')) .use(proxyMiddleware) # If not found, proxy to api http.createServer(app).listen(1337) gulp.task "watch", -> gulp.watch("src/**").on "change", (e) -> server.changed(e.path) gulp.task "default", ["connect"]# Description: # Find the build status of an open-source project on Travis # Can also notify about builds, just enable the webhook notification on travis http://about.travis-ci.org/docs/user/build-configuration/ -> 'Webhook notification' # # Dependencies: # # Configuration: # None # # Commands: # hubot travis me / - Returns the build status of https://github.com// # # URLS: # POST /hubot/travis?room=[&type= robot.router.post "/hubot/magnum-ci", (req, res) -> try payload = JSON.parse req.body.payload user = {} user.room = payload.room if payload.room user.type = payload.type if payload.type robot.messageRoom '#tool-mobile', "#{payload.title}" catch error console.log "travis hook error: #{error}. Payload: #{req.body.payload}" res.end JSON.stringify { send: true #some client have problems with and empty response, sending that response ion sync makes debugging easier }Q = require 'kew' nodeRedis = require 'redis' mysql = require 'mysql' config = require '../config' connect = ready: Q.defer() ### * - type (string) : 'production', 'development', 'testing' ### init: () -> # Connect to MySQL @mysql = mysql.createConnection config.mysql # Connect to Redis @redis = nodeRedis.createClient config.redis.port, config.redis.host @ready.resolve() module.exports = connect React = require 'react' Select = require 'react-select' apiClient = require '../api/client' debounce = require 'debounce' module.exports = React.createClass displayName: 'TagSearch' getDefaultProps: -> multi: true searchTags: (value, callback) -> if value is '' callback null, { options: [] } else apiClient.type('tags').get search: "#{value}", page_size: 10 .then (tags) => opts = for tag in tags { value: tag.name, label: tag.name } callback null, { options: opts } handleInputChange: ({target}) -> value = target.value if value.slice("-1") is "," @refs.tagSearch.addValue(value.slice(0, -1)) render: -> value = @props.value.join(',') """ insert_date_input: -> @el.each -> $input = date_input() $input.appendTo(@) $input.datepicker(format: 'dd/mm/yyyy') $input.siblings('label').attr('for', $input.attr('id')) update_select_values: (el) -> date_parts = el.value.split('/') return unless date_parts.length is 3 date_parts.reverse() $selects = @find(el).siblings('select') $selects.each (i) -> @value = parseInt(date_parts[i], 10) $selects.trigger('change') # modules Sequelize = require 'sequelize' db = require './db' Point = require './point' Game = require './game' # def model GamePoint = db.orm.define 'GamePoint', energy: Sequelize.INTEGER type: Sequelize.STRING 10 side: type: Sequelize.VIRTUAL get: -> return 'NEUTRAL' if this.energy is 0 return 'EARTHLINGS' if this.energy < 0 'STRALIENS' # def model assocs GamePoint.belongsTo Point, foreignKey: 'pointId' as: 'point' GamePoint.belongsTo Game, foreignKey: 'gameId' as: 'game' #export module.exports = GamePointclass window.Event @CLASSES: ['Board', 'Swimlane', 'Column', 'Story'] constructor: (object, type) -> for klass in Event.CLASSES if object instanceof window[klass] or object[klass.toLowerCase()]? window["#{klass}Event"]? && new window["#{klass}Event"](object, type) class window.EventConstructor extends Event constructor: (object, type) -> @["#{type}_observers"]? && @["#{type}_observers"](object) class window.ColumnEvent extends EventConstructor published_observers: (column) -> Column.redraw() Column.update_full_list() class window.SwimlaneEvent extends EventConstructor published_observers: (swimlane) -> Swimlane.redraw() window.MultiShippingAddress ||= {} $.extend(MultiShippingAddress, { SameAsBilling: {} }) class MultiShippingAddress.SameAsBilling.CopyBillToShip constructor: (@$form) -> @findShippingAddresses() @bindForm() @bindCountrySelects() billAddress: null shippingAddresses: [] getName: ($input) -> $input.attr('name').match(/.*\[(.*)\]$/)[1] bindForm: -> @$form.on 'submit', => @getBillAddress() @copyBillAddress() bindCountrySelects: -> $('.js-shipping-address select.country').on 'change', (e) -> id = $(e.currentTarget).parent().attr('id').match(/\d+/); Spree.updateState "#{ id }-address" findShippingAddresses: -> shippingAddresses = @$form.find('.js-shipping-address') @createToggleForm(address) for address in shippingAddresses createToggleForm: (address) -> @shippingAddresses.push(new MultiShippingAddress.SameAsBilling.ToggleForm ($ address)) copyBillAddress: -> @copyFormValues(address.inputs()) for address in @shippingAddresses when address.isChecked() copyFormValues: (addressInputs) -> @copyInputValue(($ input), addressInputs) for input in @billAddress copyInputValue: ($input, addressInputs) -> name = @getName $input addressInputs.filter("[name*=#{ name }]").val( $input.val() ).change() getBillAddress: -> @billAddress = @$form.find('#billing').find('input, select') describe 'buffer modifying linters', -> getModuleMain = -> atom.packages.getActivePackage('linter').mainModule.instance beforeEach -> waitsForPromise -> atom.packages.activatePackage('linter') waitsForPromise -> atom.workspace.open('test.txt') it 'is triggered before other linters', -> linter = getModuleMain() last = null normalLinter = grammarScopes: ['*'] scope: 'file' lintOnFly: false modifiesBuffer: false lint: -> last = 'normal' return [] bufferModifying = grammarScopes: ['*'] scope: 'file' lintOnFly: false modifiesBuffer: true lint: -> last = 'bufferModifying' return [] linter.addLinter(normalLinter) linter.addLinter(bufferModifying) waitsForPromise -> linter.getActiveEditorLinter().lint(false).then -> expect(last).toBe('normal')# This file contains custom Nylas error classes. # # In general I think these should be created as sparingly as possible. # Only add one if you really can't use native `new Error("my msg")` # A wrapper around the three arguments we get back from node's `request` # method. We wrap it in an error object because Promises can only call # `reject` or `resolve` with one argument (not three). class APIError extends Error constructor: ({@error, @response, @body, @requestOptions, @statusCode} = {}) -> @statusCode ?= @response?.statusCode @requestOptions ?= @response?.requestOptions @name = "APIError" @message = @body?.message ? @body ? @error?.toString?() @errorTitle = @error?.toString?() class TimeoutError extends Error constructor: -> module.exports = "APIError": APIError "TimeoutError": TimeoutError {View} = require 'atom' module.exports = class DevModeView extends View @content: -> @span class: 'inline-block icon icon-color-mode text-error' "*": editor: fontFamily: "Menlo" showIndentGuide: true tabLength: 2 invisibles: {} preferredLineLength: 120 softWrap: true fontSize: 14 core: ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" "vendor" ] disabledPackages: [ "background-tips" "exception-reporting" "metrics" "symbols-view" ] themes: [ "atom-dark-ui" "atom-dark-syntax" ] "spell-check": grammars: [ "text.plain" "source.gfm" "text.git-commit" ] welcome: showOnStartup: false "release-notes": viewedVersion: "0.89.0" "go-plus": {} "tree-view": {} react: {} "atom-beautify": _analyticsUserId: "cd7896cc-a009-4464-8536-4fc33b4c0706" "linter-eslint": eslintRulesDir: "client" disableWhenNoEslintrcFileInPath: true linter: lintOnChangeInterval: 2000 subtleLinterErrors: [ "rubocop" ] "atom-ctags": cmdArgs: "--exclude app/assets/javascripts/bundle* --exclude client/node_modules" "linter-rubocop": {} module "PubSub" require ["core/pubsub"], (pubsub) -> test "export aliases", -> ok pubsub.on is pubsub.respondTo, "on and respondTo" ok pubsub.off is pubsub.stopResponding, "off and stopResponding" test "simple on/fire", -> memoValue = null expectedMemo = "expected" pubsub.on "stim", (memo) -> memoValue = memo pubsub.fire "stim", expectedMemo ok memoValue is expectedMemo, "responder function was invoked" {BufferedProcess, CompositeDisposable} = require 'atom' path = require 'path' module.exports = class RubocopAutoCorrect constructor: -> @subscriptions = new CompositeDisposable @subscriptions.add atom.commands.add 'atom-workspace', 'rubocop-auto-correct:current-file': => if editor = atom.workspace.getActiveTextEditor() @run(editor) destroy: -> @subscriptions.dispose() autoCorrect: (filePath) -> basename = path.basename(filePath) command = atom.config.get('rubocop-auto-correct.rubocopCommandPath') args = ['-a', filePath] exit = (code) -> if (code == 0) atom.notifications.addSuccess("#{command} -a #{basename}") else atom.notifications.addError("Failer #{command} -a #{basename}") process = new BufferedProcess({command, args, exit}) process run: (editor) -> if editor.getGrammar().scopeName != "source.ruby" return atom.notifications.addError("Only use source.ruby") if editor.isModified() editor.save() @autoCorrect(editor.getPath()) MarkdownPreviewView = require 'markdown-preview/lib/markdown-preview-view' $ = require 'jquery' {$$$} = require 'space-pen' describe "MarkdownPreviewView", -> [buffer, preview] = [] beforeEach -> project.setPath(project.resolve('markdown')) buffer = project.bufferForPath('file.markdown') preview = new MarkdownPreviewView(buffer) afterEach -> buffer.release() describe "on construction", -> it "shows a loading spinner and fetches the rendered markdown", -> preview.setLoading() expect(preview.find('.markdown-spinner')).toExist() expect(preview.buffer.getText()).toBe buffer.getText() preview.fetchRenderedMarkdown() expect(preview.find(".emoji")).toExist() it "shows an error message on error", -> preview.setErrorHtml("Not a real file") expect(preview.text()).toContain "Failed" describe "serialization", -> it "reassociates with the same buffer when deserialized", -> newPreview = deserialize(preview.serialize()) expect(newPreview.buffer).toBe buffer noflo = require 'noflo' chai = require 'chai' unless chai StateToColor = require '../components/StateToColor.coffee' fs = require 'fs' path = require 'path' describe 'StateToColor component', -> c = null state = null color = null portalConfig = null beforeEach -> c = StateToColor.getComponent() portals = noflo.internalSocket.createSocket() state = noflo.internalSocket.createSocket() color = noflo.internalSocket.createSocket() c.inPorts.portals.attach portals c.inPorts.state.attach state c.outPorts.color.attach color portalConfig = JSON.parse fs.readFileSync path.resolve(__dirname, '../portals.json'), 'utf-8' portals.send portalConfig.portals describe 'receiving a neutral portal', -> it 'should set the color correctly', (done) -> color.on 'data', (color) -> chai.expect(color).to.equal "[30, \"0x403000\"]" done() state.send guid: portalConfig.mainportal team: 'NEUTRAL' state: 'stable' class @SharingTags.BaseShare url: null title: null description: null constructor: ({@url, @title, @description})-> @_assert_vars 'url' _open_popup: (api_url, params)-> share_url = if params then "#{api_url}?#{$.param(params)}" else api_url share_window = window.open share_url, 'Share Dialog', 'width=740,height=440' # share_window?.focus() clearInterval(@interval) iteration = 0 @interval = setInterval((=> iteration++ if @_open_popup_check(share_url, share_window, iteration) clearInterval @interval @_after_callback() ), 500) _open_popup_check: (share_url, share_window, iteration)=> # console.log("check desktop sharing", share_url, share_window, iteration) share_window?.closed || iteration >= 5 _before_callback: (provider)=> jQuery?(window).trigger("sharing_tags.share", url: @url, provider: provider) _after_callback: => jQuery?("body").trigger("sharing_tags.shared") _assert_vars: (vars...)-> for var_name in vars if ! @[var_name] arguments_list = '' arguments_list += " #{var_name}: '#{@[var_name]}'" for arg, val in vars throw new SharingTags.Error("Error could not initialize sharing class, with params: #{arguments_list}") _user_agent: -> window.navigator?.userAgentgit = require '../git' OutputView = require './output-view' BranchListView = require './branch-list-view' module.exports = # Extension of BranchListView # Takes the name of the remote to pull from class PullBranchListView extends BranchListView initialize: (@repo, @data, @remote) -> super confirmed: ({name}) -> @pull(name.split('/')[1]) @cancel() pull: (remoteBranch='') -> view = new OutputView() remote = @remote git.cmd args: ['fetch', @remote] cwd: @repo.getWorkingDirectory() stdout: (data) => if data.toString().length is 0 git.cmd args: ['merge', remote + "/" + remoteBranch] cwd: @repo.getWorkingDirectory() stdout: (data) -> view.addLine(data.toString()) stderr: (data) -> view.addLine(data.toString()) exit: (code) => view.finish() stderr: (data) -> view.addLine(data.toString()) # Once, 'pull' is fixed in Yosemite, revert back to this # pull: (remoteBranch='') -> # view = new OutputView() # git.cmd # args: ['pull', @remote, remoteBranch] # stdout: (data) -> view.addLine(data.toString()) # stderr: (data) -> view.addLine(data.toString()) # exit: (code) => view.finish() window.env = require 'env' window.utils = require 'utils' window.constants = require 'constants' window.app = require 'application' # Make all string methods available on _ _.mixin _.string.exports() # Set Vex default className vex.defaultOptions.className = 'vex-theme-default' # Patch jQuery ajax to always use xhrFields.withCredentials true _oldAjax = jQuery.ajax jQuery.ajax = (opts) -> opts.xhrFields ?= {} opts.xhrFields.withCredentials = true _oldAjax.call jQuery, opts $ -> app.initialize()angular.module('ad3').provider 'd3Service', () -> defaults = @defaults = {} @$get = ['$cacheFactory', '$rootScope', ($cacheFactory, $rootScope) -> cache = defaults.cache or $cacheFactory('d3Service') csv: (src, columns) -> results = cache.get(src) return results if results cache.put(src, results = []) d3.csv src, (row)-> datum = {} for name in columns name = name.trim() datum[name] = row[name] datum (error, rows) -> results.push.apply(results, rows) $rootScope.$apply() results ] @ angular.module 'Scrumble.common' .config ($stateProvider) -> $stateProvider .state 'tab', abstract: true templateUrl: 'common/states/base.html' controller: 'BaseCtrl' resolve: sprint: ($state, Sprint) -> Sprint.getActiveSprint().catch (err) -> return project: ($state, Project) -> Project.getUserProject().catch (err) -> return should = require 'should' {wd40, browser, base_url, login_url, home_url, prepIntegration} = require './helper' describe 'Free Trial', -> prepIntegration() before (done) -> wd40.fill '#username', 'free-trial-user', -> wd40.fill '#password', 'testing', -> wd40.click '#login', done before (done) -> browser.waitForElementByCss '.dataset-list', 4000, done it 'contains "14 days left"', (done) -> wd40.getText '.trial a', (err, text) -> text.toLowerCase().should.include '14 days left' done() describe 'Paid user', -> prepIntegration() before (done) -> wd40.fill '#username', 'ehg', -> wd40.fill '#password', 'testing', -> wd40.click '#login', done before (done) -> browser.waitForElementByCss '.dataset-list', 4000, done it 'does not contain "Free trial"', (done) -> wd40.getText 'body', (err, text) -> (/Free trial/i.test text).should.be.false done() {Range, Point} = require 'atom' CheckstyleBase = require './checkstyle-base' Violation = require '../violation' module.exports = class CoffeeLint extends CheckstyleBase buildCommand: -> command = [] userCoffeeLintPath = atom.config.get('atom-lint.coffeelint.path') if userCoffeeLintPath? command.push(userCoffeeLintPath) else command.push('coffeelint') command.push('--checkstyle') command.push(@filePath) command isValidExitCode: (exitCode) -> # CoffeeLint returns an exit code of 2 when everything worked, but the check failed. # And code 1 for parse errors. 0 <= exitCode <= 2 createViolationFromErrorElement: (element) -> column = element.$.column column ?= 1 bufferPoint = new Point(element.$.line - 1, column - 1) bufferRange = new Range(bufferPoint, bufferPoint) new Violation(element.$.severity, bufferRange, element.$.message) Handlebars.registerHelper 'toFixed', (number, digits) -> number.toFixed if Utils.isUndefined(digits) then digits Handlebars.registerHelper 'toPrecision', (number, precision) -> number.toPrecision if Utils.isUndefined(precision) then precision Handlebars.registerHelper 'toExponential', (number, fractions) -> number.toExponential if Utils.isUndefined(fractions) then fractions Handlebars.registerHelper 'toInt', (number) -> parseInt number, 10 Handlebars.registerHelper 'toFloat', (number) -> parseFloat number Handlebars.registerHelper 'addCommas', (number) -> number.toString().replace /(\d)(?=(\d\d\d)+(?!\d))/g, "$1," class Factlink.Prepare constructor: -> @$el = $(Factlink.templates.create) @$el.appendTo Factlink.el @$el.hide() @$el.bind "mouseup", (e) -> e.stopPropagation() @$el.bind "mousedown", (e) -> e.preventDefault() @$el.bind "click", (e) => e.preventDefault() e.stopPropagation() @startLoading() Factlink.createFactFromSelection() show: (top, left) => Factlink.set_position_of_element top, left, window, @$el @$el.fadeIn "fast" hide: (callback) => @$el.fadeOut "fast", => @stopLoading() if @_loading callback?() startLoading: -> @_loading = true @$el.addClass "fl-loading" stopLoading: -> @_loading = false @hide => @$el.removeClass "fl-loading" isVisible: -> @$el.is ":visible" angular.module('app.modules.tabs', [ 'app.modules.tabs.items' 'app.modules.tabs.review' 'app.modules.tabs.menus' 'app.modules.tabs.settings' # 'app.components.tabs.share' # 'app.components.tabs.notify' ]) .config ($stateProvider, $urlRouterProvider) -> $stateProvider .state "tab", url: "/tab" abstract: true templateUrl: "js/modules/tabs/tabs.html" # if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise "/tabs/items" #= require partystreusel/base class Readmore extends Partystreusel.Base @className = 'Readmore' constructor: (el) -> super @contentDiv = $('
    ') .append(@$el.contents()) .addClass('hide') @$el.append(@contentDiv) return if @contentDiv.text().trim() == '' @button = @renderButton('open') $(@button).bind 'click', @toggle @$el.append(@button) toggle: (event) => @button.toggleClass('open close') @button.text(@buttonText()) @contentDiv.slideToggle => @contentDiv.toggleClass('hide') @contentDiv.css('display', "") @contentDiv.removeAttr('style') if @contentDiv.attr('style') == '' return false buttonState: -> classes = @button.attr('class').split(' ') classes = classes.filter (v) -> v != 'button' classes[0] buttonText: (state = @buttonState()) -> I18n.t("readmore.button_text.#{state}") renderButton: (state) => text = @buttonText(state) $('') .addClass(state + ' button') .attr('href', '#') .html(text) Partystreusel.Readmore = Readmore if not Meteor.server console.log("spacejamio:cli - Meteor.server is not defined, creating noop implementations for all meteor ddp methods") _.each(['publish', 'methods', 'call', 'apply', 'onConnection'], (name) -> Meteor[name] = -> ); define [ 'phaser' 'underscore' 'app/helpers' ], (Phaser, _, Helpers) -> 'use strict' {Keyboard} = Phaser class InStateMenu constructor: (@textItems, @game, @options) -> @_initialize() _initialize: -> @group = @game.add.group() @overlay = @game.add.graphics 0, 0, @group @overlay.beginFill 0x000000, 0.2 @overlay.drawRect 0, 0, @game.width, @game.height @overlay.endFill() @add = @game.add # For TextMixin. @world = @game.world # For TextMixin. @layout = @options?.layout or { y: 120, baseline: 40 } for [text, style] in @textItems _.defaults style, { fill: '#fff', font: 'Enriqueta' } @addCenteredText text, @layout, style, @group @toggleKey = @game.input.keyboard.addKey @options?.hotkey or Keyboard.P @toggleKey.onDown.add @toggle, @ @toggle off destroy: -> @toggleKey.onDown.removeAll() toggle: (visible) -> visible ?= not @group.visible @group.visible = visible _.extend InStateMenu::, Helpers.TextMixin InStateMenu #= require ./element_animations #= require ./store #= require ./event_stream_actions #= require_tree ./mixins #= require_tree ./models # #= require ./controllers/task_controller #= require_tree ./controllers # #= require ./views/overlays/overlay #= require_tree ./views/forms #= require_tree ./views # #= require_tree ./helpers #= require ./components/question_component #= require_tree ./components #= require_tree ./templates #= require_tree ./routes #= require ./router #= require_self SymbolsView = require './symbols-view' module.exports = class GoBackView extends SymbolsView toggle: => return if @stack.length is 0 top = @stack.pop() atom.workspaceView.open(top.file).done => @moveToPosition(top.position, false) if top.position "*": core: disabledPackages: [ "background-tips" "exception-reporting" "metrics" ] followSymlinks: false hideGitIgnoredFiles: true ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" "vendor" ] themes: [ "unity-ui" "glacier-syntax" ] editor: fontFamily: "Menlo" invisibles: {} showIndentGuide: true softWrapAtPreferredLineLength: true "go-plus": goPath: "/Users/holman/Code/go" "release-notes": viewedVersion: "0.89.0" "spell-check": grammars: [ "text.plain" "source.gfm" "text.git-commit" "text.html.basic" ] welcome: showOnStartup: false class @Locale constructor: -> # @param dialoguesFilename [String] path of the JSON file containing all the localized dialogue lines loadDialogueLines: (dialoguesFilename) => $.getJSON(dialoguesFilename, @buildDialogueLines) .done(-> console.log "[LOAD] Loaded localized dialogue lines") .fail(-> console.log "[LOAD] Failed loading localized dialogues") # Build dictionary of dialogue lines from JSON data # # @param data [dictionary] dictionary of dialogue lines with JSON data buildDialogueLines: (data) => # console.log "[CALL] buildDialogueLines" @dialogueLines = data # Return localized string for a dialogue or text line # # @param lineID [String] line string identifier getLine: (lineID) => # split lineID in format "mkX_dY_ZZ" into "mkX/dY/ZZ" the key path to access the dictionary value # (or _tY_ for a text file content) [missionID, textNo, lineNo] = lineID.split '_' @dialogueLines[missionID][textNo][lineNo] if Meteor.isCordova window.addEventListener 'deviceready', -> cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); window.addEventListener 'native.keyboardshow', -> $('.main-content').css 'height', window.innerHeight window.addEventListener 'native.keyboardhide', -> $('.main-content').css 'height', window.innerHeight module.exports = (grunt) -> grunt.registerTask 'check-licenses', 'Report the licenses of all dependencies', -> legalEagle = require 'legal-eagle' {size, keys} = require 'underscore-plus' done = @async() options = path: process.cwd() omitPermissive: true overrides: require './license-overrides' legalEagle options, (err, summary) -> if err? console.error(err) exit 1 for key of summary delete summary[key] if key.match /^atom@/ if size(summary) console.error "Found dependencies without permissive licenses:" for name in keys(summary).sort() console.error "#{name}" console.error " License: #{summary[name].license}" console.error " Repository: #{summary[name].repository}" process.exit 1 done() `import DS from 'ember-data'` BlogyPost = DS.Model.extend { published: DS.attr() draft: DS.attr() ilustration: DS.attr() title: DS.attr() locale: DS.attr() slug: DS.attr() storage: DS.attr() format: DS.attr() document: DS.attr() remote: DS.attr() text: DS.attr() content: DS.attr() plain: DS.attr() createdAt: DS.attr() updatedAt: DS.attr() } `export default BlogyPost` "*": "atom-autocomplete-php": {} "atom-beautify": css: beautify_on_save: true end_with_newline: true indent_size: 2 no_lead_zero: true general: analytics: false beautifyEntireFileOnSave: false html: end_with_newline: true indent_size: 2 js: end_with_newline: true json: end_with_newline: true scss: beautify_on_save: true convert_quotes: "single" indent_size: 2 no_lead_zero: true core: disabledPackages: [ "metrics" "exception-reporting" ] projectHome: "~/code" themes: [ "one-dark-ui" "atom-panda-syntax" ] editor: fontFamily: "Menslo, Courrier, Monaco, Roboto Mono," fontSize: 16 preferredLineLength: 120 showIndentGuide: true showInvisibles: true softWrap: true softWrapAtPreferredLineLength: true tabType: "soft" linter: {} welcome: showOnStartup: false twilio = require 'twilio' reset = '+16466816260' module.exports = (app) -> Game = app.get 'game' hook = twilio.webhook validate: false app.get '/twilio/voice', hook, (req, res) -> twiml = new twilio.TwimlResponse if req.param('To') == reset return Game.create req.param('To'), (err, game) -> twiml.say "New game ready to play!" res.send twiml Game.findOne { number: req.param('From') }, (err, game) -> if (err || !game) twiml.reject() else twiml.play game.boys[req.param('To')].sound.file res.send twiml app.get '/twilio/messaging', hook, (req, res) -> from = req.param 'From' to = req.param 'To' Game.findOne { number: from }, (err, game) -> twiml = new twilio.TwimlResponse if (err || !game) twiml.reject() else twiml.play game.boys[to].sound.file res.send twiml app.get '/twilio/reset', (req, res) -> Game.create req.param('To'), (err, game) -> res.json gamejQuery -> $('form').on 'click', '.add_fields', (event) -> time = new Date().getTime() regexp = new RegExp($(this).data('id'), 'g') $(this).before($(this).data('fields').replace(regexp, time)) event.preventDefault() jQuery -> $('#items').dataTable columnDefs: [ ## https://datatables.net/extensions/responsive/priority { responsivePriority: 1, targets: [0, 1, 2, 3, 8, 9 ] }, { responsivePriority: 2, targets: 7 }, { responsivePriority: 3, targets: 4 }, { responsivePriority: 4, targets: 5 }, { responsivePriority: 5, targets: 6 }, { orderable: false, targets: 9 }, ] locations = $('#item_location_id').html() $('#item_department_id').change -> department = $('#item_department_id :selected').text() espaced_department = department.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1') options = $(locations).filter("optgroup[label='#{espaced_department}']").html() if options $('#item_location_id').html(options) else $('#item_location_id').empty()React = require 'react' module.exports = (tags) -> _tags = [] for name, content of tags if content _tags.push return _tagsSyrup.ApplicationAdapter = DS.FixtureAdapter Config = require '../config' argv = require('optimist') .usage('Usage: $0 --projectKey key --clientId id --clientSecret secret') .demand(['projectKey','clientId', 'clientSecret']) .argv OrderDistribution = require('../main').OrderDistribution options = master: Config.config retailer: project_key: argv.projectKey client_id: argv.clientId client_secret: argv.clientSecret impl = new OrderDistribution options impl.getUnSyncedOrders(impl.masterRest).then (orders) -> impl.run orders, (msg) -> console.log msg process.exit 1 unless msg.status .fail (msg) -> console.log msg process.exit 1class Router extends Backbone.Router @go = (path) -> -> @routeDirectly path, arguments #- Routing functions routeToServer: -> window.location.reload(true) routeDirectly: (path, args) -> return document.location.reload() if @currentView?.reloadOnClose leavingMessage = _.result(@currentView, 'onLeaveMessage') if leavingMessage if not confirm(leavingMessage) return @navigate(this.currentPath, {replace: true}) path = "views/#{path}" try ViewClass = require(path) catch error if error.toString().search('Cannot find module "' + path + '" from') is -1 throw error ViewClass ?= NotFoundView view = new ViewClass({params: args}) @openView(view) #- Opening, closing views openView: (view) -> @closeCurrentView() view.render() $('body').empty().append(view.el) @currentView = view @currentPath = document.location.pathname + document.location.search view.onInsert() closeCurrentView: -> @currentView?.destroy() setupOnLeaveSite: -> window.addEventListener "beforeunload", (e) => leavingMessage = _.result(@currentView, 'onLeaveMessage') if leavingMessage e.returnValue = leavingMessage return leavingMessage FrimFram.Router = Router$ -> enableEditables() enableEditables = -> $('span.editable').editable (value, settings) -> $span = $(this) data = {_method: 'PUT'} data[$span.data('attribute')] = value # TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator. $.post($span.data('url'), data) value , tooltip: 'Click to edit' $('table.editable td').editable (value, settings) -> $td = $(this) $tr = $td.parent('tr') data = {_method: 'PUT', index: $td.index(), value: value} # NOTE: Index is 0-based. # TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator. $.post($tr.data('url'), data, null, 'json') value window.enableEditables = enableEditables RocketChat.models._Base = class find: -> return @model.find.apply @model, arguments findOne: -> return @model.findOne.apply @model, arguments insert: -> return @model.insert.apply @model, arguments update: -> return @model.update.apply @model, arguments upsert: -> return @model.upsert.apply @model, arguments remove: -> return @model.remove.apply @model, arguments allow: -> return @model.allow.apply @model, arguments deny: -> return @model.allow.apply @model, arguments RocketChat.settings.addGroup 'InternalHubot' RocketChat.settings.add 'InternalHubot_Enabled', true, { type: 'boolean', group: 'InternalHubot', i18nLabel: 'Enabled' } RocketChat.settings.add 'InternalHubot_Username', 'Rocket.Cat', { type: 'string', group: 'InternalHubot', i18nLabel: 'Username', i18nDescription: 'InternalHubot_Username_Description' } RocketChat.settings.add 'InternalHubot_ScriptsToLoad', 'hello.coffee,zen.coffee', { type: 'string', group: 'InternalHubot'} # Description: # Generate QR codes as PNG with size 128x128 pixels # Using service from [QR Code Generator](http://goqr.me/api/doc/create-qr-code/) # # Dependencies: # None # # Configuration: # None # # Commands: # hubot qr gen # # Author: # eelcokoelewijn # http(s)://api.qrserver.com/v1/create-qr-code/?data=[URL-encoded-text]&size=[pixels]x[pixels] module.exports = (robot) -> robot.respond /qr gen (.+)/i, (msg) -> data = msg.match[1] msg.send "https://api.qrserver.com/v1/create-qr-code/?data=#{encodeURIComponent(data)}&size=128x128" '.platform-win32, .platform-linux': 'alt-\\': 'unset!' # tree-view:toggle-focus default 'ctrl-|': 'unset!' # tree-view:reveal-active-file default 'ctrl-0': 'tree-view:reveal-active-file' 'atom-workspace atom-text-editor:not([mini])': 'ctrl-up': 'unset!' # editor:move-line-up default 'ctrl-shift-up': 'editor:move-line-up' 'ctrl-down': 'unset!' # editor:move-line-down default 'ctrl-shift-down': 'editor:move-line-down' 'atom-text-editor:not([mini])': 'f5': 'unset!' # sort-lines:sort default 'f9': 'sort-lines:sort' 'atom-workspace': 'alt-]': 'unset!' # tab-switcher:next default 'ctrl-tab': 'tab-switcher:next' 'alt-[': 'unset!' # tab-switcher:previous default 'ctrl-shift-tab': 'tab-switcher:previous' class window.OpinionatersEvidence extends Backbone.Model opinionaters: -> @_opinionaters ?= new Users @get('users') #= require app App.Router = Ember.Router.extend enableLogging: true location: 'hash' root: Ember.Route.extend index: Ember.Route.extend route: '/' redirectsTo: 'whatwouldisee.index' whatwouldisee: Ember.Route.extend route: '/whatwouldisee' doLookUp: (router, e) -> if screenName = $('.js-whatwouldisee-input').val() Ember.run => router.transitionTo('root.whatwouldisee.show', user: App.User.find(screenName: screenName)) $('.js-whatwouldisee-input').focus() index: Ember.Route.extend route: '/' connectOutlets: (router, context) -> router.get('applicationController').connectOutlet('whatwouldiseeForm') show: Ember.Route.extend route: '/:user' serialize: (router, context) -> return user: context.user.screenName deserialize: (router, context) -> return user: App.User.find(screenName: context.user) connectOutlets: (router, context) -> router.get('applicationController').connectOutlet('whatwouldisee', context.user) $ -> $('.jobs_controller.index_action').each -> new Altria.ServerEvent() .on 'build.started build.finished', (attributes) -> $.ajax "/jobs/#{attributes.job_id}", success: (data) -> $("#job#{attributes.job_id}").replaceWith(data) $('.jobs_controller.show_action').each -> event = new Altria.ServerEvent() event.on 'build.finished', (attributes) -> $.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) -> $("#build#{attributes.id}").replaceWith(data) event.on 'build.started', (attributes) -> $.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) -> $('.builds ul').prepend(data) $('.builds_controller.show_action').each -> new Altria.ServerEvent() .on 'build.finished', (attributes) -> $.ajax "/builds/#{attributes.id}", success: (data) -> $('body').html(data) #= require glimpse/vendor/jquery.tipsy updatePerformanceBar = -> glimpseResults = $('#glimpse-results') $('#glimpse [data-defer-to]').each -> deferKey = $(this).data 'defer-to' data = glimpseResults.data deferKey $(this).text data initializeTipsy = -> $('#glimpse .tooltip').each -> el = $(this) gravity = if el.hasClass('rightwards') then 'w' else 'n' gravity = if el.hasClass('leftwards') then 'e' else gravity el.tipsy { gravity } toggleBar = (event) -> return if $(event.target).is ':input' if event.keyCode == 96 && !event.metaKey wrapper = $('#glimpse') if wrapper.hasClass 'disabled' wrapper.removeClass 'disabled' document.cookie = "glimpse=true; path=/"; else wrapper.addClass 'disabled' document.cookie = "glimpse=false; path=/"; $(document).on 'keypress', toggleBar $(document).on 'glimpse:update', updatePerformanceBar $(document).on 'glimpse:update', initializeTipsy # Fire the event for our own listeners. $(document).on 'pjax:end', -> $(this).trigger 'glimpse:update' # Also listen to turbolinks page change event jQuery(window).on 'page:change', -> $(document).trigger 'glimpse:update' $ -> $(this).trigger 'glimpse:update' {Emitter} = require 'emissary' module.exports = class NullGrammar Emitter.includeInto(this) name: 'Null Grammar' scopeName: 'text.plain.null-grammar' constructor: -> @scopes = ['null-grammar.text.plain'] getScore: -> 0 tokenizeLine: (line) -> tokens: [{value: line, @scopes}] tokenizeLines: (text) -> lines = text.split('\n') for line in lines {tokens} = @tokenizeLine(line) tokens grammarUpdated: -> # noop $ -> initializeButtons = () -> for metric in gon.metrics repository = gon.repository.name $(".compute-metric.#{metric}").on 'click', (event) => parameter = { "repository": repository, "metric": metric } $.post("/metrics/compute", parameter, (data, status) => console.log data ) if gon? and gon.repository? and gon.metrics? # activate repository selector $('.dropdown-toggle').dropdown() initializeButtons() #= require models/data/query #= require models/data/project #= require models/data/user #= require models/ui/temporal #= require models/ui/project_list data = @edsc.models.data ui = @edsc.models.ui ns = @edsc.models.page ui = @edsc.models.ui ns.AccessPage = do (ko, setCurrent = ns.setCurrent accessData = @edscPageData QueryModel = data.Query ProjectModel = data.Project UserModel = data.User TemporalModel = ui.Temporal ProjectListModel = ui.ProjectList ) -> class AccessPage constructor: -> @query = new QueryModel() @project = new ProjectModel(@query) @project.fromJson(accessData) @bindingsLoaded = ko.observable(false) @user = new UserModel() @ui = isLandingPage: false temporal: new TemporalModel(@query) projectList: new ProjectListModel(@project, @user) setCurrent(new AccessPage()) exports = AccessPage Template.listPrivateGroupsFlex.helpers groups: -> return ChatSubscription.find { t: { $in: ['p']}, f: { $ne: true } }, { sort: 't': 1, 'name': 1 } Template.listPrivateGroupsFlex.events 'click header': -> SideNav.closeFlex() 'click .channel-link': -> SideNav.closeFlex() 'click footer .create': -> SideNav.setFlex "createChannelFlex" 'mouseenter header': -> SideNav.overArrow() 'mouseleave header': -> SideNav.leaveArrow() {NotificationActions} = require 'shared' Router = require './router' module.exports = start: (bootstrapData) -> NotificationActions.startPolling() for level, message of (bootstrapData.flash or {}) NotificationActions.display({message, level}) buildCallbackHandlers: (comp) -> router = comp.context.router unless router throw new Error("Component's context must have router present") missing_student_id: onAdd: ({course}) -> router.transitionTo( Router.makePathname('changeStudentId', courseId: course.id) ) define [ 'models/server' 'vendor/underscore' 'vendor/jquery' ], ( Server ) -> # Application base class # class App id: null serverAddress: '' # Constructs a new app. # constructor: ( ) -> @_initTime = performance.now() @server = new Server(@serverAddress) @initialize() # Is called when the app has been constructed. Should be overridden by # subclasses. # initialize: ( ) -> # Returns the time that has passed since the starting of the app. # time: ( ) -> return performance.now() - @_initTime'use strict' describe 'Controller: ContactCtrl', -> # load the controller's module beforeEach module 'expressoApp' ContactCtrl = {} scope = {} # Initialize the controller and a mock scope beforeEach inject ($controller, $rootScope, $injector) -> scope = $rootScope.$new() AuthService = $injector.get('AuthService') ContactCtrl = $controller('ContactCtrl', { # mocked dependencies $scope: scope, auth: AuthService }) it 'should attach a list of awesomeThings to the scope', -> expect(ContactCtrl.awesomeThings.length).toBe 3 # Representation of individual nodes in a book's tree (table of contents). # A Node can represent both a tree (subcollection), or leaf (page). # Page Nodes also are used to cache a page's content once loaded. define (require) -> Backbone = require('backbone') settings = require('cs!settings') require('backbone-associations') SERVER = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}" return class Node extends Backbone.AssociatedModel url: () -> "#{SERVER}/contents/#{@id}" parse: (response, options) -> # Don't overwrite the title from the book's table of contents if @get('title') then delete response.title return @parseInfo(response) parseInfo: (response) -> # Add languageName property to nodes for faster references in views response.languageName = settings.languages[response.language] return response fetch: (options) -> super(arguments...) if not @id then return @set('downloads', 'loading') $.ajax url: "#{SERVER}/exports-allowable-types/#{@id}" dataType: 'json' .done (response) => @set('downloads', response) .fail () => @set('downloads', []) # Use chai assertation library expect = chai.expect before -> @client = new Postie.Client('http://example.org/background.html') describe 'ready', -> it 'should create an iframe', -> @client.ready() expect(@client._frame).to.be.an.instanceof(Window) keytar = require '../lib/keytar' describe "keytar", -> service = 'keytar tests' account = 'buster' password = 'secret' beforeEach -> keytar.deletePassword(service, account) describe "addPassword(service, account, password)", -> it "returns true when the service, account, and password are specified", -> expect(keytar.addPassword(service, account, password)).toBe true describe "getPassword(service, account, password)", -> it "returns the password for service and account", -> expect(keytar.addPassword(service, account, password)).toBe true expect(keytar.getPassword(service, account)).toBe password describe "deletePassword(service, account)", -> it "returns true when the password for the service and account has been deleted", -> expect(keytar.deletePassword(service, account)).toBe false expect(keytar.addPassword(service, account, password)).toBe true expect(keytar.deletePassword(service, account)).toBe true expect(keytar.deletePassword(service, account)).toBe false describe "replacePassword(service, account, password)", -> it "returns true when the password for the service and account has been deleted and readded", -> expect(keytar.addPassword(service, account, password)).toBe true expect(keytar.replacePassword(service, account, 'another secret')).toBe true expect(keytar.getPassword(service, account)).toBe 'another secret' class @Cable.Channel constructor: (params = {}) -> @channelName ?= @underscore @constructor.name params['channel'] = @channelName @channelIdentifier = JSON.stringify params cable.subscribe(@channelIdentifier, { onConnect: @connected onDisconnect: @disconnected onReceiveData: @received }) connected: => # Override in the subclass disconnected: => # Override in the subclass received: (data) => # Override in the subclass send: (data) -> cable.sendData @channelIdentifier, JSON.stringify data underscore: (value) -> value.replace(/[A-Z]/g, (match) => "_#{match.toLowerCase()}").substr(1)Cookies = require 'cookies-js' module.exports = -> $el = $('.lo-cta') unless Cookies.get('lo-cta') $el.addClass 'lo-cta--visible' $el.on 'click', '.lo-cta__close', (e) -> $el.slideToggle "fast" # Cookie expires in 1 day Cookies.set 'lo-cta', true, { expires: 86400000 } fs = require 'fs' path = require 'path' module.exports = (settings) -> # Validation throw new Error 'No shell provided' if not settings.shell shell = settings.shell # Plug completer to interface shell.interface.completer = (text) -> suggestions = [] routes = shell.routes for route in routes command = route.command if command.substr 0, text.length is text suggestions.push command [suggestions, text] null H2O.RDDsOutput = (_, _rDDs) -> _rDDViews = signal [] createRDDView = (rDD) -> id: rDD.id name: rDD.name partitions: rDD.partitions _rDDViews map _rDDs, createRDDView rDDViews: _rDDViews hasRDDs: _rDDs.length > 0 template: 'flow-rdds-output' express = require 'express' app = express() # Serve static files app.use express.static(__dirname + '/public') # Set cache manifext content-type app.use (req, res, next)-> if req.originalUrl == '/cache.manifest' res.setHeader('Content-Type', 'text/cache-manifest') next() app.get '/', (req, res, next)-> res.redirect('/online.html') port = process.env.port || 1234 app.listen port, ()-> console.log 'listening on port', port # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ # For dynamic appending test cases. $ -> $('form').on 'click', '.remove_fields', (event) -> $(this).prev('input[type=hidden]').val('1') $(this).closest('fieldset').remove() event.preventDefault() $('form').on 'click', '.add_fields', (event) -> time = new Date().getTime() regexp = new RegExp($(this).data('id'), 'g') $(this).before($(this).data('fields').replace(regexp, time)) event.preventDefault() "*": editor: invisibles: {} showInvisibles: true fontFamily: "Source Code Pro" core: ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" "vendor" ] disabledPackages: [ "background-tips" "exception-reporting" "metrics" ] "spell-check": grammars: [ "text.plain" "source.gfm" "text.git-commit" ] welcome: showOnStartup: false "atom-lint": {} linter: {} "tree-view": showOnRightSide: true "linter-rubocop": {} react: enabledForAllJavascriptFiles: true "linter-flow-plus": {} "file-watcher": promptWhenFileHasChangedOnDisk: false "linter-eslint": disableWhenNoEslintrcFileInPath: true nuclide: remoteProjectsConfig: [] "one-light-ui": {} "find-and-replace": {} "linter-jscs": onlyConfig: true fixOnSave: true "go-plus": {} Game = @Game Game.Scripts ||= {} class Game.Scripts.TrainAssaulter extends Game.EntityScript spawn: (options) -> dir = options.from ? 'top' switch dir when 'top' startY = .3 @endY = .6 when 'middle' startY = .5 @endY = .5 else startY = .6 @endY = .3 p = Crafty.e('Enemy, Color').attr( x: Crafty.viewport.width + 40 y: startY * Crafty.viewport.height speed: options.speed ? 50 health: 500 w: 30 h: 30 weaponOrigin: [0, 15] ).enemy().color('#FF0000') p.addComponent('BurstShot').burstShot projectile: (x, y, angle) => projectile = Crafty.e('Projectile, Color, Enemy, TrainBullet').attr( w: 16 h: 4 speed: 550 damage: 1 ).color('#FFFF00') projectile.shoot(x, y, angle) p execute: -> @bindSequence 'Destroyed', @onKilled @sequence( @movePath [ [.7, .5] [1.1, @endY] ], rotate: no ) onKilled: -> @bigExplosion() #= require_self #= require_tree . window.Neighborly = configs: turbolinks: true pjax: false modules: -> [] initPage: -> that = this unless window.Turbolinks is undefined $(document).bind "page:fetch", -> that.Loading.show() $(document).bind "page:restore", -> that.Loading.hide() $(document).bind "page:change", -> $(window).scrollTop(0) try FB.XFBML.parse() try twttr.widgets.load() init: -> $(document).foundation('reveal', {animation: 'fadeIn', animationSpeed: 100}) $(document).foundation() $('.button.disabled').click -> return false $('.search-button').click -> if $('.discover-form-input').val() != '' $('form.discover-form').submit() else $('.discover-form-input').toggleClass('show').focus() return false Loading: show: -> $('#loading #back-overlay, #loading #front-overlay').fadeIn(2) hide: -> $('#loading #back-overlay, #loading #front-overlay').hide() define [ './range' ], (range) -> # A control for entering an inclusive or exclusive numeric range class NumberControl extends range.RangeControl # Cast the lower bound to a number for use in the getValue() method getLowerBoundValue: -> return Number(@ui.lowerBound.val()) # Case the upper bound to a number for use in the getValue() method getUpperBoundValue: -> return Number(@ui.upperBound.val()) { NumberControl } window.ReactFeedSelection = React.createClass displayName: 'ReactFeedSelection' mixins: [UpdateOnSignInOrOutMixin] getInitialState: -> feedChoice: 'global' feeds: global: new GlobalFeedActivities personal: new PersonalFeedActivities _handleFeedChoiceChange: (e) -> if(e.target.checked) @setState feedChoice: e.target.value render: -> _div [], if currentSession.signedIn() _div ['feed-selection-row'], _input [ 'radio-toggle-button', type: 'radio', name: 'FeedChoice', value: 'global', id: 'FeedChoice_Global', onChange: @_handleFeedChoiceChange, checked: @state.feedChoice=='global' ] _label [ htmlFor: 'FeedChoice_Global' ], 'Global' _input [ 'radio-toggle-button', type: 'radio', name: 'FeedChoice', value: 'personal', id: 'FeedChoice_Personal', onChange: @_handleFeedChoiceChange, checked: @state.feedChoice=='personal' ] _label [ htmlFor: 'FeedChoice_Personal' ], 'Personal' if !window.is_kennisland _div ['feed-selection-install-extension-button'], ReactInstallExtensionOrBookmarklet() ReactFeedActivitiesAutoLoading model: @state.feeds[@state.feedChoice] key: @state.feedChoice spawn = require("child_process").spawn logger = require "logger-sharelatex" Settings = require "settings-sharelatex" module.exports = DockerRunner = _docker: Settings.clsi?.docker?.binary or 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd.push Settings.clsi?.docker?.image or "texlive" docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout () -> logger.warn "timeout achieved, stopping docker instance" proc = spawn 'docker', ['stop', "texlive-#{project_id}"] proc.on "close", -> callback timedout: true , (timeout ?= 30) * 1000 proc.on "close", () -> clearTimeout timer callback() {Model} = require 'spine' class Subject extends Model @configure 'Subject', 'zooniverseId', 'location', 'coords', 'metadata' @toClassify = [] select: -> @trigger 'select' satelliteImage: -> """ //maps.googleapis.com/maps/api/staticmap ?center=#{@coords.join ','} &zoom=17 &size=565x380 &maptype=hybrid &sensor=false """.replace '\n', '' module.exports = Subject window.NeighborlyBalancedCreditcard = Backbone.View.extend el: '.neighborly-balanced-creditcard-form' initialize: -> _.bindAll(this, 'validate', 'submit') $(document).foundation('forms') this.$button = this.$('input[type=submit]') this.$form = this.$('form') this.$form.bind('submit', this.submit) validate: -> submit: (e)-> e.preventDefault() #= require lib/format_as_short_number describe 'window.format_as_short_number', -> tests = [ [`undefined`, "?"] [null, "?"] [0, "0"] [3, "3"] [3.52555, "3"] [10, "10" ] [127.8392, "127"] [1000, "1k" ] [3600, "3k" ] ] for test in tests do (test) -> it "formats #{test[0]} as \"#{test[1]}\"", -> expect(format_as_short_number(test[0])).eq test[1] ### Button Group. In its simple form, each item in the button group is a Bootstrap.Button component, In case this is a Radio, each item is rendered as a label. ### Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection, classTypePrefix: ['btn-group'] classNames: ['btn-group'] classNameBindings: ['vertical:btn-group-vertical'] #TODO: This is a hack until it will be possible to extend from component as it looses the template association #see https://github.com/emberjs/ember.js/issues/3376 itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection, layoutName: 'components/bs-button' ) ) Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroupSchema = mongoose.Schema ObjectId = Schema.ObjectId Comment = new Schema { body : String, author_id : ObjectId, date : Date } File = new Schema { path : String, size : Number } Torrent = new Schema { uploader : String, title : String, size : Number, dateUploaded : {type: Date, default: new Date}, files : [File], description : String, comments : [Comment], category : String, infohash : {type: String, index: {unique:true}} permalink : {type: String, index: {unique:true}} } Torrent.method 'generatePermalink', (callback) -> baseurl = @title.substring(0, 75).replace(' ', '_') # check for collisions checkFunc = (base, endno) => if endno > 0 url = base + '-' + endno else url = base (mongoose.model 'Torrent').findOne {'permalink' : url}, (err, doc) => if doc checkFunc base, endno+1 else @permalink = url callback '' checkFunc baseurl, 0 TorrentModel = mongoose.model 'Torrent', Torrent exports.Torrent = TorrentModel angular.module('loomioApp').controller 'PreviousPollsPageController', ($scope, $rootScope, $routeParams, Records, AbilityService, TranslationService, LoadingService) -> $rootScope.$broadcast('currentComponent', { page: 'previousPollsPage'}) Records.groups.findOrFetchById($routeParams.key).then (group) => @group = group @loadMore() , throwPageError throwPageError = (error) -> $rootScope.$broadcast('pageError', error) from = 0 per = 10 @loadMore = => Records.polls.fetchClosedByGroup(@group.key, from: from, per: per).then => from += per Records.stances.fetchMyStances(@group.key) if AbilityService.isLoggedIn() LoadingService.applyLoadingFunction @, 'loadMore' @searchPolls = => Records.polls.search(@group.key, @fragment, per: 10) LoadingService.applyLoadingFunction @, 'searchPolls' @pollCollection = polls: => return [] unless @group? _.sortBy( _.filter(@group.closedPolls(), (poll) => _.isEmpty(@fragment) or poll.title.match(@fragment)), '-closedAt') @translations = TranslationService.eagerTranslate @, searchPlaceholder: 'previous_polls_page.search_activities' @canLoadMore = -> @group and !@fragment and from < @group.closedPollsCount return describe 'NoFlo UI initialization', -> win = null doc = null db = null before (done) -> @timeout 20000 iframe = document.getElementById 'app' iframe.src = '../app.html' iframe.onload = -> win = iframe.contentWindow doc = iframe.contentDocument setTimeout -> done() , 1000 it 'should start with the main screen', -> chai.expect(win.location.hash).to.equal '' it 'should have created the IndexedDB database', (done) -> chai.expect(win.indexedDB).to.be.an 'object' req = win.indexedDB.open 'noflo-ui', 3 req.onerror = -> chai.expect(true).to.equal false done() req.onsuccess = (event) -> db = event.target.result chai.expect(db).to.be.an 'object' db.close() done() it 'should have created the object stores', (done) -> req = win.indexedDB.open 'noflo-ui', 3 req.onerror = -> chai.expect(true).to.equal false done() req.onsuccess = (event) -> db = event.target.result chai.expect(db.objectStoreNames.contains('projects')).to.equal true chai.expect(db.objectStoreNames.contains('graphs')).to.equal true chai.expect(db.objectStoreNames.contains('components')).to.equal true chai.expect(db.objectStoreNames.contains('runtimes')).to.equal true db.close() done() # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> $tagLine = $ '.tag-line' $signButton = $ '.sign-up' # Ideally this array would come from somewhere in the server. tagLines = [ 'Schedule a meeting for next tuesday.', 'Send Alice an e-mail.', 'Invite Bob to my birth-day party.', 'Text mom I love her.' 'Let\'s play chess.', 'Make me a sandwich.' ] i = 0 tickHandler = -> $tagLine.text tagLines[i++] i = 0 if i >= tagLines.length # 5 seconds. lapse = 5000 setInterval tickHandler, lapse # Setup Google authentication. $signButton.click -> gapi.auth.signIn { callback: (result) -> console.dir (result); } async = require("async") mongoose = require("mongoose") ObjectId = mongoose.Types.ObjectId User = mongoose.model("User") Post = mongoose.model("Post") Message = mongoose.model("Message") exports.index = (req, res) -> res.render "index" exports.timeline = (req, res) -> res.render "timeline" exports.app = (req, res) -> async.parallel users: (callback) -> User.find {_id: {$ne: req.user._id}}, callback posts: (callback) -> Post.find({}) .sort(sent: -1) .limit(10) .populate("author") .exec callback messages: (callback) -> opts = query: to: req.user._id unread: true map: -> emit(@from, 1) reduce: (key, vals) -> vals.length limit: 50 Message.mapReduce opts, callback , (err, result) -> unreads = result.messages?[0] or [] res.render "app", user: _id: req.user._id name: req.user.name username: req.user.username status: req.user.status admin: req.user.admin group: req.user.group users: result.users posts: result.posts unreads: unreads {View, Range} = require 'atom' module.exports = class SearchResultView extends View @content: (previewList, filePath, match) -> range = Range.fromObject(match.range) prefix = match.lineText[0...range.start.column] suffix = match.lineText[range.end.column..] @li class: 'search-result list-item', => @span range.start.row + 1, class: 'line-number text-subtle' @span class: 'preview', => @span prefix @span match.matchText, class: 'match highlight-info' @span suffix initialize: (@previewList, @filePath, @match) -> @subscribe @previewList, 'core:confirm', => if @hasClass('selected') @highlightResult() false @on 'mousedown', (e) => @highlightResult() @previewList.find('.selected').removeClass('selected') @addClass('selected') highlightResult: -> editSession = rootView.open(@filePath) editSession.setSelectedBufferRange(@match.range, autoscroll: true) @previewList.focus() scrollTo: -> top = @previewList.scrollTop() + @offset().top - @previewList.offset().top bottom = top + @outerHeight() @previewList.scrollTo(top, bottom) # Your keymap # # Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors # to apply styles to elements, Atom keymaps use selectors to associate # keystrokes with events in specific contexts. # # You can create a new keybinding in this file by typing "key" and then hitting # tab. # # Here's an example taken from Atom's built-in keymap: # # '.editor': # 'enter': 'editor:newline' # # '.workspace': # 'ctrl-shift-p': 'core:move-up' # 'ctrl-p': 'core:move-down' # # You can find more information about keymaps in these guides: # * https://atom.io/docs/latest/customizing-atom#customizing-key-bindings # * https://atom.io/docs/latest/advanced/keymaps class LogFeed POLL_PERIOD: 500 constructor: -> @currentLine = -1 @lines = $('#lines') getLines: => $.get(window.location.href + '/changes.json', {currentLine: @currentLine}, this.getLinesSuccess ) .fail(this.getLinesError) .always(this.getLinesComplete) getLinesSuccess: (data, status, xhr) => this.displayLines data.lines @currentLine = data.last_line_number getLinesError: (data, status, err) => console.log "Error fetching logs" # TODO getLinesComplete: (xhr, status) => this.reschedule() displayLines: (lines) -> this.appendLine(line) for line in lines @lines.scrollTop @lines.prop('scrollHeight') appendLine: (line) -> $("
  • #{line}
  • ").appendTo @lines start: -> setTimeout this.getLines, 0 reschedule: -> setTimeout this.getLines, @POLL_PERIOD onReady = -> logfeed = new LogFeed logfeed.start() console.log "Started fetching logs" $(document).ready onReady $(document).on 'page:load', onReadyasync = require('async') fs = require('fs') widgets = require('../widgets/widgets') server = require('../../server/server') ProgressBar = require('progress') exports.remove = (name, confirmAttribute, deleteFunction, outerCallback) -> async.waterfall([ (callback) -> if confirmAttribute return callback(null, true) widgets.confirmRemoval(name, callback) (confirmed, callback) -> return callback() if not confirmed deleteFunction(callback) ], outerCallback) exports.downloadFile = (url, dest, callback) -> bar = null received = 0 server.request method: 'GET' url: url pipe: fs.createWriteStream(dest) , (error) -> return callback(error) , (state) -> bar ?= new ProgressBar 'Downloading device OS [:bar] :percent :etas', complete: '=' incomplete: ' ' width: 40 total: state.total return if bar.complete or not state? bar.tick(state.received - received) received = state.received should = require('chai').should() Wordnet = require('../lib/wordnet') describe 'wordnet', () -> wordnet = undefined beforeEach (done) -> wordnet = new Wordnet() done() it 'should pass unfiltered lookup method', (done) -> wordnet.lookup 'node', (results) -> should.exist(results) results.should.be.an.instanceOf(Array) results[0].should.have.property('synsetOffset', 3832647) done() it 'should implement get method', (done) -> wordnet.get 4424418, 'n', (results) -> should.exist(results) results.should.have.property('gloss', 'a machine for making textiles ') done() it 'should load exclusions correctly', (done) -> wordnet.loadExclusions () -> done() gbk_paths = [ ] gbk_exclude_path = [ ] atom.workspace.onDidOpen (event) -> editor = event.item path = event.uri gbk_paths.forEach (regex) -> if regex.test(path) gbk_exclude_path.forEach (exclude_regex) -> unless exclude_regex.test(path) console.log "#{path} matches #{regex}, set encoding to GBK" editor.setEncoding('gbk') # Movie quotes # # It'll happen # module.exports = (robot) -> robot.hear /.*one (in|out of) a million*/, (msg) -> msg.send "so you're telling me there's a chance: http://www.youtube.com/watch?v=yCFB2akLh4s" 'use strict' { setupEditors setupSamples setupCompilers setupRunButton saveProgram loadProgram } = window.viz grid = null run = (editors, compiler) -> saveProgram editors playfield = new bef.Playfield() playfield.fromString editors.source.getValue(), 16, 10 lazyRuntime = new bef.LazyRuntime() lazyRuntime.execute( playfield { jumpLimit: 1000, compiler } editors.input.getValue() ) stringedStack = lazyRuntime.programState.stack.join ' ' stringedOutput = lazyRuntime.programState.outRecord.join ' ' editors.output.setValue "Stack: #{stringedStack}\nOutput: #{stringedOutput}", 1 grid?.destroy() grid = new viz.Grid playfield, lazyRuntime.pathSet, document.getElementById 'can' grid.setListener (path) -> editors.js.setValue path?.code ? '' do -> compiler = bef.BinaryCompiler editors = setupEditors() setupSamples window.befSample, editors setupCompilers (_compiler) -> compiler = _compiler run editors, compiler setupRunButton -> run editors, compiler loadProgram editors run editors, compiler# =require modules TIMEOUT = 500 # ms - Used to be 300, but FF was too slow extendClass 'specs.jasmine.AjaxHelpers', (self)-> ajaxServer = null initialize: (fakeAjaxServer, options={})-> ajaxServer = fakeAjaxServer TIMEOUT = options.timeout if options.timeout ajaxSettings: -> ajaxServer.ajaxSettings() waitsFor: (condition, message="waited event didn't happen", timeout=TIMEOUT)-> waitsFor (-> condition.call self), message, timeout waitsForAjaxRequest: (message = "An AJAX call was expected", timeout=TIMEOUT, extraCondition)-> @waitsFor (-> ajaxServer.ajaxCallbacksQueue.length and (not extraCondition or extraCondition.call self)), message, timeout waitsForAjaxRequestAnd: (condition, message, timeout)-> @waitsForAjaxRequest(message, timeout, condition) nextRequest: (url, method, format)-> @checkRequestSettings(url, method, format) ajaxServer.processNextRequest() checkRequestSettings: (url, method, format)-> s = @ajaxSettings() expect(s.url).toBe url unless url is undefined expect(s.type).toBe method unless method is undefined expect(s.dataType).toBe format unless format is undefined ignoreRequest: (url, method, format)-> @checkRequestSettings(url, method, format) ajaxServer.ignoreNextRequest() class Game.State extends Game.TwoWay constructor: () -> @objects = {} @eventCounters = {} @eventHandlers = {} super onEvent: (e) -> # Add timestamped instance to the event counters object if e.type not of @eventCounters @eventCounters[e.type] = [] @eventCounters[e.type].push new Date() # relay the event upward @fire(e) # call added callbacks @eventHandlers[e.type]?.forEach (cb) -> cb() return addObject: (obj) -> if obj not instanceof Game.Object throw new Game.GameError(Game.Error.ErrorType.NOT_OBJECT) if obj.getId() of @objects throw new Game.GameError(Game.Error.ErrorType.ALREADY_ADDED) @objects[obj.getId()] = obj @listen(obj, @onEvent) # call object added method obj.added() removeObject: (obj) -> if obj not instanceof Game.Object throw new Game.GameError(Game.Error.ErrorType.NOT_OBJECT) if obj.getId() of @objects delete @objects[obj.getId()] @remove obj addEventHandler: (evtType, callback) -> if evtType not of @eventHandlers @eventHandlers[evtType] = [] if callback not in @eventHandlers[evtType] @eventHandlers[evtType].push callback returnclass window.Topic extends Backbone.Model newChannelForUser: (user) -> new Channel title: this.get 'title' slug_title: this.get 'slug_title' username: user.get 'username' withCurrentOrCreatedChannelFor: (user, options)-> if ch = @existingChannelFor(user) options.success?(ch) else ch = @newChannelForUser(user) user.channels.add(ch) console.info "saving channel #{ch.get 'title'} to #{ch.url()}" ch.save({}, success: (m,r)-> options.success?(m,r) error: (m,r)-> user.channels.remove(ch) options.error?(m,r) ) existingChannelFor: (user)-> user.channels.getBySlugTitle(@get 'slug_title') class Presentation constructor: -> @$presentation = $('.presentation') @$current = $('section').first() @y = 0 @$presentation.css('transition-duration', '1s') @bind() @resize() bind: -> @bindKeys() @bindGestures() @bindResize() bindKeys: -> key('right, down, space, return', @next) key('left, up, backspace', @prev) bindGestures: -> Hammer(document).on('swipeleft swipeup', @next) Hammer(document).on('swiperight swipedown', @prev) bindResize: -> $(window).resize(@resize) resize: => min = Math.min($(window).width(), $(window).height()) $('section').css('font-size', "#{min * 0.4}%") prev: => $prev = @$current.prev('section') if $prev.length @y -= $prev.outerHeight() $('.presentation').css('transform', "translateY(-#{@y}px)") @$current = $prev next: => $next = @$current.next('section') if $next.length @y += $next.outerHeight() $('.presentation').css('transform', "translateY(-#{@y}px)") @$current = $next presentation = new Presentation() ### Typekit ### try Typekit.load() ### Google Analytics ### GOOGLE_ANALYTICS = account: 'UA-12933299-1' domain: 'stdout.be' _gaq = _gaq or [] _gaq.push ['_setAccount', GOOGLE_ANALYTICS.account] _gaq.push ['_trackPageview'] _gaq.push ['_setDomainName', GOOGLE_ANALYTICS.domain] do -> https = 'https:' is document.location.protocol ga = document.createElement 'script' ga.src = (if https then 'https://ssl' else 'http://www') + '.google-analytics.com/ga.js' ga.setAttribute 'async', 'async' document.documentElement.firstChild.appendChild gaReact = require 'react' Select = require 'react-select' apiClient = require '../api/client' debounce = require 'debounce' module.exports = React.createClass displayName: 'CollectionSearch' getDefaultProps: -> multi: false project: null getInitialState: -> collections: [] searchCollections: (value, callback) -> query = page_size: 20 favorite: false current_user_roles: 'owner,collaborator' query.search = "#{value}" unless value is '' apiClient.type('collections').get query .then (collections) -> opts = collections.map (collection) -> { value: collection.id, label: collection.display_name, collection: collection } callback null, { options: opts } addSelected:(collIds) -> options = @refs.collectionSelect.state.options lastId = collIds.split(",").slice(-1)[0] collection = options.filter (col) -> col.value == lastId @setState({ collections: @state.collections.slice().concat(collection), value: collIds }) getSelected: -> @state.collections render: -> to be passed to select2 options = $.extend(allowClear: true, extra, item.data('select2')) # because select2 reads from input.data to check if it is select2 already item.data('select2', null) item.select2(options) $(document).on 'has_many_add:after', '.has_many_container', (e, fieldset) -> initSelect2(fieldset.find('.select2-input')) $(document).ready -> initSelect2($(".select2-input"), placeholder: "") return ".source.js": "Promise": prefix: "promise", body: """ new Promise((resolve, reject) => { \t${0} }); """ "Promise.prototype.then": prefix: "then" body: """ then(${1:(${2:value}) => { \t${0} \\}}) """ "Promise.prototype.catch": prefix: "catch" body: """ catch(${1:(${2:err}) => { \t${0} \\}}) """ "Promise.all": prefix: "all" body: "Promise.all(${1:iterable})" "Promise.all +": prefix: "Promise.all" body: "Promise.all(${1:iterable})" "Promise.race": prefix: "race" body: "Promise.race(${1:iterable})" "Promise.race +": prefix: "Promise.race" body: "Promise.race(${1:iterable})" "Promise.resolve": prefix: "resolve" body: "Promise.resolve(${1:value})" "Promise.resolve +": prefix: "Promise.resolve" body: "Promise.resolve(${1:value})" "Promise.reject": prefix: "reject" body: "Promise.reject(${1:value})" "Promise.reject +": prefix: "Promise.reject" body: "Promise.reject(${1:value})" angular.module 'qbn.save', ['qbn.quality'] .factory 'savedGame', (qualities) -> storageName = 'qbnSave' api = load: () -> save = JSON.parse localStorage.getItem storageName if save? for savedQuality in save.qualities quality = qualities.lookup savedQuality.id quality.load savedQuality return [save?.storylet?.id, save?.storylet?.isFrontal] save: (storylet, isFrontal) -> save = qualities: qualities.saveAll() if storylet? save.storylet = id: storylet isFrontal: isFrontal localStorage.setItem storageName, JSON.stringify save return erase: () -> localStorage.clear() return return Object.freeze api xml = require 'xml' # generate device type string makeDeviceType = (config) -> type = [ config.specs.upnp.prefix config.device.type config.device.version ] type.join ':' # build device description element buildDescription = (config, callback) -> # generate namespace string makeNS = -> ns = [ config.specs.upnp.prefix 'device' config.specs.upnp.version.split('.')[0] config.specs.upnp.version.split('.')[1] ] ns.join '-' # build spec version element buildSpecVersion = -> major = config.specs.upnp.version.split('.')[0] minor = config.specs.upnp.version.split('.')[1] [ { major: major } { minor: minor } ] # build device element buildDevice = -> [ { deviceType: makeDeviceType(config) } { friendlyName: config.app.name } { manufacturer: config.app.name } { modelName: config.app.name + ' Media Server' } { UDN: config.device.uuid } ] xml [ root: [ _attr: xmlns: makeNS() { specVersion: buildSpecVersion() } { device: buildDevice() } ] ] exports.buildDescription = buildDescription exports.makeDeviceType = makeDeviceType module.exports = (robot) -> robot.respond /educast (.*)/i, (res) -> res.send "https://beta.educast.pro/search/?q=#{res.match[1]}" isObject = require 'is-object' find = (haystack, needle, memo = []) -> if needle of haystack memo.push haystack[needle] if isObject haystack for val in (i for i of haystack) find(haystack[val], needle, memo) if isObject haystack[val] return memo keyfinder = (obj, predicate) -> find obj, predicate module.exports = (obj, predicate) -> find obj, predicate 'use strict' app = angular .module('taarifaWaterpointsApp', [ 'ngResource', 'ngRoute', 'leaflet-directive', 'dynform', 'angular-flash.service', 'angular-flash.flash-alert-directive', 'gettext', 'ui.bootstrap' ]) .config ($routeProvider, $httpProvider, flashProvider) -> $routeProvider .when '/', templateUrl: 'views/main.html' controller: 'MapCtrl' .when '/waterpoints/edit/:id', templateUrl: 'views/edit.html' controller: 'WaterpointEditCtrl' .when '/waterpoints/new', templateUrl: 'views/edit.html' controller: 'WaterpointCreateCtrl' .when '/requests', templateUrl: 'views/requests.html' controller: 'RequestTriageCtrl' .when '/requests/new', templateUrl: 'views/edit.html' controller: 'RequestCreateCtrl' .when '/dashboard', templateUrl: 'views/dashboard.html' controller: 'DashboardCtrl' .otherwise redirectTo: '/' $httpProvider.defaults.headers.patch = 'Content-Type': 'application/json;charset=utf-8' flashProvider.errorClassnames.push 'alert-danger' app.run (gettextCatalog,$rootScope) -> gettextCatalog.currentLanguage = 'en' # gettextCatalog.debug = true $rootScope.fields = { catalog: gettextCatalog, languages: { "en": "English", "sw_TZ": "Swahili" } } angular.module('Sprangular.StaticContent') .config ($routeProvider) -> $routeProvider.when '/pages/:slug*', controller: 'PageShowCtrl' templateUrl: 'pages/show.html' resolve: page: (StaticContent, $route)-> slug = $route.current.params.slug StaticContent.find(slug) Sprangular.StaticContent = addRoutes: (routeProvider) -> routeProvider.when '/:slug*', controller: 'PageShowCtrl' templateUrl: 'pages/show.html' resolve: page: (StaticContent, $route, $window)-> slug = $route.current.params.slug StaticContent.find(slug).then (->), -> $window.location.href = "/not-found" $(document).ready -> $('.ajax-hijacker').on 'click', 'a', (e) -> target = $(this).closest('.ajax-hijacker').data('target') href = $(this).attr('href') if href == '#' return e.preventDefault() e.stopPropagation() options = { url: href, success: (result) -> $(target).html(result) $(document).trigger('ajaxAction') } if type = $(this).data('method') options.type = type $.ajax options $('.ajax-hijacker').on 'submit', 'form', (e) -> e.preventDefault() e.stopPropagation() target = $(this).closest('.ajax-hijacker').data('target') action = $(this).attr('action') method = $(this).attr('method') data = $(this).serialize() options = { type: method, url: action, data: data, success: (response) -> $(target).html(response) $(document).trigger('ajaxAction') } $.ajax(options) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in home.js. $ -> data = [2,3,4,5,5,7,6,5,4,2,2,3,4,5,5,7,9,5,3,2,2,3,2,3,4,5,5,7,6,5,4,2,2,4,2,2,3,4] console.log(data); $('.inlinesparkline').sparkline data, type: "discrete" lineColor: "#2d4611" $('ul#user-grid li').mouseover -> name = $(this).data('name') $('#user-name').html(name) $('ul#user-grid li').mouseout -> $('#user-name').html("") # Cameras by road that they are on view. view roads: -> div 'data-role': 'page', id: 'roads', -> div 'data-role': 'header', 'data-position': 'fixed', -> h1 'Cameras By Road' div 'data-role': 'content', -> ul id: 'road-list', 'data-role': 'listview', 'data-filter': true, 'data-filter-placeholder': 'Filter roads...', -> for road in JSON.parse @roads if road.directions.length is 0 or road.cameraCount is 1 # A road list item that does not have cameras that can # be laid out directionally. This could be because # there is only a single camera, or because the item # represents more than one road. li -> a href: "/roads/#{road.roadId}", -> road.name else if road.directions.length is 2 # A road list item that represents a road with cameras # that can be laid out directionally (N, S, E, W). li -> for direction in road.directions a 'data-theme': 'c', href: "/roads/#{road.roadId}/#{direction}", -> "#{road.name} #{direction}" mongoose = require 'mongoose' config = require '../../server_config' PrepaidSchema = new mongoose.Schema {}, {strict: false, minimize: false,read:config.mongo.readpref} PrepaidSchema.index({code: 1}, { unique: true }) PrepaidSchema.statics.generateNewCode = (done) -> tryCode = -> code = _.sample("abcdefghijklmnopqrstuvwxyz0123456789", 8).join('') Prepaid.findOne code: code, (err, prepaid) -> return done() if err return done(code) unless prepaid tryCode() tryCode() PrepaidSchema.pre('save', (next) -> @set('exhausted', @get('maxRedeemers') <= _.size(@get('redeemers'))) next() ) module.exports = Prepaid = mongoose.model('prepaid', PrepaidSchema) passport = require "passport" route = verb: "post" path: "/login" fn: (req, res, next) -> auth = passport.authenticate "local", (err, user, info) -> if err then return next err else if !user json = reason: info.message return res.status(401).json json else req.logIn user, (err) -> redir = req.session?.returnTo if err then return next err else if redir then return res.redirect redir else return res.status(200).json { data: state: "home" } return auth req, res, next module.exports = route # Wrapping a string in this class gives you a prettier way to test # for equality. The value returned by `Bullet.env` is wrapped # in a StringInquirer object so instead of calling this: # # Bullet.env == "production" # # you can call this: # # Bullet.env.production? #=> true # Bullet.env.staging? #=> true # class StringInquirer constructor: (env) -> @[env] = 'true' module.exports = StringInquirer kd = require 'kd' React = require 'kd-react' immutable = require 'immutable' ActivityFlux = require 'activity/flux' ChatPane = require 'activity/components/chatpane' module.exports = class PublicChatPane extends React.Component @defaultProps = thread : immutable.Map() messages : immutable.List() padded : no componentDidMount: -> @createModalContainer() createModalContainer: -> ModalContainer = document.createElement 'div' ModalContainer.setAttribute 'class', 'PublicChatPane-ModalContainer hidden' document.body.appendChild ModalContainer channel: (key) -> @props.thread?.getIn ['channel', key] onSubmit: ({ value }) -> return unless body = value name = @channel 'name' unless body.match ///\##{name}/// body += " ##{name} " ActivityFlux.actions.message.createMessage @channel('id'), body @moveScrollToBottom() moveScrollToBottom: -> ChatPaneWrapper = @refs.ChatPaneWrapper.getDOMNode() InfiniteScroll = ChatPaneWrapper.querySelector '.InfiniteScroll' InfiniteScroll.scrollTop = InfiniteScroll.scrollHeight onScrollThresholdReached: -> from = @props.messages.first().get('createdAt') ActivityFlux.actions.message.loadMessages @channel('id'), from render: ->
    ledger.fup ?= {} ledger.fup.utils ?= {} _.extend ledger.fup.utils, compareVersions: (v1, v2) -> new ledger.utils.ComparisonResult v1, v2, (v1, v2) -> if v1[0] == v2[0] and v1[1] == v2[1] 0 else if v1[0] == 0 and v2[0] != 0 -1 else if v1[1] > v2[1] 1 http = require 'http' nack = require 'nack/pool' {BufferedReadStream} = require 'nack/buffered' idle = 1000 * 60 * 15 exports.Server = class Server constructor: (@configuration) -> @applications = {} @server = http.createServer (req, res) => @onRequest req, res listen: (port) -> @server.listen port close: -> @server.close() applicationForConfig: (config) -> @applications[config] ?= nack.createPool config, size: 3, idle: idle onRequest: (req, res) -> reqBuf = new BufferedReadStream req host = req.headers.host.replace /:.*/, "" @configuration.findPathForHost host, (path) => if app = @applicationForConfig path app.proxyRequest reqBuf, res reqBuf.flush() else @respondWithError res, "unknown host #{req.headers.host}" respondWithError: (res, err) -> res.writeHead 500, "Content-Type": "text/html" res.write "

    500 Internal Server Error

    #{err}

    " res.end() Dialog = require './dialog' Project = require './project' projects = require './projects' path = require 'path' module.exports = class SaveDialog extends Dialog filePath: null constructor: () -> firstPath = atom.project.getPaths()[0] title = path.basename(firstPath) if atom.config.get('project-manager.prettifyTitle') title = @prettifyTitle(title) super prompt: 'Enter name of project' input: title select: true iconClass: 'icon-arrow-right' projects.getCurrent (project) => if project.props.paths[0] is firstPath @showError "This project is already saved as #{project.props.title}" onConfirm: (title) -> if title properties = title: title paths: atom.project.getPaths() project = new Project(properties) project.save() @close() else @showError('You need to specify a name for the project') prettifyTitle: (title) -> title = title.replace(/[^\w\s]/gi, ' ') title = title.charAt(0).toUpperCase() + title.slice(1) # http://ogp.me/ OgpParser = exports? and exports or @OgpParser = {} # expects a "dom" object created by cheerio OgpParser.execute = ($) -> title: $("meta[property='og:title']").first().attr("content") summary: $("meta[property='og:description']").first().attr("content") image: $("meta[property='og:image']").first().attr("content") language: $("meta[property='og:locale']").first().attr("content") ParticipantHeads = require 'activity/views/privatemessage/participantheads' IDEChatMessageParticipantAvatar = require './idechatmessageparticipantavatar' module.exports = class IDEChatParticipantHeads extends ParticipantHeads setDefaultListTitle: -> @setOption 'moreListTitle', 'Other Participants' setVideoListTitle: -> @setOption 'moreListTitle', 'Inctive Participants' updateParticipants: (participantMap, state) -> @updatePreviewAvatars participantMap.preview, state @updateExtras participantMap.hidden, state updatePreviewAvatars: (participants, state) -> { selectedParticipant, talkingParticipants, videoActive } = state avatars = participants.toJS().map (participant) => { nickname } = participant.profile cssClasses = [] if videoActive if nickname is selectedParticipant cssClasses.push 'is-selectedParticipant' if nickname in talkingParticipants cssClasses.push 'is-talkingParticipant' options = { cssClass: cssClasses.join(' '), size: { width: 25, height: 25 } } avatar = new IDEChatMessageParticipantAvatar options, participant @forwardEvent avatar, 'ParticipantSelected' @previewContainer.destroySubViews() @previewContainer.addSubView avatar for avatar in avatars define [ 'jquery' 'underscore' 'backbone' 'marionette' 'cs!app' 'cs!collections/content' 'cs!views/layouts/workspace' 'less!styles/main.less' ], ($, _, Backbone, Marionette, app, content, WorkspaceLayout) -> return new class Router extends Marionette.AppRouter # Show Workspace # ------- # Show the workspace listing and update the URL workspace: () -> if not @layout @layout = new WorkspaceLayout() app.main.show(@layout) else # load default views @layout.showViews() # Edit existing content # ------- # Start editing an existing piece of content and update the URL. edit: (model) -> if typeof model is 'string' model = content.get(model) # Redirect to workspace if model does not exist if not model require ['cs!routers/router'], (router) -> router.navigate('/', {trigger: true, replace: true}); if not @layout @layout = new WorkspaceLayout({model: model}) app.main.show(@layout) else # load editor views @layout.showViews({model: model}) mongoose = require('mongoose') checkinSchema = new mongoose.Schema user: String session: Number checkinTime: Date deleted: { type: Boolean, default: false } deletedTime: Date checkinSchema.methods.upsert = () -> # https://jira.mongodb.org/browse/SERVER-14322 try @checkinTime = new Date() @update(this, {upsert: true}) catch logger.info "Could not upsert a checkin" checkinSchema.methods.markDeleted = () -> @deleted = true @deletedTime = new Date() @update(this) checkinSchema.statics.findBySession = (session) -> Checkin.find session: session deleted: false checkinSchema.statics.findByUser = (user) -> Checkin.find user: user deleted: false checkinSchema.index({ deleted: 1, session : 1 }) checkinSchema.index({ deleted: 1, user : 1 }) Checkin = mongoose.model('Checkins', checkinSchema); export default Checkin export MAX_CHECKIN_PER_SESSION = [1, 2] ##= require_self ##= require ./Import ##= require ./ApiInfo ##= require ./ChooseRecords ##= require ./ViewRecords class Skr.Screens.FreshBooksImport extends Skr.Screens.Base modelForAccess: 'invoice' getInitialState: -> isEditing: true dataObjects: import: -> new Skr.Screens.FreshBooksImport.Import jobStatus: -> return null unless @import.job.isExecuting message = if @import.stage is 'complete' "Importing records from Fresh Books" else "Loading record summaries from Fresh Books" render: -> {@jobStatus()} {View} = require 'atom' ImageEditor = require './image-editor' module.exports = class ImageEditorStatusView extends View @content: -> @div class: 'status-image inline-block', => @span class: 'image-size', outlet: 'imageSizeStatus' initialize: (filePath, image) => @filePath = filePath @image = image if @filePath and @image @attach() @subscribe atom.workspaceView, 'pane-container:active-pane-item-changed', => editor = atom.workspaceView.getActivePaneItem() if editor instanceof ImageEditor and @filePath is editor.filePath @imageSizeStatus.parent().show() else @imageSizeStatus.parent().hide() attach: => statusBar = atom.workspaceView.statusBar if statusBar statusBar.appendLeft this @getImageSize() getImageSize: => imageWidth = @image.width() imageHeight = @image.height() @imageSizeStatus.text("#{imageWidth} px x #{imageHeight} px").show() express = require("express") routes = require("./routes") app = module.exports = express.createServer() app.configure -> app.set "views", __dirname + "/views" app.set "view engine", "jade" app.use express.bodyParser() app.use express.methodOverride() app.use app.router app.use express.static(__dirname + "/assets") app.use require('connect-assets')() app.configure "development", -> app.use express.errorHandler( dumpExceptions: true showStack: true ) app.configure "production", -> app.use express.errorHandler() app.get "/", routes.index models = require './models' rest = require "./routes/rest" rest.createRoutesFor "character", models.Character, app app.listen process.env.port, -> console.log "Express server listening on port %d in %s mode", app.address().port, app.settings.env ### Module to fetch meetup events @author Snorre Magnus Davøen ### ### { "title": "Event title", "source": "http://url.com", "date": [timestamp], "location": { "address": "Addressen til greien", "name": "hvis det er et navn på stedet (f.eks Kvarteret/Landmark)", "lon": 10 "lat": 10 } } ### mu = require 'meetup-api' # Check if this is a Facebook url # @param [string] url exports.canHandle = (url) -> return false # Import and url # @param [object] query # @option query [string] url # @option query [function] onSuccess # @option query [function] onError exports.handle = (query) -> # Description: # The Adventures of Captain Quail, now in you chat! # # Dependencies: # "htmlparser": "1.7.6" # "soupselect": "0.2.0" # # Configuration: # None # # Commands: # hubot cq - The latest Adventures of Captain Quail # # Author: # phildini htmlparser = require "htmlparser" Select = require("soupselect").select module.exports = (robot) -> robot.respond /cq/i, (msg) -> msg.http("http://www.captainquail.com/comic/") .get() (err, res, body) -> handler = new htmlparser.DefaultHandler() parser = new htmlparser.Parser(handler) parser.parseComplete(body) img = Select handler.dom, "img.comic" title = Select handler.dom, "a.content-link" link = title[0].attribs comic = img[0].attribs msg.send link.href msg.send comic.alt module.exports = (robot) -> robot.respond /hello/, (msg) -> msg.reply "hello!" robot.hear /orly/, -> msg.send "yarly" # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # An example hack to make opened Markdown files always be soft wrapped: # # path = require 'path' # atom.workspaceView.eachEditorView (editorView) -> editor = editorView.getEditor() if path.extname(editor.getPath()) is '.md' editor.setSoftWrap(true) NotificationPlugin = require '../../notification-plugin' Handlebars = require 'handlebars' url = require 'url' module.exports = class BugHerd extends NotificationPlugin # Resolve the bugs rest api endpoint tasksUrl = (config) -> "https://www.bugherd.com/api_v2/projects/#{config.projectId}/tasks.json" # Parses the user's input of tags for the task parseTags = (tags) -> tags?.split /, */ # Build the request payload @requestPayload = (config, event) -> task: description: @textBody event priority: config.priority tag_names: parseTags config.tags status: config.status # Compose the really simple message body @textBody = Handlebars.compile( """ {{#if error.message}}{{error.message}}{{/if}} ({{error.exceptionClass}} in {{error.context}}) Stacktrace:{{#each error.stacktrace}}{{#if inProject}} {{file}}:{{lineNumber}} - {{method}}{{/if}}{{/each}} """ ) # Receive the configuration & event payload @receiveEvent = (config, event, callback) -> return if event?.trigger?.type == 'reopened' console.log config, event @request .post tasksUrl config .auth config.apiKey, 'x' .send @requestPayload config, event .on 'error', (err) -> callback err .end (res) -> return callback res.error if res.error callback null, id: res?.body?.task?.id url: res?.body?.task?.admin_link request = require 'request' _ = require 'lodash' class StockController lastTradePrice: (req, res) => @request req.params.symbol, (error, response, body) => return res.status(500).send(error) if error? res.status(response.statusCode).send(body) request: (symbol, callback=->) => options = url: 'http://download.finance.yahoo.com/d/quotes.csv' qs: s: symbol f: 'l1' request options, callback module.exports = StockController define (require) -> settings = require('settings') FooterTabView = require('cs!../inherits/tab/tab') template = require('hbs!./metadata-template') require('less!./metadata') return class MetadataView extends FooterTabView template: template templateHelpers: () -> model = super() model.languages = settings.languages return model editable: '.js-metadata-language-select': value: if @media is 'book' then 'currentPage.language' else 'language' type: 'select2' select2: width: 300 initialize: () -> super() @listenTo(@model, 'change:editable', @render) AppSettingsStore = require('../../stores/app-settings-store').store migration = version: "1.22.0" description: "Add simulation type" date: "2018-03-30" doUpdate: (data) -> data.settings ?= {} # previous complexities were: # 0: diagram only # 1: basic relationships # 2: expanded relationships # 3: collectors # # map these to # 0: simulation: diagramOnly / complexity: basic # 1: simulation: static / complexity: basic # 2: simulation: static / complexity: expanded # 3: simulation: time / complexity: expanded previousComplexity = data.settings.complexity or 2 if previousComplexity == 0 data.settings.simulationType = AppSettingsStore.SimulationType.diagramOnly data.settings.complexity = AppSettingsStore.Complexity.basic else if previousComplexity == 1 data.settings.simulationType = AppSettingsStore.SimulationType.static data.settings.complexity = AppSettingsStore.Complexity.basic else if previousComplexity == 2 data.settings.simulationType = AppSettingsStore.SimulationType.static data.settings.complexity = AppSettingsStore.Complexity.expanded else if previousComplexity == 3 data.settings.simulationType = AppSettingsStore.SimulationType.time data.settings.complexity = AppSettingsStore.Complexity.expanded module.exports = _.mixin migration, require './migration-mixin'path = require 'path' Q = require 'q' SymbolsView = require './symbols-view' TagReader = require './tag-reader' module.exports = class GoToView extends SymbolsView toggle: -> if @panel.isVisible() @cancel() else @populate() beforeRemove: -> @deferredFind?.resolve([]) findTag: (editor) -> @deferredFind?.resolve([]) deferred = Q.defer() TagReader.find editor, (error, matches=[]) -> deferred.resolve(matches) @deferredFind = deferred @deferredFind.promise populate: -> editor = atom.workspace.getActiveTextEditor() return unless editor? @findTag(editor).then (matches) => tags = [] for match in matches position = @getTagLine(match) continue unless position tags.push file: match.file name: path.basename(match.file) position: position if tags.length is 1 @openTag(tags[0]) else if tags.length > 0 @setItems(tags) @attach() 'use strict' app = angular .module('taarifaWaterpointsApp', [ 'ngResource', 'ngRoute', 'leaflet-directive', 'dynform', 'angular-flash.service', 'angular-flash.flash-alert-directive', 'gettext', 'ui.bootstrap' ]) .config ($routeProvider, $httpProvider, flashProvider) -> $routeProvider .when '/', templateUrl: 'views/main.html' controller: 'MapCtrl' .when '/waterpoints/edit/:id', templateUrl: 'views/edit.html' controller: 'WaterpointEditCtrl' .when '/waterpoints/new', templateUrl: 'views/edit.html' controller: 'WaterpointCreateCtrl' .when '/requests/new', templateUrl: 'views/edit.html' controller: 'RequestCreateCtrl' .when '/dashboard', templateUrl: 'views/dashboard.html' controller: 'DashboardCtrl' .otherwise redirectTo: '/' $httpProvider.defaults.headers.patch = 'Content-Type': 'application/json;charset=utf-8' flashProvider.errorClassnames.push 'alert-danger' app.run (gettextCatalog,$rootScope) -> gettextCatalog.currentLanguage = 'en' # gettextCatalog.debug = true $rootScope.fields = { catalog: gettextCatalog, languages: { "en": "English", "sw_TZ": "Swahili" } } module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-contrib-jshint') grunt.loadNpmTasks('grunt-contrib-watch') grunt.loadNpmTasks('grunt-mocha-cov') grunt.initConfig pkg: grunt.file.readJSON('package.json') jshint: options: jshintrc: '.jshintrc' files: ['jquery.circular.js'] coffee: compile: files: 'jquery.circular.js': 'src/circular.coffee' 'build/circular.js': 'src/circular.coffee' mochacov: coverage: options: coveralls: serviceName: 'travis-ci' repo_token: 'EPwLMGsbXbKvvVk9hGRSTK0CY2ueNZsEr' test: options: reporter: 'spec' options: compilers: ['coffee:coffee-script'] files: ['test/**/*.coffee'] watch: files: ['src/circular.coffee', 'test/**/*.coffee'] tasks: ['check', 'test'] grunt.registerTask('check', ['coffee', 'jshint']) grunt.registerTask('test', 'mochacov:test') grunt.registerTask('default', 'watch') grunt.registerTask('travis', ['check', 'mochacov:coverage']) path = require 'path' async = require 'async' topl = require 'topl' fs = undefined try fs = require 'graceful-fs' catch error fs = require 'fs' fileExists = fs.exists or path.exists # Read and parse a TOML file. # # filename - The String path to a TOML file. # callback - The Function called after parsing. # # Returns the parsed-TOML Object. readTOML = (filename, callback) -> async.waterfall [ (cb) -> fs.readFile filename, cb (buffer, cb) -> try rv = topl.parse buffer.toString() cb null, rv catch error error.filename = filename error.message = "parsing #{ path.basename(filename) }: #{ error.message }" cb error, null ], callback module.exports = {fileExists, readTOML}express = require("express") path = require("path") http = require("http") app = express() app.set "port", process.env.PORT || 3000 # Log requests to the console app.use express.logger "dev" # Allow the app to read JSON from the body in POSTs and PUTs app.use express.bodyParser() # OS-agnostic way of going up two directories # to be able to access the lib and vendor folders app.use express.static path.join __dirname, "..", ".." app.get "/", (request, response) -> response.sendfile path.join "src", "app", "index.html" # Add more routes here http.createServer(app).listen app.get("port"), () -> console.log "Server listening on port: " + app.get "port"module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'update-atom-shell', 'Update atom-shell', -> done = @async() spawn cmd: 'script/update-atom-shell', (error) -> done(error) path = require "path" assert = require "assert" rootRequire = require("root-require") root = rootRequire.packpath.parent() pkg = rootRequire("./package.json") module.constructor.prototype.require = (modulePath) -> assert(modulePath, 'missing path') assert(typeof modulePath == 'string', 'path must be a string') load = (modulePath) => this.constructor._load(modulePath, this) overridePath = pkg.browser[modulePath] if overridePath? modulePath = path.join(root, overridePath) return load(modulePath) if not (global.window? and global.document?) jsdom = require('jsdom').jsdom global.document = jsdom() global.window = document.defaultView for own name, object of global.window if not global[name]? global[name] = object Bokeh = require './main' _ = Bokeh._ APIs = require './api' _.extend(Bokeh, _.omit(APIs, "models")) module.exports = Bokeh React = require 'react' Markdown = require './markdown' module.exports = React.createClass displayName: 'MarkdownEditor' getInitialState: -> previewing: false value: @props.defaultValue ? '' render: -> previewing = @props.previewing ? @state.previewing
    {@transferPropsTo
    'use strict' angular.module 'flickrSimpleReorder' .config [ '$stateProvider' '$urlRouterProvider' ( $stateProvider $urlRouterProvider ) -> $urlRouterProvider.otherwise '/photosets' $stateProvider .state 'login', url: '/login?frob&isFrobInvalid' controller: 'LoginCtrl' templateUrl: 'tpls/login.html' .state 'logout', url: '/logout?isSilent&isExpired' controller: 'LogoutCtrl' templateUrl: 'tpls/logout.html' .state 'photosets', url: '/photosets' controller: 'PhotosetsCtrl' templateUrl: 'tpls/photosets.html' resolve: user: ['Auth', (Auth) -> Auth.checkToken()] .state 'about', url: '/about' templateUrl: 'tpls/about.html' resolve: user: ['Auth', (Auth) -> Auth.checkToken()] ] Config = require "../config" Utils = require "../utils" class User @withEmail: (email) -> Utils.fetch("#{Config.jira.url}/rest/api/2/user/search?username=#{email}") .then (user) -> jiraUser = user[0] if user and user.length is 1 throw "Cannot find jira user with #{email}, trying myself" unless jiraUser jiraUser .catch (error) -> Utils.robot.logger.error error Utils.fetch("#{Config.jira.url}/rest/api/2/myself") @withUsername: (username) -> Utils.fetch("#{Config.jira.url}/rest/api/2/user?username=#{username}") .catch (error) -> Utils.robot.logger.error "Cannot find jira user with #{username}, trying myself" Utils.fetch("#{Config.jira.url}/rest/api/2/myself") module.exports = User document.addEventListener "turbolinks:load", -> $(".img-check").click -> $(this).toggleClass("checked") routePreviewBoards = $('.route-preview.board') if routePreviewBoards.length > 0 routeSVGId = routePreviewBoards.data('routesvgid') route = $('#svg_' + routeSVGId) route.attr('filter', 'url(#glow)') route.attr('fill', 'orange') route.attr('opacity', 0.7) should = require 'should' {wd40, browser, login_url, home_url, prepIntegration} = require './helper' describe 'New view tool', -> prepIntegration() before (done) -> wd40.fill '#username', 'ehg', -> wd40.fill '#password', 'testing', -> wd40.click '#login', done context 'when I click on an Apricot dataset', -> before (done) -> # wait for tiles to fade in setTimeout -> browser.elementByPartialLinkText 'Apricot', (err, link) -> link.click done , 500 it 'takes me to the Apricot dataset page', (done) -> wd40.trueURL (err, result) -> result.should.match /\/dataset\/(\w+)/ done() context 'when I click on "More tools" in the "Tools" dropdown', -> before (done) -> wd40.click 'a#dataset-tools-toggle', -> wd40.click '.new-view', -> browser.waitForElementByCss '#chooser .tool', 4000, done context 'when I click on the newview tool', -> before (done) -> wd40.click '.newview.tool', => browser.waitForElementByTagName 'iframe', 10000, => browser.url (err, url) => @currentUrl = url done() it 'takes me to the view page', -> @currentUrl.should.match new RegExp("#{home_url}/dataset/[^/]+/view/[^/]+") Promise = require 'bluebird' fs = Promise.promisifyAll require 'fs' _ = require 'lodash' module.exports = () -> # For performance reasons, we'll do this asynchronously. fs.readdirAsync('./controllers/').then (controllers) -> #This probably isn't necessary: I wanted to parse through and grab all these controllers # asynchronously, so I threw them in a promise makeAsyncControllerParse = (file) -> return new Promise (resolve, reject) -> if file.match(/.+\.js/g) != null || file.match(/.+\.coffee/g) != null # When requiring the module, we don't really want to specify an extension. # Let's get rid of it. myObject = {} name = file.replace('.js', '').replace('.coffee', '') # Require the controller, feed it into the controllers myObject[name] = require "../controllers/#{name}" resolve(myObject) # Create a big ol' object of all the promises so that we have a handle on all the files. # # We're utilizing lodash's "chain" function simply because it gives us somewhat sane list # comprehension comparable to linq. promiseObject = do _.chain controllers .map makeAsyncControllerParse .reduce (bigObject, piece) -> _.extend bigObject, piece .value # Once everything is done from above, we return back the collective promise object and # pipe that to whomever feels fit. return Promise.props promiseObject module.exports = templateMap: signup: -> require('./templates/signup.jade') arguments... login: -> require('./templates/login.jade') arguments... register: -> require('./templates/register.jade') arguments... forgot: -> require('./templates/forgot.jade') arguments... reset: -> require('./templates/reset.jade') arguments... stateEventMap: signup: 'Viewed sign up options' login: 'Viewed login form' register: 'Viewed register using email form' forgot: 'Viewed forgot password form' reset: 'Completed password reset' successEventMap: login: 'Successfully logged in' register: 'Created account' routeCopyMap: '/favorites': signup: null register: 'Sign up to save artworks' login: 'Login to save artworks' '/following/genes': signup: null register: null login: 'Log in to manage what you follow' '/following/artists': signup: null register: 'Sign up to follow artists' login: 'Log in to follow artists' '/following/profiles': signup: null register: 'Sign up to follow galleries and museums' login: 'Login to follow galleries and museums' OT = require './' module.exports = class Document constructor: -> @text = "" @revision = 0 @operations = [] apply: (newOperation, revision) -> # Should't happened throw new Error "The operation base revision is greater than the document revision" if revision > @revision if revision < @revision # Conflict ! missedOperations = new OT.TextOperation missedOperations.targetLength = @operations[revision].baseLength for index in [revision ... @operations.length] missedOperations = missedOperations.compose @operations[index] [missedOperationsPrime, newOperationPrime] = missedOperations.transform newOperation operationToPush = newOperationPrime else operationToPush = newOperation.clone() @text = operationToPush.apply @text @revision++ @operations.push operationToPush return class Storage images: {} counter: 0 constructor: (repeat) -> @repeat = not not repeat add: (image) -> return false unless image.orig cid = @counter++ fragments = image.orig.split '/' image.hashbang = fragments[fragments.length-1] image.thumb = image.orig unless image.thumb @images[cid] = merge { cid: cid, # id name: '', # title thumb: '', # preview hashbang: '', # filename orig: '', # original w: null, # width h: null # height }, image return @images[cid] get: (cid) -> return @images[cid] next: (current) -> cid = current.cid + 1 cid = 0 if not @images[cid] and @repeat return @images[cid] prev: (current) -> cid = current.cid - 1 cid = @length() if cid < 0 and @repeat return @images[cid] length: -> return Object.keys(@images).length search: (hash) -> for own key, image of @images return image if "##{image.hashbang}" is hash return false module.exports = class EditAPI constructor: (@api) -> format: (file, offset, length) => @api.perform 'edit.format', file: file selectionOffset: offset selectionLength: length "*": core: disabledPackages: [ "minimap" ] telemetryConsent: "limited" editor: fontSize: 13 scrollPastEnd: true zoomFontWhenCtrlScrolling: false linter: {} "linter-eslint": lintHtmlFiles: true welcome: showOnStartup: false fs = require 'fs-plus' Path = require 'flavored-path' Os = require 'os' git = require '../../lib/git' {repo, pathToRepoFile} = require '../fixtures' GitShow = require '../../lib/models/git-show' describe "GitShow", -> beforeEach -> spyOn(git, 'cmd').andReturn Promise.resolve 'foobar' it "calls git.cmd with 'show' and #{pathToRepoFile}", -> GitShow repo, 'foobar-hash', pathToRepoFile args = git.cmd.mostRecentCall.args[0] expect('show' in args).toBe true expect(pathToRepoFile in args).toBe true it "writes the output to a file", -> spyOn(fs, 'writeFile').andCallFake -> fs.writeFile.mostRecentCall.args[3]() outputFile = Path.join Os.tmpDir(), "foobar-hash.diff" waitsForPromise -> GitShow repo, 'foobar-hash', pathToRepoFile runs -> args = fs.writeFile.mostRecentCall.args expect(args[0]).toBe outputFile expect(args[1]).toBe 'foobar' describe "When a hash is not specified", -> it "returns a view for entering a hash", -> view = GitShow repo expect(view).toBeDefined() # # Collection for a group of Blocks (could be users and channels as well) fetched by a search # Blocks = require("./blocks.coffee") sd = require("sharify").data _ = require 'underscore' Block = require("../models/block.coffee") params = require 'query-params' module.exports = class SearchBlocks extends Blocks defaultOptions: page: 1 per: 20 model: Block url: -> if @options.subject return "#{sd.API_URL}/search/#{@options.subject}?#{params.encode(@options)}" else return "#{sd.API_URL}/search?#{params.encode(@options)}" parse: (data)-> @total_pages = data.total_pages _.flatten _.values _.pick(data, ['contents', 'followers', 'users', 'channels', 'following', 'blocks', 'results']) loadNext: -> return false if @options.page > @total_pages ++@options.page @fetch remove: false, merge: trueLabelView = require './label-view' CiteView = require './cite-view' LatexerHook = require './latexer-hook' {CompositeDisposable} = require 'atom' module.exports = Latexer = config: parameters_to_search_citations_by: type: "array" default: ["title", "author"] items: type: "string" directories_to_search_bib_in: type: "array" default: [] items: type: "string" autocomplete_environments: type: "boolean" default: true autocomplete_references: type: "boolean" default: true autocomplete_citations: type: "boolean" default: true autocomplete_pandoc_markdown_citations: description: "For example: [see @doe99, pp. 33-35; also @smith04, chap. 1]" type: "boolean" default: true activate: -> instance = this atom.commands.add "atom-text-editor", "latexer:omnicomplete": (event)-> instance.latexHook.refCiteCheck @getModel(), true, true instance.latexHook.environmentCheck @getModel() "latexer:insert-reference": (event)-> instance.latexHook.lv.show @getModel() "latexer:insert-citation": (event)-> instance.latexHook.cv.show @getModel() atom.workspace.observeTextEditors (editor) => @latexHook = new LatexerHook(editor) deactivate: -> @latexHook.destroy() # Injected links to man(1) pages scopeName: "hidden.manref" injectionSelector: "text, comment, docstring, string.quoted.docstring, source.changelogs" patterns: [{ name: "manref" match: "([^\\s()<>/\"'`{}!:&*#?\\\\]+)((\\()([0-9])([^()\\s]*)(\\)))" captures: 1: name: "manref.subject" 2: name: "manref.section" 3: name: "punctuation.definition.begin.manref" 4: name: "manref.section-number" 5: name: "manref.section-group" 6: name: "punctuation.definition.end.manref" }] #= require ./vendor/qunit QUnit.config.hidepassed = true QUnit.config.testTimeout = 5000 QUnit.begin (suiteDetails) -> Blade.suiteBegin(total: suiteDetails.totalTests) failedAssertions = [] QUnit.testStart (testDetails) -> failedAssertions = [] QUnit.log (assertionDetails) -> unless assertionDetails.result failedAssertions.push(assertionDetails) QUnit.testDone (testDetails) -> name = "#{testDetails.module}: #{testDetails.name}" pass = testDetails.failed is 0 message = formatAssertions(failedAssertions) Blade.testResult({name, pass, message}) QUnit.done (suiteDetails) -> window.global_test_results = suiteDetails Blade.suiteEnd(suiteDetails) formatAssertions = (assertions = []) -> if assertions.length (formatAssertion(assertion) for assertion in assertions).join("\n---\n") formatAssertion = ({message, actual, expected, source}) -> lines = [] if message lines.push("Message: #{JSON.stringify(message)}") if expected lines.push("Expected: #{JSON.stringify(expected)}") if actual lines.push("Actual: #{JSON.stringify(actual)}") if source lines.push("Source:") for sourceLine in source.split("\n").slice(0,3) lines.push(" #{sourceLine.trim()}") lines.join("\n") {filter} = require 'fuzzaldrin' AutoCompletePlusProvider = selector: '.source.dart' disableForSelector: '.source.dart .comment' inclusionPriority: 1 excludeLowerPriority: true # Our analysis API service object analysisApi: null # Required: Return a promise, an array of suggestions, or null. getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) -> new Promise (resolve) => if @analysisApi path = editor.getPath() offset = editor.buffer.characterIndexForPosition(bufferPosition) @analysisApi.updateFile path, editor.getText() @analysisApi.completion.getSuggestions(path, offset) .then (autocompleteInfo) -> items = [] results = autocompleteInfo.params.results sortedResults = if prefix == "." results else filter(results, prefix, { key: 'completion'}) for result in sortedResults items.push text: result.completion, rightLabel: result.element.kind resolve(items) # (optional): called _after_ the suggestion `replacementPrefix` is replaced # by the suggestion `text` in the buffer onDidInsertSuggestion: ({editor, triggerPosition, suggestion}) -> # (optional): called when your provider needs to be cleaned up. Unsubscribe # from things, kill any processes, etc. dispose: -> module.exports = AutoCompletePlusProvider gutil = require 'gulp-util' child_process = require 'child_process' module.exports = (name, command, next = ->) -> child_process.exec( command (error, stdout, stderr) -> if error and error.code customError = message: "Failed: #{name}" gutil.log stdout gutil.log stderr gutil.log gutil.colors.red error gutil.log gutil.colors.red customError.message gutil.beep() if process.env.NODE_ENV isnt 'vagrant' process.exit 1 else gutil.log stdout gutil.log stderr gutil.log gutil.colors.green "Finished: #{name}" next() )_.extend TentStatus.Helpers, postUrl: (post) -> return unless post and post.get entity = post.get('entity') if (new HTTP.URI entity).hostname == TentStatus.config.domain_entity.hostname "/posts/#{post.get('id')}" else if entity.match /\.tent\.is/ "#{entity}/posts/#{post.get 'id'}" else "/posts/#{encodeURIComponent entity}/#{post.get('id')}" entityPostUrl: (entity, post_id) -> return unless entity and post_id if entity.match /\/.tent\.is/ "#{entity}/posts/#{post_id}" else "/posts/#{encodeURIComponent entity}/#{post_id}" entityProfileUrl: (entity) -> return unless entity if entity.match /\.tent\.is/ "#{entity}" else "/posts/#{encodeURIComponent entity}" Promise = require 'bluebird' {SphereClient} = require 'sphere-node-sdk' class FetchStocks constructor: (@logger, options = {}, @channelKey) -> @client = new SphereClient options run: -> if @channelKey @_getChannelId() .then (id) => queryString = 'supplyChannel(id="' + id + '")' @client.inventoryEntries.where(queryString).all().sort('lastModifiedAt').expand('supplyChannel').fetch() else @client.inventoryEntries.all().sort('lastModifiedAt').expand('supplyChannel').fetch() _getChannelId: -> queryString = 'key="' + @channelKey + '"' @client.channels.where(queryString).fetch() .then (result) -> Promise.resolve(result.body.results[0].id) module.exports = FetchStocksMochaWeb?.testOnly -> describe "Rock person function", -> if Meteor.isClient it "should not exist on the client", -> chai.assert.isUndefined Rock.person return it "should exist", -> chai.assert.isDefined Rock.person it "should be a function", -> chai.assert.isFunction Rock.person it "should return an object", -> chai.assert.isObject Rock.person() it "should call translate", (done) -> originalMethod = Rock.person.translate Rock.person.translate = -> done() Rock.person() Rock.person.translate = originalMethod {View} = require 'space-pen' $ = require 'jquery' Git = require 'git' fs = require 'fs' module.exports = class FileView extends View @content: ({file} = {}) -> @li class: 'file entry', => @span file.getBaseName(), class: 'name', outlet: 'fileName' @span '', class: 'highlight' file: null initialize: ({@file, @project} = {}) -> @subscribe $(window), 'focus', => @updateStatus() extension = fs.extension(@getPath()) if fs.isCompressedExtension(extension) @fileName.addClass('compressed-icon') else if fs.isImageExtension(extension) @fileName.addClass('image-icon') else if fs.isPdfExtension(extension) @fileName.addClass('pdf-icon') else @fileName.addClass('text-icon') @updateStatus() updateStatus: -> @removeClass('ignored modified new') repo = @project.repo return unless repo? path = @getPath() if repo.isPathIgnored(path) @addClass('ignored') else status = repo.getPathStatus(path) if repo.isStatusModified(status) @addClass('modified') else if repo.isStatusNew(status) @addClass('new') getPath: -> @file.path path = require 'path' helpers = require('yeoman-generator').test describe 'app', -> beforeEach (done) -> helpers.testDirectory path.join(__dirname, 'app.tmp'), (err) => return done(err) if err @app = helpers.createGenerator 'coffee-module:app', ['../../app'] done() it 'creates expected files', (done) -> # add files you expect to exist here. expected = """ package.json README.md LICENSE .travis.yml .gitignore test/mocha.opts test/test-module.spec.coffee src/test-module.coffee """.split /\s+/g helpers.mockPrompt @app, someOption: true @app.options['skip-install'] = true @app.userInfo = -> @realname = 'Alex Gorbatchev'; @email = 'alex.gorbatchev@world.com'; @githubUrl = 'https://github.com/alexgorbatchev'; helpers.mockPrompt @app, githubUser: 'alexgorbatchev' moduleName: 'test-module' @app.run {}, -> helpers.assertFile expected done() {fs} = require 'atom' path = require 'path' Watcher = require './watcher' module.exports = class BaseThemeWatcher extends Watcher constructor: -> super() @stylesheetsPath = path.dirname(window.resolveStylesheet('../static/atom.less')) @watch() watch: -> filePaths = fs.readdirSync(@stylesheetsPath).filter (filePath) -> path.extname(filePath).indexOf('less') > -1 @watchFile(filePath) for filePath in filePaths loadStylesheet: -> @loadAllStylesheets() loadAllStylesheets: -> atom.reloadBaseStylesheets() React = require 'react' BS = require 'react-bootstrap' classnames = require 'classnames' _ = require 'underscore' module.exports = React.createClass displayName: 'Icon' propTypes: type: React.PropTypes.string.isRequired spin: React.PropTypes.bool className: React.PropTypes.string tooltip: React.PropTypes.oneOf([ React.PropTypes.string, React.PropTypes.element ]) tooltipProps: React.PropTypes.object onNavbar: React.PropTypes.bool componentWillMount: -> uniqueId = _.uniqueId('icon-tooltip-') @setState({uniqueId: uniqueId}) getDefaultProps: -> tooltipProps: placement: 'bottom', trigger: 'click' render: -> classNames = classnames('tutor-icon', 'fa', "fa-#{@props.type}", @props.className, { 'fa-spin': @props.spin 'clickable': @props.tooltip and @props.tooltipProps.trigger is 'click' }) icon = if @props.tooltip classNames = tooltip = {@props.tooltip} {icon} else icon class Layout constructor: (@fn) -> this.resize() this.listen() setTimeout (=> this.resize()), 250 resize: -> this.fill '.x-fill', 'outerWidth', 'width' this.fill '.y-fill', 'outerHeight', 'height' this.fn() fill: (selector, get, set) -> $(selector).each (ix, node) => node = $(node) getter = node[get] parent = getter.call node.parent() fixed = this.fixed node, selector, (n) -> getter.call n node[set].call node, parent - fixed fixed: (node, selector, fn) -> node.siblings().not(selector).not('.float').filter(':visible') .map(-> fn $ this).get() .reduce ((sum, num) -> sum + num), 0 listen: -> id = null $(window).resize => clearTimeout id id = setTimeout (=> this.resize()), 10 this.resize()# Your keymap # # Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors # to apply styles to elements, Atom keymaps use selectors to associate # keystrokes with events in specific contexts. # # You can create a new keybinding in this file by typing "key" and then hitting # tab. # # Here's an example taken from Atom's built-in keymap: # # 'atom-text-editor': # 'enter': 'editor:newline' # # '.workspace': # 'ctrl-shift-p': 'core:move-up' # 'ctrl-p': 'core:move-down' # # You can find more information about keymaps in these guides: # * https://atom.io/docs/latest/customizing-atom#customizing-key-bindings # * https://atom.io/docs/latest/advanced/keymaps # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it here: # https://github.com/bevry/cson#what-is-cson runas = require('bindings')('runas.node') module.exports = (command, args=[], options={}) -> options.hide ?= false options.admin ?= true runas.runas(command, args, options) noflo = require "noflo" class Template extends noflo.Component description: "This component receives a templating engine name, a string containing the template, and variables for the template. Then it runs the chosen template engine and sends resulting templated content to the output port" constructor: -> @engine = "jade" @variables = null @template = null @inPorts = engine: new noflo.Port() options: new noflo.Port() template: new noflo.Port() @outPorts = out: new noflo.Port() @inPorts.engine.on "data", (data) => @engine = data @inPorts.options.on "connect", => @variables = null @inPorts.options.on "data", (data) => @variables = data @inPorts.options.on "disconnect", => @outPorts.out.connect() if @template @inPorts.template.on "connect", => @template = null @inPorts.template.on "data", (data) => @template = data @inPorts.template.on "disconnect", => @outPorts.out.connect() if @variables @outPorts.out.on "connect", => templating = require @engine @outPorts.out.send templating.render @template, @variables @variables = null @outPorts.out.disconnect() exports.getComponent = -> new Template() taxons_template = null get_taxonomy = -> Spree.ajax url: "#{Spree.routes.taxonomy_path}?set=nested" draw_tree = (taxonomy) -> $('#taxonomy_tree') .html( taxons_template({ taxons: [taxonomy.root] }) ) .find('ul') .sortable connectWith: '#taxonomy_tree ul' placeholder: 'sortable-placeholder ui-state-highlight' tolerance: 'pointer' cursorAt: { left: 5 } redraw_tree = -> get_taxonomy().done(draw_tree) @setup_taxonomy_tree = (taxonomy_id) -> return unless taxonomy_id? taxons_template_text = $('#taxons-list-template').text() taxons_template = Handlebars.compile(taxons_template_text) Handlebars.registerPartial( 'taxons', taxons_template_text ) redraw_tree() fs = require 'fs' three = require 'three' module.exports = class StrokeMesh constructor: (scene) -> @nStrokes = 1000 uniforms = bright: type: 'f' value: 0 strokeTexture: type: 't' value: three.ImageUtils.loadTexture 'texture/stroke.png' attributes = strokeColor: type: 'c' value: [ ] for idx in [0...@nStrokes] attributes.strokeColor.value.push new three.Color 0xffffff * Math.random() @material = new three.ShaderMaterial uniforms: uniforms attributes: attributes vertexShader: fs.readFileSync __dirname + '/../shader/stroke.vs.glsl' fragmentShader: fs.readFileSync __dirname + '/../shader/stroke.fs.glsl' transparent: yes blending: three.NormalBlending # Makes transparency work @strokeGeometry = new three.Geometry for idx in [0...@nStrokes] p = -> Math.random() * 20 - 10 @strokeGeometry.vertices.push new three.Vector3 p(), p(), p() @strokeSystem = new three.ParticleSystem @strokeGeometry, @material @strokeSystem.frustomCulled = yes @strokeSystem.sortParticles = yes scene.add @strokeSystem React = require 'react' Nav = React.createFactory require 'antwar-default-theme/Nav' Paths = require('antwar-core/PathsMixin') require 'antwar-default-theme/scss/main.scss' require 'react-ghfork/gh-fork-ribbon.ie.css' # ie support require 'react-ghfork/gh-fork-ribbon.css' Fork = React.createFactory(require 'react-ghfork') Config = require 'config' { div, main, script, link } = require 'react-coffee-elements' config = require 'config' if config.theme.customStyles? require 'customStyles/' + config.theme.customStyles module.exports = React.createClass displayName: 'Body' mixins: [ Paths ] render: -> sectionName = @getSectionName() itemTitle = @getItem().title; div { }, if sectionName and sectionName != '/' Nav({items: Config.theme.navigation(sectionName)}) if sectionName and sectionName != '/' Fork { className: 'right ribbon', project: "survivejs/webpack_react/issues/new?title=#{itemTitle} - ", text: 'Submit feedback', style: {backgroundColor: 'black'}, target: '_blank'} main { role: 'main' }, @props.children path = require "path" latexmk = require "./latexmk" ProgressIndicatorView = require "./progress-indicator-view" module.exports = configDefaults: texPath: "$PATH:/usr/texbin" outputDirectory: "" enableShellEscape: false activate: -> atom.workspaceView.command "latex:build", => @build() build: -> editor = atom.workspace.activePaneItem file = editor?.buffer.file unless file? # TODO: Show info message that the file has to be saved once? return editor.save() if editor.isModified() # NOTE: Should this be configurable? builder = @getBuilder() args = builder.constructArgs(file.path) @showProgressIndicator() proc = builder.run args, (statusCode) => @destroyProgressIndicator() if statusCode == 0 @showResult() else @showError("TeXification failed! Check the log file for more info...") return getBuilder: -> latexmk showResult: -> # TODO: Display a more visible success message. console.info "Success!" unless atom.inSpecMode() showError: (error) -> # TODO: Introduce proper error and warning handling. console.error error unless atom.inSpecMode() showProgressIndicator: -> return @indicator if @indicator? @indicator = new ProgressIndicatorView atom.workspaceView.statusBar?.prependRight(@indicator) @indicator destroyProgressIndicator: -> @indicator?.destroy() @indicator = null # Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' # # Each scope (e.g. '.source.coffee' above) can only be declared once. # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it in the # Atom Flight Manual: # https://atom.io/docs/latest/using-atom-basic-customization#cson '.source.js': 'Redux container': 'prefix': 'rcont' 'body': """ import { connect } from 'react-redux' import $1 from '../components/$1' export default connect()($1) """ 'Stylesheet (React Native)': 'prefix': 'rnss' 'body': """ import { StyleSheet } from 'react-native' export default StyleSheet.create({ $1 }) """ packages: [ "advanced-open-file" "atom-alignment" "atom-handlebars" "auto-update-packages" "docblockr" "editorconfig" "emmet" "expand-region" "language-apache" "language-applescript" "language-awk" "language-env" "language-gitattributes" "language-gitignore" "language-hosts" "language-ini" "language-latex" "language-liquid" "language-lisp" "language-pegjs" "language-prolog" "language-svg" "language-tcl" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jshint" "linter-jsonlint" "linter-php" "linter-ui-default" "monokai" "package-sync" "pigments" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "tabs-to-spaces" ] NotificationPlugin = require "../../notification-plugin" class xMatters extends NotificationPlugin # Flatten properties e.g. srcObj.project.name -> dstObject.project_name flatten = (dstObj, srcObj, prefix) -> for property of srcObj if typeof srcObj[property] == "object" if prefix continue # nested objects like stackTrace array are not supported flatten(dstObj, srcObj[property], property) else if prefix dstObj[ prefix + "_" + property] = srcObj[property] dstObj @receiveEvent = (config, event, callback) -> # Set event priority if event.error? xm_priority = 'high' else xm_priority = 'medium' # Build the message payload = priority : xm_priority properties : flatten({}, event) # Inject new event @request .post config.form .set 'Accept', 'application/json' .timeout(4000) .auth(config.initiator, config.password) .send(payload) .on "error", (err) -> callback(err) .end (res) -> # console.log "End: " + JSON.stringify(res.body) callback(res.errorDetails) # console.log payload module.exports = xMattersclass Skr.Extension extends Lanes.Extensions.Base identifier: "skr" # Data that is provided by lib/skr/extension.rb's # client_bootstrap_data method ends up here setBootstrapData: (data) -> Skr.Models.GlAccount.initialize( accounts: data.gl_accounts default_ids: data.default_gl_account_ids, ) Skr.Models.Location.initialize( locations: data.locations ) for type, choices of data.templates klass = Skr.Models[_.classify(type)] if klass klass.Templates = choices else console.log "Unable to find model for #{type}" rootComponent: (viewport) -> Lanes.Workspace.Layout preferenceElement: (props) -> React.createElement(SC.UserPreferences, key: 'skr') module.exports = activate: -> atom.workspaceView.command "ascii-art:convert", => @convert() convert: -> # This assumes the active pane item is an editor selection = atom.workspace.activePane.Item.getSelection() figlet = require 'figlet' figlet selection.getText(), {font: "Larry 3D 2"}, (error, asciiArt) -> if error console.error(error) else selection.insertText("\n" + asciiArt + "\n") fs = require 'fs' module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') sass: main: files: 'dist/style.css': 'css/rohpod.scss' copy: js: src: 'js/*.js' dest: 'dist/' flatten: true expand: true img: src: 'img/*' dest: 'dist/' flatten: true expand: true lib: src: 'build/jslibs.min.js' dest: 'dist/jslibs.min.js' index: src: 'index.htm' dest: 'dist/' concat: libs: src: ['jslib/*.min.js'] dest: 'build/jslibs.min.js' clean: dist: 'dist' build: 'build' grunt.loadNpmTasks 'grunt-contrib-sass' grunt.loadNpmTasks 'grunt-contrib-copy' grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-contrib-clean' grunt.registerTask 'default', () -> grunt.task.run ['copy', 'sass'] # # /login, /sign_up and /forgot # Render the homepage but force open the appropriate modals # express = require 'express' routes = require './routes' { loginPagePath, signupPagePath, twitterLastStepPath } = require('artsy-passport').options app = module.exports = express() app.set 'views', __dirname + '/templates' app.set 'view engine', 'jade' # Twitter "One last Step" UI to enter email and login app.get twitterLastStepPath, routes.twitterLastStep # Forgot/reset password app.get '/forgot_password', routes.forgotPassword app.post '/forgot_password', routes.submitForgotPassword app.get '/reset_password', routes.resetPassword # Login and signup pages app.get loginPagePath, routes.login app.get signupPagePath, routes.signUp debug = require("debug")("owfs:convert") exports.extractValue = (callback) -> (error, messages) -> if !error if messages.length > 1 debug "Received multiple messages in simple read",messages messageToUse = messages.filter (message) -> debug "Checking Header payload > 0",message.header.payload message.header.payload > 0 else messageToUse = messages debug "message to use",messageToUse result = messageToUse[0].payload.replace(new RegExp(" ", "g"), "") callback(error, result) else callback(error) extractDirectoriesFromMessage = (message)-> if not not message.payload exp = new RegExp("[\u0000-\u001F]", "g") lines = message.payload.replace(exp, "").split(" ") lines = lines.filter (line)-> not not line lines.join(",").split "," else [] exports.extractDirectories = (callback) -> debug "extractDirectories" (err, messages) -> debug messages if !err directories = messages.map extractDirectoriesFromMessage debug "extracted directories",directories callback(err, [].concat directories...) else callback(err) TM = angular.module 'TM', [] # AUTH CLIENT_ID = '522804721863.apps.googleusercontent.com' SCOPES = [ 'https://www.googleapis.com/auth/tasks' 'https://www.googleapis.com/auth/userinfo.profile' ] window.onAuthLibLoad = -> authorize handleAuthResult, true authorize = (callback, immediate) -> setTimeout -> window.gapi.auth.authorize {client_id: CLIENT_ID, scope: SCOPES, immediate: immediate}, callback handleAuthResult = (authResult) -> if authResult and not authResult.error handleAuthorized authResult.access_token else status = document.querySelector 'h1.status' status.innerHTML = 'See blocked pop-up !' status.style.color = '#F00' authorize handleAuthResult, false handleAuthorized = (token) -> TM.value 'ACCESS_TOKEN', token angular.bootstrap document, ['TM'] ReduxRouter = require 'redux-simple-router' API = require 'api' utils = require '../utils.coffee' URL = require '../url.coffee' appActions = require './app-actions.coffee' module.exports = sessionTimeout: -> type: 'SESSION_TIMEOUT' login: (data) -> type: 'LOGIN' payload: promise: API.login(data).then (body) -> (action, dispatch) -> params = JSON.parse data.from params.userId = utils.getUserId body.user._id dispatch ReduxRouter.pushPath URL.getPath(params), params action.payload = body dispatch action logout: (data) -> type: 'LOGOUT' payload: promise: API.logout(data.id).then -> (action, dispatch) -> dispatch ReduxRouter.pushPath data.from dispatch action setUser: (obj, timestamp) -> type: 'SET_LOGGEDIN_USER' payload: user: obj.user || obj || null authenticationTime: obj.timestamp || timestamp signup: (data) -> type: 'SIGNUP' payload: promise: API.signup data describe 'linter helpers', -> helpers = require '../lib/helpers' fs = require 'fs' testFile = __dirname + '/fixtures/test.txt' testContents = fs.readFileSync(testFile).toString() describe '::exec', -> it 'cries when no argument is passed', -> gotError = false try helpers.exec() catch erro then gotError = true expect(gotError).toBe(true) it 'works', -> waitsForPromise -> helpers.exec('cat', [testFile]).then (text) -> expect(text).toBe(testContents) it 'lets you choose streams', -> waitsForPromise -> helpers.exec('cat', [testFile], stream: 'stderr').then (text) -> expect(text).toBe('') it 'accepts stdin', -> waitsForPromise -> helpers.exec('cat', [], stream: 'stdout', stdin: testContents).then (text) -> expect(text).toBe(testContents) describe '::execFilePath', -> it 'cries when no argument is passed', -> gotError = false try helpers.execFilePath() catch erro then gotError = true expect(gotError).toBe(true) it 'cries when no filepath is passed', -> gotError = false try helpers.execFilePath('cat', []) catch erro then gotError = true expect(gotError).toBe(true) it 'works', -> waitsForPromise -> helpers.execFilePath('cat', [], testFile).then (text) -> expect(text).toBe(testContents) Sortable = require("./sortable") Draggable = require("./draggable") Droppable = require("./droppable") $.fn.droppable = (options = {}) -> values = for element in this (new Droppable(element, options)) values $.fn.draggable = (options = {}) -> values = for element in this (new Draggable(element, options)) values $.fn.sortable = (options = {}) -> values = for element in this (new Sortable(element, options)) values child_process = require "child_process" path = require "path" module.exports = executable: "latexmk" run: (args) -> # TODO: Add support for killing the process. proc = child_process.exec("#{@executable} #{args.join(" ")}") proc.on "close", (code, signal) => if code == 0 # TODO: Display a more visible success message. console.info "Success!" unless atom.inSpecMode() else # TODO: Introduce proper error and warning handling. console.error "TeXification failed! Check the log file for more info..." unless atom.inSpecMode() proc constructArgs: (filePath) -> args = [ "-interaction=nonstopmode" "-f" "-cd" "-pdf" ] pdfOpts = [] # TODO: Add default opts (-synctex=1, -file-line-error, ...) enableShellEscape = atom.config.get("latex.enableShellEscape") pdfOpts.push("-shell-escape %O %S") if enableShellEscape? args.push("--pdflatex=\"pdflatex #{pdfOpts.join(" ")}\"") dir = path.dirname(filePath) outdir = atom.config.get("latex.outputDirectory") if outdir?.length outdir = path.join(dir, outdir) args.push("-outdir=#{outdir}") args.push(filePath) args # Description: # Rolls dice! # # Dependencies: # None # # Configuration: # None # # Commands: # hubot roll 2d6 # # Author: # dualmoon module.exports = (robot) -> # Helpers randint = (sides) -> return Math.round(Math.random()*(sides-1))+1 rolldice = (sides, num) -> if num is 1 return 0+randint sides else results = [] results.push(randint sides) for [1..num] return results.toString() robot.respond /roll (?:([0-9]+)d([0-9]+))(?: (.*))*/i, (msg) -> num = msg.match[1] sides = msg.match[2] msg.send(rolldice sides, num) Backbone = require 'backbone' { API_URL } = require('sharify').data module.exports = class ArtworkInquiry extends Backbone.Model url: "#{API_URL}/api/v1/me/artwork_inquiry_request" # Facebook config exports.facebook = appId: null secretKey: nullclass Skr.Components.Currency extends Lanes.React.Component getDefaultProps: -> amount: _.bigDecimal('0.0') propTypes: amount: React.PropTypes.instanceOf(_.bigDecimal) render: -> {@props.amount.toFixed(2)} items = require("../build/liblol.js").items describe "items", -> describe "find", -> it "should return all items when nothing is passed to it", -> items.find().should.include item for item in items.list it "should throw an error if the parameters are bad", -> try items.find "blah" catch e e.message.should.equal "Condition is not a function!" class Turbolinks.Snapshot @wrap: (value) -> if value instanceof this value else @fromHTML(value) @fromHTML: (html) -> element = document.createElement("html") element.innerHTML = html @fromElement(element) @fromElement: (element) -> new this head: element.querySelector("head") body: element.querySelector("body") constructor: ({head, body}) -> @head = head ? document.createElement("head") @body = body ? document.createElement("body") getRootLocation: -> root = @getSetting("root") ? "/" new Turbolinks.Location root getCacheControlValue: -> @getSetting("cache-control") hasAnchor: (anchor) -> try @body.querySelector("##{anchor}")? isPreviewable: -> @getCacheControlValue() isnt "no-preview" # Private getSetting: (name) -> [..., element] = @head.querySelectorAll("meta[name='turbolinks-#{name}']") element?.getAttribute("content") Address = require 'command-interpreter/address' Range = require 'range' module.exports = class RegexAddress extends Address regex: null reverse: null constructor: (pattern, reverse) -> @reverse = reverse @regex = new RegExp(pattern) getRange: (editor, currentRange) -> rangeBefore = new Range([0, 0], currentRange.start) rangeAfter = new Range(currentRange.end, editor.getEofPosition()) rangeToSearch = if @reverse then rangeBefore else rangeAfter rangeToReturn = null scanMethodName = if @reverse then "backwardsScanInRange" else "scanInRange" editor[scanMethodName] @regex, rangeToSearch, (match, range) -> rangeToReturn = range if rangeToReturn rangeToReturn else rangeToSearch = if @reverse then rangeAfter else rangeBefore editor[scanMethodName] @regex, rangeToSearch, (match, range) -> rangeToReturn = range rangeToReturn or currentRange isRelative: -> true mainBowerFiles = require 'main-bower-files' concat = require 'gulp-concat' filter = require 'gulp-filter' commonjsWrap = require 'gulp-wrap-commonjs' pickFilesByExtension = (extension) -> filter (file) -> file.path.match new RegExp("." + extension + "$") module.exports = (gulp) -> gulp.task 'build:bower', -> gulp.src mainBowerFiles() .pipe pickFilesByExtension 'js' .pipe commonjsWrap pathModifier: (filePath) -> matches = filePath.match /(bower_components|node_modules)\/(.*?)\// moduleName = matches[2] moduleName .pipe concat 'vendor.js' .pipe gulp.dest 'build/ui/scripts' gulp.src mainBowerFiles() .pipe pickFilesByExtension 'css' .pipe concat 'vendor.css' .pipe gulp.dest 'build/ui/styles' gulp.task 'build:copy:scripts', -> gulp.src 'node_modules/commonjs-require/commonjs-require.js' .pipe gulp.dest('build/ui/scripts') gulp.src 'bower_components/socket.io-client/socket.io.js' .pipe gulp.dest('build/ui/scripts') {Model} = require 'theorist' Serializable = require 'serializable' {find} = require 'underscore-plus' FocusContext = require './focus-context' module.exports = class PaneContainerModel extends Model atom.deserializers.add(this) Serializable.includeInto(this) @properties root: null focusContext: -> new FocusContext constructor: -> super @subscribe @$root.filterDefined(), (root) => root.parent = this root.focusContext = @focusContext deserializeParams: (params) -> params.root = atom.deserializers.deserialize(params.root) params serializeParams: (params) -> root: @root?.serialize() replaceChild: (oldChild, newChild) -> throw new Error("Replacing non-existent child") if oldChild isnt @root @root = newChild getPanes: -> @root?.getPanes() ? [] getFocusedPane: -> find @getPanes(), (pane) -> pane.focused focusNextPane: -> panes = @getPanes() if panes.length > 1 currentIndex = panes.indexOf(@getFocusedPane()) nextIndex = (currentIndex + 1) % panes.length panes[nextIndex].focus() true else false focusPreviousPane: -> panes = @getPanes() if panes.length > 1 currentIndex = panes.indexOf(@getFocusedPane()) previousIndex = currentIndex - 1 previousIndex = panes.length - 1 if previousIndex < 0 panes[previousIndex].focus() true else false calculateAccess = (comp, props) -> model = _.result(comp, 'modelForAccess') || comp.commands?.getModel()?.modelForAccess() || comp.model?.modelForAccess() accessRight = if props.readonly or comp.context?.readonly 'r' else if props.writable or comp.context?.writable or Lanes.current_user.canWrite(model, props.name) 'w' else if props.readable or Lanes.current_user.canRead(model, props.name) 'r' comp.setState({accessRight}) if accessRight Lanes.React.Mixins.Access = { componentDidMount: -> calculateAccess(this, @props) componentWillReceiveProps: (newProps) -> calculateAccess(this, newProps) hasReadAccess: -> !!@state.accessRight hasWriteAccess: -> _.includes(['w', 'd'], @state.accessRight) } define 'app/settings', () -> applyAjaxDefaults = (settings) -> settings.dataType = sm_settings.ajax_format settings.cache = sm_settings.ajax_cache settings.jsonpCallback = sm_settings.ajax_jsonpCallback settings.data = settings.data || {} settings.data.format = sm_settings.ajax_format return settings return { applyAjaxDefaults: applyAjaxDefaults } mapboxgl.accessToken = 'pk.eyJ1IjoibWg2MTUwMzg5MSIsImEiOiJjaWhxbTJjOGMwNGt4dHBtMjczbzhieXZkIn0.J8-B8U-8nCtqiZ2CfxbV0g' position = new mapboxgl.LngLat(133.842941, 35.375086).wrap() map = new mapboxgl.Map { container: 'map' style: 'mapbox://styles/mapbox/streets-v8' center: [position.lng, position.lat] zoom: 8 } source = new mapboxgl.GeoJSONSource {data: 'data.geojson'} map.on 'style.load', -> map.addSource('markers', source) map.addLayer { id: 'markers' type: 'symbol' source: 'markers' layout: { 'icon-image': '{marker-symbol}-15' 'icon-optional': true } paint: { 'icon-color': '#0000FF' } } locate = -> if navigator.geolocation navigator.geolocation.getCurrentPosition (position) -> lng = position.coords.longitude lat = position.coords.latitude lnglat = new mapboxgl.LngLat(lng, lat).wrap() map.flyTo { center: [lnglat.lng, lnglat.lat] zoom: 15 } {View} = require 'atom' module.exports = class DevModeView extends View @content: -> @span class: 'inline-block icon icon-primitive-square text-error' mongoose = require('mongoose') checkinSchema = new mongoose.Schema user: String session: Number checkinTime: Date deleted: { type: Boolean, default: false } deletedTime: Date checkinSchema.methods.upsert = () -> # https://jira.mongodb.org/browse/SERVER-14322 try @checkinTime = new Date() @update(this, {upsert: true}) catch logger.info "Could not upsert a checkin" checkinSchema.methods.markDeleted = () -> @deleted = true @deletedTime = new Date() @update(this) checkinSchema.statics.findBySession = (session) -> Checkin.find session: session deleted: false checkinSchema.statics.findNotDeleted = () -> Checkin.find deleted: false checkinSchema.statics.findByUser = (user) -> Checkin.find user: user deleted: false checkinSchema.index({ deleted: 1, session : 1 }) checkinSchema.index({ deleted: 1, user : 1 }) Checkin = mongoose.model('Checkins', checkinSchema); export default Checkin export MAX_CHECKIN_PER_SESSION = [18] goog.provide 'app.react.Link' class app.react.Link ###* @param {app.Routes} routes @param {app.react.Touch} touch @constructor ### constructor: (@routes, @touch) -> ###* @param {este.Route} route @param {string} text @param {Object=} urlParams @param {Object=} props ### to: (route, text, urlParams, props) -> {a} = @touch.none 'a' linkProps = href: route.url urlParams goog.mixin linkProps, props if props linkProps.className ?= '' linkProps.className += ' ' + if @routes.active == route then 'active' else '' delete linkProps.className if !linkProps.className.trim() a linkProps, text Impromptu = require './impromptu' prompt = # Returns the global connection to the Redis server. redis: Impromptu.db.client get: (id, field, fn) -> @redis().hget(@key(id), field, fn) set: (id, field, value, fn) -> @redis().hset(@key(id), field, value, fn) del: (id, field, fn) -> @redis().hdel(@key(id), field, fn) exists: (id, field, fn) -> @redis().hexists(@key(id), field, fn) key: (id) -> "prompt:#{id}" # Expose `prompt`. exports = module.exports = prompt;path = require 'path' os = require 'os' LessCache = require 'less-cache' {Subscriber} = require 'emissary' tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp' module.exports = class LessCompileCache Subscriber.includeInto(this) @cacheDir: path.join(tmpDir, 'atom-compile-cache', 'less') constructor: ({resourcePath})-> @cache = new LessCache cacheDir: @constructor.cacheDir importPaths: @getImportPaths() resourcePath: window.resourcePath fallbackDir: path.join(resourcePath, 'less-compile-cache') @lessSearchPaths = [ path.join(resourcePath, 'static', 'variables') path.join(resourcePath, 'static') ] @subscribe atom.themes, 'reloaded', => @cache.setImportPaths(@getImportPaths()) getImportPaths: -> atom.themes.getImportPaths().concat(@lessSearchPaths) read: (stylesheetPath) -> @cache.readFileSync(stylesheetPath) destroy: -> @unsubscribe() define [ '../../core' '../../controls' './base' ], (c, controls, base) -> class NumberControl extends base.FieldControl options: regionViews: value: controls.RangeInput events: -> events = c._.clone base.FieldControl.events events["change #{@dataSelectors.operator}"] = 'toggleRange' return events toggleRange: -> input2 = @value.currentView.input2.ui.input if /range/i.test(@getOperator()) input2.prop('disabled', false).show() else input2.prop('disabled', true).hide() onRender: -> super @toggleRange() { NumberControl } {_} = require 'atom' Reporter = require './reporter' module.exports = activate: (state) -> if _.isFunction(window.onerror) @originalOnError = window.onerror window.onerror = (message, url, line) => Reporter.send(message, url, line) @originalOnError?(arguments...) deactivate: -> if @originalOnError window.onerror = @originalOnError else window.onerror = null Base = require './base' class DisturbanceInformation extends Base constructor: (config) -> @key = config.keys.disturbanceInformation @service = 'disturbanceInformation (SL Störningsinformation 2)' super module.exports = (args...) -> service = new DisturbanceInformation args... { deviations: (args...) -> service.prepareRequest 'deviations', args... deviationsRawData: (args...) -> service.prepareRequest 'deviationsrawdata', args... } module.exports = label: "Habitat" key: "habitat" values: [{ value: "deciduous" label: "Deciduous woodland" },{ value: "coniforous" label: "Coniforous woodland" },{ value: "grassland" label: "Grassland" },{ value: "heathland" label: "Heathland and moors" },{ value: "marshes" label: "Marshes and fens" },{ value: "dunes" label: "Dunes and dune slacks" },{ value: "quarries" label: "Human-made (quarries, railway lines, old industrial sites etc)" },{ value: "verges" label: "Human-made (road verges, churchyards etc)" }]class CartView extends Backbone.View initialize: -> @listenTo @collection, "reset update", @render tagName: "button" className: "epages-cart-button" events: "click": "openCart" template: _.template """ <%= count %> """ render: -> quantity = @countProducts() @$el.html @template(count: quantity) this openCart: (event) -> event.preventDefault() view = new CartDetailView(collection: @collection).render() App.modal.open(view) countProducts: () -> lineProducts = JSON.parse(@collection.storage.storage["epages-shop-cart-products"]) quantity = 0 for product in lineProducts quantity += product.quantity quantity exports.CoffeeTask = -> dist: options: bare: false sourceMap: true files: # all of the files used in testing and development - configuration, etc. ".tmp/scripts/else.js": [".tmp/scripts/*.coffee", "!.tmp/scripts/alchemy.src.coffee"] # all of the core, alchemy.js files ".tmp/scripts/alchemy.js": [".tmp/scripts/alchemy/defaultConf.coffee" ".tmp/scripts/alchemy/start.coffee" ".tmp/scripts/alchemy/*/*.{coffee,litcoffee,coffee.md}" ".tmp/scripts/alchemy/end.coffee"]'.platform-darwin .editor': 'cmd-L': 'grammar-selector:show' '.platform-win32 .editor': 'ctrl-L': 'grammar-selector:show' Gozer = require('./helpers/gozer') describe 'Gozer', -> gozer = new Gozer(port: 3002) page = null beforeEach -> page = gozer .visit('/') .resize(width: '1024') describe 'HTML tests', -> it 'can evaluate the document markup', -> expect(page.run(-> document.title)) .to.eventually.equal('Gozer') describe 'CSS tests', -> it 'can manually retrieve computed styles', -> fontFamily = page.run -> getComputedStyle(document.body).getPropertyValue('font-family') expect(fontFamily) .to.eventually.have.string('Helvetica Neue') it 'can retrieve computed styles with a helper', -> expect(page.getStyle('body', 'font-family')) .to.eventually.have.string('Helvetica Neue') context 'with breakpoints', -> it 'retrieves the computed style', -> expect(page.getStyle('body', 'font-size')) .to.eventually.equal('16px') page.resize(width: 600) expect(page.getStyle('body', 'font-size')) .to.eventually.equal('12px') # tael.js # Copyright (c) 2015 Carter Hinsley # MIT License tiles = [{ type: 'container' }] newTile = (parent) -> # Add a new tile to the `tiles` array. pushTile = -> # Push a new tile to the `tiles` array and return its index. ( tiles.push type: 'leaf' ) - 1 switch parent.type when 'container' parent.child = do pushTile when 'leaf' parent = type: 'branch' children: left: do pushTile right: do pushTile layout: split: 'horizontal' divider_location: 1 when 'branch' throw "Branch tiles cannot spawn new children post-creation." newTile(tiles[0]) module.exports = -> ($ document).ready -> ($ '.tael-container') .append( ($ '
    ') .addClass 'tael-node-leaf' .text 'Hello, world!' ) "use strict" site = require '../model/config' cabin = require '../model/cabin' exports.getList = (request, reply) -> reply.view 'list', site: site user: request.auth.credentials cabins: cabin.getCabins() title: 'List' exports.getCabin = (request, reply) -> cabin.getCabin request.params.id, (err, data) -> return reply().redirect '/' if err reply.view 'cabin', site: site user: request.auth.credentials cabin: data title: 'Endre hytte' exports.getImage = (request, reply) -> cabin.getCabin request.params.id, (err, data) -> return reply().code(404) if err or not data?.bilder?[0] cabin.getImage data.bilder[0], (err, data) -> return reply().code(404) if err or not data?.img?[1] stream = require('request')(data.img[1].url) stream.once 'response', reply currentProject = require 'zooniverse-readymade/current-project' $ = window.jQuery classifyPage = currentProject.classifyPages[0] {subjectViewer, decisionTree} = classifyPage # NOTE: This is super super hacky. # Doing this for real will require a better DecisionTree class. badges = {} $(decisionTree.el).one decisionTree.RESET, -> labels = $(decisionTree.el).find '.readymade-choice-label' for choice, i in decisionTree.currentTask.choices badges[choice.value] = $('0') badges[choice.value].insertAfter labels[i] subjectViewer.el.on 'add-tool', ({originalEvent: detail: [ms, tool]}) -> count = parseFloat(badges[tool.value].html()) + 1 badges[tool.value].html count badges[tool.value].attr 'data-count', count subjectViewer.el.on 'remove-tool', ({originalEvent: detail: [ms, tool]}) -> count = parseFloat(badges[tool.value].html()) - 1 badges[tool.value].html count badges[tool.value].attr 'data-count', count path = require 'path' module.exports = getAtomDirectory: -> process.env.ATOM_HOME ? path.join(process.env.HOME, '.atom') getResourcePath: -> process.env.ATOM_RESOURCE_PATH ? '/Applications/Atom.app/Contents/Frameworks/Atom.framework/Resources' getNodeUrl: -> process.env.ATOM_NODE_URL ? 'https://gh-contractor-zcbenz.s3.amazonaws.com/cefode2/dist' getAtomPackagesUrl: -> process.env.ATOM_PACKAGES_URL ? 'http://atom.iriscouch.com/registry/_design/apm/_view/atom_packages' getNodeVersion: -> process.env.ATOM_NODE_VERSION ? '0.10.3' getUserConfigPath: -> path.resolve(__dirname, '..', '.apmrc') path = require 'path' # require('web-frame').setZoomFactor(1.15) oldWindowDimensions = {} atom.commands.add 'atom-workspace', 'custom:insert-timestamp': -> now = new Date() atom.workspace.getActiveTextEditor().insertText(now.toISOString()) 'custom:open-todo-list': -> todoList = path.join(process.env.HOME, 'Dropbox/todo/todo.txt') atom.workspace.open(todoList) 'custom:screenshot-prep': -> oldWindowDimensions = atom.getWindowDimensions() atom.setWindowDimensions('width': 1366, 'height': 768) 'custom:screenshot-restore': -> atom.setWindowDimensions(oldWindowDimensions) 'custom:throw-error': -> throw new Error "*": "atom-ctags": {} "autocomplete-plus": enableAutoActivation: false core: audioBeep: false disabledPackages: [ "exception-reporting" "linter" ] ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" ] themes: [ "atom-dark-ui" "solarized-dark-syntax" ] editor: fontFamily: "Menlo" invisibles: {} scrollPastEnd: true showIndentGuide: true softWrapAtPreferredLineLength: true "git-diff-details": closeAfterCopy: true "git-history": showDiff: false "git-plus": openInPane: false verboseCommit: true wordDiff: false "merge-conflicts": {} "ruby-test": rspecAllCommand: "source ~/.zshrc && spring rspec --tty" rspecFileCommand: "source ~/.zshrc && spring rspec --tty {relative_path}" rspecSingleCommand: "source ~/.zshrc && spring rspec --tty {relative_path}:{line_number}" shell: "zsh" specFramework: "rspec" welcome: showOnStartup: false module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' src: ['src/*.coffee'] test: ['spec/*.coffee'] shell: test: command: 'jasmine-focused --captureExceptions --coffee spec/' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.registerTask 'clean', -> require('rimraf').sync('lib') grunt.registerTask('lint', ['coffeelint:src', 'coffeelint:test']) grunt.registerTask('default', ['coffee', 'coffeelint']) grunt.registerTask('test', ['default', 'coffeelint:test', 'shell:test']) Dispatch = require './dispatch' module.exports = configDefaults: environmentOverridesConfiguration: true syntaxCheckOnSave: false formatOnSave: true gofmtArgs: "-w" vetOnSave: true vetArgs: "" lintOnSave: false goPath: "" goExecutablePath: "/usr/local/go/bin/go" gofmtPath: "/usr/local/go/bin/gofmt" golintPath: "$GOPATH/bin/golint" golintArgs: "" runCoverageOnSave: false showPanel: true showPanelWhenNoIssuesExist: false activate: (state) -> @dispatch = new Dispatch() deactivate: -> @dispatch.destroy() io = require('socket.io-client') url = process.env.TEST_TARGET || 'https://snap-backend-dev.herokuapp.com' #'http://localhost:8080' users = process.env.USERS || 50 randWord = (len) -> Math.random().toString(36).substr(2, len) startPlayer = (name) -> name = name || process.env.TEST_NAME || 'John Smith' socket = io(url) socket.on 'connect', ()-> setTimeout () -> socket.emit 'new player', name console.log "connected a test player #{name}" setInterval () -> w = randWord(2) socket.emit 'new word', w console.log "#{name} wrote: #{w}" ,10000000000 + Math.random()*500 ,Math.random()*2000 for a in [0..users] startPlayer("player #{a}") # console.log randWord(2) Backbone.Factlink ||= {} Backbone.Factlink.TooltipMixin = default_options: side: 'left' align: 'center' margin: 0 tooltipAdd: (selector, title, text, options) -> options = _.extend @default_options, options @_tooltips ?= {} if @_tooltips[selector]? throw "Cannot call tooltipAdd multiple times with the same selector: #{selector}" view = new HelptextPopoverView _.extend {model: new Backbone.Model(title: title, text: text)}, options positionedRegion = new Backbone.Factlink.PositionedRegion options positionedRegion.crossFade view container = options.container || @$el @_tooltips[selector] = { positionedRegion, container, view } unless @isClosed @tooltipBindAll() @on 'render', @tooltipBindAll @on 'close', @tooltipResetAll tooltipRemove: (selector) -> tooltip = @_tooltips[selector] if tooltip? tooltip.positionedRegion.resetFade() delete @_tooltips[selector] tooltipBindAll: -> for selector, tooltip of @_tooltips $bindEl = @$(selector).first() tooltip.positionedRegion.bindToElement($bindEl, tooltip.container) @tooltipUpdateAll() tooltipUpdateAll: -> for selector, tooltip of @_tooltips tooltip.positionedRegion.updatePosition() tooltipResetAll: -> for selector, tooltip of @_tooltips tooltip.positionedRegion.reset() tooltip: (selector) -> @_tooltips[selector] # Copyright 2012 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:#www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ## t5/core/select # # Provides a document event handler that triggers an update a zone when the value # of a select element within the zone changes. define ["./events", "./dom", "./zone"], (events, dom, zone) -> dom.onDocument "change", "select[data-update-zone]", -> containingZone = zone.findZone this containingZone and containingZone.trigger events.zone.refresh, url: @attr "data-update-url" parameters: "t:selectvalue": @value() jQuery(document).ready -> writeanswer = (ans) -> jQuery("#answer").html(ans) jQuery("#answer").attr("class", "answered") jQuery(".unanswered").attr("class", "none") question = jQuery("#question").val() jQuery("#externallink").attr("href", "http://decisiverobot.com/?question=#{question}") answer = () -> question = jQuery("#question").val() jQuery.getJSON("/service/?question=#{question}", (data) -> writeanswer(data['answer'])) jQuery("form").submit( (event) -> event.preventDefault() answer() return false ) #set focus to the question box jQuery("#question").focus() # if the browser doesn't support svg, replace svgs with pngs if not document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") jQuery("#robot").attr("src", "decisiverobot.png") jQuery("#speechtick").attr("src", "speechtick.png") #if the browser is IE, tell them it is shit if jQuery.browser.msie alert("Decisive Robot works best on decent browsers like Firefox and Chrome. Don't use Internet Explorer, meatbag.")# Description: # Card image fetcher for Magic: The Gathering cards # # Commands: # [[]] # # Notes: # Upon failure, returns Dismal Failure # # Author: # JacobGinsparg rCardNames = /\[\[(.*)\]\]/i baseUrl = "http://gatherer.wizards.com/Handlers/Image.ashx" loadCardDatabase = -> req = new XMLHttpRequest() req.addEventListener 'readystatechange', -> if req.readyState is 4 and req.status is 200 data = eval '(' + req.responseText + ')' else data = "Error" req.open 'GET', '../AllCards.json', false req.send() verifyCardName = (cardName, db) -> cardName in db getCardImageUrl = (cardName, validCard) -> fullUrl = "#{baseUrl}?type=card&name=#{validCard ? encodeURIComponent(cardName) : "Dismal%20Failure"}" module.exports = (robot) -> robot.hear rCardNames, (msg) -> cardDB = loadCardDatabase() valid = verifyCardName msg.match[1], cardDB msg.send getCardImageUrl msg.match[1], valid path = require 'path' os = require 'os' LessCache = require 'less-cache' {Subscriber} = require 'emissary' tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp' module.exports = class LessCompileCache Subscriber.includeInto(this) @cacheDir: path.join(tmpDir, 'atom-compile-cache', 'less') constructor: ({resourcePath}) -> @lessSearchPaths = [ path.join(resourcePath, 'static', 'variables') path.join(resourcePath, 'static') ] @cache = new LessCache cacheDir: @constructor.cacheDir importPaths: @getImportPaths() resourcePath: window.resourcePath fallbackDir: path.join(resourcePath, 'less-compile-cache') @subscribe atom.themes, 'reloaded', => @cache.setImportPaths(@getImportPaths()) getImportPaths: -> atom.themes.getImportPaths().concat(@lessSearchPaths) read: (stylesheetPath) -> @cache.readFileSync(stylesheetPath) destroy: -> @unsubscribe() Template.entrySignIn.helpers emailInputType: -> if AccountsEntry.settings.passwordSignupFields is 'EMAIL_ONLY' 'email' else 'string' emailPlaceholder: -> fields = AccountsEntry.settings.passwordSignupFields if _.contains([ 'USERNAME_AND_EMAIL' 'USERNAME_AND_OPTIONAL_EMAIL' ], fields) return i18n("usernameOrEmail") return i18n("email") logo: -> AccountsEntry.settings.logo Template.entrySignIn.events 'submit #signIn': (event) -> event.preventDefault() Session.set('email', $('input[name="email"]').val()) Session.set('password', $('input[name="password"]').val()) Meteor.loginWithPassword(Session.get('email'), Session.get('password'), (error)-> if error Session.set('entryError', error.reason) else Router.go AccountsEntry.settings.dashboardRoute ) angular.module('doubtfire.units.states.tasks.viewer.directives.unit-task-list', []) .directive('unitTaskList', -> restrict: 'E' templateUrl: 'units/states/tasks/viewer/directives/unit-task-list/unit-task-list.tpl.html' scope: unit: '=' # Function to invoke to refresh tasks refreshTasks: '=?' unitTasks: '=' selectedTaskDef: '=' controller: ($scope, $timeout, $filter, gradeService, taskService, listenerService) -> listeners = listenerService.listenTo($scope) # Set up initial filtered tasks $scope.filteredTasks = [] # Set up filters $scope.filters = { taskSearch:null } # Sets new filteredTasks variable applyFilters = -> filteredTasks = $filter('taskDefinitionName')($scope.unitTasks, $scope.filters.taskSearch) filteredTasks = $filter('orderBy')(filteredTasks, 'task.seq') $scope.filteredTasks = filteredTasks # Apply filters first-time applyFilters() # When refreshing tasks, we are just reloading the active tasks $scope.refreshTasks = applyFilters # Expose grade service names $scope.gradeNames = gradeService.grades # On task name change, reapply filters $scope.taskNameChanged = applyFilters # UI call to change currently selected task $scope.setSelectedTask = (task) -> # Clicking on already selected task will disable that selection task = null if $scope.isSelectedTask(task) $scope.selectedTaskDef = task $scope.isSelectedTask = (task) -> # Compare by definition task.id == $scope.selectedTaskDef?.id )options = {} options['font_size'] = 10 options['font_family'] = 'Arial' console.log options _ = require 'underscore' qs = require 'querystring' moment = require 'moment' Backbone = require 'backbone' { EMBEDLY_KEY } = require('sharify').data { crop, resize } = require '../resizer/index.coffee' class Response extends Backbone.Model resizeUrlFor: -> resize @get('thumbnail_url'), arguments... cropUrlFor: -> crop @get('thumbnail_url'), arguments... date: (attr) -> moment @get(attr) module.exports = class Embedly extends Backbone.Collection model: Response url: 'http://api.embed.ly/1/oembed' fetch: (options = {}) -> data = qs.stringify _.extend(options.data, key: EMBEDLY_KEY) Backbone.Collection::fetch.call this, _.extend options, data: data, processData: false # ---------------------------------------------------------- # # LocalStore (util) # Serialize key,value into localstorage with cookies fallback # for browsers that doesn't support localstorage. # # ---------------------------------------------------------- define -> class LocalStore @version = '0.0.1' @set = (k,v) -> if window.lp.supports.localStorage localStorage.setItem(k, v) else @setCookie(k, v) @get = (k) -> if window.lp.supports.localStorage localStorage.getItem('cookie-compliance') else @getCookie('cookie-compliance') @getCookie = (k) -> c = document.cookie.split('; ') cookies = {} for b in c a = b.split('=') cookies[a[0]] = a[1] cookies[k] @setCookie = (k, v, days) -> if days date = new Date date.setTime(date.getTime() + (days * 86400000)) exp = "; expires= #{date.toGMTString()}" else exp ="" window.document.cookie = "#{k}=#{v}#{exp}; path=/" @removeCookie = (k) -> @setCookie(k,'',-1) path = require 'path' glob = require('glob') fs = require 'fs-extra' async = require 'async' parsePath = require 'parse-filepath' _ = require 'underscore' globPages = require './glob-pages' module.exports = (program, cb) -> {relativeDirectory, directory} = program globPages directory, (err, pages) -> # Async callback to copy each file. copy = (file, callback) -> # Map file to path generated for that directory. # e.g. if file is in directory 2015-06-16-my-sweet-blog-post that got # rewritten to my-sweet-blog-post, we find that path rewrite so # our asset gets copied to the right directory. parsed = parsePath file relativePath = path.relative(directory + "/pages", file) oldPath = parsePath(relativePath).dirname # Wouldn't rewrite basePath if oldPath is "." oldPath = "/" newPath = "/#{parsed.basename}" unless oldPath is "/" page = _.find pages, (page) -> parsePath(page.requirePath).dirname is oldPath newPath = parsePath(page.path).dirname + parsed.basename newPath = directory + "/public/" + newPath fs.copy(file, newPath, (err) -> callback err ) # Copy static assets to public folder. glob directory + '/pages/**/?(*.jpg|*.png|*.pdf)', null, (err, files) -> async.map files, copy, (err, results) -> cb(err, results) module "PubSub" require ["core/pubsub"], (pubsub) -> test "simple on/fire", -> memoValue = null expectedMemo = "expected" pubsub.on "stim", (memo) -> memoValue = memo pubsub.fire "stim", expectedMemo ok memoValue is expectedMemo, "responder function was invoked"Router.configure layoutTemplate: 'layout' loadingTemplate: 'loading' notFoundTemplate: 'notFound' waitOn: -> [Meteor.subscribe('projects'), Meteor.subscribe('notifications')] Router.route '/projects/new', name: 'projectNew' waitOn: -> Meteor.subscribe 'usernames' Router.route '/projects/:_id', name: 'projectPage' data: -> Projects.findOne this.params._id waitOn: -> projectId = this.params._id [Meteor.subscribe('measures', projectId), Meteor.subscribe('risks', projectId), Meteor.subscribe('findings', projectId), Meteor.subscribe('sources', projectId), Meteor.subscribe('usernames')] Router.route '/', name: 'projectsList' requireLogin = -> if Meteor.user() this.next() else this.render(if Meteor.loggingIn() then this.loadingTemplate else 'accessDenied') Router.onBeforeAction 'dataNotFound', only: 'projectPage' Router.onBeforeAction requireLogin Sprangular.directive 'shippingRateSelection', -> restrict: 'E' templateUrl: 'shipping/rates.html' scope: order: '=' controller: ($scope, Cart) -> $scope.loading = false $scope.rates = [] $scope.$watch 'order.shipping_method_id', (shippingMethodId) -> rate = _.find($scope.rates, (rate) -> rate.shippingMethodId == shippingMethodId) if rate $scope.order.shipTotal = rate.cost else $scope.order.shipTotal = 0 $scope.order.updateTotals() # use $scope.$watchGroup when its released for expr in ['order.actualShippingAddress().country', 'order.actualShippingAddress().state', 'order.actualShippingAddress().zipcode'] $scope.$watch expr, -> return if $scope.loading $scope.loading = true order = $scope.order address = order.actualShippingAddress() Cart.shippingRates({countryId: address.countryId, stateId: address.stateId, zipcode: address.zipcode}) .then (results) -> $scope.rates = results order.shipping_method_id = null unless _.find(results, (rate) -> rate.shippingMethodId == order.shipping_method_id) if order.shipping_method_id == null && results.length > 0 order.shipping_method_id = results[0].shippingMethodId $scope.loading = false # Outputs bot uptime module.exports = (robot) -> start = new Date().getTime() robot.respond /uptime/i, (msg) -> uptimeMe msg, start, (uptime) -> msg.send uptime numPlural = (num) -> if num != 1 then 's' else '' uptimeMe = (msg, start, cb) -> now = new Date().getTime() uptime_seconds = Math.floor((now - start) / 1000) intervals = {} intervals.day = Math.floor(uptime_seconds / 86400) intervals.hour = Math.floor((uptime_seconds % 86400) / 3600) intervals.minute = Math.floor(((uptime_seconds % 86400) % 3600) / 60) intervals.second = ((uptime_seconds % 86400) % 3600) % 60 elements = [] for own interval, value of intervals if value > 0 elements.push value + ' ' + interval + numPlural(value) last if elements.length > 1 last = elements.pop() response = elements.join ', ' response += ' and ' + last if last else response = elements.join ', ' cb 'I\'ve been sentient for ' + response # Description: # Deep thoght generator # # Dependencies: # None # # Configuration: # None # # Commands: # hubot thought - Get a random deep thought. # # Notes: # None # # Author: # @commadelimited # Configures the plugin module.exports = (robot) -> # waits for the string "hubot deep" to occur robot.respond /thought/i, (msg) -> # Configures the url of a remote server msg.http('http://andymatthews.net/thought/') # and makes an http get call .get() (error, response, body) -> results = JSON.parse body # passes back the complete reponse msg.send results.thought.thoughtfs = require 'fs' noflo = require '../../lib/NoFlo' class WriteFile extends noflo.Component constructor: -> @data = null @filename = null @inPorts = in: new noflo.Port filename: new noflo.Port @outPorts = out: new noflo.Port error: new noflo.Port @inPorts.in.on 'data', (data) => @data = data @writeFile @filename, data if @filename @inPorts.filename.on 'data', (data) => @filename = data @writeFile data, @data if @data @inPorts.filename.on 'endgroup', => @filename = null writeFile: (filename, data) -> fs.writeFile filename, data, 'utf-8', (err) => return @outPorts.error send err if err @outPorts.out.send filename @outPorts.out.disconnect() exports.getComponent = -> new WriteFile Z��3E� ������S N � ���,:!>$V*c-�35�5,9S>�C�FI,K�KDQ�TXW�\�^+`�d�f�i�j�nqYucy�zL{���:������>��ך������ȫ<���M��� ���W���@�j�h���/���=�u�M�����A���=���(�� � �#�!�$�%�(�*�-�/�1i7y;=�>CG�I�K�MdP�Q�TV�Wc\�]Q_�d�h0l�n�p�r�u�z]|k~v�l���>�����^���'�i�>�k� ���$���=�������J�c�I���I������R�������������C���^3�a +��@���� �"&w*$++0J5`7<G@CC�F�H�J NvS�WUZL]%b f�g m�p�vyw|\����j�Q���������5��������y�������v��M�H���\�����Y���?���7�������� � p�qh "d'=(�*�.�1|6�:\>9@�C`F�J�O�ReT�X][s`?b�f�j7l�q�t1z ~s��Ɇ��6�-����&�)��\�������\�_�C�,�g���3�����������q�����F�A������ �o�.���L���_ = require 'underscore' Backbone = require 'backbone' class DomainEventService _.extend @prototype, Backbone.Events constructor: (@_eventStore) -> saveAndTrigger: (domainEvents, callback) -> # TODO: this should be an transaction to guarantee the consistency of the aggregate for domainEvent in domainEvents # store the DomainEvent @_eventStore.save domainEvent, (err) => return callback err if err # now trigger the DomainEvent in multiple fashions @trigger 'DomainEvent', domainEvent @trigger domainEvent.aggregate.name, domainEvent @trigger "#{domainEvent.aggregate.name}:#{domainEvent.name}", domainEvent @trigger "#{domainEvent.aggregate.name}/#{domainEvent.aggregate.id}", domainEvent @trigger "#{domainEvent.aggregate.name}:#{domainEvent.name}/#{domainEvent.aggregate.id}", domainEvent callback null module.exports = DomainEventService 'context-menu': '.text-editor': 'The Command': "the-namespace:the-command" module.exports = fullyQualifiedLocations: [ 'New York, NY, USA', 'London, United Kingdom', 'Los Angeles, CA, USA', 'Paris, France', 'Berlin, Germany', 'Hong Kong, Hong Kong' ] Ember.Handlebars.registerBoundHelper('date', (dateString) -> if dateString && Ember.typeOf(dateString) == 'string' date = new Date(dateString.toString()) date.toLocaleDateString() )class Workbench.Routers.WorkbenchRouter extends Backbone.Router initialize: (options) -> if (location.search.length < 1) # Demo user read-only key apiKey = "3359a8ffba94a54978aa6c645e3c617a" else params = $.deparam(location.search.split('?')[1]) apiKey = params.api_key Workbench.source = new Geocens.DataService({ api_key: apiKey }) routes: 'sensors(/)': 'index' 'sensors/:id(/)': 'show' index: -> console.log "loading index route" sensors = new Workbench.Collections.SensorsCollection source: Workbench.source indexView = new Workbench.Views.SensorIndexView collection: sensors el: $("#apiView") indexView.render() sensors.fetch() show: (id) -> console.log "loading show route", id if id is "demo" # Demo user id = "f9b0b42d4b742638f96dfea960ef4735" # render show view sensor = new Workbench.Models.Sensor source: Workbench.source uid: id sensor.fetch() showView = new Workbench.Views.SensorShowView model: sensor el: $("#sensorView") showView.renderBasic() buildMailURL = _.debounce -> console.log 'Updating process.env.MAIL_URL' if RocketChat.settings.get('SMTP_Host') and RocketChat.settings.get('SMTP_Username') and RocketChat.settings.get('SMTP_Password') process.env.MAIL_URL = "smtp://" + encodeURIComponent(RocketChat.settings.get('SMTP_Username')) + ':' + encodeURIComponent(RocketChat.settings.get('SMTP_Password')) + '@' + encodeURIComponent(RocketChat.settings.get('SMTP_Host')) if RocketChat.settings.get('SMTP_Port') process.env.MAIL_URL += ':' + parseInt(RocketChat.settings.get('SMTP_Port')) , 500 RocketChat.settings.onload 'SMTP_Host', (key, value, initialLoad) -> if _.isString value buildMailURL() RocketChat.settings.onload 'SMTP_Port', (key, value, initialLoad) -> buildMailURL() RocketChat.settings.onload 'SMTP_Username', (key, value, initialLoad) -> if _.isString value buildMailURL() RocketChat.settings.onload 'SMTP_Password', (key, value, initialLoad) -> if _.isString value buildMailURL() Meteor.startup -> buildMailURL() angular.module('doubtfire.teaching-periods.states.edit.directives.teaching-period-units', []) .directive('teachingPeriodUnits', -> replace: true restrict: 'E' templateUrl: 'teaching-periods/states/edit/directives/teaching-period-units/teaching-period-units.tpl.html' controller: ($scope, $state, alertService, RolloverTeachingPeriodModal) -> # Table sort details $scope.sortOrder = "start_date" $scope.reverse = true # Pagination details $scope.currentPage = 1 $scope.maxSize = 5 $scope.pageSize = 15 # Rollover $scope.rolloverTeachingPeriodModal = (teachingPeriod) -> # If we're given a user, show that user, else create a new one teachingPeriodToShow = if teachingPeriod? then teachingPeriod else { } RolloverTeachingPeriodModal.show teachingPeriodToShow )class EditorPane extends Pane constructor: (options = {}, data) -> options.cssClass = KD.utils.curry "editor-pane", options.cssClass super options, data @createEditor() createEditor: -> {file, content} = @getOptions() isLocalFile = no unless file instanceof FSFile return new Error "File must be an instance of FSFile" unless content return new Error "You must pass file content to EditorPane" @aceView = new AceView delegate: @getDelegate(), file @aceView.ace.once "ace.ready", => @getEditor().setValue content, 1 @ace.setReadOnly yes if @getOptions().readOnly @addSubView @aceView getEditor: -> return @aceView.ace.editor getValue: -> return @getEditor().getSession().getValue() Species.ElibrarySearchFormView = Ember.View.extend templateName: 'species/elibrary_search_form' classNames: ['search-block'] keyDown: (event) -> if event.keyCode == 13 $('.elibrary-search-button').click() actions: toggleSearchOptions: () -> @.$('.search-form').toggle() tag = @.$('.search-options-toggle') icon = tag.find('i') search_text = tag.find('.search-text') if icon.hasClass('fa-plus-circle') search_text.text('Hide search options') else if icon.hasClass('fa-minus-circle') search_text.text('Show search options') icon.toggleClass("fa-plus-circle fa-minus-circle") FS = require('fs') module.exports = Save:-> try Files = [] ActiveEditor = atom.workspace.getActiveEditor() atom.workspace.eachEditor (editor)-> File = editor.getPath() return unless File Files.push File CurrentFile = ActiveEditor && ActiveEditor.getPath() || null; localStorage.setItem('open-last-project',JSON.stringify({Path: atom.project.getPath(), Files: Files, CurrentFile: CurrentFile})) LoadProject:-> LastProject = localStorage.getItem('open-last-project') return unless LastProject LastProject = JSON.parse(LastProject) return unless LastProject.Path atom.project.setPath LastProject.Path Promises = [] LastProject.Files.forEach (file)-> Promises.push new Promise (resolve)-> FS.exists file, (Status)-> return resolve() unless Status atom.workspace.open(file).then(resolve) Promise.all(Promises).then -> # Remove the empty pane atom.workspace.eachEditor (editor)-> editor.destroy() unless editor.getPath() # Set the last active file return unless LastProject.CurrentFile FS.exists LastProject.CurrentFile, (Status)-> return unless Status atom.workspace.open LastProject.CurrentFile class Georgia.Routers.EditPagePanel extends Backbone.Router routes: "": "index" initialize: -> @images = new Georgia.Collections.Images() @images.fetch() index: -> @slides = new Georgia.Collections.Slides() new Georgia.Views.SlideshowPanel(el: '#slideshow', collection: @slides, images: @images) @slides.fetch({data: {page_id: $('[data-page-id]').data('page-id')}}) @widgets = new Georgia.Collections.Widgets() @widgets.fetch() new Georgia.Views.WidgetsPanel(el: '#widgets', collection: @widgets, images: @images)ETahi.PaperController = Ember.ObjectController.extend needs: ['application'] downloadLink: ( -> "/papers/#{@get('id')}/download" ).property() authorTasks: Ember.computed.filterBy('allTasks', 'role', 'author') assignedTasks: (-> assignedTasks = @get('allTasks').filterBy 'assignee', @get('controllers.application.currentUser') _.difference assignedTasks, @get('authorTasks') ).property('allTasks.@each.assignee') reviewerTasks: Ember.computed.filterBy('allTasks', 'role', 'reviewer') authorNames: ( -> authors = @get('authors').map (author) -> [author.first_name, author.last_name].join(' ') authors.join(', ') || 'Click here to add authors' ).property('authors.@each') # These controllers have to be here for now since the load order # gets messed up otherwise ETahi.PaperIndexController = ETahi.PaperController.extend() ETahi.PaperEditController = ETahi.PaperController.extend addAuthorsTask: (-> this.get('allTasks').findBy('type', 'AuthorsTask') ).property() "*": "exception-reporting": userId: "f3cfa406-9a70-3680-f858-0c412c97f37e" welcome: showOnStartup: false metrics: userId: "a22f0efc-41ce-ed43-e5c0-88884b9fac7c" editor: invisibles: {} fontSize: 12 fontFamily: "Hack" scrollPastEnd: true showIndentGuide: true core: useReactEditor: true ignoredNames: [ ".git" ".hg" ".svn" ".DS_Store" "Thumbs.db" ".pyc" ] disabledPackages: [ "wrap-guide" ] whitespace: ensureSingleTrailingNewline: false "multi-wrap-guide": columns: [ 80 100 ] locked: true ".java.source": "multi-wrap-guide": columns: [ 100 ] editor: preferredLineLength: 100 tabLength: 4 '.shell.source': editor: tabLength: 4 '.python.source': editor: tabLength: 2 '.js.source': editor: tabLength: 2 "*": editor: fontFamily: "PragmataPro" showInvisibles: true showIndentGuide: true invisibles: {} fontSize: 16 core: disabledPackages: [ "autocomplete" "spell-check" ] projectHome: "/home/edgard/Documents/code" themes: [ "one-dark-ui" "one-dark-syntax" ] "exception-reporting": userId: "1b98cd61-c072-c275-56fd-5715ea36d0bd" welcome: showOnStartup: false "autocomplete-plus": {} minimap: {} "git-diff": showIconsInEditorGutter: true "spell-check": {} "atom-terminal": app: "/usr/bin/gnome-terminal" linter: {} "atom-beautify": _analyticsUserId: "a6a0720b-ef9b-4635-a6bf-67af0c531216" "go-plus": goPath: "/Users/edgard/Documents/code/go" tabs: enableVcsColoring: true "status-bar": {} "linter-elixirc": {} module.exports = """ query user($id: ID! $per: Int, $page: Int, $perBlocks: Int, $q: String) { user(id: $id) { contents(per: $per, type: "channel", page: $page, q: $q) { title updated_at(relative: true) user { name } kind { __typename ... on Channel { href visibility counts { blocks } blocks(per: $perBlocks, sort_by: UPDATED_AT, direction: DESC, type: BLOCK) { ... blockThumb } } } } } } #{require '../../../components/block_v2/queries/block.coffee'} """return (process, require, asarSource) -> {createArchive} = process.binding 'atom_common_asar' # Make asar.coffee accessible via "require". process.binding('natives').ATOM_SHELL_ASAR = asarSource # Monkey-patch the fs module. require('ATOM_SHELL_ASAR').wrapFsWithAsar require('fs') # Make graceful-fs work with asar. source = process.binding 'natives' source.originalFs = source.fs source.fs = """ var src = '(function (exports, require, module, __filename, __dirname) { ' + process.binding('natives').originalFs + ' });'; var vm = require('vm'); var fn = vm.runInThisContext(src, { filename: 'fs.js' }); fn(exports, require, module); var asar = require('ATOM_SHELL_ASAR'); asar.wrapFsWithAsar(exports); """ angular.module('todoApp').controller "TodoListController", ($scope, Task) -> $scope.init = (taskListId) -> @taskService = new Task(taskListId) $scope.tasks = @taskService.all() $scope.addTask = -> task = description: $scope.taskDescription $scope.tasks.push(task) @taskService.create(task) `import Ember from 'ember'` Application = Ember.Route.extend setupController: (controller, model)-> controller.set('current_user', @store.find('user', 'me')) `export default Application` '.source.haskell': 'editor': 'increaseIndentPattern': '((^.*(=|\\bdo|\\bwhere|\\bthen|\\belse|\\bof)\\s*$)|(^.*\\bif(?!.*\\bthen\\b.*\\belse\\b.*).*$))' 'decreaseIndentPattern': '^\\s*$' define ['jquery', 'underscore', 'backbone'], ($, _, Backbone) -> class SearchView extends Backbone.View el: $('#search') events: 'submit form': 'searchRoute' typeaheadOptions: source: (query, process) -> params = $.param { query: query } $.getJSON "/autocomplete?#{params}", (addresses) -> process(addresses) minLength: 3 initialize: -> @$to = @$el.find('#to'); @$from = @$el.find('#from') Reitti.Event.on 'position:change', _.once (position) => @populateFromBox position, => @$to.focus() @$from.typeahead(@typeaheadOptions) @$to.typeahead(@typeaheadOptions) render: -> @$from.focus() searchRoute: (event) -> event.preventDefault() params = $.param { from: @$from.val(), to: @$to.val() } # TODO: Move this logic somewhere else $.getJSON "/routes?#{params}", (data) -> Reitti.Event.trigger 'route:change', data[0] populateFromBox: (position, callback) -> # TODO: Move this logic somewhere else $.getJSON "/address?coords=#{position.coords.longitude},#{position.coords.latitude}", (location) => @$from.val location.name callback() Sprangular.controller 'CheckoutCtrl', ( $scope, $location, countries, order, Status, Account, Cart, Checkout, Angularytics, Env, $translate ) -> Status.setPageTitle('checkout.checkout') user = Account.user $scope.countries = countries $scope.order = order $scope.processing = false $scope.user = user $scope.secure = $location.protocol() == 'https' $scope.currencySymbol = Env.currency.symbol Cart.lastOrder = null order.resetAddresses(user) order.resetCreditCard(user) $scope.removeAdjustment = (adjustment) -> Angularytics.trackEvent("Cart", "Coupon removed", adjustment.promoCode()) Cart.removeAdjustment(adjustment) $scope.placeOrder = -> $scope.processing = true if $scope.order.isInvalid() $scope.processing = false return Checkout.confirm() .then (order) -> if order.errors && Object.keys(orders.errors).length > 0 $scope.processing = false else $location.path('/checkout/complete') , -> $scope.processing = false $(document).on 'ajax:success', '[data-replace-self-on-ajax-success]', (event, data, status, xhr) -> $(this).replaceWith(data) $.fancybox.update() fs = require 'fs' $ = require 'jquery' ScrollView = require 'scroll-view' {$$$} = require 'space-pen' module.exports = class MarkdownPreviewView extends ScrollView registerDeserializer(this) @deserialize: ({path}) -> new MarkdownPreviewView(project.bufferForPath(path)) @content: -> @div class: 'markdown-preview', tabindex: -1 initialize: (@buffer) -> super @fetchRenderedMarkdown() serialize: -> deserializer: 'MarkdownPreviewView' path: @buffer.getPath() getTitle: -> "Markdown Preview – #{@buffer.getBaseName()}" getUri: -> "markdown-preview:#{@buffer.getPath()}" setErrorHtml: -> @html $$$ -> @h2 'Previewing Markdown Failed' @h3 'Possible Reasons' @ul => @li => @span 'You aren\'t online or are unable to reach ' @a 'github.com', href: 'https://github.com' @span '.' setLoading: -> @html($$$ -> @div class: 'markdown-spinner', 'Loading Markdown...') fetchRenderedMarkdown: (text) -> @setLoading() $.ajax url: 'https://api.github.com/markdown' type: 'POST' dataType: 'html' contentType: 'application/json; charset=UTF-8' data: JSON.stringify mode: 'markdown' text: @buffer.getText() success: (html) => @html(html) error: => @setErrorHtml() #= require jquery.mousewheel shouldUseNativeBehaviour = ($el) -> # We explicitly only want a scrollbar when there is something to scroll (overflow-y: auto), # but there isn't anything to scroll $el.css('overflow-y') == 'auto' && $el[0].scrollHeight <= $el.innerHeight() shouldPreventScroll = ($el, deltaY) -> # Scrolling upward but cannot scroll any further return true if deltaY > 0 && $el.scrollTop() <= 0 # Scrolling downward but cannot scroll any further return true if deltaY < 0 && $el.scrollTop() >= $el[0].scrollHeight - $el.innerHeight() false $.fn.preventScrollPropagation = -> @each -> $(this).on 'mousewheel', (event, delta, deltaX, deltaY) -> $el = $(event.delegateTarget) return if shouldUseNativeBehaviour($el) # Allow nesting of scrollable containers # This does mean that all children should also have preventScrollPropagation! event.stopPropagation() if shouldPreventScroll($el, deltaY) event.preventDefault() define [ "chaplin" "models/posts" "views/posts" ], (Chaplin, Posts, PostsView) -> "use strict" class PostsController extends Chaplin.Controller show: (params) -> id = params.id if params.isClub query = club: params.club else if params.isTag query = tag: params.tag else query = {} @collection = new Posts [], id: id, query: query @view = new PostsView collection: @collection @adjustTitle params.title React = require 'react' _ = require 'underscore' tasks = require './collection' {ExerciseStep} = require '../exercise' {ExerciseButton} = require '../buttons' TaskReview = React.createClass displayName: 'TaskReview' getInitialState: -> @getSteps(@props) componentWillMount: -> {collectionUUID, moduleUUID} = @props tasks.fetchByModule({collectionUUID, moduleUUID}) componentWillReceiveProps: (nextProps) -> @setState(@getSteps(nextProps)) getSteps: (props) -> {taskId} = props completeSteps: tasks.getCompleteSteps(taskId) incompleteSteps: tasks.getIncompleteSteps(taskId) render: -> {completeSteps, incompleteSteps} = @state {status, taskId} = @props if _.isEmpty(completeSteps) completeStepsReview =

    Exercise to see Review

    else completeStepsReview = _.map completeSteps, (step) ->
    {completeStepsReview}
    module.exports = {TaskReview} SearchResults = React.createClass scrollTo: (event)-> console.log(event) window.scrollTo(0,$("activities_bookmark").offsetTop) render: -> message = (@props.results.map (group)-> `{group.pagination.total_items} `) if @props.results.length > 1 for i in [(@props.results.length-1)..1] by -1 message.splice(i, 0, `, `) all_results = @props.results.map (group)-> `` return `(

    {message} matching selected criteria

    {all_results}
    )` window.SearchResults = SearchResults #= require nanobar.js class @PodsProgressBar update: (factor) -> progress = factor * 100 @nanobar.go(progress) start: -> $container = $('.progress-container').empty() @nanobar = new Nanobar target: $container.get(0) id: 'pods-progress' define ["t5/core/dom", "t5/core/events", "underscore"], (dom, events, _) -> dom.onDocument events.palette.willChange, (event, memo) -> values = _.map memo.selectedOptions, (o) -> o.value (dom "event-selection").update JSON.stringify values (dom "event-reorder").update memo.reorder.toString()class @LayoutNav $ -> $('#scrolling-tabs').on 'scroll', -> currentPosition = $(this).scrollLeft() return if currentPosition == 0 if $('.nav-control').length maxPosition = $(this)[0].scrollWidth - $(this).parent().width() + 59 else maxPosition = $(this)[0].scrollWidth - $(this).parent().width() $('.fade-out').toggleClass('end-scroll', currentPosition is maxPosition) React = require 'react' MultiInput = require './multi-input' CnxModTag = React.createClass propTypes: exerciseId: React.PropTypes.string.isRequired validateInput: (value) -> 'Must match CNX module ID (without version number)' unless value.match( /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i ) cleanInput: (val) -> val.replace(/[^0-9a-f-]/g, '') render: -> module.exports = CnxModTag fs = require 'fs' path = require 'path' Mocha = require 'mocha' module.exports = (grunt) -> # Project configuration. grunt.initConfig mocha: db: src: ['test/db/*.coffee'] default: src: ['test/*.coffee'] coffee: default: files: [ expand: true # Enable dynamic expansion. cwd: 'src/' # Src matches are relative to this path. src: ['**/*.coffee'] # Actual pattern(s) to match. dest: 'lib/' # Destination path prefix. ext: '.js' # Dest filepaths will have this extension. ] watch: src: files: ['src/**/*.coffee'] tasks: ['coffee', 'mocha'] test: files: ['test/**/*.coffee'] tasks: ['mocha'] # These plugins provide necessary tasks. grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-watch' # Default task. grunt.registerTask 'default', ['coffee', 'mocha:default'] # Task for running Mocha tests with coffee. grunt.registerMultiTask 'mocha', 'Run mocha unit tests.', -> done = @async() mocha = new Mocha reporter: 'spec' for files in @files for file in files.src mocha.addFile file mocha.run (failures) => if failures grunt.log.error(failures).writeln() done() module.exports = (grunt) -> grunt.initConfig clean: test: ['tmp'] semverCopy: inlineObject: resources: name: "inlineResource" range: "~1.1" parentDirectory: "./test/fixtures/MyResource" dest: 'tmp/inlineResource' inlineObjects: resources: [ { name: "inlineResourcesA" range: "1.0.0 - 1.1.1" parentDirectory: "./test/fixtures/MyResource" dest: 'tmp/inlineResources/' },{ name: "inlineResourcesB" range: "~2" parentDirectory: "./test/fixtures/MyResource" dest: 'tmp/inlineResources/' } ] jsonFile: resourcesFiles: './test/json/one.json' jsonFiles: resourcesFiles: ['./test/json/one.json', './test/json/two.json'] nodeunit: tests: ['./test/*_test.js'] grunt.loadTasks 'tasks' grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-nodeunit' grunt.registerTask 'test', ['clean', 'semverCopy', 'nodeunit'] grunt.registerTask 'default', ['test']Router.configure layoutTemplate: "layout" loadingTemplate: "loading" waitOn: -> if Meteor.user() Meteor.subscribe "patients" else ready: -> true Router.map -> @route "home", path: "/" template: "home" @route "admin", path: "/admin" template: "accountsAdmin" onBeforeAction: -> if Meteor.loggingIn() @render @loadingTemplate else if not Roles.userIsInRole Meteor.user(), ["admin"] @redirect "/" @route "listPatients", path: "/patients" template: "listPatients" @route "addPatient", path: "/patients/new" template: "addPatient" @route "viewPatient", path: "/patients/:_id" template: "viewPatient" data: -> Patients.findOne @params._id @route "editPatient", path: "/patients/:_id/edit" template: "editPatient" data: -> Patients.findOne @params._id requireLogin = (pause) -> if not Meteor.user() if Meteor.loggingIn() @render @loadingTemplate else @render "accessDenied" pause() Router.onBeforeAction "loading" Router.onBeforeAction requireLogin, except: ["home", "accessDenied"] angular.module('doubtfire.projects', [ 'doubtfire.projects.states' 'doubtfire.projects.student-project' 'doubtfire.projects.project-lab-list' 'doubtfire.projects.project-outcome-alignment' 'doubtfire.projects.project-portfolio-wizard' 'doubtfire.projects.project-progress-dashboard' ]) Visualization = require './visualization.js' class VisualizationStory extends Visualization # Override onSync method to set Visualization Canvas offset x & use render(false) onSync: => # Setup visualization parameters @parameters = $.parseJSON @visualization.get('parameters') @setupParameters() # Setup VisualizationCanvas @visualizationCanvas.setup @nodes, @relations, @parameters $('.visualization-graph-component').css 'margin-left', -230 # translate left half the width of Story Info panel @visualizationCanvas.render() # Setup Visualization Events @bindVisualizationEvents() # Trigger synced event for Stories Backbone.trigger 'visualization.synced' # Setup a chapter nodes & relations in Visualization Canvas showChapter: (nodes, relations) -> # Update VisualizationCanvas data based on chapter nodes & relations @visualizationCanvas.updateData nodes, relations @visualizationCanvas.redraw() module.exports = VisualizationStory#= require ../auto_complete/search_list_view class AutoCompleteSearchUserView extends Backbone.Factlink.StepView tagName: "li" template: "auto_complete/search_item" templateHelpers: -> query = @options.query highlightedTitle: -> highlightTextInTextAsHtml(query, @username) onRender: -> @$el.addClass('user-logo') if @model.id == currentUser.id class window.AutoCompleteSearchUsersView extends AutoCompleteSearchListView itemView: AutoCompleteSearchUserView { namespace, utils, jQuery: $, templates: {tpl} } = uploadcare {dragdrop} = uploadcare.widget namespace 'uploadcare.widget.tabs', (ns) -> class ns.FileTab extends ns.BaseSourceTab constructor: -> super @wrap.append tpl 'tab-file', {avalibleTabs: @dialogApi.avalibleTabs} @wrap.on 'click', '@uploadcare-dialog-switch-tab', (e) => @dialogApi.switchTab $(e.target).data 'tab' @__setupFileButton() @__initDragNDrop() __initDragNDrop: -> dropArea = @wrap.find('@uploadcare-drop-area') if utils.abilities.fileDragAndDrop dragdrop.receiveDrop (type, data) => @dialogApi.addFiles type, data , dropArea className = 'draganddrop' else className = 'no-draganddrop' @wrap.addClass "uploadcare-#{className}" __setupFileButton: -> fileButton = @wrap.find('@uploadcare-dialog-browse-file') utils.fileInput fileButton, @settings.multiple, (e) => @dialogApi.addFiles 'event', e # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> animateMetric = $(".metric-box strong").each -> $this = $(this) starting_point = 0 $target_count = parseInt($this.text().replace(/\,/g, '')) # set the test to 0 $this.counter = starting_point tween = createjs.Tween.get($this).to( {counter: $target_count}, 10000 , createjs.Ease.quintOut) tween.addEventListener 'change', (event) -> $this.text(Math.round($this.counter).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")) return ETahi.ControllerParticipants = Ember.Mixin.create needs: ['application'] currentUser: Ember.computed.alias('controllers.application.currentUser') allUsers: (-> paperId = @get('paper.id') || @get('litePaper.id') DS.PromiseObject.create promise: $.getJSON("/filtered_users/collaborators/#{paperId}") ).property() participants: Em.computed.alias('model.participants') actions: saveNewParticipant: (newParticipantId) -> newParticipant = this.store.find 'user', newParticipantId newParticipant.then (user)=> unless @get('participants').contains user @get('participants').pushObject(user) @send('saveModel') unless @get('model.isNew') //= require analytics/virtual_pageview describe 'VirtualPageview', -> element = null describe 'given "data-virtual-pageview" anchor link', -> beforeEach -> element = $('' + 'John Smith' + ' ') $(document.body).append(element) new window.VirtualPageview.bindLinks() afterEach -> element.remove() element = null describe 'on first click', -> it 'dispatches pageview', -> spyOn window, 'dispatchPageView' $('#a_link').trigger 'click' expect(window.dispatchPageView).toHaveBeenCalledWith('/top-3-search-result') require [ "handlebars" ], ( Handlebars ) -> helpers = highlightMatches: (match) -> result = match.wrap (match) -> "#{match}" new Handlebars.SafeString result prettyUrl: (url) -> url.replace /^((http|https):\/\/)?(www.)?/, "" Handlebars.registerHelper(name, helper) for name, helper of helpers passport = require 'passport' debug = require('debug')('meshblu-google-authenticator:routes') url = require 'url' class Router constructor: (@app) -> register: => @app.get '/', (request, response) => response.status(200).send status: 'online' @app.get '/login', @storeCallbackUrl, passport.authenticate 'google', scope: ['profile', 'email'] @app.get '/oauthcallback', passport.authenticate('google', { failureRedirect: '/login' }), @afterPassportLogin afterPassportLogin: (request, response) => {callbackUrl} = request.session return response.status(401).send(new Error 'Invalid User') unless request.user return response.status(201).send(request.user) unless callbackUrl? uriParams = url.parse callbackUrl uriParams.query ?= {} uriParams.query.uuid = request.user.uuid uriParams.query.token = request.user.token return response.redirect(url.format uriParams) defaultRoute: (request, response) => response.render 'index' storeCallbackUrl: (request, response, next) => request.session.callbackUrl = request.query.callbackUrl next() module.exports = Router "*": "autocomplete-python": useKite: false core: disabledPackages: [ "metrics" "linter-python-pep8" ] telemetryConsent: "no" themes: [ "one-dark-ui" "monokai" ] editor: fontSize: 11 scrollPastEnd: true showIndentGuide: true showInvisibles: true softWrap: true softWrapHangingIndent: 4 tabLength: 4 "exception-reporting": userId: "1a743eaf-a8a8-050d-ec12-e52437e24ab5" "fold-functions": autofoldGrammars: [ "Python" ] skipAutofoldWhenOnlyOneFunction: true "git-diff": showIconsInEditorGutter: true global: whitespace: removeTrailingWhitespace: false linter: errorPanelHeight: 69 "linter-python-pep8": pep8DirToExecutable: "/usr/local/bin/" "one-light-ui": fontSize: 10 layoutMode: "Compact" tabSizing: "Minimum" "package-sync": createOnChange: true forceOverwrite: true welcome: showOnStartup: false whitespace: {} window.ReactSubComment = React.createBackboneClass displayName: 'ReactSubComment' propTypes: fact_opinionators: React.PropTypes.instanceOf(Opinionators).isRequired model: React.PropTypes.instanceOf(SubComment).isRequired _save: -> @model().saveWithState() _content_tag: -> if @model().get('formatted_content') _span ["comment-content spec-subcomment-content", dangerouslySetInnerHTML: {__html: @model().get('formatted_content')}] else _span ["comment-content spec-subcomment-content"], @model().get('content') render: -> creator = @model().creator() created_at = @model().get('created_at') _div ["sub-comment"], _div ['sub-comment-avatar-container'], ReactOpinionatedAvatar user: creator model: @props.fact_opinionators size: 30 _div ['sub-comment-content-container'], _a [" sub-comment-creator", href: creator.link(), rel: "backbone"], creator.get('name') if created_at TimeAgo className: "sub-comment-post-time" time: @model().get('created_at') @_content_tag() if @model().get('save_failed') == true ReactRetryButton onClick: @_save if @model().can_destroy() _div ["sub-comment-post-delete"], ReactSlidingDeleteButton model: @model() onDelete: -> @model().destroy wait: true _ = require "underscore" Util = require "../util/util" HasProperties = require "../common/has_properties" class OpenURL extends HasProperties type: 'OpenURL' execute: (data_source) -> selected = data_source.get("selected") if selected['0d'].flag indices = selected['0d'].indices else if selected['1d'].indices.length > 0 indices = selected['1d'].indices else if selected['2d'].indices.length > 0 indices = selected['2d'].indices else indices = [] for i in indices url = Util.replace_placeholders(@get("url"), data_source, i) window.open(url) defaults: -> return _.extend {}, super(), { url: 'http://' } module.exports = Model: OpenURL{$$} = require 'space-pen' SelectList = require 'select-list' $ = require 'jquery' _ = require 'underscore' module.exports = class CommandPaletteView extends SelectList @activate: -> new CommandPaletteView @viewClass: -> "#{super} command-palette overlay from-top" filterKey: 'eventDescription' previouslyFocusedElement: null keyBindings: null initialize: -> super rootView.command 'command-palette:toggle', => @toggle() toggle: -> if @hasParent() @cancel() else @attach() attach: -> super @keyBindings = _.losslessInvert(keymap.bindingsForElement(@previouslyFocusedElement)) events = [] for eventName, eventDescription of _.extend($(window).events(), @previouslyFocusedElement.events()) events.push({eventName, eventDescription}) if eventDescription events = _.sortBy events, (e) -> e.eventDescription @setArray(events) @appendTo(rootView) @miniEditor.focus() itemForElement: ({eventName, eventDescription}) -> keyBindings = @keyBindings $$ -> @li class: 'event', 'data-event-name': eventName, => @span eventDescription, class: 'label', title: eventName @div class: 'right', => for binding in keyBindings[eventName] ? [] @kbd binding, class: 'key-binding' confirmed: ({eventName}) -> @cancel() @previouslyFocusedElement.trigger(eventName) ETahi.SavesDelayed = Ember.Mixin.create saveInFlight: false saveDelayed: -> Ember.run.debounce(@, @saveModel, 100) saveModel: -> unless @get('saveInFlight') @set('saveInFlight', true) @get('model').save().then => @set('saveInFlight', false) actions: saveModel: -> @saveDelayed() fsUtils = require 'fs-utils' path = require 'path' _ = require 'underscore' archive = require 'ls-archive' File = require 'file' module.exports= class ArchiveEditSession registerDeserializer(this) @activate: -> Project = require 'project' Project.registerOpener (filePath) -> new ArchiveEditSession(filePath) if archive.isPathSupported(filePath) @deserialize: ({path}={}) -> if fsUtils.isFileSync(path) new ArchiveEditSession(path) else console.warn "Could not build edit session for path '#{path}' because that file no longer exists" constructor: (@path) -> @file = new File(@path) destroy: -> @file?.off() serialize: -> deserializer: 'ArchiveEditSession' path: @path getViewClass: -> require './archive-view' getTitle: -> if archivePath = @getPath() path.basename(archivePath) else 'untitled' getUri: -> @path getPath: -> @path isEqual: (other) -> other instanceof ArchiveEditSession and @getUri() is other.getUri() deckardcain = require('deckardcain') fury = require('fury') fury.use(require('fury-adapter-apib-parser')) fury.use(require('fury-adapter-swagger')) apiElementsToJson = require('./api-elements-to-json') createAnnotation = (message, type) -> { element: 'annotation' meta: {classes: [type]} content: message } parse = (source, callback) -> annotations = [] mediaType = deckardcain.identify(source) unless mediaType mediaType = 'text/vnd.apiblueprint' annotations.push(createAnnotation('''\ Could not recognize API description format. \ Falling back to API Blueprint by default.\ ''', 'warning')) args = {source, mediaType, generateSourceMap: true} fury.parse(args, (err, apiElements) -> if not (err or apiElements) err = new Error('Unexpected parser error occurred.') else if err # Turning Fury error object into standard JavaScript error err = new Error(err.message) if apiElements apiElements = apiElementsToJson(apiElements) apiElements.content = apiElements.content.concat(annotations) else apiElements = null callback(err, {mediaType, apiElements}) ) module.exports = parse define (require) -> Backbone = require('backbone') SEARCH_URI = "#{location.protocol}//#{location.hostname}:6543/search" return class SearchResults extends Backbone.Model url: () -> "#{SEARCH_URI}#{@query}" defaults: query: limits: [] sort: [] results: items: [] total: 0 initialize: (options = {}) -> @query = options.query or '' @fetch success: () => @set('loaded', true) H2O.PredictOutput = (_, _go, prediction) -> { frame, model } = prediction _plots = signals [] renderPlot = (title, render) -> container = signal null render (error, vis) -> if error debug error else container vis.element _plots.push title: title, plot: container switch prediction.__meta.schema_type when 'ModelMetricsBinomial' renderPlot 'ROC Curve', _.plot (g) -> g( g.path g.position 'FPR', 'TPR' g.line( g.position (g.value 1), (g.value 0) g.strokeColor g.value 'red' ) g.from _.inspect 'Prediction - Thresholds x Metric Scores', prediction ) for tableName in _.ls prediction if table = _.inspect tableName, prediction if table.indices.length > 1 renderPlot tableName, _.plot (g) -> g( g.select() g.from table ) else renderPlot tableName, _.plot (g) -> g( g.select 0 g.from table ) inspect = -> #XXX get this from prediction table _.insertAndExecuteCell 'cs', "inspect getPrediction model: #{stringify model.name}, frame: #{stringify frame.name}" defer _go plots: _plots inspect: inspect template: 'flow-predict-output' define [ 'underscore' 'marionette' '../base' 'tpl!templates/query/item.html' ], (_, Marionette, base, templates...) -> templates = _.object ['item'], templates class EmptyQueryItem extends base.EmptyView icon: false message: 'You have not yet created any queries or have had any shared with you' class QueryItem extends Marionette.ItemView className: 'row-fluid' template: templates.item ui: owner: '.owner' nonOwner: '.non-owner' onRender: -> if @model.get('is_owner') @ui.nonOwner.hide() else @ui.owner.hide() { EmptyQueryItem, QueryItem } # Notifies about Crashlytics crashes via a Crashlytics web hook # # Dependencies: # "url": "" # "querystring": "" # # Configuration: # Just put this url :/hubot/jenkins-notify?room= to your Jenkins # Notification config. See here: https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin # # Commands: # None # # URLS: # POST /hubot/crashlytics-notify?room= # # Authors: # bmnick url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.post "/hubot/crashlytics-notify", (req, res) -> @failing ||= [] query = querystring.parse(url.parse(req.url).query) try data = req.body if data.event == 'verification' console.log "verified with Crashlytics" if data.event == 'issue_impact_change' robot.messageRoom '#publishmobileautomati', 'Stuffs broke!' res.writeHead 204, { 'Content-Length': 0} res.end() catch error console.log "jenkins-notify error: #{error}. Data: #{req.body}" console.log error.stack ### jquery.turbolinks.js ~ v0.1.0 ~ https://github.com/kossnocorp/jquery.turbolinks jQuery plugin for rebind events problem caused by Tubrolinks The MIT License Copyright (c) 2012 Sasha Koss ### $ = require?('jquery') || window.jQuery callbacks = [] ready = -> callback() for callback in callbacks $(ready) $.fn.ready = (callback) -> callbacks.push(callback) $(document).on('page:change', ready) Promise = require 'bluebird' fs = Promise.promisifyAll require 'fs' os = require 'os' crypto = require 'crypto' # Parses the output of /proc/cpuinfo to find the "Serial : 710abf21" line # or the hostname if there isn't a serial number (when run in dev mode) # The uuid is the SHA1 hash of that value. exports.getDeviceUuid = -> fs.readFileAsync('/proc/cpuinfo', 'utf8') .then (cpuinfo) -> serial = cpuinfo .split('\n') .filter((line) -> line.indexOf('Serial') isnt -1)[0] ?.split(':')[1] .trim() or os.hostname() return crypto.createHash('sha1').update(serial, 'utf8').digest('hex') # Parses package.json and returns resin-supervisor's version exports.getSupervisorVersion = -> fs.readFileAsync '../package.json', 'utf-8' .then (data) -> obj = JSON.parse data return obj.version # Initializers $ -> # jQuery datepickers (also evaluates dynamically added HTML) $(document).on 'focus', '.datepicker:not(.hasDatepicker)', -> defaults = dateFormat: 'yy-mm-dd' options = $(@).data 'datepicker-options' $(@).datepicker $.extend(defaults, options) # Clear Filters button $('.clear_filters_btn').click -> window.location.search = '' # Batch Actions dropdown $('.dropdown_button').popover() # Filter form: don't send any inputs that are empty $('.filter_form').submit -> $(@).find(':input').filter(-> @value is '').prop 'disabled', true # Filter form: for filters that let you choose the query method from # a dropdown, apply that choice to the filter input field. $('.filter_form_field.select_and_search select').change -> $(@).siblings('input').prop name: "q[#{@value}]" # In order for index scopes to overflow properly onto the next line, we have # to manually set its width based on the width of the batch action button. if (batch_actions_selector = $('.table_tools .batch_actions_selector')).length batch_actions_selector.next().css width: "calc(100% - 10px - #{batch_actions_selector.outerWidth()}px)" float: 'right' sanitize = (email, options = {}) -> email = email.trim().toLowerCase() return switch when checkGmail email then sanitizeGmail email, options else email sanitizeGmail = (email, options = {}) -> options.excludeDots or= no options.excludePlus or= no [local, host] = email.split '@' [username, label...] = local.split '+' label = label.join '+' # . have no meaning, they're being abused to create fake accounts username = excludeDots username if options.excludeDots # + have meaning, but they ultimately belong to user before + # so we check for uniqueness before +, but let user save + in email username = excludePlus username if options.excludePlus if label and not options.excludePlus then local = "#{username}+#{label}" else local = username return "#{local}@#{host}" # Special rules for Gmail and Googlemail. Googlemail is for users # in Germany, Poland and Russia. checkGmail = (email) -> /^(.)+@(gmail|googlemail).com/.test email excludeDots = (username) -> username.replace /\./g, '' excludePlus = (username) -> parts[0] if (parts = username.split '+').length module.exports = sanitize # Gets added by gulp build. # base64 = require 'base64binary' uint8ArrayToInt = (arr) -> len = arr.length return 0 if len == 0 return arr[len-1] + (uint8ArrayToInt(arr[...len-1]) << 8) validate = (key) -> # See http://crypto.stackexchange.com/a/5948. key = key.replace(/\r?\n/g, '') key = /AAAAB3NzaC1yc2E[A-Za-z0-9+\/=]+/.exec(key)?[0] if !key? return 'Missing header.' arr = base64binary.decode(key) secondLength = uint8ArrayToInt(arr[11..14]) lengthSoFar = 4 + 7 + 4 + secondLength thirdLength = uint8ArrayToInt(arr[lengthSoFar..lengthSoFar+3]) lengthSoFar += 4 + thirdLength if lengthSoFar != arr.length return 'Invalid key length.' return true {CompositeDisposable} = require 'atom' module.exports = configDefaults: directory: 'testdata' notationalVelocityView: null activate: (state) -> # Events subscribed to in atom's system can be easily cleaned up with a # CompositeDisposable @subscriptions = new CompositeDisposable # Register command that toggles this view @subscriptions.add atom.commands.add 'atom-workspace', 'notational-velocity:toggle': => @createView(state).toggle() deactivate: -> @subscriptions.dispose() @notationalVelocityView.destroy() serialize: -> notationalVelocityViewState: @notationalVelocityView.serialize() createView: (state) -> unless @notationalVelocityView? NotationalVelocityView = require './notational-velocity-view' @notationalVelocityView = new NotationalVelocityView(state.notationalVelocityViewState) @notationalVelocityView # Description: # Hubot enforces the correct time to talk about lunch. # # Dependencies: # None # # Configuration: # None # # Commands: # lunch -> Isn't it a little early to be talking about lunch? # # # Author: # arosenb2 module.exports = (robot) -> robot.hear /lunch/i, (msg) -> if ! isPastLunchTime() then msg.reply "Hey #{msg.message.user.name}, isn't it a bit early to start talking about lunch?" isPastLunchTime = (time) -> return time.getHours() > 12 ### Top module for Rubic (for Chrome App) ### # Compatibility modules require("compat/es7compat") require("compat/bbjscompat") # UI helpers require("ui/bootbox-promise") # Load main controller require("controller/windowcontroller") # Needed to solve circular dependency $(-> # Controller must be initiated after window.onload require("app/preferences").initCache().then(-> require("controller/maincontroller").instance.activate() ) ) # Boards require("board/peridotboard") require("board/wakayamarbboard") require("board/grcitrusboard") # Engines require("engine/mrubyengine") require("engine/duktapeengine") require("engine/luaengine") require("engine/micropythonengine") # Editors require("editor/rubyeditor") require("editor/mrbviewer") require("editor/javascripteditor") require("editor/coffeescripteditor") require("editor/luaeditor") require("editor/pythoneditor") require("editor/yamleditor") App.IndexRoute = App.AuthenticatedRoute.extend setupController: (controller, model)-> stateData = {} stateIds = [] activeState = null # Loop thru all room states # find the first joined room to load # start pollers for all joined rooms model.forEach (item)=> stateId = item.get("id") stateIds.push(stateId) # This is to make sure the first active room is loaded if item.get("joined") == true activeState = item if !activeState? poller = new App.Poller() poller.store = @store poller.setRoom item.get("room") poller.start(item.get("room").get("id")) stateData[stateId] = {"poller": poller} else stateData[stateId] = {} controller.set("stateIds", stateIds) controller.set("stateData", stateData) controller.set("activeState", activeState) @_super(controller, model) model: -> @store.find("room_user_state") deactivate: -> stateData = @controller.get("stateData") for stateId, state of stateData state.poller.stop() if state.poller # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $(document).ready -> $(".new").hide() $(".view-option").show() $(".edit-option").hide() $(".options").each -> $(this).find(".new").first().show() return $(".new-option input").focus -> event.preventDefault() blankInputs = $(this).closest(".options").find(".new.new-option input").filter -> return $(this).val() == "" blankInputs.first().closest(".new").show() $(this).closest(".new").next().show() return $(".view-option a").click -> event.preventDefault() $(this).parent().hide() $(this).closest(".existing").find(".edit-option").show() return $(".delete label").click -> event.preventDefault() $(this).parent().parent().hide() blankInputs = $(this).closest(".options").find(".new.new-option input").filter -> return $(this).val() == "" blankInputs.closest(".new").hide() blankInputs.first().closest(".new").show() $(this).parent().parent().find("input").val("") return return #= require jquery #= require jquery_ujs #= require foundation #= require ace/ace #= require ace/theme-monokai #= require ace/mode-coffee #= require ace/mode-handlebars #= require ace/mode-yaml #= require ace/mode-haml #= require tinymce-jquery #= require_directory . #= require_self $ -> $(document).foundation() collapsible.setup() html_edit.setup() yml_edit.setup() $('.preview-page').click (ev)-> ev.preventDefault() url = $(@).attr('href') iframe = $('#preview-modal iframe') params = body: $('#page_body').val() sidebar: $('#page_sidebar').val() footer: $('#page_footer').val() layout: $('#page_layout').val() $.post url, page: params, (response)-> iframe.attr 'src', url $('#preview-modal').foundation('reveal', 'open') false {exec} = require 'child_process' path = require 'path' fs = require 'fs' REFRESH_RATE = 500 # in msecs RUN_PATH = path.join __dirname, "run_test.coffee" seen = {} # cache of file names shouldRun = true # if a change in file was detected canRun = true # if tests are running right now, don't run. runTest = (curr, prev) -> if curr.mtime > prev.mtime console.log "[beantest] Change in file detected. Rerunning tests...\n" shouldRun = true beantest = (persistent=true) -> if shouldRun and canRun exec "coffee #{RUN_PATH}", (error, stdout, stderr) -> console.log(if error then stderr else stdout) canRun = true shouldRun = canRun = false return unless persistent exec 'find . | grep "\\.coffee$"', (error, stdout, stderr) -> fileNames = stdout.split('\n') for fileName in fileNames if fileName not of seen seen[fileName] = true fs.watchFile fileName, { interval: REFRESH_RATE }, runTest setTimeout beantest, REFRESH_RATE @beantest = beantestSpellChecker = require 'spellchecker' module.exports = findMisspellings: (text) -> wordRegex = /(?:^|[\s\[\]])([a-zA-Z']+)(?=[\s\.\[\]:]|$)/g row = 0 misspellings = [] for line in text.split('\n') while matches = wordRegex.exec(line) word = matches[1] continue unless SpellChecker.isMisspelled(word) startColumn = matches.index + matches[0].length - word.length endColumn = startColumn + word.length misspellings.push([[row, startColumn], [row, endColumn]]) row++ callTaskMethod('misspellingsFound', misspellings) describe 'error of incorrect pattern type when', -> it 'is not an Object or Array', -> a.throws (-> ss 'foobar'), 'Error: Given argument type String ("foobar") is incompatible with parameter type PlainObject.' ### # Copyright 2015 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### class @LandingHero constructor: -> $(document).on 'turbolinks:load', @landingHeroInitialize landingHeroInitialize: -> $('.js-landing-hero-slider--new.js-landing-hero-slider') .slick fade: true arrows: false autoplay: true adaptiveHeight: true dots: true appendDots: $('.js-landing-header') .removeClass 'js-landing-hero-slider--new' os = osu.getOS() others = osu.otherOS os $('.js-download-platform').text Lang.get('home.landing.download.for', {'os': os}) $('.js-download-other').text Lang.get('home.landing.download.other', {'os1': others[0], 'os2': others[1]}) Backbone = require 'backbone' sd = require('sharify').data { Markdown } = require 'artsy-backbone-mixins' insane = require('insane') _ = require 'underscore' module.exports = class Page extends Backbone.Model _.extend @prototype, Markdown urlRoot: "#{sd.API_URL}/api/v1/page" sanitizedHtml: (attr) -> clean = insane(@get(attr)) Markdown.mdToHtml.apply { get: -> clean }, [null, sanitize: false] ### Requires https://github.com/jaspervdj/stylish-haskell ### "use strict" Beautifier = require('./beautifier') module.exports = class Crystal extends Beautifier name: "Crystal" link: "http://crystal-lang.org" isPreInstalled: false options: { Crystal: false } beautify: (text, language, options) -> # Seems that Crystal dosen't have Windows support yet. if @isWindows @Promise.reject(@commandNotFoundError( 'crystal' { link: "http://crystal-lang.org" program: "crystal" }) ) else @run("crystal", [ 'tool', 'format', tempFile = @tempFile("temp", text) ], {ignoreReturnCode: true}) .then(=> @readFile(tempFile) ) '.workspace': 'ctrl-9': 'github:toggle-git-panel' 'ctrl-(': 'github:toggle-git-panel-focus' # ctrl-shift-9 '.github-Panel': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-StagingView': 'left': 'github:focus-diff-view' 'tab': 'core:focus-next' 'shift-tab': 'core:focus-previous' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' 'shift-tab': 'core:focus-previous' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'core:move-right' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'tool-panel:unfocus' {Range} = require('atom') helpers = require('./helpers') module.exports = Validate = linter: (linter) -> # set undefined to false for backward compatibility linter.modifiesBuffer = Boolean(linter.modifiesBuffer) unless linter.grammarScopes instanceof Array throw new Error("grammarScopes is not an Array. Got: #{linter.grammarScopes}") unless linter.lint? throw new Error("Missing linter.lint") if typeof linter.lint isnt 'function' throw new Error("linter.lint isn't a function") return true messages: (messages) -> unless messages instanceof Array throw new Error("Expected messages to be array, provided: #{typeof messages}") messages.forEach (result) -> unless result.type throw new Error "Missing type field on Linter Response" unless result.html or result.text throw new Error "Missing html/text field on Linter Response" result.range = Range.fromObject result.range if result.range? result.key = JSON.stringify(result) result.class = result.type.toLowerCase().replace(' ', '-') Validate.messages(result.trace) if result.trace return undefined fs = require 'fs' path = require 'path' # Finds all test files in the given directory. class TestsFinder constructor: (@directory) -> # Returns the name of all files within the given directory that contain tests. files: -> @_search_directory @directory, [] # Adds all test files in the current directory and its subdirectories # to the given files array. _search_directory: (dir, files) -> for file in fs.readdirSync(dir) continue if @_is_hidden file filePath = path.resolve "#{dir}/#{file}" stat = fs.statSync filePath if stat.isFile() continue unless @_is_test_file file files.push filePath else if stat.isDirectory() @_search_directory filePath, files files # Returns whether the given filesystem object is hidden. _is_hidden: (file) -> file[0] == '.' # Returns whether the file with the given filename contains unit tests. _is_test_file: (file) -> # Ignore non-test code files. return false unless file.match /_(?:test|spec)\.[^.]+$/ # Ignore non-code files. return false unless file.match /(js|coffee)$/ true module.exports = TestsFinder kd = require 'kd' globals = require 'globals' KDCustomHTMLView = kd.CustomHTMLView EnvironmentsModal = require 'app/environment/environmentsmodal' SidebarMachineList = require './sidebarmachinelist' module.exports = class SidebarOwnMachinesList extends SidebarMachineList constructor: (options = {}, data) -> options.title ?= 'Your VMs' options.hasPlusIcon = yes options.cssClass = 'my-machines' super options, data viewAppended: -> super @header.addSubView @unreadCount = new KDCustomHTMLView tagName : 'cite' cssClass : 'count hidden' partial : '1' kd.singletons.computeController.on 'StackRevisionChecked', (stack) => return if @isDestroyed # This needs to be investigated ~ GG # We're creating instances of this multiple times # but somehow we're not cleaning up them correctly {_revisionStatus} = stack if not _revisionStatus?.error? and {status} = _revisionStatus @unreadCount.show() if status?.code > 0 headerClickHandler: -> new EnvironmentsModal {$$, EditorView, View} = require 'atom' marked = require 'marked' module.exports = class GitIssueView extends View @content: -> @div => @h1 'GitHub Issues' @ul() constructor: (opt) -> super {@issues} = opt issueList = @issues .sort (a,b) -> +a.number - +b.number .map (issue) -> "##{issue.number}: #{issue.title}
    #{marked issue.body}
    " #@setText issueList.join "\n" issueList.forEach (issue) => @find('ul').append("
  • #{issue}
  • ") getTitle: -> 'GitHub Issues' getUri: -> 'github-issues://list' ModelEmitter = require './model-emitter' Route = require './route' class App extends ModelEmitter constructor: (state = {}) -> super @_routes = {} @views = [] addRoute: (path, cb) -> unless (route = @_routes[path])? route = new Route path route.callbacks ?= [] route.callbacks.push cb @_routes[path] = route # setup routing setupRoutes: -> for k, v of @routes if Array.isArray v for cb in v @addRoute k, cb else @addRoute k, v null dispatchRoutes: -> for _, route of @_routes if route.regexp.test location.pathname for cb in route.callbacks cb() null route: -> @setupRoutes() @dispatchRoutes() module.exports = App window.UpdateOnSignInOrOutMixin = componentDidMount: -> window.currentSession.user().on 'change:username', (-> @forceUpdate()), @ componentWillUnmount: -> window.currentSession.user().off null, null, @ {CompositeDisposable} = require 'atom' AboutView = null StatusBarView = null aboutURI = 'atom://about' createAboutView = (state) -> AboutView ?= require './about-view' new AboutView(state) atom.deserializers.add name: 'AboutView' deserialize: (state) -> createAboutView(state) module.exports = About = activate: -> @subscriptions = new CompositeDisposable @updateAvailable = false @subscriptions.add atom.workspace.addOpener (uriToOpen) -> createAboutView(uri: uriToOpen) if uriToOpen is aboutURI @subscriptions.add atom.commands.add 'atom-workspace', 'about:view-release-notes', -> require('shell').openExternal('https://atom.io/releases') if atom.isReleasedVersion() @subscriptions.add atom.commands.add 'atom-workspace', 'window:update-available', => @updateAvailable = true @showStatusBarIfNeeded() deactivate: -> @subscriptions.dispose() @statusBarTile?.destroy() consumeStatusBar: (statusBar) -> @statusBar = statusBar @showStatusBarIfNeeded() showStatusBarIfNeeded: -> return unless @updateAvailable and @statusBar? StatusBarView ?= require './about-status-bar' @statusBarTile?.destroy() @statusBarTile = @statusBar.addRightTile(item: new StatusBarView(), priority: -100) noflo = require 'noflo' class RotateElement extends noflo.Component description: 'Change the coordinates of a DOM element' constructor: -> @element = null @inPorts = element: new noflo.Port 'object' percent: new noflo.Port 'number' @inPorts.element.on 'data', (element) => @element = element @inPorts.percent.on 'data', (percent) => if @element @setRotation @element, percent setRotation: (element, percent) -> degrees = 360 * percent % 360 @setVendor element, "transform", "rotate(#{degrees}deg)" setVendor: (element, property, value) -> propertyCap = property.charAt(0).toUpperCase() + property.substr(1) element.style["webkit" + propertyCap] = value element.style["moz" + propertyCap] = value element.style["ms" + propertyCap] = value element.style["o" + propertyCap] = value element.style[property] = value exports.getComponent = -> new RotateElement Sprangular.service "Orders", ($http) -> service = find: (number) -> $http.get("/api/orders/#{number}") .then (response) -> Sprangular.extend(response.data, Sprangular.Order) all: -> $http.get("/api/orders") .then (response) -> Sprangular.extend(response.data, Sprangular.Order) service # Copyright 2013 Matt Farmer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module.exports = (jobs) -> require('./scrape-sessions')(jobs) require('./scrape-representatives')(jobs) require('./scrape-vote-list')(jobs) jobs.process 'poll', (job, done) -> # Queue up jobs that should run on each poll. jobs.create('scrape sessions').save() jobs.create('scrape representatives').save() #jobs.create('scrape committees').save() #jobs.create('scrape legislation').save() #jobs.create('scrape votes').save() # Schedule the next poll. # todo done() # Create initial poll jobs.create('poll').save() "*": core: audioBeep: false closeEmptyWindows: false disabledPackages: [ "language-clojure" "language-go" "language-java" "language-perl" "language-objective-c" "language-property-list" "metrics" "open-on-github" "package-generator" "symbols-view" "language-toml" "spell-check" "github" ] packagesWithKeymapsDisabled: [ "refactor" "es-identifier-highlight" "sort-lines" "csslint" ] telemetryConsent: "limited" csslint: hideOnNoErrors: true editor: invisibles: {} showInvisibles: true "exception-reporting": userId: "2ab09d56-2ab2-2fc5-7065-f68aca373175" "find-and-replace": {} linter: lintOnChange: false "linter-jscs": configPath: ".jscsrc" onlyConfig: true "linter-jshint": disableWhenNoJshintrcFileInPath: true "linter-ui-default": showPanel: true "spell-check": {} tabs: enableVcsColoring: true "tree-view": hideIgnoredNames: true hideVcsIgnoredFiles: true welcome: showOnStartup: false whitespace: ignoreWhitespaceOnCurrentLine: false class @ReceiptFindMode extends CheckoutMode ModeSwitcher.registerEntryPoint("receipt_list", @) constructor: -> super @receiptList = new ReceiptList() enter: -> super refresh = new RefreshButton(=> Api.receipt_list().done(@onResult)) @cfg.uiRef.body.empty() @cfg.uiRef.body.append(refresh.render()) @cfg.uiRef.body.append(@receiptList.render()) refresh.refresh() glyph: -> "list-alt" title: -> "Receipt List" subtitle: -> null onResult: (receipts) => @receiptList.body.empty() for receipt, index in receipts row = @receiptList.append(receipt, index + 1) row.on("click", @_showReceiptFn(receipt.id)) if receipts.length == 0 @receiptList.no_results() _showReceiptFn: (receiptId) => () => dialog = new Dialog() dialog.addPositive().text("Ok") dialog.title.text("Receipt details") Api.receipt_get(id: receiptId).then( (data) => result = Templates.render("receipt_info", receipt: data) dialog.body.append(result) (jqXHR) => dialog.body.text(jqXHR.responseText) ) dialog.show() Template.instancesOfProcurementForm.events "click .add-instance-of-procurement": -> @instancesOfProcurementCollection.insert {} Template.instancesOfProcurementForm.helpers "iop": -> @instancesOfProcurementCollection.find() Template.instancesOfProcurementForm.created = -> collection = @data.instancesOfProcurementCollection = new Meteor.Collection null collection.insert instance for instance in @data.instancesOfProcurement Template.instanceOfProcurementForm.events "click .remove-instance-of-procurement": (e, template) -> collection = template.view.parentView.parentView.parentView.templateInstance().data.instancesOfProcurementCollection collection.remove @$ -> # Don't run on non-video pages return if not $('.videos').length # $(window).sausage({page: '.video' # , content: (i, page) -> # '' + (i + 1) + ". " + page.find('.date').html() + '' # }) every = (milliseconds, callback) => setInterval callback, milliseconds nearBottom = () -> $(window).scrollTop() > $(document).height() - $(window).height() - 600 page = 1 loading = false checkPage = every 200, () -> if not loading and nearBottom() loading = true $('.queue').append($('
    Loading...
    ')) page++ $.ajax(window.location.pathname + "?page=#{ page }", { dataType: 'script', complete: (resp) -> if resp.responseText $('#loading').replaceWith("
    #{ resp.responseText }
    ") affixTags($(".page[data-page='#{ page }'] .video .tagEntry")) # $(window).sausage('draw') loading = false else clearInterval(checkPage) })window.Tahi ||= {} class Tahi.RichEditableElement constructor: (@element) -> @instance = CKEDITOR.inline @element, extraPlugins: 'sharedspace' removePlugins: 'floatingspace,resize' sharedSpaces: top: 'toolbar' toolbar: [ [ 'Format' ] [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Table' ] [ 'PasteFromWord' ], [ 'Link', 'Unlink' ] [ 'Replace', '-', 'Scayt' ] ] @placeholderText = @element.attributes['placeholder'].value @setPlaceholder() @instance.on 'focus', => @clearPlaceholder() @instance.on 'blur', => @setPlaceholder() setPlaceholder: -> text = $($.parseHTML(@instance.getData())).text().trim() if text == '' || text == @placeholderText @instance.element.addClass 'placeholder' @instance.setData @placeholderText clearPlaceholder: -> text = $($.parseHTML(@instance.getData())).text().trim() if text == @placeholderText @instance.element.removeClass 'placeholder' @instance.setData '' r = require('require-root')('generic-dht') TransactionManager = r 'src/transactions/TransactionManager' describe 'TransactionManager', ()-> beforeEach ()-> @responseCb = jasmine.createSpy 'responseCb' @errorCb = jasmine.createSpy 'errorCb' @manager = new TransactionManager @responseCb, @errorCb it 'should not create a new transaction without an address', ()-> id = @manager.getNewTransactionId() expect(id).toBeNull() it 'should not create a new transaction without a messageType', ()-> id = @manager.getNewTransactionId(null, null) expect(id).toBeNull() path = require "path" latexmk = require "./latexmk" module.exports = configDefaults: texPath: "$PATH:/usr/texbin" outputDirectory: "" enableShellEscape: false activate: -> @initialize() atom.workspaceView.command "latex:build", => @build() initialize: -> envPath = process.env.PATH texPath = atom.config.get("latex.texPath") texPathSansMarker = texPath?.replace("$PATH", "") if texPath? and texPath.length == texPathSansMarker.length console.error "latex.texPath MUST contain $PATH at some point" return -1 hasAllPaths = texPathSansMarker?.split(":").every (path) -> envPath.indexOf(path) > -1 process.env.PATH = texPath.replace("$PATH", envPath) unless hasAllPaths build: -> editor = atom.workspace.activePaneItem file = editor?.buffer.file unless file? return -1 editor.save() if editor.isModified() # NOTE: Should this be configurable? args = latexmk.constructArgs(file.path) proc = latexmk.run(args) # TODO: Trigger an event instead of returning proc? module.exports = (config) -> config.set basePath: '' frameworks: [ 'jasmine' ] files: [ 'public/vendor/zepto-1.1.4.js' 'public/site.js' 'spec/**/*.coffee' ] exclude: [] preprocessors: { '**/*.coffee': ['coffee'] } reporters: [ 'progress' ] port: 9876 colors: true logLevel: config.LOG_INFO autoWatch: true browsers: [ 'Chrome' ] singleRun: false vm = require 'vm' exports.allowUnsafeEval = (fn) -> previousEval = global.eval try global.eval = (source) -> vm.runInThisContext(source) fn() finally global.eval = previousEval exports.allowUnsafeNewFunction = (fn) -> previousFunction = global.Function try global.Function = exports.Function fn() finally global.Function = previousFunction exports.Function = (paramLists..., body) -> params = [] for paramList in paramLists params.push(paramList.split(/\s*,\s*/)...) vm.runInThisContext """ (function(#{params.join(', ')}) { #{body} }) """ StepView = require './step.coffee' Form = require '../../form/index.coffee' LocationSearch = require '../../location_search/index.coffee' template = -> require('../templates/basic_info.jade') arguments... module.exports = class BasicInfo extends StepView template: -> template arguments... __events__: 'click button': 'serialize' serialize: (e) -> form = new Form model: @user, $form: @$('form') return unless form.start() e.preventDefault() form.state 'loading' @user.set form.data() # Temporary hack around API bug surrounding valid hash fields... collectorProfile = @user.related().collectorProfile id = collectorProfile.id collectorProfile.clear() collectorProfile.set _.extend id: id, @user.pick(collectorProfile.validHashFields) $.when.apply(null, [ @user.save() collectorProfile.save() ]) .always => @next() postRender: -> @locationSearch = new LocationSearch el: @$('.js-location-search') autofocus: false required: !@user.get('prequalified') @locationSearch.render @user.location()?.cityStateCountry() @listenTo @locationSearch, 'location:update', (location) -> @user.setLocation location remove: -> @locationSearch?.remove() super _ = require 'lodash' game = require '../game' log = require '../log' prompts = game.prompts direction = require '../direction' vectorMath = require '../vector-math' calc = require '../calc' Skill = class exports.Skill name: 'skill' # symbol: 'skill' # allow symbols for skills (to show in list maybe) class exports.TentacleWhip extends Skill name: 'tentacle whip' askParams: (creature) -> # only called for player, to populate params to pass to #use() params = {} prompts.position 'Whip towards where?', default: creature .then (pos) -> params.position = pos .then -> params use: (creature, params) -> console.log 'whip:', params 12 class exports.SenseLasagna extends Skill name: 'sense lasagna' use: (creature) -> game.message " You feel no presence of any lasagna aura in your vicinity. Disappointing. "init = -> $("[data-provider='summernote']").summernote height: 300 maximumImageFileSize: 262144 # 256KB $(document).ready(init) TentStatus.Views.PostReplyForm = class PostReplyFormView extends TentStatus.Views.NewPostForm @template_name: '_post_reply_form' @view_name: 'post_reply_form' is_reply_form: true constructor: -> super toggle: => if @visible @hide() else @show() hide: => @visible = false DOM.hide(@el) show: => @visible = true setImmediate => @constructor.instances.all[@_child_views.MentionsAutoCompleteTextarea?[0]]?.textarea_view?.focus() if @ready DOM.show(@el) else @render() post: => TentStatus.Models.Post.instances.all[@parent_view.post_cid] context: => post = @post() _.extend {}, super, max_chars: TentStatus.config.MAX_LENGTH id: post.id entity: post.entity formatted: reply_to_entities: (_.map post.postMentions(), (m) => m.entity) blacklist = require '../../lib/blacklist.coffee' { TEAM_BLOGS } = require('sharify').data module.exports = patterns: [ '^/personalize' '^/artsy-primer' '^/collect-art' '^/consign' '^/consign2' '^/signup' '^/login' '^/user/edit' '^/sale/.*' '^/auction/.*' '^/dev$' '^/inquiry/.*' '^/artwork/.*/checkout' '^/artwork/.*/thank-you' '^/jobs' '^/job/.*' TEAM_BLOGS or '^/test' '^/2016-year-in-art' '^/artist/.*' '^/venice-biennale.*' '^/gallery-partnerships.*' '^/article/.*' ] check: -> blacklist(@patterns).check() class window.ExtendedFactTitleView extends Backbone.Marionette.Layout tagName: "header" id: "single-factlink-header" template: "facts/_extended_fact_title" events: "click .back-to-profile": "navigateToProfile" regions: creatorProfileRegion: ".created_by_region" onRender: -> @creatorProfileRegion.show new UserWithAuthorityBox(model: @model) navigateToProfile: (e) -> e.preventDefault() e.stopImmediatePropagation() Backbone.history.navigate @model.get('created_by').url, true Settings = require 'settings-sharelatex' module.exports = Features = externalAuthenticationSystemUsed: -> Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth? hasFeature: (feature) -> switch feature when 'registration' return not Features.externalAuthenticationSystemUsed() when 'github-sync' return not Settings.disableGithubSync else throw new Error("unknown feature: #{feature}") ".text.roff": editor: commentStart: ".\\\" " ".source.pic": editor: commentStart: "# " ".text.runoff": editor: commentStart: ".! " window.collectionDifference = (args...) -> utils = new CollectionUtils() utils.difference args... window.collectionMap = (args...) -> utils = new CollectionUtils() utils.map(args...) class window.CollectionUtils constructor: (eventAggregator)-> @eventAggregator = eventAggregator || new Backbone.Marionette.EventAggregator listenTo: (args...)=> @eventAggregator.listenTo args... difference: (resultCollection, onField, collection1, collections...) => reset = -> forbidden_fields = _.union(( for col in collections if col.pluck col.pluck(onField) else _.pluck(col,onField) )...) diffmodels = collection1.reject (model) => model.get(onField) in forbidden_fields resultCollection.reset diffmodels @listenTo collection1, 'add reset remove change', reset for collection in collections if collection.on? @listenTo collection, 'add reset remove change', reset reset() resultCollection union: (resultCollection, collections...)-> reset = -> resultCollection.reset(_.union (col.models for col in collections)...) for collection in collections if collection.on @listenTo collection, 'add reset remove change', reset reset() resultCollection updatedClone: (resultCollection, collection)-> @difference(resultCollection, null, collection) map: (resultCollection, collection, mapFunction) => reset = -> resultCollection.reset() for model in collection.models resultCollection.add mapFunction(model) @listenTo collection, 'add remove reset change', reset reset() resultCollection define [ ], () -> class LabelsMaster constructor: (@ide, @$scope) -> @_state = { documents: {} } @$scope.$on 'doc:labels:updated', (e, data) => if data.docId and data.labels @_state.documents[data.docId] = data.labels @$scope.$on 'entity:deleted', (e, entity) => if entity.type == 'doc' delete @_state.documents[entity.id] @$scope.$on 'file:upload:complete', (e, upload) => if upload.entity_type == 'doc' @loadDocLabelsFromServer(upload.entity_id) # load project labels now @loadProjectLabelsFromServer() getAllLabels: () -> _.flatten(labels for docId, labels of @_state.documents) ## Loaders loadProjectLabelsFromServer: () -> $.get( "/project/#{window.project_id}/labels" , (data) => if data.projectLabels for docId, docLabels of data.projectLabels @_state.documents[docId] = docLabels ) loadDocLabelsFromServer: (docId) -> $.get( "/project/#{window.project_id}/#{docId}/labels" , (data) => if data.docId and data.labels @_state.documents[data.docId] = data.labels ) "*": "atom-beautify": general: _analyticsUserId: "016f8b6e-eda5-4d72-acc8-57bcde20fdff" core: autoHideMenuBar: true disabledPackages: [ "exception-reporting" "linter-perl" "perltidy" ] projectHome: "/home/caramelomartins/Projects" themes: [ "nucleus-dark-ui" "atom-material-syntax" ] editor: invisibles: {} showIndentGuide: true tabLength: 4 linter: {} "linter-htmlhint": {} "linter-jshint": {} "linter-shellcheck": enableNotice: true "markdown-preview": useGitHubStyle: true "one-dark-ui": {} "travis-ci-status": {} welcome: showOnStartup: false _ = require 'underscore' module.exports = projectPaths: null fuzzyFinderView: null loadPathsTask: null activate: (state) -> rootView.command 'fuzzy-finder:toggle-file-finder', => @createView().toggleFileFinder() rootView.command 'fuzzy-finder:toggle-buffer-finder', => @createView().toggleBufferFinder() rootView.command 'fuzzy-finder:find-under-cursor', => @createView().findUnderCursor() if rootView.project.getPath()? LoadPathsTask = require 'fuzzy-finder/lib/load-paths-task' @loadPathsTask = new LoadPathsTask((paths) => @projectPaths = paths) @loadPathsTask.start() for path, lastOpened of state session = _.detect rootView.project.getEditSessions(), (editSession) -> editSession.getPath() is path session?.lastOpened = lastOpened deactivate: -> @loadPathsTask?.terminate() @loadPathsTask = null @fuzzyFinderView?.cancel() @fuzzyFinderView = null @projectPaths = null serialize: -> @fuzzyFinderView?.getOpenedPaths() createView: -> unless @fuzzyFinderView FuzzyFinderView = require 'fuzzy-finder/lib/fuzzy-finder-view' @fuzzyFinderView = new FuzzyFinderView() if @projectPaths? and not @fuzzyFinderView.projectPaths? @fuzzyFinderView.projectPaths = @projectPaths @fuzzyFinderView.reloadProjectPaths = false @fuzzyFinderView {expect} = require "chai" utils = require "../../utils" {Collections} = utils.require "base" describe "step_interpolator_transform module", -> source = {start: 0, end: 10} target = {start: 20, end: 80} generate_jitter = -> Collections("Jitter").create width: 1 center: 0 distribution: 'uniform' describe "Jitter with uniform", -> transform = generate_jitter() transform.set('distribution', 'uniform') it "should average the fixed values", -> N = 1000 vals = Array.apply(null, Array(N)).map -> 5 rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/N) - 5 expect(thediff).to.be.below 0.01 describe "Jitter with normal", -> transform = generate_jitter() transform.set('distribution', 'normal') it "should average the fixed values", -> N = 1000 vals = Array.apply(null, Array(N)).map -> 5 rets = transform.v_compute(vals) add(a, b) -> return a+b thesum = rets.reduce(add, 0) thediff = (thesum/N) - 5 expect(thediff).to.be.below 0.01 express = require 'express' bodyParser = require 'body-parser' errorHandler = require 'errorhandler' meshbluHealthcheck = require 'express-meshblu-healthcheck' morgan = require 'morgan' MessagesController = require './src/controllers/messages-controller' messagesController = new MessagesController PORT = process.env.PORT ? 80 app = express() app.use morgan('combined', immediate: false) app.use bodyParser.json({limit: '50mb'}) app.use errorHandler() app.use meshbluHealthcheck() app.post '/messages', messagesController.create server = app.listen PORT, -> host = server.address().address port = server.address().port console.log "Server running on #{host}:#{port}" React = require "react/addons" classNames = require 'classnames' {RetinaImg} = require 'nylas-component-kit' {Actions, FocusedContentStore} = require "nylas-exports" class DraftDeleteButton extends React.Component @displayName: 'DraftDeleteButton' @containerRequired: false @propTypes: selection: React.PropTypes.object.isRequired render: -> _destroySelected: => for item in @props.selection.items() Actions.queueTask(new DestroyDraftTask(draftClientId: item.clientId)) @props.selection.clear() module.exports = {DraftDeleteButton} geyser = do -> parse = (spec) -> dotIndex = spec.indexOf '.' switch dotIndex when -1 tag: spec when 0 tag: 'div' classes: split (spec.substr 1), '.' else tokens = split spec, '.' tag: tokens.shift() classes: tokens generate = (arg) -> console.assert (isString arg) or (isArray arg) specs = if isString arg then words arg else arg map specs, (spec) -> el = parse spec (content) -> el: el content: content renderOne = (el, content) -> classes = if el.classes then ' class="' + (join el.classes, ' ') + '"' else '' "<#{el.tag}#{classes}>#{content}" render = (html) -> if isArray html.content renderOne html.el, (join (map html.content, render), '') else renderOne html.el, html.content generate: generate render: render SHARED_DATA = null SHARED_COLLECTION = null class Skr.Models.Location extends Skr.Models.Base cacheDuration: [1, 'day'] mixins: [ 'FileSupport', 'HasCodeField' ] props: id: {type:"integer"} code: {type:"code"} name: {type:"string"} address_id: {type:"integer"} is_active: {type:"boolean", "default":true} gl_branch_code:{type:"string", "default":"01"} logo: "file" options: "any" associations: address: { model: "Address" } sku_locs: { collection: "SkuLoc" } @initialize: (data) -> SHARED_DATA = data.locations Object.defineProperties Skr.Models.Location, { all: get: -> SHARED_COLLECTION ||= new Skr.Models.Location.Collection( SHARED_DATA ) default: get: -> @all.findWhere(code: 'DEFAULT') || @all.first() } class Motion constructor: (@editor) -> isComplete: -> true class MoveLeft extends Motion execute: -> {column, row} = @editor.getCursorScreenPosition() @editor.moveCursorLeft() if column > 0 select: -> {column, row} = @editor.getCursorScreenPosition() if column > 0 @editor.selectLeft() true else false class MoveRight extends Motion execute: -> # FIXME: Don't run off the end {column, row} = @editor.getCursorScreenPosition() @editor.moveCursorRight() class MoveUp extends Motion execute: -> @editor.moveCursorUp() class MoveDown extends Motion execute: -> @editor.moveCursorDown() class MoveToPreviousWord extends Motion execute: -> @editor.moveCursorToBeginningOfWord() select: -> @editor.selectToBeginningOfWord() true class MoveToNextWord extends Motion execute: -> @editor.moveCursorToBeginningOfNextWord() select: -> @editor.selectToBeginningOfNextWord() true class MoveToNextParagraph extends Motion execute: -> @editor.setCursorScreenPosition(@nextPosition()) select: -> @editor.selectToPosition(@nextPosition()) true nextPosition: -> @editor.getCurrentParagraphBufferRange().end module.exports = { Motion, MoveLeft, MoveRight, MoveUp, MoveDown, MoveToNextWord, MoveToPreviousWord, MoveToNextParagraph } ETahi.PaperIndexView = Ember.View.extend setBackgroundColor:(-> $('html').addClass('matte') ).on('didInsertElement') resetBackgroundColor:(-> $('html').removeClass('matte') ).on('willDestroyElement') App.AdvancedSearch = advanced_search_terms: -> $('#js-advanced-search').data('advanced-search-terms') toggle_form: (event) -> event.preventDefault() $('#js-advanced-search').slideToggle() toggle_date_options: -> if $('#js-advanced-search-date-min').val() == 'custom' $('#js-custom-date').show() $( ".js-calendar" ).datepicker( "option", "disabled", false ) else $('#js-custom-date').hide() $( ".js-calendar" ).datepicker( "option", "disabled", true ) init_calendar: -> locale = $('#js-locale').data('current-locale') if locale == 'en' locale = '' $('.js-calendar').datepicker regional: locale maxDate: "+0d" $('.js-calendar-full').datepicker regional: locale initialize: -> App.AdvancedSearch.init_calendar() if App.AdvancedSearch.advanced_search_terms() $('#js-advanced-search').show() App.AdvancedSearch.toggle_date_options() $('#js-advanced-search-title').on click: (event) -> App.AdvancedSearch.toggle_form(event) $('#js-advanced-search-date-min').on change: -> App.AdvancedSearch.toggle_date_options() window.Backbone ||= {} window.Backbone.Views ||= {} class Backbone.Views.ReportEditVisualisationView extends Backbone.Diorama.NestingView className: 'modal report-edit-visualisation' template: Handlebars.templates['report_edit_visualisation.hbs'] events: "click .close": "close" "click .save": "save" "change select[name='visualisation']": 'updateVisualisationType' initialize: (options) -> @visualisation = options.visualisation @listenTo @visualisation, 'change', @render @render() render: => @closeSubViews() @$el.html(@template( thisView: @ indicator: @visualisation.get('indicator').toJSON() visualisation: @visualisation visualisationType: @visualisation.get('type') visualisationViewName: @visualisation.get('type') + "View" visualisationTypes: Backbone.Models.Visualisation.visualisationTypes )) @renderSubViews() $('body').addClass('stop-scrolling') return @ save: -> @visualisation.save() onClose: -> $('body').removeClass('stop-scrolling') @trigger('close') @closeSubViews() @stopListening() updateVisualisationType: => type = @$el.find("select[name='visualisation']").val() @visualisation.set('type', type) class InteractorEmptyView extends Backbone.Marionette.ItemView tagName: 'span' template: "fact_relations/interactor_empty" class InteractorView extends Backbone.Marionette.Layout tagName: 'span' className: 'separator-list-item' template: "fact_relations/interactor" class window.InteractorsView extends Backbone.Marionette.CompositeView template: "fact_relations/interactors" emptyView: InteractorEmptyView itemView: InteractorView itemViewContainer: ".js-interactors-collection" events: 'click a.showAll' : 'showAll' initialize: (options) -> @model = new Backbone.Model @fetch() fetch: -> @collection.fetch success: => @model.set numberNotDisplayed: @collection.totalRecords - @collection.length multipleNotDisplayed: (@collection.totalRecords - @collection.length)>1 @render() templateHelpers: => multiplicity = if @collection.totalRecords > 1 then 'plural' else 'singular' translation = "fact_#{@collection.type}_past_#{multiplicity}_action" past_action: Factlink.Global.t[translation] showAll: (e) -> e.stopPropagation() e.preventDefault() @collection.howManyPer(1000000) @fetch() # TODO: API for load missing content or binding to page events $ -> setup_listener() load_missing_content() setup_listener = -> $(document).on 'progressive_render:end', load_missing_content $(document).on 'ajax:end', load_missing_content $(document).on 'turbolinks:load', load_missing_content if window.Turbolinks load_missing_content = -> $('[data-progressive-render-placeholder=true]').each -> $this = $(this) # Don't re-process div's we've already seen return if $this.data('progressive-render-setup') $this.data('progressive-render-setup', true) # Start the load $.ajax url: $this.data('progressive-render-path'), cache: false, success: (response) -> $this.html(response); $(document).trigger('progressive_render:end') #= require jquery #= require jquery_ujs #= require jquery-fileupload/basic #= require jquery-fileupload/vendor/tmpl #= require attachments #= require dropzone_effects #= require bootstrap-sprockets #= require moment #= require moment/de #= require bootstrap-datetimepicker #= require marked.min # http://github.com/toopay/bootstrap-markdown #= require bootstrap-markdown # NOTE: requires api controller to render markdown preview. # see echo-live for code # require markdown_setup #= require flyout #= require cocoon # NOTE: gem's not getting loaded for unknown reason # require editable/bootstrap-editable # require editable/rails #= require jquery.autogrow #= require clndr #= require json3 #= require underscore $ -> $('.datepicker').datetimepicker language: 'de' pick12HourFormat: false minuteStepping: 15 $('textarea').autoGrow() $(document).on "click", ".panel-toggle-btn", -> $(this).closest(".panel").toggleClass "closed" module.exports = (grunt) -> # =============================== Load plugins =============================== # grunt.loadNpmTasks 'grunt-eslint' grunt.loadNpmTasks 'grunt-travis-lint' grunt.loadNpmTasks 'grunt-jsonlint' grunt.loadNpmTasks 'grunt-coffeelint' grunt.loadNpmTasks 'grunt-mdlint' # ================================= Settings ================================= # # Force use of Unix newlines grunt.util.linefeed = '\n' # Project configuration # ===================== grunt.initConfig # Load external configurations pkg: grunt.file.readJSON 'package.json' # =================================== Task =================================== # # Linters # ------ # JS eslint: options: configFile: '.eslintrc.json' target: ['*.js'] # JSON jsonlint: default: src: [ "*.json" ".coffeelintrc" ".jshintrc" ] # Coffee coffeelint: default: [ '*.coffee' ] options: configFile: '.coffeelintrc' # MarkDown mdlint: default: [ '*.md' ] # ============================== Callable tasks ============================== # grunt.registerTask 'travis', [ 'lint' ] grunt.registerTask 'lint', [ 'eslint', 'jsonlint', 'coffeelint' 'mdlint' 'travis-lint' ] # Alias grunt.registerTask 'default', 'travis' goog.provide 'app.Facebook' class app.Facebook ###* @param {app.user.Store} userStore @constructor ### constructor: (@userStore) -> ###* @type {Object} @private ### fb_: null ###* Enable Facebook api. ### init: -> window.fbAsyncInit = => @fb_ = window.FB @fb_.init 'appId': '1458272837757905' 'cookie': true 'version': 'v2.1' 'xfbml': false # Load the SDK asynchronously. ((d, s, id) -> fjs = d.getElementsByTagName(s)[0] return if d.getElementById id js = d.createElement s js.id = id js.src = '//connect.facebook.net/en_US/sdk.js' fjs.parentNode.insertBefore js, fjs return ) document, 'script', 'facebook-jssdk' login: -> if !@fb_ alert 'Facebook API not ready yet. Click again please.' return @fb_.getLoginStatus (response) => if response.status == 'connected' @onConnected_() else if response.status == 'not_authorized' alert 'Please log into this app.' else alert 'Please log into Facebook.' ###* @private ### onConnected_: -> @fb_.api '/me', (response) => @userStore.loginFacebookUser response logout: -> # The FB.logout log the person out of Facebook, which is not we want. @userStore.logout() #= require_self #= require_tree . window.Neighborly = configs: turbolinks: true pjax: false respond_with: 'Create': 'New' 'Update': 'Edit' modules: -> [] initPage: -> that = this unless window.Turbolinks is undefined $(document).bind "page:fetch", -> that.Loading.show() $(document).bind "page:restore", -> that.Loading.hide() $(document).bind "page:change", -> $(window).scrollTop(0) try FB.XFBML.parse() try twttr.widgets.load() init: -> $(document).foundation('reveal', {animation: 'fadeAndPop', animationSpeed: 100}) $(document).foundation() $.pjax.defaults.scrollTo = false if $.pjax.defaults? $.pjax.defaults.timeout = false if $.pjax.defaults? $('.button.disabled').click -> return false $('.top-bar .search-button').click -> if $('.discover-form-input').val() != '' $('form.discover-form').submit() else $('.discover-form-input').toggleClass('show').focus() return false Loading: show: -> $('#loading').addClass('show') hide: -> $('#loading').removeClass('show') "*": core: themes: [ "one-light-ui" "solarized-dark-syntax" ] editor: fontSize: 15 "exception-reporting": userId: "76d6bd0a-16fd-42b8-0163-bce5c8c7e379" welcome: showOnStartup: false Backbone = require 'backbone' Promise = require 'bluebird-q' { API_URL } = require('sharify').data Channel = require '../../../../models/channel.coffee' mediator = require '../../../../lib/mediator.coffee' module.exports = class ConnectCreateView extends Backbone.View className: 'Connect__create' events: click: 'create' initialize: ({ @connectable, @state }) -> @listenTo @state, 'change:query', @render create: (e) -> e.preventDefault() e.stopPropagation() @$el.text 'Creating' title = @state.get 'query' channel = new Channel title: title status: 'private' channel.url = "#{API_URL}/channels" Promise(channel.save()) .then => @$el.text 'Connecting' @connect channel .then => @render() channel.set "selected:#{@connectable.get 'base_class'}:#{@connectable.id}", true @collection.unshift channel .catch => @$el.text 'Error' connect: (channel) -> Promise $.ajax type: 'POST' url: "#{API_URL}/channels/#{channel.id}/connections" data: connectable_id: @connectable.id connectable_type: @connectable.get('base_class') .then => mediator.shared.recent_connections.shove channel mediator.trigger "connection:added:#{@connectable.id}", channel mediator.trigger 'connection:added', channel render: -> @$el.text "+ New private channel “#{@state.get('query')}”" this module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') meta: banner: '/*! <%= pkg.name %> <%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n' coffee: compile: expand: true cwd: 'coffee/' src: ['**/*.coffee'] dest: 'js/' ext: '.js' uglify: options: banner: '<%= meta.banner %>' dist: files: 'js/uTip.min.js': ['js/uTip.js'] watch: files: 'src/**/*.coffee' tasks: ['compile'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.registerTask 'compile', ['coffee', 'uglify'] grunt.registerTask 'default', ['compile', 'watch'] {View} = require 'atom' # View to show the grammar name in the status bar. module.exports = class GrammarStatusView extends View @content: -> @div class: 'grammar-status', => @a href: '#', class: 'inline-block', outlet: 'grammarLink' initialize: (@statusBar) -> @subscribe @statusBar, 'active-buffer-changed', => @updateGrammarText() @subscribe atom.workspace.eachEditor (editor) => @subscribe editor, 'grammar-changed', => @updateGrammarText() if editor is atom.workspace.getActiveEditor() atom.config.observe 'grammar-selector.showOnRightSideOfStatusBar', => @attach() @subscribe this, 'click', -> atom.workspaceView.trigger('grammar-selector:show') false attach: -> if atom.config.get 'grammar-selector.showOnRightSideOfStatusBar' @statusBar.prependRight(this) else @statusBar.appendLeft(this) afterAttach: -> @updateGrammarText() updateGrammarText: -> grammar = atom.workspace.getActiveEditor()?.getGrammar?() if grammar? if grammar is atom.syntax.nullGrammar grammarName = 'Plain Text' else grammarName = grammar.name ? grammar.scopeName @grammarLink.element.textContent = grammarName @grammarLink.element.dataset.grammar = grammarName @element.style.display = '' else @element.style.display = 'none' #= require routes/map.route Wheelmap.PopupRoute = Wheelmap.MapRoute.extend model: (params)-> @get('store').find('node', params.node_id) setupController: (controller, model, queryParams)-> @_super(controller, model, queryParams) @controllerFor('map').set('poppingNode', controller) renderTemplate: (controller, model)-> @render 'node-popup', outlet: 'popup', controller: controllerReact = require 'react' ReactDOM = {render} = require 'react-dom' {Router, Route, Link} = require 'react-router' {useBasename} = require 'history' createBrowserHistory = require 'history/lib/createBrowserHistory' routes = require './router' # IE, oh my god: location.origin ?= location.protocol + "//" + location.hostname + if location.port then ':' + location.port else '' document.baseURI ?= location.origin + document.querySelector('base').getAttribute('href') if location?.hash?.indexOf('/') is 1 location.replace location.hash.slice 1 basename = document.baseURI.slice(location.origin.length) history = useBasename(createBrowserHistory)({basename}) history.listen -> window.dispatchEvent new CustomEvent 'locationchange' render {routes}, document.getElementById('panoptes-main-container') logDeployedCommit = require './lib/log-deployed-commit' logDeployedCommit() # For console access: window?.zooAPI = require 'panoptes-client/lib/api-client' window.ReactFeedSelection = React.createClass displayName: 'ReactFeedSelection' mixins: [UpdateOnSignInOrOutMixin] getInitialState: -> feedChoice: 'global' feeds: global: new GlobalFeedActivities personal: new PersonalFeedActivities _handleFeedChoiceChange: (e) -> if(e.target.checked) @setState feedChoice: e.target.value render: -> _div [], if currentSession.signedIn() _div ['feed-selection-row'], _input [ 'radio-toggle-button', type: 'radio', name: 'FeedChoice', value: 'global', id: 'FeedChoice_Global', onChange: @_handleFeedChoiceChange, checked: @state.feedChoice=='global' ] _label [ htmlFor: 'FeedChoice_Global' ], 'Global' _input [ 'radio-toggle-button', type: 'radio', name: 'FeedChoice', value: 'personal', id: 'FeedChoice_Personal', onChange: @_handleFeedChoiceChange, checked: @state.feedChoice=='personal' ] _label [ htmlFor: 'FeedChoice_Personal' ], 'Personal' _div ['feed-selection-install-extension-button'], ReactInstallExtensionOrBookmarklet() ReactFeedActivitiesAutoLoading model: @state.feeds[@state.feedChoice] key: @state.feedChoice [ { title: "@Atom Theme" paths: [ "/Users/johngardner/Labs/Atom-PhoenixTheme" ] devMode: true } { title: ".files" paths: [ "/Users/johngardner/.files" ] devMode: true } { title: "language-roff" paths: [ "/Users/johngardner/Labs/language-roff" ] devMode: true } { title: "file-icons" paths: [ "/Users/johngardner/Labs/file-icons" ] devMode: true } { title: "Atom-FS" paths: [ "/Users/johngardner/Labs/Atom-FS" "/Users/johngardner/Labs/Utils" ] devMode: true } { title: "Utils" paths: [ "/Users/johngardner/Labs/Utils" ] devMode: true } { title: "GNU Groff" paths: [ "/Users/johngardner/Mirrors/GNU-Groff" "/usr/local/share/groff/current/font" ] devMode: true } ] Player = require './Player' TextInput = require './TextInput' class Game constructor: (game) -> @textBox = new TextInput(game) @player = new Player(game) window.Game = @ @socket = io.connect('http://localhost:8080', {secure: true}) @socket.emit 'new player', 'name' @socket.on 'snap', (data) => # update appropriate word for snap @player.addPoints(data.d_score) console.log data.d_score console.log "total points: #{@player.points}" $.notify "Snap! on #{data.word}" $.notify "You have #{@player.points} points", "info" create: -> sendWord: (word) -> console.log word @socket.emit 'new word', word module.exports = Game cozydb = require 'cozydb' module.exports = Contact = cozydb.getModel 'Contact', fn : String n : String datapoints : [Object] revision : String note : String tags : [String] accounts : String title : String org : String bday : String url : String initials : String sortedName : String ref : String _attachments : Object Contact::asNameAndEmails = -> name = @fn or @n?.split(';')[0..1].join ' ' emails = @datapoints?.filter (dp) -> dp.name is 'email' # XXX What if several Cozy instances are linked to one user? cozy = dp.value for dp in @datapoints when (dp.name is 'other' and dp.type is 'COZY') or (dp.name is 'url' and dp.mediatype.search 'cozy' isnt -1) return simple = id : @id name : name or '?' emails : emails or [] hasPicture : @_attachments?.picture? cozy : cozy or null Marbles.Views.PermissionsFieldsToggle = class PermissionsFieldsToggleView extends TentStatus.View @template_name: 'permissions_fields_toggle' @view_name: 'permissions_fields_toggle' constructor: -> super @once 'ready', => setImmediate @bindEvents @render() context: (permissions = { public: true }) => _.extend super, permissions: permissions permissionsFieldsView: => _.last(@parentView()?.childViews('PermissionsFields') || []) bindEvents: => permissions_fields_view = @permissionsFieldsView() return unless permissions_fields_view permissions_fields_view.on 'change:options', => permissions = permissions_fields_view.buildPermissions() @render(@context(permissions)) @text ?= {} @text.visibility_toggle = { show: Marbles.DOM.attr(@el, 'data-show-text') hide: Marbles.DOM.attr(@el, 'data-hide-text') } Marbles.DOM.on @el, 'click', (e) => e.stopPropagation() @toggleVisibility() toggleVisibility: => if @visible @hide() else @show() hide: => @visible = false @permissionsFieldsView()?.hide() #Marbles.DOM.setInnerText(@el, @text.visibility_toggle.show) show: (should_focus = true) => @visible = true @permissionsFieldsView()?.show() #Marbles.DOM.setInnerText(@el, @text.visibility_toggle.hide) uploadcare.whenReady -> { jQuery: $ } = uploadcare dataAttr = 'uploadcareWidget' uploadcare.initialize = (targets) -> for target in $(targets || '@uploadcare-uploader') el = $(target) initializeWidget(el) return initializeWidget = (el) -> widget = el.data(dataAttr) if !widget || el[0] != widget.element[0] cleanup(el) widget = new uploadcare.widget.Widget(el) el.data(dataAttr, widget) widget.template.content.data(dataAttr, widget.template) widget # FIXME Supposed to be API wrapper cleanup = (el) -> el.off('.uploadcare') el = el.next('.uploadcare-widget') template = el.data(dataAttr) if el.length && (!template || el[0] != template.content[0]) el.remove() if uploadcare.defaults.live live = -> uploadcare.initialize() setTimeout(live, 100) $(live) else $ -> uploadcare.initialize() fs = require 'fs' path = require 'path' CSON = require 'cson' postcss = require 'postcss' namespace = postcss.plugin 'postcss-namespace', (opts) -> if not opts? opts = {token: '-'} (css) -> ref = null css.walkRules (rule) -> if /^&/.test rule.selector rule.selector = rule.selector.replace /&/, ref else ref = rule.selector module.exports = namespace define [ "base" ], (App) -> mathjaxConfig = messageStyle: "none" imageFont:null "HTML-CSS": { availableFonts: ["TeX"] }, TeX: equationNumbers: { autoNumber: "AMS" }, useLabelIDs: false tex2jax: inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true skipStartupTypeset: true MathJax?.Hub?.Config(mathjaxConfig); App.directive "mathjax", () -> return { link: (scope, element, attrs) -> setTimeout () -> MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)]) , 0 }class @ProtectedAreaMap constructor: ($container) -> @map = L.map($container.attr('id'), {zoomControl: false, scrollWheelZoom: false}) L.tileLayer('http://api.tiles.mapbox.com/v3/unepwcmc.ijh17499/{z}/{x}/{y}.png').addTo(@map) L.tileLayer('http://carbon-tool.cartodb.com/tiles/wdpa_poly_feb2014_0/{z}/{x}/{y}.png').addTo(@map) fitToBounds: (bounds, withPadding) -> opts = {} if withPadding? padding = @calculatePadding() opts.paddingTopLeft = padding.topLeft opts.paddingBottomRight = padding.bottomRight @map.fitBounds(bounds, opts) setZoomControl: (position) -> @map.addControl(L.control.zoom(position: position)) locate: -> @map.locate(setView: true) calculatePadding: -> mapSize = @map.getSize() paddingLeft = mapSize.x/5 {topLeft: [paddingLeft, 50], bottomRight: [0, 50]} path = require('path') gulp = require('gulp') mocha = require('gulp-mocha') coffeelint = require('gulp-coffeelint') mochaNotifierReporter = require('mocha-notifier-reporter') OPTIONS = config: coffeelint: path.join(__dirname, 'coffeelint.json') files: coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ] tests: 'lib/**/*.spec.coffee' gulp.task 'test', -> gulp.src(OPTIONS.files.tests, read: false) .pipe(mocha({ reporter: mochaNotifierReporter.decorate('list') })) gulp.task 'lint', -> gulp.src(OPTIONS.files.coffee) .pipe(coffeelint({ optFile: OPTIONS.config.coffeelint })) .pipe(coffeelint.reporter()) gulp.task 'watch', [ 'test', 'lint' ], -> gulp.watch(OPTIONS.files.tests, [ 'test' ]) gulp.watch(OPTIONS.files.coffee, [ 'lint' ]) colors = require('colors') url = require('url') http = require('http') Proxy = require('http-proxy') start = (config) -> match = (url, route) -> new RegExp(route).test(url) debug = (args...) -> if config.debug console.log args... getTarget = (req) -> debug "Proxying request to #{ req.url }" for path, dest of config.routes debug "Trying #{ path }" if match(req.url, path) debug "#{ path } matches, sending to #{ dest }".green return dest debug "No match!".red parseTarget = (dest) -> parts = url.parse(dest) return { host: parts.hostname port: parts.port path: parts.path } server = Proxy.createServer (req, res, proxy) -> target = getTarget(req) unless target res.writeHead(404) res.end("Proxying target not found") return target = parseTarget(target) unless target.path[target.path.length - 1] == '/' req.url = target.path proxy.proxyRequest req, res, target server.listen(config.port) module.exports = {start} exports.config = paths: public: '../SingularityService/src/main/resources/static' files: javascripts: defaultExtension: 'coffee' joinTo: 'static/js/app.js': /^app/ 'static/js/vendor.js': /^vendor/ order: before: [ 'vendor/scripts/log.coffee' 'vendor/scripts/parseDec.coffee' 'vendor/scripts/modernizr.custom-2.6.2.js' 'vendor/scripts/jquery-1.10.2.js' 'vendor/scripts/jquery.cookie-1.1.js' 'vendor/scripts/jquery.mousewheel-3.0.6.js' 'vendor/scripts/jquery.swipe-1.1.0.js' 'vendor/scripts/underscore-1.5.1.js' 'vendor/scripts/underscore.string-2.3.0.js' 'vendor/scripts/backbone-1.0.0.js' 'vendor/scripts/moment-2.1.0.js' ] stylesheets: defaultExtension: 'styl' joinTo: 'static/css/app.css' templates: defaultExtension: 'hbs' joinTo: 'static/js/app.js' server: base: '/singularity' CI.Browser or= {} CI.Browser.scroll_to = (position) => element = if jQuery.browser.webkit then "body" else "html" offset = if position == "top" then 0 else document.body.offsetHeight # Scrolling instantly is actually a smoother experience than # incorporating a delay. When the animation takes some time to run the # page jumps unpleasantly when new content is added. # Delays also fight the user if they try to scroll up at the same time # the animation is scrolling down. $(element).animate({scrollTop: offset}, 0) define [ ], () -> AUTOMATIC_REFRESH_PERIOD = 1000 * 60 * 10 class LabelsManager constructor: (@ide, @$scope) -> @$scope.$root._labels = this @state = documents: {} # map of DocId => List[Label] @loadLabelsTimeout = null @periodicLoadInterval = null setTimeout( () => # set up a regular re-load setTimeout( () => @periodicLoadInterval = setInterval( () => @loadLabelsFromOpenDoc() , AUTOMATIC_REFRESH_PERIOD ) , AUTOMATIC_REFRESH_PERIOD ) # listen for document open @$scope.$on 'document:opened', (e, doc) => setTimeout( () => @scheduleLoadLabelsFromOpenDoc() , 1000 ) , 0 ) loadLabelsFromOpenDoc: () -> docId = @ide.editorManager.getCurrentDocId() docText = @ide.editorManager.getCurrentDocValue() labels = [] re = /\\label{(.*)}/g while labelMatch = re.exec(docText) if labelMatch[1] labels.push(labelMatch[1]) @state.documents[docId] = labels scheduleLoadLabelsFromOpenDoc: () -> if @loadLabelsTimeout clearTimeout(@loadLabelsTimeout) @loadLabelsTimeout = setTimeout( () => @loadLabelsFromOpenDoc() , 1000 , this ) getAllLabels: () -> _.flatten(labels for docId, labels of @state.documents) _ = require 'lodash' expect = chai.expect React = require 'react/addons' ReactTestUtils = React.addons.TestUtils {Promise} = require 'es6-promise' {commonActions} = require './utilities' sandbox = null Wrapper = React.createClass render: -> React.createElement(@props._wrapped_component, _.extend(_.omit(@props, '_wrapped_component', 'children'), ref: 'element') @props.children ) Testing = { renderComponent: (component, options = {}) -> options.props ||= {} unmountAfter = options.unmountAfter or 1 root = document.createElement('div') promise = new Promise( (resolve, reject) -> props = _.clone(options.props) props._wrapped_component = component wrapper = React.render( React.createElement(Wrapper, props), root ) resolve({ root, wrapper, element: wrapper.refs.element, dom: React.findDOMNode(wrapper.refs.element) }) ) # defer adding the then callback so it'll be called after whatever is attached after the return _.defer -> promise.then -> _.delay( -> React.unmountComponentAtNode(root) , unmountAfter ) return arguments promise actions: commonActions } module.exports = {Testing, expect, sinon, React, _, ReactTestUtils} nconf = require("nconf") nconf.env().argv() # Add config file nconf.file(file: nconf.get("config")) Base = require('./src/base') newsroom = new Base nconf.get("newsroom") {Disposable, CompositeDisposable} = require 'atom' ViewURI = 'atom://deprecation-cop' DeprecationCopView = null module.exports = disposables: null activate: -> @disposables = new CompositeDisposable @disposables.add atom.workspace.addOpener (uri) => @deserializeDeprecationCopView({uri}) if uri is ViewURI @disposables.add atom.commands.add 'atom-workspace', 'deprecation-cop:view', -> atom.workspace.open(ViewURI) deactivate: -> @disposables.dispose() if pane = atom.workspace.paneForURI(ViewURI) pane.destroyItem(pane.itemForURI(ViewURI)) deserializeDeprecationCopView: (state) -> DeprecationCopView ?= require './deprecation-cop-view' new DeprecationCopView(state) consumeStatusBar: (statusBar) -> if atom.inDevMode() DeprecationCopStatusBarView = require './deprecation-cop-status-bar-view' statusBarView = new DeprecationCopStatusBarView() statusBarTile = statusBar.addRightTile(item: statusBarView, priority: 150) @disposables.add(new Disposable => statusBarView.destroy()) @disposables.add(new Disposable => statusBarTile.destroy()) jQuery.initializer '.edit_widget.map_search', -> oz = new OZ('oz_map_search') $form = $('form.widget_map_search') oz.api 'on_params_changed', (params) -> $('#widget_map_search_api_params').val(JSON.stringify(params)) $.post $form.attr('action'), $form.serialize(), (data) -> $('textarea#snippet').val(data.snippet) , "json" this.on 'change', 'input[type="checkbox"], input[type="text"]', -> $form.submit() jQuery.initializer '.edit_widget.direction', -> oz = new OZ('oz_direction') $form = $('form.widget_direction') oz.api 'on_params_changed', (params) -> $('#widget_direction_params').val(JSON.stringify(params)) $.post $form.attr('action'), $form.serialize(), (data) -> $('textarea#snippet').val(data.snippet) , "json" class App.Log _instance = undefined @log: ( module, level, args... ) -> if _instance == undefined _instance ?= new _Singleton _instance.log( module, level, args ) @debug: ( module, level, args... ) -> if _instance == undefined _instance ?= new _Singleton _instance.log( module, level, args ) class _Singleton constructor: -> @config = {} # Session: true # ControllerForm: true log: ( module, level, args ) -> if !@config || level isnt 'debug' @_log( module, level, args ) else if @config[ module ] @_log( module, level, args ) _log: ( module, level, args ) -> return if !console return if !console.log console.log "App.#{module}(#{level})", args '.editor': 'ctrl-m': 'bracket-matcher:go-to-matching-bracket' 'ctrl-]': 'bracket-matcher:remove-brackets-from-selection' '.platform-darwin .editor': 'ctrl-cmd-m': 'bracket-matcher:select-inside-brackets' 'alt-cmd-.': 'bracket-matcher:close-tag' '.platform-linux .editor': 'alt-ctrl-.': 'bracket-matcher:close-tag' '.platform-win32 .editor': 'alt-ctrl-.': 'bracket-matcher:close-tag' FactlinkJailRoot.on 'modalOpened', -> document.documentElement.setAttribute('data-factlink-suppress-scrolling', '') FactlinkJailRoot.on 'modalClosed', -> document.documentElement.removeAttribute('data-factlink-suppress-scrolling') 'use strict' ###* # @ngdoc service # @name arashike-blog.githubshareddata # @description # # githubshareddata # Service in the arashike-blog. ### angular.module 'arashike-blog' .service 'sharedDataService', -> gists = [] return { gists: gists } $(document).ready -> opts = lines: 11 length: 2 width: 3 radius: 9 corners: 1 rotate: 0 color: '#fff' speed: 0.8 trail: 48 shadow: false hwaccel: true className: 'spinner' zIndex: 2e9 top: 'auto' left: 'auto' target = document.getElementById("spinner") $(document).ajaxStart -> $("#progress").fadeIn() spinner = new Spinner(opts).spin(target) $(document).ajaxStop -> $("#progress").fadeOut() window.emojify = -> $(".js-emoji").each -> $(@).html(emojione.toImage($(@).text())) $ -> emojify() _ = require 'underscore' BufferedProcess = require 'buffered-process' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['--list', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0 args.unshift('--follow') paths = [] exit = => @callback(paths) stdout = (data) -> paths.push(_.compact(data.split('\n'))...) @process = new BufferedProcess({command, args, stdout, exit}) abort: -> if @process? @process.kill() @process = null packages: [ "autocomplete-emojis" "editorconfig" "file-icons" "highlight-selected" "linter" "linter-coffeelint" "linter-csslint" "linter-flake8" "linter-htmlhint" "linter-js-yaml" "linter-jshint" "linter-jsonlint" "linter-less" "linter-php" "linter-scss-lint" "linter-shellcheck" "linter-write-good" "linter-xmllint" "minimap" "omni-ruler" "package-sync" "pigments" "platformio-ide-terminal" "pretty-json" "sort-lines" ] VoteButton = require './VoteButton.coffee' init = (el)-> $feeds = $(el) $btnReload = $('#btn-reload-feeds') $tipLoading = $('#feeds-loading-tip') $tipLoaded = $('#feeds-loaded-tip') pages = parseInt $feeds.data('pages') loading = false page = 1 load = ()-> loading = true $.ajax data: page: page target: el success: (html)-> $tipLoading.before html VoteButton.init el if page >= pages $tipLoading.hide() $tipLoaded.show() else $tipLoaded.hide() setTimeout ()-> loading = false , 1000 error: (res)-> $tipLoading.addClass 'has-error' checkLoad = ()-> $last = $feeds.find('.feed').last() scrollTop = $(window).scrollTop() + $(window).height() if scrollTop < $last.offset().top - $last.height() * 2 return if loading or page >= pages return page += 1 load() if isNaN pages return console.error 'invalid data-pages attribute' VoteButton.init el $(window).on 'scroll', checkLoad $btnReload.on 'click', ()-> $tipLoading.removeClass 'has-error' load() checkLoad() module.exports = init: init define [ 'jquery' 'underscore' 'jade.templates' 'mixen' 'mixens/BaseViewMixen' 'mixens/ModelViewMixen' 'views/DonationFormView' 'vex' ], ($, _, jade, Mixen, BaseView, ModelView, DonationFormView, vex) -> class IndexStats extends Mixen(ModelView, BaseView) template: jade.indexStats events: 'click .donate-button': 'donate' render: => loadingContext = @getRenderContext() percent = (((@model.get('amountRaised') / 100) / 100000) * 100) or 0 percentWidth = if (percent > 100) then 100 else percent context = percentageWidth: percentWidth percentage: percent _.extend context, loadingContext _.extend context, @model.toJSON() @$el.html @template context @ donate: (event) => donationView = new DonationFormView parent: @ vex.defaultOptions.className = 'vex-theme-default' $vexContent = vex.open content: donationView.render().$el contentClassName: 'narrow padding-less' overlayClosesOnClick: false afterOpen: ($vexContent) -> $vexContent.append.$el @donateVexId = $vexContent.data().vex.id closeDonateVex: => vex.close(@donateVexId) {View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => @appendToEditorPane(rootView, editor) if editor.attached @appendToEditorPane: (rootView, editor) -> if underlayer = editor.find('.underlayer') underlayer.append(new WrapGuideView(editor)) @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) => @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', columnWidth).show() else @hide() else @hide() a = DS.attr ETahi.AdminJournal = DS.Model.extend logoUrl: a('string') name: a('string') paperTypes: a() taskTypes: a() manuscriptManagerTemplates: a('manuscriptManagerTemplate') roles: DS.hasMany('role') epubCoverUrl: a('string') epubCoverFileName: a('string') epubCss: a('string') pdfCss: a('string') manuscriptCss: a('string') description: a('string') paperCount: a('number') StatsTracker = require './stats-tracker' module.exports = stats: null editorStatsView: null activate: -> @stats = new StatsTracker() rootView.command 'editor-stats:toggle', => @createView().toggle(@stats) deactivate: -> @editorStatsView = null @stats = null createView: -> unless @editorStatsView EditorStatsView = require 'editor-stats/lib/editor-stats-view' @editorStatsView = new EditorStatsView() @editorStatsView Promise = require 'bluebird-q' { delay } = require 'underscore' Backbone = require 'backbone' template = -> require('./index.jade') arguments... module.exports = class NotificationsView extends Backbone.View events: 'click a': -> delay (=> @render()), 250 initialize: ({ @state }) -> @listenTo @collection, 'sync', @render @listenTo @state, 'change:unread_count', @render @listenTo @state, 'change:is_fetching', @render @$el .one 'mouseenter', => @state.set('is_fetching', true) Promise(@collection.fetch()) .then => @collection.clear() @state.set('is_fetching', false) .on 'mouseleave click', (e) => @collection.markRead() @state.set('unread_count', 0) render: -> @$el.html template feed: @collection unread_count: @state.get('unread_count') is_fetching: @state.get('is_fetching') this 'menu': [ 'label': 'Edit' 'submenu': [ 'label': 'Select Encoding' 'command': 'encoding-selector:show' ] ] #= require_tree ./vendors #= require_tree ./written/core #= require_tree ./written/extensions #= require_tree ./written/parsers Command = require 'command-interpreter/command' Range = require 'range' module.exports = class SelectAllMatches extends Command @regex: null constructor: (pattern) -> @regex = @regexForPattern(pattern) execute: (editor) -> rangesToSelect = [] for selection in editor.getSelections() selectedText = selection.getText() selectionStartIndex = editor.buffer.characterIndexForPosition(selection.getBufferRange().start) for range in @findMatchingRanges(editor, selectedText, selectionStartIndex) rangesToSelect.push(range) editor.clearSelections() editor.addSelectionForBufferRange(range) for range in rangesToSelect findMatchingRanges: (editor, text, startIndex) -> return [] unless match = text.match(@regex) matchStartIndex = startIndex + match.index matchEndIndex = matchStartIndex + match[0].length buffer = editor.buffer startPosition = buffer.positionForCharacterIndex(matchStartIndex) endPosition = buffer.positionForCharacterIndex(matchEndIndex) range = new Range(startPosition, endPosition) text = text[(match.index + match[0].length)..] startIndex = matchEndIndex [range].concat(@findMatchingRanges(editor, text, startIndex)) ETahi.ApplicationController = Ember.Controller.extend currentUser:(-> userId = Tahi.currentUser?.id.toString() @store.getById('user', userId) ).property().volatile() connectToES:(-> return unless Tahi.currentUser?.id store = @store params = url: '/event_stream' method: 'GET' success:(data)-> source = new EventSource(data.url) data.eventNames.forEach (eventName)-> source.addEventListener eventName, (msg)-> esData = JSON.parse(msg.data) Ember.run -> type = esData.type.replace(/.+::/, '') delete esData.type store.pushPayload(type, esData) Ember.$.ajax(params) ).on('init') overlayBackground: Ember.computed.defaultTo('defaultBackground') overlayRedirect: null defaultBackground: 'overlay_background' window.Cosmo = version: '0.1.0' # more # All apps should be an extended instance of this class class Cosmo.Router # app regions, assumes main content goes in a div#container regions: container: $('#container') initialize: -> # do initialization stuff and then start app routing # TODO: Do some url management start: -> @initialize() @go 'home' this # Takes an object with names and jquery selectors addRegions: (regions) -> for key, value of regions @regions[key] = $(value) this # set the value # TODO: Return value or this? (to allow chaining) set: (key, val) -> if val? this[key] = val else this[key] = null this get: (key) -> this[key] # main routing function go: (page, args...) -> if this[page]? this[page]?(args[0], args[1]) else @home() render: (view) -> @regions.container.html view # Facebook config exports.facebook = appId: null secretKey: null # Meetup config exports.meetup = null # API key as string #Eventbrite config exports.eventbrite = appKey: null exports.elasticsearch = host: 'localhost:9200' log: 'trace' apiVersion: '1.5'noflo = require 'noflo' require 'framerjs' createLayer = (properties) -> return new Layer properties exports.getComponent = -> component = new noflo.Component component.description = 'Set layer properties.' # component.icon = 'picture' # Add input ports component.inPorts.add 'in', datatype: 'object' description: 'The layer to set properties on.' process: (event, payload) -> # What to do when port receives a packet return unless event is 'data' component.layer = payload component.outPorts.layer.send payload component.inPorts.add 'properties', datatype: 'object' description: 'Properties to set on the layer.' process: (event, payload) -> # What to do when port receives a packet return unless event is 'data' component.layer[key] = value for key, value of payload component.outPorts.layer.send component.layer # Add output ports component.outPorts.add 'layer', datatype: 'object' description: 'The layer object passed as input.' component angular.module('loomioApp').factory 'KeyEventService', ($rootScope) -> new class KeyEventService keyboardShortcuts: 73: 'pressedI' 71: 'pressedG' 84: 'pressedT' 27: 'pressedEsc' 13: 'pressedEnter' 191: 'pressedSlash' 38: 'pressedUpArrow' 40: 'pressedDownArrow' broadcast: (event) -> key = @keyboardShortcuts[event.which] if key == 'pressedEnter' or (key and !event.ctrlKey and !event.metaKey) $rootScope.$broadcast key, event, angular.element(document.activeElement)[0] registerKeyEvent: (scope, eventCode, execute, shouldExecute) -> shouldExecute = shouldExecute or @defaultShouldExecute scope.$on eventCode, (angularEvent, originalEvent, active) -> if shouldExecute(active, originalEvent) angularEvent.preventDefault() and originalEvent.preventDefault() execute(active) defaultShouldExecute: (active = {}, event = {}) -> !event.ctrlKey and !event.altKey and !_.contains(['INPUT', 'TEXTAREA', 'SELECT'], active.nodeName) submitOnEnter: (scope) -> @registerKeyEvent scope, 'pressedEnter', scope.submit, (active, event) => (event.ctrlKey or event.metaKey) and angular.element(active).scope() == scope and _.contains(active.classList, 'lmo-primary-form-input') class window.ClientController constructor: (@annotatedSiteEnvoy) -> showFact: (fact_id) -> @_renderDiscussion new Fact id: fact_id showNewFact: (params={}) => fact = new Fact displaystring: params.displaystring url: params.url fact_title: params.fact_title if Factlink.Global.signed_in fact.save {}, success: => @annotatedSiteEnvoy 'highlightNewFactlink', params.displaystring, fact.id FactlinkApp.NotificationCenter.success "Added #{Factlink.Global.t.factlink}.", 'Undo', -> fact.destroy() @_renderDiscussion fact Backbone.history.navigate "/client/facts/#{fact.id}", trigger: false else view = new NewFactLoginView model: fact view.on 'render', => @annotatedSiteEnvoy 'openModalOverlay' clientModal = new DiscussionModalContainer FactlinkApp.discussionModalRegion.show clientModal clientModal.mainRegion.show view _renderDiscussion: (fact) -> fact.on 'destroy', => @annotatedSiteEnvoy 'closeModal_deleteFactlink', fact.id fact.fetch success: => newClientModal = new DiscussionModalContainer FactlinkApp.discussionModalRegion.show newClientModal view = new DiscussionView model: fact view.on 'render', => @annotatedSiteEnvoy 'openModalOverlay' newClientModal.mainRegion.show view module.exports = (grunt) -> grunt.initConfig clean: package: ['lib'] coffee: options: bare: true files: expand: true cwd: 'src' src: ['**/*.coffee'] dest: 'lib' ext: '.js' grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.registerTask 'default', [] # See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': '.overlayer': 'Enable decoration-example': 'decoration-example:toggle' 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'decoration-example' 'submenu': [ { 'label': 'Toggle', 'command': 'decoration-example:toggle' } ] ] } ] items = require("../build/liblol.js").items describe "items", -> describe "find", -> it "should return all items when nothing is passed to it", -> items.find().should.include item for item in items.list it "should throw an error if the filter isn't a function", -> try items.find "blah" catch e e.message.should.equal "Filter is not a function!" it "should return a blank array if the filter is never true", -> items.find(-> false).should.eql [] it "should throw an error if the comparator isn't a function", -> try items.find (-> false), "not a func" catch e e.message.should.equal "Comparator is not a function!" it "should sort if a comparator is given", -> # Put a filter to not have a huge eql filter = (item) -> item.name.substring(0, 1) is "A" comparator = (a, b) -> a.ap - b.ap # Ensure the sort is the same as the Array.sort items.find(filter).sort(comparator).should.eql items.find filter, comparator {Subscriber} = require 'emissary' {$, View} = require 'atom-space-pen-views' module.exports = class StatusView extends View Subscriber.includeInto(this) @content = (params) -> @div class: 'git-plus overlay from-bottom', => @div class: "#{params.type} message", params.message initialize: -> @subscribe $(window), 'core:cancel', => @detach() atom.workspace.addBottomPanel(item: this) setTimeout => @detach() , atom.config.get('git-plus.messageTimeout') * 1000 detach: -> super @unsubscribe() define [ 'spine' 'models/moves_path' 'models/simplifies_segments' 'models/link_shape' 'spine.relation' ], (Spine, MovesPath, SimplifiesSegments, LinkShape) -> class Link extends Spine.Model @configure "Link", "sourceId", "targetId", "segments", "shape" @belongsTo 'drawing', 'models/drawing' # TODO duplication with Node constructor: (attributes) -> super @k = v for k,v of attributes @updateSegments(attributes.segments) if attributes select: -> @drawing().select(@) updateSegments: (segments) => @segments = new SimplifiesSegments().for(segments) reconnectTo: (nodeId, offset) => mover = new MovesPath(@toPath(), offset) mover.moveStart() if nodeId is @sourceId mover.moveEnd() if nodeId is @targetId @updateSegments(mover.finalise()) @save() paperId: => "link" + @id toPath: => s = LinkShape.find(@shape) path = s.draw(@toSegments()) path.name = @paperId() path select: (layer) => layer.children[@paperId()].selected = true destroy: (options = {}) => destroyed = super(options) memento = sourceId: destroyed.sourceId targetId: destroyed.targetId segments: destroyed.segments shape: destroyed.shape toSegments: => for s in @segments new paper.Segment(s.point, s.handleIn, s.handleOut) Spine = require('spine') class Actions extends Spine.Controller elements: '.deal': 'deal_button' '.continue': 'continue_button' '.surrender': 'surrender_button' '.bet': 'bet_buttons' '.action': 'action_buttons' events: 'click .deal': 'deal' constructor: -> super Spine.bind 'result', @finished @setup() setup: => show @bet_buttons hide @action_buttons hide @continue_button deal: => hide @bet_buttons hide @deal_button show @action_buttons finished: => disable @action_buttons show @continue_button # Private hide = (selection) -> selection.hide() show = (selection) -> enable selection.show() disable = (selection) -> selection.attr('disabled', true) enable = (selection) -> selection.removeAttr('disabled') module.exports = Actions webpack = require 'webpack' LANGS = ['en_gb'] module.exports = resolve: # Add automatically the following extensions to required modules extensions: ['', '.coffee', '.cjsx', '.js'] plugins: [ new webpack.ContextReplacementPlugin /moment[\\\/]locale$/, new RegExp ".[\\\/](#{LANGS.join '|'})" ] devtool: if process.env.NODE_ENV isnt 'production' then 'eval' module: loaders: [ test: /\.cjsx$/ loader: 'coffee!cjsx' , test: /\.coffee$/ loader: 'coffee' , test: /\.(otf|eot|svg|ttf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/ loader: 'file' , test: /\.css$/ loader: 'style!css' , test: /\.sass$/ loader: 'style!css!sass?indentedSyntax' ] # ***** BEGIN LICENSE BLOCK ***** # Copyright (c) 2011-2012 VMware, Inc. # # For the license see COPYING. # ***** END LICENSE BLOCK ***** utils = require('./utils') transport = require('./transport') class EventSourceReceiver extends transport.ResponseReceiver protocol: "eventsource" doSendFrame: (payload) -> # Beware of leading whitespace data = ['data: ', utils.escape_selected(payload, '\r\n\x00'), '\r\n\r\n'] super(data.join('')) exports.app = eventsource: (req, res) -> if !req.headers['origin'] or req.headers['origin'] is 'null' origin = '*' else origin = req.headers['origin'] res.setHeader('Access-Control-Allow-Credentials', 'true') res.setHeader('Content-Type', 'text/event-stream; charset=UTF-8') res.setHeader('Access-Control-Allow-Origin', origin) res.setHeader('Vary', 'Origin') headers = req.headers['access-control-request-headers'] if headers res.setHeader('Access-Control-Allow-Headers', headers) res.writeHead(200) # Opera needs one more new line at the start. res.write('\r\n') transport.register(req, @, new EventSourceReceiver(req, res, @options)) return true # This module allows fetch to load local files from file:// # in node.js, electron and NW.js if window.process?.execPath req = eval 'require' fs = req 'fs' class Body constructor: (err, @buffer) -> @ok = not err @status = '' @statusText = err?.message # NOTE: We're returning a _node_ buffer, not an arrayBuffer # so we can handle byteOffsets in electron... arrayBuffer: -> Promise.resolve @buffer text: -> Promise.resolve @buffer.toString() json: -> Promise.resolve JSON.parse @buffer.toString() _fetch = window._native_fetch = window._native_fetch or fetch window.fetch = (uri) -> if /^(https?:)?\/\//.test uri _fetch.apply window, arguments else if /^file:\/\/\/[a-z]:/.test uri uri = uri[8...] else if /^file:\/\//.test uri uri = uri[7...] new Promise (resolve, reject) -> fs.readFile uri, (err, data) -> resolve(new Body(err, data)) class @PodsStore records: [] all: -> @records update: (new_records) -> @records = @records.concat(new_records) @writeObjects(new_records) writeObjects: (pods) -> r = indexedDB.open('pods', 1) r.onupgradeneeded = (e) -> db = event.target.result if !db.objectStoreNames.contains 'pods' store = db.createObjectStore 'pods', keyPath: 'name' store.createIndex "stars", "stars", unique: false r.onsuccess = (e) -> db = r.result t = db.transaction 'pods', 'readwrite' s = t.objectStore('pods') for pod in pods r = s.put(pod) TypeFactory = require '../../../../lib/type/factory' should = require 'should' describe 'TypeFactory#jsType', -> factory = new TypeFactory describe 'when used with a JS class', -> subject = factory.jsType(Number) subject.should.equal(Number) describe 'when used with a JS class name', -> subject = factory.jsType('Number') subject.should.equal(Number) mongoose = require 'mongoose' Settings = require 'settings-sharelatex' Schema = mongoose.Schema ObjectId = Schema.ObjectId THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30 ProjectInviteSchema = new Schema( { email: String token: String sendingUserId: ObjectId projectId: ObjectId privileges: String createdAt: {type: Date, default: Date.now, index: {expiresAfterSeconds: THIRTY_DAYS_IN_SECONDS}} }, { collection: 'projectInvites' } ) conn = mongoose.createConnection(Settings.mongo.url, server: poolSize: Settings.mongo.poolSize || 10) ProjectInvite = conn.model('ProjectInvite', ProjectInviteSchema) mongoose.model 'ProjectInvite', ProjectInviteSchema exports.ProjectInvite = ProjectInvite exports.ProjectInviteSchema = ProjectInviteSchema React = require 'react' NoExercises = React.createClass displayName: 'NoExercises' render: ->
    Sorry, there are no exercises for this module.
    CourseEnded = React.createClass displayName: 'NoExercises' render: ->
    Sorry, there are no exercises for this module.
    module.exports = no_exercises: NoExercises course_ended: CourseEnded # Created by AshGillman, 05/08/12 __ = require '../helpers' ScatterChart = require('../NvWrapper').ScatterChart DrawerBase = require '../DrawerBase' ScatterDrawer = class ScatterDrawer extends DrawerBase constructor: (@parent, sensor_metadata, @ts_params) -> super(@parent, sensor_metadata, @ts_params) do do @redraw # NOTE: returns a closure redraw: -> context = @ return -> for sensor in context.sensors context._bind_dataMgr_to_sensor sensor _draw_node_status: -> @chart ?= new ScatterChart @parent @plot_data ?= [{ key: 'Uncomfortable' values: [] }, { key: 'Indecisive' values: [] }, { key: 'Comfortable' values: [] }] console.log @sensors[2].properties.th_times.length, @sensors[2].properties.th_times for {properties} in @sensors if properties.comf_times.length > 0 and properties.th_times.length > 0 for comf, i in properties.comfortabilities time = properties.comf_times[i] th_index = properties.th_times.findIndex (d) -> d > time #console.log th_index if th_index >= 0 @plot_data[comf-1].values.push { x: properties.temperatures[th_index] y: properties.humidities[th_index] } @chart.updateChart @plot_data module.exports = ScatterDrawer # ************************************* # # Application # -> Manifest # # ************************************* # ------------------------------------- # Namespace # ------------------------------------- #= require presenter # ------------------------------------- # Routes # ------------------------------------- #= require routes # ------------------------------------- # Services # ------------------------------------- #= require services/progress #= require services/hotkeys # ------------------------------------- # Directives # ------------------------------------- #= require directives/progress #= require directives/slideLoader #= require directives/slides #= require directives/slide #= require directives/ytVideo # ------------------------------------- # Document Ready # ------------------------------------- jQuery ($) -> if window.location.hash is '' window.location = '/#/' Backbone.Factlink ||= {} class Backbone.Factlink.CrossFadeRegion extends Backbone.Marionette.Region fadeIn: -> @$el?.stop().hide().fadeIn(@_fadeTime()) fadeOut: (callback=->) -> @$el?.stop().fadeOut(@_fadeTime(), callback) crossFade: (newView) -> if @currentView @fadeOut => @show newView else @show(newView) open: (view) -> super(view) @fadeIn() resetFade: -> @fadeOut => @reset() _fadeTime: -> if @options?.fadeTime? @options.fadeTime else 560 onClose: -> @$el?.stop() define (require) -> $ = require('jquery') router = require('cs!router') analytics = require('cs!helpers/handlers/analytics') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./node-template') require('less!./node') return class TocNodeView extends BaseView template: template tagName: 'li' itemViewContainer: '.subcollection' events: 'click a': 'loadPage' initialize: () -> super() @listenTo(@model, 'change', @render) if @model loadPage: (e) -> e.preventDefault() $a = $(e.currentTarget) @model.setPage($a.data('page')) route = $a.attr('href') router.navigate(route) # Update browser URL to reflect the new route analytics.send() # Send the analytics information for the new route # Description # A hubot script to query Board Game Geek # # Configuration: # LIST_OF_ENV_VARS_TO_SET # # Commands: # hubot hello - # orly - # # Notes: # # # Author: # Bart Dorsey[@] options = timeout: 10000 retry: initial: 100 multiplier: 2 max: 15e3 bgg = require('bgg')(options) module.exports = (robot) -> robot.respond /bgg search (.*)$/, (msg) -> params = query: msg.match[1].replace(' ','+') type: 'boardgame' console.log params bgg('search', params) .then (results) -> if results.items.total > 0 items = results.items.item for item in items do (item) -> msg.send "" else msg.send "We couldn't find any boardgames matching \"#{msg.match[1]}\"" Game = @Game class Game.LocationGrid constructor: (settings) -> xs = @_coordList(settings.x) ys = @_coordList(settings.y) coords = [] for y in ys for x in xs coords.push { x, y } @freeCoords = _.shuffle coords _coordList: (listSettings) -> for i in [0...listSettings.steps] listSettings.start + (i * listSettings.stepSize) getLocation: -> @freeCoords.pop() $document = $(document) $document.on 'click.dropdown', '[data-toggle="collapse"]', (e)-> # Don't close dropdown when accordion togglers are clicked e.stopPropagation() $document.on 'click.dropdown', '[data-toggle="dropdown"]', (e)-> # Close all collapse elements, if dropdown was closed $parent = $(this).parent('.dropdown') unless $parent.hasClass('open') $parent.find('.collapse.in').collapse('hide').each -> # Must set this flag to false to don't stop collapse trigger next time $(this).data('collapse').transitioning = false# Load all required libraries. gulp = require 'gulp' gutil = require 'gulp-util' clean = require('gulp-clean') coffee = require 'gulp-coffee' coffeelint = require('gulp-coffeelint') istanbul = require 'gulp-istanbul' mocha = require 'gulp-mocha' gulp.task 'clean', -> gulp.src(['lib/**/*.js'], read: false).pipe(clean()) gulp.task 'coffee', -> gulp.src ['src/**/*.coffee'] .pipe coffee({bare: true}).on('error', gutil.log) .pipe gulp.dest 'lib' gulp.task 'lint', -> gulp.src 'src/**/*.coffee' .pipe coffeelint() .pipe coffeelint.reporter() gulp.task 'test', ['coffee', 'lint'], -> gulp.src ['lib/**/*.js'] .pipe istanbul() # Covering files .on 'finish', -> gulp.src ['spec/**/*.spec.coffee'] .pipe mocha reporter: 'spec', compilers: 'coffee:coffee-script' .pipe istanbul.writeReports() # Creating the reports after tests run gulp.task 'default', ['clean', 'coffee'] gulp.task 'build', ['lint', 'clean', 'coffee', 'test'] MinimapSelectionView = require './minimap-selection-view' module.exports = active: false views: {} activate: (state) -> minimapPackage = atom.packages.getLoadedPackage('minimap') return @deactivate() unless minimapPackage? @minimap = require minimapPackage.path @minimap.registerPlugin 'selection', this deactivate: -> @minimap.unregisterPlugin 'selection' @minimap = null isActive: -> @active activatePlugin: -> return if @active @active = true @subscription = @minimap.eachMinimapView ({view}) => selectionView = new MinimapSelectionView(view) selectionView.attach() @views[view.editor.id] = selectionView deactivatePlugin: -> view.destroy() for id,view of @views return unless @active @active = false @views = {} @subscription.off() $(document).on 'ready page:change', -> $('input[type=datetime]').prop('type','text').datetimepicker useSeconds: false sideBySide: false $('input[type=date]').prop('type','text').datetimepicker pickTime: false $('input.datetime').on 'dp.change', (event)-> hidden = $(event.target).next 'input[type=hidden]' hidden.val event.date.format 'YYYY-MM-DDTHH:mm' $('input.date').on 'dp.change', (event)-> hidden = $(event.target).next 'input[type=hidden]' hidden.val event.date.format 'YYYY-MM-DD' #= jquery/jquery marked = require 'marked' highlight = require '../highlight' # Initialize markdown marked.setOptions gfm: true module.exports = converters: markdown: priority: 2 matches: (ext) -> ext is '.md' or ext is '.markdown' outputExtension: (ext) -> '.html' convert: (content, callback) -> converted = marked content highlight.highlightCodeBlocks converted, callback define [ 'jquery' 'underscore' 'backbone' ], ($, _, Backbone) -> class Region constructor: (el, parent) -> @parent = parent @el = el show: (view) -> @close() @views = null @append(view) append: (view) -> @$el = @$el or @parent.$el.find(@el) view.parent = @parent @views ?= [] @views.push(view) view.setElement($('
    ').appendTo(@$el)).render() close: () -> _.each @views, (view) -> view.close() @$el?.empty() class Regions constructor: (regions, $context) -> _.each _.keys(regions), (region) => @[region] = new Region(regions[region], $context) return class BaseView extends Backbone.View initialize: () -> @_popovers = [] @regions = new Regions(@regions, @) render: () -> @$el.html(@template) return @ close: () -> _.each @regions, (region) -> region.close() @detachPopovers() @stopListening() @remove() @unbind() delete @[key] for key of @ return @ detachPopovers: () -> @_popovers.pop().close() while @_popovers?.length attachPopover: (popover) -> @_popovers.push popover {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers' $ = require 'jquery' describe 'API loader', -> beforeEach -> @jquery = ajax: sinon.spy -> d = $.Deferred() _.defer -> d.resolve({}) d.promise() delete require.cache[require.resolve('api')] delete require.cache[require.resolve('api/loader')] require.cache[require.resolve('jquery')].exports = @jquery @api = require 'api' @api.initialize('test/url') afterEach -> require.cache[require.resolve('jquery')].exports = $ # force require to re-parse the api file now that the stub's removed delete require.cache[require.resolve('api/loader')] it 'sets isPending', (done) -> expect(@api.isPending()).to.be.false @api.channel.emit('user.status.send.fetch', data: {}) _.delay( => expect(@jquery.ajax.callCount).equal(1) expect(@api.isPending()).to.be.true , 1) _.delay( => expect(@api.isPending()).to.be.false done() , 210) # longer than loader's isLocal delay it 'debounces calls to the same URL', -> for i in [1..10] @api.channel.emit('user.status.send.fetch', data: {}) _.delay => expect(@jquery.ajax.callCount).equal(1) #= require ./add_channel_to_channels_modal_view class window.AddChannelToChannelsButtonView extends Backbone.Marionette.Layout template: 'channels/add_channel_to_channels_button' events: "click .js-add-to-channel-button": "openAddToChannelModal" initialize: -> @collection = @model.getOwnContainingChannels(this) @bindTo @collection, "add remove reset", (channel) => @updateButton() onRender: -> @updateButton() updateButton: => added = @collection.length > 0 @$('.added-to-channel-button-label').toggle added @$('.add-to-channel-button-label').toggle not added openAddToChannelModal: (e) -> e.stopImmediatePropagation() e.preventDefault() FactlinkApp.Modal.show 'Add to Channels', new AddChannelToChannelsModalView model: @model, collection: @collection suggestions: @options.suggested_topics #!highlights/node_modules/coffee-script/bin/coffee Highlights = require 'highlights' fs = require 'fs' path = require 'path' highlighter = new Highlights() highlighter.requireGrammarsSync modulePath: require.resolve('./atom-language-perl6/package.json') stdin = process.openStdin() stdin.setEncoding 'utf8' mystderr = process.stderr mystdout = process.stdout process_file = (given_path) -> full_path = path.resolve given_path fs.readFile full_path, 'utf8', (read_err, file_str) -> if read_err console.error read_err else highlighter.highlight (fileContents: file_str, scopeName: 'source.perl6fe'), (hl_err, html) -> if hl_err console.error hl_err else obj = {} obj.file = full_path obj.html = html mystdout.write(JSON.stringify(obj) + '\n' ) stdin.on 'data', (input) -> process_file input.trim() getTextRange = -> doc = window.document if doc.getSelection doc.getSelection() else if doc.selection doc.selection.createRange().text else '' FactlinkJailRoot.createFactFromSelection = -> success = -> FactlinkJailRoot.createButton.hide() FactlinkJailRoot.off 'factlinkAdded', success selInfo = FactlinkJailRoot.getSelectionInfo() text = selInfo.text siteUrl = FactlinkJailRoot.siteUrl() siteTitle = selInfo.title guided = !!FactlinkConfig.guided FactlinkJailRoot.on 'factlinkAdded', success FactlinkJailRoot.factlinkCoreEnvoy 'prepareNewFactlink', text, siteUrl, siteTitle, guided # We make this a global function so it can be used for direct adding of facts # (Right click with chrome-extension) FactlinkJailRoot.getSelectionInfo = -> text: getTextRange().toString() title: window.document.title logger = require("logger-sharelatex") NotificationsHandler = require("./NotificationsHandler") module.exports = # Note: notification keys should be url-safe groupPlan: (user, licence)-> key : "join-sub-#{licence.subscription_id}" create: (callback = ->)-> messageOpts = groupName: licence.name subscription_id: licence.subscription_id logger.log user_id:user._id, key:key, "creating notification key for user" NotificationsHandler.createNotification user._id, @key, "notification_group_invite", messageOpts, null, callback read: (callback = ->)-> NotificationsHandler.markAsReadWithKey user._id, @key, callback projectInvite: (invite, project, sendingUser, user) -> key: "project-invite-#{invite._id}" create: (callback=()->) -> messageOpts = userName: sendingUser.first_name projectName: project.name projectId: project._id.toString() token: invite.token logger.log {user_id: user._id, project_id: project._id, invite_id: invite._id, key: @key}, "creating project invite notification for user" NotificationsHandler.createNotification user._id, @key, "notification_project_invite", messageOpts, invite.expires, callback read: (callback=()->) -> NotificationsHandler.markAsReadByKeyOnly @key, callback $ -> enableEditables() enableEditables = -> $('span.editable').editable (value, settings) -> $span = $(this) data = {_method: 'PUT'} data[$span.data('attribute')] = value # TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator. $.post($span.data('url'), data) value , tooltip: 'Click to edit' $('table.editable td').editable (value, settings) -> $td = $(this) $tr = $td.parent('tr') data = {_method: 'PUT', index: $td.index(), value: value} # NOTE: Index is 0-based. # TODO: We should handle failures and timeouts in POSTing, and make our own "Saving..." indicator. $.post($tr.data('url'), data, null, 'json') value , onblur: 'submit' window.enableEditables = enableEditables FactlinkJailRoot.showProxyMessage = -> content = """
    Factlink demo page
    • Get the extension to add discussions on every site
    • Or install Factlink on your own site
    """ frame = new FactlinkJailRoot.ControlIframe content frame.$el.css top: '10px' left: 'auto' right: '10px' position: 'fixed' frame.fadeIn() VisualizationBase = require './visualization-base.js' class Visualization extends VisualizationBase constructor: (_id) -> console.log 'Visualization' super _id resize: => # setup container height h = if $('body').hasClass('fullscreen') then $(window).height() else $(window).height() - 178 # -50-64-64 console.log 'resize', h @visualizationCanvas.$el.height h super() module.exports = VisualizationWheelmap = @Wheelmap Wheelmap.MapController = Ember.ArrayController.extend boundsRatioBuffer: 0.3 previousBounds: null center: null zoom: null startNode: null nodes: [] isLoading: false init: ()-> properties = center: new L.LatLng(52.50521, 13.4231) zoom: 12 if $.cookie('last_lat')? and $.cookie('last_lon')? properties.center = new L.LatLng($.cookie('last_lat'), $.cookie('last_lng')) if $.cookie('last_zoom')? properties.zoom = parseInt($.cookie('last_zoom'), 10) @setProperties(properties) mapChanged: (()-> center = @get('center') zoom = @get('zoom') $.cookie('last_lat', center.lat) $.cookie('last_lng', center.lng) $.cookie('last_zoom', zoom) ).observes('center', 'zoom') actions: zooming: (isZooming, bounds)-> if isZooming # Only reload when zooming is finished return @send('permalink') @send('updateNodes', bounds) moving: (isMoving, bounds)-> if isMoving # Only reload when moving is finished @previousBounds = bounds return @send('permalink') if @previousBounds? paddedBounds = @previousBounds.pad(@boundsRatioBuffer) if paddedBounds.contains(bounds) return @send('updateNodes', bounds)App.CurrentPaginatorPageView = Em.TextField.extend classNames: 'input-mini' # If we bind the value to the currentPageNo of the controller, it will # a page change for each key press, causing a page change for each # digit in a multi-digit page number. We don't want that, so we rather # initialize the value on didInsertElement and use the action event # (which is triggered on enter with the page number as argument) to update # the page numer in the controller. action: 'setCurrentPageNo' didInsertElement: -> @setValue() @$().on 'blur', $.proxy(@setValue, @) willDestroyElement: -> @$().off 'blur' setValue: -> @set('value', @get('controller.currentPageNo'))$ -> $owl = $(".chapter-projects") $owl.owlCarousel loop: false, nav: true, margin: 10, autoWidth: true, dotsContainer: ".owl-dots-wrapper #owl-dots", responsive: 0: {items: 2}, 600: {items: 2}, 960: {items: 2}, 1200: {items: 3}, $(".owl-wrapper .left").click (e)-> e.preventDefault() $owl.trigger("next.owl") $(".owl-wrapper .right").click (e)-> e.preventDefault() $owl.trigger("prev.owl") styleguideUri = 'atom://styleguide' createStyleguideView = (state) -> StyleguideView = require './styleguide-view' new StyleguideView(state) atom.deserializers.add name: 'StyleguideView' deserialize: (state) -> createStyleguideView(state) module.exports = activate: -> atom.workspace.addOpener (filePath) -> createStyleguideView(uri: styleguideUri) if filePath is styleguideUri @disposable = atom.commands.add 'atom-workspace', 'styleguide:show', -> atom.workspace.open(styleguideUri) deactivate: -> @disposable.dispose() #!highlights/node_modules/coffee-script/bin/coffee Highlights = require 'highlights' fs = require 'fs' path = require 'path' highlighter = new Highlights() highlighter.requireGrammarsSync modulePath: require.resolve('./atom-language-perl6/package.json') stdin = process.openStdin() stdin.setEncoding 'utf8' stdin.on 'data', (input) -> name = input.trim() process.exit() if name == 'exit' file_to_hl = path.resolve(name) process.stderr.write('HL') foo = -> fs.readFileSync file_to_hl, 'utf8' html = highlighter.highlightSync fileContents: foo() scopeName: 'source.perl6fe' console.log html class Cu.View.ViewTile extends Backbone.View className: 'view tile' tagName: 'a' attributes: -> href: "/dataset/#{@model.get('plugsInTo').get('box')}/view/#{@model.get 'box'}" events: 'click .hide': 'hideView' initialize: -> @model.on 'change', @render, this render: -> @$el.html JST['view-tile'] @model.toJSON() # :TODO: Make this suck less if /spreadsheet/i.test @model.get('name') @$el.addClass 'spreadsheet' if /download/i.test @model.get('name') @$el.addClass 'download' if /newdataset/i.test @model.get('name') @$el.addClass 'source' @ hideView: (e) -> e.preventDefault() e.stopPropagation() @$el.slideUp() @model.set 'state', 'deleted' @model.get('plugsInTo').save {}, error: (e) => @$el.slideDown() console.warn 'View could not be deleted!' QUnit.module "Batman.ModelTestCase", setup: -> @testCase = new Batman.ModelTestCase class @Foo extends Batman.Model @resourceName: 'foo' @validate 'title', presence: true @encode 'foo', 'bar' @encode 'baz', decode: false encode: (v) -> "!#{v}!" @foo = new @Foo @foo.set 'baz', 'baz' test 'assertValid asserts Batman Model is valid', -> @foo.set('title', 'foo') @testCase.assertValid @foo test 'assertNotValid asserts Batman Model is not valid', -> @testCase.assertNotValid @foo test 'assertDecoders asserts full decoder list matches', -> @testCase.assertDecoders @Foo, 'id', 'foo', 'bar' test 'assertEncoders asserts full encoder list matches', -> @testCase.assertEncoders @Foo, 'foo', 'bar', 'baz' test 'assertEncoded asserts expected value for custom encoders', -> @testCase.assertEncoded @foo, 'baz', '!baz!' test 'assertEncoded asserts function return value if expected value is a function', -> @testCase.assertEncoded @foo, 'baz', (baz) -> baz is '!baz!' React = require 'react' BS = require 'react-bootstrap' {TaskActions} = require '../../flux/task' {TaskStepActions, TaskStepStore} = require '../../flux/task-step' LoadableItem = require '../loadable-item' {CardBody} = require '../pinned-header-footer-card/sections' _ = require 'underscore' module.exports = getInitialState: -> classNames: ['task-step'] renderGenericFooter: -> buttonClasses = '-continue' buttonClasses += ' disabled' unless @isContinueEnabled() continueButton = Continue {continueButton} render: -> footer = @renderFooterButtons?() or @renderGenericFooter() {pinned} = @props {@renderBody()} {@renderGroup?()} componentDidMount: -> @setBannerClass() componentDidUpdate: -> @setBannerClass() # If the rendered content has a matching element that will be used as the banner, # add a "with-ui-banner" css class. This way the component can be styled to match setBannerClass: -> has_banner = _.contains(@state.classNames, "with-ui-banner") if not has_banner and this.getDOMNode().querySelector(":first-child[data-label]") @setState classNames: @state.classNames.concat ["with-ui-banner"] angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) -> service = current: {} findContent: (id) -> _service = @ deferred = $q.defer() $http.get "/api/pages/#{id}.json" .success (data) -> _service.current = data deferred.resolve "Success!" .error (data) -> deferred.reject data deferred.promise servicewindow.MandrillMerge or= {} class MandrillMergeApp constructor: -> @bindEvents() bindEvents: -> $('#hello-coffeescript').on('click', @greet) submit_my_form: (caller)-> caller.parent().prev('form').submit() go_back: (caller)-> alert 'watch this space' $ -> window.MandrillMerge.app = new MandrillMergeApp() # Module dependencies. models = require '../models' app = require('../app')(models.sequelize) http = require 'http' config = require '../config' # Event listener for HTTP server "error" event. onError = (error) -> if error.syscall != 'listen' throw error bind = if typeof port == 'string' then 'Pipe ' + port else 'Port ' + port # handle specific listen errors with friendly messages switch error.code when 'EACCES' console.error "#{bind} requires elevated privileges" process.exit 1 break when 'EADDRINUSE' console.error "#{bind} is already in use" process.exit 1 break else throw error # Event listener for HTTP server "listening" event. onListening = -> addr = server.address() bind = if typeof addr == 'string' then 'pipe ' + addr else 'port ' + addr.port console.log "Listening on #{bind}" # Create HTTP server. app.set 'port', config.port server = http.createServer app server.on 'error', onError server.on 'listening', onListening # Listen on provided port, on all network interfaces. models.sequelize.sync().then -> server.listen config.port App = require '../app' Book = require './model' App.PriceChartView = require './price-chart' # App.BookRoute = Ember.Route.extend # serialize: (model) -> # book_id: model._id App.BookController = Ember.ObjectController.extend deleteBook: -> title = @get('model').get('title') @get('model').one 'didDelete', => alert "#{title} deleted." @transitionToRoute 'books' @get('model').deleteRecord() @get('store').commit() module.exports = App.BookController'.platform-darwin, .platform-darwin .command-palette .editor': 'cmd-shift-p': 'command-palette:toggle' '.platform-win32, .platform-win32 .command-palette .editor': 'ctrl-shift-p': 'command-palette:toggle' '.platform-linux, .platform-linux .command-palette .editor': 'ctrl-shift-p': 'command-palette:toggle' require 'jquery.history.js' require 'jquery.paginator.js' describe "Paginator", -> beforeEach -> loadFixtures('paginator.html') $('#list').ajaxPaginator() describe 'clicking a link', -> link = null beforeEach -> link = $('.pagination a:first') link.click() it "calls the link via AJAX", -> expect(ajaxRequests).toHaveLength 1 expect(ajaxRequests[0].url).toEqual link[0].href it "fills the element with the response", -> request = mostRecentAjaxRequest() request.response status: 200, responseText: '

    Success!

    ' expect($('#list')).toHaveHtml request.responseText afterEach -> if history && history.pushState history.replaceState(null, null, '/') else location.hash = null Rahani.module 'Helpers', -> @pagination = (view, collection, selector = '.pager-region') -> @paginationView = new Rahani.Views.Application.Pagination collection: collection renderPagination = => view.$el.find(selector).html(@paginationView.render().el) view.on 'render', renderPagination @paginationView @App.factory 'MnoeApiSvc', ($log, Restangular, inflector) -> return Restangular.withConfig((RestangularProvider) -> RestangularProvider.setBaseUrl('/mnoe/jpi/v1') RestangularProvider.setDefaultHeaders({Accept: "application/json"}) # Unwrap api response RestangularProvider.addResponseInterceptor( (data, operation, what, url, response, deferred) -> extractedData = null if (operation == 'getList') extractedData = data[what] else if (operation == 'put' || operation == 'post') what = inflector.singularize(what) extractedData = data[what] else extractedData = data return extractedData ) ) extensionsByFenceName = 'bash': 'sh' 'coffee': 'coffee' 'coffeescript': 'coffee' 'coffee-script': 'coffee' 'css': 'css' 'go': 'go' 'java': 'java' 'javascript': 'js' 'js': 'js' 'json': 'json' 'less': 'less' 'mustache': 'mustache' 'python': 'py' 'rb': 'rb' 'ruby': 'rb' 'sh': 'sh' 'toml': 'toml' 'xml': 'xml' module.exports = extensionForFenceName: (fenceName) -> extensionsByFenceName[fenceName] class @ProjectShow constructor: -> $('.project-home-panel .star').on 'ajax:success', (e, data, status, xhr) -> $(@).toggleClass('on').find('.count').html(data.star_count) .on 'ajax:error', (e, xhr, status, error) -> new Flash('Star toggle failed. Try again later.', 'alert') $("a[data-toggle='tab']").on "shown.bs.tab", (e) -> $.cookie "default_view", $(e.target).attr("href"), { expires: 30 } defaultView = $.cookie("default_view") if defaultView $("a[href=" + defaultView + "]").tab "show" else $("a[data-toggle='tab']:first").tab "show" person = name: 'Alice' tryToSayHelloButFail: (delay) -> setTimeout (() -> console.log "Hi... from #{@name}"), delay sayHelloUsingAnExtraVariable: (delay) -> self = this setTimeout (() -> console.log "Hi from #{self.name}!"), delay sayHello: (delay) -> setTimeout (() => console.log "Hi from #{@name} :)"), delay person.tryToSayHelloButFail(1000) # Hi... from undefined person.sayHelloUsingAnExtraVariable(1000) # Hi from Alice! person.sayHello(1000) # Hi from Alice :) {_, Document} = require 'atom' SettingsView = null settingsView = null configUri = 'atom://config' createSettingsView = (state) -> SettingsView ?= require './settings-view' unless state instanceof Document state = _.extend({deserializer: deserializer.name, version: deserializer.version}, state) state = atom.site.createDocument(state) settingsView = new SettingsView(state) openPanel = (panelName) -> atom.rootView.open(configUri) settingsView.showPanel(panelName) deserializer = acceptsDocuments: true name: 'SettingsView' version: 1 deserialize: (state) -> createSettingsView(state) atom.deserializers.add(deserializer) module.exports = activate: -> project.registerOpener (filePath) -> createSettingsView({uri: configUri}) if filePath is configUri rootView.command 'settings-view:toggle', -> openPanel('General') rootView.command 'settings-view:show-keybindings', -> openPanel('Keybindings') rootView.command 'settings-view:change-themes', -> openPane('Themes') rootView.command 'settings-view:install-packages', -> openPanel('Packages') define [ './core' ], (c) -> class StateView extends c.Marionette.ItemView constructor: -> super if not @template? if @options.template @template = @options.template else html = [] if (icon = @options.icon or @icon) html.push icon if (message = @options.message or @message) html.push message @template = -> html.join ' ' class EmptyView extends StateView className: 'empty-view' icon: '' message: 'Move along. Nothing to see here...' class ErrorView extends StateView className: 'error-view' icon: '' message: 'Something went awry..' class LoadView extends c.Marionette.ItemView className: 'load-view' icon: '' message: 'Loading...' { EmptyView, ErrorView, LoadView } Dashboard.SearchTab = Ember.View.extend type: 'view' templateName: 'search-tab' routeName: '' tagName: '' routeParams: (-> @get('controller.searchRouteParams') ).property('controller.searchRouteParams') hasSearch: (-> hasSearch = false $.map @get('controller.search'), (value)=> if value != null hasSearch = true return hasSearch ).property('controller.search') mongoose = require 'mongoose' Schema = mongoose.Schema RemodelItemRecord = new Schema successful: Boolean itemId: Number itemLevel: Number flagshipId: Number flagshipLevel: Number flagshipCond: Number consortId: Number consortLevel: Number consortCond: Number teitokuLv: Number RemodelItemRecord.virtual('date').get -> this._id.getTimestamp() mongoose.model 'RemodelItemRecord', RemodelItemRecord # Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it here: # https://github.com/bevry/cson#what-is-cson '.source.js': 'Mocha Describe': 'prefix': 'des' 'body': 'describe(\'$1\', () => {\n $2\n});' 'Mocha Context': 'prefix': 'ctx' 'body': 'context(\'$1\', () => {\n $2\n});' 'Mocha It': 'prefix': 'it' 'body': 'it(\'$1\', () => {\n $2\n});' 'Mocha beforeEach': 'prefix': 'bef' 'body': 'beforeEach((${1:done}) => {\n $2\n});' 'Mocha afterEach': 'prefix': 'aft' 'body': 'afterEach((${1:done}) => {\n $2\n});' {existsSync} = require './utils' {join} = require 'path' settingsPath = join process.env.HOME, '.config', '/au' if existsSync settingsPath settings = require settingsPath or {} program = require('commander') .version(require('../package.json').version) help = -> console.log program.helpInformation() program .command('new [name]') .description('create a new app and/or extension') .usage('[name] [options]') .option('-t, --template [name]', 'template to use') .option('-c, --config [config file]', 'config file to use') .action (name, opts={}) -> if not name return console.log 'Name of project required' require('./generator') name, opts program .command('watch [name]') .description('watch for changes and reload') .action (opts={}) -> require('./watch') opts program .command('install') .description('install an app or extension') .option('-b, --browser [location]', 'Path to browser to use') .action (opts={}) -> switch process.platform when 'darwin' {exec} = require 'child_process' browser = opts.browser or 'Google\\ Chrome' exec "pkill #{browser}" cb = -> exec "open -a #{browser} --args --load-extension=#{process.cwd()}" setTimeout cb, 500 else console.log 'Unable to install extensions on your platform' program.parse process.argv help() unless program.args.length Page = require 'controllers/page' class GuidePage extends Page el: $('.guide') className: 'guide' events: 'click .menu li' : 'show' active: -> super @el.scroll() # trick lazyload show: (e) => target = e.currentTarget $(target).addClass('show').siblings('li').removeClass('show') $('section[data-type="' + target.dataset.type + '"]').addClass('show').siblings('section').removeClass('show') @el.scroll() # trick lazyload module.exports = GuidePagePath = require "path" module.exports = # Options are passed to Sequelize. # See http://sequelizejs.com/documentation#usage-options for details mysql: clsi: database: "clsi" username: "clsi" password: null dialect: "sqlite" storage: Path.resolve(__dirname + "/../db.sqlite") path: compilesDir: Path.resolve(__dirname + "/../compiles") clsiCacheDir: Path.resolve(__dirname + "/../cache") synctexBaseDir: (project_id) -> Path.join(@compilesDir, project_id) internal: clsi: port: 3013 host: "localhost" apis: clsi: url: "http://localhost:3013" # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ window.onload = -> btn = undefined modal = undefined span = undefined modal = document.getElementById('modalcontainer') btn = document.getElementById('openmodal') span = document.getElementsByClassName('close')[0] btn.onclick = -> modal.style.display = 'block' return span.onclick = -> modal.style.display = 'none' return window.onclick = (event) -> if event.target == modal modal.style.display = 'none' return return # Description: # Create a party when a new user appear # # Dependencies: # None # # Configuration: # None # # Commands: # new user - Create a party when a new user appear # # Author: # PiXeL16 messages = [ "A new user hooray!! :tada::tada::smile::tada::tada:", "A new user eeeehhh!! :confetti_ball::tada::smile::tada::confetti_ball:", "Its a new user, yes!! :tada::tada::metal::tada::tada:", "A new user appeared in the Wild :tada::poke::hatching_chick::tada:", ] module.exports = (robot) -> robot.catchAll (msg) -> if msg.message.match /new user/i msg.send msg.random messages class @calendar options = month: "short" day: "numeric" year: "numeric" constructor: (timestamps, starting_year, starting_month) -> cal = new CalHeatMap() cal.init itemName: ["commit"] data: timestamps start: new Date(starting_year, starting_month) domainLabelFormat: "%b" id: "cal-heatmap" domain: "month" subDomain: "day" range: 12 tooltip: true domainDynamicDimension: false colLimit: 4 label: position: "top" domainMargin: 1 legend: [ 0 1 4 7 ] legendCellPadding: 3 onClick: (date, count) -> return return "*": core: themes: [ "one-dark-ui" "solarized-dark-syntax" ] editor: fontFamily: "Monaco" fontSize: 15 "exception-reporting": userId: "1dd85e3b-ba87-9779-645f-85f161541155" welcome: showOnStartup: false whitespace: ignoreWhitespaceOnCurrentLine: false ignoreWhitespaceOnlyLines: true Darkswarm.factory "AuthenticationService", (Navigation, $modal, $location, Redirections)-> new class AuthenticationService selectedPath: "/login" constructor: -> if $location.path() in ["/login", "/signup", "/forgot"] && location.pathname is not '/register/auth' @open $location.path() else if location.pathname is '/register/auth' @open '/signup', 'registration_authentication.html' open: (path = false, template = 'authentication.html') => @modalInstance = $modal.open templateUrl: template windowClass: "login-modal medium" @modalInstance.result.then @close, @close @selectedPath = path || @selectedPath Navigation.navigate @selectedPath select: (path)=> @selectedPath = path Navigation.navigate @selectedPath active: Navigation.active close: -> Navigation.navigate "/" module.exports = _id: '_design/repos' languange: 'javascript' views: by_watchers: map: (doc) -> emit doc.watchers, doc.description if doc.watchers by_language: map: (doc) -> emit doc.languange, doc.description if doc.languange by_prefix: map: (doc) -> return unless doc.type is "repo" # emit all prefixes of name for c, i in doc.name emit [doc.name.substr(0, i+1).toLowerCase(), doc.watchers], doc.description # emit all prefixes of owner for c, i in doc.owner prefix = doc.owner.substr(0, i+1).toLowerCase() emit [prefix, doc.watchers], doc.description # emit all combined prefixes for d, j in doc.name emit [prefix + '/' + doc.name.substr(0, j+1).toLowerCase(), doc.watchers], doc.description lists: complete: (head, req) -> start headers: { 'Content-Type': 'text/plain' } while row = getRow() send "#{row.id.replace(':', '/')} (#{row.key[1]}) #{row.value}\n" return utils = require('lib/utils') exports.validate_doc_update = (newDoc, oldDoc, userCtx) -> types = ['essay','scene','video','profile'] access = if '_admin' in userCtx.roles or 'admin' in userCtx.roles or 'manager' in userCtx.roles then true else false if not access throw unauthorized: 'You must have the role admin or manager to make changes' if newDoc.type in types throw forbidden: 'site is a required field' unless newDoc.site throw forbidden: 'title is a required field' unless newDoc.title newDoc.slug = utils.cleanSlug newDoc.slug throw forbidden: 'slug is a required field' unless newDoc.slug if newDoc.published throw forbidden: 'Published doc must have a publish date' unless newDoc.published_at Travis.DurationCalculations = Ember.Mixin.create duration: (-> if duration = @get('_duration') duration else Travis.Helpers.durationFrom(@get('startedAt'), @get('finishedAt')) ).property('_duration', 'finishedAt', 'startedAt') updateTimes: -> unless ['rootState.loaded.reloading', 'rootState.loading'].contains @get('stateManager.currentState.path') or @get('isFinished') @notifyPropertyChange '_duration' @notifyPropertyChange 'finished_at' FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) -> class IframeView extends Backbone.Marionette.ItemView template: text: """ """ FacebookRenewal.addInitializer -> if currentUser?.get('services')['facebook'] checkRenewal() currentUser.on 'change', checkRenewal timeout = null justRenewed = false almostExpired = -> days = 24*60*60*1000 expiresAt = currentUser.get('services')['facebook_expires_at'] expiryDate = new Date(expiresAt*1000) timeToExpiry = expiryDate - new Date not justRenewed and timeToExpiry < 14*days tryRenewal = -> return if timeout FactlinkApp.facebookRenewalRegion.show new IframeView timeout = setTimeout tryManualRenewal, 10000 tryManualRenewal = -> justRenewed = true FactlinkApp.NotificationCenter.error """ Your Facebook connection could not be automatically verified. Please verify manually. Verify """ checkRenewal = -> tryRenewal() if almostExpired() FacebookRenewal.success = -> clearTimeout timeout timeout = null justRenewed = true currentUser.fetch() kd = require 'kd' KDView = kd.View KDTabView = kd.TabView KDTabPaneView = kd.TabPaneView TeamMembersCommonView = require './teammemberscommonview' GroupsBlockedUserView = require '../groupsblockeduserview' module.exports = class AdminMembersView extends KDView constructor: (options = {}, data) -> options.cssClass = 'member-related' super options, data @createTabView() createTabView: -> data = @getData() tabView = new KDTabView hideHandleCloseIcons: yes tabView.addPane allMembersPane = new KDTabPaneView name: 'All Members' tabView.addPane adminsPane = new KDTabPaneView name: 'Admins' tabView.addPane moderatorsPane = new KDTabPaneView name: 'Moderators' tabView.addPane blockedMembersPane = new KDTabPaneView name: 'Blocked' allMembersPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchMembers' }, data adminsPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchAdmins' }, data moderatorsPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchModerators' }, data blockedMembersPane.addSubView new GroupsBlockedUserView {}, data tabView.showPaneByIndex 0 @addSubView tabView $ -> # # Refresh the order # calculateTax = (form, invokeField)-> if $('select#product_tax_rate_id', form).val().length > 0 $('input#product_price_including_tax', form).prop('disabled', false) else $('input#product_price_including_tax', form).prop('disabled', true) $('input#product_price_including_tax', form).val($('input#product_price', form).val()) # # Setup the product form to calculate tax # setupProductForm = (form)-> # All select boxes should use Chosen $('select#product_tax_rate_id', form).on 'change', -> calculateTax $(this).parents('form'), $(this).attr('id') calculateTax form, null # # Automatically set up the form on page load if one exists. # if $('form.productForm').length setupProductForm $('form.productForm')define ['backbone', 'underscore'], (Backbone, _) -> class FieldModel extends Backbone.Model class FieldCollection extends Backbone.Collection model: FieldModel initialize: -> super @on 'reset', @resolve search: (query, handler) -> Backbone.ajax url: _.result @, 'url' data: q: query success: (resp) -> handler(resp) { FieldModel, FieldCollection } Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] console.log i1, i2 expect(new Vec().copy(i1).distanceTo(s1.center)).to.be.closeTo s1.radius, 1e-5 class ParamHandler constructor: (@payload = {}) -> getArguments: (process, callback) -> match = process.argv.join(' ').match /--[a-zA-Z]* ([a-zA-Z0-9]*)/g match.map (found) => parse = found.match(/--([a-zA-Z]*)\s/) @payload[parse[1]] = found.replace parse[0], '' callback @payload module.exports = new ParamHandlerdefine [ 'models/server' 'vendor/underscore' 'vendor/jquery' ], ( Server ) -> # Application base class # class App id: null serverAddress: '192.168.1.30' # Constructs a new app. # constructor: ( ) -> @_initTime = performance.now() @server = new Server(@serverAddress) @initialize() # Is called when the app has been constructed. Should be overridden by # subclasses. # initialize: ( ) -> # Returns the time that has passed since the starting of the app. # time: ( ) -> return performance.now() - @_initTimemodule.exports = (grunt) -> 'use strict' # Project configuration. grunt.initConfig watch: coffee: tasks: ['coffee:compile'] files: [ 'spec/*.coffee' ] buildRunner: tasks: ['jasmine:src:build'] files: [ 'spec/*.js' ] coffee: compile: options: bare: true expand: true src: 'spec/*.coffee' dest: '.' ext: '.js' jasmine: test: src: 'promiser.js' options: keepRunner: true outfile: 'spec-runner.html' specs: 'spec/*.js' vendor: 'vendor/*.js' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-jasmine' grunt.registerTask 'default', ['coffee', 'jasmine'] grunt.registerTask 'test', ['jasmine:test'] module.exports = (grunt) -> grunt.initConfig clean: package: ['tasks/gyp.js'] test: ['test/support/build'] coffee: task: options: bare: true files: 'tasks/gyp.js': 'tasks/gyp.coffee' mochacli: options: bail: true compilers: ['coffee:coffee-script/register'] # Compiling takes time… timeout: 8000 files: ['test/'] grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-mocha-cli' grunt.registerTask 'package', ['coffee:task'] grunt.registerTask 'test', ['clean:test', 'mochacli'] grunt.registerTask 'default', [] class Flash add: (message, type) -> alertId = Math.floor(Date.now() / 1000); $('body').prepend( '' ); return alertId remove: (alertId) -> $('[data-alert-id=' + alertId + ']').remove() window.Flash = new Flash() Meteor.methods log: -> console.log.apply console, arguments Meteor.startup -> Push.debug = RocketChat.settings.get 'Push_debug' if RocketChat.settings.get('Push_enable') is true Push.allow send: (userId, notification) -> return Meteor.users.findOne({_id: userId})?.admin is true Push.Configure apn: passphrase: RocketChat.settings.get 'Push_apn_passphrase' keyData: RocketChat.settings.get 'Push_apn_key' certData: RocketChat.settings.get 'Push_apn_cert' 'apn-dev': passphrase: RocketChat.settings.get 'Push_apn_dev_passphrase' keyData: RocketChat.settings.get 'Push_apn_dev_key' certData: RocketChat.settings.get 'Push_apn_dev_cert' gateway: 'gateway.sandbox.push.apple.com' production: RocketChat.settings.get 'Push_production' badge: true sound: true alert: true vibrate: true module.exports = class OverlayManager constructor: (@container) -> @overlayNodesById = {} render: (presenter) -> for decorationId, {pixelPosition, item} of presenter.state.content.overlays @renderOverlay(presenter, decorationId, item, pixelPosition) for id, overlayNode of @overlayNodesById unless presenter.state.content.overlays.hasOwnProperty(id) overlayNode.remove() delete @overlayNodesById[id] return renderOverlay: (presenter, decorationId, item, pixelPosition) -> item = atom.views.getView(item) unless overlayNode = @overlayNodesById[decorationId] overlayNode = @overlayNodesById[decorationId] = document.createElement('atom-overlay') overlayNode.appendChild(item) @container.appendChild(overlayNode) itemWidth = item.offsetWidth itemHeight = item.offsetHeight {scrollTop, scrollLeft} = presenter.state.content left = pixelPosition.left if left + itemWidth - scrollLeft > presenter.contentFrameWidth and left - itemWidth >= scrollLeft left -= itemWidth top = pixelPosition.top + presenter.lineHeight if top + itemHeight - scrollTop > presenter.height and top - itemHeight - presenter.lineHeight >= scrollTop top -= itemHeight + presenter.lineHeight overlayNode.style.top = top + 'px' overlayNode.style.left = left + 'px' #=require jasmine #=require jasmine-html #=require jasmine-jquery-1.5.0 (-> execJasmine = -> jasmineEnv.execute() jasmineEnv = jasmine.getEnv() jasmineEnv.updateInterval = 1000 window.jsApiReporter = new jasmine.JsApiReporter() htmlReporter = new jasmine.HtmlReporter() jasmineEnv.addReporter htmlReporter jasmineEnv.addReporter jsApiReporter jasmineEnv.specFilter = (spec) -> htmlReporter.specFilter spec jasmine.getFixtures().fixturesPath = '/jasmine/fixtures' jasmine.getStyleFixtures().fixturesPath = '/jasmine/fixtures' jasmine.getJSONFixtures().fixturesPath = '/jasmine/fixtures/json' jasmine.rice = {} jasmine.rice.autoExecute = true currentWindowOnload = window.onload window.onload = -> currentWindowOnload() if currentWindowOnload if jasmine.rice.autoExecute execJasmine() )() should = require 'should' bus = require '../lib/bus' log = require '../lib/core/log' tests = [ topic: 'debug' data: 'hello, debug' , topic: 'error' data: 'hello, error' , topic: 'info' data: 'hello, info' ] describe 'log', -> for test in tests do (test) -> it "should log on #{test.topic}", (done) -> # Given a listener on the 'log' channel and given topic bus.subscribe channel: log.channel topic: test.topic callback: (data, envelope) -> # We should receive a log message should.exist data data.should.eql test.data done() # When we log it via the given topic log[test.topic] test.data `import {ArrayProxy, run} from 'ember';` `import Modal from './modal'` ###* # A flavour of a {{#crossLink "Modal}}Modal{{/crossLink}} that handles form submission right. # @class ModalForm ### ModalForm = Modal.extend tagName: 'form' attributeBindings: ['in-async'] 'in-async': undefined 'close-if-error': true error: undefined ###* # Handle form submit event. # Submit the form, if the event returns a promise, then wait for the promise to be fulfilled first before # closing the modal, if the promise returned an error, then the `error` property will be set with the given error object of the # promise, when error occurs, the modal will only get closed if the `close-if-error` property isn't set to false # # @method submitForm # @private ### submitForm: ((e) -> e.preventDefault() @sendAction 'on-submit', @, e if e.promise and "function" is typeof e.promise.then @set 'in-async', 'true' e.promise.then(=> @set 'in-async', undefined @close() , (err) => @set 'in-async', undefined @set 'error', err @close() if @get('close-if-error') ) else @close() ).on('submit') `export default ModalForm`require.config paths: jquery: "vendor/jquery/jquery" jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui" jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel" jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min" handsontable: "vendor/handsontable/jquery.handsontable" numeral: "vendor/numeral/numeral" underscore: "vendor/underscore-amd/underscore" backbone: "vendor/backbone-amd/backbone" bootstrap: "vendor/bootstrap-3.1.1/js" modal: "vendor/bootstrap/modal" timezone: "vendor/timezone/src/timezone" sprintf: "vendor/sprintf/src/sprintf" rbush: "vendor/rbush/rbush" jstree: "vendor/jstree/dist/jstree" shim: sprintf: exports: 'sprintf' handsontable: deps: ["numeral"] exports: "$.fn.handsontable" jqrangeslider: deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_mousewheel"] exports: "$.fn.rangeSlider" {View} = require 'space-pen' $ = require 'jquery' Git = require 'git' fs = require 'fs' module.exports = class FileView extends View @content: ({file} = {}) -> @li class: 'file entry', => @span file.getBaseName(), class: 'name', outlet: 'fileName' @span '', class: 'highlight' file: null initialize: ({@file, @project} = {}) -> extension = fs.extension(@getPath()) if fs.isReadmePath(@getPath()) @fileName.addClass('readme-icon') else if fs.isCompressedExtension(extension) @fileName.addClass('compressed-icon') else if fs.isImageExtension(extension) @fileName.addClass('image-icon') else if fs.isPdfExtension(extension) @fileName.addClass('pdf-icon') else if fs.isBinaryExtension(extension) @fileName.addClass('binary-icon') else @fileName.addClass('text-icon') if git? git.on 'status-changed', (path, status) => @updateStatus() if path is @getPath() git.on 'statuses-changed', => @updateStatus() @updateStatus() updateStatus: -> @removeClass('ignored modified new') return unless git? path = @getPath() if git.isPathIgnored(path) @addClass('ignored') else status = git.statuses[path] if git.isStatusModified(status) @addClass('modified') else if git.isStatusNew(status) @addClass('new') getPath: -> @file.path describe "RequireJS namespacing", -> beforeEach -> @addMatchers requirejsTobeUndefined: -> typeof requirejs is "undefined" requireTobeUndefined: -> typeof require is "undefined" defineTobeUndefined: -> typeof define is "undefined" it "check that the RequireJS object is present in the global namespace", -> expect(RequireJS).toEqual jasmine.any(Object) expect(window.RequireJS).toEqual jasmine.any(Object) it "check that requirejs(), require(), and define() are not in the global namespace", -> expect({}).requirejsTobeUndefined() expect({}).requireTobeUndefined() expect({}).defineTobeUndefined() expect(window.requirejs).not.toBeDefined() expect(window.require).not.toBeDefined() expect(window.define).not.toBeDefined() describe "RequireJS module creation", -> inDefineCallback = undefined inRequireCallback = undefined it "check that we can use RequireJS define() and require() a module", -> runs -> inDefineCallback = false inRequireCallback = false RequireJS.define "test_module", [], -> inDefineCallback = true module_status: "OK" RequireJS.require "test_module", (test_module) -> inRequireCallback = true expects(test_module.module_status).toBe "OK" waitsFor (-> return false if (inDefineCallback isnt true) or (inRequireCallback isnt true) true ), "We should eventually end up in the defined callback", 1000 runs -> expects(inDefineCallback).toBeTruthy() expects(inRequireCallback).toBeTruthy() TentAdmin.Routers.main = new class MainRouter extends Marbles.Router routes: { "" : "root" "profile" : "profile" "apps" : "apps" } root: => @navigate('/profile', { replace: true, trigger: true }) profile: => new Marbles.Views.Profile container: TentAdmin.config.container apps: => new Marbles.Views.Apps container: TentAdmin.config.container define [ '../core' './index' './search' 'tpl!templates/concept/panel.html' ], (c, index, search, templates...) -> templates = c._.object ['panel'], templates class ConceptSearch extends search.ConceptSearch events: 'typeahead:autocompleted input': 'autocomplete' autocomplete: (event, datum) -> c.publish c.CONCEPT_FOCUS, datum.id # Takes a collection of c.models.ConceptModel objects class ConceptPanel extends c.Marionette.Layout className: 'concept-panel' template: templates.panel # Two primary regions for the concept panel including the search # and the index (listing) of concepts regions: search: '.search-region' index: '.index-region' onRender: -> # Pass the collection of concepts to be rendered in the index @index.show new index.ConceptIndex collection: @collection collapsable: false # When a search occurs, the index is filtered relative to the # response which contains a listing of IDs that the search # has matched. @search.show new ConceptSearch collection: @collection handler: (query, resp) => @index.currentView.filter(query, resp) # Defer focus of concept search until end of event loop c._.defer => @search.currentView.ui.input.focus() { ConceptPanel } {View} = require 'space-pen' Editor = require 'editor' $ = require 'jquery' Point = require 'point' _ = require 'underscore' module.exports = class Prompt extends View @activate: -> new Prompt @content: -> @div class: 'overlay from-top mini', => @subview 'miniEditor', new Editor(mini: true) @div class: 'message', outlet: 'message', 'Enter a session id to join' initialize: (@confirmed) -> @miniEditor.on 'focusout', => @remove() @on 'core:confirm', => @confirm() @on 'core:cancel', => @remove() @attach() beforeRemove: -> @previouslyFocusedElement?.focus() @miniEditor.setText('') confirm: -> @confirmed(@miniEditor.getText()) @remove() attach: -> @previouslyFocusedElement = $(':focus') rootView.append(this) @miniEditor.focus() noflo = require 'noflo' fbpSpec = require 'fbp-spec' exports.getComponent = -> c = new noflo.Component c.inPorts.add 'in', datatype: 'object' description: 'Project' c.inPorts.add 'runtime', datatype: 'object' required: yes c.outPorts.add 'context', datatype: 'object' c.outPorts.add 'error', datatype: 'object' noflo.helpers.WirePattern c, in: 'in' params: ['runtime'] out: 'context' async: true , (project, groups, out, callback) -> unless project do callback return unless c.params.runtime.isConnected() do callback return unless project.specs?.length do callback return specs = project.specs.filter (s) -> s.language is 'yaml' unless specs.length do callback return suites = specs.map (s) -> fbpSpec.testsuite.loadYAML s.code # Send out the initial suites out.send suites: suites runner = new fbpSpec.runner.Runner c.params.runtime fbpSpec.runner.runAll runner, suites, -> # Send updated suite state out.send suites: suites , (err) -> return callback err if err do callback describe "The Status Icon Configuration Option", -> configString = "linter.statusIconPosition" beforeEach -> waitsForPromise -> atom.packages.activatePackage('linter') it "is 'Left' by default.", -> packageSetting = atom.config.get configString expectedDefault = "Left" expect(packageSetting).toEqual expectedDefault isCurrentLineEmpty = (editor) -> # save the current buffer range, so that we can # reset the state in the end bufferRange = editor.getSelectedBufferRange() editor.moveToBeginningOfLine() editor.selectToEndOfLine() selectedText = editor.getSelectedText() # reset the selection to what it was before calling # this function editor.getSelectedBufferRange bufferRange selectedText.trim() == '' isCurrentLineLastOfFile = (editor) -> currentRow = editor.getCursorBufferPosition().row totalRows = editor.getLineCount() currentRow == totalRows - 1 moveToNextEmptyLine = (editor) -> while !isCurrentLineEmpty(editor) && !isCurrentLineLastOfFile(editor) editor.moveDown() if !isCurrentLineEmpty(editor) editor.insertNewlineBelow() editor.moveToBeginningOfLine() module.exports = isCurrentLineEmpty: isCurrentLineEmpty moveToNextEmptyLine: moveToNextEmptyLine module.exports = (grunt) -> PATHS = "Windows_NT" : "bin\\nw.exe\\nw.exe" "Darwin" : "bin/node-webkit.app/Contents/MacOS/node-webkit" os = require("os") path = require("path") spawn = require("child_process").spawn debug = -> DS = path.sep bin = PATHS[os.type()] proc = null try if bin? proc = spawn bin, ["--debug", "src" + DS], {detached: true} else grunt.fail.fatal "Unsupported environment (#{os.type()})" catch e console.error e grunt.initConfig nodewebkit : src : ["./compiled/**/*"] # Your node-webkit app options : platforms : ['win', 'osx'] version : "0.10.4" buildDir : "./release" cacheFir : "./release/cache" #macCredits : #macIcns : #winIco : # loadTasks grunt.loadNpmTasks "grunt-node-webkit-builder" # regist Tasks grunt.registerTask "debug", debug grunt.registerTask "release", ["nodewebkit"] #= require underscore strings = loading: "Loading…" noData: "No data" logger: title: "Workbench Logger" "api-endpoint": "API Endpoint" metadata: title: "Sensor Metadata" name: "Sensor Name" description: "Sensor Description" datastreams: "Datastreams" owner: "Owner" contact: "Owner Contact" other: "Other Sensors for this API Key" sensor: view: "View Sensor" api_key: "API Key" chart: ranges: two_hour: "2h" one_day: "1d" one_week: "1w" ytd: "YTD" all: "All" map: attribution: '© OpenStreetMap contributors' # Use the global t() function to extract a string from the strings object. Use # periods to denote hierarchy, e.g. "errors.timeout.header". Returns the string # or object at that level, if it exists. window.t = (key) -> keys = key.split('.') try value = _.reduce(keys, (memo, item) -> memo[item] , strings) console.warn "Undefined string key:", key if value is undefined catch TypeError console.warn "Undefined string key:", key value ".source.apl": Function: prefix: "fn" body: "∇${2:R ←} ${3:X} ${1:NAME} ${4:Y}\n\t$0\n∇" Operator: prefix: "op" body: "∇${2:R ←} ${3:X} (${4:LOP} ${1:NAME} ${5:ROP}) ${6:Y}\n\t$0\n∇" Assignment: prefix: "a" body: "${1:⎕ }← ${2:VALUE}" # GNU APL extensions "GNU Heredoc: Plain": prefix: "hd" body: "${1:result} ← '' ⎕INP '${2:RAWTEXT}'\n\t$0\n${2:RAWTEXT}" "GNU Heredoc: HTML": prefix: "html" body: "${1:result} ← '' ⎕INP '${2:END-}HTML'\n\t$0\n${2:END-}HTML" "GNU Heredoc: Embedded APL": prefix: "apl" body: "" # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': 'atom-text-editor': [ { 'label': 'Toggle tree-view-finder' 'command': 'tree-view-finder:toggle' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'tree-view-finder' 'submenu': [ { 'label': 'Toggle' 'command': 'tree-view-finder:toggle' } ] ] } ] # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ # Tooltips for Contract Balance $ -> $('.contracts').on('mouseenter', 'a[data-toggle=tooltip]', -> $(this).popover( placement: 'left' trigger: 'manual' html: true ).popover('show') # container: 'testcontainer' ).on('mouseleave', 'a[data-toggle=tooltip]', -> $(this).popover('hide') ).on 'click', 'a[data-toggle=tooltip]', (e) -> e.preventDefault() e.stopPropagation() $('.contracts').on 'click', '.contract .contract-header', (e) -> $(this).closest('.contract').toggleClass('expanded'). prev().toggleClass('before-expand'). end().find('.flights').slideToggle( 100 ) {BattleQueue} = require '../server/queue' describe 'BattleQueue', -> it 'should be empty by default', -> new BattleQueue().queue.should.be.empty describe '#add', -> it 'queues a new player', -> queue = new BattleQueue() queue.add({}) queue.queue.should.have.length 1 describe '#remove', -> it 'can dequeue old players', -> queue = new BattleQueue() player = {} queue.add(player) queue.remove(player) queue.queue.should.have.length 0 describe '#queuedPlayers', -> it 'returns the players who are queued', -> queue = new BattleQueue() dude = {} queue.add(dude) queue.queuedPlayers().should.include dude queue.queuedPlayers().should.have.length 1 describe '#pairPlayers', -> it 'takes players out of the queue', -> queue = new BattleQueue() queue.add({}) queue.add({}) queue.pairPlayers() queue.queue.should.be.empty it 'leaves one person out if the queue length is odd', -> queue = new BattleQueue() queue.add({}) queue.add({}) queue.add({}) queue.pairPlayers() queue.queue.should.have.length 1 it 'returns an array of pairs', -> queue = new BattleQueue() queue.add({}) queue.add({}) queue.add({}) queue.add({}) pairs = queue.pairPlayers() pairs.should.have.length 2 EditSession = require 'edit-session' MarkdownPreviewView = require './markdown-preview-view' module.exports = activate: -> rootView.command 'markdown-preview:show', '.editor', => @show() show: -> activePane = rootView.getActivePane() editSession = activePane.activeItem isEditSession = editSession instanceof EditSession hasMarkdownGrammar = editSession.getGrammar().scopeName == "source.gfm" if not isEditSession or not hasMarkdownGrammar console.warn("Can not render markdown for '#{editSession.getUri() ? 'untitled'}'") return {previewPane, previewItem} = @getExistingPreview(editSession) if previewItem? previewPane.showItem(previewItem) previewItem.renderMarkdown() else if nextPane = activePane.getNextPane() nextPane.showItem(new MarkdownPreviewView(editSession.buffer)) else activePane.splitRight(new MarkdownPreviewView(editSession.buffer)) activePane.focus() getExistingPreview: (editSession) -> uri = "markdown-preview:#{editSession.getPath()}" for previewPane in rootView.getPanes() previewItem = previewPane.itemForUri(uri) return {previewPane, previewItem} if previewItem? {} module.exports = """ fragment auction on Artwork { is_acquireable is_in_auction auction: sale { id name is_open is_preview is_closed is_auction is_auction_promo is_with_buyers_premium sale_artwork(id: $id) { id reserve_message estimate current_bid { amount } minimum_next_bid { amount cents } counts { bidder_positions } } } } """ FilterCtrl = ($scope) -> $scope.clear = -> @value = null angular.module('MongoBrowser', []) # Handles ESC key .directive 'onEsc', -> (scope, element, attrs) -> element.bind 'keyup', (event) -> EscapeCode = 27 return unless event.keyCode is EscapeCode scope.$apply(attrs.onEsc) # Filter for databases and collections .directive 'filter', -> restrict: 'E' replace: true transclude: true scope: placeholder: '@placeholder' controller: FilterCtrl template: $("#filter-template").text() link: (scope, element, attrs) -> $(document).ready -> $("a[data-method]").click (event) -> event.preventDefault() $link = $(event.target) createAndSubmitForm = -> action = $link.attr("href") $form = $("
    ").attr("method", "post").attr("action", action) method = $link.data("method") $metadataInput = $("").attr("type", "hidden").attr("name", "_method").val(method) $form.hide().append($metadataInput).appendTo("body"); $form.submit() confirmationMessage = $link.data("confirm") if confirmationMessage? bootbox.confirm confirmationMessage, (confirmed) => createAndSubmitForm() if confirmed else createAndSubmitForm() restler = require('restler') class PulsarApiRest constructor: (url, token) -> restService = restler.service((url, token) -> if token @defaults.username = token @defaults.password = 'x-oauth-basic' return , baseURL: url ) return new restService(url, token) module.exports = PulsarApiRest $(".polls").fadeOut 500, -> $(".polls[data-id='<%= @poll.id %>']").replaceWith("<%= escape_javascript(render :partial => "polls/poll", :locals => {:previous_poll => @poll}) %>") $(".polls").show() # Installs/updates latest version of the Tâmia Stylus framework. # Also installs jQuery. # https://github.com/sapegin/tamia 'use strict' fs = require 'fs' util = require 'util' path = require 'path' base = require '../base' module.exports = class Generator extends base Generator::checkUpdate = -> @update = fs.existsSync 'tamia' Generator::tamia = -> done = @async() tempPath = path.join @sourceRoot(), 'tamia' distUrl = 'https://github.com/sapegin/tamia/archive/master.tar.gz' @delete tempPath, {force: true} @tarball distUrl, tempPath, => @delete 'tamia' @directory 'tamia/tamia', 'tamia/tamia' @directory 'tamia/modules', 'tamia/modules' @directory 'tamia/vendor', 'tamia/vendor' done() Generator::dependencies = -> @installFromBower ['jquery'], @update #query = require("pg-query") #oreList = query("select itemName from Ore order by itemName", (err, rows, result) -> # alert rows ) #alert oreList #alert "3333" refiningTable = null refineMe = [] #accepts optional array of values as 2nd parameter for parameterized queries AddNewRefiningElement = -> Quantity = parseInt($("#inputQuantity").val(), 10) unless isNaN(Quantity) itemName = $("#oreInput1").val() rowData = refiningTable.row((rowIdx) -> return refiningTable.cell(rowIdx, 0).data() is itemName ).index() if rowData == undefined # Not found refiningTable.row.add([itemName, Quantity]) else # Found newData = refiningTable.cell(rowData, 1).data() refiningTable.cell(rowData, 1).data(newData + Quantity) refiningTable.draw() return $ -> refiningTable = $("#refiningSource").DataTable "paging": false "searching": false columns: [ { title: "Ore" } { title: "Quantity" } ] $(".select2").select2() #- $(oreList).each(function() { #- var opt = document.createElement("option"); #- opt.innerHTML = this; #- $("#oreInput1").appendChild(opt);}); $("#addButton").on("click", AddNewRefiningElement) return #= require trix/views/attachment_view #= require trix/utilities/dom #= require trix/utilities/helpers {defer} = Trix.Helpers class Trix.ImageAttachmentView extends Trix.AttachmentView render: -> @image = document.createElement("img") @image.setAttribute("contenteditable", false) @image.setAttribute("data-trix-identifier", @attachmentPiece.getIdentifier()) if @attachmentPiece.hasIdentifier() if @attachmentPiece.isPending() @attachment.getPreviewURL (previewURL) => @image.src = previewURL else @image.src = @attachmentPiece.getURL() if @attachmentPiece.getWidth()? @image.width = @attachmentPiece.getWidth() @image.height = @attachmentPiece.getHeight() @image React = require 'react' {CourseStore} = require '../../flux/course' {StudentDashboardStore, StudentDashboardActions} = require '../../flux/student-dashboard' LoadableItem = require '../loadable-item' isStepComplete = (step) -> step.is_completed StudentDashboard = require './dashboard' WindowHelpers = require '../../helpers/window' StudentDashboardShell = React.createClass displayName: 'StudentDashboardShell' contextTypes: router: React.PropTypes.func componentWillMount: -> {courseId} = @context.router.getCurrentParams() {is_concept_coach, webview_url} = CourseStore.get(courseId) if is_concept_coach and webview_url WindowHelpers.replaceBrowserLocation(webview_url) render: -> {courseId} = @context.router.getCurrentParams()
    } />
    module.exports = {StudentDashboardShell} # Error handling setup # See: http://www.artandlogic.com/blog/2014/05/error-handling-in-gulp/ gutil = require 'gulp-util' fatalLevel = require('yargs').argv.fatal ERROR_LEVELS = ['error', 'warning'] module.exports = # Convenience handlers to be used in gulp .on('error', callback) onError: (error) -> handleError.call(this, 'error', error) onWarning: (error) -> handleError.call(this, 'warning', error) # Log error and kill process handleError = (level, error) -> gutil.log error.message gutil.log "Level: " + level + " isFatal" + isFatal(level) process.exit(1) if isFatal(level) # Determine if the error is fatal. Returns true if the given level is # equal to or more severe than the given fatality level (via cli arg). # Defaults to fatality level to error if not set by user or some task default isFatal = (level) -> ERROR_LEVELS.indexOf(level) <= ERROR_LEVELS.indexOf(fatalLevel || 'error') class Trix.SelectionObserver events = ["DOMFocusIn", "DOMFocusOut", "mousedown", "keydown"] constructor: (@element) -> @element.addEventListener(event, @start) for event in events @range = getRange() start: => return if @running @running = true requestAnimationFrame(@tick) stop: -> delete @running tick: => if elementWasRemovedFromDOM(@element) @stop() else range = getRange() unless rangesAreEqual(range, @range) @delegate?.selectionDidChange?() @range = range requestAnimationFrame(@tick) getRange = -> selection = window.getSelection() selection.getRangeAt(0) if selection.rangeCount > 0 rangesAreEqual = (left, right) -> left?.startContainer is right?.startContainer and left?.startOffset is right?.startOffset and left?.endContainer is right?.endContainer and left?.endOffset is right?.endOffset elementWasRemovedFromDOM = (element) -> not element.parentNode Meteor.publish 'projects', -> Projects.find {members: this.userId} Meteor.publish 'projectMessages', (projectId) -> check projectId, String # Find all messages for the current project which have our user as sender or recipient Messages.find {$and: [{$or: [{recipients: {$in: [this.userId]}}, {sender: this.userId}]}, {project: projectId}]} Meteor.publish 'allMessages', -> Messages.find {$or: [{recipients: {$in: [this.userId]}}, {sender: this.userId}]} Meteor.publish 'usernames', -> Meteor.users.find {}, {fields: {'emails': 1, '_id': 1, 'telephone_nr': 1, 'skype_id': 1, 'name': 1}} angular.module('Sprangular.StaticContent').service 'StaticContent', ($q, $http) -> service = findContent: (id) -> $http.get "/api/pages/#{id}.json" service {WorkspaceView} = require 'atom' LineJumper = require '../lib/line-jumper' describe "LineJumper", -> editor = null beforeEach -> atom.workspaceView = new WorkspaceView() pack = atom.packages.activatePackage("line-jumper", immediate: true) atom.workspaceView.openSync('sample.js') editor = atom.workspaceView.getActiveView() describe "moving and selecting down", -> it "moves down", -> atom.workspaceView.trigger 'line-jumper:move-down' pos = editor.getCursorBufferPosition() expect(pos).toEqual [10,0] it "selects down", -> atom.workspaceView.trigger 'line-jumper:select-down' bufferRange = editor.getSelectedBufferRange() expect(bufferRange).toEqual [[0,0],[10,0]] describe "moving and selecting up", -> beforeEach -> pos = editor.setCursorBufferPosition([12,0]) it "moves up", -> atom.workspaceView.trigger 'line-jumper:move-up' pos = editor.getCursorBufferPosition() expect(pos).toEqual [2,0] it "selects down", -> atom.workspaceView.trigger 'line-jumper:select-up' bufferRange = editor.getSelectedBufferRange() expect(bufferRange).toEqual [[2,0],[12,0]] define [ "chaplin" "models/posts" "views/posts" ], (Chaplin, Posts, PostsView) -> "use strict" class PostsController extends Chaplin.Controller show: (params) -> # Unescape matched parts of url. # Why the hell chaplin doesn't do it by himself? # XXX: Seems like what we should use encodeURIComponent # and then decode it for each url parameter like user or id # but we hope that they will not contain "bad" characters # in future. params.tag = decodeURIComponent params.tag if params.tag? params.club = decodeURIComponent params.club if params.club? query = use_bl: 1 if params.user? query.user = params.user query.tag = params.tag if params.tag? params.title = "@#{params.user}" else if params.club? query.club = params.club params.title = "!#{params.club}" else if params.tag? query.tag = params.tag params.title = "*#{params.tag}" else query = {} @collection = new Posts [], id: params.id, query: query @view = new PostsView collection: @collection, pageble: params.pageble @adjustTitle params.title $ -> margin_top = $('.navbar-fixed-top, .navbar-static-top').height() $('table[data-toggle=sticky-header]').floatThead useAbsolutePositioning: false scrollingTop: margin_top class SceneView constructor: (@canvas) -> @id = _.uniqueId 'view' throw new Error "A Canvas is required" if not @canvas @context = @canvas.getContext("2d") throw new Error "Could not retrieve Canvas context" if not @context @camera = new Rect(0,0,100,100) render: (object) -> #editor = ace.edit("editor") #editor.getSession().setMode("ace/mode/markdown") jQuery -> jQuery('.editor').ace({ theme: 'github', lang: 'markdown', width: '100%', indent: 2 }) jQuery('.editor-meta select').change event, -> ace = jQuery(event.srcElement) .closest('.editor-container') .find('.editor') .data('ace') ace.editor.ace.getSession().setMode("ace/mode/#{event.srcElement.value}") jQuery('.initial-focus').focus() # For the nested form. document.body.addEventListener "DOMNodeInserted", ((event) -> elementJustAdded = jQuery(event.target) if elementJustAdded.hasClass("fields") jQuery(".editor").ace lang: "markdown" indent: 2 width: "100%" theme: "github" jQuery(event.srcElement).find(".editor-meta select").change (ev) -> ace = undefined ace = jQuery(ev.target).closest(".editor-container").find(".editor").data("ace") ace.editor.ace.getSession().setMode "ace/mode/" + ev.target.value return ), false # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> $('select#r').change(window.secondnav_goto) $('select#r option').click(window.secondnav_goto) $('select#r2').change(window.secondnav_goto2) $('select#r2 option').click(window.secondnav_goto2) $('select#r3').change(window.secondnav_goto3) $('select#r3 option').click(window.secondnav_goto3) window.secondnav_goto = -> return unless document return unless document.getElementById el = document.getElementById("r") window.location = el.options[el.selectedIndex].value return window.secondnav_goto2 = -> return unless document return unless document.getElementById el = document.getElementById("r2") window.location = el.options[el.selectedIndex].value return window.secondnav_goto3 = -> return unless document return unless document.getElementById el = document.getElementById("r3") window.location = el.options[el.selectedIndex].value return module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-release' grunt.loadNpmTasks 'grunt-exec' grunt.loadNpmTasks 'grunt-gh-pages' grunt.initConfig release: options: bump: false add: false push: false tagName: "v<%= version %>" exec: test: command: "./node_modules/jasmine-node/bin/jasmine-node --coffee spec" build_docs: command: "./bin/biscotto src/" 'gh-pages': options: base: "doc" src: ['**'] grunt.registerTask('test', 'exec:test') grunt.registerTask('publish', ['exec:build_docs', 'gh-pages']) $ -> saveTextSearchCondition = (selectTag) -> cond = selectedValue: selectTag.find(':selected').val() query: $('input#q').val() localStorage.setItem('textSearch', JSON.stringify(cond)) $('form').on "submit", (e) -> e.preventDefault() selectTag = $('select#category') searchTarget = selectTag.find(':selected').data('searchTarget') saveTextSearchCondition(selectTag) switch searchTarget when 'category' @.action = "/text" selectTag.attr('name', 'category') when 'stanza' @.action = "/text/search" selectTag.attr('name', 'stanza_id') @.submit() $(window).on "load", (e) -> search = window.location.search unless search cond = JSON.parse(localStorage.getItem('textSearch')) if cond $('input#q').val(cond.query) $('select#category').val(cond.selectedValue) $("#textsearch-container button").click() $(document).on "page:change", -> $(".data-table").each -> table = $(@) return if $.fn.dataTable.isDataTable(table) if table.hasClass("sort-asc") table.DataTable responsive: true else table.DataTable responsive: true order: [[ 0, "desc" ]] class @Activities constructor: -> Pager.init 20, true $(".event-filter a").bind "click", (event) => event.preventDefault() @toggleFilter($(event.currentTarget)) @reloadActivities() reloadActivities: -> $(".content_list").html '' Pager.init 20, true toggleFilter: (sender) -> sender.parent().toggleClass "active" event_filters = $.cookie("event_filter") filter = sender.attr("id").split("_")[0] if event_filters event_filters = event_filters.split(",") else event_filters = new Array() index = event_filters.indexOf(filter) if index is -1 event_filters.push filter else event_filters.splice index, 1 $.cookie "event_filter", event_filters.join(","), { path: '/' } React = require 'react' Button = require 'react-bootstrap/Button' RouteToMixin = require './RouteToMixin' ADDITIONAL_RESERVED_PROPS = key: true ref: true ButtonLink = React.createClass displayName: 'ButtonLink' mixins: [ RouteToMixin ] additionalReservedProps: ADDITIONAL_RESERVED_PROPS render: -> @transferPropsTo( ) module.exports = ButtonLink {BufferedProcess} = require 'atom' module.exports = activate: -> atom.workspaceView.command "execute-as-ruby:execute", => @execute() execute: -> # This assumes the active pane item is an editor editor = atom.workspace.activePaneItem cursor = editor.getCursor() selection = editor.getSelectedText() insertResult = (result) -> editor.moveCursorToEndOfLine() editor.insertText(" " + result) if not selection line = cursor.getCurrentBufferLine() result = @runRuby(line, insertResult) else result = @runRuby(selection, insertResult) packagePath: -> packagePath = null for p in atom.packages.getAvailablePackagePaths() if p.indexOf("/execute-as-ruby") != -1 packagePath = p if not packagePath throw "Could not locate package path" packagePath runRuby: (rubyCode, done) -> command = 'ruby' args = ['--', @packagePath() + "/lib/helper.rb", rubyCode] output = [] stdout = (data) -> output.push(data) exit = (code) -> done(output.join("")) stderr = (data) -> output.push(data) process = new BufferedProcess({command, args, stdout, stderr, exit}) 'use strict' TimeTracker.WorkTimes = setDestroyCallback: -> $('.worktime-page #day-records').on 'ajax:success', '.day-row a.destroy', (event, data, status, xhr) -> $(event.target).parent().fadeOut 'fast', -> $(this).remove() init: -> do @setDestroyCallback $ -> do TimeTracker.WorkTimes.init TimeTracker.Modals.onClick 'new-record' TimeTracker.FormErrors.init 'new'#= require jquery #= require jquery_ujs #= require turbolinks #= require bootstrap #= require_tree . $(-> $('#job_date_type').change(-> switch $(@).val() when 'agreement', '' $('.job_start_date').slideUp() $('.job_end_date').slideUp() when 'date' $('.job_start_date').slideDown() $('.job_end_date').slideUp() when 'date_range' $('.job_start_date').slideDown() $('.job_end_date').slideDown() ).change() ) define [ 'underscore' 'marionette' '../core' '../base' '../concept' '../context' 'tpl!templates/workflows/query.html' ], (_, Marionette, c, base, concept, context, templates...) -> templates = _.object ['query'], templates class QueryWorkflow extends Marionette.Layout className: 'query-workflow' template: templates.query regions: concepts: '.concept-panel-region' workspace: '.concept-workspace-region' context: '.context-panel-region' onRender: -> @workspace.show new concept.ConceptWorkspace # Deferred loading of views.. @concepts.show new base.LoadView message: 'Loading query concepts...' @context.show new base.LoadView message: 'Loading session context...' c.promiser.when 'concepts', => @concepts.show new concept.ConceptPanel collection: c.data.concepts.queryable @concepts.currentView.$el.stacked fluid: '.index-region' c.promiser.when 'contexts', => @context.show new context.ContextPanel model: c.data.contexts.getSession() @context.currentView.$el.stacked fluid: '.tree-region' { QueryWorkflow } define ['lodash'], (L) -> Array '$scope', '$log', '$modal', (scope, log, modalFactory) -> InputEditCtrl = Array '$scope', '$modalInstance', 'history', 'step', (scope, modal, history, step, index) -> scope.data = L.clone step.data delete scope.data.service # Not editable scope.ok = -> modal.close history.id, index, scope.data scope.cancel = -> modal.dismiss 'cancel' scope.openEditDialogue = -> dialogue = modalFactory.open templateUrl: '/partials/edit-step-data.html' controller: InputEditCtrl size: 'lg' resolve: index: -> scope.$index history: -> scope.history step: -> scope.s "use strict" Beautifier = require('./beautifier') module.exports = class TypeScriptFormatter extends Beautifier name: "TypeScript Formatter" options: { TypeScript: true } beautify: (text, language, options) -> return new @Promise((resolve, reject) => try format = require("typescript-formatter/lib/formatter").default formatterUtils = require("typescript-formatter/lib/utils") # @verbose('format', format, formatterUtils) opts = formatterUtils.createDefaultFormatCodeOptions() opts.TabSize = options.tab_width or options.indent_size opts.IndentSize = options.indent_size opts.IndentStyle = 'space' opts.convertTabsToSpaces = true @verbose('typescript', text, opts) result = format('', text, opts) @verbose(result) resolve result catch e return reject(e) ) define [ 'settings' 'promise' 'helpers/browser_helper' 'helpers/url_helper' ], (Settings, Promise, BrowserHelper, URLHelper)-> unique_id = 1 class Reporter constructor: (options)-> @base = Settings.url.base @queue = [] @transport = 'img' @_determineTransport().then @_enableProperJobHandler report: (url, payload) -> promise = new Promise() @_handleJob url, payload, promise promise _determineTransport: -> BrowserHelper.checkImages().then (images_enabled)-> @transport = 'script' unless images_enabled _enableProperJobHandler: => @_handleJob = @_properHandleJob while job_args = @queue.reverse().pop() @_handleJob.apply this, job_args _handleJob: -> @queue.push arguments _properHandleJob: (url, payload, promise)-> data = URLHelper.serialize payload, true url = URLHelper.appendData(url, data) @_createTransport(promise, url) _createTransport: (promise, url) -> cache_buster = "buster=#{+new Date()}_#{unique_id++}" element = document.createElement(@transport) element.onload = -> promise.resolve() element.onerror = -> promise.reject() element.src = URLHelper.appendData(url, cache_buster) sibling = document.getElementsByTagName('script')[0] sibling.parentNode.insertBefore(element, sibling) promise return Reporter # Miscellanious date support code. class DateSupport @stripSeconds: (date) -> date.setSeconds 0 date module.exports = DateSupport class Storylet constructor: (@id, @title, @text, @choices) -> Object.freeze @ angular.module 'qbn.storylet', ['qbn.state'] .factory 'storylets', (makeGameState) -> library = {} api = register: (args...) -> storylet = new Storylet args... library[storylet.id] = storylet # Storylets are stored in immutable form return this # Allow Chaining resolve: (q) -> if q instanceof Storylet q else makeGameState library[q.toString()] return Object.freeze api AS = ORBEON.xforms.server.AjaxServer Document = ORBEON.xforms.Document Events = ORBEON.xforms.Events # Returns a deferred object that gets resolved when the next Ajax response arrives AS.nextAjaxResponse = (formId) -> deferred = $.Deferred() seqNo = -> parseInt Document.getFromClientState formId, 'sequence' initialSeqNo = seqNo() onAjaxResponse = -> if seqNo() == initialSeqNo + 1 Events.ajaxResponseProcessedEvent.unsubscribe onAjaxResponse deferred.resolve() Events.ajaxResponseProcessedEvent.subscribe onAjaxResponse deferredmailer = null describe "Salad.Mailer", -> before -> mailer = new App.WelcomeMailer describe "#render", -> it "should render templates", -> content = mailer.render "rendering/test" content.should.equal "

    Hello World!

    " describe "#mail", -> todo = null beforeEach (done) -> App.Todo.create title: "Todo", (err, res) -> todo = res done() it "should send an email to the address", (done) -> mailer.welcome todo, (err, message) -> message.subject.should.equal "Your todos" message.to.should.equal "user@company.tld" message.from.should.equal "root@localhost" message.text.should.equal "text1" message.attachment[0].data.should.equal "html1" done() # coffeelint: disable=no_empty_functions _ = require 'underscore' flux = require 'flux-react' {CourseActions, CourseStore} = require './course' LOADING = 'loading' LOADED = 'loaded' FAILED = 'failed' CourseListingActions = flux.createActions [ 'load' 'loaded' 'reset' 'FAILED' ] CourseListingStore = flux.createStore actions: _.values(CourseListingActions) _asyncStatus: null load: -> # Used by API @_asyncStatus = LOADING @emit('load') reset: -> @_course_ids = [] CourseActions.reset() @_asyncStatus = null @emitChange() FAILED: -> @_asyncStatus = FAILED @emit('failed') loaded: (courses) -> @_course_ids = _.map courses, (course) -> CourseActions.loaded(course, course.id) course.id # Store only the ids @_asyncStatus = LOADED @emit('loaded') exports: isLoading: -> @_asyncStatus is LOADING isLoaded: -> @_asyncStatus is LOADED isFailed: -> @_asyncStatus is FAILED # Loads the store if it's not already loaded or loading # Returns false if the store is already loaded, true otherwise ensureLoaded: -> if @_asyncStatus is LOADED false else CourseListingActions.load() unless @_asyncStatus is LOADING true allCourses: -> return _.map @_course_ids, CourseStore.get module.exports = {CourseListingActions, CourseListingStore} configManager = require '../config-manager' resolve = require 'resolve' path = require 'path' getCompiler = (editor) -> filepath = editor.getPath() coffee = if filepath then maybeGetLocalCoffeescript(filepath) if coffee? then return coffee coffeescriptVersion = configManager.get('coffeescriptVersion') switch coffeescriptVersion when '2.0.2' return require('coffeescript') else # default back to 1.12.7 return require('coffee-script') # Check if there is a local coffee-script package, use that package if it exists maybeGetLocalCoffeescript = (filepath) -> basedir = path.dirname(filepath) rst = null try rst = path.dirname(resolve.sync('coffee-script', { basedir })) if rst then require rst module.exports = id: 'coffee-compile' selector: [ 'source.coffee' 'source.litcoffee' 'text.plain' 'text.plain.null-grammar', 'source.coffee.embedded.html' ] compiledScope: 'source.js' preCompile: (code, editor) -> return code compile: (code, editor) -> coffee = getCompiler editor literate = editor.getGrammar().scopeName is "source.litcoffee" bare = configManager.get('noTopLevelFunctionWrapper') bare ?= true return coffee.compile code, {bare, literate} postCompile: (code, editor) -> return code # See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': '.overlayer': 'Git add file': 'git-plus:add' 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Git Plus' 'submenu': [ { 'label': 'Add', 'command': 'git-plus:add' } { 'label': 'Add All', 'command': 'git-plus:add-all' } { 'label': 'Commit', 'command': 'git-plus:commit' } { 'label': 'Diff', 'command': 'git-plus:diff' } { 'label': 'Diff All', 'command': 'git-plus:diff-all' } { 'label': 'Add & Commit', 'command': 'git-plus:add-and-commit'} { 'label': 'Add All & Commit', 'command': 'git-plus:add-all-and-commit'} { 'label': 'Log', 'command': 'git-plus:log' } { 'label': 'Merge', 'command': 'git-plus:merge'} ] ] } ] # default - message + brief help gulp = require "gulp" runSequence = require "run-sequence" gulp.task "default", (cb) -> console.log('Building BokehJS for developer mode ...') runSequence("build", "install", "watch", cb) React = require 'react-atom-fork' {div} = require 'reactionary-atom-fork' module.exports = React.createClass render: -> {parentView} = @props {top, left, width, height} = parentView.selectionScrollRect() div className: 'selection-box-handle', style: { top: (top + height) + 'px' left: (left + width) + '%' } {Operator} = require './general-operators' # # It indents everything selected by the following motion. # class Indent extends Operator # Public: Indents the text selected by the given motion. # # count - The number of times to execute. # # Returns nothing. execute: (count=1) -> @indent(count) # Protected: Indents or outdents the text selected by the given motion. # # count - The number of times to execute. # direction - Either 'indent' or 'outdent' # # Returns nothing. indent: (count, direction='indent') -> mode = @vimState.mode @motion.select(count) {start} = @editor.getSelectedBufferRange() if direction == 'indent' @editor.indentSelectedRows() else if direction == 'outdent' @editor.outdentSelectedRows() else if direction == 'auto' @editor.autoIndentSelectedRows() if mode != 'visual' @editor.setCursorScreenPosition([start.row, 0]) @editor.moveToFirstCharacterOfLine() @vimState.activateCommandMode() # # It outdents everything selected by the following motion. # class Outdent extends Indent # Public: Indents the text selected by the given motion. # # count - The number of times to execute. # # Returns nothing. execute: (count=1) -> @indent(count, 'outdent') # # It autoindents everything selected by the following motion. # class Autoindent extends Indent # Public: Autoindents the text selected by the given motion. # # count - The number of times to execute. # # Returns nothing. execute: (count=1) -> @indent(count, 'auto') module.exports = {Indent, Outdent, Autoindent} React = require('react') import Problem from './Problem' import Level from './Level' import Contest from './Contest' Page = (props) ->
    MaterialProper = (props) -> if props.material.type == 'page' `` else if props.material.type == 'level' `` else if props.material.type == 'contest' `` else if props.material.type == 'epigraph' `` else if props.material.type == 'problem' `` else
    Unknown material type
    export default Material = (props) ->
    IncompatiblePackagesView = null viewUri = 'atom://incompatible-packages' createView = (state) -> IncompatiblePackagesView ?= require './incompatible-packages-view' new IncompatiblePackagesView(state) atom.deserializers.add name: 'IncompatiblePackagesView' deserialize: (state) -> createView(state) incompatiblePackagesStatusView = null module.exports = activate: -> atom.workspace.addOpener (filePath) -> createView(uri: viewUri) if filePath is viewUri atom.commands.add 'atom-workspace', 'incompatible-packages:view': -> atom.workspace.open(viewUri) 'incompatible-packages:clear-cache': -> for key, data of global.localStorage if key.indexOf('installed-packages:') is 0 global.localStorage.removeItem(key) 'incompatible-packages:reload-atom-and-recheck-packages': -> workspaceView = atom.views.getView(atom.workspace) workspaceView.trigger 'incompatible-packages:clear-cache' workspaceView.trigger 'window:reload' atom.packages.onDidActivateAll -> if atom.workspaceView?.statusBar? incompatibleCount = 0 for pack in atom.packages.getLoadedPackages() incompatibleCount++ unless pack.isCompatible() if incompatibleCount > 0 IncompatiblePackagesStatusView = require './incompatible-packages-status-view' incompatiblePackagesStatusView ?= new IncompatiblePackagesStatusView(atom.workspaceView.statusBar, incompatibleCount) deactivate: -> incompatiblePackagesStatusView?.remove() path = require 'path' _ = require 'underscore-plus' ImageEditor = require './image-editor' module.exports = activate: -> atom.workspace.registerOpener(openUri) atom.packages.once('activated', createImageStatusView) deactivate: -> atom.workspace.unregisterOpener(openUri) createImageStatusView = -> {statusBar} = atom.workspaceView if statusBar? ImageEditorStatusView = require './image-editor-status-view' view = new ImageEditorStatusView(statusBar) view.attach() # Files with these extensions will be opened as images imageExtensions = ['.gif', '.ico', '.jpeg', '.jpg', '.png'] openUri = (uriToOpen) -> uriExtension = path.extname(uriToOpen).toLowerCase() if _.include(imageExtensions, uriExtension) new ImageEditor(uriToOpen) define (require) -> Backbone = require('backbone') settings = require('cs!settings') SEARCH_URI = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}/search" return class SearchResults extends Backbone.Model url: () -> "#{SEARCH_URI}#{@query}" defaults: query: limits: [] sort: [] results: items: [] total: 0 initialize: (options = {}) -> @query = options.query or '' @fetch success: () => @set('loaded', true) require 'routes/route' TravisRoute = Travis.Route Route = TravisRoute.extend renderTemplate: -> $('body').attr('id', 'home') @_super.apply this, arguments @render 'repos', outlet: 'left', into: 'main' setupController: (controller)-> # TODO: this is redundant with repositories and recent routes toActivate = if @signedIn() then 'owned' else 'recent' @container.lookup('controller:repos').activate(toActivate) activate: -> # subscribe to pusher only if we're at a main route if @config.pusher.channels @get('pusher').subscribeAll(@config.pusher.channels) Travis.MainRoute = Route define [ 'jquery' 'underscore' 'backbone' 'marionette' 'cs!collections/content' 'cs!views/workspace/sidebar/toc-branch' 'hbs!templates/workspace/sidebar/toc' ], ($, _, Backbone, Marionette, content, TocBranchView, tocTemplate) -> return Marionette.CompositeView.extend template: tocTemplate itemView: TocBranchView itemViewContainer: 'ol' initialize: (options) -> if options?.collection @collection = options.collection @showNodes = true else @collection = content @listenTo(@collection, 'change change:contents', @render) # Override Marionette's showCollection() showCollection: () -> if @collection.branches data = @collection.branches() else data = @collection.models _.each data, (item, index) => @addItemView(item, TocBranchView, index) # We also need to override addItemView() addItemView: (item, ItemView, index) -> if item.branch or @showNodes Marionette.CompositeView::addItemView.call(@, item, ItemView, index) events: 'click .editor-content-title': 'changeTitle' changeTitle: -> title = prompt('Enter a new Title', @model.get('title')) if title then @model.set('title', title) yaml = require('js-yaml') argv = require('optimist').argv books = require './books.yml' retrieve = require('./src/retrieve') do -> console.log "Using books.yml with #{books.books.length} ISBNs" r = retrieve(books.books) if argv.table output = require('./src/tableOutput') output r out = argv.o or argv.out if typeof out is "string" fs = require('fs') r.then (data) -> fs.writeFile out, JSON.stringify(data, null, 2), (err) -> return console.log "Error writing file #{out}: #{err}" if err console.log "Wrote data to #{out}" {CompositeDisposable} = require 'atom' buildProject = require './lib/build-project' openLatestRptFile = require './lib/open-latest-rpt-file' module.exports = subscriptions: null config: buildDevScript: title: "Development Build Script", description: "Location of the Development Build Script (requires a compatible script, such as CBA's or ACE3's build.py)", type: "string", default: "/tools/build.py" buildReleaseScript: title: "Release Build Script" description: "Location of the Release Build Script (requires a compatible script, such as CBA's or ACE3's make.py)" type: "string" default: "/tools/make.py" appDataFolder: title: "Arma 3 AppData Folder", description: "Location of the Arma 3 Application Data Folder (location of RPT files)", type: "string", default: "%localappdata%\\Arma 3\\" activate: -> @subscriptions = new CompositeDisposable @subscriptions.add atom.commands.add 'atom-workspace', 'language-arma-atom:build-dev': => buildProject.dev() @subscriptions.add atom.commands.add 'atom-workspace', 'language-arma-atom:build-release': => buildProject.release() @subscriptions.add atom.commands.add 'atom-workspace', 'language-arma-atom:open-latest-RPT-file': => openLatestRptFile.open() deactivate: -> @subscriptions.dispose() THREE = require 'three' IsometricCamera = require './isometric_camera.coffee' class Renderer constructor: -> window.THREE = THREE rad = 0.0174532925 @scene = new THREE.Scene @renderer = new THREE.WebGLRenderer { alpha: true } @renderer.setSize window.innerWidth, window.innerHeight @renderer.setClearColor 0xffffff @canvas = @renderer.domElement @isometricCamera = new IsometricCamera @canvas @camera = @isometricCamera.camera console.log 'adding lights' @light = new THREE.PointLight(0xffffff, 1.1, 0) @light.position.set(0.0, 0, 900) @scene.add @light window.addEventListener 'resize', @handleWindowResize getScene: -> @scene handleWindowResize: (e) => @isometricCamera.update() @renderer.setSize window.innerWidth, window.innerHeight update: -> render: -> @renderer.render @scene, @camera module.exports = Renderer jQuery -> if $('#pagination').size() > 0 $('#pagination').hide() loading_posts = false $('#load-more-btn').show().click -> unless loading_posts loading_posts = true more_posts_url = $('#pagination .pagination .next a').attr('href') $this = $(this) $this.html('').addClass('disabled') $.getScript more_posts_url, -> $this.text('Load more').removeClass('disabled') if $this loading_posts = false $('[data-toggle="tooltip"]').tooltip() return $ -> $body = $('body') $('#container2') .on 'mouseenter', '.box', (e)-> $(this).addClass 'hover' $body.addClass 'box_hover' .on 'mouseleave', '.box', (e)-> $(this).removeClass 'hover' $body.removeClass 'box_hover' $('.tournament.plot').each (index, element) -> container = $(element) chart_element = container.children('.chart').get(0) y_axis_element = container.children('.y_axis').get(0) legend_element = container.children('.legend').get(0) palette = new Rickshaw.Color.Palette ajax_graph = new Rickshaw.Graph.Ajax({ element: chart_element width: 300 height: 100 min: 800 renderer: 'line' dataURL: container.data('url') onData: (d) -> for series in d series.color = palette.color() series.data = for point in series.data { x: Date.parse(point.period_at) / 1000.0 y: Math.round(parseFloat(point.rating) - 2.0 * parseFloat(point.rating_deviation)) } series onComplete: -> x_axis = new Rickshaw.Graph.Axis.Time graph: @graph y_axis = new Rickshaw.Graph.Axis.Y graph: @graph orientation: 'left' element: y_axis_element hover_detail = new Rickshaw.Graph.HoverDetail graph: @graph xFormatter: (x) -> new Date(x * 1000).toString() yFormatter: (y) -> y.toFixed(0) @graph.update() }) $ -> $(".chzn-select").chosen disable_search_threshold: 25 $("#problem_body").charCount allowed: 250 warning: 20 counterText: " characters remaining" $("#problem_solution_body").charCount allowed: 250 warning: 20 counterText: " characters remaining" charCounter = $("span.counter") charCounter.toggle() $("textarea#problem_body, textarea#problem_solution_body").focus -> $(this).next().toggle() $("textarea#problem_solution_body").focus -> $(this).css "padding-bottom", "+=5" $(this).css "margin-bottom", "+=10" $("textarea#problem_solution_body").focusout -> $(this).css "padding-bottom", "-=5" $(this).css "margin-bottom", "-=10" $("textarea#problem_body, textarea#problem_solution_body").focusout -> $(this).next().toggle() express = require 'express' routes = require './routes' app = module.exports = express() app.set 'views', __dirname + '/templates' app.set 'view engine', 'jade' app.get '/inquiry/development', routes.development app.get '/inquiry/debug/:id', routes.index app.get '/inquiry/debug/:id/*', routes.index app.get '/inquiry/:artwork_id', routes.index app.get '/inquiry/:id/user_outcome', routes.user_outcome %J(MW�.���i�k �x��� %*U+.�.�379�;�<m>@�DJ_MKO�S�VEZ:\�]�^a`�bMg"j3l.n\q�v{wm|@}π�Q�Ɍǐ�N�ܘd���Ѣ�:�g���i�(���_���������^�����"�<������������w�x��������L�A / �������"�'�+�,�0�14V7�:�<�?vB5GK:O RT�U�WIZ�[�_%b�fj�l�n�s�wHx�y�{s~U�K�I�{�0�Ð ���7����R�٥h�&����׶T����*�U���&�!���������������$���������:�����.�� ��&�2Y�"s%1*�-�/L4p7�<`A�B7H�K�P5U Z�^�b�d?h�mxoEp�q�s�u�y�~K�ֆ���Ɏ��g������~�ߟp���n���7��� �C�g�:���� �����z���/�����=�3�6�z��� ���� ��~���?�N#�'�) /�26�9P>S>�?B5DVE�I3K�S�V&\^ c�d�i?nipWr�tx�|^���C���؏f��7�>���;���K�L���R��)�Y�"��� �����{� ������0�5�F�������G�.�prettyPrint = require('html').prettyPrint React = require 'react' assertRendersHtml = (reactComponent, done, expectedHtml) -> if typeof(document) == 'undefined' React.renderComponentToString reactComponent, (html) -> html = html.replace /data-reactid="(.*?)"/g, '' html = html.replace /data-react-checksum="(.*?)"/g, '' html = prettyPrint html, indent_size: 2, unformatted: [] expect(html).toEqual expectedHtml done() else div = document.createElement('div') body = window.document.getElementsByTagName('body')[0] body.appendChild(div) React.renderComponent reactComponent, div html = div.innerHTML html = html.replace /data-reactid="(.*?)"/g, '' html = html.replace /data-react-checksum="(.*?)"/g, '' html = prettyPrint html, indent_size: 2, unformatted: [] expect(html).toEqual expectedHtml div.parentNode.removeChild div done() click = (node) -> if node.fireEvent # if IE8 if node.nodeName == 'INPUT' && node.type == 'checkbox' node.checked = not node.checked e = document.createEventObject() node.fireEvent 'onclick', e else node.dispatchEvent(new MouseEvent('click', { bubbles: true })) module.exports = { assertRendersHtml, click } path = require 'path' transformTools = require 'browserify-transform-tools' getReplacement = (file, aliases)-> if aliases[file] return aliases[file] else fileParts = /^([^\/]*)(\/.*)$/.exec(file) pkg = aliases[fileParts?[1]] if pkg? return pkg+fileParts[2] return null module.exports = transformTools.makeRequireTransform "aliasify", {jsFilesOnly: true, fromSourceFileDir: true}, (args, opts, done) -> if !opts.config then return done new Error("Could not find configuration for aliasify") aliases = opts.config.aliases verbose = opts.config.verbose configDir = opts.configData?.configDir or opts.config.configDir or process.cwd() result = null file = args[0] if file? and aliases? replacement = getReplacement(file, aliases) if replacement? if replacement.relative? replacement = replacement.relative else if /^\./.test(replacement) # Resolve the new file relative to the configuration file. replacement = path.resolve configDir, replacement fileDir = path.dirname opts.file replacement = "./#{path.relative fileDir, replacement}" if verbose console.error "aliasify - #{opts.file}: replacing #{args[0]} with #{replacement}" result = "require('#{replacement.replace(/\\/gi,"/")}')" done null, result edsl = (id, name, description, args = {}) -> {defaultValue, defaultProgress, maxProgress, hasProgress, visible} = args defaultValue ?= 0 defaultProgress ?= 0 maxProgress ?= if hasProgress then 100 else 0 visible ?= true Object.freeze new Quality(id, name, description, defaultValue, defaultProgress, maxProgress, visible) class Quality constructor: (@id, @name, @description, @defaultValue, @defaultProgress, @maxProgress, @visible) -> angular.module 'qbn.quality', ['qbn.state'] .factory 'qualityLibrary', (makeGameState) -> library = {} api = register: (args...) -> quality = edsl args... library[quality.id] = makeGameState quality # Qualities are stored in state form. return this # Allow Chaining resolve: (q) -> if q instanceof Quality q else library[q.toString()] getAll: () -> quality for _, quality of library when quality.visible return Object.freeze api --- --- pow2 = (exp) -> base = 1 base *= 2 while exp-- > 0 base recalculate = -> val = 0 for el in document.querySelectorAll '.flag-list input' val += pow2 el.getAttribute 'value' if el.checked document.getElementById('flag').value = val return document.addEventListener 'DOMContentLoaded', -> for el in document.querySelectorAll '.flag-list input' el.addEventListener 'click', recalculate return recalculate() _ = require 'underscore' {View} = require 'space-pen' Selection = require 'selection' MarkerView = require './marker-view' SearchResultsModel = require './search-results-model' # Will be one of these created per editor. module.exports = class SearchResultsView extends View @content: -> @div class: 'search-results' # options - # editor: an Atom Editor! initialize: (@searchModel, @editor) -> @model = new SearchResultsModel(@searchModel, @editor) @model.on 'change:markers', @addMarkerViews @model.on 'add:markers', @addMarkerViews @searchModel.on 'show:results', @onShowResults @searchModel.on 'hide:results', @onHideResults if @searchModel.resultsVisible @onShowResults() else @onHideResults() onHideResults: => view.remove() for view in @markerViews if @markerViews @markerViews = [] @hide() onShowResults: => @addMarkerViews({markers: @model.markers}) @show() addMarkerViews: ({markers}) => return unless @searchModel.resultsVisible @markerViews = (new MarkerView({@editor, marker}) for marker in markers) @append(view) for view in @markerViews @editor.requestDisplayUpdate() define [ 'app/views/base', 'app/tour' ], ( base, tour, ) -> class TourStartButton extends base.SMItemView className: 'feature-tour-start' template: 'feature-tour-start' events: 'click .close-button' : 'hideTour' 'click .prompt-button' : 'showTour' hideTour: (ev) -> p13n.set 'hide_tour', false @trigger 'close' ev.stopPropagation() showTour: (ev) -> tour.startTour() @trigger 'close' Meteor.startup -> return unless Meteor.isCordova # Handle click events for all external URLs $(document).on 'deviceready', -> platform = device.platform.toLowerCase() $(document).on 'click', (e) -> $link = $(e.target).closest('a[href]') return unless $link.length > 0 url = $link.attr('href') if /^https?:\/\/.+/.test(url) is true switch platform when 'ios' window.open url, '_system' when 'android' navigator.app.loadUrl url, {openExternal: true} e.preventDefault()Q = require 'q' Package = require './package' module.exports = class ThemePackage extends Package getType: -> 'theme' getStyleSheetPriority: -> 1 enable: -> atom.config.unshiftAtKeyPath('core.themes', @name) disable: -> atom.config.removeAtKeyPath('core.themes', @name) load: -> this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => try @loadStylesheets() @activateNow() catch error @handleError("Failed to activate the #{@name} theme", error) @activationDeferred.promise module.exports = class Util @log: console.log.bind console @logError: console.error.bind console @debug: (object) -> if @isDebug() @log object @isDebug: -> process.env.HUBOT_FLEEP_DEBUG is 'true' or false @parseOptions: -> email : process.env.HUBOT_FLEEP_EMAIL password : process.env.HUBOT_FLEEP_PASSWORD conversations : process.env.HUBOT_FLEEP_CONVERSATIONS?.split(',') or [] name : process.env.HUBOT_FLEEP_BOTNAME or 'FleepBot' debug : @isDebug() # Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. # See the LICENCE file in the repository root for full licence text. import core from 'osu-core-singleton' import { createElement } from 'react' import { ArtEntryList } from './contest-voting/art-entry-list' import { EntryList } from './contest-voting/entry-list' propsFunction = (target) -> data = osu.parseJson target.dataset.src return { contest: data.contest selected: data.userVotes options: showPreview: data.contest['type'] == 'music' showLink: data.contest['type'] == 'external' || (data.contest['type'] == 'beatmap' && _.some(data.contest.entries, 'preview')) } core.reactTurbolinks.register 'contestArtList', false, (target) -> createElement(ArtEntryList, propsFunction(target)) core.reactTurbolinks.register 'contestList', false, -> createElement(EntryList, propsFunction(target)) {$$, SelectListView} = require 'atom' module.exports = class DiffListView extends SelectListView initialize: -> super @addClass('diff-list-view overlay from-top') getEmptyMessage: -> 'No diffs' getFilterKey: -> 'lineText' attach: -> @storeFocusedElement() atom.workspaceView.appendToTop(this) @focusFilterEditor() viewForItem: ({oldStart, newStart, oldLines, newLines, lineText}) -> $$ -> @li class: 'two-lines', => @div lineText, class: 'primary-line' @div "-#{oldStart},#{oldLines} +#{newStart},#{newLines}", class: 'secondary-line' populate: -> diffs = atom.project.getRepo()?.getLineDiffs(@editor.getPath(), @editor.getText()) ? [] for diff in diffs bufferRow = if diff.newStart > 0 then diff.newStart - 1 else diff.newStart diff.lineText = @editor.lineForBufferRow(bufferRow)?.trim() ? '' @setItems(diffs) toggle: -> if @hasParent() @cancel() else if @editor = atom.workspace.getActiveEditor() @populate() @attach() confirmed: ({newStart})-> @cancel() bufferRow = if newStart > 0 then newStart - 1 else newStart @editor.setCursorBufferPosition([bufferRow, 0], autoscroll: true) @editor.moveCursorToFirstCharacterOfLine() {File} = require 'file-utils' fs = require 'fs' class LocaleTempFileRepository items : null constructor : (@items = {}) -> setInterval (=> @gc()), 60000 gc : -> console.log 'LocaleTempFileRepository.gc' now = new Date() validUntil = now - 60 for id, item of @items #when item.created < validUntil filePath = @items[id].filePath console.info item.created.getTime(), validUntil console.log "LocaleTempFileRepository.gc >> Deleting #{filePath}..." @remove id return add : (id) -> @items[id] = filePath : new File('../' + id).getAbsolutePath() created : new Date() remove : (id) -> if @items[id] fs.unlink @items[id].filePath, => delete @items[id] return exist : (id) -> @items[id] isnt undefined get : (id) -> if @exist id @items[id].filePath exports.LocaleTempFileRepository = LocaleTempFileRepositorytoggleQuotes = (editor) -> editor.transact -> for cursor in editor.getCursors() position = cursor.getBufferPosition() toggleQuoteAtPosition(editor, position) cursor.setBufferPosition(position) toggleQuoteAtPosition = (editor, position) -> range = editor.displayBuffer.bufferRangeForScopeAtPosition('.string.quoted', position) return unless range? text = editor.getTextInBufferRange(range) quoteCharacter = text[0] oppositeQuoteCharacter = getOppositeQuote(quoteCharacter) quoteRegex = new RegExp(quoteCharacter, 'g') escapedQuoteRegex = new RegExp("\\\\#{quoteCharacter}", 'g') oppositeQuoteRegex = new RegExp(oppositeQuoteCharacter, 'g') newText = text .replace(oppositeQuoteRegex, "\\#{oppositeQuoteCharacter}") .replace(escapedQuoteRegex, quoteCharacter) newText = oppositeQuoteCharacter + newText[1...-1] + oppositeQuoteCharacter editor.setTextInBufferRange(range, newText) getOppositeQuote = (quoteCharacter) -> if quoteCharacter is '"' "'" else '"' module.exports = activate: -> atom.workspaceView.command 'toggle-quotes:toggle', '.editor', -> editor = atom.workspace.getActiveEditor() toggleQuotes(editor) toggleQuotes: toggleQuotes class Controller _redirecting: false constructor: (@request, @response, view, layout) -> View = Import 'class.View$cs' @view = new View view, @response @view.setLayout layout beforeLoad: -> beforeRender: -> redirect: (args...) -> if args.length is 2 @response.redirect args[0], args[1] else @response.redirect args[0] @_redirecting = true render: (viewFile) -> viewFile ?= null if not @_redirecting then @view.render viewFile getQuery: (param, def) -> def ?= null return @request.query if typeof param is 'undefined' or not param? param = @request.query[param] if typeof param is 'undefined' then return def param getPost: (param, def) -> def ?= null return @request.body if typeof param is 'undefined' or not param? param = @request.body[param] if typeof param is 'undefined' then return def param getParam: (param, def) -> def ?= null param = @request.param param if typeof param is 'undefined' then return def param module.exports = Controllerdefine (require) -> Backbone = require('backbone') settings = require('settings') # Class to handle loading analytics scripts and wrapping # handlers around them so that modules don't have to # interact with global variables directly return new class AnalyticsHandler constructor: () -> # Setup temporary analytics.js objects # window.GoogleAnalyticsObject = 'ga' # window.ga = () -> (window.ga.q ?= []).push(arguments) # window.ga.l = 1 * new Date() # Initialize analytics.js account # window.ga('create', settings.analyticsID, 'auto') # ## Setup ga.js window._gaq ?= [] # Asynchronously load analytics.js. # require(['https://www.google-analytics.com/analytics.js']) # Asynchronously load ga.js require(['https://www.google-analytics.com/ga.js']) # Wrapper functions to add analytics events # ga: () -> window.ga?.apply(@, arguments) # analytics.js gaq: () -> window._gaq?.push(arguments[0]) # ga.js # Send the current page to every analytics service send: (account) -> fragment = Backbone.history.fragment if not /^\//.test(fragment) then fragment = '/' + fragment # Use the default analytics ID in settings if no account is specified account ?= settings.analyticsID # @ga('send', 'pageview') @gaq(['_trackPageview', fragment]) @gaq.push(['_setAccount', account], ['_trackPageview']) BaseStackEditorView = require './basestackeditorview' module.exports = class StackTemplateEditorView extends BaseStackEditorView constructor: (options = {}, data) -> unless options.content options.content = require '../defaulttemplate' super options, data class Skr.Components.CustomerProjectFinder extends Lanes.React.Component propTypes: onModelSet: React.PropTypes.func commands: React.PropTypes.object autoFocus: React.PropTypes.bool name: React.PropTypes.string selectField: React.PropTypes.bool getDefaultProps: -> autoFocus: false, label: 'Project Code', name: 'code' dataObjects: query: -> new Lanes.Models.Query({ syncOptions: include: [ 'customer', 'sku' ] src: Skr.Models.CustomerProject, fields: [ {id:'id', visible: false} { id: 'code', fixedWidth: 120 } { id: 'description', flex: 1 } { id: 'notes', flex: 1.5 } ] }) select: (model, proj) -> if @props.onModelSet @props.onModelSet(proj) else model.set(customer_project: proj) render: -> props = _.clone(@props) if props.selectField else 'use strict' apiResource = ($resource, resource, args) -> $resource "/api/#{resource}/:id" , # Default arguments args , # Override methods query: method: 'GET' isArray: false angular.module('taarifaWaterpointsApp') .factory 'Waterpoint', ($resource) -> apiResource $resource, 'waterpoints', projection: _id: 1 district: 1 latitude: 1 longitude: 1 wpt_code: 1 status: 1 class Lanes.Components.Grid.Selections id: 'selected' query: false textAlign: 'center' fixedWidth: 90 defaultClicked: true constructor: (options) -> @onChange = options.onChange @choices = {} _.bindAll(@, 'onColumnClick') @render = _.partial(@render, _, @) onColumnClick: (ev, {rowNum, field, query}) -> unless ev.target.tagName is 'INPUT' input = ev.target.querySelector('input') input.checked = !input.checked @select({target: input}, @, query.results, rowNum) ev.stopPropagation() select: (ev, me, results, index) -> x = results.xtraData(index) x.selected = ev.target.checked me.onChange?(index) render: (props, me) -> id = props.row[props.query.idIndex] x = props.query.results.xtraData(props.index) x.selected = me.defaultClicked unless x.selected? [ { title: "CDS-411 Instructors" group: "CDS-411" paths: [ "~/Courses/CDS-411/instructors" ] } { title: "Spyns" group: "Development" paths: [ "~/Development/spyns" ] } { title: "CSI-702 Spr17: Homework02 Instructor Attempt" group: "CSI-702" paths: [ "~/Documents/work/teaching/2017_Spring_Semester/CSI-702_High_Performance_Computing/assignments/homework02-instructor-attempt" ] } { title: "JS Random Walk" group: "Development" paths: [ "~/Development/js-random-walk" ] } ] $(document).on 'page:change', -> if window._gaq? _gaq.push ['_trackPageview'] else if window.pageTracker? pageTracker._trackPageview()make_element = (name, v) -> e = $ "<#{name}>" e.append v for n in ["label", "div", "span", "button", "img", "figure", "figcaption", "h1", "h2", "h3", "table", "thead", "tfoot", "tbody", "tr", "th", "td", "form", "select", "option"] @[n] = do (n) -> (v) -> make_element n, v program = require 'commander' msgflo_nodejs = require 'msgflo-nodejs' fs = require 'fs' path = require 'path' foreigner = require '../foreign-participant' yaml = require 'js-yaml' onError = (err) -> console.log err process.exit 1 onComplete = -> process.exit 0 main = -> program .option('--broker ', 'Broker address', String, 'amqp://localhost') .usage('[options] ') .parse(process.argv) defPath = path.resolve process.cwd(), program.args[0] fs.readFile defPath, 'utf-8', (err, contents) -> return onError err if err return onError "No definition found in #{defPath}" unless contents try definition = yaml.safeLoad contents catch e return onError e definition.id = path.basename defPath, path.extname defPath unless definition.id definition.role = path.basename defPath, path.extname defPath unless definition.role inPorts = definition.inports or {} definition.inports = Object.keys(inPorts).map (id) -> def = inPorts[id] def.id = id def outPorts = definition.outports or {} definition.outports = Object.keys(outPorts).map (id) -> def = outPorts[id] def.id = id def foreigner.register program.broker, definition, (err) -> return onError err if err onComplete() exports.main = main {Range} = require('atom') path = require 'path' child_process = require('child_process') Helpers = module.exports = error: (e) -> atom.notifications.addError(e.toString(), {detail: e.stack or '', dismissable: true}) shouldTriggerLinter: (linter, onChange, scopes) -> # Trigger lint-on-Fly linters on both events but on-save linters only on save # Because we want to trigger onFly linters on save when the # user has disabled lintOnFly from config return false if onChange and not linter.lintOnFly return false unless scopes.some (entry) -> entry in linter.grammarScopes return true requestUpdateFrame: (callback) -> setTimeout(callback, 100) debounce: (callback, delay) -> timeout = null return (arg) -> clearTimeout(timeout) timeout = setTimeout(() => callback.call(this, arg) , delay) isPathIgnored: (filePath) -> repo = null for projectPath, i in atom.project.getPaths() if filePath.indexOf(projectPath + path.sep) is 0 repo = atom.project.getRepositories()[i] break return true if repo and repo.isProjectAtRoot() and repo.isPathIgnored(filePath) return false {$$, BufferedNodeProcess} = require 'atom' module.exports = activate: -> atom.workspaceView.command 'update-package-dependencies:update', => @update() update: -> view = @createProgressView() atom.workspaceView.append(view) command = atom.packages.getApmPath() args = ['install'] options = {cwd: atom.project.getPath()} exit = (code, signal) -> atom.workspaceView.one 'core:cancel', -> view.remove() view.empty().focus().on 'focusout', -> view.remove() success = (code == 0) if success view.append $$ -> @div class: 'text-success', 'Package depencencies updated.' else view.append $$ -> @div class: 'text-error', 'Failed to update package depencencies.' new BufferedNodeProcess({command, args, exit, options}) createProgressView: -> $$ -> @div tabindex: -1, class: 'overlay from-top', => @span class: 'loading loading-spinner-small inline-block' @span "Updating package dependencies\u2026" ###* @jsx React.DOM ### window.CwbSimpleInput = React.createClass getInitialState: -> searchText: '' displayedQuery: -> '' handleTextChange: (e) -> console.log('text') @setState(searchText: e.target.value) handleSearch: (e) -> console.log('search') render: -> `
    ` $(document).ready -> # Photo grid photoGrid = $(".photo-grid") photoGrid.imagesLoaded -> photoGrid.trigger "reload:grid" $(window).resize -> photoGrid.trigger "reload:grid" photoGrid.on "reload:grid", -> opts = wookmarkOptions(calculateGridWidth()) photoGrid.find(".photo, .user-block").wookmark(opts) # Description size tweaking on photo show image = $(".display .image img") if image.length > 0 image.on "resize", -> image.siblings(".description").innerWidth(image.width()) image.trigger "resize" $(window).resize -> image.trigger "resize" module.exports = -> chai = require 'chai' chai.use require 'chai-as-promised' @World.prototype.expect = chai.expect module.exports = -> highlightSelectedPackage = atom.packages.getLoadedPackage('highlight-selected') highlightSelected = require (highlightSelectedPackage.path) HighlightedAreaView = require (highlightSelectedPackage.path + '/lib/highlighted-area-view') class FakeEditor constructor: (@minimap) -> getActiveMinimap: -> @minimap.getActiveMinimap() getActiveTextEditor: -> @getActiveMinimap()?.getTextEditor() ['markBufferRange', 'scanInBufferRange', 'getEofBufferPosition', 'getSelections', 'getLastSelection', 'bufferRangeForBufferRow', 'getTextInBufferRange', 'onDidChangeSelectionRange'].forEach (key) -> FakeEditor::[key] = -> @getActiveTextEditor()?[key](arguments...) ['decorateMarker'].forEach (key) -> FakeEditor::[key] = -> @getActiveMinimap()[key](arguments...) class MinimapHighlightSelectedView extends HighlightedAreaView constructor: (minimap) -> @fakeEditor = new FakeEditor(minimap) super getActiveEditor: -> @fakeEditor handleSelection: -> return unless atom.workspace.getActiveTextEditor()? return unless @fakeEditor.getActiveTextEditor()? super SidebarMachineList = require './sidebarmachinelist' module.exports = class SidebarSharedMachinesList extends SidebarMachineList constructor: (options = {}, data) -> options.title = 'Shared VMs' options.hasPlusIcon = no options.cssClass = 'shared-machines' { shared, collaboration } = data data.machine.isSharedMachine = yes for data in shared data.machine.isCollaborationMachine = yes for data in collaboration data = shared.concat collaboration super options, data App.Store = DS.Store.extend revision: 11 adapter: App.Adapter.create() TitleBar = require '../src/title-bar' describe "TitleBar", -> it 'updates the title based on document.title when the active pane item changes', -> titleBar = new TitleBar({ workspace: atom.workspace, themes: atom.themes, applicationDelegate: atom.applicationDelegate, }) expect(titleBar.element.querySelector('.title').textContent).toBe document.title initialTitle = document.title atom.workspace.getActivePane().activateItem({ getTitle: -> 'Test Title' }) expect(document.title).not.toBe(initialTitle) expect(titleBar.element.querySelector('.title').textContent).toBe document.title # Description: # Find the build status of an open-source project on Travis # Can also notify about builds, just enable the webhook notification on travis http://about.travis-ci.org/docs/user/build-configuration/ -> 'Webhook notification' # # Dependencies: # # Configuration: # None # # Commands: # hubot travis me / - Returns the build status of https://github.com// # # URLS: # POST /hubot/travis?room=[&type= robot.router.post "/hubot/magnum-ci", (req, res) -> try payload = JSON.parse req.body.payload user = {} user.room = payload.room if payload.room user.type = payload.type if payload.type robot.send "#{payload.title}" catch error console.log "travis hook error: #{error}. Payload: #{req.body.payload}" res.end JSON.stringify { send: true #some client have problems with and empty response, sending that response ion sync makes debugging easier }if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question' gulp = require 'gulp' sequence = require 'gulp-run-sequence' require('./clean') gulp require('./coffee') gulp require('./jade') gulp require('./scss') gulp require('./vendor') gulp require('./watch') gulp require('./webserver') gulp require('./specs') gulp module.exports = (gulp) -> gulp.task 'build', -> sequence( 'build:clean' [ 'build:scss' 'build:jade' 'build:coffee' 'build:bower' 'build:copy:scripts' ] 'build:webserver' 'build:watch' ) gulp.task 'default', -> sequence 'build'helper = settingsPath: "#{__dirname}/projects.test.cson" savedProjects: null readFile: (callback) -> callback(helper.projects) writeFile: (projects, callback) -> helper.projects = projects callback?() projects: testproject1: title: "Test project 1" group: "Test" paths: [ "/Users/project-1" ] testproject2: title: "Test project 2" group: "Test" paths: [ "/Users/project-2" ] helper.savedProjects = Object.keys(helper.projects).length module.exports = helper# tael.js # Copyright (c) 2015 Carter Hinsley # MIT License module.exports = -> ($ document).ready -> ($ '.tael-container') .append( ($ '
    ') .addClass 'tael-node-leaf' .text 'Hello, world!' ) Slack = require('slack-client') require('events').EventEmitter config = require('../../../config.json').slack; class SlackIntegration constructor: (opts)-> { @token } = opts @slack = new Slack(@token, true, true) @slack.login() @slack_channels = [] @config_channels = config.channels @slack.on 'error', (err)-> console.log 'Slack error!', err @slack.on 'open', (data)=> @slack_channels = (channel for id, channel of @slack.channels when channel.is_member) @slack.on 'message', (message)=> channel = @slack.getChannelGroupOrDMByID(message.channel) #event.emit() sendNotification: (player, game)-> return if not @config_channels or not @slack_channels channels = @getChannelsToNotify(player) message = config.message.replace('#{player}', player).replace('#{game}', game) channel.send(message) for channel in channels getChannelsToNotify: (player)=> userChannels = (channel for channel in @config_channels when channel.indexOf(player) isnt -1) notifyChannels = (channel for channel in @slack_channels when userChannels[channel.name] isnt -1) notifyChannels module.exports = SlackIntegration Slack = require('slack-client') require('events').EventEmitter config = require('../../../config.json').slack; class SlackIntegration DEFAULT_MESSAGE = "#{player} is playing #{game}. Go join them!" constructor: (opts)-> { @token } = opts @slack = new Slack(@token, true, true) @slack.login() @slack_channels = [] @config_channels = config.channels @slack.on 'error', (err)-> console.log 'Slack error!', err @slack.on 'open', (data)=> @slack_channels = (channel for id, channel of @slack.channels when channel.is_member) @slack.on 'message', (message)=> channel = @slack.getChannelGroupOrDMByID(message.channel) #event.emit() sendNotification: (player, game)-> return if not @config_channels or not @slack_channels channels = @getChannelsToNotify(player) message = if config.message then formatMessage(config.message, player, game) else formatMessage(DEFAULT_MESSAGE, player, game) channel.send(message) for channel in channels getChannelsToNotify: (player)=> userChannels = (channel for channel in @config_channels when channel.indexOf(player) isnt -1) notifyChannels = (channel for channel in @slack_channels when userChannels[channel.name] isnt -1) notifyChannels formatMessage: (message, player, game)-> message.replace('#{player}', player) if player message.replace('#{game}', game) if game message module.exports = SlackIntegration define [ 'phaser' 'underscore' 'app/helpers' ], (Phaser, _, Helpers) -> 'use strict' {Keyboard} = Phaser class InStateMenu constructor: (@textItems, game, options = {}) -> {@pauseHandler, @layout, @toggleKeyCode} = _.defaults options, layout: { y: 120, baseline: 40 } pauseHandler: (paused) -> game.paused = paused toggleKeyCode: Keyboard.P {@add, @height, @input, @width, @world} = game @_initialize() _initialize: -> @group = @add.group() @overlay = @add.graphics 0, 0, @group @overlay.beginFill 0x000000, 0.2 @overlay.drawRect 0, 0, @width, @height @overlay.endFill() for [text, style] in @textItems _.defaults style, { fill: '#fff', font: 'Enriqueta' } @addCenteredText text, @layout, style, @group @toggleKey = @input.keyboard.addKey @toggleKeyCode @toggleKey.onDown.add => @toggle() @toggle off destroy: -> @toggleKey.onDown.removeAll() toggle: (toggled) -> toggled ?= not @group.visible @group.visible = toggled @pauseHandler toggled _.extend InStateMenu::, Helpers.TextMixin InStateMenu $ -> DIC_URL_PREFIX = 'http://alldic.daum.net/search.do?dic=eng&q=' IMAGES_URL_PREFIX = 'http://images.search.yahoo.com/search/images?p=' $input = $('input') $button = $('button') $dicIframe = $('iframe.dic') $imagesIframe = $('iframe.images') search = -> query = $input.val() return if query is '' $dicIframe.prop 'src', DIC_URL_PREFIX + query $imagesIframe.prop 'src', IMAGES_URL_PREFIX + query return do bindEvents = -> $(document).on 'keydown', (e) -> NUM_1_KEY = 49 NUM_2_KEY = 50 if e.ctrlKey and (e.which is NUM_1_KEY) $dicIframe.contentWindow.focus() if e.ctrlKey and (e.which is NUM_2_KEY) $imagesIframe.contentWindow.focus() $input.on 'keydown', (e) -> search() if e.which is 13 $button.click search do init = -> $input.focus() _ = require 'underscore' pkg = require '../package.json' module.exports = (app) -> # homepage app.get '/', (req, res, next) -> res.json _.omit pkg, 'devDependencies' # retrieve a link to the generated pdf app.post '/api/pdf/url', (req, res, next) -> # - generate pdf # - respond with JSON containing link to PDF # generate and render pdf in the browser app.post '/api/pdf/render', (req, res, next) -> # - generate pdf # - respond with pdf # generate and download pdf app.post '/api/pdf/download', (req, res, next) -> # - generate pdf # - respond with download class @StickyHeader stickMarker: document.getElementsByClassName('js-sticky-header') constructor: -> $(window).on 'scroll', @stickOrUnstick $(document).on 'ready page:load osu:page:change', @stickOrUnstick stickOrUnstick: => return if @stickMarker.length == 0 for marker in @stickMarker by -1 if marker.getBoundingClientRect().top < 0 $.publish 'stickyHeader', marker.getAttribute('data-sticky-header-target') return $.publish 'stickyHeader' #= require jiffy_enum #= require_self class window.JiffyEnums constructor: (@hash) -> # equavalent to [] in ruby get: (key) => @hash[key] each: (func) => _.each(@hash, func) all: (func) => _.values(@hash) for_value: (value) => _.each( all(), (_enum) -> return _enum if value == _enum.value ) for_ordinal: (ordinal) => _.each( all(), (_enum) -> return _enum if ordinal == _enum.ordinal ) all_to_hash: () => hash = {} each( (_enum, key) -> hash[key] = _enum.value ) hash Steam.ModelSelectionView = (_) -> _selections = nodes$ [] _hasSelection = lift$ _selections, (selections) -> selections.length > 0 _caption = lift$ _selections, (selections) -> "#{describeCount selections.length, 'model'} selected." scoreSelections = -> _.promptForFrame (action, frameKey) -> switch action when 'confirm' scorings = map _selections(), (selection) -> frameKey: frameKey model: selection.data status: null time: null result: null timestamp: Date.now() _.switchToScoring type: 'scoring', scorings: scorings _.deselectAllModels() when 'error' _.fail 'Error', 'An error occured while fetching the list of datasets.', error, noop clearSelections = -> _.deselectAllModels() link$ _.modelSelectionChanged, (isSelected, model) -> if isSelected _selections.push model else _selections.remove model link$ _.modelSelectionCleared, -> _selections.removeAll() caption: _caption hasSelection: _hasSelection clearSelections: clearSelections scoreSelections: scoreSelections template: 'model-selection-view' class Workbench.Controllers.SensorsController extends Backbone.Marionette.Controller initialize: (options) -> @$el = options.el @getApiKey() Workbench.source = new Geocens.DataService({ api_key: @apiKey }) # Ensure the API Key is displayed in the URL params. addApiKeyParam: (base) -> # if (location.search.length < 1) # Backbone.history.navigate "#{base}?api_key=#{@apiKey}", { replace: true } # Check params for API Key. getApiKey: -> if (location.search.length > 0) params = deparam(location.search.split('?')[1]) @apiKey ||= params.api_key # # Actions # index: => @addApiKeyParam("sensors") @sensors = new Workbench.Collections.SensorsCollection source: Workbench.source mainView = new Workbench.Views.SensorIndexView collection: @sensors el: @$el mainView.render() @sensors.fetch() show: (id) => @addApiKeyParam("sensors/#{id}") @sensor = new Workbench.Models.Sensor source: Workbench.source uid: id @sensor.fetch() mainView = new Workbench.Views.SensorShowView model: @sensor el: @$el mainView.render() class Workbench.Routers.WorkbenchRouter extends Backbone.Router initialize: (options) -> @sensor = options.sensor @navigate(@sensor.id) routes: '': 'index' ':id/': 'show' index: -> console.log "loading index route" # render index view show: (id) -> console.log "loading show route", id # render show view showView = new Workbench.Views.SensorShowView model: new Workbench.Models.Sensor(@sensor) el: $("#sensorView") showView.render() class NumberFieldUpdater @hideReadOnly: (id) -> toggleReadOnly(id, false) resetInput(id) @showReadOnly: (id) -> toggleReadOnly(id, true) @showForm: (id) -> toggleForm(id, true) @hideForm: (id) -> toggleForm(id, false) @successHandler: (id, newNumber) -> $("#number-update-#{id} span").text(newNumber) @hideForm(id) @showReadOnly(id) toggleReadOnly = (id, show) -> toggleButtonVisibility('edit', id, show) toggleButtonVisibility('trash', id, show) cssDisplay = if show then 'block' else 'none' $("#number-update-#{id} span").css('display', cssDisplay) toggleForm = (id, show) -> toggleButtonVisibility('cancel', id, show) toggleButtonVisibility('check', id, show) cssDisplay = if show then 'block' else 'none' $("#number-update-#{id} input[type='number']").css('display', cssDisplay) toggleButtonVisibility = (buttonIcon, id, show) -> cssDisplay = if show then 'inline-block' else 'none' $(".fa-#{buttonIcon}[data-id='#{id}']").css('display', cssDisplay) resetInput = (id) -> tableCell = $("#number-update-#{id}") countText = tableCell.find('span').text().trim() tableCell.find("input[type='number']").val(countText) Spree.NumberFieldUpdater = NumberFieldUpdater goog.provide 'app.react.Layout' class app.react.Layout ###* PATTERN(steida): Here we can choose mobile/tablet/desktop layout. @param {app.Routes} routes @param {app.react.Header} header @param {app.react.Footer} footer @constructor ### constructor: (routes, header, footer) -> {div} = React.DOM @create = React.createClass render: -> div className: 'layout', header.create() @props.page.create() footer.create()define (require) -> $ = require('jquery') linksHelper = require('cs!helpers/links') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./filter-template') require('less!./filter') return class SearchResultsFilterView extends BaseView template: template templateHelpers: url: () -> queryString = linksHelper.serializeQuery(window.location.search) q = queryString.q delete queryString.page delete queryString.q params = linksHelper.param(queryString) params += '&' if params url = "#{location.pathname}?#{params}q=#{q}" return url events: 'click .toggle': 'toggleLimits' initialize: () -> super() @listenTo(@model, 'change:results', @render) onRender: () -> @$el.find('.collapsed').append('
  • More...
  • ') toggleLimits: (e) -> $target = $(e.currentTarget) $limits = $target.siblings('.overflow') $text = $target.children('.text') if @expanded $limits.addClass('hidden') $text.text('More...') $text.removeClass('less') @expanded = false else $limits.removeClass('hidden') $text.text('Less...') $text.addClass('less') @expanded = true init = -> primary_lang = $("#catalog_primary_language") other_lang_boxes = \ $("input[type=checkbox][name='catalog[other_languages][]']") update_boxes = (evt)-> primary_value = primary_lang.val() other_lang_boxes.attr("disabled", false) match_box = $("input[type=checkbox][value=#{primary_value}]") match_box.attr("disabled", true) if primary_lang.length > 0 primary_lang.on "change", update_boxes update_boxes() $('#catalog_data_only').on 'change', (e) -> if $('#catalog_data_only')[0].checked $('#catalog_custom_root_page_id').attr 'disabled', 'disabled' $('#catalog_advertize').attr 'disabled', 'disabled' else $('#catalog_custom_root_page_id').attr 'disabled', null $('#catalog_advertize').attr 'disabled', null return $(document).ready(init) 'global': 'core': 'themes': [ 'inbox-light-ui' ] 'disabledPackages': [ "atom-dark-syntax", "atom-dark-ui", "atom-light-syntax", "atom-light-ui", "one-dark-syntax", "one-dark-ui", "one-light-syntax", "one-light-ui", "base16-tomorrow-dark-theme", "base16-tomorrow-light-theme", "solarized-dark-syntax", "solarized-light-syntax", "archive-view", "autocomplete", "autoflow", "autosave", "background-tips", "bookmarks", "bracket-matcher", "command-palette", "deprecation-cop", "encoding-selector", "dev-live-reload", "exception-reporting", "feedback", "find-and-replace", "fuzzy-finder", "git-diff", "go-to-line", "grammar-selector", "image-view", "incompatible-packages", "keybinding-resolver", "link", "markdown-preview", "metrics", "open-on-github", "package-generator", "release-notes", "settings-view", "snippets", "spell-check", "status-bar", "styleguide", "symbols-view", "tabs", "timecop", "tree-view", "update-package-dependencies", "welcome", "whitespace", "wrap-guide", "language-c", "language-coffee-script", "language-css", "language-gfm", "language-git", "language-go", "language-html", "language-hyperlink", "language-java", "language-javascript", "language-json", "language-less", "language-make", "language-mustache", "language-objective-c", "language-perl", "language-php", "language-property-list", "language-python", "language-ruby", "language-ruby-on-rails", "language-sass", "language-shellscript", "language-source", "language-sql", "language-text", "language-todo", "language-toml", "language-xml", "language-yaml", # Temporarily disabled "sidebar-fullcontact", "message-templates", "calendar-bar", "salesforce" ] setTimeout -> if /^(interactive|complete)$/.test(document.readyState) FactlinkJailRoot.host_ready_promise.resolve() else document.addEventListener('DOMContentLoaded', -> FactlinkJailRoot.host_ready_promise.resolve()) if 'complete' == document.readyState FactlinkJailRoot.host_loaded_promise.resolve() else window.addEventListener('load', -> FactlinkJailRoot.host_loaded_promise.resolve()) , 0 fs = require 'fs' expect = require 'expect.js' config = require '../../../test/test_config' models = require('../lib/schema').load(config) common = require '../../../test/common' describe "Dotstorm Canvas to image from idea", -> before (done) -> @mahId = undefined common.startUp (server) => @server = server done() after (done) -> common.shutDown(@server, done) it "creates idea", (done) -> idea = new models.Idea dotstorm_id: "aaaaaaaaaaaaaaaaaaaaaaaa" background: "#ffffdd" tags: "ok" description: "whatevs" drawing: [["pencil", 0, 0, 400, 400]] idea.save (err) => @mahId = idea._id expect(err).to.be null expect(fs.existsSync idea.getDrawingPath("small")).to.be true done() return true it "removes the idea", (done) -> models.Idea.findOne {_id: @mahId}, (err, idea) -> expect(err).to.be null expect(idea).to.not.be null idea.remove (err) -> expect(fs.existsSync idea.getDrawingPath("small")).to.be false done() module.exports = (grunt, options) -> return { options: client: true files: '<%= build %>/js/templates.js': ['views/templates/**/*.jade'] dev: options: data: debug: true dist: options: data: debug: false } module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON "package.json" sass: dist: files: "{{ app_name }}/static/{{ app_name }}/css/app.css": "{{ app_name }}/static/{{ app_name }}/sass/app.sass" options: style: "compressed" watch: css: files: "{{ app_name }}/**/*.s?ss" tasks: ["sass", ] TASKS = [ "grunt-contrib-sass", "grunt-contrib-watch" ] [grunt.loadNpmTasks a for a in TASKS] grunt.registerTask "default", ["watch", ] window.LOG = () -> console?.log?(arguments...) window.init_loading_button = () -> $('body').on 'click', '.btn-loading', -> $(this).button('loading') window.init_time = () -> if ($ 'time').length > 0 recalculate = -> ($ 'time[datetime]').each -> date = moment.utc ($ this).attr 'datetime' diff = moment().diff date , 'days' if diff > 25 ($ this).text date.local().format 'YYYY-DD-MM' else ($ this).text date.fromNow() ($ this).attr 'title', date.local().format 'dddd, MMMM Do YYYY, HH:mm:ss Z' recalculate() setInterval -> recalculate() , 1000 * 60 mongoose = require '../connection' Schema = mongoose.Schema ObjectId = Schema.ObjectId MessageSchema = new Schema( Name: String Subject: String Message: String Date: Date Phone: String Country: String Attachments: String ) Message = mongoose.model('Message', MessageSchema) module.exports = Message [] class Lanes.Components.Input extends Lanes.React.Component mixins: [ Lanes.Components.Form.FieldMixin ] formGroupClass: 'input' getDefaultProps: -> type: 'text' propTypes: unlabled: React.PropTypes.bool getValue: -> @refs.input.getValue() handleKeyDown: (ev) -> @props.onEnter() if ev.key is 'Enter' renderEdit: (label) -> value = @props.model[@props.name] or '' label = @props.label or _.field2title(@props.name) props = _.extend({ ref: 'input' className: _.classnames('value', changeset: @state.changeset) label: if @props.unlabeled then label else false value: value onKeyDown: @handleKeyDown if @props.onEnter onChange: @handleChange }, @props) if @props.inputOnly then @renderPlain(props) else @renderStyled(props, label) renderPlain: (props) -> renderStyled: (props, label) -> colProps = _.omit(props, 'name') Transformations["Checkmark"] = (object) -> Transformations.static(Checkmarks.Checkmark, object) Checkmarks = Collections["Checkmark"] = new Mongo.Collection("Checkmarks", {transform: if Meteor.isClient then Transformations.Checkmark else null}) class Checkmarks.Checkmark constructor: (doc) -> _.extend(@, doc) CheckmarkPreSave = (userId, changes) -> now = new Date() changes.updatedAt = changes.updatedAt or now Checkmarks.before.insert (userId, Checkmark) -> Checkmark._id ||= Random.id() now = new Date() _.defaults(Checkmark, userId: userId updatedAt: now createdAt: now ) throw new Meteor.Error("Checkmark:userId:empty", "Checkmark::userId is empty", Checkmark) if not Checkmark.userId CheckmarkPreSave.call(@, userId, Checkmark) true Checkmarks.before.update (userId, Checkmark, fieldNames, modifier, options) -> modifier.$set = modifier.$set or {} CheckmarkPreSave.call(@, userId, modifier.$set) true {CompositeDisposable} = require 'atom' module.exports = class VariableMarker constructor: ({@marker, @variable}) -> @subscriptions = new CompositeDisposable @subscriptions.add @marker.onDidDestroy => @destroyed() @subscriptions.add @variable.onDidDestroy => @destroy() destroy: -> return if @wasDestroyed @marker.destroy() destroyed: -> return if @wasDestroyed @subscriptions.dispose() {@marker, @variable} = {} @wasDestroyed = true match: (properties) -> bool = true if properties.bufferRange? bool &&= @marker?.getBufferRange().isEqual(properties.bufferRange) if properties.variable bool &&= @variable?.isEqual(properties.variable) bool serialize: -> return if @wasDestroyed { markerId: @marker.id bufferRange: @marker.getBufferRange().serialize() variable: @variable.name } {Emitter} = require 'atom' module.exports = class MessageManager constructor: (csound, Csound) -> @emitter = new Emitter messageCallback = (Csound, attributes, string) => @emitter.emit 'did-receive-message', {string: string, attributes: attributes} csound.SetDefaultMessageCallback messageCallback csound.SetMessageCallback Csound, messageCallback csound.SetIsGraphable Csound, true csound.SetMakeGraphCallback Csound, (data, name) => @emitter.emit 'graph-creation-request', {name: name, data: data} csound.SetDrawGraphCallback Csound, (data) => @emitter.emit 'graph-drawing-request', data onDidReceiveMessage: (callback) -> @emitter.on 'did-receive-message', callback onGraphCreationRequest: (callback) -> @emitter.on 'graph-creation-request', callback onGraphDrawingRequest: (callback) -> @emitter.on 'graph-drawing-request', callback _ = require('underscore')._ CONS = require '../lib/constants' Q = require 'q' class Categories constructor: -> @id2index = {} @name2id = {} @fqName2id = {} @duplicateNames = [] getAll: (rest) -> deferred = Q.defer() rest.GET "/categories?limit=1000", (error, response, body) -> if error deferred.reject 'Error on getting categories: ' + error else if response.statusCode isnt 200 deferred.reject "Problem on getting categories:\n" + "status #{response.statusCode})\n" + "body " + response.body else categories = body.results deferred.resolve categories deferred.promise buildMaps: (categories) -> for category, index in categories name = category.name[CONS.DEFAULT_LANGUAGE] id = category.id @id2index[id] = index if _.has @name2id, name @duplicateNames.push name @name2id[name] = id for category, index in categories fqName = '' if category.ancestors for anchestor in category.ancestors cat = categories[@id2index[anchestor.id]] name = cat.name[CONS.DEFAULT_LANGUAGE] fqName = "#{fqName}#{name}#{CONS.DELIM_CATEGORY_CHILD}" @fqName2id["#{fqName}#{category.name[CONS.DEFAULT_LANGUAGE]}"] = category.id module.exports = Categories packages: [ "editorconfig" "file-icons" "highlight-selected" "language-docker" "language-typescript-grammars-only" "linter" "linter-coffeelint" "linter-csslint" "linter-docker" "linter-flake8" "linter-htmlhint" "linter-js-yaml" "linter-jshint" "linter-jsonlint" "linter-less" "linter-php" "linter-scss-lint" "linter-shellcheck" "linter-tslint" "linter-write-good" "linter-xmllint" "minimap" "omni-ruler" "package-sync" "pigments" "platformio-ide-terminal" "pretty-json" "sort-lines" ] {WorkspaceView} = require 'atom' NotationalVelocity = require '../lib/notational-velocity' # Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. # # To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` # or `fdescribe`). Remove the `f` to unfocus the block. describe "NotationalVelocity", -> activationPromise = null beforeEach -> atom.workspaceView = new WorkspaceView activationPromise = atom.packages.activatePackage('notational-velocity') describe "when the notational-velocity:toggle event is triggered", -> it "attaches and then detaches the view", -> expect(atom.workspaceView.find('.notational-velocity')).not.toExist() # This is an activation event, triggering it will cause the package to be # activated. atom.commands.dispatch atom.workspaceView.element, 'notational-velocity:toggle' waitsForPromise -> activationPromise runs -> expect(atom.workspaceView.find('.notational-velocity')).toExist() atom.commands.dispatch atom.workspaceView.element, 'notational-velocity:toggle' each frameworks, (framework) -> module "#{framework} - Accept", setup: -> setupFrame this, "/#{framework}.html" asyncTest "default accept header prefers scripts", -> @$.ajax type: 'POST' url: "/echo" success: (env) => if typeof env is 'string' env = JSON.parse env if @win.Zepto? equal env['HTTP_ACCEPT'], "*/*;q=0.5, text/javascript, application/javascript" else equal env['HTTP_ACCEPT'], "*/*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" start() asyncTest "dataType overrides default accept header", -> @$.ajax type: 'POST' url: "/echo" dataType: 'json' success: (env) => if @win.Zepto? equal env['HTTP_ACCEPT'], "application/json" else equal env['HTTP_ACCEPT'], "application/json, text/javascript, */*; q=0.01" start() noflo = require "noflo" http = require "connect" class Server extends noflo.Component description: "This component receives a port and host, and initializes a HTTP server for that combination. It sends out a request/response pair for each HTTP request it receives" constructor: -> @server = null @serverPort = null @inPorts = listen: new noflo.Port() @outPorts = request: new noflo.Port() @inPorts.listen.on "data", (data) => @serverPort = data @inPorts.listen.on "disconnect", => @server = http.createServer @sendRequest @server.listen @serverPort sendRequest: (req, res) => @outPorts.request.send req: req res: res @outPorts.request.disconnect() exports.getComponent = -> new Server() # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $.fn.stars = -> $(this).each -> # Get the value val = parseFloat($(this).html()) val = Math.round(val * 2) / 2; # To round to nearest half # Make sure that the value is in 0 - 5 range, multiply to get width size = Math.max(0, Math.min(5, val)) * 16 # Create stars holder $span = $('').width(size) # Replace the numerical value with stars $(this).html $span $ -> $('span.stars').stars() goog.provide 'app.Storage' goog.require 'este.labs.storage.Base' class app.Storage extends este.labs.storage.Base ###* @param {app.songs.Store} songsStore @constructor @extends {este.labs.storage.Base} ### constructor: (@songsStore) -> ###* @override ### load: (route, routes) -> switch route when routes.song # This is simulation of long XHR load... # We can also demonstrate "last click win" aka "pending navigation" # just by click to another link. Previous load will be canceled. new goog.Promise (resolve, reject) -> setTimeout resolve, 2000 return .then => # console.log 'Store updated.' @songsStore.song = @songsStore.songByRoute route else super route, routes#= require wymeditor/jquery.wymeditor.js #= require_self $ -> $(':input.wymeditor').wymeditor basePath: '/assets/wymeditor/' updateSelector: 'form:has(:input.wymeditor)' updateEvent: 'submit' exports.Calculator = class Calculator add: (input) -> result = 0 [delimiter, trimmedInput] = this.getDelimiter input numberStrings = trimmedInput.split delimiter negatives = [] for numberString in numberStrings num = parseInt numberString negatives.push num if num && num < 0 result += num if num throw ('Negative numbers are not allowed: ' + negatives.join(', ')) if negatives.length > 0 result getDelimiter: (input) -> match = input.match /^\/\/(.+)\n(.+)/ if match [match[1], match[2]] else [/\n|,/, input] {cloneFragment} = Trix Trix.registerElement "trix-toolbar", defaultCSS: """ %t { white-space: collapse; } %t .dialog { display: none; } %t .dialog.active { display: block; } %t .dialog input.validate:invalid { background-color: #ffdddd; } %t[native] { display: none; } """ createdCallback: -> if @innerHTML is "" @appendChild(cloneFragment(Trix.config.toolbar.content)) Git = require 'git' fs = require 'fs' module.exports = loadStatuses: (path) -> repo = Git.open(path) if repo? workingDirectoryPath = repo.getWorkingDirectory() statuses = {} for path, status of repo.getRepo().getStatuses() statuses[fs.join(workingDirectoryPath, path)] = status upstream = repo.getAheadBehindCounts() repo.destroy() else upstream = {} statuses = {} callTaskMethod('statusesLoaded', {statuses, upstream}) ColorScanner = require '../color-scanner' ColorContext = require '../color-context' registry = require '../color-expressions' {namePrefixes} = require '../regexes' ColorsChunkSize = 100 class BufferColorsScanner constructor: (config) -> {@buffer, variables} = config @context = new ColorContext(variables) @scanner = new ColorScanner({@context}) @results = [] if variables?.length > 0 variableNames = variables.map (v) -> v.name.replace(/[-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") .join('|') paletteRegexpString = "(#{namePrefixes})(#{variableNames})(?!_|-|\\w|\\d|[ \\t]*[\\.:=])" registry.createExpression 'variables', paletteRegexpString, 1, (match, expression, context) -> [d,d,name] = match baseColor = context.readColor(name) @rgba = baseColor.rgba scan: -> lastIndex = 0 while result = @scanner.search(@buffer, lastIndex) @results.push(result) @flushColors() if @results.length >= ColorsChunkSize {lastIndex} = result @flushColors() flushColors: -> emit('scan-buffer:colors-found', @results) @results = [] module.exports = (config) -> new BufferColorsScanner(config).scan() kd = require 'kd' KDView = kd.View KDListItemView = kd.ListItemView KDCustomHTMLView = kd.CustomHTMLView KDListViewController = kd.ListViewController module.exports = class TeamMembersCommonView extends KDView constructor: (options = {}, data) -> options.noItemFoundWidget or= new KDCustomHTMLView options.listViewItemClass or= KDListItemView super options, data @createListController() @listMembers() createListController: -> { listViewItemClass, noItemFoundWidget } = @getOptions @listController = new KDListViewController itemClass : listViewItemClass noItemFoundWidget : noItemFoundWidget startWithLazyLoader : yes lazyLoadThreshold : .90 lazyLoaderOptions : spinnerOptions : size : width: 28 @addSubView @listController.getView() ###* This method needs to be implemented in subclasses. @abstract ### listMembers: -> throw new Error 'Method needs to be implemented in subclasses' ScopeSelectorParser = require './scope-selector-parser' module.exports = class ScopeSelector # Create a new scope selector. # # source - A {String} to parse as a scope selector. constructor: (source) -> @matcher = ScopeSelectorParser.parse(source) # Check if this scope selector matches the scopes. # # scopes - An {Array} of {String}s or a single {String}. # # Returns a {Boolean}. matches: (scopes) -> scopes = [scopes] if typeof scopes is 'string' @matcher.matches(scopes) # Gets the prefix of this scope selector. # # scopes - An {Array} of {String}s or a single {String}. # # Returns a {String} if there is a prefix or undefined otherwise. getPrefix: (scopes) -> scopes = [scopes] if typeof scopes is 'string' @matcher.getPrefix(scopes) # Convert this TextMate scope selector to a CSS selector. # # Returns a {String}. toCssSelector: -> @matcher.toCssSelector() # Convert this TextMate scope selector to a CSS selector, prefixing scopes with `syntax--`. # # Returns a {String}. toCssSyntaxSelector: -> @matcher.toCssSyntaxSelector() Flow.ConfirmDialog = (_, _message, _opts={}, _go) -> defaults _opts, title: 'Alert' acceptCaption: 'Yes' declineCaption: 'No' accept = -> _go yes decline = -> _go no title: _opts.title acceptCaption: _opts.acceptCaption declineCaption: _opts.declineCaption message: Flow.Util.multilineTextToHTML _message accept: accept decline: decline template: 'confirm-dialog' storage = require 'node-persist' storage.initSync() User = require './user' users = (storage.getItem('users') or []).map (u) -> new User u chalk = require 'chalk' bcrypt = require 'bcrypt-nodejs' _ = require 'lodash' exp = getUser: (username, password, cb) -> if !cb and password cb = password password = null return cb null if !users for user in users return cb user if user.data.username == username and (!password or bcrypt.compareSync password, user.data.password) return cb null createUser: (options, cb) -> options.password = bcrypt.hashSync options.password user = new User options users.push user @save -> cb users getUsers: -> return users setUsers: (u) -> users = u save: (cb) -> storage.setItem 'users', users, cb chalk.enabled = true if users.length == 0 exp.createUser {username: 'admin', password: 'admin', needsReset: true, admin: true}, () -> console.log chalk.yellow "No users found, so I've created a new administrator user:" console.log chalk.cyan "\tUsername: admin" console.log chalk.cyan "\tPassword: admin" console.log chalk.yellow "You will be asked to change your password when you log in for the first time." module.exports = exp$ -> $(".photos").justifiedGallery rowHeight: 200, margins: 8 {View} = require 'space-pen' {GitNotFoundError} = require '../git-bridge' class GitNotFoundErrorView extends View @content: (err) -> @div class: 'overlay from-top padded merge-conflict-error merge-conflicts-message', => @div class: 'panel', => @div class: "panel-heading", => @code 'git' @text "can't be found at " @code atom.config.get 'merge-conflicts.gitPath' @text '!' @div class: 'panel-body', => @div class: 'block', 'Please fix the path in your settings.' @div class: 'block', => @button class: 'btn btn-error inline-block-tight', click: 'openSettings', 'Open Settings' @button class: 'btn inline-block-tight', click: 'notRightNow', 'Not Right Now' openSettings: -> atom.workspace.open 'atom://config/packages' @remove() notRightNow: -> @remove() module.exports = handleErr: (err) -> return false unless err? if err instanceof GitNotFoundError atom.workspaceView.appendToTop new GitNotFoundErrorView(err) console.error err true module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['**/*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' indentation: level: 'ignore' src: ['src/*.coffee'] test: ['spec/*.coffee'] gruntfile: ['Gruntfile.coffee'] shell: test: command: 'node --harmony_collections node_modules/.bin/jasmine-focused --coffee --captureExceptions --forceexit spec' options: stdout: true stderr: true failOnError: true 'update-atomdoc': command: 'npm update grunt-atomdoc' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-atomdoc') grunt.registerTask 'clean', -> require('rimraf').sync('lib') require('rimraf').sync('api.json') grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['coffee', 'lint']) grunt.registerTask('test', ['coffee', 'lint', 'shell:test']) class @Activities constructor: -> Pager.init 20, true $(".event-filter .btn").bind "click", (event) => event.preventDefault() @toggleFilter($(event.currentTarget)) @reloadActivities() reloadActivities: -> $(".content_list").html '' Pager.init 20, true toggleFilter: (sender) -> sender.parent().toggleClass "active" event_filters = $.cookie("event_filter") filter = sender.attr("id").split("_")[0] if event_filters event_filters = event_filters.split(",") else event_filters = new Array() index = event_filters.indexOf(filter) if index is -1 event_filters.push filter else event_filters.splice index, 1 $.cookie "event_filter", event_filters.join(","), { path: '/' } '*': 'editor': 'fontFamily': 'Fira Code' 'showIndentGuide': true 'tabLength': 4 'softWrap': true 'invisibles': {} 'zoomFontWhenCtrlScrolling': false 'core': 'disabledPackages': [ 'language-objective-c' 'archive-view' 'autosave' 'bookmarks' 'language-clojure' 'language-perl' 'language-php' 'language-toml' 'snippets' 'welcome' 'spell-check' ] 'themes': [ 'seti-ui' 'seti-syntax' ] 'projectHome': '/home/ai/Dev' 'autoHideMenuBar': true 'exception-reporting': 'userId': '51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71' 'welcome': 'showOnStartup': false 'markdown-preview': 'breakOnSingleNewline': true 'spell-check': {} express = require 'express' router = express.Router() database = require '../routes/database' item = require '../routes/item' db = null router.post '/new', (req, res, next) -> req.body._id = database.getId() db.insertOne(req.body).then () -> res.redirect 'back' router.post '/getData', (req, res, next) -> db.findOne({'_id': database.getId req.body.id}).then (result) -> res.send result router.post '/delete', (req, res, next) -> db.deleteOne({'_id': database.getId req.body.id}).then () -> res.send true router.post '/update/:id', (req, res, next) -> db.updateOne( {'_id': database.getId req.params.id}, {$set: req.body} ).then () -> res.redirect 'back' router.get '/', (req, res, next) -> db = database.getDb().collection('team') db.find({}).toArray (err, teams) -> res.render 'teamdata', teamKeys: Object.keys(teams), teams: teams, module.exports = router{readFile} = require 'fs' {dirname} = require 'path' {parseProcfile} = require './procfile' {createFormation} = require './formation' class Server constructor: (@procfile) -> @cwd = dirname @procfile spawn: (callback) -> parseProcfile @procfile, (err, details) => return callback?(err) if err @formation = createFormation details, {@cwd, output: process.stdout} @formation.spawn callback ? -> exports.createServer = (args...) -> new Server args... msgflo = require 'msgflo' path = require 'path' chai = require 'chai' unless chai heterogenous = require '../node_modules/msgflo/spec/heterogenous.coffee' python = process.env.PYTHON or 'python' participants = 'PythonRepeat': [python, path.join __dirname, '..', 'examples', 'repeat.py'] describe 'Participants', -> address = 'amqp://localhost' g = broker: null commands: participants beforeEach (done) -> g.broker = msgflo.transport.getBroker address g.broker.connect done afterEach (done) -> g.broker.disconnect done names = Object.keys g.commands names.forEach (name) -> heterogenous.testParticipant g, name request = require "request" githubAuth = require "../../auth/github" class GitHub fetchGist: (gistID, callback) -> request.get( url: "https://api.github.com/gists/#{gistID}" + "?client_id=#{githubAuth.clientID}" + "&client_secret=#{githubAuth.clientSecret}" json: true , (err, res, body) -> return callback err if err code = res.statusCode return callback(new Error "Missing Gist") if code is 404 return callback(new Error body?.message or body) unless code is 200 jsonFile = body.files?["command.json"] return callback(new Error "Missing JSON") unless jsonFile try json = JSON.parse body.files["command.json"].content catch exception return callback new Error "Unparsable JSON" callback err, json: json id: body.id src: body.files["command.js"]?.raw_url ) module.exports = new GitHub api = require './slide-pack-api' mousetrap = require 'mousetrap' $ = require 'zeptojs' # keyboard navigation mousetrap.bind ['left', 'up', 'k', 'h'], api.prev mousetrap.bind ['right', 'down', 'j', 'l'], api.next # mouse/touch navigation nav = $('') $('body').append nav $(document).on 'click', 'nav a:first-child', (e) -> api.prev() $(document).on 'click', 'nav a:last-child', (e) -> api.next() $(document).on 'swipeLeft', -> api.next() $(document).on 'swipeRight', -> api.prev() # Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' # class TitaniumView constructor: (attributes) -> for name, value of attributes @[name] = value @children = [] addEventListener: (name, event) -> @on name, event removeEventListener: (name, event) -> @off name, event fireEvent: (name, args...) -> @trigger name, args add: (view) -> @children.push view remove: (view) -> @children = _.without @children, view getChildren: -> @children Ti.UI.createView = (attributes) -> new TitaniumView attributes _.extend TitaniumView::, Backbone.Events ### # Copyright 2015-2017 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### {div,i} = ReactDOMFactories el = React.createElement class Contest.Voting.VoteSummary extends React.Component render: -> classes = [ 'contest__voting-star', 'contest__voting-star--smaller', 'contest__voting-star--float-right', ] selectedClass = [ 'contest__voting-star--selected', ] voteSummary = [] voteSummary.push _.times Math.max(0, @props.maxVotes - @props.voteCount), -> div className: classes.join(' '), i className: 'fas fa-fw fa-star' voteSummary.push _.times @props.voteCount, -> div className: classes.concat(selectedClass).join(' '), i className: 'fas fa-fw fa-star' div {}, voteSummary Wheelmap.ToolbarView = Ember.View.extend elementId: 'toolbar' templateName: 'toolbar' addToggleSearchbar: (()-> $searchbar = @$('.searchbar-form') @$('.btn-toggle-searchbar').click ()-> $searchbar.toggleClass('active'); ).on('didInsertElement') categoryButton: (()-> activeCategories = @get('controller.activeCategories') length = activeCategories.get('length') if length == 1 I18n.t('poi.category.' + activeCategories.get('firstObject.identifier')) else I18n.t('header.toolbar.categories') ).property('controller.activeCategories.length') click: (event)-> # Stop propagation of click on the dropdown menu if Ember.$(event.target).closest('.dropdown-menu').length > 0 event.stopPropagation(){CompositeDisposable, Disposable} = require 'atom' _ = require 'underscore-plus' AutocompleteView = require './autocomplete-view' module.exports = config: includeCompletionsFromAllBuffers: type: 'boolean' default: false autocompleteViewsByEditor: null deactivationDisposables: null activate: -> @autocompleteViewsByEditor = new WeakMap @deactivationDisposables = new CompositeDisposable @deactivationDisposables.add atom.workspace.observeTextEditors (editor) => return if editor.mini autocompleteView = new AutocompleteView(editor) @autocompleteViewsByEditor.set(editor, autocompleteView) disposable = new Disposable => autocompleteView.destroy() @deactivationDisposables.add editor.onDidDestroy => disposable.dispose() @deactivationDisposables.add disposable getAutocompleteView = (editorElement) => @autocompleteViewsByEditor.get(editorElement.getModel()) @deactivationDisposables.add atom.commands.add 'atom-text-editor:not([mini])', 'autocomplete:toggle': -> getAutocompleteView(this)?.toggle() 'autocomplete:next': => getAutocompleteView(this)?.selectNextItemView() 'autocomplete:previous': => getAutocompleteView(this)?.selectPreviousItemView() deactivate: -> @deactivationDisposables.dispose() angular.module('loomioApp').factory 'DiscussionForm', -> templateUrl: 'generated/components/discussion_form/discussion_form.html' controller: ($scope, $controller, $location, discussion, CurrentUser, Records, AbilityService, FormService, KeyEventService) -> $scope.discussion = discussion.clone() if $scope.discussion.isNew() and !$scope.discussion.groupId? $scope.showGroupSelect = true $scope.$on 'modal.closing', (event) -> FormService.confirmDiscardChanges(event, $scope.discussion) actionName = if $scope.discussion.isNew() then 'created' else 'updated' $scope.submit = FormService.submit $scope, $scope.discussion, flashSuccess: "discussion_form.messages.#{actionName}" successCallback: (response) => $location.path "/d/#{response.discussions[0].key}" if actionName == 'created' $scope.availableGroups = -> _.filter CurrentUser.groups(), (group) -> AbilityService.canStartThread(group) $scope.showPrivacyForm = -> return unless $scope.discussion.group() $scope.discussion.group().discussionPrivacyOptions == 'public_or_private' KeyEventService.submitOnEnter $scope $ -> if isOnPage 'join_requests', 'invite' # invite is selected by default enableDisableMessage() # enable/disable the message depending on the type selected $('.type-options input[type=radio]').on 'change', -> enableDisableMessage() # input to search for users id = '#candidates' url = '/users/select?limit=10' $(id).select2 minimumInputLength: 1 width: 'resolve' multiple: true formatSearching: -> I18n.t('join_requests.invite.users.searching') formatInputTooShort: -> I18n.t('join_requests.invite.users.hint') formatNoMatches: -> I18n.t('join_requests.invite.users.no_results') tags: true tokenSeparators: [",",";"] formatSelection: (object, container) -> text = if object.name? object.name else object.text mconf.Base.escapeHTML(text) ajax: url: url dataType: "json" data: (term, page) -> q: term # search term results: (data, page) -> # parse the results into the format expected by Select2. results: data enableDisableMessage = -> typeInvite = $('#type_invite') $('#join_request_comment').enable(typeInvite.is(":checked")) angular.module 'qbn.engine', ['qbn.quality', 'qbn.storylet', 'qbn.choice'] .controller 'QbnEngine', ($scope, qualities, storylets, frontalChoices, choiceFactory, resolve) -> $scope.qualities = qualities.getAll() updateFrontalChoices = () -> $scope.choices = frontalChoices.getAll() return updateFrontalChoices() retreat = choiceFactory '!!retreat!!', 'On second thought, maybe not…' 'Return to the previous screen.' {}, {}, undefined onwards = choiceFactory '!!onwards!!', 'The story continues…' '', {}, {}, undefined $scope.choose = (choice) -> next = resolve choice.next storylet = storylets.lookup next if storylet? unless $scope.storylet? storylet.choices = storylet.choices.concat retreat unless storylet.choices? storylet.choices = [onwards] else updateFrontalChoices() $scope.storylet = storylet return return .filter 'resolve', ($injector, qualities) -> (v) -> while typeof v == 'function' || Array.isArray v qualityNames = $injector.annotate v qualityValues = qualityNames.map (name) -> qualities.lookup(name)?.value v = v qualityValues... return v 'name': 'Pweave markdown' scopeName: 'source.pweave.md' 'fileTypes': [ 'pmd' 'pmdw' ] patterns: [ { 'include' : 'source.pweave.noweb' } { 'begin': '^([`~]{3,})(\\{|\\{\\.|)(python)(,|)\\s*(.*?)(\\}|)\\s*$' 'beginCaptures': '1': 'name': 'markup.heading.weave.md' '3': 'name': 'markup.bold.weave.md' '5': 'contentName' : 'source.embedded.python' 'patterns': [ { 'include': 'source.python' } ] 'end': '^[`~]{3,}\\s*$' 'endCaptures': '0': 'name': 'markup.heading.weave.md' 'contentName': 'source.embedded.python' 'patterns': [ { 'include': 'source.python' } ] } { 'include': 'source.gfm' } { 'include': 'text.md' } ] noflo = require "noflo" jsdom = require "jsdom" class ScrapeHtml extends noflo.Component constructor: -> @html = "" @textSelector = "" @crapSelectors = [] @inPorts = in: new noflo.Port() textSelector: new noflo.Port() crapSelector: new noflo.ArrayPort() @outPorts = out: new noflo.Port() error: new noflo.Port() @inPorts.in.on "data", (data) => @html += data @inPorts.in.on "disconnect", => return unless @textSelector.length @scrapeHtml() @inPorts.textSelector.on "data", (data) => @textSelector = data @inPorts.textSelector.on "disconnect", => return unless @html.length @scrapeHtml() @inPorts.crapSelector.on "data", (data) => @crapSelectors.push data scrapeHtml: -> target = @outPorts.out jsdom.env @html, ['http://code.jquery.com/jquery.min.js'], (err, win) => if err @outPorts.error.send err return @outPorts.error.disconnect() win.$(crap).remove() for crap in @crapSelectors data = win.$(@textSelector).text() @outPorts.out.send data @outPorts.out.disconnect() @html = "" exports.getComponent = -> new ScrapeHtml #= require_self #= require_tree ./templates #= require_tree ./models #= require_tree ./views #= require_tree ./routers window.Water = Models: {} Collections: {} Routers: {} Views: {} $ -> window.tree_fetcher = new Water.TreeFetcher(repository_path: gon.repository_path, ref: gon.ref) window.tcl = new Water.TreesController() window.tree_view = new Water.TreeView(el: $("#spine"), model: window.tree_fetcher, router: window.tcl) window.tcl.view = window.tree_view window.tcl.fetcher = window.tree_fetcher window.tree_view.controller = window.tcl Backbone.history.start() window.tcl.trigger("root") EventEmitter = require('events').EventEmitter ipc = process.atomBinding('ipc') class Ipc extends EventEmitter constructor: -> process.on 'ATOM_INTERNAL_MESSAGE', (args...) => @emit(args...) send: (args...) -> ipc.send('ATOM_INTERNAL_MESSAGE', 'message', args...) sendChannel: (args...) -> ipc.send('ATOM_INTERNAL_MESSAGE', args...) sendSync: (args...) -> ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', 'sync-message', args...).result sendChannelSync: (args...) -> ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', args...).result module.exports = new Ipc require 'jquery.history.js' require 'jquery.paginator.js' describe "Paginator", -> beforeEach -> loadFixtures('paginator.html') $('#list').ajaxPaginator() describe 'clicking a link', -> link = null beforeEach -> link = $('.pagination a:first') link.click() it "calls the link via AJAX", -> expect(ajaxRequests).toHaveLength 1 expect(ajaxRequests[0].url).toEqual link[0].href it "shows it's loading while the request is proccessed", -> expect($('#list')).toContain 'p.loading' it "fills the element with the response", -> request = mostRecentAjaxRequest() request.response status: 200, responseText: '

    Success!

    ' expect($('#list')).toHaveHtml request.responseText afterEach -> if browser_supports_history() history.replaceState(null, null, '/') else location.hash = null module.exports = activate: -> rootView.eachEditSession (editSession) => @whitespaceBeforeSave(editSession) configDefaults: ensureSingleTrailingNewline: true whitespaceBeforeSave: (editSession) -> buffer = editSession.buffer buffer.on 'will-be-saved', -> buffer.transact -> buffer.scan /[ \t]+$/g, ({match, replace}) -> # GFM permits two whitespaces at the end of a line--trim anything else unless editSession.getGrammar().scopeName is "source.gfm" and match[0] is " " replace('') if config.get('whitespace.ensureSingleTrailingNewline') if buffer.getLastLine() is '' row = buffer.getLastRow() - 1 while row and buffer.lineForRow(row) is '' buffer.deleteRow(row--) else selectedBufferRanges = editSession.getSelectedBufferRanges() buffer.append('\n') editSession.setSelectedBufferRanges(selectedBufferRanges) Package = require 'package' fs = require 'fs' module.exports = class AtomPackage extends Package metadata: null keymapsDirPath: null constructor: (@name) -> super @keymapsDirPath = fs.join(@path, 'keymaps') load: -> try if @requireModule @module = require(@path) @module.name = @name @loadMetadata() @loadKeymaps() @loadStylesheets() rootView.activatePackage(@name, @module) if @module catch e console.warn "Failed to load package named '#{@name}'", e.stack loadMetadata: -> if metadataPath = fs.resolveExtension(fs.join(@path, "package"), ['cson', 'json']) @metadata = fs.readObject(metadataPath) loadKeymaps: -> for keymapPath in @getKeymapPaths() keymap.load(keymapPath) getKeymapPaths: -> if keymaps = @metadata?.keymaps keymaps.map (relativePath) => fs.resolve(@keymapsDirPath, relativePath, ['cson', 'json', '']) else if fs.exists(@keymapsDirPath) fs.list(@keymapsDirPath) else [] loadStylesheets: -> for stylesheetPath in @getStylesheetPaths() requireStylesheet(stylesheetPath) getStylesheetPaths: -> stylesheetDirPath = fs.join(@path, 'stylesheets') if fs.exists stylesheetDirPath fs.list stylesheetDirPath else [] ### Common variables and functions for bots ### #require = patchRequire(global.require) #utils = require('utils') exports.userAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.5 Safari/537.36' #argumentData = [{name:'argName1',default:'optionalArg'}, {name:'argName2',csv:true}, ...] exports.parseArgs = (argumentData, casper) -> ARGS = []; missingRequired = []; posArg = -1; argCount = 0 for arg in argumentData # get the arguments from the command line if casper.cli.raw.has arg.name ARGS[argCount] = casper.cli.raw.get arg.name else if casper.cli.raw.has posArg+1 ARGS[argCount] = casper.cli.raw.get ++posArg else if arg.default? # use the default value if one exists ARGS[argCount] = arg.default else # if no default value is given then it is a required argument missingRequired.push arg.name if arg.csv and ARGS[argCount]? ARGS[argCount] = ARGS[argCount].split(',') argCount++ if missingRequired.length > 0 # if any required arguments were missing casper.echo "argErr: #{missingRequired} are required parameters." casper.exit 1 ARGS # return### Top module for Rubic (for Chrome App) ### # Compatibility modules require("compat/es7compat") require("compat/bbjscompat") # UI helpers require("ui/bootbox-promise") # Load main controller require("controller/windowcontroller") # Needed to solve circular dependency $(-> # Controller must be initiated after window.onload require("controller/maincontroller").instance.activate() ) # Boards require("board/peridotboard") require("board/wakayamarbboard") require("board/grcitrusboard") # Engines require("engine/mrubyengine") require("engine/duktapeengine") require("engine/luaengine") require("engine/micropythonengine") # Editors require("editor/rubyeditor") require("editor/mrbviewer") require("editor/javascripteditor") require("editor/coffeescripteditor") require("editor/luaeditor") require("editor/pythoneditor") require("editor/yamleditor") codio = require '../src/codio' path = require 'path' assert = require 'assert' tmp = require 'tmp' fs = require 'fs-extra' describe.only 'versal codio', -> cwd = null before (done) -> tmp.dir (err, tmp) -> cwd = tmp codio { cwd }, done it 'creates .codio file', (done) -> fs.exists path.join(cwd, '.codio'), (exists) -> assert exists done() it '.codio file contains sections for run and preview buttons', -> fs.readJson path.join(cwd, '.codio'), (err, json) -> if err then throw err assert json.hasOwnProperty 'commands' assert json.hasOwnProperty 'preview' _ = require('underscore') module.exports = (req, res, next) -> httpVerbWhitelist = ['GET'] return next() if process.env.NODE_ENV == 'test' return next() if req.isAuthenticated() or _.contains(httpVerbWhitelist, req.method) return res.send(401, 'Unauthorised') americano = require 'americano' port = process.env.PORT || 9250 americano.start name: 'template', port: portReact = require('react') moment = require('moment') import { ListGroup, ListGroupItem } from 'react-bootstrap' import {Link} from 'react-router-dom' import ConnectedComponent from '../lib/ConnectedComponent' import withMyUser from '../lib/withMyUser' getClass = (result) -> if not result return undefined switch when result.solved > 0 then "success" when result.ok > 0 then "success" when result.ignored > 0 then "info" when result.attempts > 0 then "danger" else undefined FindMistakeList = (props) ->

    Найди ошибку

    {props.findMistakes.map (m) -> href = "/findMistake/" + m._id cl = getClass(props.results?[m._id]) {m.fullProblem.name}{" "} ({m.fullProblem.level}, {m.language}){" "} #{m.hash} }
    options = urls: (props) -> return findMistakes: "findMistakeList/#{props.myUser?._id}" results: "userResultsForFindMistake/#{props.myUser?._id}" export default withMyUser(ConnectedComponent(FindMistakeList, options)) Router.map -> @route "entrySignIn", path: "/sign-in" onBeforeRun: -> Session.set('entryError', undefined) Session.set('buttonText', 'in') @route "entrySignUp", path: "/sign-up" onBeforeRun: -> Session.set('entryError', undefined) Session.set('buttonText', 'up') @route "entryForgotPassword", path: "/forgot-password" onBeforeRun: -> Session.set('entryError', undefined) @route 'entrySignOut', path: '/sign-out' before: -> if AccountsEntry.settings.homeRoute Meteor.logout() Router.go AccountsEntry.settings.homeRoute @stop() $ -> $('.devise-registrations-new .user_email input').blur -> $input = $(@) $sublogo = $input.parents('.login').find('.sub-logo') email = $input.val() if email.length > 0 and $input.data('last-email') != email $sublogo.html '' $.get "/company-from-email?email=#{email}", (data) -> if data.name.length > 0 $input.data 'last-email', email $sublogo.html "for #{data.name}" $sublogo.css({'opacity': 0, 'margin-left': '-6px'}) $sublogo.animate({'opacity': 1, 'margin-left': 0}) child_process = require 'child_process' module.exports = class Command spawn: (command, args, remaining...) -> options = remaining.shift() if remaining.length >= 2 callback = remaining.shift() spawned = child_process.spawn(command, args, options) errorChunks = [] outputChunks = [] spawned.stdout.on 'data', (chunk) -> outputChunks.push(chunk) spawned.stderr.on 'data', (chunk) -> errorChunks.push(chunk) spawned.on 'error', (error) -> callback(error, Buffer.concat(errorChunks).toString(), Buffer.concat(outputChunks).toString()) spawned.on 'close', (code) -> callback(code, Buffer.concat(errorChunks).toString(), Buffer.concat(outputChunks).toString()) fork: (script, args, remaining...) -> args.unshift(script) @spawn(process.execPath, args, remaining...) clipboard = require 'clipboard' crypto = require 'crypto' # Internal: Represents the clipboard used for copying and pasting in Atom. module.exports = class Pasteboard signatureForMetadata: null # Creates an `md5` hash of some text. # # text - A {String} to encrypt. # # Returns an encrypted {String}. md5: (text) -> crypto.createHash('md5').update(text, 'utf8').digest('hex') # Saves from the clipboard. # # text - A {String} to store # metadata - An object of additional info to associate with the text write: (text, metadata) -> @signatureForMetadata = @md5(text) @metadata = metadata clipboard.writeText(text) # Loads from the clipboard. # # Returns an {Array}. The first index is the saved text, and the second is any metadata associated with the text. read: -> text = clipboard.readText() value = [text] value.push(@metadata) if @signatureForMetadata == @md5(text) value Dashboard.SessionsNewRoute = Ember.Route.extend authRedirectable: false renderTemplate: -> Dashboard.SessionsDestroyRoute = Ember.Route.extend activate: -> @auth.signOut().then -> window.location.reload true this.render('sessions/new', outlet: 'login') versionCheck = (scope)-> scope.alert ||= false scope.requiredProtocolVerion ||= 6 scope.disconnect ||= true if (typeof Leap != 'undefined') && Leap.Controller if Leap.version.minor < 5 && Leap.version.dot < 4 console.warn("LeapJS Version Check plugin incompatible with LeapJS pre 0.4.4") @on 'ready', -> required = scope.requiredProtocolVerion current = @connection.opts.requestProtocolVersion if current < required console.warn "Protocol Version too old. v#{required} required, v#{current} available." @emit('versionCheck.outdated', { required: required current: current disconnect: scope.disconnect }) if scope.disconnect # due to LeapJS implementation details, a call to disconnect within 1000ms of connection will result in # automatic reconnection. We disable this behavior below. # https://github.com/leapmotion/leapjs/blob/master/lib/connection/base.js#L64 clearInterval(@connection.reconnectionTimer) @disconnect() if scope.alert alert("Your Leap Software version is out of date. Visit http://www.leapmotion.com/setup to update") {} if (typeof Leap != 'undefined') && Leap.Controller Leap.Controller.plugin 'versionCheck', versionCheck else if (typeof module != 'undefined') module.exports.versionCheck = versionCheck else throw 'leap.js not included' Template.login.events 'submit form': (e) -> e.preventDefault() user = e.target.username.value pass = e.target.password.value Meteor.loginWithPg user, pass, (err) -> unless err Tracker.autorun -> Meteor.call 'listFiles', Meteor.user().user else FlashMessages.sendError("Login failed: #{err.message}") false Template.body.helpers loggedIn: -> if Meteor.user() Tracker.autorun -> Meteor.subscribe 'file-list', Meteor.user().user Template.body.events 'click #logout': (e) -> e.preventDefault() Meteor.logout() $ -> $("div.tabs").tab() $ -> $("a[rel=twipsy]").tooltip live: true $ -> $("a[rel=popover]").popover offset: 10 $ -> # TODO: find a better way to set this event handler # it is here, so this 'click' is handled before the 'dropdown' one $('ul.quickjump-dropdown').parents("li.dropdown").find("a.dropdown-toggle").bind "click", (event) -> input = $(this).parents('li.dropdown').find('li.quickjump-input input') console.log ">", input setTimeout -> input.focus() , 100 true $('.dropdown-toggle').dropdown() $ -> $(".alert-message").alert() # Automatically select and deselect text inputs in modals $ -> $("div.modal").modal().modal("hide").bind 'shown', -> $(this).find('input[type=text], textarea').first().select() .bind 'hide', -> $(this).find('input[type=text], textarea').blur() # A cancel link in a modal should dismiss that modal $('div.modal a.btn.cancel').bind "click", (event) -> $(this).parents('div.modal').modal('hide') false # An input[type="submit"] in .modal-footer should submit form in corresponding .modal-body $('div.modal div.modal-footer input[type="submit"]').bind "click", (event) -> form = $(this).parents('div.modal').find('div.modal-body form') form.submit() false path = require 'path' runas = null module.exports = (grunt) -> {cp, mkdir, rm} = require('./task-helpers')(grunt) grunt.registerTask 'install', 'Install the built application', -> installDir = grunt.config.get('atom.installDir') shellAppDir = grunt.config.get('atom.shellAppDir') if process.platform is 'win32' runas ?= require 'runas' copyFolder = path.resolve 'script', 'copy-folder.cmd' if runas('cmd', ['/c', copyFolder, shellAppDir, installDir], admin: true) isnt 0 grunt.log.error("Failed to copy #{shellAppDir} to #{installDir}") createShortcut = path.resolve 'script', 'create-shortcut.cmd' runas('cmd', ['/c', createShortcut, path.join(installDir, 'atom.exe'), 'Atom']) else if process.platform is 'darwin' rm installDir mkdir path.dirname(installDir) cp shellAppDir, installDir else binDir = path.join(installDir, 'bin') shareDir = path.join(installDir, 'share', 'atom') mkdir binDir cp 'atom.sh', path.join(binDir, 'atom') rm shareDir mkdir path.dirname(shareDir) cp shellAppDir, shareDir 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Bracket Matcher' 'submenu': [ { 'label': 'Go To Matching Bracket', 'command': 'bracket-matcher:go-to-matching-bracket' } { 'label': 'Select Inside Brackets', 'command': 'bracket-matcher:select-inside-brackets' } { 'label': 'Remove Brackets From Selection', 'command': 'bracket-matcher:remove-brackets-from-selection' } { 'label': 'Close Current Tag', 'command': 'bracket-matcher:close-tag'} ] ] } ] define ['app', 'tests/testUtils'], (App, TestUtils) -> run = -> module 'Integration: showActivity', teardown: -> App.reset() test 'hello', -> ok true, 'true is tautological' test 'visit /, list all activity', -> expect 1 TestUtils.stubAjax '/api/v1/activity/days', 'GET', '[{"day":1399096800000,"activities":["Tested DayTracker"]}]' visit '/' andThen -> equal find('li:last').text(), 'Tested DayTracker' {run: run} define (require) -> Backbone = require('backbone') settings = require('cs!settings') SERVER = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}" return new class Subjects extends Backbone.Collection url: () -> "#{SERVER}/extras" initialize: () -> @fetch({reset: true}) parse: (response, options) -> return response.subjects app = angular.module 'qiprofile', [ 'ngRoute', 'ui.bootstrap', 'nvd3ChartDirectives', 'qiprofile.services', 'qiprofile.controllers', 'qiprofile.filters', 'qiprofile.directives', 'qiprofile.routes' ] Q = require 'q' argv = (require 'yargs').argv log = require './log' Q.longStackSupport = yes process.on 'uncaughtException', (err) -> log.error 'Uncaught exception:', err.stack process.nextTick -> process.exit 1 logLevel = argv.log ? 'info' log.initialize logLevel, require './io/tty-log' log "Using log level #{logLevel}" game = require './game' game.initialize require './io/tty' game.main()class PG.Legend defaults: className: "legend" constructor: (container, @graphs, options) -> @container = $(container) @options = $.extend @defaults, options @element = $("
    ").addClass(@options.className) @container.append @element @legend = new Rickshaw.Graph.Legend graph: @graphs[0] element: @element.get(0) instance = @ @graphSeries = {} for line, i in @legend.lines $label = $(line.element).find("span").first() $label.attr "rel", line.series.name @graphSeries[line.series.name] = series : _.map @graphs, (graph) -> graph.series[graph.series.length - 1 - i] disabled : no $label.on "click", -> instance.toggle $(this) toggle: ($label) -> $line = $label.parent(".line") name = $label.attr("rel") graphSeries = @graphSeries[name] if graphSeries.disabled graphSeries.disabled = no series.disabled = no for series in graphSeries.series $label.removeClass "#{@options.className}__label_disabled" $line.removeClass "disabled" else return if _.every(_.pluck(_.without(@graphSeries, graphSeries), "disabled")) graphSeries.disabled = yes series.disabled = yes for series in graphSeries.series $label.addClass "#{@options.className}__label_disabled" $line.addClass "disabled" @updateGraphs() updateGraphs: -> graph.update() for graph in @graphs {Emitter} = require('../src/emitter') describe "Emitter", -> it "invokes the observer when the named event is emitted until disposed", -> emitter = new Emitter fooEvents = [] barEvents = [] sub1 = emitter.on 'foo', (value) -> fooEvents.push(['a', value]) sub2 = emitter.on 'bar', (value) -> barEvents.push(['b', value]) emitter.emit 'foo', 1 emitter.emit 'foo', 2 emitter.emit 'bar', 3 sub1.dispose() emitter.emit 'foo', 4 emitter.emit 'bar', 5 sub2.dispose() emitter.emit 'bar', 6 expect(fooEvents).toEqual [['a', 1], ['a', 2]] expect(barEvents).toEqual [[ 'b', 3],[ 'b', 5]] it "throws an exception when subscribing with a callback that isn't a function", -> emitter = new Emitter expect(-> emitter.on('foo', null)).toThrow() expect(-> emitter.on('foo', 'a')).toThrow() $ = require 'jquery' Template = require 'template' module.exports = class Layout extends Template @attach: -> view = @build() $('body').append view view content: -> @link rel: 'stylesheet', href: 'static/atom.css' @div id: 'app-horizontal', => @div id: 'app-vertical', outlet: 'vertical', => @div id: 'main', outlet: 'main' viewProperties: addPane: (view) -> pane = $('
    ') pane.append(view) @main.after(pane) define ['jquery', 'underscore', 'backbone', 'views/search_input_view'], ($, _, Backbone, SearchInputView) -> class SearchView extends Backbone.View el: $('#search') events: 'submit form': 'searchRoute' initialize: -> @to = new SearchInputView(el: @$el.find('#to')) @from = new SearchInputView(el: @$el.find('#from')) Reitti.Event.on 'position:change', _.once (position) => @populateFromBox position, => @to.focus() render: -> @from.focus() searchRoute: (event) -> event.preventDefault() params = $.param { from: @from.val(), to: @to.val() } # TODO: Move this logic somewhere else $.getJSON "/routes?#{params}", (data) -> Reitti.Event.trigger 'route:change', data[0] populateFromBox: (position, callback) -> # TODO: Move this logic somewhere else $.getJSON "/address?coords=#{position.coords.longitude},#{position.coords.latitude}", (location) => @from.val location.name callback() {CompositeDisposable} = require 'atom' module.exports = class MinimapBookmarksBinding constructor: (@minimap) -> @subscriptions = new CompositeDisposable @editor = @minimap.getTextEditor() @decorationsByMarkerId = {} @decorationSubscriptionsByMarkerId = {} @subscriptions.add @editor.displayBuffer.onDidCreateMarker (marker) => if marker.matchesProperties(class: 'bookmark') @handleMarker(marker) @editor.displayBuffer.findMarkers(class: 'bookmark').forEach (marker) => @handleMarker(marker) handleMarker: (marker) -> {id} = marker decoration = @minimap.decorateMarker(marker, type: 'line', class: 'bookmark', plugin: 'bookmarks') @decorationsByMarkerId[id] = decoration @decorationSubscriptionsByMarkerId[id] = decoration.onDidDestroy => @decorationSubscriptionsByMarkerId[id].dispose() delete @decorationsByMarkerId[id] delete @decorationSubscriptionsByMarkerId[id] destroy: -> for id,decoration of @decorationsByMarkerId @decorationSubscriptionsByMarkerId[id].dispose() decoration.destroy() delete @decorationsByMarkerId[id] delete @decorationSubscriptionsByMarkerId[id] @subscriptions.dispose() {Task} = require 'atom' ctags = require 'ctags' async = require 'async' getTagsFile = require "./get-tags-file" handlerPath = require.resolve './load-tags-handler' module.exports = find: (editor, callback) -> if editor.getLastCursor().getScopeDescriptor().getScopesArray().indexOf('source.ruby') isnt -1 # Include ! and ? in word regular expression for ruby files range = editor.getLastCursor().getCurrentWordBufferRange(wordRegex: /[\w!?]*/g) else range = editor.getLastCursor().getCurrentWordBufferRange() symbol = editor.getTextInRange(range) unless symbol?.length > 0 return process.nextTick -> callback(null, []) allTags = [] async.each( atom.project.getPaths(), (projectPath, done) -> tagsFile = getTagsFile(projectPath) return done() unless tagsFile? ctags.findTags tagsFile, symbol, (err, tags=[]) -> tag.directory = projectPath for tag in tags allTags = allTags.concat(tags) done(err) (err) -> callback(err, allTags) ) getAllTags: (callback) -> projectTags = [] task = Task.once handlerPath, atom.project.getPaths(), -> callback(projectTags) task.on 'tags', (tags) -> projectTags.push(tags...) task define (require) -> router = require('cs!router') analytics = require('cs!helpers/handlers/analytics') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./nav-template') require('less!./nav') return class MediaNavView extends BaseView template: template templateHelpers: _hideProgress: () -> @hideProgress initialize: (options) -> super() @listenTo(@model, 'change:page change:pages', @render) if @model @hideProgress = options.hideProgress events: 'click .next': 'nextPage' 'click .back': 'previousPage' nextPage: () -> @navigate(@model.nextPage()) previousPage: () -> @navigate(@model.previousPage()) navigate: (page) -> y = window.pageYOffset || document.documentElement.scrollTop if y > 700 window.scrollTo(0, 300) route = "/content/#{router.current().params[0]}:#{page}" # Deterimine the new route router.navigate(route) # Update browser URL to reflect the new route analytics.send() # Send the analytics information for the new route React = require 'react' BS = require 'react-bootstrap' _ = require 'underscore' {StepPanel} = require '../../helpers/policies' {CardBody} = require '../pinned-header-footer-card/sections' AsyncButton = require '../buttons/async-button' {TaskStore} = require '../../flux/task' {TaskStepStore} = require '../../flux/task-step' module.exports = renderContinueButton: -> return null if @hideContinueButton?() isWaiting = TaskStepStore.isLoading(@props.id) isSaving = TaskStepStore.isSaving(@props.id) isFailed = TaskStepStore.isFailed(@props.id) # if this is the last step completed and the view is read-only, # then you cannot continue, and this will override @isContinueEnabled cannotContinue = not StepPanel.canContinue(@props.id) {@continueButtonText?() or 'Continue'} render: -> {pinned, courseId, id, taskId, review} = @props # from StepFooterMixin footer = @renderFooter({stepId: id, taskId, courseId, review}) {@renderBody()} {@renderGroup?()} Yossarian.EventArtistView = Ember.View.extend tagName: 'img' attributeBindings: ['src', 'title'] preload: -> @set('src', @get('content.image.image.large.url')) @set('title', @get('content.name')) Yossarian.EventArtistsView = Ember.CollectionView.extend tagName: 'div' content: [] currentItem: null itemViewClass: Yossarian.EventArtistView didInsertElement: -> views = @get('childViews') view.preload() for view in views[0..2] for view in views[3..(views.length - 1)] ((view) -> setTimeout (-> view.preload()), 3000)(view) setTimeout (=> @initilizeSlider()), 100 initilizeSlider: -> @$().nivoSlider effect: 'slideInRight' animSpeed: 400 pauseTime: Math.random() * (20000 - 3000) + 3000 directionNav: false controlNav: false pauseOnHover: true startSlide: Math.round(Math.random() * 2) {Wrappers} = require "#{__dirname}/wrappers" class BeanBuilder basePath: null suffix: null createObjectCallback: null useSingletons: false instances: null constructor: ({@basePath, @suffix, @createObjectCallback, @useSingletons}) -> if @suffix[0] is '_' @suffix = @suffix[1..] @instances = {} @useSingletons = @useSingletons is true build: (config) -> throw new Error 'No task defined.' unless config suffixLength = @suffix.length config.type = Wrappers.underscored(config.type ? 'default') config.type = "#{config.type}_#{@suffix}" unless config.type[-suffixLength..] is "_#{@suffix}" className = Wrappers.classify config.type if (@useSingletons or config.singleton) and @instances[className] instance = @instances[className] instance.reconfigure config if instance.reconfigure config return instance filePath = "#{@basePath}/#{config.type}" requiredScope = require filePath Clazz = requiredScope[className] throw new Error "Type #{className} was not found in file #{filePath}." unless Clazz instance = if typeof @createObjectCallback is 'function' @createObjectCallback Clazz, config else new Clazz # Shadow copy of this instance for singleton usage. if (@useSingletons or config.singleton) @instances[className] = instance instance exports.BeanBuilder = BeanBuilder## Browser policy to allow many external sources, but *not* frames. #BrowserPolicy.content.allowOriginForAll 'http://meteor.local' BrowserPolicy.content.allowImageOrigin '*' BrowserPolicy.content.allowMediaOrigin '*' BrowserPolicy.content.allowFontOrigin '*' BrowserPolicy.content.allowStyleOrigin '*' BrowserPolicy.content.allowConnectOrigin '*' Marbles.Views.NavigationActive = class NavigationActiveView extends Marbles.View @view_name: 'navigation_active' @buildMappingRegexp: (mapping) -> new RegExp("^#{mapping.replace("*", ".*?")}$") initialize: -> @active_class = Marbles.DOM.attr(@el, 'data-active-class') @active_selector = Marbles.DOM.attr(@el, 'data-active-selector') @buildActiveMapping() @markActiveItem() Marbles.history.on 'route', (router, name, args) => @markActiveItem() buildActiveMapping: => @active_mapping = [] for el in Marbles.DOM.querySelectorAll(@active_selector, @el) continue unless mapping = Marbles.DOM.attr(el, 'data-match-url') reg = @constructor.buildMappingRegexp(mapping) @active_mapping.push([reg, el]) @active_mapping = _.sortBy(@active_mapping, ( (item) => item[0].source.length * -1 )) markActiveItem: => path = window.location.pathname matched = false for item in @active_mapping [reg, el] = item if !matched && reg.test(path) matched = true Marbles.DOM.addClass(el, @active_class) else Marbles.DOM.removeClass(el, @active_class) class VendorView extends KDView constructor:-> super cssClass: 'vendor' @vendorController = new KDListViewController selection : yes viewOptions : cssClass : 'vendor-list' wrapper : yes itemClass : VendorItemView , items : [ { name : "Koding", view : new VendorKoding } { name : "Amazon", view : new VendorAmazon } { name : "DigitalOcean", view : new VendorDigitalOcean } { name : "EngineYard", view : new VendorEngineyard } ] viewAppended:-> @mainView = new KDTabView cssClass : "vendor-mainview" hideHandleContainer : yes @vendorListView = new KDView @vendorListView.addSubView new KDHeaderView title : "Vendors" type : "medium" @vendorListView.addSubView @vendorController.getView() @addSubView @messagesSplit = new SplitViewWithOlderSiblings sizes : ["200px",null] views : [@vendorListView, @mainView] cssClass : "vendor-split" resizable : no # Add vendor views to mainview for vendor in @vendorController.itemsOrdered @mainView.addPane vendor.getData().view # Add Welcome pane @mainView.addPane new VendorWelcomeView @vendorController.on "ItemSelectionPerformed", (controller, item)=> {view} = item.items.first.getData() @mainView.showPane view class @VoteController extends RouteController waitOn: -> q = {} if filterType = @params.filterType q.type = filterType if filterTag = @params.filterTag q.tags = filterTag Meteor.subscribe('proposals-min', q) after: -> document.title = "Vote | Reversim Summit 2014" tempalte: 'vote' data: -> speakers = User.allSpeakers() user = User.current() speakers = if user and (user.admin() or user.moderator()) then sort(speakers) else _.shuffle(speakers) return { page: 'vote' speakers: speakers filterType: @params.filterType filterTag: @params.filterTag } sort = (speakers) -> _.sortBy(speakers, (speaker) -> - sum(speaker.proposals().map((p) -> p.voteCount())) ) sum = (arr) -> _.reduce(arr, (sum, num) -> sum + num)fs = require 'fs' require 'window' measure 'spec suite require time', -> fsUtils = require 'fs-utils' path = require 'path' require 'spec-helper' requireSpecs = (directoryPath, specType) -> for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath require specPath setSpecType = (specType) -> for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType? spec.specType = specType # Run core specs requireSpecs(window.resourcePath) setSpecType('core') # Run bundled package specs if fsUtils.isDirectorySync(config.nodeModulesDirPath) for packageName in fs.readdirSync(config.nodeModulesDirPath) packagePath = path.join(config.nodeModulesDirPath, packageName) requireSpecs(packagePath, 'bundled') if atom.isInternalPackage(packagePath) setSpecType('bundled') # Run user package specs if fsUtils.isDirectorySync(config.userPackagesDirPath) for packageName in fs.readdirSync(config.userPackagesDirPath) requireSpecs(path.join(config.userPackagesDirPath, packageName)) setSpecType('user') class Dashing.Lecturelist extends Dashing.Widget ready: -> onData: (data) -> i = 0 node = $(@get('node')) if data.items.length == 0 @set 'empty', true while i < data.items.length capacity = data.items[i].capacity tickets = data.items[i].tickets people = "" x = capacity - tickets while x-- people += "" while tickets-- people += "" data.items[i].people = people i++ app = require 'core/application' AuthModal = require 'views/core/AuthModal' RootView = require 'views/core/RootView' template = require 'templates/sales-view' module.exports = class SalesView extends RootView id: 'sales-view' template: template events: 'click .btn-contact-us': 'onClickContactUs' 'click .btn-create-account': 'onClickSignup' 'click .btn-login-account': 'onClickLogin' getTitle: -> 'CodeCombat' onClickContactUs: (e) -> app.router.navigate '/teachers/freetrial', trigger: true onClickLogin: (e) -> @openModalView new AuthModal(mode: 'login') if me.get('anonymous') window.tracker?.trackEvent 'Started Login', category: 'Sales', label: 'Sales Login' onClickSignup: (e) -> @openModalView new AuthModal() if me.get('anonymous') window.tracker?.trackEvent 'Started Signup', category: 'Sales', label: 'Sales Create' logoutRedirectURL: false # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ roundUpBy = (value, round_to) -> return round_to * Math.ceil(value / round_to) formatNumber = (number) -> Math.ceil(number).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") animateNumber = (element, target_count, duration) -> jQuery(counter: 0).animate { counter: target_count }, duration: duration easing: "easeInOutQuint" step: -> element.text formatNumber(@counter) complete: -> jQuery(counter: target_count).animate { counter: (40 + target_count) }, duration: 400 easing: "easeOutQuint" step: -> element.text formatNumber(@counter) return return return $ -> metricsInview = new (Waypoint.Inview)( element: $('.metric-box')[0] enter: (direction) -> $(".metric-box strong").each (index) -> $this = $(this) $target_count = parseInt($this.text().replace(/\,/g, '')) animateNumber($this, $target_count, 300 + index * 200) # only run this once this.destroy() ) # I love this program. # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # An example hack to log to the console when each text editor is saved. # # atom.workspace.observeTextEditors (editor) -> # editor.onDidSave -> # console.log "Saved! #{editor.getPath()}" # Hide scope-related notices shortly after displaying them atom.workspace.notificationManager.onDidAddNotification (popup) -> if /^\s*Scopes at Cursor/.test(popup.message) setTimeout (-> popup.dismiss() ), atom.config.get("popupDismissDelay") || 1000 module.exports = -> # Project configuration @initConfig pkg: @file.readJSON 'package.json' # BDD tests on Node.js mochaTest: nodejs: src: ['spec/*.coffee'] options: reporter: 'spec' # Coding standards coffeelint: components: files: src: ['spec/*.coffee', 'src/*.coffee', 'src/runtimes/*.coffee'] options: max_line_length: value: 80 level: 'warn' # Protocol tests shell: msgflo: command: 'node bin/msgflo' options: async: true fbp_test: command: 'fbp-test --colors' # Grunt plugins used for building # Grunt plugins used for testing @loadNpmTasks 'grunt-mocha-test' @loadNpmTasks 'grunt-coffeelint' @loadNpmTasks 'grunt-shell-spawn' # Our local tasks @registerTask 'fbp-test', [ 'shell:msgflo' 'shell:fbp_test' 'shell:msgflo:kill' ] @registerTask 'build', 'Build the chosen target platform', (target = 'all') => # nothing @registerTask 'test', 'Build and run automated tests', (target = 'all') => @task.run 'coffeelint' @task.run 'build' @task.run 'mochaTest' # @task.run 'fbp-test' @registerTask 'default', ['test'] $.fn.equalHeights = () -> max = -1 $(this).each -> h = $(this).height() max = (if h > max then h else max) $(this).css "min-height": maxclass app.views.BasePage extends app.View constructor: (@el, @entry) -> super deactivate: -> if super @highlightNodes = [] render: (content, fromCache = false) -> @highlightNodes = [] @previousTiming = null @addClass "_#{@entry.doc.type}" unless @constructor.className @html content @prepare?() unless fromCache @activate() @delay @afterRender if @afterRender if @highlightNodes.length > 0 $.requestAnimationFrame => $.requestAnimationFrame(@paintCode) return highlightCode: (el, language) -> return unless language language = "language-#{language}" if $.isCollection(el) for e in el e.classList.add(language) @highlightNodes.push(e) else if el el.classList.add(language) @highlightNodes.push(el) return paintCode: (timing) => if @previousTiming if Math.round(1000 / (timing - @previousTiming)) > 50 # fps @nodesPerFrame = Math.round(Math.min(@nodesPerFrame * 1.25, 50)) else @nodesPerFrame = Math.round(Math.max(@nodesPerFrame * .8, 10)) else @nodesPerFrame = 10 Prism.highlightElement(el) for el in @highlightNodes.splice(0, @nodesPerFrame) $.requestAnimationFrame(@paintCode) if @highlightNodes.length > 0 @previousTiming = timing return Twitter = require 'twitter' client = new Twitter consumer_key: process.env.HUBOT_TWITTER_CONSUMER_KEY, consumer_secret: process.env.HUBOT_TWITTER_CONSUMER_SECRET, access_token_key: process.env.HUBOT_TWITTER_ACCESS_TOKEN_KEY, access_token_secret: process.env.HUBOT_TWITTER_ACCESS_TOKEN_SECRET, # I give you, a pre-configured twitter client, # So you don't have to. module.exports = client: client # A helper for the general case, posts `body` # as a tweet, and calls you back with it, as well # as a pre-built URL tweet: (body, cb=(err, tweet, url)) => params = status: body client.post 'statuses/update', params, (error, tweet, response) -> return cb(error) if error # LUCKY US myself = tweet.user.screen_name tid = tweet.id_str url = "https://twitter.com/#{myself}/status/#{tid}" return cb(tweet, url) Controller = Ember.Controller.extend name: 'profile' needs: ['currentUser', 'accounts', 'account'] userBinding: 'controllers.currentUser' accountBinding: 'controllers.account' activate: (action, params) -> this["view#{$.camelize(action)}"]() viewHooks: -> @connectTab('hooks') @get('controllers.account').reloadHooks() viewUser: -> @connectTab('user') connectTab: (tab) -> @set('tab', tab) billingUrl: (-> id = if @get('account.type') == 'user' then 'user' else @get('account.login') "#{@get('config').billing_endpoint}/subscriptions/#{id}" ).property('account.login', 'account.type') Travis.ProfileController = Controller module.exports = class CallbacksRegistry constructor: -> @nextId = 0 @callbacks = {} add: (callback) -> @callbacks[++@nextId] = callback @nextId get: (id) -> @callbacks[id] call: (id, args...) -> @get(id).call global, args... apply: (id, args...) -> @get(id).apply global, args... remove: (id) -> delete @callbacks[id] op = require '../../../tasks/package/operators' module.exports = (config) -> config.tasks.package.merge operatorsMap: 'annotate:class': op.annotateClass 'annotate:file': op.annotateFile 'join': op.join 'compile': op.compile 'uglify': op.uglify 'create:directory': op.createDirectory 'strip:requires': op.stripRequires 'exports:package': op.exportsToPackage 'saveToFile': op.saveToFile # Get the name of the favorites collection for a project module?.exports = (project) -> #--> Naming Convention: "Favorites for #{project_id}" # Prevents global uniqueness validation conflict under project scope name = "Favorites" name += " (#{project.id})" if project? name mkdirp = Meteor.npmRequire 'mkdirp' Busboy = Meteor.npmRequire "busboy" fs = Npm.require 'fs' os = Npm.require 'os' path = Npm.require 'path' Router.route '/image/:roomId', name: 'image' where: 'server' onBeforeAction: (req, res, next) -> {roomId} = @params filenames = [] if req.method is 'POST' busboy = new Busboy headers: req.headers busboy.on 'file', (fieldname, file, filename, encoding, mimetype) -> dir = path.join Meteor.settings.imageDir, id try mkdirp.sync dir saveTo = path.join dir, filename file.pipe fs.createWriteStream saveTo filenames.push saveTo catch error res.statusCode = 500 next() busboy.on 'finish', -> if filenames.length res.statusCode = 204 else res.statusCode = 400 next() req.pipe busboy else next() .post -> @response.end() Router.route '/image/:roomId/:file', where: 'server' .get -> {roomId, file} = @params imagePath = path.join Meteor.settings.imageDir, id, file if fs.existsSync imagePath image = fs.readFileSync imagePath @response.writeHead 200, 'Content-Type': 'image/jpg' @response.write image else @response.statusCode = 500 @response.end() Batman.mixin Batman.Filters, timeText: (str_time)-> str_time = str_time.split('+') moment.locale('de') now = moment.utc() start = moment(str_time[0], "HH-mm").add(str_time[1], 'minutes') "#{start.from(now)} (+#{str_time[1]})" class Dashing.List extends Dashing.Widget ready: -> if @get('unordered') $(@node).find('ol').remove() else $(@node).find('ul').remove()Q = require 'q' moment = require('moment') HeadlineService = require('../services/headline') TYPE_SOURCE_MAP = esri: name: 'Environment Agency - Abu Dhabi' url: 'http://www.ead.ae' worldBank: name: 'World Bank Database' url: 'http://data.worldbank.org' DATE_FORMAT = 'D MMM YYYY' module.exports = class IndicatorPresenter constructor: (@indicator) -> populateHeadlineRangesFromHeadlines: (headlines) -> @indicator.headlineRanges = {} xAxis = @indicator.indicatorDefinition?.xAxis if xAxis? newest = headlines[0][xAxis].toString() oldest = headlines[headlines.length - 1][xAxis].toString() @indicator.headlineRanges = oldest: moment(oldest).format(DATE_FORMAT) newest: moment(newest).format(DATE_FORMAT) populateIsUpToDate: -> deferred = Q.defer() if @indicator.narrativeRecency? @indicator.isUpToDate = HeadlineService.narrativeRecencyTextIsUpToDate( @indicator.narrativeRecency ) deferred.resolve() else new HeadlineService(@indicator).calculateRecencyOfHeadline().then((narrativeRecency)=> @indicator.isUpToDate = HeadlineService.narrativeRecencyTextIsUpToDate( narrativeRecency ) deferred.resolve() ).fail(deferred.reject) return deferred.promise populateNarrativeRecency: -> deferred = Q.defer() new HeadlineService(@indicator).calculateRecencyOfHeadline().then((recency)=> @indicator.narrativeRecency = recency deferred.resolve() ).fail(deferred.reject) return deferred.promise app = require 'app' delegate = require 'atom_delegate' path = require 'path' Window = require 'window' # All opened windows. windows = [] # Quit when all windows are closed. app.on 'window-all-closed', -> app.quit() delegate.browserMainParts.preMainMessageLoopRun = -> win = new Window width: 800, height: 600, show: false win.loadUrl "file://#{__dirname}/../static/index.html" win.on 'destroyed', -> windows.splice windows.indexOf(win), 1 windows.push win win.show() httpProxy = require 'http-proxy' http = require 'http' service = require './service' DEFAULT_CONFIG = dir: "/Users/adam/.wow" timeout: 20000 class ServiceManager constructor: (config) -> @config = config or DEFAULT_CONFIG @services = {} getService: (name) => if @services[name]? return @services[name] else service = new service.Service(this, name) @services[name] = service return service getProxy: => myProxy = httpProxy.createServer (req, res, proxy) => service = @getService(req.headers.host) service.start -> proxy.proxyRequest req, res, host: 'localhost' port: service.port return myProxy listen: (port) => @getProxy().listen(port) exports.ServiceManager = ServiceManager I18n = (id, args...) -> m = chrome.i18n.getMessage(id, [args...]) return escapeHtml(m) if m != "" m = id.replace(/(.)([A-Z][a-z])/g, (m, p1, p2) -> "#{p1} #{p2.toLowerCase()}") m = m.replace(/_/g, ' ') escapeHtml(m) $(-> pat = /__MSG_([A-Za-z0-9]+)__/ $("a,button").each((i, v) -> e = $(v) title = e.attr?("title") if title newTitle = title.replace(pat, (m, p1) -> I18n(p1)) e.attr("title", newTitle) if title != newTitle html = e.html() return true unless html newHtml = html.replace(pat, (m, p1) -> I18n(p1)) e.html(newHtml) if html != newHtml ) ) app = require 'app' fs = require 'fs' path = require 'path' protocol = require 'protocol' # Private: Handles requests with 'atom' protocol. # # It's created by {AtomApplication} upon instantiation, and is used to create a # custom resource loader by adding the 'atom' custom protocol. module.exports = class AtomProtocolHandler constructor: (@resourcePath) -> @loadPaths = [ path.join(@resourcePath, 'node_modules') path.join(app.getHomeDir(), '.atom', 'packages') ] @registerAtomProtocol() # Private: Creates the 'atom' custom protocol handler. registerAtomProtocol: -> protocol.registerProtocol 'atom', (request) => relativePath = path.normalize(request.url.substr(7)) for loadPath in @loadPaths filePath = path.join(loadPath, relativePath) break if fs.statSyncNoException(filePath)? return new protocol.RequestFileJob(filePath) connect = require('connect') utils = connect.utils forbiddenURLChars= /\/([._][^/]*)|_$/ ### todo: // detect if URL is of a directory and, if so, bring up the _index if (stat.isDirectory()) if (!redirect) return @next(); @res.statusCode = 301; @res.setHeader('Location', url.pathname + '/'); @res.end('Redirecting to ' + url.pathname + '/'); return; } ### exports = module.exports = action= ()-> actions= @meta._actions if forbiddenURLChars.test(@pathinfo.url.pathname) @res.statusCode = 403; @res.end('Forbidden URL'); return; urlExtension = @pathinfo.path.extension if urlExtension aue= @meta._allowed_url_extensions unless aue.set s= {} s['.'+key]=true for key in aue aue.set= s unless aue.set[urlExtension] @res.statusCode = 415; @res.end('Unsupported Media Type'); return; actionList= actions[urlExtension] ? actions['*'] @next() unless actionList i= -1 pass= ()=> i+= 1 if (actionList.length > i) actionList[i].call(this,pass) else @next() pass(){CompositeDisposable} = require 'atom' module.exports = config: require './config' activate: (state) -> @transpiler ?= new (require './transpiler') # track any file save ( buffer save) events and transpile if babel @disposable = new CompositeDisposable @disposable.add atom.project.onDidChangePaths => @transpiler.stopUnusedTasks() @disposable.add atom.workspace.observeTextEditors (textEditor) => @disposable.add textEditor.onDidSave (event) => grammar = textEditor.getGrammar() return if grammar.packageName isnt 'language-babel' @transpiler.transpile(event.path, textEditor) deactivate: -> if @disposable? @disposable.dispose() @transpiler.stopAllTranspilerTask() module.exports = config: jshintExecutablePath: default: '' type: 'string' description: 'Leave empty to use bundled' provideLinter: -> jshintPath = require('path').join(__dirname, '..', 'node_modules', '.bin', 'jshint') helpers = require('atom-linter') reporter = require('jshint-json') # a string path provider = grammarScopes: ['source.js', 'source.js.jsx'] scope: 'file' lintOnFly: true lint: (textEditor) -> exePath = atom.config.get('linter-jshint.jshintExecutablePath') or jshintPath filePath = textEditor.getPath() text = textEditor.getText() parameters = ['--reporter', reporter, '--extract', 'auto', '--filename', filePath, '-'] return helpers.exec(exePath, parameters, {stdin: text}).then (output) -> return JSON.parse(output).result.filter((entry) -> entry.error.id).map (entry) -> error = entry.error pointStart = [error.line - 1, error.character - 1] pointEnd = [error.line - 1, error.character] return { type: error.id.substr(1, error.id.length - 2) text: "#{error.code} - #{error.reason}" filePath range: [pointStart, pointEnd] } module.exports = configDefaults: executableDir: null activate: -> console.log 'activate linter-python-flake8' #= require ../../node_modules/share/node_modules/browserchannel/dist/bcsocket-uncompressed #= require ../../node_modules/share/webclient/share.uncompressed #= require ../../node_modules/share/webclient/json.uncompressed module = angular.module "plunker.share", [] module.service "share", [ () -> ]App.Votes = hoverize: (selector, delegateTo) -> $(selector).on "mouseenter", delegateTo, -> $(this).find("div.anonymous-votes").show() $(this).find("div.organizations-votes").show() $(this).find("div.not-logged").show() $(selector).on "mouseleave", delegateTo, -> $(this).find("div.anonymous-votes").hide() $(this).find("div.organizations-votes").hide() $(this).find("div.not-logged").hide() initialize: -> App.Votes.hoverize $("#debates"), "div.votes" App.Votes.hoverize $("#proposals, #featured-proposals"), "div.supports" false # For some odd reason, this isn't working. There's no reason why it shouldn't. I # think either Heroku is messing up my config, or I need to flip a setting in # Heroku somewhere. # # Instead, I'm requiring HTTPS through CloudFlare page rules, a hacky but # effective solution #config = require '../config' # #exports.forceHTTPS = (req, res, next) -> # # redirect to HTTPS in production, take care of Heroku's special https # # handling # if not (req.secure or (req.header('x-forwarded-proto') == 'https')) and # config.nodeEnv == 'production' # res.redirect "https://#{req.headers.host}#{req.url}" # else # next() exports.app = (req, res, next) -> res.render 'app', loggedIn: req.isAuthenticated() user: req.user Mark = require './mark' class FanMark extends Mark type: 'fan' source: null distance: 0 angle: 0 spread: 0 constructor: -> super @set source: @source || {x: 0, y: 0} distance: @distance angle: @angle spread: @spread 'set distance': (value) -> Math.max value, 10 'set spread': (value) -> Math.min 90, Math.max 1, value toJSON: -> {@type, @source, @distance, @angle, @spread} module.exports = FanMark class window.SubchannelItemView extends Backbone.Marionette.ItemView tagName: "li" events: click: "clickHandler" "click .close": "destroySubchannel" template: "subchannels/_subchannel_item" initialize: -> @model.bind "destroy", @close, this destroySubchannel: (e) -> @model.destroy() if confirm("Are you sure you want to remove this channel from your channel?") e.stopPropagation() false onRender: -> @$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id') clickHandler: (e) -> return if e.metaKey or e.ctrlKey or e.altKey mp_track "Channel: Click on subchannel", channel_id: currentChannel.id subchannel_id: @model.id Backbone.history.navigate @model.get("created_by").username + "/channels/" + @model.id, true e.preventDefault() false Bookshelf = require('bookshelf') config = require('../knex_config').database Bookshelf.PG = PG = Bookshelf.initialize(config) Team = PG.Model.extend tableName: 'teams' hasTimestamps: ['created_at', 'updated_at'] toJSON: -> { id: @id name: @get('name') generation: @get('generation') pokemon: JSON.parse(@get('contents')) } Teams = PG.Collection.extend model: Team module.exports = {Team, Teams} Helpers = require '../lib/helpers' describe "The Results Validation Helper", -> it "should throw an exception when nothing is passed.", -> expect( -> Helpers.validateResults()).toThrow() it "should throw an exception when a String is passed.", -> expect( -> Helpers.validateResults('String')).toThrow() describe "The Linter Validation Helper", -> it "should throw an exception when grammarScopes is not an Array.", -> linter = { grammarScopes: 'not an array' lint: -> } expect( -> Helpers.validateLinter(linter)).toThrow() it "should throw an exception when lint is missing.", -> linter = { grammarScopes: [] } expect( -> Helpers.validateLinter(linter)).toThrow() it "should throw an exception when a lint is not a function.", -> linter = { grammarScopes: [] lint: 'not a function' } expect( -> Helpers.validateLinter(linter)).toThrow() it "should return true when everything validates.", -> linter = { grammarScopes: [] lint: -> } expect(Helpers.validateLinter(linter)).toEqual(true) window.UsersComponent = class UsersComponent @initialize: -> @addEventListeners() @addEventListeners: -> @userDetailsTooltip() @userDetailsTooltip: -> tooltipClass = '.information-tooltip' $("#{tooltipClass}-trigger").toggle( (ev) -> ev.preventDefault() $("#{tooltipClass}-trigger").not(@).siblings(tooltipClass).hide() $(@).html(' close') $(@).siblings(tooltipClass).show() , (ev) -> ev.preventDefault() $(@).html(' details') $(@).siblings(tooltipClass).hide() ) $(document).ready -> UsersComponent.initialize() routes = require './routes.js' bodyParser = require 'body-parser' path = require 'path' express = require 'express' app = express() models = require('mongoose').models outline = require '../outline.js' utils = require './utils.js' # Default parsers app.use express.static(path.resolve(outline.dist)) app.use bodyParser.urlencoded({ extended: false }) app.use bodyParser.json(); utils.allowCORS(app); # Setup routes for route in routes for name, config of route console.log "name : #{config.auth}" url = name.split('.')[0]; if config.auth in ['true', 'optional'] app[config.method](url, (req, res, next) -> utils.setupAuthData req, res, next, config) app[config.method](url, (req, res, next) -> utils.rejectBadRequest(req, res, next, config)) app[config.method](url, config.fn); app.get '*/', (req, res) -> res.sendFile path.resolve("#{__dirname}/../#{outline.dist}/#{req.path}") app.get '/', (req, res) -> res.sendFile path.resolve("#{__dirname}/../#{outline.dist}/index.html") module.exports = app;describe "CMS", -> beforeEach -> CMS.unbind() it "should initialize Models", -> expect(CMS.Models).toBeDefined() it "should initialize Views", -> expect(CMS.Views).toBeDefined() describe "main helper", -> beforeEach -> @previousAjaxSettings = $.extend(true, {}, $.ajaxSettings) window.stubCookies["csrftoken"] = "stubCSRFToken" $(document).ready() afterEach -> $.ajaxSettings = @previousAjaxSettings it "turn on Backbone emulateHTTP", -> expect(Backbone.emulateHTTP).toBeTruthy() it "setup AJAX CSRF token", -> expect($.ajaxSettings.headers["X-CSRFToken"]).toEqual("stubCSRFToken") path = require 'path' colors = require 'colors' CSON = require 'season' config = require './config' Command = require './command' module.exports = class Publisher extends Command userConfigPath: null atomNpmPath: null constructor: -> @userConfigPath = config.getUserConfigPath() @atomNpmPath = require.resolve('npm/bin/npm-cli') run: (options) -> process.stdout.write 'Publishing ' try {name, version} = CSON.readFileSync(CSON.resolve('package')) ? {} process.stdout.write "#{name}@#{version} " catch e publishArgs = ['--userconfig', @userConfigPath, 'publish'] @fork @atomNpmPath, publishArgs, (code, stderr='') => if code is 0 process.stdout.write '\u2713\n'.green options.callback() else process.stdout.write '\u2717\n'.red options.callback(stderr.red) angular.module("admin.enterprises") .controller "enterpriseCtrl", ($scope, Enterprise, PaymentMethods, ShippingMethods) -> $scope.Enterprise = Enterprise.enterprise $scope.PaymentMethods = PaymentMethods.paymentMethods $scope.ShippingMethods = ShippingMethods.shippingMethods for PaymentMethod in $scope.PaymentMethods PaymentMethod.selected = if PaymentMethod.id in $scope.Enterprise.payment_method_ids then true else false $scope.paymentMethodsColor = -> if $scope.PaymentMethods.length > 0 if $scope.selectedPaymentMethodsCount() > 0 then "blue" else "red" else "red" $scope.selectedPaymentMethodsCount = -> $scope.PaymentMethods.reduce (count, PaymentMethod) -> count++ if PaymentMethod.selected count , 0 for ShippingMethod in $scope.ShippingMethods ShippingMethod.selected = if ShippingMethod.id in $scope.Enterprise.shipping_method_ids then true else false $scope.shippingMethodsColor = -> if $scope.ShippingMethods.length > 0 if $scope.selectedShippingMethodsCount() > 0 then "blue" else "red" else "red" $scope.selectedShippingMethodsCount = -> $scope.ShippingMethods.reduce (count, ShippingMethod) -> count++ if ShippingMethod.selected count , 0class ResultViewModel constructor: (@htmlArray) -> @html = ko.computed () => @htmlArray().join("") afterListviewRender: (element, data) -> # サムネイル表示時のレンダリングがうまくいかないので # 自前でクラスを設定する。 $(element).addClass("ui-li-has-thumb") $(element).find("img").addClass("ui-li-thumb") # refresh しないと説明文が画面に収まらない場合がある $("#preview").listview("refresh") showPhoto: (listItem) => $.mobile.changePage "#preview-page", { transition: "slide" } imgObject = $(listItem).find("img").clone() imgObject.removeClass("ui-li-thumb") imgObject.removeAttr("height") imgObject.width("100%") $("#img-preview").html(imgObject) launchApp: (url) => $.mobile.changePage "#main" window.location = url + encodeURIComponent(@html()) insertToMoblogger: () => this.launchApp("moblogger://append?text=") launchMobloggerAndCopy: () => this.launchApp("moblogger://pboard?text=") insertToRowline: () => this.launchApp("rowline:///set?loc=bottom&view=lines&text=") sendToTextHandler: () => this.launchApp("myscripts://run?title=TextHandler&text=") insertToTextwell: () => T( 'add', { text: @html() }) "*": core: disabledPackages: [ "wrap-guide" "activate-power-mode" ] editor: {} "exception-reporting": userId: "79967b20-c933-87c9-85b8-ea6b20c3a648" "linter-puppet-lint": oldVersion: false skip140Chars: true skip80Chars: true minimap: plugins: cursorline: true cursorlineDecorationsZIndex: 0 "find-and-replace": true "find-and-replaceDecorationsZIndex": 0 "git-diff": true "git-diffDecorationsZIndex": 0 linter: true linterDecorationsZIndex: 0 "minimap-autohide": true "minimap-autohideDecorationsZIndex": 0 sunset: daytime_syntax_theme: "one-light-syntax" daytime_ui_theme: "one-light-ui" has_been_configured: true nighttime_syntax_theme: "one-dark-syntax" nighttime_ui_theme: "one-dark-ui" when_does_it_get_dark: 1400 when_does_it_get_light: 700 welcome: showOnStartup: false '.workspace': 'ctrl-M': 'markdown-preview:toggle' '.platform-darwin .markdown-preview': 'cmd-+': 'markdown-preview:zoom-in' 'cmd-=': 'markdown-preview:zoom-in' 'cmd--': 'markdown-preview:zoom-out' 'cmd-_': 'markdown-preview:zoom-out' 'cmd-0': 'markdown-preview:reset-zoom' '.platform-win32 .markdown-preview, .platform-linux .markdown-preview': 'ctrl-+': 'markdown-preview:zoom-in' 'ctrl-=': 'markdown-preview:zoom-in' 'ctrl--': 'markdown-preview:zoom-out' 'ctrl-_': 'markdown-preview:zoom-out' 'ctrl-0': 'markdown-preview:reset-zoom' class Labels constructor: -> form = $('.label-form') @setupLabelForm(form) @cleanBinding() @addBinding() @updateColorPreview addBinding: -> $(document).on 'click', '.suggest-colors a', @setSuggestedColor $(document).on 'input', 'input#label_color', @updateColorPreview cleanBinding: -> $(document).off 'click', '.suggest-colors a' $(document).off 'input', 'input#label_color' # Initializes the form to disable the save button if no color or title is entered setupLabelForm: (form) -> disableButtonIfAnyEmptyField form, '.form-control', form.find('.js-save-button') # Updates the the preview color with the hex-color input updateColorPreview: => previewColor = $('input#label_color').val() $('div.label-color-preview').css('background-color', previewColor) # Updates the preview color with a click on a suggested color setSuggestedColor: (e) => color = $(e.currentTarget).data('color') $('input#label_color').val(color) @updateColorPreview() # Notify the form, that color has changed $('.label-form').trigger('keyup') e.preventDefault() @Labels = Labels window.Tahi ||= {} class Tahi.RichEditableElement constructor: (@element) -> @instance = CKEDITOR.inline @element, extraPlugins: 'sharedspace' removePlugins: 'floatingspace,resize' sharedSpaces: top: 'toolbar' toolbar: [ [ 'Styles', 'Format', 'FontSize' ] [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'Table' ] [ 'PasteFromWord' ], [ 'Link', 'Unlink', 'Anchor' ] [ 'Find', 'Replace', '-', 'Scayt' ] ] @placeholderText = @element.attributes['placeholder'].value @setPlaceholder() @instance.on 'focus', => @clearPlaceholder() @instance.on 'blur', => @setPlaceholder() setPlaceholder: -> text = $($.parseHTML(@instance.getData())).text().trim() if text == '' || text == @placeholderText @instance.element.addClass 'placeholder' @instance.setData @placeholderText clearPlaceholder: -> text = $($.parseHTML(@instance.getData())).text().trim() if text == @placeholderText @instance.element.removeClass 'placeholder' @instance.setData '' # spec/javascripts/foobar_spec.js.coffee describe "foobar", -> it 'works', -> expect(1 + 1).toEqual(2); EnterDialog = require './enter-dialog' {Stacktrace} = require './stacktrace' {StacktraceView} = require './stacktrace-view' {NavigationView} = require './navigation-view' editorDecorator = require './editor-decorator' module.exports = activate: (state) -> atom.workspaceView.command 'stacktrace:paste', -> atom.workspaceView.appendToTop new EnterDialog() atom.workspaceView.command 'stacktrace:from-selection', -> selections = atom.workspace.getActiveEditor()?.getSelections() text = (s.getText() for s in (selections or [])).join '' atom.emit 'stacktrace:accept-trace', trace: text atom.workspaceView.command 'stacktrace:caller', -> NavigationView.current()?.navigateToCaller() atom.workspaceView.command 'stacktrace:follow-call', -> NavigationView.current()?.navigateToCalled() atom.workspace.eachEditor editorDecorator @activeChanged = Stacktrace.on 'active-changed', -> editorDecorator(e) for e in atom.workspace.getEditors() @navigationView = new NavigationView atom.workspaceView.appendToBottom @navigationView StacktraceView.registerIn(atom.workspace) @acceptTrace = atom.on 'stacktrace:accept-trace', ({trace}) => for trace in Stacktrace.parse(trace) trace.register() atom.workspace.open trace.getUrl() deactivate: -> @navigationView.remove() @activeChanged.off() @acceptTrace.off() import {mongoCallbacksCount} from '../mongo/MongooseCallbackManager' import {GROUPS} from '../../client/lib/informaticsGroups' import {START_SUBMITS_DATE} from '../api/dashboard' import send from '../metrics/graphite' import notify from '../metrics/notify' import Result from "../models/result" sendGraphite = () -> queries = ok: {ok: 1, lastSubmitTime: {$gt: START_SUBMITS_DATE}, findMistake: null, activated: true}, ps: {ps: 1} metrics = {} for key, query of queries query.total = 1 for group, _ of GROUPS query["userList"] = group metrics["#{key}.#{group}"] = (await Result.find(query)).length await send(metrics) sendWebSocketsCount2Graphite = () -> metrics = {"websockets": mongoCallbacksCount()} await send(metrics) sendWarnings = () -> endDate = new Date(new Date() - 5 * 60 * 1000) query = {ps: 1, lastSubmitTime: {$lt: endDate}, total: 1} submits = await Result.find(query) count = submits.length if count > 0 notify "#{count} решений в статусе PS" export default sendMetrics = () -> await sendWarnings() await sendGraphite() await sendWebSocketsCount2Graphite() # Load all requirements. gulp = require 'gulp' GulpTaskLoader = require 'gulp-task-loader' require 'require-yaml' # Load configuration. config = require './config.yml' # Configure gulp-task-loader opts = root: config.root, dir: config.tasks, exts: config.ext, config: config gulpTaskLoader = GulpTaskLoader opts # Define tasks. gulp.task 'default', ['jade'] gulp.task 'test', ['jasmine'] coffee = require 'gulp-coffee' gulp = require 'gulp' gutil = require 'gulp-util' mocha = require 'gulp-mocha' rimraf = require 'rimraf' handleError = (err) -> gutil.log err @emit 'end' gulp.task 'clean', (done) -> rimraf './lib', done gulp.task 'build', ['clean'], -> gulp.src './lib-src/**/*.coffee' .pipe coffee(bare: true).on 'error', handleError .pipe gulp.dest './lib' gulp.task 'test', ['build'], -> gulp.src './test/**/*.coffee', read: false .pipe mocha().on 'error', handleError gulp.task 'watch', -> gulp.watch ['./lib-src/**/*.coffee', './test/**/*.coffee'], ['test'] gulp.task 'default', ['watch', 'test'] # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> $('time').each (index, elem) -> $elem = $(elem) datetime = $elem.attr 'datetime' $elem.text moment(new Date(datetime)).fromNow() $('.preview').on 'click', -> textid = $(this).data('text') titleid = $(this).data('title') title = $(titleid).val() text = $(textid).val() $.post '/preview', { text: text }, (body) -> $preview = $('#preview') $preview.find('.post-title').text(title) $preview.find('.article-content').html(body) $preview.foundation('reveal', 'open') false $('.posts #post_event_attributes__destroy').on 'change', -> $('#event_fields_container').toggle this.checked expect = chai.expect mocha.setup 'bdd' describe 'VTEX JS Checkout Module', -> before -> $.mockjax url: mock.API_URL responseText: mock.orderform.empty it 'should have basic properties', -> expect(vtexjs.checkout).to.be.ok expect(vtexjs.checkout.getOrderForm).to.be.a('function') expect(vtexjs.checkout._getBaseOrderFormURL()).to.equal(mock.API_URL) it 'should get orderform', (done) -> xhr = vtexjs.checkout.getOrderForm() xhr.done (orderForm) -> expect(orderForm).to.deep.equal(mock.orderform.empty) done() xhr.fail (jqXHR) -> done(jqXHR) _ = require 'underscore' module.exports = class Collector constructor: -> @sessionId = new Date().getTime() # Private getPath: -> global.project.getPath() # Private getUser: -> process.env.USER # Private getSessionId: -> @sessionId # Private getUserAgent: -> navigator.userAgent # Private getScreenResolution: -> screen.width + "x" + screen.height # Private getPixelRatio: -> window.devicePixelRatio # Private getBrowserResolution: -> try width = 0 height = 0 if typeof window.innerWidth is 'number' width = window.innerWidth height = window.innerHeight else if document.documentElement?.clientWidth? width = document.documentElement.clientWidth height = document.documentElement.clientHeight else if document.body?.clientWidth? width = document.body.clientWidth height = document.body.clientHeight width + 'x' + height catch e 'unknown' # Private getPackages: -> _.keys(atom.activePackages) # Public: Returns an object containing all data collected. getData: (additionalData) -> data = window_path: @getPath() session_id: @getSessionId() actor_login: @getUser() user_agent: @getUserAgent() screen_resolution: @getScreenResolution() pixel_ratio: @getPixelRatio() browser_resolution: @getBrowserResolution() packages: JSON.stringify(@getPackages()) _.extend(data, additionalData) class Base58 constructor: -> @alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" @base = @alphabet.length encode: (num) -> throw new Error('Value passed is not a number.') if typeof num != 'number' str = '' while num >= @base mod = num % @base str = @alphabet[mod] + str num = (num - mod)/@base @alphabet[num] + str decode: (str) -> num = 0 for char, index in str.split(//).reverse() if (char_index = @alphabet.indexOf(char)) == -1 throw new Error('Value passed not a valid Base58 string.') num += char_index * Math.pow(@base, index) num # Export module module.exports = new Base58()class Screen extends NativeObject freeze: (options={}, callbacks={})-> @nativeCall method: "freeze" parameters: options successCallbacks: [callbacks.onSuccess] failureCallbacks: [callbacks.onFailure] unfreeze: (options={}, callbacks={})-> @nativeCall method: "unfreeze" parameters: options successCallbacks: [callbacks.onSuccess] failureCallbacks: [callbacks.onFailure] capture: (options={}, callbacks={})-> @nativeCall method: "takeScreenshot" parameters: options successCallbacks: [callbacks.onSuccess] failureCallbacks: [callbacks.onFailure] # For more information see: http://emberjs.com/guides/routing/ @Wheelmap.Router.map ()-> @resource 'index', path: '/', queryParams: ['lat', 'lon', 'zoom', 'node_id', 'status'] # index route showing map (no map route because, we need it more than once) # route returns models filtered by bounding box of map view ... how to?{ScrollView, BufferedProcess} = require 'atom' # Runs a portion of a script through an interpreter and displays it line by line module.exports = class ScriptView extends ScrollView @content: -> @div class: 'script', tabindex: -1, => @div class: 'output' constructor: (interpreter, make_args) -> super @interpreter = interpreter @make_args = make_args getTitle: -> if @interpreter? @interpreter else ":(" addLine: (line, out_type) -> #console.log(line) @find("div.output").append("
    #{line}
    ") runit: (err, code) -> if err? @addLine(err, "error") return command = @interpreter args = @make_args(code) # Default to where the user opened atom options = cwd: atom.project.getPath() env: process.env console.log("Running " + command + " " + args.join(" ")) stdout = (output) => @addLine(output, "stdout") stderr = (output) => @addLine(output, "stderr") exit = (return_code) -> console.log("Exited with #{return_code}") bufferedProcess = new BufferedProcess({command, args, options, stdout, stderr, exit}) ACTIVITIES = TW: action: 'lähetti Tweetin' icon: 'twitter' FB: action: 'teki Facebook-päivityksen' icon: 'facebook' ST: action: 'käytti täysistuntopuheenvuoron' icon: 'comment-alt' SI: action: 'allekirjoitti aloitteen' icon: 'pencil' IN: action: 'teki lakialoitteen' icon: 'lightbulb' WQ: action: 'jätti kirjallisen kysymyksen' icon: 'question' class @MemberActivityView extends Backbone.View tagName: 'li' className: 'activity' initialize: -> render: -> obj = @model.toJSON() act = ACTIVITIES[obj.type] obj.action = act.action obj.icon = act.icon obj.time_ago = moment(obj.time).fromNow() html = _.template $("#activity-item-template").html(), obj @$el.html html @$el.find('.summary').expander slicePoint: 350 return @ Point = require 'point' ChildProcess = nodeRequire 'child_process' $ = require 'jquery' module.exports = class TagGenerator constructor: (@path) -> parseTagLine: (line) -> sections = line.split('\t') if sections.length > 3 position: new Point(parseInt(sections[2]) - 1) name: sections[0] else null generate: -> command = "#{require.resolve('ctags')}" args = ['--fields=+KS', '-nf', '-', @path] ctags = ChildProcess.spawn(command, args) deferred = $.Deferred() output = '' ctags.stdout.setEncoding('utf8') ctags.stdout.on 'data', (data) -> output += data ctags.stdout.on 'close', => tags = [] for line in output.split('\n') tag = @parseTagLine(line) tags.push(tag) if tag deferred.resolve(tags) deferred '.platform-darwin .editor': 'cmd-:': 'spell-check:correct-misspelling' '.platform-darwin .corrections .editor': 'cmd-:': 'core:cancel' '.platform-win32 .editor': 'ctrl-:': 'spell-check:correct-misspelling' '.platform-win32 .corrections .editor': 'ctrl-:': 'core:cancel' '.platform-linux .editor': 'ctrl-:': 'spell-check:correct-misspelling' '.platform-linux .corrections .editor': 'ctrl-:': 'core:cancel' '.corrections .mini.editor input': 'enter': 'core:confirm' 'tab': 'core:confirm' ### Inject some [pseudo-]local variables ### fs = require 'fs' path = require 'path' ini = require '../package' for f of ini.devDependencies when /^[$\w]+$/.test f exports[f] = f for lib in fs.readdirSync src = path.join __dirname, '../src' continue unless fs.statSync lib = path.join src, lib .isDirectory() z = {} for file in fs.readdirSync lib if 'index' == name = path.parse(file).name z = {} break z[name] = path.join lib, file for k, v of z exports[k] = v _ = require('lodash') IS_BROWSER = window? { fetchMock, mockedFetch } = require('resin-fetch-mock') dataDirectoryPath = null if not IS_BROWSER temp = require('temp').track() dataDirectoryPath = temp.mkdirSync() ResinAuth = require('resin-auth')['default'] auth = new ResinAuth({ dataDirectory: dataDirectoryPath, tokenKey: 'token' }) getRequest = require('../lib/request') getCustomRequest = (opts, mockFetch = true) -> opts = _.assign({}, { auth, debug: false, isBrowser: IS_BROWSER }, opts) request = getRequest(opts) request._setFetch(mockedFetch) if mockFetch return request module.exports = -> IS_BROWSER: IS_BROWSER fetchMock: fetchMock auth: auth request: getCustomRequest() getCustomRequest: getCustomRequest # Adding CORS headers so we can use CDNs for static content WebApp.rawConnectHandlers.use (req, res, next) -> res.setHeader("Access-Control-Allow-Origin", "*") res.setHeader("X-Rocket-Chat-Version", VERSION) res.setHeader("Access-Control-Expose-Headers", "X-Rocket-Chat-Version") return next() _staticFilesMiddleware = WebAppInternals.staticFilesMiddleware WebAppInternals._staticFilesMiddleware = (staticFiles, req, res, next) -> res.setHeader("Access-Control-Allow-Origin", "*") res.setHeader("X-Rocket-Chat-Version", VERSION) res.setHeader("Access-Control-Expose-Headers", "X-Rocket-Chat-Version") _staticFilesMiddleware(staticFiles, req, res, next) Backbone.Factlink ||= {} class Backbone.Factlink.CrossFadeRegion extends Backbone.Marionette.Region defaultFadeTime = 560 initialize: -> @on 'close', -> @$el?.stop() crossFade: (newView) -> if @currentView @$el.stop().fadeOut(@_fadeTime(), => @show newView) else @show(newView) open: (view) -> @$el.stop().hide() .html(view.el) .fadeIn(@_fadeTime()) resetFade: -> return unless @$el #if there's no element, nothing's been shown. @$el.stop().fadeOut(@_fadeTime(), => @reset()) _fadeTime: -> @options?.fadeTime || defaultFadeTime module.exports = -> @loadNpmTasks 'grunt-shell' # Find Chrome binary here... @config 'shell', 'chrome-extension': command: 'google-chrome ' + [ '--pack-extension=chrome-extension/dist/tipsy' '--pack-extension-key=chrome-extension/key.pem' '--no-message-box' ].join(' ') if Meteor.isCordova document.addEventListener 'pause', -> Meteor.disconnect() document.addEventListener 'resume', -> Meteor.reconnect()'menu': [ { 'label': 'View' 'submenu': [ { 'label': 'Toggle Tree View', 'command': 'tree-view:toggle' } { 'label': 'Toggle Tree Side', 'command': 'tree-view:toggle-side' } ] } { 'label': 'Packages' 'submenu': [ 'label': 'Tree View' 'submenu': [ { 'label': 'Focus', 'command': 'tree-view:toggle-focus' } { 'label': 'Toggle', 'command': 'tree-view:toggle' } { 'label': 'Reveal Active File', 'command': 'tree-view:reveal-active-file' } { 'label': 'Toggle Tree Side', 'command': 'tree-view:toggle-side' } ] ] } ] 'context-menu': '.tree-view': 'Add File': 'tree-view:add' 'Add Folder': 'tree-view:add' 'Rename': 'tree-view:move' 'Delete': 'tree-view:remove' 'Copy Full Path': 'tree-view:copy-full-path' 'Copy Project Path': 'tree-view:copy-project-path' 'Show in Finder': 'tree-view:show-in-file-manager' '.pane .item-views': 'Reveal in Tree View': 'tree-view:reveal-active-file' _ = require 'underscore-plus' optimist = require 'optimist' request = require 'request' View = require './view' config = require './config' tree = require './tree' module.exports = class Docs extends View @commandNames: ['docs', 'home', 'open'] open: require 'open' parseOptions: (argv) -> options = optimist(argv) options.usage """ Usage: apm docs [options] Opens a package's homepage in the default browser. """ options.alias('h', 'help').describe('help', 'Print this usage message') options.boolean('p').alias('p', 'print').describe('print', 'Just print the URL, do not open it') run: (options) -> {callback} = options options = @parseOptions(options.commandArgs) [packageName] = options.argv._ unless packageName callback("Missing required package name") return @getPackage packageName, (error, pack) => if error? callback(error) return if repository = @getRepository(pack) if options.argv.print console.log repository else @open(repository) else callback("Package \"#{packageName}\" does not contain a repository URL") return callback() eval("window = {};") eval("attachEvent = function(){};") eval("console = {};") console.warn = -> self.postMessage type: 'warn' details: arguments console.log = -> self.postMessage type: 'warn' details: arguments self.addEventListener 'message', (event) -> switch event.data.type when 'start' window.resourcePath = event.data.resourcePath importScripts(event.data.requirePath) self.task = require(event.data.taskPath) self.postMessage(type:'started') else self.task[event.data.type](event.data) class Calculator presetNames: ['full', 'half', 'noSalad'] weekdays: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] weekTotalFor: (preset, target) -> total = 0 week = target[preset] for weekday, countServings of week continue if @weekdays.indexOf(weekday) == -1 total += countServings if countServings return total calcTotalsFor: (targets) -> totals = {} for target, presets of targets @presetNames.forEach (preset) -> return false unless presets[preset] totals[target] = {} unless totals[target] totals[target][preset] = @weekTotalFor preset, presets , @ return totals module.exports = Calculator;americano = require 'americano' fs = require 'fs' path = require 'path' clientPath = path.resolve(__dirname, '..', 'client', 'public') useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js') config = common: set: 'view engine': if useBuildView then 'js' else 'jade' 'views': path.resolve __dirname, 'views' engine: js: (path, locales, callback) -> callback null, require(path)(locales) use: [ americano.bodyParser() americano.methodOverride() americano.errorHandler dumpExceptions: true showStack: true americano.static clientPath, maxAge: 86400000 ] development: [ americano.logger 'dev' ] production: [ americano.logger 'short' ] module.exports = config React = require 'react' BS = require 'react-bootstrap' _ = require 'underscore' {ExerciseStore} = require 'stores/exercise' PublishedModal = React.createClass getInitialState: -> {} componentWillMount: -> ExerciseStore.on('published', @onPublished) componentWillUnmount: -> ExerciseStore.off('published', @onPublished) onPublished: (publishedId, opt) -> @show() if publishedId is @props.exerciseId show: -> @setState(isShowing: true) onHide: -> @setState(isShowing: false) render: -> return null unless @state.isShowing exercise = ExerciseStore.get(@props.exerciseId)
    Exercise {exercise.uid} has published successfully
    Close
    module.exports = PublishedModal name: "RUNOFF" scopeName: "text.runoff" fileTypes: [ "rnb" "rnc" "rnd" "rne" "rnh" "rnl" "rnm" "rno" "rnp" "rns" "rnt" "rnx" "run" ] patterns: [include: "#main"] repository: # Common patterns main: patterns: [ {include: "#comment"} {include: "#underline"} {include: "#commands"} ] # Comment lines comment: name: "comment.line.runoff" begin: "^\\.!" end: "$" beginCaptures: 0: name: "punctuation.definition.comment.runoff" # Single underlined character underline: name: "markup.underline.link.runoff" match: "[^_]\x08(?=_)|(?<=_)\x08[^_]" MinimapSelectionView = require './minimap-selection-view' module.exports = active: false views: {} activate: (state) -> try atom.packages.activatePackage('minimap').then (minimapPackage) => @minimap = minimapPackage.mainModule return @deactivate() unless @minimap.versionMatch('>= 3.5.0') @minimap.registerPlugin 'selection', this catch @deactivate deactivate: -> @minimap.unregisterPlugin 'selection' @minimap = null isActive: -> @active activatePlugin: -> return if @active @active = true @subscription = @minimap.observeMinimaps (o) => minimap = o.view ? o selectionView = new MinimapSelectionView(minimap) @views[minimap.id] = selectionView disposable = minimap.onDidDestroy => selectionView.destroy() delete @views[minimap.id] disposable.dispose() deactivatePlugin: -> return unless @active view.destroy() for id,view of @views @active = false @views = {} @subscription.dispose() # I realize polluting body with .code-links-{ctrl,alt} is not ideal, but I don't # see a better solution. I couldn't extract which key is being pressed in the # event handler to match against the config. 'body.code-links-ctrl atom-text-editor': { 'ctrl': 'code-links:tmp-show-links' } 'body.code-links-alt atom-text-editor': { 'alt': 'code-links:tmp-show-links' } Crafty.c 'Enemy', init: -> @requires '2D, Canvas, Collision, Choreography, ViewportFixed' enemy: -> Crafty.trigger('EnemySpawned', this) @onHit 'Bullet', (e) -> return if @hidden bullet = e[0].obj bullet.trigger 'HitTarget', target: this @trigger('Hit', this) @health -= bullet.damage if @health <= 0 bullet.trigger 'DestroyTarget', target: this Crafty.trigger('EnemyDestroyed', this) @trigger('Destroyed', this) @destroy() bullet.destroy() this hide: (@hideMarker) -> @hidden = yes @attr alpha: 0.0 reveal: -> @hideMarker?.destroy() @hidden = no @attr alpha: 1.0 describe 'User factory', -> scope = undefined __User__ = undefined httpBackend = undefined beforeEach -> module 'trackaKeepa' inject ($httpBackend, User, $rootScope) -> scope = $rootScope __User__ = User httpBackend = $httpBackend it 'createUser should create and log in a user', -> it 'getUser should return the current user', -> it 'login should log in a user', -> it 'logout should log out a user', -> _ = require 'lodash' direction = require 'rl-directions' bindings = require '../key-bindings.json' eventBus = require './event-bus' module.exports = exports = -> eventBus.on 'key.*', (ch, key) -> action = bindings[key.full] ? bindings[key.name] if action? parts = action.split('.') if parts[0] is 'direction' parts[1] = direction.normalize parts[1], 1 eventBus.emit "action.#{parts.join '.'}", parts... exports.bindings = bindings DB = require './db' Project = require './project' module.exports = class Projects properties: _id: null title: null icon: null paths: [] settings: {} group: null devMode: false template: null db: null initialize: () -> @db = new DB() getAll: -> projectSettings = @db.findAll() projects = [] for setting in projectSettings if setting.paths? project = new Project(setting) projects.push(project) return projectspackages: [ "advanced-open-file" "atom-alignment" "auto-update-packages" "docblockr" "editorconfig" "emmet" "expand-region" "language-apache" "language-applescript" "language-awk" "language-env" "language-gitattributes" "language-gitignore" "language-hosts" "language-ini" "language-latex" "language-liquid" "language-lisp" "language-patch" "language-pegjs" "language-prolog" "language-svg" "language-tcl" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jsonlint" "linter-php" "linter-ui-default" "monokai" "package-sync" "pigments" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "tabs-to-spaces" ] fs = require 'fs' path = require 'path' temp = require 'temp' _ = require 'underscore' temp.track() module.exports = (grunt) -> grunt.registerTask 'create-windows-installer', 'Create the Windows installer', -> @requiresConfig("#{@name}.appDirectory") done = @async() {appDirectory, outputDirectory} = grunt.config(@name) outputDirectory ?= path.resolve('.') metadata = grunt.file.readJSON('package.json') inputTemplate = grunt.file.read(path.resolve(__dirname, '..', 'template.nuspec')) nuspecContent = _.template(inputTemplate, metadata) targetNuspecPath = path.join(temp.mkdirSync('squirrel-installer-'), "#{metadata.name}.nuspec") grunt.file.write(targetNuspecPath, nuspecContent) cmd = path.resolve(__dirname, '..', 'vendor', 'nuget.exe') args = [ 'pack' targetNuspecPath '-BasePath' appDirectory '-OutputDirectory' outputDirectory ] console.log targetNuspecPath grunt.util.spawn {cmd, args}, (error, result, code) -> grunt.log.writeln(result) done(error) surveyor = require './lib/surveyor.coffee' websocket = require './lib/websocket.coffee' webserver = require './lib/webserver.coffee' webserver.listen 4001 util = require './lib/util.coffee' lock = false check = -> return if lock lock = true surveyor.getManifest (err) -> console.error err if err? throw new Error err if err? surveyor.buildRequired -> surveyor.spawnMissing (err, procs) -> lock = false return console.error err, procs if err? console.log "spawned", procs if Object.keys(procs).length isnt 0 currentRoutingTable = "" route = -> surveyor.calculateRoutingTable (err, table) -> return console.error err if err? hash = util.hashObj(table) if hash isnt currentRoutingTable surveyor.propagateRoutingTable table, (errs) -> currentRoutingTable = hash unless errs? console.error errs if err? setInterval -> check() , 3000 setTimeout -> setInterval -> route() , 3000 , 1500 { attemptShell, isBinaryExecutable } = require './utils' logger = require './logger' styler = require './styler' _ = require 'lodash' @clean = ({ recursive = no, deep = no } = {}) -> hasFileTool = attemptShell('which', 'file')? unless hasFileTool if process.platform is "win32" logger.e "Tool #{styler.id 'file'} is required for this command. You can download it from the following link: http://gnuwin32.sourceforge.net/packages/file.htm" else logger.e "Tool #{styler.id 'file'} is required for this command. Make sure it is installed and it is in your PATH variable" filter = if deep (file) -> isBinaryExecutable(file) or file.match(/\.out$/) or file.match(/oprofile_data/) else isBinaryExecutable if recursive files = _.filter attemptShell('ls', ['-R', '.']), filter else files = _.filter attemptShell('ls', '.'), filter if files.length > 0 logger.i "Removing #{files.join(", ")}" else logger.i "No files found to remove" attemptShell('rm', ['-R', files]) angular.module('doubtfire.projects.states.dashboard.directives.task-dashboard.directives.task-assessment-card', []) # # Shows quality stars and graded task information # .directive('taskAssessmentCard', -> restrict: 'E' templateUrl: 'projects/states/dashboard/directives/task-dashboard/directives/task-assessment-card/task-assessment-card.tpl.html' scope: task: '=' controller: ($scope, taskService, gradeService) -> # Expose grade names $scope.gradeNames = gradeService.grades $scope.hasBeenGivenStars = (t) -> t.quality_pts > 0 || _.includes(taskService.gradeableStatuses, t.status) $scope.hasBeenGraded = (t) -> _.isNumber(t.grade) ) module.exports = selector: ['.source.ruby', '.source.ruby.rails'] id: 'aligner-ruby' # package name config: '=>-alignment': title: 'Padding for =>' description: 'Pad left or right of the character' type: 'string' enum: ['left', 'right'] default: 'left' '=>-leftSpace': title: 'Left space for =>' description: 'Add 1 whitespace to the left' type: 'boolean' default: true '=>-rightSpace': title: 'Right space for =>' description: 'Add 1 whitespace to the right' type: 'boolean' default: true '=>-scope': title: 'Character scope' description: 'Scope string to match' type: 'string' default: 'key-value' Base = require './Base' class TrafficSituation extends Base constructor: (config) -> @key = config.keys.trafficSituation @service = 'trafficSituation (SL Trafikläget 2)' super parseResponse: (body) -> body = JSON.parse body err = if body.StatusCode isnt 0 "#{body.StatusCode} - #{body.Message}" else null [err, body.ResponseData.TrafficTypes] module.exports = (args...) -> service = new TrafficSituation args... (args...) -> service.prepareRequest 'trafficsituation', args... React = require 'react' MiniCourse = require '../lib/mini-course' module.exports = React.createClass displayName: 'MiniCourseButton' getDefaultProps: -> user: null project: null getInitialState: -> minicourse: null componentDidMount: -> @fetchMiniCourseFor @props.workflow componentWillReceiveProps: (nextProps) -> unless nextProps.workflow is @props.workflow and nextProps.project is @props.project @fetchMiniCourseFor nextProps.workflow fetchMiniCourseFor: (workflow) -> @setState minicourse: null MiniCourse.find({workflow}).then (minicourse) => @setState {minicourse} render: -> if @state.minicourse?.steps.length > 0 and @props.user? else nullpath = require 'path' transformTools = require 'browserify-transform-tools' module.exports = transformTools.makeRequireTransform "aliasify", (args, opts, cb) -> aliases = opts.config?.aliases verbose = opts.config?.verbose if (args.length > 0) and aliases? and aliases[args[0]]? replacement = aliases[args[0]] if replacement.length > 0 and replacement[0] is '.' # Resolve the new file relative to the file doing the requiring. replacement = path.resolve opts.configData.configDir, replacement fileDir = path.dirname opts.file replacement = "./#{path.relative fileDir, replacement}" if verbose console.log "aliasify - #{opts.file}: replacing #{args[0]} with #{replacement}" cb null, "require('#{replacement}')" else cb() show_tab = -> if location.hash.match(/^#tab-/) $(".nav-tabs a[href=##{location.hash.replace('#tab-', '')}]").tab('show') show_default_tab = -> if $('.nav-tabs').length > 0 default_hash = $('.nav-tabs .active a')[0].hash.replace('#', '') window.history.replaceState({}, '', ("#tab-" + default_hash)) show_tab() || show_default_tab() $(window).on 'popstate', show_tab $('a[data-toggle="tab"]').on 'shown.bs.tab', (e) -> window.location.hash = e.target.hash.replace('#', '#tab-') if errored_pane = $('.tab-pane .field_with_errors:eq(1)').parents('.tab-pane').attr('id') $(".nav-tabs a[href=##{errored_pane}]").tab('show') # # A simple meditor specifically for providing custom analytics hooks in app code, # leaving the tracking code inside /analytics. # _ = require 'underscore' Backbone = require 'backbone' module.exports = window.analyticsHooks ?= _.extend({}, Backbone.Events)# React = require 'react' assign = require 'object-assign' excludeMethods = componentDidMount: true, componentWillUnmount: true, componentDidUpdate: true, included: true class Component extends React.Component @include = (mixin, config = {}) -> if typeof mixin == 'function' mixin = mixin config for name, _ of mixin when not excludeMethods[name] @prototype[name] = do (fn = name, mx = mixin) => -> mx[fn].apply @, arguments mixin.included?.call @ @__mixins__ ?= [] @__mixins__.unshift mixin @ constructor: (props) -> super props @state = {} componentDidMount: -> if @.constructor.__mixins__? mx.componentDidMount?.call @ for mx in @.constructor.__mixins__ componentWillUnmount: -> if @.constructor.__mixins__? mx.componentWillUnmount?.call @ for mx in @.constructor.__mixins__ componentDidUpdate: -> if @.constructor.__mixins__? mx.componentDidUpdate?.call @ for mx in @.constructor.__mixins__ module.exports = Component goog.provide 'app.ValidationError' class app.ValidationError ###* @param {string} prop @param {string} message @constructor ### constructor: (@prop, @message) ->_ = require 'underscore' { APP_URL, REFERRER, MEDIUM, SESSION_ID } = require('sharify').data Backbone = require 'backbone' Cookies = require '../../../../components/cookies/index.coffee' module.exports = class Form extends Backbone.Model url: "#{APP_URL}/apply/form" defaults: oid: '00DC0000000PWQJ' '00NC0000005RNdW': REFERRER '00NC0000005RNfS': MEDIUM '00NC0000005ROPB': Cookies.get('force-referrer') '00NC0000005RRYb': SESSION_ID # There are others... but this is just so # we can validate any attributes # coming in over a query string valid: [ 'company' 'email' 'first_name' 'last_name' 'phone' 'title' 'URL' '00NC0000005RNdW' # Web Referrer '00NC0000005RNfS' # Web Medium '00NC0000005ROPB' # Web Source Referrer ] @validate: (obj) -> _.pick obj, @::valid save: (attrs, options = {}) -> attrs = _.extend {}, @attributes, attrs _.each attrs, (val, key) -> if _.isArray val attrs[key] = val.join(';') + ';' super kd = require 'kd' ###* * The KlientEventManager is a wrapper over Klient events (from * `client.Subscribe`) that have repeating callbacks. It serves to * provide a cleaner pubsub interface for methods of Klient * that make sense using this style. ### module.exports = class KlientEventManager extends kd.Object ###* * @param {Object} options - An object where the keys are event names, * and the values are callbacks. As an alternative, you can simply * use the `@subscribe` method. ### constructor: (options = {}, machine) -> super options, machine unless machine throw new Error kd.err 'KlientEventManager requires a Machine' @kite = machine.getBaseKite() if @kite.isDisconnected throw new Error 'KlientEventManager requires an active Kite connection' @subscribe eventName, callback for eventName, callback of options ###* * Subscribe to the given Klient client.Subscribe eventName * * @param {String} eventName * @param {Function()} callback - Called with whatever data the given * eventName responds with. ### subscribe: (eventName, callback) -> @kite.clientSubscribe { eventName, onPublish: callback } # Return this, to match the EventEmitter's self return. return this parse_pararms = (querystring) -> params = {} querystring = querystring.split('&') for qs in querystring continue if not qs pair = qs.split('=') params[decodeURIComponent pair[0]] = decodeURIComponent pair[1] params Meteor.Router.add '/': -> Session.set('params', parse_pararms @querystring) return 'all' '/new': 'new_event' '/login': 'login' '/event/:title_id': (title_id) -> event_id = Events.findOne(title_id: encodeURIComponent(title_id)) Session.set("event_id", event_id) return 'event_info' '/user/:user_id': (user_id) -> Session.set("user_id", user_id) return 'show_user' '/settings': () -> if Meteor.user() then 'edit_user' else 'login' '/search': (q) -> Session.set('params', parse_pararms @querystring) return 'search' define ['angular', 'lodash', 'timeSeries', 'volume'], (ng, _) -> imageSequence = ng.module('qiprofile.imagesequence', ['qiprofile.timeseries', 'qiprofile.volume']) imageSequence.factory 'ImageSequence', ['TimeSeries', 'Volume', (TimeSeries, Volume) -> # @param imageSequence the scan or registration ImageSequence # to extend # @returns the extended ImageSequence extend: (imageSequence) -> # Extend the time series. if imageSequence.timeSeries? TimeSeries.extend(imageSequence.timeSeries) # Extend each volume. for volume, index in imageSequence.volumes.images Volume.extend(volume, imageSequence, index + 1) # Return the augmented image sequence. imageSequence ] ### Running copy of myself in background ### # Magic cookie magic = "<#{PACKAGE.version}>" find = (cmd)-> require('./zogi')[cmd] # Run background process module.exports = exports = (cmd, args...)-> return unless find cmd run.apply @, [0, argv0, "version", magic, cmd].concat args return # See whether we are in the background exports.$ = (args)-> return if magic != args.shift() return unless cmd = find args.shift() cmd.$ args exit() return kd = require 'kd' KDCustomHTMLView = kd.CustomHTMLView PendingInvitationsView = require './pendinginvitationsview' module.exports = class AcceptedInvitationsView extends PendingInvitationsView constructor: (options = {}, data) -> options.statusType = 'accepted' options.listViewItemOptions = { statusType: 'accepted' } options.noItemFoundWidget = new KDCustomHTMLView partial : 'There is no accepted invitation.' cssClass : 'hidden no-item-view' super options, data React = require 'react' LearningGuide = require '../flux/learning-guide' LoadableItem = require './loadable-item' Teacher = require './learning-guide/teacher' Student = require './learning-guide/student' LearningGuideStudentShell = React.createClass contextTypes: router: React.PropTypes.func render: -> {courseId} = @context.router.getCurrentParams() } /> LearningGuideTeacherShell = React.createClass contextTypes: router: React.PropTypes.func render: -> {courseId} = @context.router.getCurrentParams() } /> module.exports = {LearningGuideStudentShell, LearningGuideTeacherShell} app = require 'app' ChildProcess = require 'child_process' fs = require 'fs' path = require 'path' updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe') exeName = path.basename(process.execPath) # Spawn the Update.exe with the given arguments and invoke the callback when # the command completes. exports.spawn = (args, callback) -> updateProcess = ChildProcess.spawn(updateDotExe, args) stdout = '' updateProcess.stdout.on 'data', (data) -> stdout += data error = null updateProcess.on 'error', (processError) -> error ?= processError updateProcess.on 'close', (code, signal) -> error ?= new Error("Command failed: #{signal}") if code isnt 0 error?.code ?= code error?.stdout ?= stdout callback(error, stdout) undefined # Is the Update.exe installed with Atom? exports.existsSync = -> fs.existsSync(updateDotExe) # Handle squirrel events denoted by --squirrel-* command line arguments. exports.handleStartupEvent = -> switch process.argv[1] when '--squirrel-install', '--squirrel-updated' exports.spawn ['--createShortcut', exeName], -> app.quit() spawnUpdateAndQuit('') true when '--squirrel-uninstall' exports.spawn ['--removeShortcut', exeName], -> app.quit() true when '--squirrel-obsolete' app.quit() true else false Darkswarm.directive 'mapSearch', ($timeout)-> # Install a basic search field in a map restrict: 'E' require: '^googleMap' replace: true template: '' link: (scope, elem, attrs, ctrl)-> $timeout => map = ctrl.getMap() input = (document.getElementById("pac-input")) map.controls[google.maps.ControlPosition.TOP_LEFT].push input searchBox = new google.maps.places.SearchBox((input)) google.maps.event.addListener searchBox, "places_changed", -> places = searchBox.getPlaces() return if places.length is 0 # For each place, get the icon, place name, and location. markers = [] bounds = new google.maps.LatLngBounds() for place in places #map.setCenter place.geometry.location map.fitBounds place.geometry.viewport #map.fitBounds bounds # Bias the SearchBox results towards places that are within the bounds of the # current map's viewport. google.maps.event.addListener map, "bounds_changed", -> bounds = map.getBounds() searchBox.setBounds bounds child_process = require "child_process" module.exports = run: (path, args) -> # TODO: Add support killing the process. proc = child_process.exec(path + " " + args.join " ") proc.on "close", (code, signal) => if code == 0 # TODO: Display a more visible success message. console.info "Success!" else # TODO: Introduce proper error and warning handling. console.error "TeXification failed! Check the log file for more info..." proc # language-specific Tab triggers # you can add more triggers by changing `grammar` attribute values 'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini])': 'shift-space': 'emmet:expand-abbreviation-with-tab' props = permissions: [] anonymous: true preferredLanguage: 'en' exports.serverConfig = codeNinja: false static: true exports.features = playViewsOnly: false exports.me = isStudent: () -> false isAnonymous: () -> @get('anonymous') isTeacher: () -> false isAdmin: () -> false level: () -> 1 gems: () -> 0 getPhotoURL: () -> '' displayName: () -> '' broadName: () -> '' get: (prop) -> props[prop] isOnPremiumServer: () -> false exports.view = forumLink: () -> 'http://discourse.codecombat.com/' isMobile: () -> false showAds: () -> false isOldBrowser: () -> false isIPadBrowser: () -> false'.source.rust': 'editor': 'commentStart': '// ' 'increaseIndentPattern': '(?x) ^ .* \\{ [^}"\']* $ |^ .* \\( [^\\)"\']* $ |^ \\s* \\{ \\} $ ' 'decreaseIndentPattern': '(?x) ^ \\s* (\\s* /[*] .* [*]/ \\s*)* \\} |^ \\s* (\\s* /[*] .* [*]/ \\s*)* \\) ' 'tabLength': 4 'softTabs': true 'preferredLineLength': 99 {DOMParser} = require 'xmldom' xpath = require 'xpath' request = require 'request' module.exports = getAddress: (company, callback) -> url = "http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&output=atom&start=0&count=1&CIK=#{company}" request url, (error, response, body) -> if error? callback(error) else dom = new DOMParser().parseFromString(body) [address] = xpath.select('/feed/company-info/addresses/address[@type=\'business\']', dom) unless address? [address] = xpath.select('/feed/company-info/addresses/address[@type=\'mailing\']', dom) street1 = xpath.select('street1/text()', address).toString() street2 = xpath.select('street2/text()', address).toString() city = xpath.select('city/text()', address).toString() state = xpath.select('state/text()', address).toString() zip = xpath.select('zip/text()', address).toString() callback(null, {street1, street2, city, state, zip}) Crafty.c 'PlayerClone', init: -> @requires 'Enemy, playerShip' playerClone: (attr = {}) -> @attr _.defaults(attr, h: 45, w: 71, health: 900) @origin 'center' @flipX() @colorOverride '#808080', 'partial' @enemy() this require 'window' measure 'spec suite require time', -> fsUtils = require 'fs-utils' path = require 'path' require 'spec-helper' requireSpecs = (directoryPath, specType) -> for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath require specPath for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType? spec.specType = specType # Run core specs requireSpecs(window.resourcePath, 'core') # Run bundled package specs for packagePath in fsUtils.listTreeSync(config.nodeModulesDirPath) when atom.isInternalPackage(packagePath) requireSpecs(packagePath, 'bundled') # Run user package specs for packagePath in fsUtils.listTreeSync(config.userPackagesDirPath) requireSpecs(packagePath, 'user') angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice'] .factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) -> api = quality: (id, name, description, args = {}) -> {value, progress, maxProgress, hasProgress, progressEscalation, visible} = args value ?= 0 progress ?= 0 maxProgress ?= if hasProgress then 100 else 0 progressEscalation ?= 0.10 visible ?= true qualities.register id, name, description, value, progress, maxProgress, progressEscalation, visible return storylet: (id, title, text, choices...) -> storylets.register id, title, text, choices return choice: (id, title, text, next, args = {}) -> {visible, active} = args visible ?= {} active ?= {} choiceFactory id, title, text, visible, active, next front: (choice) -> frontalChoices.register choice return increase: (qualityName, major, minor) -> quality = qualities.lookup(qualityName) if quality? hasProgress = quality.maxProgress != 0 if hasProgress quality.increase(minor, major) else quality.increase(major, 0) return return Object.freeze api js2coffee = require('./js2coffee') _ = require('underscore') fs = require('fs') path = require('path') UnsupportedError = js2coffee.UnsupportedError basename = path.basename cmd = basename(process.argv[1]) build_and_show = (fname) -> contents = fs.readFileSync(fname, 'utf-8') output = js2coffee.build(contents) console.log "%s", output runFiles = (proc) -> files = process.argv.slice(2) work = proc or build_and_show try work '/dev/stdin' catch e throw e unless e.code == 'EAGAIN' if files.length == 0 console.warn "Usage:" console.warn " #{cmd} file.js" console.warn " #{cmd} file.js > output.txt" console.warn " cat file.js | #{cmd}" process.exit 1 _.each files, (fname) -> work fname module.exports = run: (args...) -> try runFiles.apply this, args catch e throw e unless e.constructor in [UnsupportedError, SyntaxError] console.warn "Error: #{e.message}" console.warn "Cursor position: #{e.cursor}" config = require './config' api = require './api' capture = require './capture' display = require './display' # Set the interval for the operations interval = 1000 busy = false device_url = null api.registerDevice (err, result) -> device_url = result.device.url console.log device_url captureTask = (task) -> capture (err) -> return console.log(err) if err api.uploadImage task.image, "./captured-image.jpg", (err, url) -> api.updateTask task.url, (err, _task) -> busy = false console.log("Uploaded camera shot to "+task.image) displayTask = (task) -> display "http://#{config.host}#{task.image}", (error) -> return console.log error if error console.log "displaying" api.updateTask task.url, (err, data) -> console.log "Task updated" executeTask = (task) -> return if task.completed return if busy console.log task if task.type is "capture" busy = true captureTask task else if task.type is "display" null#displayTask task getTasks = -> return unless device_url return if busy api.getDevice device_url, (err, result) -> executeTask(task) for task in result.device.tasks setInterval getTasks, interval minimatch = require 'minimatch' module.exports = class Filters @firstElementFilter: (value, i) -> i == 0 @fieldMatchFilter: (filter, value) -> for k, v of filter return false unless value[k]? and minimatch value[k], v true ### @todo Add a circular progress variant ### require './style' module.exports = React.createClass # -- Properties propTypes: buffer : React.PropTypes.number max : React.PropTypes.number min : React.PropTypes.number value : React.PropTypes.number indeterminate : React.PropTypes.bool getDefaultProps: -> buffer : 0 indeterminate : false max : 100 min : 0 value : 0 # -- Helper methods calculateRatio: (value) -> (value - @props.min) / (@props.max - @props.min) transformProgress: (ratio) -> WebkitTransform: "scaleX(#{ratio})" MsTransform: "scaleX(#{ratio})" transform: "scaleX(#{ratio})" # -- Render render: -> className = 'indeterminate' if @props.indeterminate primaryRatio = @calculateRatio(@props.value) secondaryRatio = @calculateRatio(@props.buffer)
    Utils = require './utils' {CompositeDisposable} = require 'atom' module.exports = class BufferUpdateComponent constructor: (@editor, @analysisAPI) -> @events = new CompositeDisposable() @events.add @editor.onDidStopChanging => descriptors = @editor.getRootScopeDescriptor() # We only support pure Dart files for now return unless Utils.isCompatible(editor) @analysisAPI.updateFile @editor.getPath(), @editor.getText() destroy: => @events.dispose() class Skr.Components.Currency extends Lanes.React.Component getDefaultProps: -> amount: _.bigDecimal('0.0') symbol: '$' propTypes: amount: React.PropTypes.instanceOf(_.bigDecimal) symbol: React.PropTypes.string render: -> className = _.classnames 'currency', @props.className {@props.symbol} {@props.amount.toFixed(2)} class ChatConversationListItemTitle extends JView constructor:(options = {}, data)-> options.cssClass = 'chat-item' data = [nick for nick in data when nick isnt KD.nick()].first super viewAppended:-> invitees = @getData() @accounts = [] for invitee in invitees KD.remote.cacheable invitee, (err, account)=> warn err if err @accounts.push account?.first or Object @setTemplate @pistachio() if @accounts.length is @getData().length getName:(index)-> "#{@accounts[index].profile.firstName} #{@accounts[index].profile.lastName}" pistachio:-> @setClass 'multiple' if @accounts.length > 1 @avatar = new AvatarView size : {width: 30, height: 30} origin : @accounts.first @participants = switch @accounts.length when 1 then @getName 0 when 2 then "#{@getName(0)} and #{@getName(1)}" else "#{@getName(0)}, #{@getName(1)} and #{data.length - 2} more." """
    {{> @avatar}}

    #{@participants}

    """ #= require shortcuts_navigation class @ShortcutsIssueable extends ShortcutsNavigation constructor: (isMergeRequest) -> super() Mousetrap.bind('a', -> $('.js-assignee').select2('open') return false ) Mousetrap.bind('m', -> $('.js-milestone').select2('open') return false ) if isMergeRequest @enabledHelp.push('.hidden-shortcut.merge_requests') else @enabledHelp.push('.hidden-shortcut.issues') class @Scenario extends Backbone.Model api_session_id: => key = App.settings.get('api_session_id') return if key? then key else null api_attributes: => s = App.settings data = area_code: s.get('area_code') end_year: s.get('end_year') preset_scenario_id: s.get('preset_scenario_id') use_fce: s.get('use_fce') source: 'ETM' # Returns the base scenario URL, taking into account CORS support url_path: => App.api.path "/scenarios/#{@api_session_id()}" reset: => App.reset_scenario() angular.module 'qbn.edsl', ['qbn.quality', 'qbn.storylet', 'qbn.choice'] .factory 'qbnEdsl', (qualities, storylets, frontalChoices, choiceFactory) -> api = quality: (id, name, description, args = {}) -> {value, progress, maxProgress, hasProgress, progressEscalation, visible} = args value ?= 0 progress ?= 0 maxProgress ?= if hasProgress then 100 else 0 progressEscalation ?= 0.10 visible ?= true qualities.register id, name, description, value, progress, maxProgress, progressEscalation, visible return storylet: (id, title, text, choices...) -> storylets.register id, title, text, choices return choice: (id, title, text, next, args = {}) -> {visibleReqs, activeReqs} = args visibleReqs ?= {} activeReqs ?= {} choiceFactory id, title, text, visibleReqs, activeReqs, next front: (choice) -> frontalChoices.register choice return return Object.freeze api React = require 'react' Tutorial = require '../lib/tutorial' module.exports = React.createClass getDefaultProps: -> workflow: null project: null user: null getInitialState: -> tutorial: null componentDidMount: -> @fetchTutorialFor @props.workflow componentWillReceiveProps: (nextProps) -> unless nextProps.workflow is @props.workflow and nextProps.project is @props.project @fetchTutorialFor nextProps.workflow fetchTutorialFor: (workflow) -> @setState tutorial: null Tutorial.find({workflow}).then (tutorial) => @setState {tutorial} render: -> if @state.tutorial?.steps.length > 0 else null angular.module('doubtfire.projects.project-portfolio-wizard.portfolio-review-step', []) # # Step for students to view their portfolio and optionally delete it # .directive('portfolioReviewStep', -> restrict: 'E' templateUrl: 'projects/project-portfolio-wizard/portfolio-review-step/portfolio-review-step.tpl.html' controller: ($scope, alertService, Project) -> $scope.hasLSR = $scope.projectHasLearningSummaryReport() $scope.hasTasksSelected = $scope.selectedTasks().length > 0 $scope.portfolioIsCompiling = $scope.project.compile_portfolio $scope.canCompilePortfolio = (not $scope.portfolioIsCompiling) and $scope.hasTasksSelected and $scope.hasLSR and not $scope.project.portfolio_available # # Compile portfolio # $scope.toggleCompileProject = () -> $scope.project.compile_portfolio = not $scope.project.compile_portfolio Project.update { id: $scope.project.project_id, compile_portfolio: $scope.project.compile_portfolio }, (response) -> $scope.portfolioIsCompiling = true $scope.canCompilePortfolio = false # # PDF Local Funcs # $scope.deletePortfolio = () -> $scope.fileUploader.api.delete { id: $scope.project.project_id }, (response) -> $scope.activePortfolioTab = $scope.tabData.compileStep $scope.project.portfolio_available = false ) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ # http://stackoverflow.com/questions/1307705/jquery-ui-sortable-with-table-and-tr-width/1372954#1372954 # http://benw.me/posts/sortable-bootstrap-tables/ jQuery -> $('#call_list').sortable( placeholder: "ui-state-highlight" axis: 'y' items: '.pregnancy-data' handle: '.handle' cursor: 'move' sort: (e, ui) -> ui.item.addClass('active-item-shadow') stop: (e, ui) -> ui.item.removeClass('active-item-shadow') # highlight the row on drop to indicate an update ui.item.children('td').effect('highlight', {}, 500) update: (e, ui) -> item_id = ui.item[0].id parent = $('#'+item_id).parent() children = parent.children() order = [] for child, value of children if value.id? then order.push(value.id) console.log(order) helper: (e, tr) -> originals = tr.children() helper = tr.clone() helper.children().each (index, element) -> $(element).css('width', originals.eq(index).width()) return helper # $.ajax( # type: 'POST' # url: '/something/reorder_pregnancies' # dataType: 'json' # data: { order } # ) ) StyleguideView = null styleguideUri = 'atom://styleguide' createStyleguideView = (state) -> StyleguideView ?= require './styleguide-view' new StyleguideView(state) deserializer = name: 'StyleguideView' deserialize: (state) -> createStyleguideView(state) atom.deserializers.add(deserializer) module.exports = activate: -> atom.project.registerOpener (filePath) -> createStyleguideView(uri: styleguideUri) if filePath is styleguideUri atom.rootView.command 'styleguide:show', -> rootView.open(styleguideUri) supervisor = require 'supervisor' main = () -> supervisor.run [ '--quiet' '--exec', 'node' '--no-restart-on', 'exit' '--extensions', 'coffee,js,json,yml' '/Users/a/code/ReclaimSoftware/rs-runner/devrun.js' ] module.exports = {main} "use strict" request = require 'supertest' assert = require 'assert' exports.app = app = require './../coffee/server.coffee' exports.data = data = require('./util/data-gen.coffee')(100) before (done) -> app.once 'ready', done beforeEach (done) -> db = app.get 'db' db.collection('test').drop (err) -> #throw err if err db.collection('test').insert data, (err) -> throw err if err done() describe 'ntb.api', -> describe '/', -> it 'should fail with no api key', (done) -> request(app) .get('/') .expect(400, done) it 'should fail for invalid api key', (done) -> request(app) .get('/?api_key=fail') .expect(401, done) it 'should authenticate for valid api key', (done) -> request(app) .get('/?api_key=dnt') .expect(200, done) describe '/:collection', -> require './collection-spec.coffee' describe ':collection/:document', -> require './document-spec.coffee' RECORDS = {} init_records = (name) -> ($ ".current_xml").append RECORDS[name] = ($ "<#{name}>") init_records "clients" init_records "groups" @open_clients = -> menu_slide -> ($ ".groupform").remove() ($ ".arena").append form().addClass "clientform" ($ ".arena").append form().addClass "groupform" make_form ( containment: ($ ".clientform"), parent: ($ "clients"), schema: "client", desc: "Kunden" ) make_form ( containment: ($ ".groupform"), parent: ($ "groups"), schema: "group", desc: "Gruppen" ) require 'coffee-script/register' require './setup' {eachGroup} = require('../lib/specs_iterator') eachGroup (group) -> run = if group.pending then xdescribe else describe run group.name, -> group.specs.forEach (spec) -> it spec.name, do (spec) -> -> result = js2coffee(spec.input) try expect(result).eql(spec.output) catch e e.stack = '' throw e class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() else @showFacts @channelFacts() showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts() Backbone = require('backbone') [Control, Controls] = require('./Control.coffee') Router = require('./Router.coffee') AppView = require('./AppView.coffee') module.exports = class App extends Backbone.Model initialize: -> @log "Jarvis web client here" Backbone.$ = window.$ @router = new Router(app: this) @controls = new Controls() @currentPath = null $.when(@controls.fetch()).done => @log "Startup tasks are finished" @view = new AppView(el: $('body'), model: this) @view.render() Backbone.history.start() @setupSocket() setupSocket: -> @socket = io() @socket.on 'control:change', (controlJSON) => control = @controls.get(controlJSON.id) unless control? @log 'warn', "Received update about unknown control #{controlJSON.id}" control.set controlJSON log: (one, two) -> # XXX Implement levels if two? console.log two else console.log one class DirectionalSound extends Wage.MeshSound constructor: (name, mesh, @angles, options) -> super name, mesh, options _init: (options) -> @panner.coneInnerAngle = angles.innerAngleDegrees @panner.coneOuterAngle = angles.outerAngleDegrees @panner.coneOuterGain = angles.outerGainFactor return update: (dt) -> super dt matrix = @mesh.matrixWorld mx = matrix.elements[12] my = matrix.elements[13] mz = matrix.elements[14] for i in [12..14] matrix.elements[i] = 0 #: multiply orientation vector vec = new THREE.Vector3 0, 0, 1 vec.applyProjection matrix vec.normalize() @panner.setOrientation vec.x, vec.y, vec.z matrix.elements[12] = mx matrix.elements[13] = my matrix.elements[14] = mz return env = self.Wage ?= {} env.DirectionalSound = DirectionalSound define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> window.location.href = window.location.toString() + '&rt=true' nconf = require 'nconf' net = require 'net' pkgman = require 'pkgman' repl = require 'repl' exports.$initialized = -> replServer = null # Feed all the goodies into a REPL for ultimate awesome. replServer = net.createServer (socket) -> s = repl.start( prompt: "shrub> " input: socket output: socket ) s.context.config = nconf pkgman.invoke 'replContext', (_, spec) -> spec s.context s.on 'exit', -> socket.end() replServer.listen "#{__dirname}/socket" process.on 'SIGINT', -> replServer.close() process.exit 1 ### The 'main' script for bootstrapping the default Cilantro client. Projects can use this directly or emulate the functionality in their own script. ### require ['cilantro'], (c) -> # Session options options = url: c.config.get('url') credentials: c.config.get('credentials') # Open the default session defined in the pre-defined configuration. # Initialize routes once data is confirmed to be available c.sessions.open(options).then -> # Define routes routes = [ id: 'query' route: 'query/' view: new c.ui.QueryWorkflow context: @data.contexts.session concepts: @data.concepts.queryable , id: 'results' route: 'results/' view: new c.ui.ResultsWorkflow view: @data.views.session context: @data.contexts.session concepts: @data.concepts.viewable # The differences in these names are noted results: @data.preview exporters: @data.exporter queries: @data.queries ] # Workspace supported as of 2.1.0 if c.isSupported('2.1.0') routes.push id: 'workspace' route: 'workspace/' view: new c.ui.WorkspaceWorkflow queries: @data.shared_queries context: @data.contexts.session view: @data.views.session # Register routes and start the session @start(routes) class @PodsStore update: (new_records) -> @writeObjects(new_records) all: -> records = [] promise = new Promise (resolve, reject) => @database (db) -> t = db.transaction 'pods', 'readwrite' store = t.objectStore('pods') keyRange = IDBKeyRange.lowerBound(0) r = store.openCursor(keyRange) r.onsuccess = (e) -> cursor = e.target.result if cursor records.push cursor.value cursor.continue() else resolve(records) r.onerror = (e) -> reject(e) promise writeObjects: (pods) -> @database (db) -> t = db.transaction 'pods', 'readwrite' s = t.objectStore('pods') for pod in pods r = s.put(pod) countAll: (callback) -> @database (db) -> t = db.transaction 'pods', 'readwrite' s = t.objectStore('pods') r = s.count() r.onsuccess = -> callback(r.result) database: (callback) -> r = indexedDB.open('pods', 1) r.onupgradeneeded = (e) -> db = event.target.result if !db.objectStoreNames.contains 'pods' store = db.createObjectStore 'pods', keyPath: 'name' store.createIndex "stars", "stars", unique: false r.onsuccess = (e) -> db = r.result callback(db)path = require 'path' {spawn} = require 'child_process' pairSettings = ['version-string'] singleSettings = ['file-version', 'product-version', 'icon'] module.exports = (exe, options, callback) -> rcedit = path.resolve __dirname, '..', 'bin', 'rcedit.exe' args = [exe] for name in pairSettings if options[name]? for key, value of options[name] args.push "--set-#{name}" args.push key args.push value for name in singleSettings if options[name]? args.push "--set-#{name}" args.push options[name] child = spawn rcedit, args stderr = '' child.stderr.on 'data', (data) -> stderr += data child.on 'close', (code) -> if code is 0 callback null else callback stderr Bacon = require("baconjs") # Observe mouse move and provide callback functions to react accordingly # # @param mouseDownEvent: {Event} Initial event that should be called prior to starting to observe changes here module.exports = (mouseDownEvent) -> mouseDoneStream = Bacon.fromEvent(document.body, "mouseup").merge(Bacon.fromEvent(document.body, "mouseleave")) mouseDoneStream.onValue -> return Bacon.noMore # to stop listening to events on both merged streams (mouseup/mouseleave) return Bacon.combineWith (initialEvent, moveEvent) -> clientX: moveEvent.clientX - initialEvent.clientX clientY: moveEvent.clientY - initialEvent.clientY , Bacon.constant(mouseDownEvent), Bacon.fromEvent(document.body, "mousemove").takeUntil(mouseDoneStream) if typeof window isnt 'undefined' root = window else root = global if !root._spec_setup root.sinon = require 'sinon' root.mockery = require 'mockery' root.chai = require 'chai' root.expect = chai.expect root.sandbox = sinon.sandbox.create() sinonChai = require 'sinon-chai' chai.use sinonChai root._spec_setup = true afterEach -> sandbox.restore() uri = require('../lib/util/uri-helpers') xdescribe 'resolveURL()', -> it 'should replace the last segment', -> expect(uri.resolveURL('a', 'b')).toBe 'b' expect(uri.resolveURL('x/y', 'z')).toBe 'x/z' expect(uri.resolveURL('m', 'n/o')).toBe 'n/o' expect(uri.resolveURL('a/b', 'c/d')).toBe 'a/c/d' it 'should replace absolute segments', -> expect(uri.resolveURL('//a/b/c', '/y/z')).toBe '//a/y/z' it 'should resolve relative segments', -> expect(uri.resolveURL('a/b/c', '../x')).toBe 'a/x' it 'should resolve fully-qualified URIs', -> expect(uri.resolveURL('//site.com/a/b/c', 'x/y')).toBe '//site.com/a/b/x/y' class Workbench.Views.DatastreamLatestView extends Backbone.View template: JST["workbench/workbench/templates/latest"] initialize: -> # Animate out, update content, animate back in swapHtml: ($element, content) -> $element.transition(rotateX: '90deg').promise().done(-> @html(content).transition(rotateX: '0deg') ) render: -> latest = _.last(@model.get("seriesData")) @swapHtml(@$el, @template({ latest: latest.value date: new Date(latest.timestamp) unit: @model.get("unit") })) this update: (date, value) -> @swapHtml(@$("date"), date) @swapHtml(@$(".value"), value) this ETahi.AdminJournalUserController = Ember.ObjectController.extend resetPasswordSuccess: (-> false ).property() resetPasswordFailure: (-> false ).property() modalId: (-> "#{@get('id')}-#{@get('username')}" ).property('username', 'id') actions: saveUser: -> @get('model').save() rollbackUser: -> @get('model').rollback() resetPassword: (user) -> $.get("/admin/journal_users/#{user.id}/reset").done(=> @set 'resetPasswordSuccess', true ).fail => @set 'resetPasswordFailure', true define [ "base" ], (App) -> App.directive "reviewPanelSorted", ($timeout) -> return { link: (scope, element, attrs) -> layout = () -> entries = [] for el in element.find(".rp-entry") entries.push { el: el scope: angular.element(el).scope() } entries.sort (a,b) -> a.scope.entry.offset - b.scope.entry.offset previousBottom = 28 # This should start at the height of the toolbar for entry in entries height = $(entry.el).height() top = entry.scope.entry.screenPos.y top = Math.max(top, previousBottom + 12) previousBottom = top + height entry.scope.top = top scope.$watch "reviewPanel.entries", (value) -> return if !value? $timeout () -> layout() scope.$on "review-panel:layout", () -> $timeout () -> layout() }define [ "base" ], (App) -> App.controller "HistoryV2DiffController", ($scope, ide, event_tracking) -> $scope.restoreState = inflight: false error: false $scope.restoreDeletedFile = () -> pathname = $scope.history.selection.pathname return if !pathname? version = $scope.history.selection.docs[pathname]?.deletedAtV return if !version? event_tracking.sendMB "history-v2-restore-deleted" $scope.restoreState.inflight = true ide.historyManager .restoreFile(version, pathname) .then (response) -> { data } = response openEntity(data) .catch () -> ide.showGenericMessageModal('Sorry, something went wrong with the restore') .finally () -> $scope.restoreState.inflight = false openEntity = (data) -> {id, type} = data ide.waitFor( () -> ide.fileTreeManager.findEntityById(id) (entity) -> if type == 'doc' ide.editorManager.openDoc(entity) else type == 'file' ide.binaryFilesManager.openFile(entity) 3000 ) module.exports = config: undefinedDisplay: type: 'string' default: '' activate: (state) -> atom.workspaceView.command 'table-edit:demo', => @openDemo() @openDemo() deactivate: -> serialize: -> openDemo: -> Table = require './table' TableView = require './table-view' table = new Table table.addColumn 'key' table.addColumn 'value', align: 'right' table.addColumn 'foo', align: 'right' for i in [0...100] table.addRow [ "row#{i}" i * 100 if i % 2 is 0 then 'yes' else 'no' ] table.clearUndoStack() tableView = new TableView(table) tableView.setRowHeight 30 tableView.setRowOverdraw 4 tableView.addClass('demo overlay from-top').height(300) atom.workspaceView.append(tableView) tableView.on 'core:cancel', -> tableView.destroy() tableView.focus() define [ '../core' ], (c) -> class Model extends c.Backbone.Model url: -> if @isNew() then super else @links.self constructor: (attrs, options) -> @links = {} super(attrs, options) parse: (attrs, options) -> if attrs? and attrs._links? @links = {} for name, link of attrs._links @links[name] = link.href return attrs class Collection extends c.Backbone.Collection model: Model url: -> if @isNew() then super else @links.self constructor: (attrs, options) -> @links = {} super(attrs, options) fetch: (options) -> options = options or {} options.cache = false return c.Backbone.Collection.prototype.fetch.call(this, options) parse: (attrs, options) -> if attrs? and attrs._links? @links = {} for name, link of attrs._links @links[name] = link.href return attrs { Model, Collection } noflo = require 'noflo' debugAction = require('debug') 'noflo-ui:action' debugActionFull = require('debug') 'noflo-ui:action:full' sendEvent = (label, action = 'click', category = 'menu') -> return unless typeof window.ga is 'function' window.ga 'send', 'event', category, action, label exports.getComponent = -> c = new noflo.Component c.inPorts.add 'in', datatype: 'all' c.outPorts.add 'pass', datatype: 'all' noflo.helpers.WirePattern c, in: 'in' out: 'pass' forwardGroups: true async: true , (data, groups, out, callback) -> action = data.action debugAction action debugActionFull action, data.payload switch action when 'user:login' sendEvent 'userLogin' when 'user:logout' sendEvent 'userLogout' when 'github:open' sendEvent 'pullGithub', 'navigation', 'url' when 'gist:open' sendEvent 'pullGist', 'navigation', 'url' when 'main:open' sendEvent 'openHome', 'navigation', 'url' out.send data do callback # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. $(document).ready -> $('.page_link').colorbox onCleanup: -> location.reload() if $('#tandem_page_links').length > 0 $('body').addClass('tandem-admin-bar') $('.tandem_content').live 'mouseenter': -> $('.tandem_toolbar', $(this)).fadeIn('slow') 'mouseleave': -> $('.tandem_toolbar', $(this)).fadeOut('slow') $('.tandem_content').live 'click', -> $.fn.colorbox href: $('.tandem_edit_link', $(this)).attr('href') iframe: true width: '80%' height: '80%' open: true return false reload_tandem_content = (resource_id,resource_url) -> $.fn.colorbox.close() resource_id = '#'+resource_id $(resource_id).load resource_url+' '+resource_id, -> bind_tandem_events($(resource_id)) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ # This class scans your stylesheets for pseudo classes, then inserts a new CSS # rule with the same properties, but named 'psuedo-class-{{name}}'. # # Supported pseudo classes: hover, disabled, active, visited. # # Example: # # a:hover{ color:blue; } # => a.pseudo-class-hover{ color:blue; } class KssStateGenerator constructor: -> pseudos = /(\:hover|\:disabled|\:active|\:visited)/g try for stylesheet in document.styleSheets idxs = [] for rule, idx in stylesheet.cssRules if (rule.type == CSSRule.STYLE_RULE) && pseudos.test(rule.selectorText) replaceRule = (matched, stuff) -> return ".pseudo-class-" + matched.replace(':', '') @insertRule(rule.cssText.replace(pseudos, replaceRule)) # Takes a given style and attaches it to the current page. # # rule - A CSS rule String (ex: ".test{ display:none; }"). # # Returns nothing. insertRule: (rule) -> headEl = document.getElementsByTagName('head')[0] styleEl = document.createElement('style') styleEl.type = 'text/css' if styleEl.styleSheet styleEl.styleSheet.cssText = rule else styleEl.appendChild(document.createTextNode(rule)) headEl.appendChild(styleEl) new KssStateGenerator# Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ # Image upload control class @ImageUpload uploadMethod: null constructor: (@container)-> @setupNestedAttributes() @setupSwtiching() setupNestedAttributes: -> @container.nestedAttributes bindAddTo: $(".actions .add") collectionName: 'images' collectIdAttributes: false $clone: @container.children('.field') @container.find('input').focus (e)=> inputs = @container.find("input:enabled.upload[type=#{@uploadMethod}]").not(e.target).filter (index)-> @value.length == 0 if inputs.length == 0 @container.nestedAttributes("add") setupSwtiching: -> @updateView() @setCurrentUploadMethod() @container.find('.actions a.switch').click (e)=> e.preventDefault() # toggle disable @container.find('.field input.upload').prop 'disabled', (i,v)=> !v @updateView() @setCurrentUploadMethod() setCurrentUploadMethod: -> if @container.find("input:enabled.upload[type=file]").length @uploadMethod = 'file' else @uploadMethod = 'url' updateView: -> # visibility @container.find('.field input').each (index, input)=> input = $(input) if input.prop('disabled') input.addClass('hide') else input.removeClass('hide') $ -> new ImageUpload($('.file-section')) App.User = DS.Model.extend firstName: DS.attr("string") lastName: DS.attr("string") email: DS.attr("string") role: DS.attr("string") password: DS.attr("string") App.CurrentUser = App.User.extend({}) App.Room = DS.Model.extend name: DS.attr("string") roomUserState: DS.belongsTo("room_user_state") App.RoomUserState = DS.Model.extend userId: DS.attr("number") joined: DS.attr("boolean") room: DS.belongsTo("room") lastPingedAt: DS.attr("date") #TODO move this elsewhere App.RoomUserStateSerializer = DS.ActiveModelSerializer.extend(DS.EmbeddedRecordsMixin, { attrs: { room: {embedded: "load"} } }) App.Message = DS.Model.extend body: DS.attr("string") type: DS.attr("string") roomId: DS.attr("string") user: DS.belongsTo("user") createdAt: DS.attr("date") React = require 'react' moment = require 'moment' CellStatusMixin = require './cell-status-mixin' ConceptCoachCell = React.createClass mixins: [CellStatusMixin] # prop validation lastWorked: -> moment(@props.task.last_worked_at).format('MMM. D') render: ->
    {@props.task.correct_exercise_count} of {@props.task.exercise_count}
    {@lastWorked()}
    module.exports = ConceptCoachCell #= require ./validators class Batman.EmailValidator extends Batman.Validator @triggers 'email' # WebKit's email validation regexp emailRegexp: /[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*/ constructor: (options) -> console.log @emailRegexp super validateEach: (errors, record, key, callback) -> value = record.get(key) if !value? || value == '' || !@emailRegexp.test(value) errors.add key, @format(key, 'not_an_email') callback() Batman.Validators.push Batman.EmailValidator should = require 'should' sinon = require 'sinon' shouldSinon = require 'should-sinon' KDEventEmitterWildcard = require '../../lib/core/eventemitterwildcard' describe 'KDEventEmitterWildcard', -> beforeEach -> @instance = new KDEventEmitterWildcard it 'exists', -> KDEventEmitterWildcard.should.exist describe 'constructor', -> it 'should default delimiter option', -> @instance._delim.should.equal '.' it 'should change delimiter option', -> emitter = new KDEventEmitterWildcard delimiter: '~' emitter._delim.should.equal '~' describe 'setMaxListeners', -> it 'should set max listeners', -> @instance.setMaxListeners 20 @instance._maxListeners.should.equal 20 NotificationPlugin = require "../../notification-plugin.js" class Slack extends NotificationPlugin @errorAttachment = (event) -> fallback: "Something happened", fields: [ { title: "Error" value: (event.error.exceptionClass + (if event.error.message then ": #{event.error.message}")).truncate(85) }, { title: "Location", value: event.error.stacktrace && @firstStacktraceLine(event.error.stacktrace) } ] @receiveEvent = (config, event, callback) -> # Build the notification title title = ["#{event.trigger.message} in #{event.error.releaseStage} from <#{event.project.url}|#{event.project.name}>"] title.push("in #{event.error.context}") title.push("<#{event.error.url}|(details)>") # Build the common payload payload = { username: "Bugsnag", text: title.join(" "), attachments: [] } # Attach error information payload.attachments.push(@errorAttachment(event)) if event.error # Post to slack @request .post(config.url) .timeout(4000) .send(payload) .on "error", (err) -> callback(err) .end (res) -> callback(res.error) module.exports = Slack class Atoms.Molecule.Navigation extends Atoms.Core.Class.Molecule template: """ """ bindings: link: ["click"] button: ["click"] constructor: -> @atoms = link: [], button: [] super linkClick: (event, atom) => @_trigger event, atom buttonClick: (event, atom) => @_trigger event, atom _trigger: (event, atom) -> event.preventDefault() atom.el.addClass("active").siblings().removeClass("active") @trigger "select", event, atom #= require_self #= require_tree . window.Dummy = Common: initPage: -> # If you're using the Turbolinks and you need run a code only one time, put something here. # if you're not using the turbolinks, there's no difference between init and initPage. init: -> # Something here. This is called in every page, with or without Turbolinks. finish: -> # Something here. This is called in every page, with or without Turbolinks. config = require('../../src/protractor.conf.coffee').config config.capabilities = browserName: 'chrome' config.framework = 'mocha' config.specs = '../**/*.spec.coffee' config.allScriptsTimeout = 20000 exports.config = config Marbles.Views.MentionsAutoCompleteTextarea = class MentionsAutoCompleteTextareaView extends Marbles.View @view_name: 'mentions_autocomplete_textarea' constructor: (options = {}) -> super @initInlineMentionsManager() initInlineMentionsManager: => @inline_mentions_manager = new TentStatus.InlineMentionsManager(el: @el) focus: => @el.focus() window.GraphQuestionList = React.createClass propTypes: questions: React.PropTypes.array.isRequired activeQuestion: React.PropTypes.number.isRequired answerTexts: React.PropTypes.array.isRequired render: -> questions = (`` for q,i in this.props.questions) `
    {questions}
    `$(document).ready -> chart = new Highcharts.Chart chart: renderTo: 'weekly-performance-graph', defaultSeriesType: 'spline', backgroundColor: '#f7f7f7', width: 600 title: [ text: 'Weekly Performance' ], series: [ { name: 'views', data: [['Mon', 10], ['Tue', 20], ['Wed', 30], ['Thu', 20], ['Fri', 10], ['Sat', 15], ['Sun', 10]] }, { name: 'submits', data: [5, 1, 0, 0, 2, 3, 4] } ], legend: enabled: false yAxis: title: text: null requestEventSummary() $(document).on 'event-summary-updated', (event) -> if event.eventSummary.name == "tab-view" chart.series[0].setData(event.eventSummary.data) else if event.eventSummary.name == "tab-submit" chart.series[1].setData(event.eventSummary.data) Review.PermissionCellComponent = Ember.Component.extend tagName: 'th' classNames: ['permissions', 'text-center'] classNameBindings: ['permission.isAllowed:success:danger'] permission: (() -> user = @get('user') project = @get('project') permission = user.get('permissions').find((item) -> item.get('project.id') == project.get('id')) permission ||= @createPermission(user, project) ).property('project', 'user') createPermission: (user, project) -> permission = @store.createRecord({ allowed: false user: user project: project }) actions: grantAccess: (permission)-> permission.set('allowed', true) permission.get('store').commit() revokeAccess: (permission)-> permission.set('allowed', false) permission.get('store').commit() ### grunt-commonjs-coffee https://github.com/tuxracer/grunt-commonjs-coffee Copyright (c) 2013 Team Delicious, AVOS Systems Inc. Licensed under the MIT license. ### path = require 'path' grunt = require 'grunt' # commonjs: { # modules: { # cwd: 'assets/', # src: ['assets/*.coffee'], # dest: 'dist/' # } # } indentStr = (str) -> str.replace(/(\r\n|\n|\r)/g, '\n ') isCoffeeScript = (filepath) -> filepath.slice(-7) is '.coffee' wrapDefine = (filepath, content) -> definePath = filepath.replace /\.\w+$/, '' if isCoffeeScript filepath content = indentStr content "window.require.define '#{definePath}': (exports, require, module) ->\n #{content}\n" else "window.require.define({'#{definePath}': function(exports, require, module) {\n#{content}}});\n" module.exports = (grunt) -> grunt.registerMultiTask 'commonjs', 'Wrap .coffee and .js files for commonjs.', -> @filesSrc.forEach (filepath) => content = grunt.file.read path.join @data.cwd, filepath dest = path.join @data.dest, filepath wrapped = wrapDefine filepath, content grunt.file.write dest, wrapped FileEditorView = require './file-editor-view' exec = require('child_process').execSync module.exports = class WAVEditorView extends FileEditorView @content: -> @div class: 'xoreos-editor', tabindex: -1, => @div class: 'xoreos-container', => @div class: 'audio-container', => @div class: 'audio-cell', => @audio controls: true, outlet: 'audio' refresh: -> exec("avconv -y -i '#{@path}' '#{@path}'.wav") @audio.attr('src', "#{@path}.wav") # Description: # Allows Hubot interact with mercure # # Commands: # hubot download me util = require 'util' url = require 'url' MERCURE_URL = process.env.MERCURE_URL MERCURE_TOKEN = process.env.MERCURE_TOKEN HUBOT_URL = process.env.HUBOT_URL module.exports = (robot) -> robot.respond /download me (.*)/i, (msg) -> msg.http("#{MERCURE_URL}/download").query({ token: MERCURE_TOKEN, url: msg.match[1], callback: "#{HUBOT_URL}/mercure/callback/#{encodeURIComponent(msg.message.room)}" }).post() (err, res, body) -> return msg.send "error" if err return msg.send "Downloading #{msg.match[1]}" if res.statusCode == 202 robot.router.post "/mercure/callback/:room", (req, res) -> robot.messageRoom req.params.room, "File #{req.body.url} (#{req.body.size}): #{req.body.status}" res.end "ok" # Copyright (c) 2012 Mattes Groeger # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. #= require LinkGrabber document.body.onmouseup = (event) -> chrome.extension.sendMessage({type:"verifySelection", links:getLinksFromSelection()}) getLinksFromSelection = -> selection = window.getSelection() LinkGrabber.fromSelection(selection).allLinks()AppConfig = require('../initializers/config') Deploy = require('../lib/deploy') range_check = require('range_check') tagRefersToServer = (tag, serverName) -> return new RegExp("^#{serverName}").test(tag) getIpFromRequest = (req) -> req.connection.remoteAddress GITHUB_IP_RANGE = "192.30.252.0/22" ipIsFromGithub = (ip) -> range_check.in_range(ip, GITHUB_IP_RANGE) exports.index = (req, res) -> remoteIp = getIpFromRequest(req) envIsProduction = process.env.NODE_ENV is 'production' if !ipIsFromGithub(remoteIp) and envIsProduction return res.send 401 parsedPayload = req.body console.log "Got deploy message from #{parsedPayload.ref}" serverName = AppConfig.get('server_name') tagName = parsedPayload.ref unless tagRefersToServer(tagName, serverName) errMessage = "Only deploys for this server (#{serverName}) are accepted" console.log errMessage return res.send 500, errMessage console.log "Updating code from #{tagName}..." Deploy.deploy(tagName).then(-> console.log "Code update finished, restarting server" process.exit() ).catch((err)-> console.log "Error updating code:" console.error err ) res.send 200 Guest = require('../../../../../h/h/static/scripts/annotator/guest.coffee'); extend = require('extend') Annotator = require('annotator') $ = Annotator.$ class GuestExt extends Guest html: extend {}, Annotator::html, adder: '''
    ''' module.exports = GuestExtdefine ['jsmin'], ($) -> class SelectGroup constructor: (@parent = null, @callback = false) -> @selectParent = (if @parent != null then $(@parent) else $('.js-select-group')) @addHandlers() addHandlers: -> @selectParent.on 'change', (e) => e.preventDefault() result = e.target.options[e.target.selectedIndex].text label = e.target.parentNode.find('.js-select-overlay').innerHTML = result if @callback then @callback(e.target)I18n.translations ||= en: readmore: button_text: open: 'Read more' close: 'Read less' de: readmore: button_text: open: 'Open' close: 'Close' BaseStackEditorView = require './basestackeditorview' module.exports = class StackTemplateEditorView extends BaseStackEditorView constructor: (options = {}, data) -> unless options.content options.content = require '../defaulttemplate' super options, data if options.showHelpContent @once 'EditorReady', @bound 'insertHelpText' insertHelpText: -> position = row: 0, column: 0 content = """ # Here is your stack preview # You can make advanced changes like modifying your VM, # installing packages, and running shell commands. """ ace = @getAce() ace.editor.session.insert position, content ace.contentChanged = no selenium = require 'selenium-webdriver' {TaskHelper} = require './task' class CourseSelect extends TaskHelper goTo: (category) -> # Go to the bio dashboard switch category when 'BIOLOGY' then @test.waitClick(css: '[data-appearance="biology"] > [href*="calendar"]') when 'PHYSICS' then @test.waitClick(css: '[data-appearance="physics"] > [href*="calendar"]') else @test.waitClick(css: '[data-appearance] > [href*="calendar"]') module.exports = CourseSelect define [ 'environ' 'mediator' 'underscore' 'serrano' ], (environ, mediator, _, Serrano) -> class DataContexts extends Serrano.DataContexts url: environ.absolutePath '/api/contexts/' initialize: -> @deferred = @fetch() getNamed: -> @filter (model) -> model.get('name') class DataContextHistory extends Serrano.DataContexts url: environ.absolutePath '/api/contexts/history/' initialize: -> @deferred = @fetch() App.DataContext = new DataContexts App.DataContextHistory = new DataContextHistory # Special treatment for the session App.DataContext.deferred.done -> if not (session = App.DataContext.getSession()) session = App.DataContext.create session: true App.DataContext.session = session session.on 'sync', -> mediator.publish 'datacontext/change' Meteor.methods registerUser: (formData) -> check formData, Object if RocketChat.settings.get('Accounts_RegistrationForm') is 'Disabled' throw new Meteor.Error 'error-user-registration-disabled', 'User registration is disabled', { method: 'registerUser' } else if RocketChat.settings.get('Accounts_RegistrationForm') is 'Secret URL' and (not formData.secretURL or formData.secretURL isnt RocketChat.settings.get('Accounts_RegistrationForm_SecretURL')) throw new Meteor.Error 'error-user-registration-secret', 'User registration is only allowed via Secret URL', { method: 'registerUser' } RocketChat.validateEmailDomain(formData.email); userData = email: s.trim(formData.email.toLowerCase()) password: formData.pass userId = Accounts.createUser userData RocketChat.models.Users.setName userId, s.trim(formData.name) RocketChat.saveCustomFields(userId, formData) try if userData.email Accounts.sendVerificationEmail(userId, userData.email); catch error # throw new Meteor.Error 'error-email-send-failed', 'Error trying to send email: ' + error.message, { method: 'registerUser', message: error.message } return userId define [ 'dispatcher' 'action-manager' 'store' 'invariant' 'signals' ], (dispatcher, actionManager, Store, invariant, logger, {Signal}) -> return { dispatcher actionManager Store invariant Signal } Dashboard.Auth = Ember.Auth.extend request: 'jquery' response: 'json' strategy: 'token' session: 'cookie' modules: [ 'emberData' 'authRedirectable' 'actionRedirectable' ] tokenKey: 'access_token' tokenIdKey: 'user_id' tokenLocation: 'authHeader' tokenHeaderKey: 'AUTH-TOKEN' signInEndPoint: Dashboard.ApplicationAdapter.create().buildURL('sessions') signOutEndPoint: Dashboard.ApplicationAdapter.create().buildURL('sessions') emberData: userModel: 'user' authRedirectable: route: 'sessionsNew' actionRedirectable: signInRoute: 'index' signOutRoute: 'sessionsNew' signInSmart: true signInBlacklist: ['sessionsNew', 'sessionsDestroy'] Wheelmap.FlashMessagesController = Ember.ArrayController.extend pushMessage: (type, message)-> @pushObject Wheelmap.FlashMessage.create type: type message: message actions: removed: (message)-> @removeObject(message) Wheelmap.FlashMessage = Ember.Object.extend type: 'notice' message: null exports.draw_grid = (S, grid_size, cell_size) -> draw_leg = (x, y) -> size = cell_size * 0.5 S.rect { x: x y: y height: size width: size / 2 fill: "#00aa00" } draw_arc = (width, x_sign, y_sign) -> "a#{width},#{width} 0 0,1 #{x_sign*width},#{y_sign*width} " draw_ellipse = (width, x_sign, y_sign) -> draw_arc(width, x_sign, y_sign) + draw_arc(width, -1*x_sign, -1*y_sign) draw_turtle_path = (i, j) -> width = cell_size / 2 x = i*cell_size y = j*cell_size path = "M#{x},#{y} " for offset in [[1,1], [1,-1], [-1,1], [-1,-1]] path += draw_ellipse(width, offset[0], offset[1]) head = cell_size / 4 path += "m#{width / 3},0 " + draw_ellipse(head, 2,0) shell = cell_size * 2 / 3 path += "m#{width / 2},0 " + draw_ellipse(shell , -3 / 2,0) S.path {class: "path-turtle", d: path, fill: "#88ff88"} grid_path = "" for n in [0..grid_size] by cell_size grid_path += "M#{n},1 V#{grid_size-1} M1,#{n} H#{grid_size-1} " [ S.rect { class: "grid-background" height: grid_size width: grid_size fill: "#ccffcc" stroke: "black" } S.path {class: "grid-lines", d: grid_path, stroke: "#ffffff"} draw_turtle_path(1,2) ] #= require ./start/start_main #= require ./results/results_main ###* @jsx React.DOM ### window.MainAreaBottom = React.createClass propTypes: store: React.PropTypes.object.isRequired statechart: React.PropTypes.object.isRequired corpus: React.PropTypes.object.isRequired results: React.PropTypes.object.isRequired mainComponent: -> {store, statechart, corpus, results} = @props if statechart.pathContains('start') `` else currentResultPageNo = statechart.getArgumentValue('currentResultPageNo') `` rowWithSidebar: -> `
    {this.mainComponent()}
    ` rowWithoutSidebar: -> `
    {this.mainComponent()}
    ` render: -> if true @rowWithSidebar() else @rowWithoutSidebar() Backbone.Factlink ||= {} class Backbone.Factlink.Collection extends Backbone.Collection constructor: (args...) -> super args... @_loading = false @on 'before:fetch', => @_loading = true @on 'reset', => @_loading = false loading: -> @_loading waitForFetch: (callback) -> if @_loading resetCallback = -> @off 'reset', resetCallback # run callback with "this" bound, and with first argument this collection callback.call(this, this) @on 'reset', resetCallback, @ else callback.call(this, this) fetchOnce: (options={}) -> if @_loading @waitForFetch options.success if options.success? else @fetch options define [ "base" ], (App) -> App.controller "FeatureOnboardingController", ($scope, settings) -> $scope.innerStep = 1 $scope.turnCodeCheckOn = () -> settings.saveSettings({ syntaxValidation: true }) $scope.settings.syntaxValidation = true navToInnerStep2() $scope.turnCodeCheckOff = () -> settings.saveSettings({ syntaxValidation: false }) $scope.settings.syntaxValidation = false navToInnerStep2() $scope.dismiss = () -> $scope.ui.leftMenuShown = false $scope.ui.showCodeCheckerOnboarding = false navToInnerStep2 = () -> $scope.innerStep = 2 $scope.ui.leftMenuShown = true angular.module('loomioApp').controller 'MiniProposalPieChartController', ($scope) -> $scope.pieChartData = [ { value : 0, color : "#90D490" }, { value : 0, color : "#F0BB67" }, { value : 0, color : "#D49090" }, { value : 0, color : "#dd0000"} ] $scope.pieChartOptions = animation: false segmentShowStroke: false responsive: false refreshPieChartData = -> return unless $scope.proposal counts = $scope.proposal.voteCounts # yeah - this is done to preseve the view binding on the pieChartData $scope.pieChartData[0].value = counts.yes $scope.pieChartData[1].value = counts.abstain $scope.pieChartData[2].value = counts.no $scope.pieChartData[3].value = counts.block $scope.$watch 'proposal.voteCounts', -> refreshPieChartData() $ -> showOrderDialog = (orderId) -> $.ajax url: "/orders/#{orderId}/show_order_dialog" type: 'POST' dataType: 'json' success: (response) -> $("#order_id").text(response.order_id) $("#date_received").text(response.order_date) $("#organization_name").text(response.organization_name) $("#status").text(response.status) $("#edit_order_button").attr("href", "/orders/" + response.order_id + "/edit") orderDetails = JSON.parse(response.order_details) html = [] html.push("#{item.description}#{item.quantity}") for item in orderDetails $("#order-details").html(html.join("")); $("#order_details_modal").modal(); error: (jqXHR, textStatus, errorThrown) -> alert("Error occurred") $('.order').click (e) -> e.stopPropagation() orderId = $(e.target).parent().data('order-id') showOrderDialog(orderId) $(':input[name="status"]').change (e) -> $(e.target).closest('form').submit() require [ "jquery" "app" "../extension/hotkey" ], ( $ App ) -> class LocalSetup constructor: -> @loadCommands() App.on "execute.commands", @executeCommand.bind(this) loadCommands: -> $.getJSON("http://api.backtick.io/commands") .success((response) => App.trigger "load.commands", response) .error(console.log.bind(console, "Error fetching commands")) executeCommand: (command) -> $.getScript(command.src) .success(App.trigger.bind(App, "executed.commands", command)) .error(App.trigger.bind(App, "executionError.commands", command)) new LocalSetupangular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> if not unit.studentEnrolled project.project_id unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() , (response) -> alertService.add("danger", "Unable to find student. Please check the student ID, and ensure the student has logged in at least once already to ensure they have an account.", 6000) ) # Manages add to home screen button. Gather.Views.AddToHomeScreenView = Backbone.View.extend initialize: (options) -> @options = options window.addEventListener('beforeinstallprompt', (event) => # Prevent Chrome 67 and earlier from automatically showing the prompt event.preventDefault() unless @optedOut() # Stash the event so it can be triggered later. @deferredPrompt = event # Update UI notify the user they can add to home screen @$el.show() ) events: 'click .btn': 'add' 'click .opt-out': 'optOut' add: -> # Hide our user interface that shows our A2HS button @$el.hide() # Show the prompt @deferredPrompt.prompt() # Wait for the user to respond to the prompt. We need to handle this event for it to work, I think. @deferredPrompt.userChoice.then((choiceResult) => if choiceResult.outcome == 'accepted' console.log('User accepted the A2HS prompt') else console.log('User dismissed the A2HS prompt') @deferredPrompt = null ) optOut: (event) -> event.preventDefault() @$el.hide() document.cookie += "dontAddToHomeScreen=1;domain=.#{@options.host};" + "path=/;expires=Tue, 19 Jan 2038 03:14:07 UTC;" optedOut: -> return true if window.localStorage.getItem('dontAddToHomeScreen') # Legacy return true if document.cookie.indexOf('dontAddToHomeScreen=1') != -1 false ti = require 'tb/lib/ti' module.exports = load: -> Backbone.$ = ti.$ @extendView() extendView: -> # The default `viewName` for a View is `"View"`, which serves as # the base of all Titanium views. Backbone.View::viewName = 'View' # Delegate tagName to viewName to reduce the number of Backbone.View # methods which need to be overridden Backbone.View::tagName = -> _.result @, 'viewName' _originalConfigure = Backbone.View::_configure Backbone.View::_configure = (options) -> # If attributes are provided in the constructor, merge them with # attributes provided by an 'attributes' attribute or function if options.attributes and attrs = _.extend {}, _.result(this, 'attributes') options.attributes = _.extend attrs, options.attributes _originalConfigure.call @, options # StorageManager = require '../src/storage-manager' # # # This spec file cannot be included with other specs because it requires a pristine # # StorageManager singleton instance. Instead, ensure this works by commenting it in # # and running it by itself # # describe 'Singleton#get with window.base.data', -> # stubbedStorageManager = null # # beforeAll -> # stubbedStorageManager = { # addCollection: -> # restore: -> # } # # window.base = { data: stubbedStorageManager } # # fit 'uses the window.base.data reference', -> # expect(StorageManager.get()).toBe(stubbedStorageManager) ݛ���/�kV����>� 'x��Z��!&�)Y*�.�3�7�:�= ACD�IWN�N�P�U�X^�_�b�hdjMk,l�phq@s�uTyl~�Q�†Ћːj�������}�����بp��Q�E���ú�����������+���;�S���������E�d���J�,�m  � � ,�s�;���$&&,.�3Q7�:�?VC0DDFICM�M�QHSYT�W�Y�]Qb�g h�kWns�w�z�~�H�Ň�����Z����������C��|���j����������?�|� ����7�9�/������`�������8���2����.���hz 1Q�# (�*v,c/�378�:?�A�B�D.E2G�G'JiK�KNgP�SZ�_�c�gii�m&n�qs�s�vz�| ~�:�m�_������������)���5�3�c���'���[���w�����(��'�����.�7��u���i���O�w�1�s�F�1���+F � cY�-+�/%!Q$�%�)-�15�8�9�=qB�F)G�H�MYNHQ�S$T�Y^b. ### class @FormToggle constructor: -> $(document).on 'change', '.js-form-toggle--input', @togglePollForm togglePollForm: (e) => show = e.currentTarget.checked id = e.currentTarget.dataset.formToggleId $form = $(".js-form-toggle--form[data-form-toggle-id='#{id}']") direction = if show then 'Down' else 'Up' $form.stop()["slide#{direction}"]() AccountsEntry = settings: wrapLinks: true homeRoute: '/home' dashboardRoute: '/dashboard' passwordSignupFields: 'EMAIL_ONLY' config: (appConfig) -> @settings = _.extend(@settings, appConfig) i18n.setDefaultLanguage "en_US" if appConfig.language i18n.setLanguage appConfig.language if appConfig.signUpTemplate Router.routes = _.reject Router.routes, (e, i) -> e.name is 'entrySignUp' Router.map -> @route 'signUp', path: 'sign-up', template: appConfig.signUpTemplate @AccountsEntry = AccountsEntry import logger from '../log' request = require('request-promise-native') sleep = (milliseconds) -> return new Promise((resolve) -> setTimeout(resolve, milliseconds)) export default download = (href, jar, options) -> logger.debug "Downloading", href if not jar jar = request.jar() delay = 5 for i in [1..10] try page = await request({ options..., url: href jar: jar, gzip: true, timeout: options?.timeout || 7 * 1000 }) return page catch e logger.info "Error downloading " + href + " " + i + " will re-download" logger.info e.message await sleep(delay) delay *= 2 throw "Can't download" # Copyright (c) 2015 Markus Kohlhase React = require "react" PureMixin = require "react-pure-render/mixin" { NAMES, CSS_CLASSES } = require "../constants/Categories" { div, p, h3, button, span, i } = React.DOM module.exports = React.createClass displayName: "EntryDetails" mixins: [ PureMixin ] render: -> { entry } = @props clz = CSS_CLASSES[entry.categories?[0]] div className: "entry-detail #{clz}", div className: "category", span null, NAMES[entry.categories?[0]] div null, h3 null, entry.title p null, entry.description p null, entry.homepage p null, entry.phone div null, button onClick: @props.onClose className: "pure-button", i className: "fa fa-chevron-left" "zurück" button onClick: @props.onEdit className: "pure-button", i className: "fa fa-pencil" "bearbeiten" # detect tweet URL and send tweet content module.exports = (robot) -> robot.hear /https?:\/\/(mobile\.)?twitter\.com\/.*?\/status\/([0-9]+)/i, (msg) -> msg.http("https://api.twitter.com/1/statuses/show/#{msg.match[2]}.json").get() (err, res, body) -> return if err or (res.statusCode != 200) tweet = JSON.parse(body) msg.send "@#{tweet.user.name}: #{tweet.text}" should = require 'should' KDCustomHTMLView = require '../../lib/core/customhtmlview' describe 'KDCustomHTMLView', -> it 'exists', -> KDCustomHTMLView.should.exist describe 'constructor', -> it 'should instantiate without error', -> router = new KDCustomHTMLView router.should.exist module.exports = { name: "UX Markup" namespace: "ux" fallback: ['xml'] ### Supported Grammars ### grammars: [ "UX" ] ### Supported extensions ### extensions: [ "ux" ] defaultBeautifier: "Pretty Diff" } RubocopAutoCorrect = require './rubocop-auto-correct' module.exports = config: rubocopCommandPath: description: 'If command doesnot work, please input rubocop full path. example: /Users//.rbenv/shims/rubocop)' type: 'string' default: 'rubocop' autoRun: description: 'When you save the buffer, Automatically run Rubocop auto correct, But, need to run manually once at window' type: 'boolean' default: false notification: description: 'If you want to disable notification, Please remove the check' type: 'boolean' default: true correctFile: description: 'When enabled, correct directly in the file (Don\'t need to save)' type: 'boolean' default: false activate: -> @rubocopAutoCorrect = new RubocopAutoCorrect() deactivate: -> @rubocopAutoCorrect?.destroy() @rubocopAutoCorrect = null path = require 'path' _ = require 'underscore-plus' ImageEditor = require './image-editor' module.exports = activate: -> atom.project.registerOpener(openUri) deactivate: -> atom.project.unregisterOpener(openUri) # Files with these extensions will be opened as images imageExtensions = ['.gif', '.ico', '.jpeg', '.jpg', '.png'] openUri = (uriToOpen) -> uriExtension = path.extname(uriToOpen) if _.include(imageExtensions, uriExtension) new ImageEditor(uriToOpen) gulp = require 'gulp' coffee = require 'gulp-coffee' mocha = require 'gulp-mocha' src = './src/*.coffee' test = './test/*.coffee' gulp.task('compile', -> gulp.src(src) .pipe(coffee()) .pipe(gulp.dest('./src')) ) gulp.task('test', -> gulp.src(test) .pipe(mocha({ reporter: 'list' })) ) gulp.task('watch', -> gulp.watch([src, test], ['test']) ) gulp.task('default', ['test']) _ = require "underscore" LayoutDOM = require "./layout_dom" p = require "../../core/properties" class BaseBox extends LayoutDOM.Model type: "BaseBox" @define { children: [ p.Array, [] ] } module.exports = Model: BaseBox cp = require('child_process') getBranchFromRef = (ref) -> refParts = ref.split("/") return refParts[refParts.length-1] exports.index = (req, res) -> parsedPayload = JSON.parse(req.body.payload) console.log "Got deploy message from #{parsedPayload.ref}" unless getBranchFromRef(parsedPayload.ref) is "deploy" console.log "Ignoring, only deploys on pushes from deploy" return res.send 500, "Only commits from deploy branch are accepted" console.log "Forking #{process.cwd()}/bin/deploy.coffee" cp.fork("#{process.cwd()}/bin/deploy.coffee") console.log "Forked!" res.send 200 FactlinkApp.module "DiscussionModalOnFrontend", (DiscussionModalOnFrontend, MyApp, Backbone, Marionette, $, _) -> background_page_url = null DiscussionModalOnFrontend.addInitializer -> background_page_url = currentUser.streamLink() FactlinkApp.vent.on 'close_discussion_modal', -> Backbone.history.navigate background_page_url, false FactlinkApp.discussionModalRegion.close() DiscussionModalOnFrontend.openDiscussion = (fact, url) -> Backbone.history.navigate fact.get('url'), false background_page_url = Backbone.history.getFragment(url) if url? newClientModal = new DiscussionModalContainer FactlinkApp.discussionModalRegion.show newClientModal newClientModal.mainRegion.show new NDPDiscussionView model: fact # HACK: This assumes that we use "navigate url, true" for all url changes that # leave the main regions alone (sidebar, mainRegion, etc) DiscussionModalOnFrontend.loadUrlStopRouting = (fragment) -> FactlinkApp.discussionModalRegion.close() if fragment == background_page_url background_page_url = null true else background_page_url = null false React = require 'react' BS = require 'react-bootstrap' ChapterSectionType = require './chapter-section-type' module.exports = React.createClass displayName: 'LearningGuideProgressBar' propTypes: section: React.PropTypes.object.isRequired onPractice: React.PropTypes.func render: -> {section, onPractice} = @props bar = if section.current_level percent = Math.round((section.current_level / 1) * 100) # always show at least 5% of bar, otherwise it just looks empty else Practice section if onPractice tooltip = Click to practice onPractice(section)} block>{bar} else bar stripeCallback = (status, response) -> if response.error anchortabSite.validationError("#card-number", response.error.message) else $("#stripe-token").val(response.id) $(".stripe-form").submit() $(document).ready -> anchortabSite.event("stripe-form-ready") $(".plan-selection").on 'change', (event) -> if $(".plan-selection").find(":selected").data("has-trial") $(".billing-information").hide() else $(".billing-information").show() $(".stripe-form .submit").on "click", (event) -> return if $(".plan-selection").find(":selected").data("has-trial") event.preventDefault() event.stopPropagation() anchortabSite.event("validate-stripe-form", stripeCallback: stripeCallback ) $(".plan-selection").change() class window.NDPEvidenceCollection extends Backbone.Collection initialize: (models, options) -> @on 'change', @sort, @ @fact = options.fact constructor: (models, options) -> super unless models and models.length > 0 @reset [ new OpinionatersEvidence {type: 'believe'}, collection: this new OpinionatersEvidence {type: 'disbelieve'}, collection: this new OpinionatersEvidence {type: 'doubt'}, collection: this ] comparator: (item) -> - item.get('impact') $ -> # Refresh if a page is loaded directly pageLoad() # Refresh if a page is loaded via turbolinks $(document).on "page:load", pageLoad pageLoad = -> # Steps to do on a page load (with turbolinks) # Refresh all ratings on the current page refreshRatings() # Refresh for the new event divs that are shown on a idea show $(".idea-overview-title").on "ajax:success", (event) -> refreshRatings() refreshRatings = -> $(".rating").each (index,value) -> div_id = $(this).attr("id") #alert $(this).attr("data-url") #TODO: make this generic so it will update idea-* or event-* $.ajax url: $(this).attr("data-url"), type: 'GET', dataType: 'json' success: (data, textStatus, jqXHR) -> reaction = data['reaction'] $("##{div_id}").raty path: "/assets" score: reaction click: (score,evt) -> $.ajax url: $(this).attr("data-url"), type: 'PATCH', dataType: 'json', data: { event: { reaction: score } } # Given an array of actions, the actions will be called serially. # The first action is called. If it calls the 'next' function that is passed to it # the next action in the series is called. This continues until either one of the # actions does not call 'next' or until the end of the list is reached. _ = require('underscore')._ actionOrMetaString= require('../actionOrMetaString') exports = module.exports = action_series= (silo)-> action_series_handler= (req,res,next)-> return next() unless silo if _.isFunction(silo) silo= [silo] i= 0 nextActionHandler= (err)=> next(err) if err try actor= silo[i++] if (actor) actionOrMetaString(actor)(req,res,nextActionHandler) else next() catch e next(e) nextActionHandler()'use strict' app.directive 'pdfViewer', [ () -> restrict: 'E' transclude: true scope: asset: '=asset' link: ($scope, $elem, $attrs,_Controller, $transclude) -> pdfElement = $elem[0] objectTag = document.createElement('object') objectTag.setAttribute('data', $scope.asset.downloadRoute(true)) objectTag.setAttribute('width', '80%') objectTag.setAttribute('type', $scope.asset.format.mimetype) $transclude (elem) -> objectTag.appendChild elem[0] pdfElement.appendChild(objectTag) return ] _ = require "underscore" Promise = require "bluebird" stream = require "readable-stream" Match = require "mtr-match" ActivityTask = require "../ActivityTask" Read = require "./Read" Save = require "./Save" class Download extends ActivityTask constructor: (options, dependencies) -> Match.check dependencies, Match.ObjectIncluding read: Read save: Save super @save.input = @read.output = new stream.PassThrough({objectMode: true}) execute: -> Promise.join(@read.execute(), @save.execute()) module.exports = Download logger = require "logger-sharelatex" module.exports = startDrain: (io, rate) -> # Clear out any old interval clearInterval @interval if rate == 0 return @interval = setInterval () => @reconnectNClients(io, rate) , 1000 RECONNECTED_CLIENTS: {} reconnectNClients: (io, N) -> drainedCount = 0 for client in io.sockets.clients() if !@RECONNECTED_CLIENTS[client.id] @RECONNECTED_CLIENTS[client.id] = true logger.log {client_id: client.id}, "Asking client to reconnect gracefully" client.emit "reconnectGracefully" drainedCount++ if drainedCount == N break if drainedCount < N logger.log "All clients have been told to reconnectGracefully"if Meteor.isCordova document.addEventListener 'deviceready', -> if device?.platform.toLowerCase() isnt 'android' cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); window.addEventListener 'native.keyboardshow', -> if device?.platform.toLowerCase() isnt 'android' $('.main-content').css 'height', window.innerHeight window.addEventListener 'native.keyboardhide', -> if device?.platform.toLowerCase() isnt 'android' $('.main-content').css 'height', window.innerHeightgulp = require 'gulp' jshint = require 'gulp-jshint' coffeelint = require 'gulp-coffeelint' mocha = require 'gulp-mocha' runSequence = require 'run-sequence' # compilers coffee = require 'gulp-coffee' gulp.task 'coffee', -> gulp.src './src/*.coffee' .pipe coffee() .pipe gulp.dest './lib' gulp.task 'coffeelint', -> gulp.src ['./src/*.coffee', './test/*.coffee'] .pipe coffeelint() .pipe coffeelint.reporter() gulp.task 'jshint', -> gulp.src ['./bin/*.js', './lib/*.js'] .pipe jshint() .pipe jshint.reporter() gulp.task 'watch', -> gulp.watch './src/*.coffee', ['coffee'] gulp.task 'mocha', -> gulp.src './test/*.coffee' .pipe mocha {reporter: 'spec'} gulp.task 'default', -> runSequence ['coffeelint', 'jshint'], 'coffee', 'mocha' module.exports = openPath: (path, callback) -> waitsForPromise -> atom.workspace.open(path) runs -> callback(atom.views.getView(atom.workspace.getActivePaneItem())) rowRangeFrom: (marker) -> [marker.getTailBufferPosition().row, marker.getHeadBufferPosition().row] window.Sounds2 = class sounds: walk: [0, 0.2] chop: [1, 1.2] throw: [2, 2.1] snowball_hit: [3, 3.4] drop: [4, 4.2] pickup: [5, 5.2] deliver: [6, 6.5] constructor: -> @players = [] for i in [0 .. 9] # create 10 players by default @.createPlayer() createPlayer: -> player = document.createElement("audio"); player.src = '/sounds.mp3' $('body').append(player) player.pause() player.addEventListener('timeupdate', ()=> @.onPlayerTimeUpdate(player) false ) @players.push(player) player getFreePlayer: -> _.detect(@players, (p)-> not p.stop_at? ) || @.createPlayer() playSound: (key)-> player = @.getFreePlayer() player.src = player.src player.currentTime = @.sounds[key][0] player.stop_at = @.sounds[key][1] console.log('start:', player.currentTime) player.play() # binds to player onPlayerTimeUpdate: (player)-> if player.currentTime > player.stop_at player.pause() delete player.stop_at console.log('done') chai = require("chai") should = chai.should() mock = require("TinyMockJS").mock Logger = require("../src/Logger").Logger fs = require("fs") describe "Logger", -> describe "constructor(options)", -> it "retrieves the log file name from 'options'", -> mock (options) -> options.expects("get_log_filename") logger = new Logger(options) describe "write(message)", -> logger = undefined beforeEach -> options = { get_log_filename: -> "log.txt" } logger = new Logger(options) it "writes 'message' to 'log_filename' that was passed to the constructor", -> mock -> fs.expects("appendFileSync").args("log.txt", "a message") logger.log("a message") it "does not eat exceptions thrown by fs.appendFileSync", -> mock -> fs.expects("appendFileSync").args("log.txt", "a message").throws(new Error("an error")) (-> logger.log("a message") ).should.throw("an error") # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.workspace': 'ctrl-alt-o': 'rails:toggle' '.editor.vim-mode.command-mode:not(.insert-mode)': 'g m': 'rails:go-to-model' 'g v': 'rails:go-to-view' 'g c': 'rails:go-to-controller' 'g s': 'rails:go-to-test' 'g h': 'rails:go-to-helper' DiffChunk = require './diff-chunk' List = require '../list' _ = require 'underscore' ## # A diff is a whole-file diff, and is broken into a list of chunks. End-game # here is to be able to stage individual chunks, not just the whole diff. # module.exports = class Diff extends List model: DiffChunk is_sublist: true selected_index: -1 removeHeader: (diff) -> # Remove first two lines, which name the file @header = diff.match(/^(.*?\n){2}/)[0] diff.replace /^(.*?\n){2}/, "" splitChunks: (diff) -> # We'll treat "@@ " a the beginning of a line as characteristic of the start # of a chunk. diff.split /(?=^@@ )/gm constructor: (diff) -> @giftDiff = diff @raw = diff.diff diff = @removeHeader @raw chunks = @splitChunks diff chunks = _.map chunks, (chunk) => chunk: chunk, header: @header super chunks @select -1 chunks: -> @models module.exports = (app, server) -> authMiddleware = require('./middleware/authentication') models = require '../models' app.io = require('socket.io')(server) redisClient = require('./redis_client')() respondSocketError = (next, err) -> console.error "Socket failed to connect", err next(new Error('not found')) validateLeagueAuth = (socket, next) -> unless socket.handshake.query.league_id respondSocketError(next) else models.League.findOne(where: {id: socket.handshake.query.league_id}) .then (league) -> if (league) authMiddleware.getOrCreateUserFromToken(socket.handshake.query.id_token, redisClient) .then (user) -> next() .catch respondSocketError.bind(null, next) else respondSocketError(next) .catch respondSocketError.bind(null, next) app.io.use validateLeagueAuth app.io.sockets.on 'connection', (socket) -> socket.join(socket.handshake.query.league_id); socket.on 'message', (data) -> socket.broadcast.to(socket.handshake.query.league_id).emit('message', data) module.exports = (robot) -> names = ['Dana', 'Freia', 'Jhishan', 'Kyle', 'Brenton', 'Terri', 'Abhi', 'Drew'] robot.hear /Resume queen, who is next?/i, (res) -> res.send res.random names class Game.State extends Game.TwoWay constructor: () -> @objects = {} @eventCounters = {} @eventHandlers = {} super onEvent: (e) -> # Add timestamped instance to the event counters object if e.type not of @eventCounters @eventCounters[e.type] = [] @eventCounters[e.type].push new Date() # relay the event upward @fire(e) # call added callbacks @eventHandlers[e.type].forEach (cb) -> cb() return addObject: (obj) -> if obj not instanceof Game.Object throw new Game.GameError(Game.Error.ErrorType.NOT_OBJECT) if obj.getId() of @objects throw new Game.GameError(Game.Error.ErrorType.ALREADY_ADDED) @objects[obj.getId()] = obj @listen(obj, @onEvent) # call object added method obj.added() addEventHandler: (evtType, callback) -> if evtType not of @eventHandlers @eventHandlers[evtType] = [] if callback not in @eventHandlers[evtType] @eventHandlers[evtType].push callback returnpackages: [ "advanced-open-file" "atom-alignment" "atom-beautify" "atom-transpose" "change-case" "color-picker" "docblockr" "editorconfig" "emmet" "expand-region" "language-apache" "language-applescript" "language-awk" "language-babel" "language-diff" "language-env" "language-gitattributes" "language-gitignore" "language-har" "language-hosts" "language-ini" "language-javascript-jsx" "language-latex" "language-liquid" "language-lisp" "language-pegjs" "language-pip" "language-prolog" "language-sca" "language-svg" "language-tcl" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jsonlint" "linter-php" "linter-shellcheck" "linter-ui-default" "monokai" "package-sync" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "swap-selection" "tabs-to-spaces" "teletype" ] Walrus = require '../../bin/walrus' fs = require 'fs' path = require 'path' exec = require( 'child_process' ).exec TestHelpers = read : ( filename ) -> fs.readFileSync filename, 'utf8' if path.existsSync filename pass : ( specs, suffix='' ) -> for file in fs.readdirSync specs when path.extname( file ) is '.wal' do ( file ) => base = path.basename file, '.wal' spec = "#{specs}/#{base}#{suffix}.html" text = @read "#{specs}/#{base}.wal" json = @read "#{specs}/#{base}.js" html = @read spec # if we can't find the suffixed version, try and find # one without the suffix and use that instead. if not html spec = "#{specs}/#{base}.html" html = @read spec # if _that_ one doesn't exist, throw a helpful error. throw "Can't find example html at #{specs}/#{base}#{suffix}.html or #{specs}/#{base}.html" if not html tmpl = Walrus.Parser.parse text it "should pass the #{base}#{suffix} example", ( done ) -> comp = tmpl.compile( eval( "(#{json})" ) ) if comp is html done( ) else cmd = """ printf "#{comp}" | diff --unified #{spec} - """ exec cmd, ( error, stdout, stderr ) -> done new Error "Expected did not match actual:\n" + stdout module.exports = TestHelpers editorModule "Attachments", template: "editor_with_image" editorTest "moving an image by drag and drop", (expectDocument) -> typeCharacters "!", -> moveCursor direction: "right", times: 1, (coordinates) -> img = document.activeElement.querySelector("img") triggerEvent(img, "mousedown") after 1, -> dragToCoordinates coordinates, -> expectDocument "!a#{Trix.OBJECT_REPLACEMENT_CHARACTER}b\n" editorTest "removing an image", (expectDocument) -> after 20, -> clickElement getFigure(), -> closeButton = getFigure().querySelector(".attachment__remover") clickElement closeButton, -> expectDocument "ab\n" getFigure = -> getDocumentElement().querySelector("figure") define [ 'controllers/node_tool' 'models/commands/commander' ], (NodeTool, Commander) -> class MockContainer addNode: -> class MockDrawing extends MockContainer select: (item) -> @selection = [item] clearSelection: -> @selection = [] describe 'NodeTool', -> beforeEach -> @commander = new Commander @drawing = new MockDrawing @tool = new NodeTool(commander: @commander, drawing: @drawing) @tool.setParameter("shape", "a-shape") it 'creates a new node', -> spyOn(@drawing, 'addNode') @tool.onMouseDown({point: "dummy-position"}) expect(@drawing.addNode).toHaveBeenCalledWith( shape : 'a-shape' position : "dummy-position" ) ETahi.UploadManuscriptOverlayController = ETahi.TaskController.extend manuscriptUploadUrl: (-> "/papers/#{@get('litePaper.id')}/upload" ).property('litePaper.id') isUploading: false isProcessing: false uploadProgress: 0 showProgress: true actions: uploadStarted: -> @set('isUploading', true) uploadProgress: (data) -> progress = Math.round(data.loaded * 100 / data.total) @set('uploadProgress', progress) if progress >= 100 @setProperties(showProgress: false, isProcessing: true) uploadError: (message) -> @set('uploadError', message) uploadFinished: (data) -> @store.pushPayload(data) @set('isUploading', false) @set('completed', true) @get('model').save().then(=> @send('closeAction')) ### Register all the editors. One you add a new built in editor, it should go here. ### # Require each module, which loads a file editor. These call register_file_editor. # This should be a comprehensive list of all React editors # require('./editor_terminal') require('./chat/register') require('./editor_archive') #require('./course/main') require('./course-coffee/main') require('./editor_pdf') require('./stopwatch/register') require('./jupyter/register') require('./tasks/register') require('./media-viewer/register') # Public editors #require('./public/editor_image') # Raw data editors require('./editor-data/generic') # All the non-react editors. require('./editor').register_nonreact_editors() require('./frame-editors/register') `import Ember from 'ember'` `import TravisRoute from 'travis/routes/basic'` `import config from 'travis/config/environment'` Route = TravisRoute.extend queryParams: filter: { replace: true } model: -> apiEndpoint = config.apiEndpoint $.ajax(apiEndpoint + '/v3/repos?repository.active=true', { headers: { Authorization: 'token ' + @auth.token() } }).then (response) -> response.repositories.sortBy('last_build.finished_at').filter( (repo) -> repo.last_build ).map( (repo) -> Ember.Object.create(repo) ) `export default Route` React = require 'react' createReactClass = require 'create-react-class' CroppedImage = require '../../../components/cropped-image' ArticleListItem = createReactClass getDefaultProps: -> icon: null title: '' onClick: -> render: -> module.exports = ArticleListItem {View} = require 'atom' ImageEditor = require './image-editor' module.exports = class ImageEditorStatusView extends View @content: -> @div class: 'status-image inline-block', => @span class: 'image-size', outlet: 'imageSizeStatus' initialize: (filePath, image) => @filePath = filePath @image = image if @filePath and @image @attach() @subscribe atom.workspaceView, 'pane-container:active-pane-item-changed', => editor = atom.workspaceView.getActivePaneItem() if editor instanceof ImageEditor and @filePath is editor.filePath @imageSizeStatus.parent().show() else @imageSizeStatus.parent().hide() attach: => statusBar = atom.workspaceView.statusBar if statusBar statusBar.appendLeft this @getImageSize() getImageSize: => imageWidth = @image.width() imageHeight = @image.height() @imageSizeStatus.text("#{imageWidth}px x #{imageHeight}px").show() angular.module('kassa').directive('kassaStateToggle',[ '$location' ($location)-> linker = ($scope, $element, $attrs)-> stateKey = $attrs.kassaStateToggle defaultValue = $attrs.kassaStateDefault || false unless $location.search()[stateKey]? $location.search stateKey, defaultValue isInVisibleState = (key)-> stateValue = $location.search()[key] stateValue == "true" $element.on 'click', -> $scope.$apply -> value = String(!isInVisibleState(stateKey)) $location.search(stateKey, value).replace() $scope.isInVisibleState = isInVisibleState restrict: 'A', scope: false, link: linker ])".source.ruby": "Hashrocket": prefix: "=" body: " => " ".source.coffee": "Describe block": prefix: "de" body: """ describe "${1:description}", -> ${2:body} """ "It block": prefix: "i" body: """ it "$1", -> $2 """ "Before each": prefix: "be" body: """ beforeEach -> $1 """ "After each": prefix: "af" body: """ afterEach -> $1 """ "Expectation": prefix: "ex" body: "expect($1).to$2" "Console log": prefix: "log" body: "console.log $1" "Range array": prefix: "ra" body: "[[$1, $2], [$3, $4]]" "Point array": prefix: "pt" body: "[$1, $2]" "Key-value pair": prefix: ":" body: '${1:"${2:key}"}: ${3:value}' "Create Jasmine spy": prefix: "spy" body: 'jasmine.createSpy("${1:description}")$2' packages: [ "advanced-open-file" "atom-alignment" "atom-beautify" "atom-transpose" "change-case" "color-picker" "docblockr" "editorconfig" "emmet" "expand-region" "git-blame" "language-apache" "language-applescript" "language-awk" "language-babel" "language-diff" "language-env" "language-gitattributes" "language-gitignore" "language-har" "language-hosts" "language-ini" "language-javascript-jsx" "language-latex" "language-liquid" "language-lisp" "language-pegjs" "language-pip" "language-prolog" "language-sca" "language-svg" "language-tcl" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jsonlint" "linter-php" "linter-shellcheck" "linter-ui-default" "monokai" "package-sync" "plist-converter" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "tabs-to-spaces" "teletype" ] module.exports = """ query user($id: ID! $per: Int, $page: Int, $perBlocks: Int, $q: String, $sort: SearchSorts, $seed: Int) { user(id: $id) { contents(per: $per, type: "channel", page: $page, q: $q, sort_by: $sort, seed: $seed) { title(truncate: 50) updated_at(relative: true) user { name } id href kind { __typename ... on Channel { visibility counts { blocks } blocks(per: $perBlocks, sort_by: UPDATED_AT, direction: DESC, type: BLOCK) { ... blockThumb } } } } } } #{require '../../../components/block_v2/queries/block.coffee'} """class exports.BrunchApplication constructor: -> jQuery => @initialize this Backbone.history.start() initialize: -> null # node.js child-process # http://nodejs.org/docs/v0.6.3/api/child_processes.html $ = require 'jquery' _ = require 'underscore' module.exports = class ChildProccess @exec: (command, options={}) -> deferred = $.Deferred() if options.bufferLines options.stdout = @bufferLines(options.stdout) if options.stdout options.stderr = @bufferLines(options.stderr) if options.stderr $native.exec command, options, (exitStatus, stdout, stdin) -> if error != 0 error = new Error("Exec failed (#{exitStatus}) command '#{command}'") error.exitStatus = exitStatus deferred.reject(error) else deferred.resolve(stdout, stdin) deferred @bufferLines: (callback) -> buffered = "" (data) -> buffered += data lastNewlineIndex = buffered.lastIndexOf('\n') if lastNewlineIndex >= 0 callback(buffered.substring(0, lastNewlineIndex + 1)) buffered = buffered.substring(lastNewlineIndex + 1) packages: [ "advanced-open-file" "atom-react-native-autocomplete" "auto-indent" "autocomplete-modules" "emmet" "expand-region" "file-icons" "git-diff-popup" "git-plus" "git-time-machine" "hyperclick" "incremental-search" "js-hyperclick" "language-javascript-jsx" "linter" "linter-eslint" "linter-rubocop" "linter-sass-lint" "list-edit" "markdown-scroll-sync" "merge-conflicts" "package-sync" "project-manager" "react" "react-es6-snippets" "relative-numbers" "ruby-test" "sort-lines" "split-diff" "synced-sidebar" "terminal-plus" "toggle-quotes" "vim-mode" "vim-surround" ] packages: [ "editorconfig" "file-icons" "highlight-selected" "linter" "linter-coffeelint" "linter-csslint" "linter-flake8" "linter-htmlhint" "linter-js-yaml" "linter-jshint" "linter-jsonlint" "linter-less" "linter-php" "linter-scss-lint" "linter-shellcheck" "linter-xmllint" "minimap" "omni-ruler" "package-sync" "pigments" "pretty-json" "sort-lines" "terminal-plus" ] @['pages#home'] = (data) -> handler = Gmaps.build('Google') handler.buildMap provider: center: lat: 39 lng: -101 zoom: 4 internal: id: 'home-map-jumbotron' -> handler.addMarkers markersJSON @['pages#sponsor'] = (data) -> handler = Gmaps.build('Google') handler.buildMap provider: center: lat: 39 lng: -101 zoom: 3 internal: id: 'sponsor-clubs-map' -> handler.addMarkers markersJSON requirejs.config baseUrl: '/scripts' paths: 'underscore': '../bower_components/underscore/underscore' 'jquery': '../bower_components/jquery/jquery' 'backbone': '../bower_components/backbone/backbone' 'backbone.routefilter': '../bower_components/backbone-route-filter/backbone-route-filter' 'backbone.stickit': '../bower_components/backbone.stickit/backbone.stickit' 'backbone-validtion': '../bower_components/backbone-validation/dist/backbone-validation-amd' 'backbone.babysitter': '../bower_components/backbone.babysitter/lib/backbone.babysitter' 'backbone.wreqr': '../bower_components/backbone.wreqr/lib/backbone.wreqr' 'marionette': '../bower_components/marionette/lib/core/amd/backbone.marionette' 'bootstrap': '../bower_components/bootstrap/dist/js/bootstrap' 'jade': '../vendor/scripts/runtime' shim: 'underscore': exports: '_' 'jquery': exports: '$' 'backbone': deps: ['underscore', 'jquery', 'bootstrap'] exports: 'Backbone' 'backbone.routefilter': deps: ['backbone'] 'marionette': deps: ['backbone', 'backbone.babysitter', 'backbone.wreqr', 'backbone.routefilter', 'backbone.stickit', 'backbone-validtion'] exports: 'Marionette' 'bootstrap': deps: ['jquery'] 'templates': deps: ['jade'] angular.module('loomioApp').controller 'ProfilePageController', ($rootScope, Records, FormService, $location, AbilityService, ModalService, ChangePictureForm, ChangePasswordForm, DeactivateUserForm, $translate, Session, AppConfig, DeactivationModal) -> $rootScope.$broadcast('currentComponent', { page: 'profilePage'}) @init = => return unless AbilityService.isLoggedIn() @user = Session.user() $translate.use(@user.locale) @init() @availableLocales = -> AppConfig.locales @submit = FormService.submit @, @user, flashSuccess: 'profile_page.messages.updated' submitFn: Records.users.updateProfile successCallback: @init @changePicture = -> ModalService.open ChangePictureForm @changePassword = -> ModalService.open ChangePasswordForm @deactivateUser = -> ModalService.open DeactivationModal return define [ "base" ], (App) -> App.controller "AutoCompileOnboardingController", ($scope) -> recompileBtn = angular.element('#recompile') popover = angular.element('.onboarding__autocompile') { top, left } = recompileBtn.offset() # If pdf panel smaller than recompile button + popover, show to left. # Otherwise show to right if $scope.ui.pdfWidth < 475 $scope.placement = 'left' popover.offset({ top: top, left: left - popover.width() }) else $scope.placement = 'right' angular.element('.onboarding__autocompile').offset({ top: top, left: left + recompileBtn.width() }) $scope.dismiss = () -> $scope.onboarding.autoCompile = 'dismissed' event_tracking.sendMB "shown-autocompile-onboarding" class GameState customers: [] agents: [] requestQueues: {} tickables: [] tick: 0 money: 1000000 reputation: 0.5 agent_spawner = AgentSpawner() addAgent: (agent) -> @agents.append(agent) fireAgent: (agent) -> @agents.pop(agent) calculateReputation: -> totalWorth = 0 totalRep = 0 for customer in @customers totalRep += customer.mood * customer.worth totalWorth += customer.worth if totalWorth != 0 @reputation = totalRep / totalWorth constructor: -> @level = new Level numberOfRequests: -> requests = 0 for queue of @requestQueues requests += @requestQueues[queue].length() requests toString: -> "Customers: " + @customers.length + "\nRequests: " + @numberOfRequests() + "\nReputation: " + (@reputation * 100) + "%" ETahi.FunderController = Ember.ObjectController.extend ETahi.SavesDelayed, allAuthors: null fundedAuthors: Em.computed.alias('model.authors') addingAuthor: null initAuthors: (-> @set('allAuthors', @get('task.paper.authors')) ).on('init').observes('task.paper.authors') actions: funderDidChange: -> #saveModel is implemented in ETahi.SavesDelayed @send('saveModel') startAddingAuthor: -> author = @store.createRecord('author', position: 0) group.get('authors').pushObject(author) @set('addingAuthor', author) finishAddingAuthor: -> author = @get("addingAuthor") if author?.get("firstName") && author?.get("lastName") author.save().then => @get('allAuthors').pushObject(author) @get('fundedAuthors').pushObject(author) @set('addingAuthor', null) cancelAddingAuthor: -> @get('addingAuthor').deleteRecord() @set('addingAuthor', null) removeFunder: -> @get('model').destroyRecord() #!/usr/bin/env coffee RSS = require 'rss' escape = require 'escape-html' request = require 'request' API_ENDPOINT = 'https://api.imgur.com/3/' get = (clientId, path, query, cb) -> request { url: API_ENDPOINT + path method: 'get' qs: query json: true headers: Authorization: "Client-ID #{ clientId }" }, cb exports.album2rss = (clientId, albumId, cb) -> return cb "Must specify a client ID" unless clientId return cb "Must specify an album ID" unless albumId get clientId, "album/#{ albumId }", null, (err, res, body) -> return cb err if err return cb String(body?.data?.error) unless body?.success feed = new RSS(title: body.data.title, site_url: body.data.link, generator: 'imgur2rss') body.data.images.sort (a, b) -> a.datetime - b.datetime for image in body.data.images.slice 0, 10 feed.item title: image.title ? image.id url: "http://imgur.com/#{ image.id }" date: new Date(image.datetime * 1000) description: """#{ image.title ? image.id }""" cb null, feed.xml(indent: true) editor = new Voltage.Editor Deps.autorun -> if Meteor.user() Meteor.call 'isVoltageAuthorized', (err, authorized) -> Session.set 'isVoltageAuthorized', authorized else Session.set 'isVoltageAuthorized', false Template.voltagePage.helpers isVoltageAuthorized: -> editor.renderData() Session.get 'isVoltageAuthorized' Template.voltagePage.rendered = -> slug = window.location.pathname.replace(/\//g, '-').slice(1) $('.voltage').addClass slug options = update: (markdown) => page = Page.first name: slug if page page.update text: markdown else Page.create text: markdown name: slug html: () => page = Page.first name: slug if page return marked page.text '' markdown: () => page = Page.first name: slug if page return page.text '' editor.init(options).renderData() # anchor fragment support hash = document.location.hash.substr(1) if hash && !Template.voltagePage.scrolled scroller = -> $("html, body").stop() Meteor.setTimeout(-> elem = $('#' + hash) if elem.length scroller().scrollTop(elem.offset().top) Template.voltagePage.scrolled = true , 0) Template.voltagePage.destroyed = -> delete Template.voltagePage.scrolled Template.voltageEditor.rendered = -> editor.renderEditor() '.editor': 'ctrl-j': 'symbols-view:toggle-file-symbols' 'meta-.': 'symbols-view:go-to-declaration' 'body': 'ctrl-J': 'symbols-view:toggle-project-symbols' Template.admin.servers = -> servers.find() Template.admin.events "click .servt tr": -> Router.go Router.routes["adminServer"].path {id: @_id} Template.adminServer.events "click .sdBtn": -> id = @_id console.log "Requesting host shutdown for "+id Meteor.call "shutdownHost", id, (err, res)-> if err? $.pnotify title: "Failed to Shutdown Host" text: err.reason type: "error" else $.pnotify title: "Command Sent" text: "Server told to shut down." type: "success" {div, img} = React.DOM module.exports = React.createClass displayName: 'ProtoNode' componentDidMount: -> $(@refs.node.getDOMNode()).draggable drag: @doMove revert: true helper: 'clone' revertDuration: 0 opacity: 0.35 appendTo: 'body' zIndex: 1000 doMove: -> undefined onClick: -> @props.onNodeClicked? @props.image render: -> defaultImage = "img/nodes/blank.png" imageUrl = if @props.image?.length > 0 then @props.image else defaultImage (div {className: 'proto-node', ref: 'node', onClick: @onClick, 'data-node-key': @props.key, 'data-image': @props.image, 'data-title': @props.title}, (div {className: 'img-background'}, (img {src: imageUrl}) ) ) class Workbench.Views.DatastreamChartView extends Backbone.View initialize: -> render: -> @chart = @$el.GeocensChart datastream: @model this module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: compile: files: 'select.js': 'select.coffee' 'docs/welcome/js/welcome.js': 'docs/welcome/coffee/welcome.coffee' watch: coffee: files: ['*.coffee', 'sass/*', 'docs/**/*'] tasks: ['coffee', 'uglify', 'compass'] uglify: select: src: 'select.js' dest: 'select.min.js' options: banner: '/*! select.js <%= pkg.version %> */\n' compass: dist: options: sassDir: 'sass' cssDir: 'css' welcomeDocs: options: sassDir: 'docs/welcome/sass' cssDir: 'docs/welcome/css' bower: install: options: targetDir: 'deps' cleanup: true layout: 'byComponent' bowerOptions: forceLatest: true production: true grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.loadNpmTasks 'grunt-bower-task' grunt.registerTask 'default', ['bower', 'coffee', 'uglify', 'compass'] path = require 'path' require 'LiveScript' module.exports = (grunt) -> gruntConfig = pkg: grunt.file.readJSON 'package.json' grunt.file.expand( {filter: 'isFile'}, ['./grunt/config/**', './grunt/userconfig/**'] ).forEach (filename) -> key = path.basename filename, '.ls' gruntConfig[key] = require filename grunt.initConfig gruntConfig (require 'load-grunt-tasks')(grunt) grunt.loadTasks 'grunt/tasks' j = @jasmine.getEnv() j.describe "circle test suite", -> j.it 'should increment a variable', -> @expect(1).toEqual 1 { SHOW, ARTWORKS } = require('sharify').data PartnerShow = require '../../../models/partner_show.coffee' ShareView = require '../../../components/share/view.coffee' initCarousel = require '../../../components/merry_go_round/index.coffee' ArtworkColumnsView = require '../../../components/artwork_columns/view.coffee' attachFollowArtists = require '../components/follow_artists/index.coffee' attachFollowProfile = require '../components/follow_profile/index.coffee' module.exports.init = -> show = new PartnerShow SHOW show.related().artworks.reset ARTWORKS initCarousel $('.js-show-installation-shot-carousel') artworkColumnsView = new ArtworkColumnsView el: $('.js-show-artworks-columns') collection: show.related().artworks numberOfColumns: 3 gutterWidth: 80 maxArtworkHeight: 400 isOrdered: true seeMore: false allowDuplicates: true artworkSize: 'large' artworkColumnsView.$el.addClass 'is-fade-in' attachFollowArtists show.related().artists attachFollowProfile show.related().profile new ShareView el: $('.js-show-share') {Subscriber} = require 'emissary' module.exports = -> findAndReplace = atom.packages.getLoadedPackage('find-and-replace') minimap = atom.packages.getLoadedPackage('minimap') minimapInstance = require (minimap.path) class MinimapFindResultsView Subscriber.includeInto(this) constructor: (@model) -> @subscribe @model, 'updated', @markersUpdated atom.workspaceView.on 'pane-container:active-pane-item-changed', => @activePaneItemChanged() @decorationsByMarkerId = {} destroy: -> @unsubscribe() @destroyDecorations() @decorationsByMarkerId = {} destroyDecorations: -> decoration.destroy() for id, decoration of @decorationsByMarkerId getMinimap: -> minimapInstance.getActiveMinimap() markersUpdated: (markers) => minimap = @getMinimap() return unless minimap? for marker in markers decoration = minimap.decorateMarker(marker, type: 'highlight', scope: '.minimap .search-result') @decorationsByMarkerId[marker.id] = decoration activePaneItemChanged: -> @destroyDecorations() setImmediate => @markersUpdated(@model.markers) exports.config = # See http://brunch.io/#documentation for docs. files: javascripts: joinTo: 'javascripts/app.js': /^app/ 'javascripts/vendor.js': /^vendor/ 'test/javascripts/test.js': /^test[\\/](?!vendor)/ 'test/javascripts/test-vendor.js': /^test[\\/](?=vendor)/ order: # Files in `vendor` directories are compiled before other files # even if they aren't specified in order.before. before: [ 'vendor/scripts/console-polyfill.js', 'vendor/scripts/jquery-1.9.1.js', 'vendor/scripts/lodash-1.2.0.js', 'vendor/scripts/backbone-1.0.0.js' ] after: [ 'test/vendor/scripts/test-helper.js' ] stylesheets: joinTo: 'stylesheets/app.css': /^(app|vendor)/ 'test/stylesheets/test.css': /^test/ order: after: ['vendor/styles/helpers.css'] templates: joinTo: 'javascripts/app.js' coffeelint: options: max_line_length: level: "ignore" `import startApp from '../helpers/start-app';` acceptance = (suiteName) -> App = null suite "Acceptance: #{suiteName}", setup: -> App = startApp() teardown: -> Ember.run(App, 'destroy') `export default acceptance;` _ = require 'underscore' Q = require 'q' Backbone = require 'backbone' { SESSION_ID, API_URL } = require('sharify').data Relations = require './mixins/relations/collector_profile.coffee' module.exports = class CollectorProfile extends Backbone.Model _.extend @prototype, Relations url: "#{API_URL}/api/v1/me/collector_profile" defaults: session_id: SESSION_ID fetch: (options = {}) -> options.data = _.extend options.data or {}, @pick('anonymous_session_id'), session_id: SESSION_ID super options instantiate: (options = {}) -> { success, error } = options options = _.omit options, 'success', 'error' Q.promise (resolve, reject) => @fetch _.extend {}, options, success: -> resolve arguments... success? arguments... error: => @save {}, success: -> resolve arguments... success? arguments... error: -> reject arguments... error? arguments... {Range} = require 'atom' BubbleView = require './bubble-view' class Bubble constructor: (@linter) -> @bubble = null update: (point) -> @remove() return unless @linter.view.messages.length textEditor = @linter.activeEditor found = false @linter.view.messages.forEach (message) => return if found return unless message.currentFile return unless message.position p = message.position errorRange = new Range([p[0][0] - 1, p[0][1] - 1], [p[1][0] - 1, p[1][1]]) return unless errorRange.containsPoint point marker = textEditor.markBufferRange errorRange, {invalidate: 'never'} @bubble = textEditor.decorateMarker marker, type: 'overlay', item: BubbleView(@linter, message) found = true remove: -> @bubble?.destroy() module.exports = Bubble V = Visualizer N = V.ReactNodes rootEvaluators = R.mapObjIndexed( ({useScheduler, getDefaultArgs}, key) -> (input) -> R.always( "Rx.Observable.#{key}(" + (if getDefaultArgs then input else '') + (if useScheduler then (if getDefaultArgs then ', scheduler)' else 'scheduler)') else ')') ) )(N.Roots) operatorEvaluators = R.mapObjIndexed( ({useScheduler, recursive, getDefaultArgs, recursionType}, key) -> (input) -> if recursive (innerObservable) -> switch recursionType when "function" then ".#{key}(#{input}#{innerObservable}})" when "observable" then ".#{key}(#{innerObservable})" when "observableWithSelector" then ".#{key}(#{innerObservable}, #{input})" else R.always(".#{key}(#{input || ''}#{useScheduler && ', scheduler' || ''})") )(N.Operators) evalRoot = ({id, type, args}) -> getCode: rootEvaluators[type](args) id: id evalOperator = ({id, type, args, observable}) -> id: id getCode: operatorEvaluators[type](args) observable: observable && V.evaluateInput(observable) V.evaluateInput = ({root, operators}) -> root: evalRoot(root) operators: operators.map evalOperator getQueryParam = (variable, defaultValue) -> query = location.search.substring(1) vars = query.split('&') for v in vars pair = v.split('=') if pair[0] == variable return decodeURIComponent(pair[1]) return defaultValue or false getConfigData = () -> options = { forecastAPIKey: $('#forecastAPIKey').val() } localStorage['forecastAPIKey'] = options.forecastAPIKey options $(document).ready -> if localStorage['forecastAPIKey'] $('#forecastAPIKey').val(localStorage['forecastAPIKey']) $('#cancelButton').click -> document.location = 'pebblejs://close' $('#submitButton').click -> return_to = getQueryParam('return_to', 'pebblejs://close#') return_val = encodeURIComponent(JSON.stringify(getConfigData())) document.location = return_to + return_val null fs = require 'fs' path = require 'path' delegate = require 'atom_delegate' optimist = require 'optimist' coffeeScript = require 'coffee-script' atomApplication = null delegate.browserMainParts.preMainMessageLoopRun = -> commandLineArgs = parseCommandLine() require('module').globalPaths.push(path.join(commandLineArgs.resourcePath, "src")) AtomApplication = require('atom-application') atomApplication = new AtomApplication(commandLineArgs) getHomeDir = -> process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] parseCommandLine = -> args = optimist(process.argv[1..]).argv executedFrom = args['executed-from'] pathsToOpen = if args._.length > 0 then args._ else null testMode = true if args['test'] version = String fs.readFileSync(path.join(__dirname, '..', '..', 'version')) if args['resource-path'] resourcePath = args['resource-path'] else if args['dev'] resourcePath = path.join(getHomeDir(), 'github/atom') try fs.statSync resourcePath catch e resourcePath = path.dirname(__dirname) {resourcePath, executedFrom, pathsToOpen, testMode, version} FactlinkJailRoot.contentBox = (element) -> $element = $(element) offset = $element.offset() top: offset.top + parseInt window.getComputedStyle(element)['padding-top'] left: offset.left + parseInt window.getComputedStyle(element)['padding-left'] width: $element.width() height: $element.height() window.App.pendingUploads = 0; window.App.successfulUploads = []; $ -> fetch_tree_for_path = (url) -> alert("Fetching!") success = (data) -> $("#tree-view").html(data) $.get url, null, success, 'html' $("#tree-view").on("click", "#tree-view td.node a", () -> fetch_tree_for_path($(this).data("url"))) fetch_tree_for_path("/repositories/test2/trees/master") window.App.functions.sendAddCommitRequest = (files, path) -> $("#main").append($("#commit-request-dialog")) action = gon.commit_request_path request = method: "add" request.files = ({id: file.id, to:[path, file.name].join("/")} for file in files) console.log(request) success = (data) -> $("#commit-request-dialog h1").text("Done!") $.ajax action, type: "POST", data: request, success: successes = require 'event-stream' glob = require 'glob' module.exports = create: (globb, opt={}) -> throw new Error "Invalid or missing glob string" unless typeof globb is 'string' opt.silent ?= true opt.nonull ?= false stream = es.pause() globber = new glob.Glob globb, opt globber.on 'error', (e) -> stream.emit 'error', e globber.on 'end', -> stream.emit 'end' globber.on 'match', (filename) -> stream.emit 'data', filename return streamhelpers = require 'atom-linter' { BufferedProcess } = require 'atom' executablePath = "jolie" pattern = ".+:\\s*(?[^:]+):\\s*(?\\d+):\\s*(?error|warning)\\s*:(?.+)" module.exports = config: {} activate: -> require( "atom-package-deps" ).install( "linter-jolie" ); provideLinter: -> provider = grammarScopes: [ "source.jolie" ] scope: "file" lintOnFly: true lint: ( editor ) -> return helpers.exec( executablePath, [ "--check", editor.getPath() ], { stream: "both" } ).then ( data ) -> helpers.parse( data.stderr, pattern, { filePath: editor.getPath() } ) .map ( issue ) -> [ [ lineStart, colStart ], [ lineEnd, colEnd ] ] = issue.range issue.range = helpers.rangeFromLineNumber editor, lineStart, colStart return issue hrtime = process.hrtime module.exports = -> (getNanoSeconds() - loadTime) / 1e6 getNanoSeconds = -> hr = hrtime() hr[0] * 1e9 + hr[1] loadTime = getNanoSeconds()_ = require "underscore" moment = require "moment" Octokat = require "octokat" Config = require "../config" PullRequest = require "./pullrequest" Utils = require "../utils" octo = new Octokat token: Config.github.token class PullRequests constructor: (prs) -> @prs = (new PullRequest p for p in prs) @fromKey: (key) -> octo.search.issues.fetch q: "#{key} @#{Config.github.organization} state:open" .then (json) -> return Promise.all json.items.map (issue) -> octo.fromUrl(issue.pullRequest.url).fetch() if issue.pullRequest?.url .then (issues) -> new PullRequests _(issues).compact() toAttachment: -> attachments = (pr.toAttachment() for pr in @prs) Promise.all attachments module.exports = PullRequests require '../src/ext/svg-circle' require '../src/ext/svg-draggable' require '../src/ext/svg-export' beforeEach -> jasmine.addMatchers toShow: -> compare: (actual) -> {passed: actual.css('display') != 'none'} toHide: -> compare: (actual) -> {passed: actual.css('display') != 'none'} Marionette = require 'backbone.marionette' TodoLayout = require './views/layout/layout' class TodoModule extends Marionette.Module initialize: -> this.todoRegionId = 'todo-region' onStart: -> this._createContainer() this._addRegion() this._addLayout() onStop: -> this._removeRegion() this._destroyContainer() _createContainer: -> node = document.createElement 'div' node.id = this.todoRegionId document.body.appendChild node _addRegion: -> this.app.addRegions todoRegion: '#' + this.todoRegionId _addLayout: () -> this.app.todoRegion.show(new TodoLayout) _destroyContainer: -> node = document.getElementById(this.todoRegionId) node?.parentElement.removeChild node _removeRegion: -> this.app.removeRegion 'todoRegion' module.exports = TodoModule Darkswarm.controller "OffcanvasCtrl", ($scope, $window) -> $scope.menu = $(".left-off-canvas-menu") $scope.setOffcanvasMenuHeight = -> $scope.menu.height($(window).height()) $scope.bind = -> $(window).on("resize", $scope.setOffcanvasMenuHeight) $scope.setOffcanvasMenuHeight() $scope.bind() http = require('http') http.globalAgent.maxSockets = 300 module.exports = internal: packageindexer: port: 3022 host: "localhost" mongo: url: 'mongodb://127.0.0.1/sharelatex' window.InteractionWebTools ||= {} window.InteractionWebTools.Chat ||= {} jQuery -> @chatClient = new InteractionWebTools.Chat.Client InteractionWebTools.Chat.instance = @chatClient $(document).on 'click', '.chat > .controls > a.open', => @chatClient.open() false $(document).on 'click', '.chat > .controls > a.close', => @chatClient.close() false $(document).on 'click', '.chat-messages a.start', => @chatClient.startChat(true) false $(document).on 'submit', 'form.chat-message-form', (e) => input = $(e.target).find('textarea[name=content]') @chatClient.send input.val() input.val '' false $(document).on 'keydown', 'textarea.chat-message-input', (e) -> if (e.keyCode == 10 || e.keyCode == 13) return true if (e.shiftKey) $(e.target).parents('form').first().trigger('submit') false $(document).on 'beforeunload', 'hmtl', (e) => @chatClient.terminateChat()Chamber.Views.Rooms ||= {} class Chamber.Views.Rooms.ShowView extends Backbone.View template: JST["backbone/templates/rooms/show"] events: { "click input[type=submit]": "doSubmit", } initialize: -> @messages_index_view = new Chamber.Views.Messages.IndexView( { el: $("#messages", @el) messages: @options.messages } ) @participants_index_view = new Chamber.Views.Participants.IndexView( { el: $("#participants", @el) participants: @options.participants } ) doSubmit: (e) -> # Get the body of the message from the input input = $("#body") body = input.val() # Create a new message @options.messages.create({ body: body, room_id: room.id, }, { silent: true, success: -> # Clear the input field input.val('') }) e.preventDefault() return false express = require 'express' app = module.exports = express() to = require './to' app.get '/filter/artworks', to '/browse' app.get '/filter/artworks/*', to '/browse' app.get '/genes', to '/categories' app.get '/partner-application', to '/apply' app.get '/fair-application', to '/apply/fair' app.get '/fairs', to 'art-fairs' app.get '/feature/art-fairs', to 'art-fairs' app.get '/settings', to '/user/edit' app.get '/_=_', to '/' # Facebook passport bug, see: https://github.com/jaredhanson/passport-facebook/issues/12#issuecomment-5913711 app.get '/press', to '/press/press-releases' app.get '/about/press', to '/press/press-releases' app.get '/about/events', to '/press/in-the-media' app.get '/about/jobs', to '/jobs' !/usr/bin/env coffee exports.command = description: 'Build a tangle app' if require.main is module path = require 'path' grunt = require 'grunt' grunt.cli gruntfile: path.join(__dirname, '..', 'subcommands', 'build', 'index.coffee') base: process.cwd() require('./styles/index.scss') require('leaflet/dist/leaflet.css') require('leaflet') document.addEventListener('DOMContentLoaded', -> map = L.map('map').setView([25.1701, 121.5948], 13) L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', attribution: '© OpenStreetMap contributors' ).addTo(map) map.on('click', (ev) -> fetch("http://overpass-api.de/api/interpreter?data=[out:json];node[name=\"Gielgen\"];out;") .then((response) -> response.text()) .then((body) -> debugger) ) ) ETahi.AuthorsOverlayController = ETahi.TaskController.extend resolvedPaper: null _setPaper: ( -> @get('paper').then (paper) => @set('resolvedPaper', paper) ).observes('paper') actions: addAuthorGroup: -> newAuthorGroup = @store.createRecord('authorGroup', {}) newAuthorGroup.set('paper', @get('resolvedPaper')) newAuthorGroup.save() removeAuthorGroup: -> lastAuthorGroup = @get('resolvedPaper.authorGroups.lastObject') if !lastAuthorGroup.get('authors.length') lastAuthorGroup.destroyRecord() fs = require 'fs' _ = require 'underscore' module.exports = loadPaths: (rootPath, ignoredNames, excludeGitIgnoredPaths) -> if excludeGitIgnoredPaths Git = require 'git' repo = Git.open(rootPath, refreshIndexOnFocus: false) paths = [] isIgnored = (path) -> for segment in path.split('/') return true if _.contains(ignoredNames, segment) repo?.isPathIgnored(fs.join(rootPath, path)) onFile = (path) -> paths.push(path) unless isIgnored(path) onDirectory = (path) -> not isIgnored(path) fs.traverseTree(rootPath, onFile, onDirectory) repo?.destroy() callTaskMethod('pathsLoaded', paths) module.exports = _id: '_design/repos' languange: 'javascript' views: by_watchers: map: (doc) -> emit doc.watchers, doc.description if doc.watchers by_language: map: (doc) -> emit doc.languange, doc.description if doc.languange by_prefix: map: (doc) -> return unless doc.type is "repo" # emit all prefixes of name for c, i in doc.name emit [doc.name.substr(0, i), doc.watchers], doc.description # emit all prefixes of owner for c, i in doc.owner prefix = doc.owner.substr(0, i) emit [prefix, doc.watchers], doc.description # emit all combined prefixes for d, j in doc.name emit [prefix + '/' + doc.name.substr(0,j), doc.watchers], doc.description lists: complete: (head, req) -> start headers: { 'Content-Type': 'text/plain' } while row = getRow() send "#{row.id.replace(':', '/')} (#{row.key[1]}) #{row.value}\n" return define [ 'chai' 'underscore' 'controllers' ], (chai, _, controllers) -> chai.should() describe 'Index controller', => it 'should set not authentication status', => scope = {} window.isAuthenticated = false controllers.IndexCtrl scope scope.isAuthenticated.should.be.false it 'should set authentication status', => scope = {} window.isAuthenticated = true controllers.IndexCtrl scope scope.isAuthenticated.should.be.true it 'should prepare statistic chart', => scope = {} window.successTasks = 10 window.failedTasks = 5 controllers.IndexCtrl scope scope.successPercent.should.be.equal 10 scope.failedPercent.should.be.equal 5 describe 'Dashboard controller', => http = get: -> success: (callback) -> callback.call null, objects: 'test' tasks = -> {load: -> @} it 'should fill projects', => scope = {} controllers.DashboardCtrl scope, http, tasks scope.projects.should.be.equal 'test' {File} = require 'file-utils' class LocaleTempFileRepository items : null constructor : (@items = []) -> setInterval (=> @gc()), 60000 gc : -> console.log 'LocaleTempFileRepository.gc' now = new Date() validUntil = now - 60 for id, item in @items when item.created < validUntil console.log "LocaleTempFileRepository.gc >> Deleting #{@items[id].filePath}" new File(@items[id]).delete() @items[id] = null return add : (id) -> @items[id] = filePath : new File(id).getAbsolutePath() created : new Date() remove : (id) -> if @items[id] new File(@items[id].filePath).delete() return exist : (id) -> @items[id] isnt undefined get : (id) -> if @exist id @items[id].filePath exports.LocaleTempFileRepository = LocaleTempFileRepositoryDarkswarm.directive "pageView", -> restrict: "C" require: "^^pagesetCtrl" template: "
    " scope: templates: "=" link: (scope, element, attrs, ctrl) -> scope.template = null ctrl.registerSelectionListener (prefix, selection) -> if selection? selection = "#{prefix}/#{selection}" if prefix? scope.template = "#{selection}.html" else scope.template = null config = require './config' module.exports = (app, passport) -> isLoggedIn = app.middlewares.auth.isLoggedIn isNotLoggedIn = app.middlewares.auth.isNotLoggedIn setLocals = app.middlewares.auth.setLocals errorHandlers = app.middlewares.error app.get '/login', isNotLoggedIn, app.controllers.sessions.new app.post '/login', isNotLoggedIn, app.controllers.sessions.create(passport) app.get '/signup', isNotLoggedIn, app.controllers.users.new app.post '/signup', isNotLoggedIn, app.controllers.users.create(passport) app.get '/forgot', isNotLoggedIn, app.controllers.forgot.showEmailForm app.post '/forgot', isNotLoggedIn, app.controllers.forgot.sendMail app.get '/reset/:token', isNotLoggedIn, app.controllers.forgot.showNewPasswordForm app.post '/reset/:token', isNotLoggedIn, app.controllers.forgot.saveNewPassword app.all '*', isLoggedIn app.all '*', setLocals app.get '/', app.controllers.home.index app.post '/logout', app.controllers.sessions.destroy app.use errorHandlers.notFound app.use errorHandlers.internalError "title": "Your Blog title" "api": "baseUrl": "http://dev.julienrenaux.fr/wp-json" "timeout": 10000 "maxAttempt": 3 "translation": # "displayed" : ["en", "fr"] # "prefered": "en" "cordova": "pushNotifications": "enabled": false "baseUrl": "http://yourDomain.com/pnfw" "android": "senderID": "" all = require('../../src') tasks = { clean: () -> all.task.clean() build: () -> all.task.library({ library: { isPlugin: true dependencies: [ { param: 'ko' name: 'knockout' } { param: 'isAn' name: 'is-an' } ] } }) } all.task.exportTasks(tasks) define (require) -> $ = require('jquery') BaseView = require('cs!helpers/backbone/views/base') BookPopoverView = require('cs!./popovers/book/book') template = require('hbs!./header-template') require('less!./header') return class MediaHeaderView extends BaseView template: template templateHelpers: () -> currentPage = @model.get('currentPage') currentPage.encodedTitle = encodeURI(currentPage.get('title')) return {currentPage: currentPage.toJSON()} initialize: () -> super() @listenTo(@model.get('currentPage'), 'change', @render) onRender: () -> @attachPopover new BookPopoverView owner: @$el.find('.info .btn') content: @model.toJSON() class Recipes.ListenToYourHeart extends Recipes.Bitly generateSteps: -> position = 1 @generateStep( key: "GoogleChooseAvatar" , $setOnInsert: cls: "GoogleChooseAvatar" api: "Google" scopes: ["https://www.googleapis.com/auth/drive", "https://spreadsheets.google.com/feeds"] $set: position: position++ ) @generateStep( key: "Echo" , $setOnInsert: cls: "Echo" $set: position: position++ ) input: (step) -> switch step.key when "ListenToYourHeart" steps = @stepsByKey() input = ListenToYourHeart: GoogleWriteSpreadsheets: avatarId: steps["GoogleChooseAvatar"].avatarId params: {} BitlyDownloadLinks: avatarId: steps["BitlyChooseAvatar"].avatarId params: {} GoogleWriteSpreadsheetCells: avatarId: steps["GoogleChooseAvatar"].avatarId params: {} else throw new Meteor.Error "Recipe:unknown-step-cls", "Can't generate input for unknown step cls '#{step.cls}'", recipe: @ step: step input progressBars: (step) -> switch step.key when "ListenToYourHeart" progressBars = @generateProgressBars [ "Echo" ], [ "Echo" ] else throw new Meteor.Error "Recipe:unknown-step-cls", "Can't generate progress bars for unknown step cls '#{step.cls}'", recipe: @ step: step progressBars require 'atom' {runSpecSuite} = require 'jasmine-helper' document.title = "Spec Suite" runSpecSuite "spec-suite" React = require 'react' talkClient = require '../api/talk' apiClient = require '../api/client' Paginator = require '../talk/lib/paginator' SubjectViewer = require '../components/subject-viewer' PromiseRenderer = require '../components/promise-renderer' {Navigation} = require 'react-router' module?.exports = React.createClass displayName: 'CollectionShowList' mixins: [Navigation] getInitialState: -> page: 1 # start on page 1 subjectsRequest: -> # TODO Fix this on the backend should be able to do @state.collection.get('subjects') apiClient.type('subjects').get(collection_id: @props.collection.id, page: @state.page) goToPage: (n) -> @transitionTo(@props.path, @props.params, {page: n}) @setState(page: n) subject: (sub) -> render: ->
    {(subjects) =>
    {subjects?.map(@subject)}
    }
    # Selects all options of a multi-select box belonging to a optgroup, when # clicking on the optgroup label. init_group_selectable = (select) -> chosen = select.next() chosen.on 'click', '.group-result', (e) -> target = $(e.target) group_name = target.text() options = select.find('optgroup[label="' + group_name + '"]').children() options.attr('selected', 'selected') select.trigger('chosen:updated') $ -> $('.ui-components-select').each -> $this = $(this) data = $this.data() data.search_contains = true $this.chosen data # Append help-block to parent .form-group element $formGroup = $this.closest('.form-group') $formGroup.css('position', 'relative') $helpBlock = $formGroup.find('.help-block') $helpBlock.css('position', 'absolute') $helpBlock.css('top', '1.6em') $helpBlock.css('left', '3em') init_group_selectable($this) if data.remoteOptions $this.ajaxChosen type: 'GET' url: data.remoteOptions dataType: 'json' expect = require('chai').expect Phone = require('../../src/script/Phone') canada = require('../../src/script/countries/CAN') describe 'Canada', -> describe 'Should get', -> number = '' afterEach -> # Act result = Phone.getPhoneInternational(number) # Assert expect(result.valid).to.be.true expect(result.countryNameAbbr).to.equal('CAN') it 'a number', -> # Arrange number = "+1 204 9898656" describe 'Should validate a', -> number = '' afterEach -> # Act result = Phone.validate(number) # Assert expect(result).to.be.true it 'number', -> # Arrange number = "+1 204 9898656" describe 'Utility method', -> it 'should get the country code given the abbr', -> countryCode = Phone.getCountryCodeByNameAbbr('CAN') expect(countryCode).to.equal('1') noflo = require 'noflo' uuid = require 'uuid' iframeAddress = 'https://noflojs.org/noflo-browser/everything.html?fbp_noload=true&fbp_protocol=iframe' ensureOneIframeRuntime = (runtimes) -> for runtime in runtimes # Check that we don't have the iframe runtime already if runtime.protocol is 'iframe' and runtime.address is iframeAddress # Update 'last seen' property runtime.seen = new Date return runtime iframeRuntime = label: 'NoFlo HTML5 environment' id: uuid() protocol: 'iframe' address: 'https://noflojs.org/noflo-browser/everything.html?fbp_noload=true&fbp_protocol=iframe' type: 'noflo-browser' seen: Date.now() return iframeRuntime exports.getComponent = -> c = new noflo.Component c.inPorts.add 'in', datatype: 'array' c.outPorts.add 'out', datatype: 'object' noflo.helpers.WirePattern c, async: true forwardGroups: false , (data, groups, out, callback) -> data = [] unless data iframeRuntime = ensureOneIframeRuntime data if iframeRuntime out.send iframeRuntime do callback _ = require 'underscore' BufferedProcess = require 'buffered-process' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) command = require.resolve 'nak' args = ['--list', rootPath] args.unshift('--addVCSIgnores') if config.get('core.excludeVcsIgnoredPaths') args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0 args.unshift('--follow') paths = [] exit = (code) => if code is 0 @callback(paths) else @callback([]) stdout = (data) -> paths.push(_.compact(data.split('\n'))...) @process = new BufferedProcess({command, args, stdout, exit}) abort: -> if @process? @process.kill() @process = null Sprangular.directive 'creditCardForm', -> restrict: 'E' templateUrl: 'credit_cards/form.html' scope: creditCard: '=' controller: ($scope, $locale) -> $scope.months = _.map $locale.DATETIME_FORMATS.MONTH, (month, index) -> {"index": index, "name": month} currentYear = (new Date).getFullYear() $scope.years = [currentYear .. currentYear+15] $scope.$watch 'creditCard.number', (number) -> return unless number $scope.creditCard.lastDigits = number.substr(-4) $scope.creditCard.determineType() FactlinkJailRoot.createFactFromSelection = (current_user_opinion) -> success = -> window.document.getSelection().removeAllRanges() FactlinkJailRoot.createButton.hide() FactlinkJailRoot.off 'modalOpened', success selInfo = text: window.document.getSelection().toString() title: window.document.title text = selInfo.text siteUrl = FactlinkJailRoot.siteUrl() siteTitle = selInfo.title FactlinkJailRoot.on 'modalOpened', success FactlinkJailRoot.factlinkCoreEnvoy 'prepareNewFactlink', text, siteUrl, siteTitle, current_user_opinion FactlinkJailRoot.textSelected = -> # At least 4 words of at least 2 characters /(\w{2,}[\s-_&\/#%.,;:!()]+){4}/.test window.document.getSelection().toString() $(document).on "turbolinks:load", -> $('div.calendar').calendar() $('.calendar_range_start').calendar endCalendar: $('.calendar_range_end'), type: 'date' $('.calendar_range_end').calendar startCalendar: $('.calendar_range_start'), type: 'date' $('.ui.accordion').accordion() $('.ui.dropdown').dropdown action: 'hide' $('select.dropdown').dropdown() $('#calendar').fullCalendar firstDay: '1', eventSources: [ '/calendars.json' ], timeFormat: 'H:mm', displayEventEnd: 'true', eventRender: (event, element) -> element.qtip content: { title: { text: event.title }, text: event.description }, position: { my: 'center center', at: 'top center' }, style: { classes: 'qtip-green qtip-shadow qtip-rounded' } return {APLArray} = require '../array' @['⊃'] = (omega, alpha) -> if alpha # Pick (`⊃`) # # ⍬⊃3 <=> 3 # 2⊃'PICK' <=> 'C' # 1 0⊃2 2⍴'ABCD' <=> 'C' # 1⊃'foo' 'bar' <=> 'bar' if alpha.shape.length > 1 throw RankError pick = alpha.toArray() if pick.length isnt omega.shape.length throw RankError omega.get pick else # Disclose (`⊃`) # # ⊃(1 2 3)(4 5 6) <=> 1 2 3 # ⊃(1 2)(3 4 5) <=> 1 2 # ⊃'AB' <=> 'A' # ⊃123 <=> 123 # ⊃⍬ <=> 0 #! ⊃'' <=> ' ' if omega.empty() return APLArray.zero pick = [] x = omega.get pick if x instanceof APLArray then x else APLArray.scalar x BaseViewer = require './base-viewer' {is_dir} = require '../ltutils' {execSync} = require 'child_process' path = require 'path' module.exports = class SkimViewer extends BaseViewer _getArgs = (opts = {}) -> args = ["-r"] args.push "-g" if opts?.keepFocus args forwardSync: (pdfFile, texFile, line, col, opts = {}) -> args = _getArgs opts command = '/Applications/Skim.app' if not is_dir(command) try command = execSync( 'osascript -e "POSIX path of (path to app id \\"net.sourceforge.skim-app.skim\\")"' ).toString().replace /^\s+|\s+$/g, '' catch error atom.notifications.addError( 'Cannot find Skim.app' + ' on your system. Please ensure that Skim is installed before' + ' attempting to run the viewer.' dismissable: true ) return command = path.join command, 'Contents/SharedSupport/displayline' args.unshift command args.push line, "#{pdfFile}", "#{texFile}" @runViewer args viewFile: (pdfFile, opts = {}) -> args = _getArgs opts command = path.join( atom.packages.resolvePackagePath("latextools"), "lib/displayfile" ) args.unshift command args.push "\"#{pdfFile}\"" @runViewer args module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: compile: files: 'select.js': 'select.coffee' 'docs/welcome/js/welcome.js': 'docs/welcome/coffee/welcome.coffee' watch: coffee: files: ['*.coffee', 'sass/*', 'docs/**/*'] tasks: ['coffee', 'uglify', 'compass'] uglify: select: src: 'select.js' dest: 'select.min.js' options: banner: '/*! select.js <%= pkg.version %> */\n' compass: dist: options: sassDir: 'sass' cssDir: 'css' welcomeDocs: options: sassDir: 'docs/welcome/sass' cssDir: 'docs/welcome/css' bower: install: options: targetDir: 'deps' cleanup: true layout: 'byComponent' bowerOptions: forceLatest: true production: true grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.loadNpmTasks 'grunt-bower-task' grunt.registerTask 'default', ['coffee', 'uglify', 'compass', 'bower'] module.exports = (grunt) -> files = [ 'src/*.coffee' ] grunt.initConfig pkg: grunt.file.readJSON 'package.json' watch: coffee: files: files tasks: ['default'] coffee: build: options: join: true files: 'tweenmachine.js': files uglify: production: files: 'tweenmachine.min.js': ['tweenmachine.js'] clean: js: ['tweenmachine.js', 'tweenmachine.min.js'] grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-clean' grunt.registerTask 'build:development', ['coffee:build'] grunt.registerTask 'build:production', ['coffee:build', 'uglify:production'] grunt.registerTask 'default', ['build:production'] # coffeelint: disable=no_empty_functions _ = require 'underscore' flux = require 'flux-react' {CourseActions, CourseStore} = require './course' {CrudConfig, makeSimpleStore, extendConfig} = require './helpers' LOADING = 'loading' LOADED = 'loaded' FAILED = 'failed' CourseListingActions = flux.createActions [ 'load' 'loaded' 'reset' ] CourseListingStore = flux.createStore actions: _.values(CourseListingActions) _asyncStatus: null load: -> # Used by API @_asyncStatus = LOADING @emit('load') reset: -> @_course_ids = [] CourseActions.reset() @_asyncStatus = null @emitChange() loaded: (courses) -> @_course_ids = _.map courses, (course) -> CourseActions.loaded(course, course.id) course.id # Store only the ids @_asyncStatus = LOADED @emit('loaded') exports: isLoading: -> @_asyncStatus is LOADING isLoaded: -> @_asyncStatus is LOADED isFailed: -> @_asyncStatus is FAILED # Loads the store if it's not already loaded or loading # Returns false if the store is already loaded, true otherwise ensureLoaded: -> if @_asyncStatus is LOADED false else CourseListingActions.load() unless @_asyncStatus is LOADING true allCourses: -> return _.map @_course_ids, CourseStore.get module.exports = {CourseListingActions, CourseListingStore} "*": core: disabledPackages: [ "background-tips" "exception-reporting" "metrics" ] followSymlinks: false hideGitIgnoredFiles: true ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" "vendor" ] themes: [ "unity-ui" "glacier-syntax" ] editor: fontFamily: "Menlo" invisibles: {} showIndentGuide: true softWrapAtPreferredLineLength: true "go-plus": goPath: "/Users/holman/Code/go" "release-notes": viewedVersion: "0.89.0" "spell-check": grammars: [ "text.plain" "source.gfm" "text.git-commit" "text.html.basic" ] welcome: showOnStartup: false path = require "path" runas = require "runas" module.exports = activate: -> atom.workspaceView.command "latex:build", => @build() build: -> editor = atom.workspace.activePaneItem # console.debug editor file = editor.buffer.file # console.debug file if file? # file = editor.getUri() dir = path.dirname(file.path) outdir = path.join(dir, "output") # console.debug outdir code = runas("/usr/texbin/latexmk", ["--pdf", "--f", "--interaction=nonstopmode", "--outdir=#{outdir}", file.path]) # console.debug code class KeypathObserver constructor: (@view, @model, @keypath, @callback) -> @interfaces = (k for k, v of @view.adapters) @objectPath = [] @tokens = Rivets.KeypathParser.parse @keypath, @interfaces, @view.config.rootInterface @root = @tokens.shift() @key = @tokens.pop() @target = @realize() update: => unless (next = @realize()) is @target @callback @target = next realize: => current = @view.adapters[@root.interface].read @view.models, @root.path for token, index in @tokens if @objectPath[index]? if current isnt prev = @objectPath[index] @view.adapters[token.interface].unsubscribe prev, token.path, @update @view.adapters[token.interface].subscribe current, token.path, @update @objectPath[index] = current else @view.adapters[token.interface].subscribe current, token.path, @update @objectPath[index] = current current = @view.adapters[token.interface].read current, token.path current 'menu': [ { 'label': 'View' 'submenu': [ { 'label': 'Toggle Git Panel' 'command': 'github:toggle-git-panel' } ] } { 'label': 'Packages' 'submenu': [ { 'label': 'GitHub', 'submenu': [ { 'label': 'Toggle' 'command': 'github:toggle-git-panel' } ] } ] } ] _ = require 'underscore' sd = require('sharify').data Backbone = require 'backbone' Item = require '../models/item.coffee' module.exports = class Items extends Backbone.Collection url: -> "#{sd.ARTSY_URL}/api/v1/set/#{@id}/items" model: (attrs, options) -> heuristicType = (attrs) -> return attrs.item_type if attrs.item_type? return 'Profile' if _.has attrs, 'cover_image' undefined switch heuristicType(attrs) when 'FeaturedLink' FeaturedLink = require '../models/featured_link.coffee' new FeaturedLink attrs, options when 'Profile' Profile = require '../models/profile.coffee' new Profile attrs, options else new Item attrs, options initialize: (models, options) -> { @id } = options super isFunction = require 'is-function' isObjectOrArray = require 'is-object' isArray = require 'is-array' ### when passed an object, returns an array of its keys. when passed an array, returns an array of its indexes. arrayify({a: 'aa', b: 'bb', c: 'cc'}) -> ['a', 'b', 'c'] arrayify(['one', 'two', 'three']) -> [1, 2, 3] ### arrayify = (obj) -> (key for key of obj) find = (haystack, needle, memo = []) -> if needle and isObjectOrArray(haystack) if needle of haystack memo.push haystack[needle] for key in arrayify(haystack) val = haystack[key] if isFunction(needle) needle(key, val) if isObjectOrArray(val) find(val, needle, memo) return memo module.exports = (obj, key) -> find obj, key fs = require 'fs' upnp = require 'upnp-server' Tag = require('taglib').Tag mediaServer = upnp.createDevice 'MediaServer', 'Bragi', (err, device, msg) -> throw err if err device.start (err) -> throw err if err fs.readdir dir, (err, files) -> for file in files try t = new Tag(dir + file) catch err console.log err finally media.children.push( title: t.title location: dir + file ) device.addMedia 0, media, (err, id) -> console.log id # See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': '.overlayer': 'Rename coffee-refactor': 'coffee-refactor:rename' 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'coffee-refactor' 'submenu': [ { 'label': 'Rename', 'command': 'coffee-refactor:rename' } ] ] } ] class ChatConversationListController extends CommonChatController constructor:-> super @getListView().on 'moveToIndexRequested', @bound 'moveItemToIndex' addItem:(data)-> # Make sure there is one conversation with same channel name {conversation, chatChannel} = data for chat in @itemsOrdered return if chat.conversation?.channel?.name is chatChannel?.name return if (conversation.invitees?.length or 1) < 2 super data loadItems:-> @removeAllItems() chatController = KD.getSingleton 'chatController' {JChatConversation} = KD.remote.api JChatConversation.fetchSome {}, (err, conversations)=> warn err if err for conversation in conversations chatController.addConversationToChatPanel \ conversation.publicName, conversation Space.messaging.define Space.messaging.Event, 'Space.accounts', UserCreated: { sourceId: Guid timestamp: Date username: Username email: EmailAddress password: Password } UserLoggedIn: { sourceId: Guid timestamp: Date via: String } UserLoginFailed: { sourceId: Guid timestamp: Date via: String error: String } spawn = require("child_process").spawn logger = require "logger-sharelatex" Settings = require "settings-sharelatex" module.exports = DockerRunner = _docker: Settings.clsi?.docker?.binary or 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd.push Settings.clsi?.docker?.image or "texlive" docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout () -> logger.warn "timeout achieved, stopping docker instance" proc = spawn 'docker', ['stop', "texlive-#{project_id}"] proc.on "close", -> callback timedout: true , timeout proc.on "close", () -> clearTimeout timer callback() sinos = require('../index') describe 'sinos-river-level-twitter', -> describe '#search', -> it 'is a function', -> expect(sinos.search).to.be.instanceof Function Spine = require 'spine' Api = require 'zooniverse/lib/api' User = require 'zooniverse/lib/models/user' class InteractiveSubject extends Spine.Model @configure 'InteractiveSubject', 'redshift', 'color', 'subject', 'classification', 'type' @fetch: ({random=false, limit, user=false}) => url = @url(random, limit, user) fetcher = Api.get url, @fromJSON @url: (random, limit, user) => if random url = '/projects/galaxy_zoo/user-groups/random-classifications' else if user url = "/projects/galaxy_zoo/user-groups/#{User.current.user_group_id}/classifications/user_recents' else url = '/projects/galaxy_zoo/user-groups/#{User.current.group}/classifications' if limit isnt 0 url = url + "?limit=#{limit}" return url @fromJSON: (json) => @lastFetch = new Array for result in json item = @create redshift: @result.metadata.redshift color: @result.metadata.color subject: @result.subject classification: @result.classification type: @findType(@result.subject) @lastFetch.push item @findType: (subject) => if subject.smooth > subject.feature and subject.smooth > subject.artifact return 'smooth' else if subject.feature > subject.smooth and subject.feature > subject.artifact return 'feature' else return 'artifact' module.exports = InteractiveSubject DotLedger.module 'Views.Reports.IncomeAndExpenses', -> class @Filter extends Backbone.Marionette.ItemView template: 'reports/income_and_expenses/filter' className: 'nav nav-pills nav-justified' tagName: 'ul' events: 'click .period a': 'clickPeriod' onRender: -> @$el.find(".period.period-#{@model.get('period')}-days").addClass('active') clickPeriod: (event)-> @model.set('period', $(event.target).data('period')) false # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # path = require 'path' oldWindowDimensions = {} oldThemes = [] atom.commands.add 'atom-workspace', 'custom:open-todo-list': -> todoList = path.join(process.env.HOME, 'Dropbox', 'todo', 'todo.txt') atom.workspace.open(todoList) atom.workspaceView.command 'custom:screenshot-prep', -> oldWindowDimensions = atom.getWindowDimensions() oldThemes = atom.config.get('core.themes') atom.setWindowDimensions 'width': 1024 'height': 768 atom.config.restoreDefault('core.themes') atom.workspaceView.command 'custom:screenshot-restore', -> atom.config.set('core.themes', oldThemes) atom.setWindowDimensions(oldWindowDimensions) React = require 'react' module.exports = React.createClass displayName: 'LoadingIndicator' render: -> # Description: # Listens for ac webhooks and post in chat # # Dependencies: # None # # Configuration: # None # # Commands: # None # # Notes: # None # # Author: # digitalsadhu module.exports = (robot) -> robot.router.get "/hubot/ac-webhooks", (req, res) -> robot.send "ac webhooks url hit!"vorpal = require 'vorpal' chalk = vorpal().chalk _ = require 'underscore' awkward = vorpal() .delimiter process.env.USER+'@awk' .localStorage 'awkward@iostreamer' .history 'awkward@iostreamer/history' global.chalk = chalk global.awkward = awkward global._ = _ require('./terminal/main')(awkward) awkward.exec 'repl' awkward.show().parse process.argv window.GiftCards = _bindLookupGiftCard: -> $(document).on('submit', '#lookup-redemption-code', (event) -> event.preventDefault() window.location.href = $(this).attr('action') + '/' + $(this).find('#gift_card_redemption_code').val() ) init: -> @_bindLookupGiftCard() setAdminDatepicker: () -> $(document).ready(() -> $(".giftcard-datepicker").datepicker("setDate", new Date($(".giftcard-datepicker").val().split("-"))) $(".giftcard-datepicker").datepicker("option", "minDate", new Date()) ) # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.editor': 'cmd-shift-c': 'coffee-compile:compile' module.exports = (grunt) -> grunt.initConfig nodewebkit: options: build_dir: './builds' version: '0.8.3' mac: true win: true linux32: false linux64: false src: [ './src/**/*' ] grunt.loadNpmTasks 'grunt-node-webkit-builder' grunt.registerTask 'default', ['nodewebkit']TimeEntry = require '../../models/time_entry' should = require 'should' makeT = (offset = 10) -> t = new TimeEntry start: new Date() - 5 end: new Date() - offset duration: 60 * 60 message: 'message goes here' userId: 'someuserID' projectId: 'someprojectID' describe 'TimeEntry Model', -> it 'should be able to create a new instance', -> t = do makeT t.should.not.be.equal undefined it 'should validate', -> t = do makeT start = new Date t.start end = new Date t.end start.should.be.instanceof Date end.should.be.instanceof Date t.message.should.be.equal 'message goes here' t.validate().should.be.true define [ "base" ], (App) -> App.directive "reviewPanelToggle", () -> restrict: "E" scope: onToggle: '&' ngModel: '=' disabled: '=?' onDisabledClick: '=?' link: (scope) -> if !scope.disabled? scope.disabled = false scope.onChange = (args...) -> scope.onToggle({ isOn: scope.localModel }) scope.handleClick = () -> if scope.disabled scope.onDisabledClick() scope.localModel = scope.ngModel scope.$watch "ngModel", (value) -> scope.localModel = value template: """
    """ describe 'Custom Element Base', -> registerCustomElement = require('../base.min.js') {getCustomElement} = require('./helper') it 'fires the events in order', -> lastRan = null element = new (registerCustomElement(getCustomElement({ name: 'x-custom-element' created: -> lastRan = 'created' initialize: -> lastRan = 'initialize' attached: -> expect(lastRan).toBe('initialize') lastRan = 'attached' detached: -> lastRan = 'detached' attributeChanged: -> lastRan = 'attributeChanged' }))) expect(lastRan).toBe('created') element.setAttribute('a-b', 'c') expect(lastRan).toBe('attributeChanged') document.body.appendChild(element) expect(lastRan).toBe('attached') element.remove() expect(lastRan).toBe('detached') $ -> $('#currency').change -> $.ajax( type: 'POST' url: $(this).data('href') data: currency: $(this).val() ).done -> window.location.reload() ETahi.AdminRoute = ETahi.AuthorizedRoute.extend actions: viewUserDetails: (user) -> @controllerFor('adminJournalUser').set('model', user) @render 'userDetailOverlay', into: 'application' outlet: 'overlay' controller: 'adminJournalUser' didTransition: -> $('html').attr('screen', 'admin') willTransition: -> $('html').attr('screen', '') class MainChatPanel extends JView constructor:-> super cssClass : 'main-chat-panel visible' @registerSingleton "chatPanel", @, yes @header = new MainChatHeader @conversationList = new ChatConversationListView @conversationListController = new ChatConversationListController view : @conversationList createConversation:(data)-> # Data includes chatChannel and the conversation @conversationListController.addItem data viewAppended:-> @addSubView @header @addSubView @conversationList @conversationListController.loadItems() show:-> @setClass 'visible' @emit 'PanelVisibilityChanged', true hide:-> @unsetClass 'visible' @emit 'PanelVisibilityChanged', false toggle:-> @toggleClass 'visible' @emit 'PanelVisibilityChanged', @isVisible() isVisible:-> @hasClass 'visible' app = require '../../test.js' _ = require 'underscore' module.exports = Backbone: app.Backbone chai: require 'chai' require: (path) -> app.require path class LoginAppsController extends AppController KD.registerAppClass this, name : "Login" route : [ '/:name?/Login' '/:name?/Redeem' '/:name?/Register' '/:name?/Recover' '/:name?/ResendToken' ] hiddenHandle : yes labels : ['Redeem', 'Register', 'Recover', 'ResendToken'] preCondition : condition : (options, cb)-> cb not KD.isLoggedIn() failure : -> KD.getSingleton('router').handleRoute "/Activity" constructor:(options = {}, data)-> options.view = new LoginView testPath : "landing-login" options.appInfo = name : "Login" super options, data handleQuery: (query) -> {currentPath} = KD.getSingleton 'router' form = 'login' s = (exp, tf)-> if currentPath.match exp then form = tf s /\/Login$/ , 'login' s /\/Redeem$/ , 'redeem' s /\/Register$/ , 'register' s /\/Recover$/ , 'recover' s /\/ResendToken$/ , 'resendEmail' @getView().animateToForm form# Add new migrations here. # I wasn't able to get automatic path globed `require` to work with gulp. migrations = [ require "./01_base" require "./02_add_initial_values" ] module.exports = migrations: migrations update: (data) -> for m in migrations if m.update data = m.update(data) data latestVersion: -> @lastMigration().version lastMigration: -> _.max migrations, (m) -> m.version bindArrows = -> Mousetrap.bind 'left', -> if jekyll_page_previous? and not window.disable_keyboard_nav Turbolinks.visit(jekyll_page_previous) Mousetrap.bind 'right', -> if jekyll_page_next? and not window.disable_keyboard_nav Turbolinks.visit(jekyll_page_next) # Mousetrap.bind 'up', -> # if 'jekyll_page_up' of window # window.location.href = jekyll_page_up Mousetrap.bind 'e d i t o r', -> if localStorage.debug_mode is "yes" # Disable localStorage.debug_mode = "no" $('[data-debug-toggle]').hide() else # Enable localStorage.debug_mode = "yes" $('[data-debug-toggle]').show() window.disable_keyboard_nav = false $(window).load -> # DO NOT DO ON EVERY TURBONAV if localStorage.debug_mode is "yes" $('[data-debug-toggle]').show() bindArrows() document.addEventListener 'turbolinks:visit', -> window.jekyll_page_up = null window.jekyll_page_previous = null window.jekyll_page_next = null spawn = require("child_process").spawn exec = require("child_process").exec logger = require "logger-sharelatex" module.exports = DockerRunner = _docker: 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID', 'texlive'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout timeout, () -> logger.warn "timeout achieved, stopping docker instance" exec 'docker', ['stop', "texlive-#{project_id}"] callback 'Compilation failed, timeout' proc.on "close", () -> clearTimeout timer callback() 'use strict' async = require 'async' sysPath = require 'path' inflection = require 'inflection' GeneratedFile = require './generated_file' getGeneratedFilesPaths = (sourceFile, joinConfig) -> sourceFileJoinConfig = joinConfig[inflection.pluralize sourceFile.type] or {} Object.keys(sourceFileJoinConfig).filter (generatedFilePath) -> checker = sourceFileJoinConfig[generatedFilePath] checker sourceFile.path getFiles = (fileList, config, joinConfig, minifiers) -> map = {} fileList.files.forEach (file) => paths = getGeneratedFilesPaths file, joinConfig paths.forEach (path) => map[path] ?= [] map[path].push file Object.keys(map).map (generatedFilePath) => sourceFiles = map[generatedFilePath] fullPath = sysPath.join config.paths.public, generatedFilePath new GeneratedFile fullPath, sourceFiles, config, minifiers # * plugins - hashmap of plugins from package.json. module.exports = write = (fileList, config, joinConfig, plugins, startTime, callback) -> minifiers = plugins.filter (plugin) -> !!plugin.minify files = getFiles fileList, config, joinConfig, minifiers changed = files.filter (generatedFile) -> generatedFile.sourceFiles.some (sourceFile) -> sourceFile.cache.compilationTime > startTime async.forEach changed, ((file) -> file.write callback), (error) -> return callback error if error? callback null, changed module.exports = s = # Convenience method: wrap services in complete middleware stack # accepts {serviceName: serviceDef} # returns {serviceName: serviceDef} (wrapped) create: (defs, jargon=[], policy=[], resolvers={}) -> services = s.process defs, jargon withPolicy = s.applyPolicy services, policy final = s.applyDependencies withPolicy, resolvers return final # loads services from the file system (assumed to be in separate files) # accepts (serviceLocation) # returns {serviceName: serviceDef} load: require './getServices' # processes service definitions into functions # accepts (services, jargon) # returns {serviceName: service} process: require './wrapServicesInMiddleware' # wraps services with access/lookup policy # accepts (services, policy) # returns {serviceName: wrappedService} applyPolicy: require './applyPolicy' # looks up and requires dependencies according to # the resolvers data structure. # accepts (services, resolvers) # returns {serviceName: wrappedService} applyDependencies: require './applyDependencies' # prints out the stack of filters applied to each service # accepts (services) # returns {serviceName: filterStack} print: require './printFilters' # exposes the 'graph' submodule, which includes functions to # take a set of services and return information about the graphs # graphs induced by the various dependency types, especially # the 'services' dependencyType. graph: require './graph' # Export 'errors' module for extensions to depend upon. errors: = require './errors'commandDisposable = null grammarListView = null grammarStatusView = null module.exports = config: showOnRightSideOfStatusBar: type: 'boolean' default: true activate: -> commandDisposable = atom.commands.add('atom-text-editor', 'grammar-selector:show', createGrammarListView) deactivate: -> commandDisposable?.dispose() commandDisposable = null grammarStatusView?.destroy() grammarStatusView = null grammarListView?.destroy() grammarListView = null consumeStatusBar: (statusBar) -> GrammarStatusView = require './grammar-status-view' grammarStatusView = new GrammarStatusView().initialize(statusBar) grammarStatusView.attach() createGrammarListView = -> unless grammarListView? GrammarListView = require './grammar-list-view' grammarListView = new GrammarListView() grammarListView.toggle() $ -> scan_request_option_id = '#entire_no' scan_request_container_class = '#holding-request-option-offsite-scan' # Select scan request if any of the text inputs have a value $(document).on 'keypress', scan_request_container_class + ' fieldset input', -> $(this).closest('fieldset').prev('label').find('input').first().prop('checked', true) # Clear the text inputs for scan requests if option is unselected $(document).on 'change', 'input[type="radio"]', -> if !$(scan_request_option_id).is(':checked') $(scan_request_container_class + ' fieldset input').val('') class Utils getHTMLTitleFromHistoryFragment: (fragment) -> _.capitalize(fragment.split('\/').join(' ')) stringJSON: (object) -> JSON.stringify object, null, ' ' viewJSON: (object) -> vex.dialog.alert contentCSS: width: 800 message: "
    #{ utils.stringJSON object }
    " getAcrossCollections: (collectionStrings, id) -> model = undefined _.each collectionStrings, (collectionString) -> collection = app.collections[collectionString] model = collection.get(id) ? model return model module.exports = new Utilsmodule = angular.module("taigaProject", []) class Water.TreesController extends Backbone.Router routes: "/tree/*path": "fetch_tree" "/blob/*path": "fetch_blob" "*anything": "root" fetch_tree: (path) -> @fetcher.fetch("trees", path) fetch_blob: (path) -> @fetcher.fetch("blobs", path) root: () -> @fetcher.fetch("trees", "") module.exports = config: autocompleteBrackets: type: 'boolean' default: true autocompleteSmartQuotes: type: 'boolean' default: true wrapSelectionsInBrackets: type: 'boolean' default: true activate: -> atom.workspace.observeTextEditors (editor) -> editorElement = atom.views.getView(editor) BracketMatcherView = require './bracket-matcher-view' new BracketMatcherView(editor, editorElement) BracketMatcher = require './bracket-matcher' new BracketMatcher(editor, editorElement) PEG = require 'pegjs' {fs} = require 'atom' grammarSrc = fs.readFileSync(require.resolve('./snippet-body.pegjs'), 'utf8') module.exports = PEG.buildParser(grammarSrc, trackLineAndColumn: true) 'use strict' angular.module('ccApp.controllers') .controller 'MainCtrl', ($scope, _, questions, scores) -> questionsByCategory = _.groupBy questions, (question) -> question.tags[0] $scope.questions = questions $scope.questionGroups = questionsByCategory $scope.sections = _.keys(questionsByCategory) $scope.totalsPerSection = scores.totals(questions) $scope.resultsPerSection = scores.userScores(questions) $scope.generateReport = () -> $scope.resultsPerSection = scores.userScores(questions) #= require trix/utilities/object class Trix.Attachment extends Trix.Object constructor: (@file) -> $ = require 'jquery' FinishGame = submitResults: (state) -> window.onbeforeunload = -> gameParams = {rounds: state.round.get('rounds').toJS()} gameId = state.game.get('id') $.ajax url: "/games/#{gameId}/finish" data: { game: gameParams } method: 'PUT' headers: 'X-CSRF-Token': localStorage.getItem('csrf-token') .done (response) -> window.location = response.redirectUrl .fail -> window.onbeforeunload = -> 'Your game has not been saved!' alert 'Error finishing game!' module.exports = FinishGame StockStore = require './stock_store.coffee' ArticleStore = new StockStore( sortKey: 'title' sortAsc: true descKeys: character_sum: true view_count: true modelKey: 'article' ) module.exports = ArticleStore.store loadPpt = -> pptData = StrutBuilder.build(JSON.parse(localStorage.regions)) #[ #{ #slide 1 #start: 0, #end: 2.5, #texts: [ #{text: 'Hum', position: 1.2}, #{text: 'bewafaa', position: 1.7} #] #}, #{ #slide 2 #start: 2.5, #end: 4.3, #texts: [ #{text: 'Hargiz', position: 3.3}, #{text: 'na they', position: 3.8} #] #} #] localStorage['strut-presentation-unnamed.strut'] = JSON.stringify(pptData) $('#editor').attr('src', '/editor/') $ -> $('#ppt-loader').on 'click', loadPpt # medellin coords 6.29, -75.54 map_center = new google.maps.LatLng(19.311143,-39.199219) marker = null map = null initialize_map = -> mapOptions = zoom: 2, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP, center: map_center map = new google.maps.Map(document.getElementById('mapa'), mapOptions) loadUsersData() loadUsersData = -> $.getJSON '/users_map.json', (data) -> $.each data, (key, value) -> user_location = new google.maps.LatLng(value.latitude, value.longitude) addMarker(user_location) addMarker = (place) -> marker = new google.maps.Marker map: map, draggable:true, animation: google.maps.Animation.DROP, position: place google.maps.event.addListener(marker, 'click', bounceOnce) bounceOnce = -> marker.setAnimation(google.maps.Animation.BOUNCE) setInterval(stopBounce, 1000) stopBounce = -> marker.setAnimation(null) toggleBounce = -> if marker.getAnimation() != null marker.setAnimation(null) else marker.setAnimation(google.maps.Animation.BOUNCE) $(document).ready -> initialize_map() # fillOptions = () -> # $('#selectLocation'). Template.locationEdit.created = () -> Meteor.call 'getOptions', (error, result) -> locationsData = JSON.parse result locations = locationsData.locations for location in locations $('#selectLocation').append '' Template.locationEdit.events 'submit form': (e) -> e.preventDefault() locationProperty = $(e.target).find('[name=location]').val() Meteor.users.update {_id: Meteor.userId()}, {$set: {"profile.location": locationProperty}}, (error) -> if error console.log 'Error!' else alert 'Update Successful!'dgram = require "dgram" class ListenServer passphrase: '' handleMessage: (msg, rinfo) -> try data = JSON.parse(msg) if data and @checkPassphrase(data) @incomingData(data) checkPassphrase: (data) -> if @passphrase == '' true else data.passphrase and data.passphrase == @passphrase incomingData: (data) -> if data.objectType @mongoConnection.collection "fnf-#{data.objectType}", (err, conn) -> coll.insert data, {safe:true}, (err) -> start: (port) -> server = dgram.createSocket("udp4") server.on("listening", @onSocketListen) server.on("message", @onSocketMessage) server.listenServer = this server.bind(port) @server = server this stop: -> @server.close() onSocketListen: -> console.log "server listening #{@address().address}:#{@address().port}" onSocketMessage: (msg, rinfo) -> # Handle the message in the scope of ListenServer, not the Socket # This makes it easier to test by spying/stubbing handleMessage instead @listenServer.handleMessage(msg, rinfo) module.exports = ListenServer # Let people know of emergent / constant questions # # hot topic anything = whatever you want to rememeber # forget hot topic anything # hot topics module.exports = (robot) -> robot.brain.data.hot_topics or= {} robot.respond /hot topic (.*) = (.*)/i, (msg) -> robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2] msg.send "OK I'll remember that and let people know" robot.respond /forget hot topic (.*)/i, (msg) -> if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]? delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()] msg.send "OK forgot it." else msg.send "Didn't know anything about that anyway." robot.respond /hot topics/i, (msg) -> robot.brain.data.hot_topics or= {} memories = for phrase, memory of robot.brain.data.hot_topics "#{phrase} -> #{memory}" msg.send memories.join("\n") robot.hear /(.+)/i, (msg) -> text = msg.message.text unless text.match 'hot topic' memories = for phrase, memory of robot.brain.data.hot_topics when text.toLowerCase().match(phrase) memory msg.send memories.join("\n") # App # === # Highest-level application script. # Dependencies # ------------ # Configure RequireJS. Dependency references default to the `lib` directory. # We're using CoffeeScript, so our `app` package code is in the compiled js # directory `release`. requirejs.config baseUrl: 'lib' paths: app: '../release' requirejs [ 'phaser' 'app/game' ], (Phaser, MorningStroll) -> 'use strict' # Global flags # ------------ window.DEBUG = on # Main # ---- # Run our game. game = new MorningStroll() game.start() # Debug # ----- # Block of additions for debugging the app. Exposes classes and instances as # globals. if window.DEBUG is on window.Phaser = Phaser window.game = game console.info game 'global': 'editor': 'showInvisibles': true 'preferredLineLength': 120 'softWrapped': true 'showIndentGuide': true 'fontSize': 12 'invisibles': {} 'core': 'disabledPackages': [ 'metrics' ] 'themes': [ 'atom-dark-ui' 'glitterbomb' ] 'exception-reporting': 'userId': '2f6c1fe2-cfdb-87de-4712-11b4b505fed4' 'welcome': 'showOnStartup': false 'atom-beautify': '_analyticsUserId': '1d4703af-c0bf-4e61-8894-f8865aaabf2b' React = require 'react' NewCourseRegistration = require './new-registration' ModifyCourseRegistration = require './modify-registration' UserStatus = require '../user/status-mixin' Course = require './model' CourseRegistration = React.createClass propTypes: collectionUUID: React.PropTypes.string.isRequired mixins: [UserStatus] render: -> course = @getUser().getCourse(@props.collectionUUID) body = if course?.isRegistered() else
    {body}
    module.exports = CourseRegistration React = require 'react' BS = require 'react-bootstrap' {CourseStore} = require '../../flux/course' module.exports = React.createClass displayName: 'BrowseTheBook' contextTypes: router: React.PropTypes.func getDefaultProps: -> bsStyle: 'primary' propTypes: courseId: React.PropTypes.string chapterId: React.PropTypes.number sectionId: React.PropTypes.number page: React.PropTypes.string unstyled: React.PropTypes.bool bsStyle: React.PropTypes.string render: -> courseId = @props.courseId or @context.router.getCurrentParams().courseId # the router is smart enough to figure out which props are present and return the best route linkType = if @props.page then 'viewReferenceBookPage' else if @props.section then 'viewReferenceBookSection' else 'viewReferenceBook' course = CourseStore.get(@props.courseId) link = @context.router.makeHref( linkType, bookId: course.book_id, cnxId: @props.page, section:@props.section ) linkProps = {target:'_blank', className:'view-reference-guide', href: link} text = @props.children or 'Browse the Book' if @props.unstyled {text} else {text} `import BaseRoute from './_base'` `import ajax from 'ic-ajax'` Route = BaseRoute.extend model: -> mePath = '/api/me' # return the current user as the model if authenticated, otherwise a blank object new Ember.RSVP.Promise (resolve, reject) => ajax url: mePath dataType: 'json' .then (result) => user = Ember.Object.create(result) if result.isAnon @set 'session.isAnon', true @set 'session.currentUser', null else @set 'session.isAnon', false @set 'session.currentUser', user resolve(user) ajax url: mePath method: 'post' , (result) -> reject() clearSession: -> @set 'session.currentUser', undefined @set 'session.isAnon', true @set 'settings.editMode', false actions: toggleEditMode: -> @toggleProperty 'settings.editMode' @send 'flushUpdateQueue' flushUpdateQueue: -> return unless @get('session.currentUser.isAdmin') updateQueue = @get('updateQueue') while updateQueue.get('length') section = updateQueue.popObject() section.save() error: (result, transition) -> if result.status is 403 @clearSession() @transitionTo 'signout' return false else return true `export default Route` AuthModalView = require '../../../../components/auth_modal/view.coffee' { templateMap } = require '../../../../components/auth_modal/maps.coffee' mediator = require '../../../../lib/mediator.coffee' templateMap['phone_number'] = -> require('./templates/phone_number.jade') arguments... module.exports = class InquireViaPhoneModalView extends AuthModalView template: -> templateToRender = if sd.CURRENT_USER then 'phone_number' else @state.get('mode') templateMap[templateToRender] arguments... onSubmitSuccess: (model, response, options) => analyticsHooks.trigger "auth:#{@state.get 'mode'}" @reenableForm null, reset: false if response.error? mediator.trigger 'auth:error', _s.capitalize response.error else Cookies.set('destination', @destination, expires: 60 * 60 * 24) if @destination switch @state.get('mode') when 'login' Cookies.set('signed_in', true, expires: 60 * 60 * 24 * 7) when 'register' mediator.trigger 'auth:sign_up:success' when 'forgot' mediator.trigger 'auth:change:mode', 'reset' @state.set 'mode', 'phone_number' addBinding = ViewModel.addBinding addBinding name: 'text' autorun: (c, bindArg) -> bindArg.element.text bindArg.getVmValue() return addBinding name: 'default' bind: (bindArg) -> bindArg.element.on bindArg.bindName, (event) -> if ~bindArg.bindValue.indexOf(')', bindArg.bindValue.length - 1) bindArg.getVmValue() else bindArg.setVmValue(event) return return addBinding name: 'toggle' events: click: (event, bindArg) -> value = bindArg.getVmValue() bindArg.setVmValue(!value) return addBinding name: 'if' autorun: (c, bindArg) -> if bindArg.getVmValue() bindArg.element.show() else bindArg.element.hide() return addBinding name: 'value' selector: 'input' events: 'input propertychange': (event, bindArg) -> bindArg.setVmValue bindArg.element.val() autorun: (c, bindArg) -> bindArg.element.val bindArg.getVmValue()Chamber.Views.Messages ||= {} class Chamber.Views.Messages.IndexView extends Backbone.View template: JST["backbone/templates/messages/index"] initialize: () -> #@options.messages.bind('reset', @addAll) @options.messages.bind('add', @addOne) #addAll: () => # @options.messages.each(@addOne) addOne: (message) => view = new Chamber.Views.Messages.MessageView({model : message}) $("tbody", @el).append(view.render().el) render: => $(@el).html(@template(messages: @options.messages.toJSON())) return thisclass SidebarController extends KDViewController constructor:-> super mainController = KD.getSingleton 'mainController' mainController.on 'ManageRemotes', -> new ManageRemotesModal mainController.on 'ManageDatabases', -> new ManageDatabasesModal mainController.on 'AccountChanged', @bound 'accountChanged' mainController.ready @bound 'accountChanged' accountChanged:(account)-> account or= KD.whoami() {profile} = account sidebar = @getView() { avatar, finderHeader, navController avatarAreaIconMenu, finderController footerMenuController, resourcesController } = sidebar avatar.setData account finderHeader.setData account # temp fix # this should be done on framework level # check comments on KDObject::setData avatar.render() finderHeader.render() navController.reset() footerMenuController.reset() @resetAdminNavItems() avatarAreaIconMenu.accountChanged account # get registered users vms all ready to go (don't for guests right now): finderController.reset() if "registered" is account.type resourcesController.reset() resetAdminNavItems:-> # return unless KD.isLoggedIn() KD.whoami().fetchRole? (err, role)=> if role is "super-admin" @getView().navController.addItem title : "Admin Panel" type : "admin" loggedIn : yes callback : -> new AdminModal webpack = require "webpack" option = require "./gulp.coffee" module.exports = watchDelay : 500 output : filename : "[name].js" sourceMapFilename : "map/[file].map" publicPath : "/js/" devtool : "#source-map" resolve : root : [ "#{option.sourceDir}/renderer/coffee" "#{option.sourceDir}/renderer/js" ] extensions : ["", ".coffee", ".js"] modulesDirectories : [ "bower_components" "node_modules" ] alias : bower : "bower_components" module : loaders : [ {test: /\.html$/, loader: "html-loader"} {test: /\.coffee$/, loader: "coffee-loader"} {test: /\.jade$/, loader: "jade-loader"} {test: /\.styl$/, loader: "css-loader!stylus-loader"} {test: /\.cson$/, loader: "cson-loader"} {test: /\.json$/, loader: "json-loader"} ] plugins : [ new webpack.ResolverPlugin(new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("package.json", [ "main" ])) new webpack.ResolverPlugin(new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", [ "main" ])) new webpack.ResolverPlugin(new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("component.json", [ "main" ])) new webpack.optimize.AggressiveMergingPlugin new webpack.optimize.DedupePlugin ] Meteor.startup -> if Meteor.isServer lib = require './lib.coffee' keys = require '/server/utils/deploykeys.coffee' authenticationHandler = -> if (key = @params.query?['api-key']) or (key = @request.headers?['api-key']) if (apiKey = APIKeys.findOne key: key) user = Meteor.users.findOne(apiKey.owner) # @authenticatedUSer = user @next() else if(key in keys()) user = "deploy" @next() else lib.endWithError @response, 401, "Not authenticated" else lib.endWithError @response, 401, "No API key provided" Router.onBeforeAction authenticationHandler, only: [ 'api/v2/apps/details' 'api/v2/apps/dockerCompose' 'api/v2/apps/bigboatCompose' 'api/v2/apps/byName' 'api/v2/apps' 'api/v2/instances' 'api/v2/instances/single' 'api/v2/status' ] path = require 'path' _ = require 'underscore-plus' optimist = require 'optimist' config = require './config' Command = require './command' Install = require './install' module.exports = class Rebuild extends Command @commandNames: ['rebuild'] constructor: -> @atomNodeDirectory = path.join(config.getAtomDirectory(), '.node-gyp') @atomNpmPath = require.resolve('npm/bin/npm-cli') parseOptions: (argv) -> options = optimist(argv) options.usage """ Usage: apm rebuild Rebuild all the modules currently installed in the node_modules folder in the current working directory. """ options.alias('h', 'help').describe('help', 'Print this usage message') showHelp: (argv) -> @parseOptions(argv).showHelp() run: ({callback}) -> new Install().installNode (error) => if error? callback(error) else process.stdout.write 'Rebuilding modules ' rebuildArgs = ['rebuild'] rebuildArgs.push("--target=#{config.getNodeVersion()}") rebuildArgs.push("--arch=#{config.getNodeArch()}") env = _.extend({}, process.env, HOME: @atomNodeDirectory) env.USERPROFILE = env.HOME if config.isWin32() @fork @atomNpmPath, rebuildArgs, {env}, (code, stderr='') -> if code is 0 process.stdout.write '\u2713\n'.green callback() else process.stdout.write '\u2717\n'.red callback(stderr) 'menu': [ 'label': 'Edit' 'submenu': [ 'label': 'Select Encoding' 'command': 'encoding-selector:show' ] ] 'context-menu': '.overlayer': [ 'label': 'Change Encoding' 'command': 'encoding-selector:show' ] Path = require('path') fs = require('fs') module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON("package.json") coffee: compile: files: 'js/odometer.js': 'coffee/odometer.coffee' 'js/landing-page.js': 'coffee/landing-page.coffee' watch: coffee: files: ['coffee/odometer.coffee', 'sass/*'] tasks: ["coffee", "uglify", "compass"] uglify: options: banner: "/*! <%= pkg.name %> <%= pkg.version %> */\n" dist: src: 'odometer.js' dest: 'odometer.min.js' compass: dist: options: sassDir: 'sass' cssDir: 'css' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-compass' grunt.registerTask 'default', ['coffee', 'uglify', 'compass'] module.exports = (grunt) -> require('load-grunt-tasks') grunt grunt.initConfig clean: folder: 'build' sass: options: sourceMap: true dist: files: 'build/main.css': 'stylesheets/main.sass' watch: files: ['stylesheets/**/*.sass', 'stylesheets/**/*.scss'] tasks: ['sass'] grunt.registerTask 'default', ['clean', 'sass'] App.Followable = update: (followable_id, button) -> $("#" + followable_id + " .js-follow").html(button) # Temporary line. Waiting for issue resolution: https://github.com/consul/consul/issues/1736 initialize_modules() Bacon = require 'bacon' $ = require 'jquery' class NCN constructor: (@host = '') -> request = (method) -> (path, data) -> Bacon.fromPromise( $.ajax @host + path, data: data type: method dataType: 'json') get: request 'GET' post: request 'POST' delete: request 'DELETE' put: request 'PUT' module.exports = NCN class Tenon.features.QuickSearch constructor: -> @$content = $('.toolbox #quick-search-container') @$toggle = $('#quick-search-toggle') @openClass = 'open' @$field = $('#quick-search') # listeners $(document).on('keyup', '#quick-search', $.debounce(500, @_submitSearch)) @$toggle.on('click', @toggleNav) # $(document).on('click', '.nav-holder.mobile-open a', @_closeNav) _submitSearch: (e) => @$list = $(@$field.data('record-list')) params = {q: @$field.val()} new Tenon.features.RecordList(@$list, params: params, clear: true) toggleNav: (e) => e.preventDefault() @$toggle.find('i').toggleClass('fa-search fa-times') if @$toggle.hasClass(@openClass) @_closeNav() else @_openNav() _closeNav: () => @$field.val('').keyup() # clear quick search and submit it when closing the toolbox @$toggle.removeClass(@openClass) $('header').css('border-bottom-width', '1px') @$content.removeClass(@openClass) _openNav: () => @$toggle.addClass(@openClass) $('header').css('border-bottom-width', '0px') @$content.addClass(@openClass) @$content.find('input')[0].focus() {View} = require 'atom' ImageEditor = require './image-editor' module.exports = class ImageEditorStatusView extends View @content: -> @div class: 'status-image inline-block', => @span class: 'image-size', outlet: 'imageSizeStatus' initialize: (@statusBar) -> @attach() @subscribe atom.workspaceView, 'pane-container:active-pane-item-changed', => @updateImageSize() attach: -> @statusBar.appendLeft this afterAttach: -> @updateImageSize() getImageSize: ({originalHeight, originalWidth}) -> @imageSizeStatus.text("#{originalWidth}x#{originalHeight}").show() updateImageSize: -> editor = atom.workspaceView.getActivePaneItem() if editor instanceof ImageEditor view = atom.workspaceView.getActiveView() if view.loaded @getImageSize(view) else # wait for image to load before getting originalWidth and originalHeight view.image.load => # Make sure view is still active since load is async @getImageSize(view) if view is atom.workspaceView.getActiveView() else @imageSizeStatus.hide() Sprangular.directive 'shippingRateSelection', -> restrict: 'E' templateUrl: 'shipping/rates.html' scope: order: '=' controller: ($scope, Checkout, Env) -> $scope.loading = false $scope.address = {} $scope.currencySymbol = Env.currency.symbol $scope.$watch 'order.shippingRate', (rate, oldRate) -> return if !oldRate || rate.id == oldRate.id order = $scope.order if rate order.shipTotal = rate.cost else order.shipTotal = 0 order.updateTotals() $scope.$watch('order.shippingAddress', -> $scope.address = $scope.order.shippingAddress , true) validateAddress = (address) -> $scope.isValid = address.firstname && address.lastname && address.city && address.address1 && address.zipcode && address.country && address.state && address.phone $scope.$watch('address', validateAddress, true) # use $scope.$watchGroup when its released $scope.$watch 'address.country.id + address.state.id + address.zipcode + isValid', (oldValue, newValue) -> return if $scope.loading || oldValue == newValue || !$scope.isValid $scope.loading = true Checkout.setDelivery().then -> $scope.loading = false validateAddress($scope.address) ETahi.InlineEditBodyPartComponent = Em.Component.extend editing: false snapshot: [] confirmDelete: false createSnapshot: (-> @set('snapshot', Em.copy(@get('block'), true)) ).observes('editing') hasContent: true # hasContent: Em.computed.notEmpty('bodyPart.value') hasNoContent: Em.computed.not('hasContent') actions: toggleEdit: -> @sendAction('cancel', @get('block'), @get('snapshot')) if @get('editing') @toggleProperty 'editing' deleteBlock: -> @sendAction('delete', @get('block')) save: -> if @get('hasContent') @sendAction('save', @get('block')) @toggleProperty 'editing' confirmDeletion: -> @set('confirmDelete', true) cancelDestroy: -> @set('confirmDelete', false) addItem: -> @sendAction('addItem', @get('block')) App.ResultToolbarController = Em.ArrayController.extend content: [] searchBinding: 'currentSearchController.content' pageSize: 15 _currentPageNo: 0 currentPageNo: ((key, value) -> if value? numPages = @get('numPages') @_currentPageNo = if value < 0 then 0 else (if value >= numPages then numPages - 1 else value) @_currentPageNo ).property() showPreviousPage: -> @set('currentPageNo', @get('currentPageNo') - 1) showNextPage: -> @set('currentPageNo', @get('currentPageNo') + 1) App.router.send('goToPage') showFirstPage: -> @set('currentPageNo', 0) showLastPage: -> @set('currentPageNo', @get('numPages') - 1) numPages: (-> numHits = @get('search.numHits') if numHits is 0 then 0 else Math.floor((numHits - 1) / @pageSize) + 1 ).property('search') hasMoreThanOnePage: (-> @get('numPages') > 1 ).property('numPages') isShowingFirstPage: (-> @get('currentPageNo') is 0 ).property('currentPageNo') isShowingLastPage: (-> @get('currentPageNo') is @get('numPages') - 1 ).property('currentPageNo', 'numPages') exports.config = paths: watched:['client'] files: javascripts: joinTo: 'app.js' stylesheets: joinTo: 'app.css' templates: joinTo: 'app.js'expect = require('chai').expect algorhythm = require('../../lib/algorhythmic') describe 'Algorhythmic', -> it 'works', -> expect(algorhythm).to.be.ok define [ "base" ], (App) -> App.directive "reviewPanelToggle", () -> restrict: "E" scope: onToggle: '&' ngModel: '=' disabled: '=?' onDisabledClick: '=?' link: (scope) -> if !scope.disabled? scope.disabled = false scope.onChange = (args...) -> scope.onToggle({ isOn: scope.localModel }) scope.handleClick = () -> if scope.disabled scope.onDisabledClick() scope.localModel = scope.ngModel scope.$watch "ngModel", (value) -> scope.localModel = value template: """
    """ Base = require("./Base") module.exports = class Mercurial extends Base type: 'mercurial' _doCommit: (message) -> @_exec(['hg', 'commit', '-m', message]) _doPull: -> @_exec(['hg', 'pull']) _doPush: -> @_exec(['hg', 'push']) _doUpdate: (revision) -> @_exec(['hg', 'update', revision]) _doMerge: (revision) -> @_exec(['hg', 'merge', '-r', revision]) _doStatus: -> @_exec(['hg', 'status']) _doBranch: -> @_exec(['hg', 'branch']) class Cfp.Views.RankingView extends Backbone.View el: '#ranking' events: 'change #rank' : 'changeRank' changeRank: -> rank = new Cfp.Models.Rank rank.save value: @selectedRank() selectedRank: => @$('#rank').val() namespace 'Exo.Widgets.AutocompleteTokenField', (exports) -> exports.ReplaceIdStrategy = (tokens) -> if id = tokens[0]?.id @originalInput.value = id exports.ArrayStrategy = (tokens) -> inputName = @originalInput.name + "[]" @$el.find('[type="hidden"]').remove() for token in tokens input = document.createElement("input") input.name = inputName input.value = token.get("query") input.type = "hidden" @el.appendChild(input) return exports.NestedAttributesStrategy = (instance, tokens) -> klass = class extends Exo.Views.AutocompleteTokenField constructor: (el, options = {}) -> @serializeStrategy = options.serializeStrategy || exports.NestedAttributesStrategy options.input = el[0] super(options) initialize: (options) -> super @source ||= new Backbone.Collection @setSource(@source) @render() unless @originalInput.value == "" @insertToken(@source.get(@originalInput.value)) if options.tokens @setToken(options.tokens) @on "add remove", (tokens) => tokens = if tokens instanceof Array then tokens else [tokens] @serializeStrategy.call(this, tokens) Exo.Widget.register("autoCompleteTokenField", klass) @Campaigns = new Meteor.Collection 'campaigns' @Campaigns.attachSchema new SimpleSchema name: type: String label: "Nome" max: 100 description: type: String label: "Descrição" max: 10000 createdAt: type: Date label: "Criado em" autoValue: -> if @isInsert return new Date if @isUpsert return $setOnInsert: new Date @unset() mainMedia: type: Object label: 'Media' optional: true 'mainMedia.type': type: String allowedValues: ['Person', 'Organization'], 'mainMedia.url': type: String regEx: SimpleSchema.RegEx.Url 'mainMedia.videoUrl': type: String regEx: SimpleSchema.RegEx.Url optional: true user: type: Object label: 'Criado por' autoValue: -> return { _id: @userId name: Users.findOne(@userId).profile.name or Users.findOne(@userId).emails[0].address type: Users.findOne(@userId).profile.type } 'user._id': type: String 'user.name': type: String ### Users @param email @param password @param name @param type [organization, person] ### @Users = Meteor.usersclass PG.Palette colors: red: stroke: "#b64639" fill: "#dc6355" orange: stroke: "#b27a01" fill: "#e3b514" yellowGreen: stroke: "#9bac0c" fill: "#c3d52a" lime: stroke: "#60a121" fill: "#8cd347" mediumSeaGreen: stroke: "#1a9853" fill: "#47d386" turquoise: stroke: "#188a91" fill: "#47cbd3" dodgerBlue: stroke: "#1675ab" fill: "#39a9e9" violet: stroke: "#5d5bbb" fill: "#8f8dee" orchid: stroke: "#5d5bbb" fill: "#8f8dee" violetRed: stroke: "#b42b58" fill: "#ed789e" fallbackColor: stroke: "#ccc" fill: "#ccc" color: -> unused = _.compact _(@colors).map (colors, name) => name unless @colors[name].used if unused[0] @colors[unused[0]].used = yes @colors[unused[0]] else @fallbackColor _ = require 'underscore' Promise = require 'bluebird' FetchStocks = require '../lib/fetchstocks' {ExtendedLogger} = require 'sphere-node-utils' Config = require '../config' describe 'FetchStocks', -> beforeEach -> @logger = new ExtendedLogger @fetchStocks = new FetchStocks @logger, Config, 'anyKey' it 'should get the channel Information', (done) -> spyOn(@fetchStocks.client.channels, 'fetch').andCallFake -> Promise.resolve body: results: [ { id: '123' }] @fetchStocks._getChannelId() .then (result) => expect(result).toEqual '123' done() .catch (e) -> done ewindow.JobsListView = class JobsListView extends Backbone.View initialize: -> @model.bind 'add', => this.render() $(@el).append('

    Jobs List

    ') @list = $('
      ').appendTo(@el) $(@el).append('

      Save jobs here by clicking "Add to jobs list" on a job.') $(window).bind 'resize', => this.setHeight() setHeight: -> height = $(window).height() - 350; $(@list).css(maxHeight: height) render: -> @list.empty() _.each(jobsList.models, (job) -> jobView = new JobView(model: job) @list.append(jobView.render().el) , this) this.setHeight() return thisReact = require 'react' window.React = React React.initializeTouchEvents true router = require './router' mainContainer = document.createElement 'div' mainContainer.id = 'panoptes-main-container' document.body.appendChild mainContainer if process.env.NON_ROOT isnt 'true' and location.hash isnt "" location.pathname = location.hash.slice(1) router.run (Handler, handlerProps) -> window.dispatchEvent new Event 'locationchange' React.render(, mainContainer); logDeployedCommit = require './lib/log-deployed-commit' logDeployedCommit() Window = process.atom_binding('window').Window module.exports = Window jQuery ($) -> EditableForm = $.fn.editableform.Constructor EditableForm.prototype.saveWithUrlHook = (value) -> originalUrl = @options.url model = @options.model nestedName = @options.nested nestedId = @options.nid nestedLocale = @options.locale @options.url = (params) => if typeof originalUrl == 'function' originalUrl.call(@options.scope, params) else if originalUrl? && @options.send != 'never' myName = params.name if typeof params.value == 'string' myValue = params.value.replace(/(\r\n|\n|\r)/gm,"
      ") else myValue = params.value obj = {} if nestedName nested = {} nested[myName] = myValue nested['id'] = nestedId if nestedLocale nested['locale'] = nestedLocale obj[nestedName + '_attributes'] = nested else obj[myName] = myValue params[model] = obj delete params.name delete params.value delete params.pk $.ajax($.extend({ url : originalUrl data : params type : 'PUT' dataType: 'json' }, @options.ajaxOptions)) @saveWithoutUrlHook(value) EditableForm.prototype.saveWithoutUrlHook = EditableForm.prototype.save EditableForm.prototype.save = EditableForm.prototype.saveWithUrlHookchild_process = require "child_process" module.exports = run: (path, args) -> # TODO: Add support killing the process. proc = child_process.exec(path + " " + args.join " ") proc.on 'close', (code, signal) -> if code == 0 # TODO: Display a more visible success message. console.info "Success!" else # TODO: Introduce proper error and warning handling. console.error "TeXification failed! Check the log file for more info..." proc # base64 # # @description # @Copyright 2014 Fantasy # @create 2014-12-11 # @update 2014-12-21 exports.encode = (str) -> try str = str.replace /\n/g, '' .replace /\s/g, '' window.btoa str catch err console.debug err exports.decode = (str) -> try JSON.stringify(JSON.parse(window.atob(str)), undefined, 2) catch err console.debug err 'body, .command-palette .editor': 'meta-p': 'command-palette:toggle' '.command-palette .editor': 'meta-p': 'command-palette:toggle' # csso = require 'csso' cleanCss = require 'clean-css' Bundle = require './bundle' fs = require 'fs' os = require 'os' path = require 'path' class Css extends Bundle constructor: (@options) -> @fileExtension = '.css' super minify: (code) -> return code unless @options.minifyCss try # csso.justDoIt(code, false, false) # csso.parse(code, 'stylesheet', true) return cleanCss.process(code, { keepSpecialComments:0 # remove all }); catch err filename = path.resolve(os.tmpDir(), 'tmpcss.css') fs.writeFileSync(filename, code) console.error("CSSO", err, "temporary file at: ", filename) process.exit() render: (namespace) -> style = '' for file in @files if file.namespace == namespace style += "" return style _convertFilename: (filename) -> splitted = filename.split('.') splitted.splice(0, splitted.length - 1).join('.') + '.css' module.exports = Css path = require('path') gulp = require('gulp') mocha = require('gulp-mocha') coffeelint = require('gulp-coffeelint') mochaNotifierReporter = require('mocha-notifier-reporter') OPTIONS = config: coffeelint: path.join(__dirname, 'coffeelint.json') files: coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ] tests: 'lib/**/*.spec.coffee' gulp.task 'test', -> gulp.src(OPTIONS.files.tests, read: false) .pipe(mocha({ reporter: mochaNotifierReporter.decorate('landing') })) gulp.task 'lint', -> gulp.src(OPTIONS.files.coffee) .pipe(coffeelint({ optFile: OPTIONS.config.coffeelint })) .pipe(coffeelint.reporter()) gulp.task 'watch', [ 'test', 'lint' ], -> gulp.watch(OPTIONS.files.coffee, [ 'test', 'lint' ]) mongoose = require 'mongoose' Schema = mongoose.Schema ObjectId = Schema.ObjectId mongoose.model "User", new Schema user: type: String required: true unique: true password: type: String required: true User = module.exports.User = mongoose.model "User" mongoose.model "Chart", new Schema owner: type: ObjectId required: true index: true title: type: String required: true Chart = module.exports.Chart = mongoose.model "Chart" schema_Point = new Schema chart: type: ObjectId required: true index: true stamp: type: Date required: true data: type: Number required: true schema_Point.index chart: 1 stamp: 1 mongoose.model "Point", schema_Point Point = module.exports.Point = mongoose.model "Point" 'use strict' {toggleGem} = require './actions' store = require './store' Gem = React.createClass mixins: [Reflux.connect store, 'status'] onClick: (event) -> toggleGem() return render: -> statusStr = if @state?.status then 'activated' else 'deactivated' (

      Gem is {statusStr}  

      ) module.exports = Gem #= require jquery #= require jquery_ujs #= require turbolinks #= require_tree . onReady = -> $('#gems-search').keyup -> if $("#query").val().length $.get $(this).attr('action'), $(this).serialize(), null, 'script' false $(document).ready onReady $(document).on 'page:change', -> if window._gaq? _gaq.push ['_trackPageview'] else if window.pageTracker? pageTracker._trackPageview() onReady() Neighborly.Map = (mapCanvasSelector) -> window.mapCanvasSelector = mapCanvasSelector $.getScript('https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=Neighborly.MapInitialize') Neighborly.MapInitialize = -> mapCanvasSelector = '.map-canvas' if typeof mapCanvasSelector is 'undefined' mapCanvas = $(mapCanvasSelector)[0] mapOptions = zoom: 11 center: new google.maps.LatLng($('.address-coordinates').data('latitude'), $('.address-coordinates').data('longitude')) disableDefaultUI: true map = new google.maps.Map(mapCanvas, mapOptions) #= require test_helper testPhases = undefined testTemplate = undefined module 'Unit: ManuscriptManagerTemplate', setup: -> phase = name: 'First Phase', task_types: ['ATask', 'AnotherTask'] @testThing = 5 template = name: 'A name' paper_type: 'A type' template: phases: [phase] Ember.run => testTemplate = ETahi.ManuscriptManagerTemplate.create(template) testPhases = testTemplate.get('phases') test '#init creates phase objects for the phases in a template', -> equal testPhases.length, 1 equal testPhases.get('firstObject.name'), 'First Phase' test '#init creates task objects for the task types in a phase', -> tasks = testPhases.get('firstObject.tasks') equal tasks.get('length'), 2 equal tasks.get('firstObject.title'), 'ATask' test "#init sets the paperType", -> equal testTemplate.get('paperType'), 'A type' test "#init sets the template property to null", -> equal testTemplate.get('template'), null mongoose = require 'mongoose' plugins = require '../plugins/plugins' AnalyticsLogEventSchema = new mongoose.Schema({ created: type: Date 'default': Date.now }, {strict: false}) AnalyticsLogEventSchema.index({event: 1, created: -1}) module.exports = AnalyticsLogEvent = mongoose.model('analytics.log.event', AnalyticsLogEventSchema) window.App ||= {} class App.Base constructor: -> if (window.jQuery) then @setClearEventHandlers() # clearing application event handlers only possible with jQuery return this ### Run the new action for the create action. Generally the create action will 'render :new' if there was a problem. This prevents doubling the code for each action. ### create: -> if typeof $this.new == 'function' return $this.new() ### Run the edit action for the update action. Generally the update action will 'render :edit' if there was a problem. This prevents doubling the code for each action. ### update: -> if typeof $this.edit == 'function' return $this.edit() ### Clear event handlers with a blank namespace. This will prevent window and document event handlers from stacking when each new page is fetched. Adding a namespace to your events will prevent them from being removed between page loads, i.e. "$(window).on 'scroll.app', myHandler" ### clearEventHandlers: -> jQuery(document).on 'page:before-change', -> for element in [window, document] for event, handlers in jQuery._data(element, 'events') for handler in handlers if handler.namespace == '' then $(element).off event, handler.handler# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.workspace': 'ctrl-alt-t': 'task-list:toggle' class Water.TreeFetcher extends Backbone.Model fetch: (node_type, path) => @trigger "start_fetch" url = [@attributes.repository_path, node_type, @attributes.ref , path].join("/") $.ajax url: url data: bare: 1 success: (data) => @data_did_fetch(data) dataType: "html" data_did_fetch: (data) => @set(data: data) $(document).ready -> assert = (condition) -> throw 'Assertion failed' unless condition contents = """ ################################################################# ################################################################# ################################################################# ################################################################# """ # assert contents == $('#sample').text() new window.TextFadeIn( document.getElementById('demo1'), 'milliseconds': 1 ).run() new window.TextFadeIn( document.getElementById('demo2'), contents, 'milliseconds': 1 ).run() new window.TextFadeIn( document.getElementById('demo3'), contents, 'milliseconds': 10 ).run() new window.TextFadeIn( document.getElementById('demo4'), contents, 'threads': 10 ).run() # assert contents == $('#sample').text() ### jquery.turbolinks.js ~ v1.0.0-rc1 ~ https://github.com/kossnocorp/jquery.turbolinks jQuery plugin for drop-in fix binded events problem caused by Turbolinks The MIT License Copyright (c) 2012 Sasha Koss ### $ = require?('jquery') || window.jQuery # List for store callbacks passed to `$` or `$.ready` callbacks = [] # Call each callback in list ready = -> callback($) for callback in callbacks # Turbolinks ready event turbolinksReady = -> $.isReady = true ready() # Fetch event handler fetch = -> $(document).off(undefined, '**') $.isReady = false # Bind `ready` to DOM ready event $(ready) # Store callbacks in list on `$` and `$.ready` $.fn.ready = (callback) -> callbacks.push(callback) callback($) if $.isReady # Bind ready to passed event $.setReadyEvent = (event) -> $(document) .off('.turbolinks-ready') .on(event + '.turbolinks-ready', turbolinksReady) # Bind fetch event $.setFetchEvent = (event) -> $(document) .off('.turbolinks-fetch') .on(event + '.turbolinks-fetch', fetch) # Bind `ready` to Tubolinks page:load $.setReadyEvent('page:load') # Bind fetch to Turbolinks page:fetch $.setFetchEvent('page:fetch') { tr,td,button,i } = React.DOM shared_filesystem_storage.AccessItem = React.createClass getInitialState: -> deleting: false handleDelete: (e) -> e.preventDefault() shared_filesystem_storage.ConfirmDialog.ask 'Are you sure?', #validationTerm: @props.shared_network.name description: 'Would you like to delete this access?' confirmLabel: 'Yes, delete it!' .then => @delete() .fail -> null delete: -> @setState deleting: true @props.ajax.delete "shares/#{@props.shareId}/rules/#{@props.rule.id}", success: () => @props.handleDeleteRule @props.rule error: ( jqXHR, textStatus, errorThrown ) => @setState deleting: null render: -> tr className: ('updating' if @state.deleting), td null, @props.rule.access_type td null, @props.rule.access_to td null, @props.rule.access_level td null, @props.rule.state td className: 'snug', button className: 'btn btn-danger btn-sm', onClick: @handleDelete, i className: 'fa fa-minus'React = require 'react' {div} = require 'reactionary' {debounce} = require 'underscore-plus' SubscriberMixin = require './subscriber-mixin' CursorComponent = require './cursor-component' module.exports = CursorsComponent = React.createClass displayName: 'CursorsComponent' mixins: [SubscriberMixin] cursorBlinkIntervalHandle: null render: -> {editor} = @props blinkOff = @state.blinkCursorsOff div className: 'cursors', for selection in editor.getSelections() when editor.selectionIntersectsVisibleRowRange(selection) {cursor} = selection CursorComponent({key: cursor.id, cursor, blinkOff}) getInitialState: -> blinkCursorsOff: false componentDidMount: -> {editor} = @props @subscribe editor, 'cursors-moved', @pauseCursorBlinking @startBlinkingCursors() startBlinkingCursors: -> @cursorBlinkIntervalHandle = setInterval(@toggleCursorBlink, @props.cursorBlinkPeriod / 2) startBlinkingCursorsAfterDelay: null # Created lazily stopBlinkingCursors: -> clearInterval(@cursorBlinkIntervalHandle) @setState(blinkCursorsOff: false) toggleCursorBlink: -> @setState(blinkCursorsOff: not @state.blinkCursorsOff) pauseCursorBlinking: -> @stopBlinkingCursors() @startBlinkingCursorsAfterDelay ?= debounce(@startBlinkingCursors, @props.cursorBlinkResumeDelay) @startBlinkingCursorsAfterDelay() `import Em from "vendor/ember"` Component = Em.Component.extend options: Em.computed "content.{options,prompt,is_optional}", -> prompt = @get "content.prompt" prompt = "" if not prompt and @get "content.is_optional" options = @get "content.options" if typeof prompt is "string" and prompt isnt options[0]?.label [ label: prompt, value: "" ].concat options else options isStatic: Em.computed "content.{options,editable,is_optional}", -> options = @get "content.options" isEditable = @get "editable" isOptional = @get "is_optional" if options.length is 1 and not isEditable and not isOptional @set "content.value", options[0].value true else false isCustom: Em.computed "options", "content.value", -> values = (o.value for o in @get "options") value = @get "content.value" value = "" if value is null value not in values customize: Em.computed "isCustom", -> @get "isCustom" actions: customize: -> @toggleProperty "customize" if not @get "customize" if @get "isCustom" @set "content.value", @get("options")[0].value Em.run.next => @$("input,select")[0].focus() `export default Component` _ = require 'underscore' { API_URL } = require('sharify').data Backbone = require 'backbone' RelatedLinksView = require '../view.coffee' Partners = require '../../../collections/partners.coffee' module.exports = class RelatedRepresentationsLinksView extends RelatedLinksView headerTemplate: _.template '

      Gallery Representation

      ' wrapperTemplate: _.template '' initialize: (options = {}) -> @collection = new Partners @collection.url = "#{API_URL}/api/v1/artist/#{options.id}/partners" @collection.fetch data: size: 20, represented_by: true super exports.loadUsers = (params, callback) -> if @isId params params = teamId: params else unless params and typeof params is 'object' throw new TSArgsError 'teamsnap.loadUsers', 'must provide a teamId or query parameters' @loadItems 'user', params, callback exports.loadMe = (callback) -> @collections.root.queryItem('me', callback) exports.saveUser = (user, callback) -> unless user throw new TSArgsError 'teamsnap.saveUser', "`user` must be provided" unless @isItem user, 'user' throw new TSArgsError 'teamsnap.saveUser', "`user.type` must be 'user'" unless user.email?.trim() return @reject 'You must provide an email for the user.', 'email', callback @saveItem user, callback exports.sendEmailValidation = (callback) -> @collections.users.exec('sendEmailValidation', userId).pop().callback callback class CMS.Views.ModuleEdit extends Backbone.View tagName: 'section' className: 'edit-pane' events: 'click .cancel': 'cancel' 'click .module-edit': 'editSubmodule' 'click .save-update': 'save' initialize: -> @$el.load @model.editUrl(), => @model.loadModule(@el) @$el.find('.preview').each (idx, previewEl) => @model.loadPreview(previewEl) save: (event) -> event.preventDefault() @model.save().success(-> alert("Your changes have been saved.") ).error(-> alert("There was an error saving your changes. Please try again.") ) cancel: (event) -> event.preventDefault() CMS.popView() editSubmodule: (event) -> event.preventDefault() CMS.pushView(new CMS.Views.ModuleEdit(model: new CMS.Models.Module(id: $(event.target).data('id'), type: $(event.target).data('type')))) ETahi.AuthorViewComponent = Ember.Component.extend DragNDrop.Dragable, classNames: ['authors-overlay-item'] classNameBindings: ['hoverState:__hover', 'isEditable:__editable'] editState: false hoverState: false deleteState: false attachHoverEvent: (-> self = this toggleHoverClass = (e) -> self.toggleProperty 'hoverState' @$().hover(toggleHoverClass, toggleHoverClass) ).on('didInsertElement') teardownHoverEvent: (-> @$().off('mouseenter mouseleave'); ).on('willDestroyElement') dragStart: (e) -> e.dataTransfer.effectAllowed = 'move' ETahi.set('dragItem', @get('author')) dragEnd: (e) -> DragNDrop.draggingStopped('.author-drop-target') actions: delete: -> @sendAction 'delete', @get('author') save: -> @sendAction 'save', @get('author') @set 'editState', false toggleEditForm: -> @toggleProperty 'editState' toggleDeleteConfirmation: -> @toggleProperty 'deleteState' Task = require 'task' describe "Task", -> describe "populating the window with fake properties", -> describe "when jQuery is loaded in a child process", -> it "doesn't log to the console", -> spyOn(console, 'log') spyOn(console, 'error') spyOn(console, 'warn') jqueryTask = new Task('fixtures/jquery-task-handler.coffee') jqueryLoaded = false jqueryTask.start (loaded) -> jqueryLoaded = loaded waitsFor "child process to start and jquery to be required", 5000, -> jqueryLoaded runs -> expect(jqueryLoaded).toBeTruthy() expect(console.log).not.toHaveBeenCalled() expect(console.error).not.toHaveBeenCalled() expect(console.warn).not.toHaveBeenCalled() describe 'Graph Editor', -> win = null doc = null before -> iframe = document.getElementById 'app' win = iframe.contentWindow doc = iframe.contentDocument describe 'component search', -> search = null it 'should initially show the breadcrumb', -> search = doc.querySelector 'noflo-search' chai.expect(search).to.be.an 'object' chai.expect(search.classList.contains('overlay')).to.equal true it 'when clicked it should show the search input', (done) -> breadcrumb = search.shadowRoot.querySelector '#breadcrumb' chai.expect(breadcrumb).to.be.an 'object' Syn.click breadcrumb setTimeout -> chai.expect(search.classList.contains('overlay')).to.equal false done() , 500 it 'should initially show results', (done) -> setTimeout -> chai.expect(search.results.length).to.be.above 10 done() , 1800 it 'should narrow them down when something is written', (done) -> input = search.shadowRoot.querySelector '#search' Syn.click(input) .type 'GetEle' setTimeout -> chai.expect(search.results.length).to.equal 1 done() , 1000 Darkswarm.directive "stripeElements", ($injector, StripeElements) -> restrict: 'E' template: "" link: (scope, elem, attr)-> if $injector.has('stripeObject') stripe = $injector.get('stripeObject') card = stripe.elements().create 'card', hidePostalCode: false style: base: fontFamily: "Roboto, Arial, sans-serif" fontSize: '16px' color: '#5c5c5c' '::placeholder': color: '#6c6c6c' card.mount('#card-element') # Elements validates user input as it is typed. To help your customers # catch mistakes, you should listen to change events on the card Element # and display any errors: card.addEventListener 'change', (event) -> displayError = document.getElementById('card-errors') if event.error displayError.textContent = event.error.message else displayError.textContent = '' return StripeElements.stripe = stripe StripeElements.card = card ((E, $) -> 'use strict' $(document).ready -> $('#lettersVisibility').on 'click', (e) -> E.accounts.changeUnmarkVisibility() $('#labelLettersVisibility').on 'click', (e) -> if $('#lettersVisibility').is(':checked') $('#lettersVisibility').prop('checked', false) else $('#lettersVisibility').prop('checked', true) E.accounts.changeUnmarkVisibility() E.accounts = changeUnmarkVisibility: -> unmarkLines = $('.active-list .unmark').closest('tr') if unmarkLines.is(':visible') unmarkLines.hide() else unmarkLines.show() ) ekylibre, jQuery _ = require 'underscore' Q = require 'bluebird-q' Backbone = require 'backbone' FilterArtworks = require '../../../../collections/filter_artworks.coffee' initCarousel = require '../../../../components/merry_go_round/index.coffee' template = -> require('./index.jade') arguments... module.exports = class HeroArtworksCarousel extends Backbone.View defaults: filterOptions: sort: '-partner_updated_at' for_sale: true size: 10 initialize: (options = {}) -> { @partner, @filterOptions } = _.defaults options, @defaults startUp: -> @fetchArtworks().then(@initCarousel).done() fetchArtworks: -> artworks = new FilterArtworks [] data = _.extend {}, @filterOptions, partner_id: @partner.get('id') Q(artworks.fetch data: data).then -> artworks initCarousel: (artworks) => return @remove() unless artworks.length >= 5 @$el.html template artworks: artworks initCarousel @$el, imagesLoaded: true $ -> $('.flash').delay(4000).fadeOut() $('#close_flash_early').click( -> closeFlashEarly()) closeFlashEarly = -> $('.flash').stop().fadeOut()kd = require 'kd' React = require 'kd-react' immutable = require 'immutable' ActivityFlux = require 'activity/flux' ChatPane = require 'activity/components/chatpane' module.exports = class PublicChatPane extends React.Component @defaultProps = thread : immutable.Map() messages : immutable.List() padded : no channel: (key) -> @props.thread?.getIn ['channel', key] onSubmit: ({ value }) -> return unless body = value name = @channel 'name' unless body.match ///\##{name}/// body += " ##{name} " ActivityFlux.actions.message.createMessage @channel('id'), body @moveScrollToBottom() moveScrollToBottom: -> ChatPaneWrapper = @refs.ChatPaneWrapper.getDOMNode() InfiniteScroll = ChatPaneWrapper.querySelector '.InfiniteScroll' InfiniteScroll.scrollTop = InfiniteScroll.scrollHeight onScrollThresholdReached: -> from = @props.messages.first().get('createdAt') ActivityFlux.actions.message.loadMessages @channel('id'), from render: ->
      path = require 'path' Module = require 'module' # Expose information of current process. process.__atom_type = 'renderer' process.resourcesPath = path.resolve process.argv[1], '..', '..', '..' # We modified the original process.argv to let node.js load the # atom-renderer.js, we need to restore it here. process.argv.splice 1, 1 # Add renderer/api/lib to require's search paths, which contains javascript part # of Atom's built-in libraries. globalPaths = Module.globalPaths globalPaths.push path.join(process.resourcesPath, 'renderer', 'api', 'lib') # And also common/api/lib. globalPaths.push path.join(process.resourcesPath, 'common', 'api', 'lib') # And also app. globalPaths.push path.join(process.resourcesPath, 'app') # Expose global variables. global.require = require global.module = module # Set the __filename to the path of html file if it's file:// protocol. if window.location.protocol is 'file:' global.__filename = window.location.pathname global.__dirname = path.dirname global.__filename # Also search for module under the html file. module.paths = module.paths.concat Module._nodeModulePaths(global.__dirname) else global.__filename = __filename global.__dirname = __dirname {CompositeDisposable} = require 'atom' MinimapBookmarksBinding = null module.exports = active: false isActive: -> @active activate: (state) -> @subscriptions = new CompositeDisposable consumeMinimapServiceV1: (@minimap) -> @minimap.registerPlugin 'bookmarks', this deactivate: -> @minimap?.unregisterPlugin 'bookmarks' @minimap = null activatePlugin: -> return if @active @active = true @minimapsSubscription = @minimap.observeMinimaps (minimap) => MinimapBookmarksBinding ?= require './minimap-bookmarks-binding' binding = new MinimapBookmarksBinding(minimap) @subscriptions.add subscription = minimap.onDidDestroy => binding.destroy() @subscriptions.remove(subscription) subscription.dispose() deactivatePlugin: -> return unless @active @active = false @minimapsSubscription.dispose() @subscriptions.dispose() mongoose = require 'mongoose' db = mongoose.connection TaskSet = require './models/taskset' saveCompletedTaskset = (tasksetData, callback) -> tasksetData.lock = false tasksetData.time.submit = new Date() tasksetData.time.workTime = tasksetData.time.submit - new Date(tasksetData.time.start) taskset = new TaskSet(tasksetData) TaskSet.findByIdAndUpdate(tasksetData._id, tasksetData, {upsert:true}, (err, taskset) -> callback(err, taskset) ) db.close() module.exports = saveCompletedTaskset Promise = require 'bluebird-q' { delay } = require 'underscore' Backbone = require 'backbone' template = -> require('./index.jade') arguments... module.exports = class NotificationsView extends Backbone.View events: 'click a': -> delay (=> @render()), 250 initialize: ({ @state }) -> @listenTo @collection, 'sync', @render @listenTo @state, 'change:unread_count', @render @listenTo @state, 'change:is_fetching', @render @$el .one 'mouseenter', => @state.set('is_fetching', true) Promise(@collection.fetch()) .then => @collection.clear() @state.set('is_fetching', false) .on 'mouseleave click', (e) => @state.set('unread_count', 0) @collection.markRead() render: -> @$el.html template feed: @collection unread_count: @state.get('unread_count') is_fetching: @state.get('is_fetching') this window.slackReadyFunction = (func) -> TS.groups.message_received_sig.add func TS.channels.message_received_sig.add func TS.ims.message_received_sig.add func TS.channels.switched_sig.add func TS.groups.switched_sig.add func TS.ims.switched_sig.add func func() Backbone.Factlink ||= {} Backbone.Factlink.AddModelToCollectionMixin = addModel: (model) -> @options.addToCollection.add(model) model.save {}, success: => @addModelSuccess(model) if @addModelSuccess error: => @options.addToCollection.remove(model) @addModelError(model) if @addModelError addDefaultModel: -> @addModel @model addWrappedModel: -> @addModel @wrapNewModel(@model) _ = require('underscore') YAML = require('libyaml') colors = require('colors') fs = require('fs') commander = require('commander') proxy = require('./proxy') commander .usage("Run it in the root of your project to start proxying requests as defined in the project's .vee file") .option('-p, --port [port number]', "port to run from", 80) .option('-d, --debug', "Output route matching debug info", false) .parse(process.argv) options = _.pick commander, 'port' try cfg = fs.readFileSync('.vee').toString('utf8') catch e if e.code is 'ENOENT' console.error ".vee configuration file not found in the current directory".red process.exit(1) else throw e try project = YAML.parse(cfg)[0] catch e console.error ".vee file is not valid YAML: #{ e.toString() }".red process.exit(1) options.routes = project.routes proxy.start options console.log "Proxy started on port #{ options.port }!".green module.exports = (observed, keys, callback) -> Object.observe observed, (changes) => for change in changes if change.name in keys callback() break remote = require "remote" dialog = remote.require "dialog" module.exports = class FileUtil constructor: () -> @prepareFile: (buffer) -> if buffer.file? && buffer.file.existsSync FileUtil.saveIfModified(buffer) else FileUtil.saveNewFile(buffer) @getPngFilePath:(file) -> pngFileName = FileUtil.getPngFilename(file) filePath = file.path.split('/') filePath.pop() filePath.join("/") + '/' + pngFileName # private @saveIfModified:(buffer) -> if buffer.isModified() buffer.save() !buffer.isModified() # no longer modified when successfully saved @saveNewFile:(buffer) -> path = dialog.showSaveDialog( {options:{title:'save plantuml file'}}) if path? buffer.setPath(path) buffer.save() !buffer.isModified() # no longer modified when successfully saved @getPngFilename:(file) -> fileName = path.basename(file.path) if fileName.indexOf('.') > -1 unsuffixedFileName = fileName.split('.') unsuffixedFileName.pop() fileName = unsuffixedFileName.join('.') fileName + '.png' {expect} = require "chai" utils = require "../utils" {Collections} = utils.require "common/base" describe "categorical mapper", -> mapper = null before -> mapper = Collections('CategoricalMapper').create( source_range: Collections('FactorRange').create factors: ['foo', 'bar', 'baz'] target_range: Collections('Range1d').create start: 20, 'end': 80 ) it "should map first category to bottom third", -> expect(mapper.map_to_target "foo").to.equal 30 it "should map second category to middle", -> expect(mapper.map_to_target "bar").to.equal 50 it "should map third category to upper third", -> expect(mapper.map_to_target "baz").to.equal 70 Template.room_list.helpers rooms: -> searchQuery = Session.get 'search-query' query = {} query.displayName = new RegExp searchQuery, 'i' Rooms.find query, { sort: { displayName: 1 } } Template.room_list.rendered = -> @$('[data-toggle="tooltip"]').tooltip() @$('[data-toggle="popover"]').each -> $(@).popover placement: 'auto left' html: true container: 'body' content: -> $(@).parent().find('.meta').html() Template.room_summary.helpers zoom: -> Session.get 'zoom' storage = require 'node-persist' storage.initSync() config = storage.getItemSync 'config' module.exports = getConfig: -> defaultDelay: 3 defaultDuration: 0.5 defaultTransition: "none" checkCycles: 20{ MEDIUM, CURRENT_USER } = require('sharify').data AuthModalView = require '../../../components/auth_modal/view.coffee' CTABarView = require '../../../components/cta_bar/view.coffee' module.exports = (artist) -> return unless MEDIUM is 'search' and not CURRENT_USER? name = 'artist_cta' ctaHeadline = "Get updates on new shows and works by #{artist.get('name')}." modalCopy = "Get the latest new shows and works by #{artist.get('name')}." ctaBarView = new CTABarView headline: ctaHeadline name: name persist: true modalOptions: copy: modalCopy destination: "#{artist.href()}/follow" unless ctaBarView.previouslyDismissed() $('body').append ctaBarView.render().$el $('#artist-page-section-works').waypoint (direction) -> ctaBarView.transitionIn() if direction is 'down' , { offset: 'bottom-in-view' } compile = (template, type) -> if 0 <= index = template.indexOf ' ' tmpl = template.substr 0, index attrs = template.substr index else tmpl = template [ name, classes... ] = tmpl.split /\.+/g if 0 is name.indexOf '#' id = name.substr 1 name = 'div' if name is '' name = 'div' beginTag = "<#{name}" beginTag += " id='#{id}'" if id beginTag += " class='#{classes.join ' '}'" if classes.length beginTag += attrs if attrs beginTag += ">" closeTag = "" if type is '=' (content) -> beginTag + (content or '') + closeTag else if type is '+' (content, arg0) -> #TODO add more args as necessary tag = replace beginTag, '{0}', arg0 tag + content + closeTag else (contents) -> beginTag + (contents.join '') + closeTag _templateCache = {} Flow.HTML = template: (templates...) -> for template in templates if cached = _templateCache[template] cached else type = charAt template, 0 if type is '=' or type is '+' _templateCache[template] = compile (template.substr 1), type else _templateCache[template] = compile template render: (name, html) -> el = document.createElement name if html if isString html el.innerHTML = html else el.appendChild html el #= require ./abstract_attribute_binding class Batman.DOM.EventBinding extends Batman.DOM.AbstractAttributeBinding onlyObserve: Batman.BindingDefinitionOnlyObserve.Data bindImmediately: false constructor: -> super callback = => func = @get('filteredValue') target = @view.targetForKeypathBase(@functionPath) return func?.apply(target, arguments) if attacher = Batman.DOM.events[@attributeName] attacher(@node, callback, @view) else Batman.DOM.events.other(@node, @attributeName, callback, @view) _unfilteredValue: (key) -> if not @functionName and (index = key.lastIndexOf('.')) != -1 @functionPath = key.substr(0, index) @functionName = key.substr(index + 1) else @functionPath = key value = super(@functionPath) if @functionName value?[@functionName] else value behaviours = {} share.attach = attach = (behaviour, args...) -> if _.isString behaviour options = behaviours[behaviour].options behaviour = behaviours[behaviour].behaviour if _.isFunction behaviour context = collection: @ options: options or {} behaviour.apply context, args else console.warn 'Behaviour not found' return class CollectionBehaviours @attach: (collection, args...) -> attach.apply collection, args @configure: (name, options) -> if name of behaviours behaviours[name].options = options else console.warn 'Configure failed, behaviour not found' @define: (name, behaviour, options) -> if name of behaviours and not options?.replace console.warn 'Behaviour already defined, use {replace: true} to override' else behaviours[name] = behaviour: behaviour Hummingbird.AnimeRoute = Ember.Route.extend model: (params) -> @store.find('fullAnime', params.id) saveLibraryEntry: (libraryEntry) -> anime = @currentModel Messenger().expectPromise (-> libraryEntry.save()), progressMessage: "Saving " + anime.get('canonicalTitle') + "..." successMessage: "Saved " + anime.get('canonicalTitle') + "!" actions: toggleFavorite: -> alert('Need to be signed in') unless @get('currentUser.isSignedIn') libraryEntry = @currentModel.get('libraryEntry') libraryEntry.set 'isFavorite', not libraryEntry.get('isFavorite') @saveLibraryEntry libraryEntry removeFromLibrary: -> anime = @currentModel libraryEntry = anime.get('libraryEntry') Messenger().expectPromise (-> libraryEntry.destroyRecord()), progressMessage: "Removing " + anime.get('canonicalTitle') + " from your library..." successMessage: "Removed " + anime.get('canonicalTitle') + " from your library!" setLibraryStatus: (newStatus) -> libraryEntry = @currentModel.get('libraryEntry') if libraryEntry libraryEntry.set 'status', newStatus else libraryEntry = @store.createRecord 'libraryEntry', status: newStatus anime: @currentModel @saveLibraryEntry libraryEntry setLibraryRating: (newRating) -> libraryEntry = @currentModel.get('libraryEntry') libraryEntry.set 'rating', newRating @saveLibraryEntry libraryEntry # Include lib. for file in ['buildable', 'arrayFilters', 'underscore'] Ti.include('lib/' + file + '.js') # Include expansions. for file in ['citiesAndKnights'] Ti.include('models/expansions/' + file + '.js') # Include models. for file in [ 'city', 'game', 'largestArmy', 'longestRoad', 'player', 'settlement', 'soldier', 'developmentCardVictoryPoint', 'gameSettings', 'knight', 'barbarians', 'catanDefense', 'barbariansBattleOutcome', 'defenderOfCatanCard', ] Ti.include('models/' + file + '.js') class Written.Cursor constructor: (element, selection) -> @element = -> element @selection = selection children = Array.prototype.slice.call(@element().children, 0) @offset = selection.focusOffset node = selection.focusNode while node && !children.includes(node) parent = node.parentElement if parent child = node.previousSibling while child @offset += child.toString().length child = child.previousSibling if node.nodeName == 'LI' this.offset += Array.prototype.indexOf.call(parent.children, node) node = parent for child in @element().children if child == node break @offset += child.toString().length @offset += 1 @currentNode = -> node offsetAt: (node) -> offset = @offset element = @element().firstElementChild while element && element != node offset -= element.toString().length element = element.nextElementSibling offset focus: (offset, node) => if offset is undefined offset = @offset if node is undefined node = @element().firstElementChild while node.nextElementSibling && node.toString().length < offset offset -= node.toString().length + 1 node = node.nextElementSibling range = node.getRange(Math.min(offset, node.toString().length), document.createTreeWalker(node, NodeFilter.SHOW_TEXT)) @selection.removeAllRanges() @selection.addRange(range) class AsciiIo.DataUnpacker unpack: (base64BzippedData, callback) -> bzippedData = atob base64BzippedData if window.Worker worker = new Worker(window.unpackWorkerPath) worker.onmessage = (event) => callback event.data worker.postMessage bzippedData else data = ArchUtils.bz2.decode bzippedData callback data React = require 'react' ClassificationsRibbon = require '../../components/classifications-ribbon' PromiseRenderer = require '../../components/promise-renderer' ProjectIcon = require '../../components/project-icon' module.exports = React.createClass getDefaultProps: -> user: null render: ->

      Your contribution stats

      Users can only view their own stats.

      {if @props.profileUser is @props.user # TODO: Braces after "style" here confuse coffee-reactify. That's really annoying. centered = textAlign: 'center'

      {projectPreferences.map (projectPreference) => if project? else null } />}
      } />
      else

      Sorry, we can’t show you stats for {@props.user.display_name}.

      }
      Math._random ?= Math.random pesudoRandomValues = [] pesudoRandom = -> pesudoRandomValues.shift() ? Math._random() pesudoRandom.MIN_VALUE = 0 pesudoRandom.MAX_VALUE = 0.99999999 pesudoRandom.push = -> pesudoRandomValues.push arguments... @ pesudoRandom.set = -> @clear() .push arguments... pesudoRandom.clear = -> pesudoRandomValues = [] @ pesudoRandom.attach = -> beforeEach -> pesudoRandom.clear() @ module.exports = Math.random = pesudoRandom Backbone = require 'backbone' template = -> require('./index.jade') arguments... module.exports = class HomePathFieldView extends Backbone.View className: 'Fieldset' events: 'change select': 'select' initialize: -> @listenTo @model, 'change:home_path', @render select: (e) -> $target = $(e.currentTarget) @model.set 'home_path', $target.val() render: -> @$el.html template user: @model this Crafty.c 'ShootOnSight', remove: -> @unbind('GameLoop', @_checkForShot) shootOnSight: (options) -> @shootConfig = _.defaults(options, targetType: 'PlayerControlledShip' sightAngle: 10 shootWhenHidden: no cooldown: 800 ) @bind('GameLoop', @_checkForShot) _checkForShot: (fd) -> if @lastShotAt? @lastShotAt += fd.dt return if @lastShotAt < @shootConfig.cooldown self = this Crafty(@shootConfig.targetType).each -> angle = Math.atan2(self.y - @y, self.x - @x) angle *= 180 / Math.PI angle = (angle + 360) % 360 self._shoot(angle) if Math.abs(angle - self.rotation) < self.shootConfig.sightAngle _shoot: (angle) -> return if @hidden and !@shootConfig.shootWhenHidden @lastShotAt = 0 wo = @weaponOrigin ? [0, 0] wo[0] *= (@scale ? 1) wo[1] *= (@scale ? 1) @shootConfig.projectile(wo[0] + @x, wo[1] + @y, angle) ######################################################## # AngularJS service to manipulate cookies ######################################################## angular.module('feedbunch').service 'cookiesSvc', ['$window', ($window)-> #--------------------------------------------- # Set an "accepted_cookies" cookie with value "true". This will make the cookies warning # (to comply with EU law) not to appear again. #--------------------------------------------- accept_cookies: -> $window.document.cookie = 'accepted_cookies=true' ]class NCopyUrlView extends JView constructor: -> super @path = FSHelper.plainPath @getData().path @publicPath = @path.replace \ ///.*\/(.*\.#{KD.config.userSitesDomain})\/(.*)///, 'http://$1/$2' @inputUrlLabel = new KDLabelView cssClass : 'public-url-label' title : 'Public URL' click :=> @focusAndSelectAll() @inputUrl = new KDInputView label : @inputUrlLabel cssClass : 'public-url-input' @inputUrl.setValue @publicPath focusAndSelectAll:-> @inputUrl.setFocus() @inputUrl.selectAll() viewAppended:-> @setClass "copy-url-wrapper" super pistachio:-> hasNoPublicPath = @publicPath is @path if hasNoPublicPath """
      This #{@getData().type} can not be reached over a public URL
      """ else """ {{> @inputUrlLabel}} {{> @inputUrl}} """Models = 'models/cube.js': name: 'Cube' 'models/sphere.js': name: 'Shere' 'models/torus.js': name: 'Torus' 'models/dragon.js': name: 'Dragon' scale: 1.2 'models/hexmkii.js': name: 'Hex MKII' scale: 0.01 'models/suzanne_low.js': name: 'Suzanne (low)' 'models/suzanne_high.js': name: 'Suzanne (high)' @shdr ||= {} @shdr.Models = Modelsclass window.RelatedChannelsView extends Backbone.Marionette.CompositeView className: "related-channels-for-channel" template: "channels/related_channels", itemViewContainer: "ul", itemView: RelatedChannelView itemViewOptions: => addToCollection : @addToCollection templateHelpers: => is_mine: this.model.get('created_by').username == currentUser.get('username') initialize: (options) -> @addToCollection = this.model.subchannels() @collection = collectionDifference(new ChannelList, 'id', this.model.relatedChannels(), this.addToCollection, [@model]); showEmptyView: => this.$el.hide() closeEmptyView: => this.$el.show() class @OverlayDimensions minMargin: 10 constructor: (overlayContent) -> @overlayContent = overlayContent @totalMargin = @minMargin * 2 @maxWidth = -> $(window).width() - @totalMargin width: -> @overlayContent.width() height: -> @overlayContent.height() margin: -> margin = (@maxWidth() - @width()) / 2 return margin unless margin < 1 @minMargin top: -> ($(window).height() - @height()) / 2 closeButtonLeftPosition: -> @width() - @closeButtonOffset #= require app/models/movie class App.Collections.Movies extends Backbone.Collection model: App.Models.Movie url: '/movies' ###* IndexController. Responsible for the index view. ### app.controller "IndexController", ($scope, $location) -> $scope.whatsMyName = "Welcome my friend" return class KeypathObserver constructor: (@view, @model, @keypath, @callback) -> @interfaces = (k for k, v of @view.adapters) @objectPath = [] @tokens = Rivets.KeypathParser.parse @keypath, @interfaces, @view.config.rootInterface @root = @tokens.shift() @key = @tokens.pop() @target = @realize() update: => unless (next = @realize()) is @target @callback @target = next realize: => current = @model for token, index in @tokens if @objectPath[index]? if current isnt prev = @objectPath[index] @view.adapters[token.interface].unsubscribe prev, token.path, @update @view.adapters[token.interface].subscribe current, token.path, @update @objectPath[index] = current else @view.adapters[token.interface].subscribe current, token.path, @update @objectPath[index] = current current = @view.adapters[token.interface].read current, token.path current define ['lodash', './dialogue', 'text!./template-dialogue.html'], (L, Ctrl, View) -> controller = (console, scope, Modals, connectTo) -> console.log scope.data scope.listName = scope.data.name scope.ids = scope.data.ids scope.type = scope.data.type scope.service = root: scope.data.root ? scope.data.service.root scope.showTemplates = -> console.log "showing templates at #{ scope.service.root }" connect = connectTo scope.service.root injected = model: -> connect.then (s) -> s.fetchModel() templates: -> connect.then (s) -> s.fetchTemplates() service: -> connect if list = scope.listName? injected.list = -> connect.then (s) -> s.fetchList list injected.items = -> null else if ids = scope.ids? injected.list = -> null injected.items = -> {ids: scope.ids, type: scope.type} modalInstance = Modals.open template: View controller: Ctrl size: 'lg' resolve: injected modalInstance.result.then (selectedTemplate) -> step = title: "Ran #{ selectedTemplate.name } over #{ scope.listName }" tool: 'show-table' data: service: root: scope.service.root query: selectedTemplate scope.appendStep data: step ['$log', '$scope', '$modal', 'connectTo', controller] defaults = require('lodash/defaults') shuffle = require('lodash/shuffle') class Game.LocationGrid constructor: (settings) -> settings = defaults settings, x: {} y: {} settings.x = defaults settings.x, start: 0 steps: 1 stepSize: 1 avoid: [] settings.y = defaults settings.y, start: 0 steps: 1 stepSize: 1 avoid: [] xs = @_coordList(settings.x) ys = @_coordList(settings.y) coords = [] for y in ys for x in xs xPerc = (x - settings.x.start) / (settings.x.stepSize * settings.x.steps) yPerc = (y - settings.y.start) / (settings.y.stepSize * settings.y.steps) coords.push { x, y, xPerc, yPerc } @freeCoords = shuffle coords _coordList: (listSettings) -> avoid = listSettings.avoid?() ? listSettings.avoid for i in [0...listSettings.steps] when i not in avoid listSettings.start + (i * listSettings.stepSize) getLocation: -> @freeCoords.pop() Helper = require('hubot-test-helper') nock = require('nock') expect = require('chai').expect helper = new Helper('../src/codenames.coffee') describe 'codenames', -> beforeEach -> nock('http://codenames.clivemurray.com') .get('/data/prefixes.json') .reply(200, [{title: 'black', attributes: ['colour']}]) .get('/data/animals.json') .reply(200, [{title: 'bat', attributes: ['air', 'mammal']}]) @room = helper.createRoom(http: false) afterEach -> @room.destroy() nock.cleanAll() context 'user asks for a suggestion', -> beforeEach (done) -> @room.user.say 'alice', 'hubot suggest a name' setTimeout done, 100 it 'responds to suggestions', -> expect(@room.messages).to.eql [ ['alice', 'hubot suggest a name'], ['hubot', '@alice How about BlackBat?'], ] Package = require 'package' fs = require 'fs' module.exports = class AtomPackage extends Package metadata: null keymapsDirPath: null autoloadStylesheets: true constructor: -> super @keymapsDirPath = fs.join(@path, 'keymaps') load: -> try @loadMetadata() @loadKeymaps() @loadStylesheets() if @autoloadStylesheets rootView?.activatePackage(@name, this) if require.resolve(@path) catch e console.warn "Failed to load package named '#{@name}'", e.stack this loadMetadata: -> if metadataPath = fs.resolveExtension(fs.join(@path, "package"), ['cson', 'json']) @metadata = fs.readObject(metadataPath) loadKeymaps: -> if keymaps = @metadata?.keymaps keymaps = keymaps.map (relativePath) => fs.resolve(@keymapsDirPath, relativePath, ['cson', 'json', '']) keymap.load(keymapPath) for keymapPath in keymaps else keymap.loadDirectory(@keymapsDirPath) loadStylesheets: -> for stylesheetPath in @getStylesheetPaths() requireStylesheet(stylesheetPath) getStylesheetPaths: -> stylesheetDirPath = fs.join(@path, 'stylesheets') fs.list(stylesheetDirPath) InquireViaPhoneModalView = require '../inquire_via_phone/index.coffee' module.exports = ($el) -> $el .find '.js-artwork-partner-stub-inquire-via-phone' .click (e) -> e.preventDefault() @modal = new InquireViaPhoneModalView width: '500px' copy: login: 'Log in to Artsy to call gallery' signup: 'Create an Artsy account to call gallery' register: 'Create an Artsy account to call gallery' artistIds: JSON.parse(e.toElement.dataset.artist_ids) userData: partner: JSON.parse(e.toElement.dataset.partner) $el .find '.js-artwork-partner-stub-phone-toggle' .click (e) -> e.preventDefault() $(this).hide() $el .find '.js-artwork-partner-stub-phone-toggleable' .show() _ = require 'underscore' React = require 'react' KatexMixin = require './katex-mixin' module.exports = React.createClass displayName: 'ArbitraryHtmlAndMath' propTypes: className: React.PropTypes.string html: React.PropTypes.string block: React.PropTypes.bool mixins: [KatexMixin] render: -> classes = ['has-html'] classes.push(@props.className) if @props.className classes = classes.join(' ') if @props.block
      else getHTMLFromProp: -> {html} = @props if html __html: html componentDidMount: -> # External links should open in a new window root = @getDOMNode() links = root.querySelectorAll('a') _.each links, (link) -> link.setAttribute('target', '_blank') unless link.getAttribute('href')?[0] is '#' # MathML should be rendered by MathJax (if available) window.MathJax?.Hub.Queue(['Typeset', MathJax.Hub, root]) module.exports = (name = '') -> { argv } = require 'optimist' express = require 'express' cors = require 'cors' helmet = require 'helmet' app = express() compression = require 'compression' bodyParser = require 'body-parser' app.use compression() app.use bodyParser.json() helmet.defaults app app.use cors() KONFIG = require 'koding-config-manager' app.get '/version', (req, res) -> res.send "#{KONFIG.version}" app.get '/healthCheck', (req, res) -> res.send "#{name} is running with version: #{KONFIG.version}" app.listen argv.p #require("./webgl-example/blue-thing") leaflet = require("leaflet") require("./rectangle_editor") $ = require("jquery") tilesUrl = 'http://skogsmaskin.asuscomm.com:3001/kartverk/{z}/{x}/{y}.png' tilesLayer = new L.TileLayer(tilesUrl); $ -> map = new L.Map('map'); map.addLayer(tilesLayer); map.setView(new L.LatLng(59.918893,10.739715), 10); do -> eRect = new L.RectangleEditor([[59.9,10.7],[59.928893,10.769715]],); map.addLayer(eRect); from = null to = null selectionRect = L.rectangle([[59.918893,10.739715], [59.918893,10.739715]], {color: "#ff7800", weight: 1, opacity: 0.5}) added = false drawSelection = ()-> selectionRect.setBounds([from, to]) selectionRect.addTo(map) and added = true unless added console.log('draw', from, ' => ', to) setTo = (e)-> console.log("omg") to = e.latlng drawSelection() endSelect = (e)-> console.log('end select', e.latlng) map.once 'click', beginSelect map.off 'mouseover', setTo beginSelect = (e)-> from = e.latlng to = e.latlng console.log('begin select from', from, 'to', to) map.once 'click', endSelect map.on 'mousemove', setTo map.once 'click', beginSelect module.exports = -> { dash } = require 'bongo' bongo = this (req, res, next) -> { channelName, queue: requestQueue } = req.body unless requestQueue?.length res.send 400 return responseQueue = new Array requestQueue.length workQueue = requestQueue.map (message, i) -> -> bongo.handleRequest channelName, { message }, (secretName, callbackId, args) -> bongo.scrubResponse callbackId, args, (message) -> responseQueue[i] = message workQueue.fin() dash workQueue, -> res.send responseQueue window.Cosmo = version: '0.1.0' # more # All apps should be an extended instance of this class class Cosmo.Router # app regions, assumes main content goes in a div#container regions: container: $('#container') initialize: -> # do initialization stuff and then start app routing # TODO: Do some url management start: -> @initialize() @go 'home' this # Takes an object with names and jquery selectors addRegions: (regions) -> for key, value of regions @regions[key] = $(value) this # set the value # TODO: Return value or this? (to allow chaining) set: (key, val) -> if val? this[key] = val else this[key] = null this get: (key) -> this[key] # main routing function go: (page, args...) -> if this[page]? this[page]?(args[0], args[1]) else @home() render: (view) -> @regions.container.html view class ledger.api.UnspentOutputsRestClient extends ledger.api.RestClient getUnspentOutputsFromAddresses: (addresses, callback) -> addresses = (address for address in addresses when Bitcoin.Address.validate(address) is true) query = _(addresses).join(',') @http().get(url: "blockchain/addresses/#{query}/unspents").done( (response) => l response callback?(response) ).fail (xhr, status, message) => callback(null, {xhr, status, message}) getUnspentOutputsFromPaths: (addressesPaths, callback) -> ledger.wallet.pathsToAddresses addressesPaths, (addresses, notFound) => l addressesPaths, addresses if notFound.length == addressesPaths.length callback? null, {title: 'Missing addresses', missings: notFound} else @getUnspentOutputsFromAddresses _.values(addresses), (outputs, error) => return callback?(null, error) if error? paths = _.invert(addresses) for output in outputs output.paths = [] output.paths.push paths[address] for address in output.addresses when paths[address]? callback?(outputs) ledger.api.UnspentOutputsRestClient.instance = new ledger.api.UnspentOutputsRestClient()Dashboard.PaginatedRouteMixin = Ember.Mixin.create actions: refreshPageData: (controller, page)-> query = $.extend(@controller.get('model')['query'], { page: page }) @store.findQuery(@controller.get('model').type, query).then (records)=> metadata = records.store.typeMapFor(records.type).metadata @controller.set('model', records) gotoPage: (page) -> @send('refreshPageData', @get('controller'), page) nextPage: -> current = @get('controller.model.meta.page') or 1 @gotoPage current + 1 previousPage: -> current = @get('controller.model.meta.page') or 0 @gotoPage current - 1 lastPage: -> last = @get('controller.model.meta.total_pages') or 1 @gotoPage last firstPage: -> @gotoPage 1 # Config and Start SyncedCron SyncedCron.config collectionName: 'rocketchat_cron_history' generateStatistics = -> statistics = RocketChat.statistics.save() statistics.host = Meteor.absoluteUrl() unless RocketChat.settings.get 'Statistics_opt_out' HTTP.post 'https://rocket.chat/stats', data: statistics return Meteor.startup -> Meteor.defer -> generateStatistics() # Generate and save statistics every hour SyncedCron.add name: 'Generate and save statistics', schedule: (parser) -># parser is a later.parse object return parser.text 'every 1 hour' job: generateStatistics SyncedCron.start() class app.models.Entry extends app.Model # Attributes: name, type, path SEPARATORS_REGEXP = /\:?\ |#|::/g PARANTHESES_REGEXP = /\(.*?\)$/ constructor: -> super @text = @searchValue() searchValue: -> @name .toLowerCase() .replace '...', ' ' .replace ' event', '' .replace SEPARATORS_REGEXP, '.' .replace /\.+/g, '.' .replace PARANTHESES_REGEXP, '' .trim() fullPath: -> @doc.fullPath if @isIndex() then '' else @path filePath: -> @doc.fullPath @_filePath() fileUrl: -> @doc.fileUrl @_filePath() _filePath: -> result = @path.replace /#.*/, '' result += '.html' unless result[-5..-1] is '.html' result isIndex: -> @path is 'index' getType: -> @doc.types.findBy 'name', @type loadFile: (onSuccess, onError) -> ajax url: @fileUrl() dataType: 'html' success: onSuccess error: onError # ************************************* # # Document Ready # # ************************************* jQuery ($) -> # ----- Functions ----- # Orientation.accordion() Orientation.autoSubmit() Orientation.dropdown() Orientation.headingLink() Orientation.search() Orientation.search $element : $( '.js-articleSearch' ) $form : $( '.js-articleSearch-form' ) $input : $( '.js-articleSearch-input' ) $results : $( '.js-articleSearch-results' ) callback : ( settings ) -> guidesElement = $( '.js-guideList' ) if settings.$input.val() guidesElement.addClass( 'dn' ) settings.$results.removeClass( 'dn' ) else guidesElement.removeClass( 'dn' ) settings.$results.addClass( 'dn' ) # ----- Modules ----- # Orientation.editor.init() Orientation.selectText.init() Orientation.tableBank.init() # ----- Vendor ----- # # Bootstrap $( '[data-toggle="tooltip"]' ).tooltip container : 'body' # jquery-ujs $( '#article_tag_tokens' ).tokenInput '/tags.json', prePopulate : $( '#article_tag_tokens' ).data( 'load' ) preventDuplicates : true define (require) -> Backbone = require('backbone') settings = require('settings') session = require('cs!session') analytics = require('cs!helpers/handlers/analytics') AppView = require('cs!pages/app/app') return new class Router extends Backbone.Router initialize: () -> @appView = new AppView() # Default Route @route '*actions', 'default', () -> @appView.render('error', {code: 404}) @route '', 'index', () -> @appView.render('home') @route 'contents', 'contents', () -> @appView.render('contents') @route 'workspace', 'workspace', () -> @appView.render('workspace') # Match and extract uuid and page numbers separated by a colon @route /^contents\/([^:]+):?([0-9]*)/, 'media', (uuid, page) -> uuid = uuid.toLowerCase() uuid = settings.shortcodes[uuid] if settings.shortcodes[uuid] @appView.render('contents', {uuid: uuid, page: Number(page)}) @route /^search/, 'search', () -> @appView.render('search') @route 'about-us', 'about-us', () -> @appView.render('about-us') @route 'people', 'people', () -> @appView.render('people') navigate: (fragment, options = {}, cb) -> super(arguments...) session.update() # Check for changes to the session status analytics.send() if options.analytics isnt false cb?() @trigger('navigate') angular.module('doubtfire.units.states.tasks.inbox', []) # # Task inbox for tasks to deal with # .config(($stateProvider) -> $stateProvider.state 'units/tasks/inbox', { parent: 'units/tasks' url: '/inbox/:taskId' templateUrl: "units/states/tasks/inbox/inbox.tpl.html" controller: "TaskInboxStateCtrl" data: task: "Task Inbox" pageTitle: "_Home_" roleWhitelist: ['Tutor', 'Convenor', 'Admin'] } ) .controller('TaskInboxStateCtrl', ($scope, Unit) -> $scope.taskSource = Unit.tasksForTaskInbox console.log("Set dataSource to ", $scope.dataSource) ) ".source.apl": Function: prefix: "fn" body: "∇${2:R ←} ${3:X} ${1:NAME} ${4:Y}\n\t$0\n∇" Operator: prefix: "op" body: "∇${2:R ←} ${3:X} (${4:LOP} ${1:NAME} ${5:ROP}) ${6:Y}\n\t$0\n∇" Assignment: prefix: "a" body: "${1:⎕ }← ${2:VALUE}" Hashbang: prefix: "#" body: "#!/usr/${3:local/bin/apl} ${2:--noCIN -f}$1" # GNU APL extensions "GNU Heredoc: Plain": prefix: "hd" body: "${1:result} ← '' ⎕INP '${2:RAWTEXT}'\n\t$0\n${2:RAWTEXT}" "GNU Heredoc: HTML": prefix: "html" body: "${1:result} ← '' ⎕INP '${2:END-}HTML'\n\t$0\n${2:END-}HTML" # Snippets scoped to heredocs containing foreign languages (like HTML) ".heredoc.apl .embedded": "GNU Heredoc: Embedded APL": prefix: "apl" body: "" class Postie listenCallback: null constructor: (options = {}) -> send: (frames, data, callback) -> console.log frames # Public: assign listener callback function listen: (callback) -> @listenCallback = callback @bindEventListener onMessage: (event) -> event = @parseEvent(event) console.log event @listenCallback(event) parseEvent: (rawEvent) -> new PostieEvent(rawEvent) bindEventListener: -> if typeof(window.addEventListener) is not 'undefined' window.addEventListener 'message', @onMessage, false else if typeof(window.attachEvent) is not 'undefined' window.attachEvent 'onmessage', @onMessage React = require 'react-atom-fork' {div} = require 'reactionary-atom-fork' module.exports = React.createClass getInitialState: -> firstRow: 0 lastRow: 0 totalRows: 0 rowHeight: 0 columnsWidth: [] render: -> {firstRow, lastRow, rowHeight, columnsWidth} = @state console.log columnsWidth rows = for row in [firstRow...lastRow] rowData = @props.table.getRow(row) columns = [] rowData.eachCell (cell,i) -> columns.push div className: 'table-edit-column', style: { width: columnsWidth[i] }, cell.getValue() div className: 'table-edit-row', style: { height: "#{rowHeight}px", top: "#{row * rowHeight}px" }, 'data-row-id': row + 1, columns div className: 'table-edit-content', style: { height: @getTableHeight() }, rows getTableHeight: -> @state.totalRows * @state.rowHeight module.exports = config = apiEndpoint: process.env.API_ENDPOINT ? 'https://api.resin.io' registryEndpoint: process.env.REGISTRY_ENDPOINT ? 'registry.resin.io' pubnub: subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY ? 'sub-c-bananas' publish_key: process.env.PUBNUB_PUBLISH_KEY ? 'pub-c-bananas' mixpanelToken: process.env.MIXPANEL_TOKEN ? 'bananasbananas' dockerSocket: process.env.DOCKER_SOCKET ? '/run/docker.sock' supervisorContainer: Volumes: '/boot/config.json': {} '/data': {} '/run/docker.sock': {} '/mnt/fib_trie': {} Binds: [ '/mnt/mmcblk0p1/config.json:/boot/config.json' '/var/run/docker.sock:/run/docker.sock' '/var/lib/docker/data:/data' '/proc/net/fib_trie:/mnt/fib_trie' ] class SidebarMachineBox extends KDView constructor: (options = {}, data) -> super options, data { machine } = data @addSubView @machineItem = new NavigationMachineItem {}, machine @createWorkspacesLabel() @createWorkspacesList() createWorkspacesList: -> { machine, workspaces } = @getData() @listController = new KDListViewController itemClass : NavigationWorkspaceItem itemOptions : { machine } for ws in workspaces @listController.addItem ws @addSubView @listController.getView() createWorkspacesLabel: -> @addSubView @workspacesLabel = new KDCustomHTMLView cssClass : 'workspaces-link' partial : 'Workspaces' click : => modal = new MoreWorkspacesModal {}, @getData().workspaces modal.once 'NewWorkspaceRequested', @bound 'showAddWorkspaceInput' showAddWorkspaceInput: -> if @addWorkspaceView @addWorkspaceView.input.setFocus() return no { machineUId, machineLabel } = @getData().machine @addWorkspaceView = new AddWorkspaceView {}, { machineUId, machineLabel } @addWorkspaceView.once 'KDObjectWillBeDestroyed', => @addWorkspaceView = null @listController.getView().addSubView @addWorkspaceView KD.utils.wait 177, => @addWorkspaceView.input.setFocus() {_, $, View} = require 'atom' module.exports = class WrapGuideView extends View @activate: -> atom.workspaceView.eachEditorView (editorView) -> if editorView.attached and editorView.getPane() editorView.underlayer.append(new WrapGuideView(editorView)) @content: -> @div class: 'wrap-guide' initialize: (@editorView) -> @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editorView, 'editor:path-changed', => @updateGuide() @subscribe @editorView, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getDefaultColumn: -> atom.config.getPositiveInt('editor.preferredLineLength', 80) getGuideColumn: (path) -> customColumns = atom.config.get('wrapGuide.columns') return @getDefaultColumn() unless _.isArray(customColumns) for customColumn in customColumns when _.isObject(customColumn) {pattern, column} = customColumn return parseInt(column) if pattern and new RegExp(pattern).test(path) @getDefaultColumn() updateGuide: -> column = @getGuideColumn(@editorView.getPath()) if column > 0 columnWidth = @editorView.charWidth * column if columnWidth < @editorView.layerMinWidth or columnWidth < @editorView.width() @css('left', columnWidth).show() else @hide() else @hide() module.exports = [{ # Bitbucket exps: [ /^git@(bitbucket\.org):(.+)\/(.+)\.git$/ /^https:\/\/(bitbucket\.org)\/(.+)\/(.+)\.git$/ /^https:\/\/.+@(bitbucket\.org)\/(.+)\/(.+)\.git$/ ] template: "https://{host}/{user}/{repo}/commits/{hash}" },{ # Generic (Github, GitLab and others) exps: [ /^git@(.*):(.+)\/(.+)\.git$/ /^https?:\/\/(.+)\/(.+)\/(.+)(\.git)?$/ /^https?:\/\/.+@(.*)\/(.+)\/(.+)(\.git)?$/ ] template: "https://{host}/{user}/{repo}/commit/{hash}" }] module.exports = { options: helperNameSuffix: '.js' specNameSuffix: 'spec.coffee' useHelpers: true unit: specs: [ 'test/unit/**' ] helpers: [ 'test/helpers/**' ] integration: specs: [ 'test/integration/**' ] helpers: [ 'test/helpers/**' ] } angular.module("admin.indexUtils").controller "ColumnsCtrl", ($scope, Columns) -> $scope.columns = Columns.columns $scope.predicate = "" $scope.reverse = false request = require("request") settings = require("settings-sharelatex") logger = require("logger-sharelatex") ErrorController = require "../Errors/ErrorController" module.exports = WikiController = getPage: (req, res, next) -> page = req.url.replace(/^\/learn/, "").replace(/^\//, "") if page == "" page = "Main_Page" wikiUrl = "#{settings.apis.wiki.url}/learn-scripts/api.php" logger.log page: page, "proxying request to wiki" request { url: wikiUrl qs: { page: page action: "parse" format: "json" } }, (err, response, data)-> if response?.statusCode == 404 return ErrorController.notFound(req, res, next) try data = JSON.parse(data) catch err logger.err err:err, data:data, "error parsing data from wiki" logger.log data: data, "got response from wiki" res.render "wiki/page", { content: data.parse.text['*'] title: data.parse.title } angular.module('kassa').factory('CacheService', [ '$q' '$parse' ($q, $parse)-> cache = {} [isUndefined, copy] = [angular.isUndefined, angular.copy] _writeToCache = (cacheObj, obj, key)-> if isUndefined(cacheObj[key]) cacheObj[key] = obj else #copy to ensure object references for the cached object stay intact and views are actually updated copy(obj, cacheObj[key]) set = (obj, prefix, field='id')-> $q.when(obj).then (obj)-> $parse("#{prefix}.#{obj[field]}").assign(cache, obj) get = (key, prefix)-> $q.when $parse("#{prefix}.#{key}")(cache) getAllByPrefix = (prefix)-> cachedData = $parse("#{prefix}")(cache) if isUndefined(cachedData) $q.when() else $q.when(_.toArray(cachedData)) {set, get, getAllByPrefix} ])window.ReactFeedSelection = React.createClass displayName: 'ReactFeedSelection' getInitialState: -> feedChoice: 'global' feeds: global: new GlobalFeedActivities personal: new PersonalFeedActivities handleFeedChoiceChange: (e) -> console.log(e,e.target,e.target.checked, e.target.value) if(e.target.checked) @setState feedChoice: e.target.value render: -> _div [], _div [], _input [ type: 'radio', name: 'FeedChoice', value: 'global', id: 'FeedChoice_Global', onChange: @handleFeedChoiceChange, checked: @state.feedChoice=='global' ] _label [ htmlFor: 'FeedChoice_Global' ], 'Global' _input [ type: 'radio', name: 'FeedChoice', value: 'personal', id: 'FeedChoice_Personal', onChange: @handleFeedChoiceChange, checked: @state.feedChoice=='personal' ] _label [ htmlFor: 'FeedChoice_Personal' ], 'Personal' ReactFeedActivities model: @state.feeds[@state.feedChoice] key: @state.feedChoice #= require_self #= require_tree . window.Neighborly = Common: initPage: -> that = this unless window.Turbolinks is undefined $(document).bind "page:fetch", -> that.Loading.show() $(document).bind "page:restore", -> that.Loading.hide() $(document).bind "page:change", -> $(window).scrollTop(0) try FB.XFBML.parse() try twttr.widgets.load() init: -> $(document).foundation('reveal', {animation: 'fadeIn', animationSpeed: 100}) $(document).foundation() finish: -> Loading: show: -> $('#loading #back-overlay, #loading #front-overlay').fadeIn(2) hide: -> $('#loading #back-overlay, #loading #front-overlay').fadeOut(2) 'use strict' app.factory('uploadService', [ '$q', '$sce', 'constantService', 'routerService', 'messageService', ($q, $sce, constants, router, messages) -> removedAsset: undefined flowOptions: () -> target: router.controllers.uploadChunk.route() method: 'octet' # chunkSize: 4194304 chunkSize: 500 # forceChunkSize: false forceChunkSize: true simultaneousUploads: 3 testChunks: false chunkRetryInterval: 5000 permanentErrors: [400, 403, 404, 409, 415, 500, 501] successStatuses: [200, 201, 202, 204], progressCallbacksInterval: 500 prioritizeFirstAndLastChunk: false headers: {'x-csverf': router.http.csverf} upload: (volume, file) -> file.pause() router.http(router.controllers.uploadStart, volume.id, filename: file.name size: file.size ).then (res) -> file.uniqueIdentifier = res.data file.resume() return , (res) -> messages.addError type: 'red' body: constants.message('asset.upload.rejected', {sce:$sce.HTML}, file.name.substr(file.name.lastIndexOf('.')+1)) report: res file.cancel() $q.reject(res) ]) ZXCVBN_SRC = '//dl.dropbox.com/u/209/zxcvbn/zxcvbn.js' # adapted from http://friendlybit.com/js/lazy-loading-asyncronous-javascript/ async_load = -> s = document.createElement 'script' s.src = ZXCVBN_SRC s.type = 'text/javascript' s.async = true first = document.getElementsByTagName('script')[0] first.parentNode.insertBefore s, first if window.attachEvent? window.attachEvent 'onload', async_load else window.addEventListener 'load', async_load, false # Contributed by Jason Huggins http: require 'http' server: http.createServer (req, res) -> res.writeHeader 200, {'Content-Type': 'text/plain'} res.write 'Hello, World!' res.close() server.listen 3000 puts "Server running at http://localhost:3000/" Monkey.registerView 'post', ''' div[id="monkey"] h1 title p body h3 "Comments" form[submit=postComment] p textarea[change=commentEdited] p input[type="submit" value="Post"] ul - collection comments - view comment ''' Monkey.registerView 'comment', ''' li p body p a[click=highlight href="#"] "Highlight" ''' class Post extends Monkey.Model @property 'title' @property 'body' @collection 'comments' class Comment extends Monkey.Model @property 'body' class PostController postComment: (event) -> @model.comments.push(@newComment) event.preventDefault() commentEdited: (event) -> @newComment = { body: event.target.value } class CommentController highlight: -> @view.style.backgroundColor = 'red' Monkey.registerController 'post', PostController Monkey.registerController 'comment', CommentController window.aPost = new Post() aPost.comments.update([{body: 'test'}, {body: 'another'}]) window.onload = -> view = Monkey.render('post', aPost) sandbox = document.body.appendChild(view) class AsciiIo.DataUnpacker unpack: (base64BzippedData, callback) -> data = atob base64BzippedData if data[0] == 'B' and data[1] == 'Z' if window.Worker worker = new Worker(window.unpackWorkerPath) worker.onmessage = (event) => callback event.data worker.postMessage data else data = ArchUtils.bz2.decode data callback data else callback data Settings = require "settings-sharelatex" logger = require "logger-sharelatex" _ = require "underscore" if !Settings.analytics?.postgres? module.exports = recordEvent: (user_id, event, segmentation, callback = () ->) -> logger.log {user_id, event, segmentation}, "no event tracking configured, logging event" callback() else Sequelize = require "sequelize" options = _.extend {logging:false}, Settings.analytics.postgres sequelize = new Sequelize( Settings.analytics.postgres.database, Settings.analytics.postgres.username, Settings.analytics.postgres.password, options ) Event = sequelize.define("Event", { user_id: Sequelize.STRING, event: Sequelize.STRING, segmentation: Sequelize.JSON }) module.exports = recordEvent: (user_id, event, segmentation = {}, callback = (error) ->) -> if user_id? and typeof(user_id) != "string" user_id = user_id.toString() if user_id == Settings.smokeTest?.userId # Don't record smoke tests analytics return callback() Event .create({ user_id, event, segmentation }) .then( (result) -> callback(), (error) -> logger.err {err: error, user_id, event, segmentation}, "error recording analytics event" callback(error) ) sync: () -> sequelize.sync()authentication = require 'passport' {Strategy} = require 'passport-linkedin' {VIE} = require "#{__dirname}/../palsu/static/deps/vie-2.0.0.js" vieRedis = require "#{__dirname}/../../lib/vie-redis" exports.getAuthentication = (config) -> vie = new VIE vie.namespaces.add 'foaf', 'http://xmlns.com/foaf/0.1/' vie.namespaces.add 'iks', 'http://www.iks-project.eu/#' profileToEntity = (profile) -> entity = vie.entities.addOrUpdate '@subject': "http://linkedin.com/#user/#{profile.id}" '@type': 'foaf:Person' 'foaf:name': profile.displayName , overrideAttributes: true entity authentication.use new Strategy consumerKey: config.linkedin.apiKey consumerSecret: config.linkedin.secretKey callbackURL: config.linkedin.callbackURL , (token, tokenSecret, profile, done) -> done null, profileToEntity profile authentication.serializeUser (user, done) -> user.save {}, success: -> done null, user.getSubjectUri() error: (err) -> done err, null authentication.deserializeUser (id, done) -> entity = vie.entities.addOrUpdate '@subject': id , overrideAttributes: true entity.fetch success: -> done null, entity error: (err) -> done err, null authentication config = require './config' if !config.env.development || require('piping')() # Server-side Google Closure for development. if config.env.development require '../../bower_components/closure-library/closure/goog/bootstrap/nodejs.js' require '../../tmp/deps.js' # Mock client-side stuff for server-side. global.React = require 'react' doc = require('jsdom').jsdom() global.window = doc.parentWindow global.document = doc.parentWindow.document # Require uncompiled/compiled server code. if config.env.development goog.require 'server.main' else require './build/app' server.main configclass App Routers: {} Models: {} Collections: {} Views: {} init: -> window.flight = new Flight() new @Routers.AppRouter Backbone.history.start() @Collections.Activities.fetch() window.app = new App ` String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; String.prototype.truncate = function(n,useWordBoundary) { var toLong = this.length>n, s_ = toLong ? this.substr(0,n-1) : this; s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_; return toLong ? s_ +'...' : s_; }; String.prototype.escapeHTML = function () { return(this.replace(/&/g,'&').replace(/>/g,'>').replace(/ len) ? this.substr(0, len) + "..." : this; } ` FactlinkJailRoot.showProxyMessage = -> content = """
      Factlink Browser
      """ frame = new FactlinkJailRoot.ControlIframe content frame.$el.css top: '10px' left: '10px' position: 'relative' frame.fadeIn() {View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => editor.underlayer.append(new WrapGuideView(editor)) if editor.attached @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) -> @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', columnWidth).show() else @hide() else @hide() class @IntermediateModel _events: {} data: [] constructor: -> @fetch() get: (key) -> @[key] set: (key, value, silent) -> @[key] = value if not @_events[key] or silent return for callback in @_events[key] (callback)() onChange: (key, callback) -> @_events[key] = @_events[key] or [] @_events[key].push(callback) fetch: -> setTimeout( => res = @genData() @set('data', res) , 300) genData: -> allData = [ { name: 'AAA', amount: 3000 } { name: 'BBB', amount: 1000 } { name: 'CCC', amount: 2000 } { name: 'DDD', amount: 5000 } { name: 'EEE', amount: 10000 } { name: 'FFF', amount: 1000 } { name: 'GGG', amount: 3000 } { name: 'HHH', amount: 1000 } { name: 'III', amount: 2000 } { name: 'JJJ', amount: 5000 } { name: 'KKK', amount: 10000 } ] allData.sort((x, y) -> Math.random() - Math.random() ) allData[0...5] jQuery -> #Pagination Demo $(".pagination a").click (e) -> e.preventDefault() if (!$(this).parent().hasClass("previous") && !$(this).parent().hasClass("next")) $(this).parent().siblings("li").removeClass("active") $(this).parent().addClass("active") $('.panel-content').scroll -> sidebar = $('.docs-sidebar') if $(window).width() > 767 console.log $(window).width() if $('.panel-content').scrollTop() >= 320 sidebar.addClass("affix") if $('.panel-content').scrollTop() < 320 sidebar.removeClass("affix") Emberella = window.Emberella get = Ember.get set = Ember.set Emberella.FocusableMixin = Ember.Mixin.create ### @property isFocusable @type Boolean @default true @final ### isFocusable: true attributeBindings: ['tabindex'] tabindex: 0 classNameBindings: [ 'hasFocus:focused' ] hasFocus: false focusIn: (e) -> e.stopPropagation() set @, 'hasFocus', true focusOut: (e) -> e.stopPropagation() set @, 'hasFocus', false #= override this file in your application to add custom behaviour $ -> $(".tinymce-trigger").click -> tinymce.init selector:'.tinymce-editable', plugins: "image link table media print charmap preview code" assert = require 'assert' webdriver = require 'selenium-webdriver' protractor = require 'protractor' dbhelper = require '../../lib/dbhelper' worldDefinition = () -> ptor = null driver = null class World constructor: (callback) -> @browser = ptor @By = protractor.By @assert = assert callback() capabilities = webdriver.Capabilities.chrome() # .merge # username: process.env.SAUCE_USERNAME # accessKey: process.env.SAUCE_ACCESS_KEY # name: 'gint-security protractor test' # browserName: 'Chrome' # platform: 'Windows 7' # 'record-video': true # 'tunnel-identifier': process.env.DRONE_BUILD_NUMBER @BeforeFeatures (event, callback) -> driver = new webdriver.Builder(). usingServer('http://192.168.1.72:4444/wd/hub'). withCapabilities(capabilities).build() ptor = protractor.wrapDriver driver ptor.driver.manage().timeouts().setScriptTimeout 10000 dbhelper.initializeDB callback @AfterFeatures (event, callback) -> driver.quit().then (err) -> callback err @World = World module.exports = worldDefinition$ -> myOptions = center: new google.maps.LatLng(-34.397, 150.644) zoom: 8 disableDefaultUI: true mapTypeId: google.maps.MapTypeId.ROADMAP map = new google.maps.Map(document.getElementById("centermap"), myOptions) upnp = require 'upnp' config = app: name: 'Bragi' version: '0.0.1' url: 'http://' device: type: 'MediaServer' version: '1.0' upnp.start config, -> console.log 'Bragi running! :-)' fs = require 'fs' path = require 'path' scripts = ['github-event-announcer.coffee'] module.exports = (robot) -> scriptsPath = path.resolve(__dirname, 'src') fs.exists scriptsPath, (exists) -> if exists for script in fs.readdirSync(scriptsPath) if scripts? and '*' not in scripts robot.loadFile(scriptsPath, script) if script in scripts else robot.loadFile(scriptsPath, script) { Disposable } = require 'atom' module.exports = class Syntax extends Disposable constructor: (latex) -> @latex = latex dollarsign: -> editor = atom.workspace.getActiveTextEditor() selected = editor.getSelectedText() if selected range = editor.getSelectedBufferRange() range.start.column += 1 range.end.column += 1 editor.insertText("""$#{selected}$""") editor.setSelectedBufferRange(range) return cursor = editor.getCursorBufferPosition() if editor?.buffer?.lines[cursor.row][cursor.column - 1] is ' ' if editor?.buffer?.lines[cursor.row].length is cursor.column or \ editor?.buffer?.lines[cursor.row][cursor.column] is ' ' editor.insertText('$$') editor.moveLeft() return editor.insertText('$') backquote: -> editor = atom.workspace.getActiveTextEditor() selected = editor.getSelectedText() if selected range = editor.getSelectedBufferRange() range.start.column += 1 range.end.column += 1 editor.insertText("""`#{selected}'""") editor.setSelectedBufferRange(range) return editor.insertText('`') doublequote: -> editor = atom.workspace.getActiveTextEditor() selected = editor.getSelectedText() if selected range = editor.getSelectedBufferRange() range.start.column += 1 range.end.column += 1 editor.insertText("""``#{selected}\'\'""") editor.setSelectedBufferRange(range) return editor.insertText('\"') module.exports = (grunt) -> # Project configuration grunt.initConfig { pkg: grunt.file.readJSON 'package.json' uglify: { options: { banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' } } coffee: { options: { sourceMap: true } compile: { files: { 'out/background.js': 'coffee/background.coffee' } } } copy: { main: { files: [ {expand: true, src:['html/*'], dest: 'out/', filter: 'isFile'}, {expand: true, src:['app/*'], dest: 'out/', filter: 'isFile'} ] } } build: { # Fill this out } } # Load uglify grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-copy' grunt.registerTask 'default', ['uglify']module.exports = (grunt) -> grunt.initConfig coffee: compile: files: 'test/test.js': 'test/*.coffee', 'dist/lib/geekywalletlib.js': 'lib/geekywalletlib.coffee' mochaTest: test: src: ['test/**/*.js'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-mocha-test' grunt.registerTask 'test', ['coffee', 'mochaTest'] window.Initjs = initialize: -> infos = $("#init-js") controllerClass = infos.data("controller-class") controllerName = infos.data("controller-name") action = infos.data("action") this.execFilter('init') this.exec(controllerClass, controllerName, action) this.execFilter('finish') this.appName() appName: -> appName = $("#init-js").data('app-name') || "App" window.App = window[appName] if window.App is undefined console.log "Initjs: #{appName} is not defined. Run `rails generate initjs` to generate the app file." exec: (controllerClass, controllerName, action) -> namespace = App if controllerClass railsNamespace = controllerClass.split("::").slice(0, -1) else railsNamespace = [] for name in railsNamespace namespace = namespace[name] if namespace if namespace and controllerName controller = namespace[controllerName] if controller and View = controller[action] App.currentView = window.view = new View() execFilter: (filterName) -> this.appName() if App.Common and typeof App.Common[filterName] == 'function' App.Common[filterName]() jQuery -> window.Initjs.execFilter('initPage') # If you are using the Turbolinks and you need to run a code only once. window.Initjs.initialize() if window.Turbolinks? $(document).bind "page:change", -> window.Initjs.initialize() mailer = null describe "Salad.Mailer", -> before -> mailer = new App.WelcomeMailer describe "#render", -> it "should render templates", -> content = mailer.render "rendering/test" content.should.equal "

      Hello World!

      " describe "#mail", -> todo = null beforeEach (done) -> App.Todo.create title: "Todo", (err, res) -> todo = res done() it "should send an email to the address", (done) -> mailer.welcome todo, (err, message) -> message.subject.should.equal "Your todos" message.to.should.equal "user@company.tld" message.from.should.equal "root@localhost" message.text.should.equal "text1" message.html.should.equal "html1" done()determineBrowser = -> [ 'chrome', 'firefox', 'safari', 'phantom_js', 'unsupported-browser' ] .filter( (browser) -> $('html.'+browser).length )[0] window.ReactInstallExtensionButton = React.createClass displayName: 'ReactInstallExtensionButton' render: -> extra_class = if @props.huge_button then 'button-huge' else null if document.documentElement.getAttribute('data-factlink-extension-loaded') != undefined _div [], _button ['button', extra_class, disabled: true], 'Factlink already installed.' else _div [], _div ['visible-when-chrome'], _a ['button-success', extra_class, href: 'javascript:chrome.webstore.install()'], _span ['install-chrome'] 'Install Factlink for Chrome' _div ['visible-when-firefox'], _a ['button-success', extra_class, href: 'https://static.factlink.com/extension/firefox/factlink-latest.xpi'], _span ['install-firefox'] 'Install Factlink for Firefox' _div ['visible-when-safari'], _a ['button-success', extra_class, href: 'https://static.factlink.com/extension/firefox/factlink.safariextz'], _span ['install-safari'] 'Install Factlink for Safari' # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # An example hack to make opened Markdown files have larger text: # # path = require 'path' # # atom.workspaceView.eachEditorView (editorView) -> # if path.extname(editorView.getEditor().getPath()) is '.md' # editorView.setFontSize(24) GitChanges = require './git-changes' module.exports = class Changes # The view-model for the root ChangesView constructor: -> @git = new GitChanges Wmsb.Views.MapView = Backbone.View.extend events: 'click a.student-name': 'updateCurrentStudent' initialize: (options) -> @mapEl = document.getElementById 'map-canvas' @currentAssignment = @collection.find (assignment) -> assignment.get('token') is cookie.get('current_assignment') @listenTo @collection, 'reset', @updateMarker _.bindAll this render: -> @map = new google.maps.Map @mapEl, { center: @currentAssignment.get('latLng') zoom: 12 mapTypeId: google.maps.MapTypeId.ROADMAP } @updateMarker() @intervalID = setInterval @refreshLocations, 60000 refreshLocations: -> @collection.fetch reset: true updateMarker: -> if @marker? @marker.setMap null @marker = new google.maps.Marker position: @currentAssignment.get 'latLng' map: @map title: @currentAssignment.get 'student_name' updateCurrentStudent: (event) -> @currentAssignment = @collection.find (assignment) -> assignment.get('student_name') is event.target.text cookie.set 'current_assignment', @currentAssignment.get('token') @updateMarker() class Lanes.Components.RecordFinder extends Lanes.React.Component propTypes: query: Lanes.PropTypes.State.isRequired model: Lanes.PropTypes.State.isRequired commands: React.PropTypes.object.isRequired contextTypes: viewport: Lanes.PropTypes.State.isRequired showFinder: -> body = Lanes.u.withReactContext @context, => @context.viewport.displayModal( body: body title: "Find #{@props.query.title}" buttons: [{title: 'Cancel'}] ).then(Lanes.emptyFn, Lanes.emptyFn) loadCurrentSelection: -> value = @props.model[@props.query.initialField.id] @props.query.loadSingle(value).then (model) => @props.commands.setModel(model) onKeyPress: (ev) -> if "Enter" == ev.key ev.stopPropagation() this.loadCurrentSelection() null render: -> findIcon =

      ) module.exports = Gem class window.GlobalFeedActivities extends Backbone.Factlink.Collection _.extend @prototype, AutoloadCollectionOnTimestamp model: Activity initialize: (models, options={}) -> @_count = options.count || 20 url: -> "/api/beta/feed.json?count=#{@_count}" class window.PersonalFeedActivities extends Backbone.Collection _.extend @prototype, AutoloadCollectionOnTimestamp model: Activity url: -> '/api/beta/feed/personal' Meteor.methods joinRoom: (rid, code) -> check rid, String check code, String if not Meteor.userId() throw new Meteor.Error 'error-invalid-user', 'Invalid user', { method: 'joinRoom' } room = RocketChat.models.Rooms.findOneById rid if not room? throw new Meteor.Error 'error-invalid-room', 'Invalid room', { method: 'joinRoom' } if room.t isnt 'c' or RocketChat.authz.hasPermission(Meteor.userId(), 'view-c-room') isnt true throw new Meteor.Error 'error-not-allowed', 'Not allowed', { method: 'joinRoom' } if room.joinCodeRequired is true and code isnt room.joinCode throw new Meteor.Error 'error-code-invalid', 'Invalid Code', { method: 'joinRoom' } RocketChat.addUserToRoom(rid, Meteor.user()) Meteor.methods registerUser: (formData) -> userData = email: formData.email password: formData.pass userId = Accounts.createUser userData Meteor.users.update userId, $set: name: formData.name if userData.email Accounts.sendVerificationEmail(userId, userData.email); angular.module('doubtfire.admin.states', [ 'doubtfire.admin.states.units' 'doubtfire.admin.states.users' ]) servers = { official: 'sync.nitrotasks.com:443' localhost: 'localhost:8080' } # Set active server active = servers.official module.exports = sync: active server: active + '/api' email: active + '/email' Tinytest.add 'Google Translate - should translate text' , (test)-> translation = GoogleTranslate.translate("my name is Brandon", "es") expect(translation).to.be.a("string") expect(translation).to.equal("mi nombre es Brandon") Tinytest.add 'Google Translate - should translate text with multiple lines' , (test)-> translation = GoogleTranslate.translate("my name is Brandon\ni like apples\n", "es") expect(translation).to.be.a("string") expect(translation).to.equal("mi nombre es Brandon\nMe gustan las manzanas\n") $ -> new Dispatcher() class Dispatcher constructor: () -> @initSearch() @initPageScripts() initPageScripts: -> page = $('body').attr('data-page') project_id = $('body').attr('data-project-id') console.log(page) path = page.split(':') switch page when 'issues:index' Issues.init() when 'dashboard:show' new Dashboard() when 'commit:show' new Commit() when 'groups:show', 'teams:show', 'projects:show' Pager.init(20, true) when 'projects:new', 'projects:edit' new Project() when 'walls:show' new Wall(project_id) switch path.first() when 'admin' then new Admin() when 'wikis' then new Wikis() initSearch: -> autocomplete_json = $('.search-autocomplete-json').data('autocomplete-opts') new SearchAutocomplete(autocomplete_json) class PanelView extends HTMLElement initialize(@linter)-> @id = 'linter-panel' @decorations = [] removeDecorations: -> return unless @decorations.length @decorations.forEach (decoration) -> try decoration.destroy() @decorations = [] render: (messages)-> @removeDecorations() @innerHTML = '' messages.forEach (message)=> return unless message.currentFile # A custom property added while creating arrays of them return unless message.position return if @type is 'file' and (not message.currentFile) p = message.position range = [[p[0][0] - 1, p[0][1] - 1], [p[1][0] - 1, p[1][1]]] marker = @linter.activeEditor.markBufferRange range, {invalidate: 'never'} @decorations.push @linter.activeEditor.decorateMarker( marker, type: 'line-number', class: 'line-number-' + message.type.toLowerCase() ) @decorations.push @linter.activeEditor.decorateMarker( marker, type: 'highlight', class: 'highlight-' + message.type.toLowerCase() ) @appendChild @linter.view.messageLine message, @linter.views.type is 'project' module.exports = PanelView = document.registerElement('linter-panel-view', {prototype: PanelView.prototype})$(document).on "page:change", -> if $("body[data-controller=ships][data-action=index]").get 0 $(".ship-thumb").click -> $("#ship-selection").val $(this).data "ship-id" $('html, body').animate({ scrollTop: $("#purchase-form").offset().top }, 2000) $ -> $("div.tag-form").hide() $("div.tag-form li.cancel a").live "click", -> $("div.tags").show() $("div.tag-form").hide() false $("a[rel='edit-tags']").live "click", -> $("div.tags").hide() $("div.tag-form").show() false $("form.edit-tags").live "ajax:success", (e, data, status, xhr) -> $("div.tags").html(data.tagpanel).show() $("div.tag-form").hide() $("section.library.box").replaceWith(data.librarypanel) if data.librarypanel ### Examples TUTUM_REDIS_HOST=127.0.0.1 TUTUM_REDIS_PORT=6379 TUTUM_CLIENT_NAME=mywebsite TUTUM_CLIENT_HOST=www.dotcloud.com TUTUM_CLIENT_ADDRESS=http://192.168.0.42:80 ### if process.env.TUTUM_REDIS_HOST? redis = Npm.require 'redis' process.env.TUTUM_REDIS_PORT ?= 6379 client = redis.createClient(process.env.TUTUM_REDIS_PORT, process.env.TUTUM_REDIS_HOST) client.del("frontend:#{process.env.TUTUM_CLIENT_HOST}") client.rpush('frontend:#{process.env.TUTUM_CLIENT_HOST}', process.env.TUTUM_CLIENT_NAME) client.rpush('frontend:#{process.env.TUTUM_CLIENT_HOST}', process.env.TUTUM_CLIENT_ADDRESS) '.platform-darwin .editor': 'cmd-:': 'spell-check:correct-misspelling' '.platform-win32 .editor': 'ctrl-:': 'spell-check:correct-misspelling' define (require) -> BaseView = require('cs!helpers/backbone/views/base') HeaderView = require('cs!modules/header/header') FooterView = require('cs!modules/footer/footer') FindContentView = require('cs!modules/find-content/find-content') DefaultView = require('cs!./default/default') PeopleView = require('cs!./people/people') template = require('hbs!./about-template') require('less!./about') return class AboutPage extends BaseView template: template pageTitle: 'About OpenStax College' regions: find: '.find' content: '.about-content' initialize: (options = {}) -> super() @page = options.page onRender: () -> @parent.regions.header.show(new HeaderView({page: 'about'})) @parent.regions.footer.show(new FooterView({page: 'about'})) @regions.find.show(new FindContentView()) switch @page when 'people' @regions.content.show(new PeopleView()) else @regions.content.show(new DefaultView()) showPopup = (url) -> width = 640 height = 480 left = (screen.width/2)-(width/2) top = (screen.height/2)-(height/2) popup_window = window.open url, "authPopup", "menubar=no,toolbar=no,status=no,width=#{width},height=#{height},left=#{left},top=#{top}" popup_window.focus() $('html').on 'click', '.js-accounts-popup-link', (e) -> showPopup($(e.target).closest('.js-accounts-popup-link').attr("href")) e.stopPropagation() e.preventDefault() $(document).on 'account_success', (e) -> FactlinkApp.refreshCurrentUser JSON.parse(e.originalEvent.detail) mp_track 'User: Sign in' $(document).on 'account_error', (e) -> if typeof FactlinkApp == 'object' FactlinkApp.NotificationCenter.error(e.originalEvent.detail) else _.defer -> alert(e.originalEvent.detail) fs = require 'fs' path = require 'path' module.exports = (robot, scripts) -> scriptsPath = path.resolve(__dirname, 'src') fs.exists scriptsPath, (exists) -> if exists for script in fs.readdirSync(scriptsPath) if scripts? and '*' not in scripts robot.loadFile(scriptsPath, script) if script in scripts else robot.loadFile(scriptsPath, script)keychain = require './utils/keychain' config = use: (platform) -> for key, value of config[platform] config[key] = value production: url: 'http://sync.nitrotasks.com:443' port: process.env.PORT || 8080 mysql: host: keychain 'sql_host' port: keychain 'sql_port' user: keychain 'sql_user' password: keychain 'sql_pass' database: keychain 'sql_db' development: url: 'http://localhost:8080' port: process.env.PORT || 8080 mysql: host: '127.0.0.1' port: 3306 user: 'nodejs' password: 'nodejs' database: 'Nitro' testing: url: 'http://localhost:8080' port: 8080 mysql: host: '127.0.0.1' port: 3306 user: 'nodejs' password: 'nodejs' database: 'Nitro_Test' module.exports = config $(document).on 'click', 'a[data-clear-form]', (event) -> event.preventDefault() $(event.currentTarget).closest('form').trigger('clear') $(document).on 'clear', '.effective-datatable-scopes form', (event) -> $(this).find('.radio.active').removeClass('active'); $(this).find(':radio').prop('checked', false); $(this).submit()define [ "base" ], (App) -> App.controller 'CloneProjectModalController', ($scope, $modalInstance, $timeout, $http, ide) -> $scope.inputs = projectName: ide.$scope.project.name + " (Copy)" $scope.state = inflight: false error: false $modalInstance.opened.then () -> $timeout () -> $scope.$broadcast "open" , 200 cloneProject = (cloneName) -> $http.post("/project/#{ide.$scope.project._id}/clone", { _csrf: window.csrfToken projectName: cloneName }) $scope.clone = () -> $scope.state.inflight = true $scope.state.error = false cloneProject($scope.inputs.projectName) .success (data) -> window.location = "/project/#{data.data.project_id}" .error (body, statusCode) -> $scope.state.inflight = false if statusCode == 400 $scope.state.error = { message: body } else $scope.state.error = true $scope.cancel = () -> $modalInstance.dismiss('cancel'){View} = require 'atom' module.exports = class SelectionCountView extends View @content: -> @div class: "selection-count inline-block" initialize: (@statusBar) -> @subscribe atom.workspaceView.eachEditorView (editor) => @subscribe editor, "selection:changed", @updateCount @subscribe atom.workspaceView, "pane-container:active-pane-item-changed", @updateCount destroy: -> @remove() afterAttach: -> @updateCount() updateCount: => count = atom.workspace.getActiveEditor()?.getSelection().getText().length if count > 0 @text("(#{count})").show() else @hide() mod = angular.module("player") mod.controller("BrowseCtrl", ($scope, $stateParams, $state, library, playlist) -> "use strict" that = this $scope.library = library that.breadcrumbs = (uri) -> parts = uri.split("/") { label: part, path: parts[0..i].join("/") } for part, i in parts $scope.$on "$stateChangeSuccess", (event, toState, toParams, fromState, fromParams) -> toParams.uri ?= "/" library.ls(toParams.uri).then (data) -> $scope.items = data $scope.breadcrumbs = that.breadcrumbs(toParams.uri) $scope.showActions = (e) -> e.preventDefault() e.stopPropagation() ) module.exports = usernameChanged = ({ oldUsername, username, isRegistration }) -> return unless oldUsername and username return if isRegistration JMachine = require '../machine' console.log "Removing user #{oldUsername} vms..." JMachine.update provider : { $in: ['koding', 'managed'] } credential : oldUsername , $set : userDeleted : yes , multi : yes , (err) -> if err? console.error \ "Failed to mark them as deleted for #{oldUsername}:", err class Shothere.Routers.MoviesRouter extends Backbone.Router initialize: (options) -> @movies = new Shothere.Collections.MoviesCollection() @movies.reset options.movies if options.movies @movies.on( 'add', @index, @) routes: "new" : "newMovie" "index" : "index" ":id/edit" : "edit" ":id" : "show" ".*" : "index" newMovie: -> @view = new Shothere.Views.Movies.NewView(collection: @movies) $("#movies").html(@view.render().el) index: -> @view = new Shothere.Views.Movies.IndexView(movies: @movies) $("#movies").html(@view.render().el) show: (id) -> movie = @movies.get(id) @view = new Shothere.Views.Movies.ShowView(model: movie) $("#movies").html(@view.render().el) edit: (id) -> movie = @movies.get(id) @view = new Shothere.Views.Movies.EditView(model: movie) $("#movies").html(@view.render().el) # Description: # Listens for words and sometimes replies with an Arnie quote # # Dependencies: # None # # Commands: # None # # Author: # Casey Lawrence # odds = [1...100] arnie_quotes = [ 'GET TO THE CHOPPA!', 'Your clothes, give them to me, NOW!', 'Hasta La Vista, Baby!', 'DDDAAANNNAAAA!', 'You are one ugly mothersucker.', 'It`s not a tumor!', 'When I said you should screw yourself I didn`t mean it literally.', 'Can you hurry up. My horse is getting tired.', 'Are these all your lunches? You mean you eat other peoples` lunches? STOP IT!!', 'I`m the party pooper.', 'Who is your daddy and what does he do?' ] module.exports = (robot) -> robot.hear /(^|\s)arnie(\s|$|[\W])/ig, (msg) -> val = msg.random odds if val > 0 # Set Arnie to reply 100% for now msg.send msg.random arnie_quotes robot.hear /(^|\s)arnold(\s|$|[\W])/ig, (msg) -> val = msg.random odds if val > 0 # Set Arnie to reply 100% for now msg.send msg.random arnie_quotes# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ (($) -> $('input.date').live 'click focus', -> $(this).datepicker({ showOn: 'focus', changeMonth: true, dateFormat: 'yy-mm-dd'}) $('input.datetime').live 'click focus', -> $(this).datetimepicker({ showOn: 'focus', changeMonth: true, dateFormat: 'yy-mm-dd'}) ) jQuery require './shim/phantomjs-bind' window.Promise = require 'bluebird' window.Rdb = require('rdb/index') class TestRunner running: false results: {} instance = null @get: -> instance ?= new TestRunner(); constructor: ()-> Meteor.startup => console.log 'TestRunner: Meteor.startup' Tracker.autorun @onVelocityIsReady onVelocityIsReady: => console.log 'onVelocityIsReady:' return if not velocity.isReady() or @running @runTests() runTests: -> @results = {} @running = true; console.info 'Calling Tinytest._runTestsEverywhere()' Tinytest._runTestsEverywhere @onNewTestReport, @onTestsCompleted, ["tinytest"] onNewTestReport: (report)=> log.debug 'onNewTestReport:', report testName = TinytestResult.getUniqueTestName(report) result = @results[testName] ?= new TinytestResult(testName, report) result.processEvents(report) return if not result.done velocityResult = result.toVelocityResult() log.debug "Reporting the following test result to velocity:", velocityResult velocity.postResult velocityResult onTestsCompleted: ()-> console.log "TestRunner: tests completed." @running = false @results = {} #Tracker.flush(); Meteor.connection._unsubscribeAll() @testRunner = TestRunner.get() App.CategoriesRoute = Em.Route.extend model: -> App.Category.findAll() setupController: (controller, model) -> @_super controller, model @set 'unassigned', model.findBy('system_type', 'unassigned') class @FlexibilityOrder constructor: (@element) -> # pass url: (path) -> "#{ App.scenario.url_path() }/flexibility_order/#{ path }" update: (order) => $.ajax url: @url('set'), type: 'POST', data: flexibility_order: order: order, scenario_id: App.scenario.api_session_id() success: -> App.call_api() error: (e,f) -> console.log('Throw error') render: => $.ajax url: @url('get') type: 'GET' success: (data) => console.log @element Sortable.create @element, ghostClass: 'ghost' animation: 150 store: get: (sortable) -> data.order set: (sortable) => @update(sortable.toArray().concat(['curtailment'])) linterPath = atom.packages.getLoadedPackage("linter").path Linter = require "#{linterPath}/lib/linter" class LinterJshint extends Linter # The syntax that the linter handles. May be a string or # list/tuple of strings. Names should be all lowercase. @syntax: ['source.js', 'source.js.jquery', 'text.html.basic'] # , 'text.html.twig', 'text.html.erb', 'text.html.ruby'] # A string, list, tuple or callable that returns a string, list or tuple, # containing the command line (with arguments) used to lint. cmd: 'jshint --verbose --extract=auto' linterName: 'jshint' # A regex pattern used to extract information from the executable's output. regex: '((?ERROR: .+)|' + '.+?: line (?[0-9]+), col (?[0-9]+), ' + '(?.+) ' + # capture error, warning and code '\\(((?E)|(?W))(?[0-9]+)\\)'+ # '\\((?.).+\\)' ')' constructor: (editor)-> super(editor) atom.config.observe 'linter-jshint.jshintExecutablePath', => @executablePath = atom.config.get 'linter-jshint.jshintExecutablePath' destroy: -> atom.config.unobserve 'linter-jshint.jshintExecutablePath' module.exports = LinterJshint # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps # '.workspace': # 'ctrl-alt-o': 'textmate:toggle' 'body.platform-darwin': 'ctrl-alt-cmd-d': 'tree-view:toggle' 'alt-cmd-tab': 'tree-view:toggle-focus' 'ctrl-cmd-r': 'tree-view:reveal-active-file' 'ctrl-cmd-t': 'command-palette:toggle' 'body.platform-darwin .editor': 'ctrl-D': 'editor:duplicate-line' 'cmd-L': 'editor:select-line' 'body.platform-darwin .workspace': 'cmd-O': 'textmate:open-favs' 'body.platform-darwin .tree-view': 'cmd-down': 'tree-view:open-selected-entry' class ImageListWidget constructor: (images) -> @imgs = images @binder = new Binder() onCreate: () -> @binder.bindAction( Rx.Observable .fromEvent($(window), 'resize') .map(() => $(window).height()) .startWith($(window).height()), (h) => @height = h ) @binder.bindAction( Rx.Observable .fromEvent($(window), 'scroll') .map(() => Unit.create()) .startWith(Unit.create()), () => @reveal() ) onDestroy: () -> @binder.detach() getScroll: () -> $('body').scrollTop() isVisible: (e) -> extra = @height * .5 0 - extra <= e.offset().top - @getScroll() <= @height + extra isContentSet: (e) -> e.attr('data-js-was-set') is 1 setContent: (e) -> url = e.attr('data-src') e.css('background-image', "url(#{url})") e.attr('data-js-was-set', 1) reveal: () -> @imgs.each (i, e) => f = $(e) @setContent(f) if @isVisible(f) and !@isContentSet(f) module.exports = instance: null config: lintOnFly: title: 'Lint on fly' description: 'Lint files while typing, without the need to save them' type: 'boolean' default: true showErrorInline: type: 'boolean' default: true activate: -> @instance = new (require './linter-plus.coffee') atom.config.observe 'linter-plus.lintOnFly', (lintOnyFly) => @instance.lintOnFly = lintOnyFly legacy = require('./legacy.coffee') for atomPackage in atom.packages.getLoadedPackages() if atomPackage.metadata['linter-package'] is true implementation = atomPackage.metadata['linter-implementation'] ? atomPackage.name linter = legacy(require "#{atomPackage.path}/lib/#{implementation}") @consumeLinter(linter) if atomPackage.metadata.providedServices?['linter-plus']?.versions['0.1.0'] atom.notifications.addWarning("#{atomPackage.name} still provides `linter-plus` this has been depricated in favor of `linter`") consumeLinter: (linter) -> @instance.linters.push linter consumeStatusBar: (statusBar) -> @instance.views.attachBottom(statusBar) provideLinter: -> @Linter deactivate: -> @instance?.deactivate() fs = require('fs') _ = require('lodash') # Check if valid path # # @private # # @param {String} path path # @return {Boolean} is valid path # # @todo There should be more complex checks here # # @example Is valid path? # console.log isValidPath('/Users/me') # True # console.log isValidPath([ 1, 2, 3 ]) # False # exports.isValidPath = (p) -> return _.isString(p) # Check if path is directory # # @private # # @param {String} directory directory # @param {Function} callback callback(error, isDirectory) # # @example Is directory? # console.log isDirectory('/usr/local/share') # True # console.log isDirectory('/Users/me/app.js') # False # exports.isDirectory = (directory, callback) -> fs.stat directory, (error, stats) -> return callback?(error) if error? return callback?(null, stats.isDirectory()) # Show current Heroku status module.exports = (robot) -> robot.respond /heroku status/, (msg) -> msg.http("https://status.heroku.com/status.json") .get() (err, res, body) -> try json = JSON.parse(body) msg.send "App Operations: #{json['App Operations']}\n" + "Tools: #{json['Tools']}\n" catch error msg.send "Uh oh, I had trouble figuring out what the Heroku cloud is up to." xhr = require 'xhr' class Crowdstart endpoint: "https://api.crowdstart.com" constructor: (@key) -> setKey: (key) -> @key = key req: (uri, data, cb) -> xhr uri: (@endpoint.replace /\/$/, '') + uri method: 'POST' headers: 'Content-Type': 'application/json' 'Authorization': @key json: data , (err, res, body) -> cb res.statusCode, body, res.headers.location authorize: (data, cb) -> @req '/authorize', data, cb charge: (data, cb) -> @req '/charge', data, cb module.exports = Crowdstart jQuery -> $('.results_round').dataTable bPaginate: false bInfo: false sDom: 't' aoColumnDefs: [ aTargets: ['recalled_header', 'adjudicator_header'] bSearchable: false ] $('.results_round').floatThead() $(document).ready -> if $('[contenteditable!=false]').length > 0 for elementId in ['body_editable', 'abstract_editable'] CKEDITOR.inline elementId, extraPlugins: 'sharedspace' removePlugins: 'floatingspace,resize' sharedSpaces: top: 'ckeditor-toolbar' $('#save_button').on 'click', (e) -> e.preventDefault() $.ajax url: $(this).data('url') + '.json' method: "PUT" data: paper: title: $.trim($('#title_editable').text()) body: CKEDITOR.instances.body_editable.getData() abstract: CKEDITOR.instances.abstract_editable.getData() short_title: $.trim($('#short_title_editable').text()) success: window.location = "/" class ApplicationTabHandleHolder extends KDView constructor: (options = {}, data) -> options.cssClass = KD.utils.curry "application-tab-handle-holder", options.cssClass options.bind = "mouseenter mouseleave" options.addPlusHandle ?= yes super options, data if options.addPlusHandle @on 'PlusHandleClicked', => @getDelegate().addNewTab() viewAppended: -> @addPlusHandle() if @getOptions().addPlusHandle addPlusHandle: -> @addSubView @plusHandle = new KDCustomHTMLView cssClass : "kdtabhandle visible-tab-handle plus" partial : "" delegate : @ click: => @emit "PlusHandleClicked" repositionPlusHandle: (handles) -> handlesLength = handles.length @plusHandle?.$().insertAfter handles[handlesLength - 1].$() if handlesLengthangular.module('loomioApp').factory 'RecordLoader', (Records) -> class RecordLoader constructor: (opts = {}) -> @loadingFirst = true @collection = opts.collection @params = opts.params or {from: 0, per: 25, order: 'id'} @path = opts.path @numLoaded = opts.numLoaded or 0 @then = opts.then or -> reset: -> @params['from'] = 0 @numLoaded = 0 fetchRecords: -> @loading = true Records[_.camelCase(@collection)].fetch path: @path params: @params .then (data) => if data[@collection].length > 0 @numLoaded += data[@collection].length else @exhausted = true data .then(@then) .finally => @loadingFirst = false @loading = false loadMore: (from) -> if from? @params['from'] = from else @params['from'] += @params['per'] if @numLoaded > 0 @loadingMore = true @fetchRecords().finally => @loadingMore = false loadPrevious: (from) -> if from? @params['from'] = from else @params['from'] -= @params['per'] if @numLoaded > 0 @loadingPrevious = true @fetchRecords().finally => @loadingPrevious = false define (require) -> BaseView = require('cs!helpers/backbone/views/base') observerConfig = subtree: true childList: true characterData: true return class EditableView extends BaseView initialize: () -> super() @listenTo(@model, 'change:edit', @toggleEdit) @observer = new MutationObserver (mutations) => mutations.forEach (mutation) => page = @model.get('currentPage') @model.set('changed', true) page.set('changed', true) toggleEdit: () -> edit = @model.get('edit') $editable = @$el.children(@editable) $editable.attr('contenteditable', edit) if edit $editable.each (index) => @observer.observe($editable.get(index), observerConfig) else @observer.disconnect() Darkswarm.directive "darkerBackground", -> restrict: "A" link: (scope, elm, attr)-> elm.closest('.page-view').toggleClass("with-darker-background", true) # Description: # None # # Dependencies: # "redis": "0.7.2" # # Configuration: # REDISTOGO_URL # # Commands: # None # # Author: # atmos Url = require "url" Redis = require "redis" # sets up hooks to persist the brain into redis. module.exports = (robot) -> info = Url.parse process.env.REDISTOGO_URL || 'redis://localhost:6379' client = Redis.createClient(info.port, info.hostname) if info.auth client.auth info.auth.split(":")[1] client.on "error", (err) -> robot.logger.error err client.on "connect", -> robot.logger.debug "Successfully connected to Redis" client.get "hubot:storage", (err, reply) -> if err throw err else if reply robot.brain.mergeData JSON.parse(reply.toString()) else robot.logger.info "Initializing new redis-brain storage" robot.brain.mergeData {} robot.brain.on 'save', (data = {}) -> client.set 'hubot:storage', JSON.stringify data robot.brain.on 'close', -> client.quit() angular.module('loomioApp').directive 'subgroupsCard', -> scope: {group: '='} restrict: 'E' templateUrl: 'generated/components/group_page/subgroups_card/subgroups_card.html' replace: true controller: ($scope, Records, AbilityService, ModalService, StartGroupForm) -> Records.groups.fetchByParent $scope.group $scope.canCreateSubgroups = -> AbilityService.canCreateSubgroups($scope.group) $scope.showSubgroupsPlaceholder = -> AbilityService.canAdministerGroup($scope.group) and $scope.group.subgroups().length == 0 $scope.startSubgroup = -> ModalService.open StartGroupForm, group: -> Records.groups.build(parent_id: $scope.group.id)module.exports = do (Marionette, $) -> { UIRouterMarionette } = require('../router') App = new Marionette.Application Marionette.Behaviors.behaviorsLookup = -> # Import Marionette behaviors for state lookup/active state UISref: require('../router/marionette/behaviors').UISref App.addRegions rootRegion: '#root' App.on "before:start", -> @router = UIRouterMarionette.getInstance() require('./routes') Visualizer = require('ui-router-visualizer').Visualizer @router.plugin(Visualizer) App.on "start", -> @router.start(App.rootRegion) @router.trace.enable() @router.trace.enable("TRANSITION", "UIVIEW", "VIEWCONFIG") return App FieldList = require './field_list' module.exports = class Form extends Backbone.Model defaults: saveable: false updateOnly: false sections: [ { key: 'default', group: true } { key: 'none', group: false } ] initialize: (attributes) -> @original = attributes?.model @buildClone() @buildFields attributes buildClone: => @clone = @original.clone() @clone.on 'change', => # Check the fields handled by this form to determine if they are valid @set saveable: (! @clone.validate?) or @clone.isValid _.keys @fields.attributes() buildFields: (attributes) => @fields = new FieldList @fields.currentModel = @clone @fields.add attributes?.fields @fields.on 'change', (field) => # Set silently to prevent validation on the clone @clone.set (field.get 'key'), (field.get 'value'), silent: true # Trigger the change event since we were silent @clone.change() save: => if @get 'updateOnly' @original.set @fields.attributes() else @original.save @fields.attributes() express = require 'express' extend = require './extend' {existsSync} = require './utils' {join, dirname} = require 'path' exports.extend = (app, func) -> extend app, func exports.createServer = (func) -> app = express.createServer() extend app, func exports.default = (opts) -> -> @configure -> @set 'port', opts.port # setup views dir = join opts.base, '/views' if existsSync dir @set 'views', dir # Use jade by default @set 'view engine', 'jade' # Disable layouts @set 'view options', layout: false @development -> # Enable logging @use express.logger 'dev' # setup static file serving dir = join opts.base, opts.staticPath if existsSync dir @use express.static dir else # serve cwd if public dir doesn't exist. @use express.static opts.base # Serve bundles bundles = {} for bundle in [opts.jsBundle, opts.cssBundle] if bundle and existsSync dirname bundle.entry bundles[bundle.url] = bundle.create opts.base if Object.keys(bundles).length > 0 @use require('./middleware').bundle(bundles) @test -> # listen on a different port when running tests @set 'port', opts.port + 1 @ {expect} = require "chai" utils = require "../../utils" {Collections} = utils.require "base" Jitter = utils.require("models/transforms/jitter").Model describe "Jitter transform module", -> source = {start: 0, end: 10} target = {start: 20, end: 80} generate_jitter = -> new Jitter({ width: 1, mean: 0, distribution: 'uniform' }) describe "Jitter with uniform", -> transform = generate_jitter() transform.set('distribution', 'uniform') it "should average the fixed values", -> N = 1000 vals = Array.apply(null, Array(N)).map -> 5 rets = transform.v_compute(vals) thesum = rets.reduce((a,b) -> return a+b , 0) thediff = (thesum/N) - 5 expect(thediff).to.be.below 0.01 describe "Jitter with normal", -> transform = generate_jitter() transform.set('distribution', 'normal') it "should average the fixed values", -> N = 1000 vals = Array.apply(null, Array(N)).map -> 5 rets = transform.v_compute(vals) thesum = rets.reduce((a,b) -> return a+b , 0) thediff = (thesum/N) - 5 expect(thediff).to.be.below 0.01 Wheelmap.NodePopupView = Ember.View.extend templateName: 'node-popup' classNames: ['node-popup-view'] aboutFaqLink: (()-> if I18n.locale == 'de' then 'http://wheelmap.org/about/faqs/' else 'http://wheelmap.org/en/faqs/' ).property() linkTarget: (()-> if Ember.ENV.EMBEDDED then '_blank' else null ).property() Wheelmap.NodePopupStatusDropdownView = Ember.View.extend templateName: 'nodes/_status-dropdown' tagName: 'section' classNames: ['node-status-dropdown'] $dropdown: (()-> @$().find('.dropdown-toggle') ).property() closeDropdown: (()-> $dropdown = @get('$dropdown') # Close dropdown when new wheelchair status is saved if !@get('controller.isPosting') and $dropdown.closest('.dropdown').hasClass('open') $dropdown.trigger('click.dropdown.data-api') ).observes('controller.isPosting') click: (event)-> if Ember.$(event.target).closest('.dropdown-menu').length > 0 event.stopPropagation()class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about'{View, $$} = require 'space-pen' $ = require 'jquery' Git = require 'git' module.exports = class FileView extends View @content: (file) -> @li class: 'file entry', => @span file.getBaseName(), class: 'name' @span "", class: 'highlight' file: null initialize: (@file) -> @addClass('ignored') if new Git(@getPath()).isPathIgnored(@getPath()) getPath: -> @file.path # all # ---------------------------------------- 'atom-text-editor.vim-mode-plus': # mode switch 'ctrl-space': 'vim-mode-plus:reset-normal-mode' # undo/redo 'ctrl-u': 'vim-mode-plus:redo' # motions 'ctrl-h': 'vim-mode-plus:previous-tab' 'ctrl-l': 'vim-mode-plus:next-tab' 'ctrl-k': 'vim-mode-plus:scroll-half-screen-up' 'ctrl-j': 'vim-mode-plus:scroll-half-screen-down' # file operations 'ctrl-s': 'custom:vim-save' 'ctrl-d': 'tabs:close-tab' # search 'ctrl-f': 'vim-mode-plus:search-current-word' # code navigation 'ctrl-t': 'nuclide-navigation-stack:navigate-backwards' # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # An example hack to make opened Markdown files always be soft wrapped: # {$} = require 'atom' path = require 'path' atom.workspaceView.eachEditorView (editorView) -> editor = editorView.getEditor() if path.extname(editor.getPath()) is '.md' editor.setSoftWrap(true) #= require jquery #= require jquery_ujs #= require foundation #= require rails.validations #= require rails.validations.simple_form #= require rails.validations.simple_form.fix #= require turbolinks #= require nprogress #= require nprogress-turbolinks #= require jquery.autosize #= require globals/_functions #= require tools/mapbox #= require tools/nprogress $(document).on 'ready page:load page:restore', -> $(document).foundation() $('.autosize').autosize()name: 'Popup my Bookmarks' version: '' manifest_version: 2 minimum_chrome_version: '26' default_locale: 'en' description: '__MSG_extDesc__' icons: 16: 'img/icon16.png' 48: 'img/icon48.png' 128: 'img/icon128.png' browser_action: default_icon: 'img/icon38.png' default_popup: 'popup.html' options_page: 'options.html' permissions: [ 'chrome://favicon/' 'bookmarks' 'storage' 'tabs' ] optional_permissions: [ 'http://*/' 'https://*/' ] path = require 'path' optimist = require 'optimist' Command = require './command' module.exports = class Test extends Command @commandNames: ['test'] parseOptions: (argv) -> options = optimist(argv) options.usage """ Usage: apm test Runs the package's tests contained within the spec directory (relative to the current working directory). """ options.alias('h', 'help').describe('help', 'Print this usage message') options.alias('p', 'path').describe('path', 'Path to atom command') showHelp: (argv) -> @parseOptions(argv).showHelp() run: (options) -> {callback} = options args = @parseOptions(options.commandArgs) env = process.env atomCommand = args.argv.path ? 'atom' @spawn atomCommand, ['-d', '-t', "--spec-directory=#{path.join(process.cwd(), 'spec')}"], {env, streaming: true}, (code) -> if code is 0 process.stdout.write 'Tests passed\n'.green callback() else callback('Tests failed') $(document).ready -> autocompleteURL = $("#competitor_wca").attr("data-url") auto = $("#competitor_wca").typeahead { minLength: 6 },{ source: (q, callback) -> $.getJSON(autocompleteURL + "?q=#{q}") .done (result) -> callback(result) matcher: (item) -> true name: 'wca-competitors' displayKey: (object) -> object.id templates: suggestion: (item) -> '
    • ' + item.id + '' } auto.bind "typeahead:selected", (event, object) -> names = object.name.split(" ") firstName = names[0] lastName = names[1] country = object.country gender = object.gender $("#competitor_first_name").val(firstName) $("#competitor_last_name").val(lastName) $("#competitor_country_id option").filter( -> $(this).html().toLowerCase() == country.toLowerCase() ).attr("selected", "selected") switch gender when "m" then $("#competitor_male_true").attr("checked", "checked") when "f" then $("#competitor_male_false").attr("checked", "checked") '.platform-darwin atom-text-editor': 'ctrl-shift-u': 'encoding-selector:show' '.platform-win32 atom-text-editor': 'ctrl-shift-u': 'encoding-selector:show' '.platform-linux atom-text-editor': 'ctrl-u': 'encoding-selector:show' Trade.Flash = Ember.Mixin.create needs: 'application' application: Ember.computed.alias('controllers.application') notification: Ember.computed.alias('controllers.application.notification') flashSuccess: (options) -> @get('application').notify({ title: "Done" message: options.message, type: "alert-success", persists: options.persists }) flashError: (msg, persists) -> @get('application').notify({ title: "Error" message: options.message, type: "alert-error", persists: options.persists }) flashClear: -> @get('application').send('closeNotification')stylus = require 'stylus' express = require 'express' { basename, join } = require 'path' browserify = do (browserify = require 'browserify-middleware') -> (path) -> browserify path, transform: [ 'coffeeify', 'jadeify2' ] module.exports = -> @set 'public', join __dirname, '..', 'public' @use stylus.middleware src: @settings.public @use express.static @settings.public @get '/tx/new.js', browserify '../client/tx/new.coffee' @get '/tx/join.js', browserify '../client/tx/join.coffee' @get '/tx/multisig.js', browserify '../client/tx/multisig.coffee' @get '/arbitrate/new.js', browserify '../client/arbitrate/new.coffee' @get '/arbitrate/manage.js', browserify '../client/arbitrate/manage.coffee' @get '/', (req, res) -> res.render 'index' @get '/*.html', (req, res) -> res.render basename req.url, '.html' {BaseClass} = require "./BaseClass" {Events} = require "./Events" Events.MIDICommand = "midiCommand" class MIDIInput extends BaseClass @define "enabled", get: -> @_inputs?.length or @_request set: (value) -> return unless value != @enabled return @_requestRejected() if not navigator.requestMIDIAccess if value @_request = navigator.requestMIDIAccess().then @_requestResolved, @_requestRejected else @_inputs?.map close @_request = null @_inputs = [] # Success handlers _requestResolved: (access) => @_inputs ?= [] access.inputs.forEach (input) => console.log(input) @_inputs.push input input.onmidimessage = @_onmidimessage(input.id) # Failure handlers _requestRejected: (error) => throw Error "Requesting MIDI access failed: #{error ? "not supported by browser"}" # Event handlers _onmidimessage: (sourceID) => (message) => @emit(Events.MIDICommand, sourceID, message.timeStamp, message.data) # Event shortcuts onCommand: (cb) -> @on(Events.MIDICommand, cb) exports.MIDIInput = new MIDIInput # galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity. # Copyright (C) 2013 Matthew Farmer - Distributed Under the GNU AGPL 3.0. See LICENSE at project root. module.exports = (app, jobs, db) -> ObjectId = require('mongodb').ObjectID; retrievalError = (error, res) -> errorId = Math.random().toString(36).substring(7) console.error("Error " + errorId + ": " + err) res.json id: errorId, error: err , 500 validObjectId = (possibleObjectId) -> try new ObjectId possibleObjectId catch error: "invalid", message: "That doesn't look like a valid object id." retrieveOrError = (collection, name) -> (req, res, next, id) -> validId = validObjectId(id) if validId.error? res.json validId, 417 return db.collection(collection).findOne {_id: validId}, (err, result) -> if err retrievalError(err, res) else if result? req[name] = result next() else res.json error: "not_found", message: "That #{name} was not found." , 404 app.param 'vote', retrieveOrError("votes", "vote") app.param 'member', retrieveOrError("members", "member") app.param 'committee', retrieveOrError("committees", "committee") app.param 'legislation', retrieveOrError("legislation", "legislation") app.param 'legislativeSession', retrieveOrError("sessions", "legislativeSession") fs = require 'fs' path = require 'path' delegate = require 'atom_delegate' optimist = require 'optimist' atomApplication = null delegate.browserMainParts.preMainMessageLoopRun = -> commandLineArgs = parseCommandLine() require('module').globalPaths.push(path.join(commandLineArgs.resourcePath, 'src')) AtomApplication = require('atom-application') atomApplication = new AtomApplication(commandLineArgs) getHomeDir = -> process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] parseCommandLine = -> args = optimist(process.argv[1..]).argv executedFrom = args['executed-from'] pathsToOpen = if args._.length > 0 then args._ else null testMode = true if args['test'] version = String fs.readFileSync(path.join(__dirname, '..', '..', 'version')) if args['resource-path'] resourcePath = args['resource-path'] else if args['dev'] resourcePath = path.join(getHomeDir(), 'github', 'atom') try fs.statSync resourcePath catch e resourcePath = path.dirname(__dirname) {resourcePath, executedFrom, pathsToOpen, testMode, version} require "forge.bundle.js" WsseDynamicValue = -> this.username = "" this.password = "" this.evaluate = -> time = (new Date()).toISOString() nonce = forge.util.bytesToHex forge.random.getBytesSync 10 nonce64 = forge.util.encode64 nonce md = forge.md.sha1.create() md.update nonce + time + this.password digest = forge.util.encode64 md.digest().getBytes() "UsernameToken " + "Username=\"#{@username}\", " + "PasswordDigest=\"#{digest}\", " + "Nonce=\"#{nonce64}\", " + "Created=\"#{time}\""; @title = -> "WSSE" @text = -> @username return WsseDynamicValue.identifier = "net.xelaris.PawExtensions.WsseDynamicValue" WsseDynamicValue.title = "WSSE Dynamic Value" WsseDynamicValue.inputs = [ DynamicValueInput("username", "Username", "String"), DynamicValueInput("password", "Password", "String") ] registerDynamicValueClass WsseDynamicValue FileIcons = require './file-icons' module.exports = activate: (state) -> @tabBarViews = [] TabBarView = require './tab-bar-view' _ = require 'underscore-plus' @paneSubscription = atom.workspace.observePanes (pane) => tabBarView = new TabBarView tabBarView.initialize(pane) paneElement = atom.views.getView(pane) paneElement.insertBefore(tabBarView, paneElement.firstChild) @tabBarViews.push(tabBarView) pane.onDidDestroy => _.remove(@tabBarViews, tabBarView) deactivate: -> @paneSubscription.dispose() @fileIconsDisposable?.dispose() tabBarView.remove() for tabBarView in @tabBarViews return consumeFileIcons: (service) -> FileIcons.setService(service) @fileIconsDisposable = service.onWillDeactivate -> FileIcons.resetService() VariableParser = require '../lib/variable-parser' describe 'VariableParser', -> [parser] = [] itParses = (expression) -> description: '' asColor: (variable) -> [expectedName] = Object.keys(variable) expectedValue = variable[expectedName] it "parses the '#{expression}' as a color variable with name '#{expectedName}' and value '#{expectedValue}'", -> [{name, value, type}] = parser.parse(expression) expect(name).toEqual(expectedName) expect(value).toEqual(expectedValue) # expect(type).toEqual('color') asNonColor: (variable) -> [expectedName] = Object.keys(variable) expectedValue = variable[expectedName] it "parses '#{expression}' as a variable with name '#{expectedName}' and value '#{expectedValue}'", -> [{name, value, type}] = parser.parse(expression) expect(name).toEqual(expectedName) expect(value).toEqual(expectedValue) # expect(type).toEqual('non-color') beforeEach -> parser = new VariableParser itParses('color = white').asColor('color': 'white') itParses('non-color = 10px').asNonColor('non-color': '10px') AWS = require 'aws-sdk' AWS.config.region = 'us-east-1' AWS.config.update accessKeyId : 'AKIAJTAPKSDXI4FIXGJA' secretAccessKey : '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' module.exports = AWS exports.config = (config) -> # File path glob patterns. # All file paths matching these glob patterns will be watched for changes, # and when they are detected, the matching URL cache will be expired. config.watch "app/assets/**" config.watch "vendor/assets/**" # Match file paths to their corresponding URLs. # The first argument is the match pattern, and the second argument is the # translation function. Any captures made by the matching pattern will be # passed into the translation function in the order they are matched. The # returned URL String from the translation function will be used to expire # the cache for that URL. config.match ':location/assets/javascripts/*', javascript_path config.match ':location/assets/stylesheets/*', stylesheet_path # Establish a white list of URL Strings of the paths to cache. # If an incoming request URL does not match an include pattern, it will not # be cached and will be simply reverse proxied to the server. config.include /\.js\?body=1$/ config.include /\.css\?body=1$/ config.include /\.(jpg|jpeg|gif|png|svg)$/i return javascript_path = (location, filepath) -> return "/assets/#{filepath}?body=1" stylesheet_path = (location, filepath) -> return "/assets/application.css?body=1" fs = require 'fs' path = require 'path' async = require 'async' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'run-specs', 'Run the specs', -> passed = true done = @async() atomPath = path.resolve('atom.sh') apmPath = path.resolve('node_modules/.bin/apm') queue = async.queue (packagePath, callback) -> options = cmd: apmPath args: ['test', '--path', atomPath] opts: cwd: packagePath grunt.log.writeln("Launching #{path.basename(packagePath)} specs.") spawn options, (error, results, code) -> passed = passed and code is 0 callback() modulesDirectory = path.resolve('node_modules') for packageDirectory in fs.readdirSync(modulesDirectory) packagePath = path.join(modulesDirectory, packageDirectory) continue unless grunt.file.isDir(path.join(packagePath, 'spec')) try {engines} = grunt.file.readJSON(path.join(packagePath, 'package.json')) ? {} queue.push(packagePath) if engines.atom? queue.concurrency = 1 queue.drain = -> done(passed) filters = angular.module 'qiprofile.filters', [] filters.filter 'capitalize', -> (s) -> _.str.capitalize(s) filters.filter 'moment', -> (s) -> moment(s).format('MM/DD/YY') filters.filter 'visitDates', -> (sessions) -> sess.acquisition_date() for sess in sessions do ($$ = Quo) -> VENDORS = [ "-webkit-", "-moz-", "-ms-", "-o-", "" ] $$.fn.addClass = (name) -> @each -> unless _existsClass(name, @className) @className += " " + name @className = @className.trim() $$.fn.removeClass = (name) -> @each -> unless name @className = "" else @className = @className.replace(name, " ").replace(/\s+/g, " ").trim() if _existsClass(name, @className) $$.fn.toggleClass = (name) -> @each -> if _existsClass(name, @className) @className = @className.replace(name, " ") else @className += " " + name @className = @className.trim() $$.fn.hasClass = (name) -> _existsClass name, this[0].className $$.fn.style = (property, value) -> if value @each -> @style[property] = value else this[0].style[property] or _computedStyle(this[0], property) $$.fn.css = (property, value) -> @style property, value $$.fn.vendor = (property, value) -> @style("#{vendor}#{property}", value) for vendor in VENDORS _existsClass = (name, className) -> classes = className.split(/\s+/g) classes.indexOf(name) >= 0 _computedStyle = (element, property) -> document.defaultView.getComputedStyle(element, "")[property] ready = -> $('.js-navigation').on('click', -> $('.loading-indicator').show()) $(document).ready(ready) $(document).on('page:load', ready) #= require ./abstract_attribute_binding class Batman.DOM.AddClassBinding extends Batman.DOM.AbstractAttributeBinding onlyObserve: Batman.BindingDefinitionOnlyObserve.Data constructor: (definition) -> {@invert} = definition @classes = for name in definition.attr.split('|') {name: name, pattern: new RegExp("(?:^|\\s)#{name}(?:$|\\s)", 'i')} super dataChange: (value) -> currentName = @node.className for {name, pattern} in @classes includesClassName = pattern.test(currentName) if !!value is !@invert @node.className = "#{currentName} #{name}" if !includesClassName else @node.className = currentName.replace(pattern, ' ') if includesClassName true Template.adminImportProgress.helpers step: -> return Template.instance().step.get() completed: -> return Template.instance().completed.get() total: -> return Template.instance().total.get() Template.adminImportProgress.onCreated -> instance = @ @step = new ReactiveVar t('Loading...') @completed = new ReactiveVar 0 @total = new ReactiveVar 0 @updateProgress = -> Meteor.call 'getImportProgress', FlowRouter.getParam('importer'), (error, progress) -> if error console.warn 'Error on getting the import progress:', error handleError error return if progress if progress.step is 'importer_done' toastr.success t(progress.step) FlowRouter.go '/admin/import' else if progress.step is 'importer_import_failed' toastr.error t(progress.step) FlowRouter.go '/admin/import/prepare/' + FlowRouter.getParam('importer') else instance.step.set t(progress.step) instance.completed.set progress.count.completed instance.total.set progress.count.total setTimeout(() -> instance.updateProgress() , 100) else toastr.warning t('importer_not_in_progress') FlowRouter.go '/admin/import/prepare/' + FlowRouter.getParam('importer') instance.updateProgress() module.exports = development: port: 3000 production: port: 80 # Description # A hubot script that shows who has the longest github streak in your org # # Configuration: # LIST_OF_ENV_VARS_TO_SET # ORG_ACCESS_TOKEN # # Commands: # streak ladder - # # Notes: # An access token is required by the github api to access a private org's members # so an account that is a member of the private org is required. # # Author: # Nigel Rahkola # Mitch Leblanc <> module.exports = (robot) -> robot.hear /streak ladder/i, (res) -> access_token = process.env.ORG_ACCESS_TOKEN unless access_token? res.send "Missing ORG_ACCESS_TOKEN in environment: please set and try again" return res.send "Found the access token in the environment! #{acces_token}" React = require 'react' apiClient = require '../../api/client' {Navigation} = require 'react-router' Loading = require '../../components/loading-indicator' module?.exports = React.createClass displayName: 'ProjectLinker' mixins: [Navigation] getInitialState: -> projects: [] loading: true componentWillMount: -> @setProjects() shouldComponentUpdate: (nextProps, nextState) -> nextState.projects isnt @state.projects goToProjectTalk: (projectId) -> apiClient.type('projects').get(projectId.toString()).then (project) => project.get('owner').then (owner) => @transitionTo 'project-talk', owner: owner.login name: project.slug setProjects: (metadata) -> query = launch_approved: true include: 'owners' apiClient.type('projects').get(query) .then (projects) => @setState {projects, loading: false} onChangeSelect: (e) -> projectsSelect = React.findDOMNode(@).querySelector('select') projectId = projectsSelect.options[projectsSelect.selectedIndex].value @goToProjectTalk(projectId) projectOption: (d, i) -> render: -> if @state.loading else if @state.projects.length
      else

      Error retreiving projects list.

      $ -> $(".protected-branches-list :checkbox").change -> name = $(this).attr("name") if name == "developers_can_push" id = $(this).val() checked = $(this).is(":checked") url = $(this).data("url") $.ajax type: "PUT" url: url dataType: "json" data: id: id developers_can_push: checked success: -> new Flash("Branch updated.", "notice") location.reload true error: -> new Flash("Failed to update branch!", "alert") koding = require './../bongo' { getClientId } = require './../helpers' module.exports = (req, res) -> { JUser } = koding.models { password, email, tfcode } = req.body return res.status(400).send 'Bad request' unless email? { password, redirect } = req.body clientId = getClientId req, res if clientId JUser.login clientId, { username : email, password, tfcode }, (err, info) -> { isValid : isEmail } = JUser.validateAt 'email', email, yes if err?.name is 'VERIFICATION_CODE_NEEDED' return res.status(400).send 'TwoFactor auth Enabled' else if err?.message is 'Access denied!' return res.status(400).send 'Bad request' else if err and isEmail JUser.emailAvailable email, (err_, response) -> return res.status(400).send 'Bad request' if err_ return if response then res.status(200).send response else res.status(400).send 'Email is taken!' return unless info return res.status(500).send 'An error occurred' res.cookie 'clientId', info.replacementToken, { path : '/' } return res.status(200).send 'User is logged in!' # This is the Hubot Loading Bay. NPM uses it as an entry point. # # Hubot = require 'hubot' # YourBot = Hubot.robot 'campfire', 'yourbot' # Loads a Hubot robot exports.loadBot = (adapterName, botName) -> robot = require './src/robot' new robot adapterName, botName exports.robot = -> require './src/robot' # Loads the Hubot test harness. exports.tests = -> require './test/tests' React = require 'react' {CurrentUserStore} = require '../../flux/current-user' classnames = require 'classnames' LOGOUT_URL = '/accounts/logout' LOGOUT_URL_CC = '/accounts/logout?cc=true' CSRF_Token = CurrentUserStore.getCSRFToken() LogoutLink = React.createClass propTypes: label: React.PropTypes.string getDefaultProps: -> label: 'Log Out' onLinkClick: (ev) -> ev.currentTarget.querySelector('form').submit() render: -> {className, children, isConceptCoach} = @props classes = classnames(className)
    • module.exports = LogoutLink coffee = require 'coffee-script' configManager = require '../config-manager' cjsx_transform = null module.exports = id: 'coffee-compile' selector: [ 'source.coffee' 'source.litcoffee' 'text.plain' 'text.plain.null-grammar' ] compiledScope: 'source.js' preCompile: (code, editor) -> if configManager.get('compileCjsx') unless cjsx_transform cjsx_transform = require 'coffee-react-transform' code = cjsx_transform code return code compile: (code, editor) -> literate = editor.getGrammar().scopeName is "source.litcoffee" bare = configManager.get('noTopLevelFunctionWrapper') bare ?= true return coffee.compile code, {bare, literate} postCompile: (code, editor) -> return code #=require d3 $ -> $(".report.repository-select").on 'change', (e) => repository = $(".report.repository-select").val() window.location = "repository?show=#{repository}" $(".dropdown-toggle").dropdown() express = require 'express' stylus = require 'stylus' assets = require 'connect-assets' app = express.createServer() app.use assets() app.set 'view engine', 'jade' app.get '/', (req, resp) -> resp.render 'index' app.get '/:filename.:extension', (req, resp) -> content = req.param['content'] if (content and content.length > 1024) resp.json({error: 'File content is longer than 1024 characters and was truncated.. Please use POST instead of GET'}, 406) else saveit(req, resp) app.post '/:filename.:extension', (req, resp)-> saveit(req, resp) saveit = (req, resp) -> content = req.param['content'] unless (content) resp.json({error: 'File content is missing'}, 406) else resp.attachment(req.param['filename']) resp.send(content) app.listen process.env.PORT or 4000, -> console.log 'Listening...' RunLoop.register -> for el in $('[data-replace-self-on-load]') url = $(el).data('replace-self-on-load') $(el).removeAttr('data-replace-self-on-load') $.get url, (html) -> $(el).replaceWith(html) SpecLauncher = require './spec-launcher' SpecRunnerView = require './spec-runner-view' configUri = "atom://spec-runner" module.exports = activate: (state) -> atom.project.registerOpener (uri) => @specRunnerView = new SpecRunnerView if uri is configUri atom.config.setDefaults "spec-runner", command: "rspec" atom.workspaceView.command "spec-runner:run-file", => atom.workspaceView.open(configUri) @specRunnerView.runCurrentFile() atom.workspaceView.command "spec-runner:run-line", => atom.workspaceView.open(configUri) @specRunnerView.runCurrentLine() # deactivate: -> # @specRunnerView.destroy() # # serialize: -> # specRunnerViewState: @specRunnerView.serialize() "use strict" assert = require 'assert' server = require '../coffee/server.coffee' cookie = null before (done) -> opts = method: 'POST' url: '/login' payload: 'username=turbo%40dnt.org&password=helttopp' headers: 'Content-Type': 'application/x-www-form-urlencoded' 'Content-Length': 42 server.inject opts, (res) -> assert.equal res.raw.res.statusCode, 302 assert res.raw.res._headers['set-cookie'] instanceof Array assert.equal typeof res.raw.res._headers['set-cookie'][0].split(';')[0], 'string' cookie = "Cookie": res.raw.res._headers['set-cookie'][0].split(';')[0] done() describe '/liste', -> it 'should display a list of cabins', (done) -> server.inject method: 'GET', url: '/liste', headers: cookie, (res) -> assert.equal res.raw.res.statusCode, 200 done() request = require('request') module.exports = class API constructor: (apiKey) -> @apiKey = apiKey getCourseFromRoom: (building, room, done) -> apiURL = @apiURLForEndpoint("buildings/#{building}/#{room}/courses") options = { uri: apiURL headers: {'User-Agent': 'Roomular (https://github.com/christhomson/roomular)'} } request(options, (err, res, body) -> try classes = JSON.parse(body).data done(null, classes) catch e done(err, []) ) apiURLForEndpoint: (endpoint) -> "http://api.uwaterloo.ca/public/v2/#{endpoint}.json?key=#{@apiKey}"gulp = require 'gulp' jasmine = require 'gulp-jasmine' module.exports = () -> return gulp.src this.opts.config.jasmine.src .pipe jasmine() # gulp-jasmine works on filepaths so you can't have any plugins before it '.workspace': 'ctrl-h': 'window:focus-pane-on-left' 'ctrl-j': 'window:focus-pane-below' 'ctrl-k': 'window:focus-pane-above' 'ctrl-l': 'window:focus-pane-on-right' 'ctrl-|': 'pane:split-right' 'ctrl--': 'pane:split-down' 'alt-g j': 'git-diff:move-to-next-diff' 'alt-g k': 'git-diff:move-to-previous-diff' # Declare keymaps for the commands defined in init.coffee 'alt-cmd-ctrl-b': 'dot-atom:demo' 'ctrl-;': 'dot-atom:delete-to-end-of-line' 'ctrl-. h': 'dot-atom:move-to-top-visible-line' 'ctrl-. m': 'dot-atom:move-to-middle-visible-line' 'ctrl-. l': 'dot-atom:move-to-bottom-visible-line' 'ctrl-. t': 'dot-atom:scroll-cursor-to-top' 'ctrl-. z': 'dot-atom:scroll-cursor-to-center' 'ctrl-. b': 'dot-atom:scroll-cursor-to-bottom' '.workspace, .command-palette .editor': 'cmd-p': 'command-palette:toggle' _ = require 'underscore' Artist = require '../../models/artist' AuctionLots = require '../../collections/auction_lots' @artist = (req, res) -> artist = null auctionLots = null currentPage = parseInt req.query.page || 1 sort = req.query.sort render = _.after 2, -> res.render 'artist', auctionLots : auctionLots artist : artist new Artist(id: req.params.id).fetch cache : true success: (response) -> artist = response; render() error : res.backboneError new AuctionLots([], id : req.params.id sortBy: sort state : { currentPage: currentPage } ).fetch cache : true success: (response) -> auctionLots = response; render() error : res.backboneError Artwork = require '../../models/artwork' ComparableSales = require '../../collections/comparable_sales' @artwork = (req, res) -> artwork = null auctionLots = null render = _.after 2, -> res.render 'artwork', artwork: artwork auctionLots: auctionLots new Artwork(id: req.params.id).fetch cache : true success : (response) -> artwork = response; render() new ComparableSales([], id: req.params.id ).fetch success : (response) -> auctionLots = response; render() error : res.backboneError ((window, Elyssa) -> # Elyssa.Math # Static class # @mixin Elyssa.Math = # Clamps a value between a minimum and maximum # # @param {Number} The value that needs to be clamped # @param {Number} Minimum (Optional, set to 0.0 by default) # @param {Number} Maximum (Optional, set to 1.0 by default) # # @return {Number} The clamped value clamp: (value, min = 0.0, max = 1.0) -> if min <= value <= max value else if value > max then max else min )(@, @Elyssa or= {}) ###* * @namespace OpenOrchestra:FormBehavior ### window.OpenOrchestra or= {} window.OpenOrchestra.FormBehavior or= {} ###* * @class ValidateHidden ### class OpenOrchestra.FormBehavior.ValidateHidden extends OpenOrchestra.FormBehavior.AbstractFormBehavior ###* * activateBehaviorOnElements * @param {Array} elements * @param {Object} view * @param {Object} form ### activateBehaviorOnElements: (elements, view, form) -> elements.addClass('focusable').attr('type', 'text') jQuery -> OpenOrchestra.FormBehavior.formBehaviorLibrary.add(new OpenOrchestra.FormBehavior.ValidateHidden("input[type='hidden'][required='required']")) OpenOrchestra.FormBehavior.formBehaviorLibrary.add(new OpenOrchestra.FormBehavior.ValidateHidden("input:hidden[type='text'][required='required']")) window.lesson = {} window.lesson.applyScrollEffect = (classList, options) -> @prevST = 0 @scrollTimer = null if localStorage.getItem('scrollAlertShown') $('.scroll-effect-alert').alert('close') else $('.scroll-effect-alert .close').click(-> localStorage.setItem('scrollAlertShown', 'true')) @onHover = -> elem.addClass('mouse--enter') for elem in classList $('.mouse--enter').hover( => @showElems() => @hideElems() ) @onHover() if options.showOnHover @onScroll = => currentST = $(window).scrollTop() # Update classList elements if scroll change > 50px if Math.abs(currentST - @prevST) > 50 if currentST > @prevST @hideElems() else @showElems() @prevST = currentST @hideElems = -> # Prevent onHover() hiding of classList elements if user at top of page if $(window).scrollTop() > 0 elem.removeClass('scroll--up').addClass('scroll--down') for elem in classList @showElems = -> elem.removeClass('scroll--down').addClass('scroll--up') for elem in classList $(window).scroll => clearTimeout(@scrollTimer) if @scrollTimer @scrollTimer = setTimeout(@onScroll, 50) # Description: # Business cat is summoned when business jargon is used # # Dependencies: # None # # Configuration: # HUBOT_BUSINESS_CAT_JARGON comma-separated list of additional "tiggers" # # Commands: # Business jargon - summons business cat # # Notes: # See jargon array for list of trigger phrases # # Author: # Morgan Wigmanich (https://github.com/okize) images = require './data/images.json' jargon = require './data/triggers.json' if process.env.HUBOT_BUSINESS_CAT_JARGON? additionalJargon = (process.env.HUBOT_BUSINESS_CAT_JARGON).split(',') jargon = jargon.concat(additionalJargon) regex = new RegExp jargon.join('|'), 'gi' module.exports = (robot) -> robot.hear regex, (msg) -> msg.send msg.random images module.exports = class ProcessConfig constructor: (object={}) -> @namespace = 'Process Palette'; @action = null; @command = null; @arguments = []; @cwd = null; @env = {}; @keystroke = null; @stream = false; @outputTarget = 'panel'; @reuseOutputTarget = true; @maxCompleted = 1; @maxRunning = null; @successOutput = '{stdout}'; @errorOutput = '{stderr}'; @fatalOutput = 'Failed to execute : {fullCommand}\n{stdout}\n{stderr}'; @successMessage = 'Executed : {fullCommand}'; @errorMessage = 'Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}'; @fatalMessage = 'Failed to execute : {fullCommand}\n{stdout}\n{stderr}'; for key, val of object @[key] = val if @outputTarget not in ["panel", "editor", "file", "clipboard", "console", "void"] @outputTarget = "void"; if !@arguments @arguments = []; getCommandName: -> return @namespace + ":" + @action; getFullCommand: -> full = @command + " " + @arguments.join(" "); return full.trim(); outputToPanel: -> return @outputTarget == 'panel'; App.Utils = hexToRgb: (hex) -> result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec hex; if result r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) else null should = require 'should' sinon = require 'sinon' shouldSinon = require 'should-sinon' KDEventEmitterWildcard = require '../../lib/core/eventemitterwildcard' describe 'KDEventEmitterWildcard', -> beforeEach -> @instance = new KDEventEmitterWildcard it 'exists', -> KDEventEmitterWildcard.should.exist describe 'constructor', -> it 'should default delimiter option', -> @instance._delim.should.equal '.' it 'should change delimiter option', -> emitter = new KDEventEmitterWildcard delimiter: '~' emitter._delim.should.equal '~' describe 'setMaxListeners', -> it 'should set max listeners', -> @instance.setMaxListeners 20 @instance._maxListeners.should.equal 20 class window.Followers extends Backbone.Paginator.requestPager model: User, server_api: take: -> @perPage skip: -> (@currentPage-1) * @perPage paginator_core: dataType: "json", url: -> "/#{@user.get('username')}/followers" paginator_ui: perPage: 3 firstPage: 1 currentPage: 1 initialize: (models, opts) -> @user = opts.user @_followed_by_me = false @totalRecords = 0 url: -> "/#{@user.get('username')}/followers" addFollower: (follower) -> Backbone.sync('update', follower, url: "#{@url()}/#{follower.get('username')}" ) @_followed_by_me = true @trigger 'change' removeFollower: (follower) -> Backbone.sync('delete', follower, url: "#{@url()}/#{follower.get('username')}" ) @_followed_by_me = false @trigger 'change' parse: (response) -> @totalRecords = response.total @totalPages = Math.floor(response.total / @perPage) @_followed_by_me = response.followed_by_me response fetch: -> super success: => @trigger 'change' followed_by_me: -> @_followed_by_me followers_count: -> @totalRecords Vue = require "vue/dist/vue" escape = require "../filters/escape" linkify = require "../filters/linkify" newLine = require "../filters/newLine" module.exports = Vue.extend methods: filter: (text) -> text = escape text text = newLine text text = linkify text text mounted: -> $comment = $(@$el) $comment.html(@filter($comment.text())) class @VendorFindMode extends CheckoutMode ModeSwitcher.registerEntryPoint("vendor_find", @) constructor: (args..., query) -> super @vendorList = new VendorList() @query = query enter: -> super @cfg.uiRef.body.append(@vendorList.render()) if @query? Api.vendor_find(q: @query).done(@onVendorsFound) glyph: -> "user" title: -> gettext("Vendor Search") inputPlaceholder: -> gettext("Search vendor") actions: -> [ ["", (query) => Api.vendor_find(q: query).done(@onVendorsFound)] [@commands.logout, @onLogout] ] onVendorsFound: (vendors) => @vendorList.body.empty() if vendors.length == 1 @switcher.switchTo(VendorReport, vendors[0]) return for vendor_, index_ in vendors ((vendor, index) => @vendorList.append( vendor, index + 1, (=> @switcher.switchTo(VendorReport, vendor)), ) )(vendor_, index_) return # # Pages like Terms of Use, Privacy, etc. that display relatively static content. # express = require 'express' routes = require './routes' app = module.exports = express() app.set 'views', __dirname app.set 'view engine', 'jade' app.get '/terms', routes.vanityUrl('terms') app.get '/past-terms', routes.vanityUrl('past-terms') app.get '/past-terms-10-29-12', routes.vanityUrl('past-terms-10-29-12') app.get '/privacy', routes.vanityUrl('privacy') app.get '/past-privacy', routes.vanityUrl('past-privacy') app.get '/press', routes.vanityUrl('press') app.get '/conditions-of-sale', routes.vanityUrl('conditions-of-sale') app.get '/auction-info', routes.vanityUrl('auction-info') app.get '/job/:id', routes.index # Handle urls like /job/devops-engineer/about app.get '/job/:id/*', routes.index {View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => editor.underlayer.append(new WrapGuideView(editor)) if editor.attached @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) => @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', columnWidth).show() else @hide() else @hide() express = require 'express' cookieParser = require 'cookie-parser' bodyParser = require 'body-parser' expressSession = require 'express-session' colors = require 'colors' passport = require './lib/auth' util = require './lib/util' config = require './config' module.exports = app = express() app.set 'views', 'public/' app.set 'view engine', 'hbs' # Handle cookies and sessions and stuff app.use cookieParser config.buckets.salt app.use bodyParser() app.use expressSession secret: config.buckets.salt # Passport deals with any possible auth app.use passport.initialize() app.use passport.session() # Load Routes for the API, admin, and frontend app.use "/#{config.buckets.apiSegment}", api for api in util.loadClasses "#{__dirname}/api/" app.use "/#{config.buckets.adminSegment}", require('./routes/admin') app.use require('./routes/frontend') app.listen config.buckets.port console.log "\nBuckets".yellow + " is running at " + "http://localhost:#{config.buckets.port}/".underline.boldangular.module("doubtfire.services.analytics", []) # # Services for analytics # .factory("analyticsService", ($analytics, currentUser) -> analyticsService = {} # # Logs a new event # # For consistency, use like this: # category: 'Visualisations' (Pluralised) # eventName: 'Refreshed All' (Past-Tense) # analyticsService.event = (category, eventName, label, value) -> # Don't log unless user has opted in return unless currentUser.profile.opt_in_to_research if value? and typeof value isnt 'Number' and value < 0 throw new Error "Value needs to be a positive number" $analytics.eventTrack eventName, { category: category label: label value: value } analyticsService.watchEvent = ( scope, toWatch, category, label) -> scope.$watch toWatch, (newVal, oldVal) -> if newVal? && newVal != oldVal if _.isFunction label analyticsService.event category, "Changed #{toWatch}", label(newVal) else if _.isInteger newVal analyticsService.event category, "Changed #{toWatch}", label, newVal else analyticsService.event category, "Changed #{toWatch}", newVal analyticsService ) # end factory _ = require 'underscore' View = require 'lib/view' FormMixin = require 'views/base/mixins/form' FieldTypeSettingsView = require 'views/fields/settings' mediator = require 'mediator' tpl = require 'templates/fields/edit' module.exports = class FieldEditView extends View template: tpl events: 'submit form': 'submitForm' 'click [href="#cancel"]': 'clickCancel' regions: 'settings': '.settings' render: -> super if @model.get('fieldType') in ['text', 'textarea', 'checkbox', 'number'] @renderSettings() else # Otherwise ensure the plugin is loaded and see if one exists mediator.loadPlugin(@model.get('fieldType')).done @renderSettings renderSettings: => configOptions = region: 'settings', model: @model plugin = mediator.plugins[@model.get('fieldType')] if plugin if _.isFunction plugin.settingsView SettingsView = plugin.settingsView else if _.isString plugin.settingsView configOptions.template = plugin.settingsView SettingsView = FieldTypeSettingsView else SettingsView = FieldTypeSettingsView @subview "settings_#{@model.get('slug')}", new SettingsView configOptions submitForm: (e) -> e.preventDefault() data = @formParams() data.fieldType = @model.get('fieldType') data.slug = data.fieldSlug delete data.fieldSlug data.settings = @$('.settings').formParams() @model.set data clickCancel: (e) -> e.preventDefault() @dispose() @mixin FormMixin module.exports = dist: options: namespace: '<%= package.name %>', base: 'src/' src: ['src/**/*.js'], dest: 'build/debug/js/<%= package.name %>.js' all: options: footer: '//# sourceMappingURL=all.js.map' base: 'build/debug/js' src: ['build/debug/js/**/*.js'] dest: 'build/debug/all.js' @registryadmin.controller 'RegistryLoginCtrl', [ "$scope" "registrydataService" "registryloginService" "$q" "$location" "$rootScope" ($scope,registrydataService,registryloginService,$q,$location,$rootScope) -> scopeDestroyed = false registryloginService.clearCredentials() $scope.error = '' $scope.login = () -> registryloginService.setCredentials($scope.username, $scope.password) back = $rootScope.loginback $rootScope.loginback = undefined $location.path(back) # val = registryloginService.getLoginStatus() # val.then( # (result) -> # $scope.statusmessage = result # $location.path('/') # (result) -> # if result == undefined || result['status'] == 401 # authRequired = true # $location.path('/login') # ) ] '.platform-darwin .pdf-view': 'cmd-+': 'pdf-view:zoom-in' 'cmd-=': 'pdf-view:zoom-in' 'cmd--': 'pdf-view:zoom-out' 'cmd-_': 'pdf-view:zoom-out' 'cmd-0': 'pdf-view:reset-zoom' '.platform-win32 .pdf-view, .platform-linux .pdf-view': 'ctrl-+': 'pdf-view:zoom-in' 'ctrl-=': 'pdf-view:zoom-in' 'ctrl--': 'pdf-view:zoom-out' 'ctrl-_': 'pdf-view:zoom-out' 'ctrl-0': 'pdf-view:reset-zoom' { formatMoney } = require 'accounting' StepView = require './step.coffee' createSlider = require '../../../../../components/slider/index.coffee' template = -> require('../../templates/price_range.jade') arguments... module.exports = class PriceRangeView extends StepView formatter: (val, index) -> if index is 0 "#{formatMoney(val, { precision: 0 })}" else "#{formatMoney(val, { symbol: "", precision: 0 })}" onSetSlider: (_, __, [min, max]) => @user.set price_range_min: min, price_range_max: max render: -> @$el.html template(state: @state, user: @user) @slider = createSlider $container: @$('.artsy-primer-personalize-slider') name: 'Price' min: 50 max: 50000 range: { min: [50, 100] '20%': [10000, 500] '50%': [25000, 1000] max: [50000] } formatter: @formatter @slider.on 'set', @onSetSlider this errors = require 'errors' {threshold} = require 'limits' exports.$endpoint = -> limiter: message: "You are logging in too much." threshold: threshold(3).every(30).seconds() receiver: (req, fn) -> switch req.body.method when 'local' (req.passport.authenticate 'local', (error, user, info) -> return fn error if error? return fn errors.instantiate 'login' unless user req.login user, (error) -> return fn error if error? user.redactFor(user).nodeify fn ) req, res = {} exports.$errorType = (require 'client/modules/packages/user/login').$errorType #= require jquery2 #= require ./jquery_ui #= require jquery_ujs #= require_self #= require_tree ./lib #= require_tree ./ext #= require_tree ./initializers window.ActiveAdmin = {} #= require jquery #= require jquery_ujs #= require common #= require front/cufon-yui #= require front/Aller.font #= require front/slides.min.jquery #= require front/front #= require_selfMeteor.startup -> RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true } RocketChat.models.Permissions.upsert('pin-message', {$addToSet: {roles: {$each: ['owner', 'moderator', 'admin']}}}) ETahi.PaperManageController = Ember.ObjectController.extend sortedPhases: ( -> Ember.ArrayProxy.createWithMixins(Em.SortableMixin, { content: @get('model.phases') sortProperties: ['position'] }) ).property('model.phases.@each') actions: addPhase: (position) -> paper = @get('model') phase = @store.createRecord 'phase', position: position + 1 name: "New Phase" paper: paper phase.save().then -> paper.reload() removePhase: (phase) -> paper = phase.get('paper') phase.destroyRecord().then -> paper.reload() refreshColumnHeights: (-> Ember.run.next(this, Tahi.utils.resizeColumnHeaders) ).observes('phases.[]') fsUtils = require 'fs-utils' path = require 'path' _ = require 'underscore' archive = require 'ls-archive' File = require 'file' module.exports= class ArchiveEditSession registerDeserializer(this) @activate: -> Project = require 'project' Project.registerOpener (filePath) -> new ArchiveEditSession(filePath) if archive.isPathSupported(filePath) @deserialize: ({path}={}) -> path = project.resolve(path) if fsUtils.isFileSync(path) new ArchiveEditSession(path) else console.warn "Could not build archive edit session for path '#{path}' because that file no longer exists" constructor: (@path) -> @file = new File(@path) destroy: -> @file?.off() serialize: -> deserializer: 'ArchiveEditSession' path: @getUri() getViewClass: -> require './archive-view' getTitle: -> if archivePath = @getPath() path.basename(archivePath) else 'untitled' getUri: -> project?.relativize(@getPath()) ? @getPath() getPath: -> @path isEqual: (other) -> other instanceof ArchiveEditSession and @getUri() is other.getUri() NodeEditView= React.createFactory require '../node-edit-view' LinkEditView= React.createFactory require '../link-edit-view' {div, i} = React.DOM module.exports = React.createClass displayName: 'InspectorPanelView' getInitialState: -> expanded: true collapse: -> @setState {expanded: false} expand: -> @setState {expanded: true} render: -> className = "wireframe-inspector-panel" if @state.expanded is false className = "#{className} inspector-panel-collapsed" (div {className: className}, (div {className: 'inspector-panel-toggle'}, if @state.expanded is true (i className: 'fa fa-chevron-right' onClick: @collapse ) else (i className: 'fa fa-chevron-left' onClick: @expand ) ) (div {className: "inspector-panel-content"}, (NodeEditView {node: @props.node, onNodeChanged: @props.onNodeChanged, protoNodes: @props.protoNodes}) (LinkEditView {link: @props.selectedConnection, onLinkChanged: @props.onLinkChanged}) ) ) fs = require 'fs' package_json = require '../package.json' StockXmlImport = require('../main').StockXmlImport argv = require('optimist') .usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --xmlfile file --timeout timeout') .default('timeout', 300000) .describe('projectKey', 'your SPHERE.IO project-key') .describe('clientId', 'your OAuth client id for the SPHERE.IO API') .describe('clientSecret', 'your OAuth client secret for the SPHERE.IO API') .describe('xmlfile', 'XML file containing inventory information to import') .describe('timeout', 'Set timeout for requests') .demand(['projectKey', 'clientId', 'clientSecret', 'xmlfile']) .argv options = config: project_key: argv.projectKey client_id: argv.clientId client_secret: argv.clientSecret timeout: argv.timeout user_agent: "#{package_json.name} - #{package_json.version}" stockxmlimport = new StockXmlImport options fs.readFile argv.xmlfile, 'utf8', (err, content) -> if err console.error "Problems on reading file '#{argv.xmlfile}': " + err process.exit 2 stockxmlimport.run content, (result) -> console.log result process.exit 1 unless result.statusStockXmlImport = require('../main').StockXmlImport fs = require 'fs' argv = require('optimist') .usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --xmlfile file') .demand(['projectKey', 'clientId', 'clientSecret', 'xmlfile']) .argv options = config: project_key: argv.projectKey client_id: argv.clientId client_secret: argv.clientSecret stockxmlimport = new StockXmlImport options fs.readFile argv.xmlfile, 'utf8', (err, content) -> if err console.error "Problems on reading file '#{argv.xmlfile}': " + err process.exit 2 stockxmlimport.run content, (result) -> console.log result process.exit 1 unless result.statusVolontariat.ArgumentsIndexRoute = Ember.Route.extend model: (params) -> @controllerFor('arguments.index').set 'page', parseInt(params.page) @controllerFor('arguments.index').set 'thingId', @modelFor('thing').id @store.find 'argument', thing_id: @modelFor('thing').id, page: params.page setupController: (controller, model) -> controller.send('goToPageWithoutRedirect', controller.get('page')) controller.set('model', model) actions: openModal: (modalName) -> @render modalName, into: "arguments.index" outlet: "modal" $('#modal').modal('show') closeModal: -> @disconnectOutlet outlet: "modal" parentView: "arguments.index" $('#modal').modal('hide')'context-menu': '.tab': [ {label: 'Close Tab', command: 'tabs:close-tab'} {label: 'Close Other Tabs', command: 'tabs:close-other-tabs'} {label: 'Close Tabs to the Right', command: 'tabs:close-tabs-to-right'} {label: 'Close Saved Tabs', command: 'tabs:close-saved-tabs'} {label: 'Close All Tabs', command: 'tabs:close-all-tabs'} {type: 'separator'} {label: 'Split Up', command: 'tabs:split-up'} {label: 'Split Down', command: 'tabs:split-down'} {label: 'Split Left', command: 'tabs:split-left'} {label: 'Split Right', command: 'tabs:split-right'} ] '.tab-bar': [ {label: 'Reopen Closed Tab', command: 'pane:reopen-closed-item'} ] React = require 'react' BS = require 'react-bootstrap' UserStatus = require '../user/status' {ExerciseStep} = require '../exercise' STEP_ID = '4571' Demo = React.createClass displayName: 'Demo' render: -> demos = exercise: demos = _.map(demos, (demo, name) ->

      {"#{name}"}

      {demo}
      ) {demos} module.exports = Demo Marionette = require "marionette" CommentCollectionView = require "./comment/collectionView" PlayingNotifierView = require "./nowPlaying/nowPlayingView" module.exports = class NcoMainLayout extends Marionette.LayoutView template : require "./view.jade" regions : comment : "#nco-comments" notify : ".NcoNotifier" ui : null events : null onShow : -> @comment.show new CommentCollectionView @notify.show new PlayingNotifierView Polymer is: 'league-controller' properties: league: Object leagueId: type: String, observer: '_leagueIdChanged' leagueAttrs: Object players: type: Object observer: '_onPlayersChange' playerModels: Array newPlayer: -> event.preventDefault() league = @league errorsEl = Polymer.dom(this).node.querySelector("#errors") playerInput = Polymer.dom(this).node.querySelector("#playerName") opts = name: playerInput.value LeagueId: league.id player = new Player(opts) player.setApiClient(@$.api) player.save player.attributes, success: (model) -> league.get('Players').add(model) playerInput.value = "" errorsEl.errors = [] error: (data, response) -> errorsEl.errors = [response.responseJSON.error.errors[0]] playerEditClick: (event) -> event.preventDefault() console.log "TODO" playerRemoveClick: (event) -> event.preventDefault() playerId = event.target.getAttribute("data-player") player = @league.get('Players').get(playerId) player.setApiClient(@$.api) player.destroy(wait: true) _leagueIdChanged: -> if @leagueId @$.api.findOrFetchModel(League, @leagueId) .then (league) => @league = league @fire('iron-signal', {name: "league", data: league}) # Your keymap # # Atom keymaps work similarly to style sheets. Just as style sheets use # selectors to apply styles to elements, Atom keymaps use selectors to associate # keystrokes with events in specific contexts. Unlike style sheets however, # each selector can only be declared once. # # You can create a new keybinding in this file by typing "key" and then hitting # tab. # # Here's an example taken from Atom's built-in keymap: # # 'atom-text-editor': # 'enter': 'editor:newline' # # 'atom-workspace': # 'ctrl-shift-p': 'core:move-up' # 'ctrl-p': 'core:move-down' # # You can find more information about keymaps in these guides: # * https://atom.io/docs/latest/using-atom-basic-customization#customizing-key-bindings # * https://atom.io/docs/latest/behind-atom-keymaps-in-depth # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it in the # Atom Flight Manual: # https://atom.io/docs/latest/using-atom-basic-customization#cson ThemeWatcher = require './theme-watcher' BaseThemeWatcher = require './base-theme-watcher' module.exports = class UIWatcher constructor: ({@themeManager}) -> @baseTheme = new BaseThemeWatcher() for theme in @themeManager.getActiveThemes() @createThemeWatcher(theme) @themeManager.on 'theme-activated', (theme) => @createThemeWatcher(theme) createThemeWatcher: (theme) -> watcher = new ThemeWatcher(theme) watcher.on 'globals-changed', @reloadAll watcher reloadAll: => @baseTheme.reloadStylesheet() theme.load() for theme in atom.themes.getThemes() should = require 'should' fixtures = require './fixtures' git = require '../src' Blob = require '../src/blob' describe "Blob", -> describe "constructor", -> repo = fixtures.branched blob = new Blob repo, {name: "X", mode: "Y", id: "abc"} it "assigns @name", -> blob.name.should.eql "X" it "assigns @mode", -> blob.mode.should.eql "Y" it "assigns @id", -> blob.id.should.eql "abc" describe "#data", -> describe "of a file off the root", -> repo = git "#{__dirname}/fixtures/branched" data = null before (done) -> repo.tree().blobs (err, blobs) -> blobs[0].data (err, _data) -> data = _data done err it "is a string", -> data.should.be.a "string" data.should.include "Bla" describe "of a file in a subdir", -> repo = git "#{__dirname}/fixtures/branched" data = null before (done) -> repo.tree().trees (err, trees) -> trees[0].blobs (err, blobs) -> blobs[0].data (err, _data) -> data = _data done err it "is a string", -> data.should.be.a "string" data.should.include "!!!" window.TimeAgo = React.createClass mixins: [SetIntervalMixin] getInitialState: -> now: Date.now() componentDidMount: -> @setInterval(@update_time, 1000) update_time: -> @setState now: Date.now() seconds_lapsed: -> (@state.now - Date.parse(@props.time)) / 1000 showNr: (nr, unit) -> "#{Math.round(nr)}#{unit}" displayTime: (time) -> seconds = 1 minutes = 60 hours = 60 * minutes days = 24 * hours months = 30* days years = 365 * days if not time '?' else if time < 1 * minutes "now" else if time < 1*hours @showNr(time / minutes, 'm') else if time < 1*days @showNr(time / hours, 'h') else if time < 1*months @showNr(time / days , 'd') else if time < 1*years @showNr(time / months, 'm') else @showNr(time / years, 'y') render: -> span = _span {}, @displayTime(@seconds_lapsed()) @transferPropsTo span React = require 'react' ReactRedux = require 'react-redux' moment = require 'moment' createFactory = require '../create-factory.coffee' Elements = require '../elements.coffee' selectors = require '../selectors/app-selectors.coffee' userActions = require '../actions/user-actions.coffee' URL = require '../url.coffee' { nav, ul, li } = Elements Link = createFactory ReactRedux.connect(selectors.linkSelector)( require './link.coffee' ) LangPicker = createFactory ReactRedux.connect(selectors.langPickerSelector)( require './lang-picker.coffee' ) module.exports = React.createClass displayName: 'SiteMenu' handleLogout: -> @props.dispatch userActions.logout() render: -> { home, admin, newArticle, logout } = @props.localeStrings newUrl = '/' + moment().format('YYYY/MM/DD') + '/untitled/new' ulArgs = [ className: 'list-inline' li Link href: '/', home li Link href: '/login', admin ] if @props.login.isLoggedIn logoutUrl = URL.getUserPath(@props.login.user._id) + '/logout' ulArgs.push( li key: 'new-article', Link href: newUrl, newArticle li key: 'logout', Link( href: logoutUrl onClick: @handleLogout logout ) ) nav( { className: 'site-menu' } LangPicker className: 'site-menu__lang-picker' ul ulArgs ) #= require dashboard #= require mock-ajax describe "Dashboard - getData()", -> beforeEach -> jasmine.Ajax.useMock() @dashboard = Dashboard describe "when the report is ready on the first iteration", -> it "should return the dashboard data", -> that = this @dashboard.getData 'lesson_leaders', {}, (data) -> that.data = data request = mostRecentAjaxRequest() expect(request.url).toBe('/dashboard/queries') expect(request.method).toBe('POST') request.response { status: 200, responseText: '{"id": "REPORT_ID" }' } waits(1000) runs -> request = mostRecentAjaxRequest() expect(request.url).toBe('/dashboard/queries/REPORT_ID/ready') expect(request.method).toBe('GET') request.response { status: 200, responseText: '{"is_ready": true, "data":"DATA" }' } expect(that.data).toEqual 'DATA' # Copyright 2013 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. root = exports ? this # Formats a Bug's file name, taking into account special files. # # @param [Object] bug The Bug. # @return [String] The abbreviated file name. # root.formatBugFile = (bug) -> #TODO don't guess, record this information if bug.file =~ /^\[S\] / "" else parts = bug.file.split('/') parts[parts.length - 1] #= require jquery #= require bootstrap-fix #= require jquery_ujs #= require jquery-ui.js #= require jquery.cookie #= require jquery.titlealert #= require jquery.mousewheel #= require jquery.expanding #= require jquery.iframe-transport #= require simply-scroll # require jquery.purr #= require hamlcoffee #= require date #= require faye #= require twitter-text #= require autolink #= require select2 # require pjax # require jquery.tokeninput # require jquery.daterangepicker # require best_in_place # require rails.validations # require rails.validations.custom # require rails.validations.formbuilder # require farbtastic # require showdown # require highcharts # # require underscore #= require underscore-1.3.3 #= require backbone #= require backbone.getset # #= require cloudsdale # #= require_tree ../templates/ #= require_tree ./models #= require_tree ./collections #= require_tree ./views #= require_tree ./routers #= require_tree ./modulesFactlinkJailRoot.createFactFromSelection = (current_user_opinion) -> success = -> FactlinkJailRoot.createButton.hide() FactlinkJailRoot.off 'modalOpened', success selInfo = text: window.document.getSelection().toString() title: window.document.title text = selInfo.text siteUrl = FactlinkJailRoot.siteUrl() siteTitle = selInfo.title FactlinkJailRoot.on 'modalOpened', success FactlinkJailRoot.factlinkCoreEnvoy 'prepareNewFactlink', text, siteUrl, siteTitle, current_user_opinion FactlinkJailRoot.textSelected = -> # At least 4 words of at least 2 characters /(\w{2,}[\s-_&\/#%.,;:!()]+){4}/.test window.document.getSelection().toString() Reflux = require 'reflux' {api} = require '../api/client' classifierActions = require '../actions/classifier-actions' workflowStore = require './workflow-store' module.exports = Reflux.createStore subjects: [] subject: null init: -> @listenTo workflowStore, @changeWorkflow @listenTo classifierActions.moveToNextSubject, @next getInitialState: -> @subjects @subject next: -> if @subjects.length == 0 query = workflow_id: workflowStore.data.id sort: 'queued' api.type('subjects').get query .then (subjects) => return unless subjects.length > 0 @subjects = subjects .then => @loadSubjectImage() else @loadSubjectImage() loadSubjectImage: -> @subject = @subjects.shift() @generateHttpsUrl() image = new Image() image.src = @subject.locations[0]['image/jpeg'] image.onload = => @subject.srcWidth = image.naturalWidth @trigger @subject generateHttpsUrl: -> # If it's not an https url, we replace the s3 domain name with a secure one url = @subject.locations[0]['image/jpeg'] if url.substr(0, 5) != 'https' filename = url.replace /https?:\/\/[^\/]+/i, '' @subject.locations[0]['image/jpeg'] = 'https://zooniverse-export.s3.amazonaws.com' + filename changeWorkflow: -> @subject = null @subjects.length = 0 @trigger @subject @next() BaseModel = require './base' crypto = require 'crypto' uuid = require 'uuid' _ = require 'underscore' class UserCredential extends BaseModel constructor: (options) -> super options @required = ['userid', 'secret'] if not @secret @genSecret() genSecret: () -> sha = crypto.createHash 'sha256' sha.update "#{uuid.v1()}" @secret = sha.digest 'hex' module.exports = UserCredential os = require("os") module.exports.monitor = (logger) -> return (req, res, next) -> Metrics = require("./metrics") startTime = new Date() end = res.end res.end = () -> end.apply(this, arguments) responseTime = new Date() - startTime routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:/g, '').slice(1) key = "http-requests.#{routePath}.#{req.method}.#{res.statusCode}" Metrics.timing(key, responseTime) logger.log req: url: req.originalUrl || req.url method: req.method referrer: req.headers['referer'] || req.headers['referrer'] "remote-addr": req.ip || req.socket?.socket?.remoteAddress || req.socket?.remoteAddress "user-agent": req.headers["user-agent"] "content-length": req.headers["content-length"] res: "content-length": res._headers?["content-length"] statusCode: res.statusCode "response-time": responseTime "http request" next() Helper = require('hubot-test-helper') chai = require 'chai' expect = chai.expect helper = new Helper('../scripts/hello.coffee') describe 'Training 1', -> beforeEach -> @room = helper.createRoom() afterEach -> @room.destroy() it 'start Training 1', -> @room.user.say('miura', '@customer 三浦と申します。監視ソフトウェアの構築をしていました。').then => expect(@room.messages).to.eql [ ['miura', '@customer 三浦と申します。監視ソフトウェアの構築をしていました。'] ['hubot', '@miura はじめまして、三浦さん。これからよろしくお願いします。'] ] ### Requires https://github.com/andialbrecht/sqlparse ### getCmd = (inputPath, outputPath, options) -> path = options.sqlformat_path optionsStr = " --indent_width={0} --keywords={1} --identifiers={2} --reindent" optionsStr = optionsStr.replace("{0}", options.indent_size) .replace("{1}", options.keywords) .replace("{2}", options.identifiers) if path # Use absolute path "python \"" + path + "\" \"" + inputPath + "\" " + optionsStr else # Use command available in $PATH "sqlformat \"" + inputPath + "\" " + optionsStr "use strict" cliBeautify = require("./cli-beautify") isStdout = true module.exports = cliBeautify(getCmd, isStdout) _ = require 'underscore' View = require 'lib/view' tpl = require 'templates/users/edit' mediator = require('chaplin').mediator module.exports = class EditUserView extends View template: tpl autoRender: yes events: 'submit form': 'submitForm' 'click [href="#remove"]': 'clickRemove' getTemplateData: -> _.extend super, currentUser: mediator.user?.toJSON() submitForm: (e) -> e.preventDefault() data = @$el.formParams(no) @model.save(data, wait: yes).fail(@renderServerErrors).done => @dispose() clickRemove: (e) -> e.preventDefault() @model.destroy(wait: yes).done => toastr.success 'User has been removed.' @dispose()class VirtualizationController extends KDController constructor:-> super @kc = KD.singletons.kiteController @lastState = state : 'STOPPED' run:(command, callback, emitStateChanged=yes)-> @kc.run kiteName : 'os' method : command , @_cbWrapper callback, emitStateChanged start:(callback)-> @run 'vm.start', callback stop:(callback)-> @run 'vm.stop', callback reinitialize:(callback)-> @run 'vm.reinitialize', callback info:(callback)-> @run 'vm.info', (err, info)=> unless err then @lastState = info else warn "[VM]", err @emit 'StateChanged', err, info callback? err, info , no _cbWrapper:(callback, emitStateChanged)-> return callback unless emitStateChanged return (rest...)=> @info callback? rest... SpellCheckView = null module.exports = config: grammars: type: 'array' default: [ 'source.asciidoc' 'source.gfm' 'text.git-commit' 'text.plain' 'text.plain.null-grammar' ] activate: -> @disposable = atom.workspace.observeTextEditors(addViewToEditor) deactivate: -> @disposable.dispose() addViewToEditor = (editor) -> SpellCheckView ?= require './spell-check-view' new SpellCheckView(editor) #= require ./top/navbar #= require ./centre/main_area ###* @jsx React.DOM ### window.App = React.createClass render: -> ` ` class TerminalPane extends Pane constructor: (options = {}, data) -> options.cssClass = "terminal-pane terminal" options.delay ?= 0 super options, data @createWebTermView() @webterm.on "WebTermConnected", (@remote) => @emit "WebtermCreated" @onWebTermConnected() createWebTermView: -> @webterm = new WebTermView cssClass : "webterm" advancedSettings : no delegate : this mode : @getMode() @webterm.connectToTerminal() # WebTermView.setTerminalTimeout null, 15000, handler, handler getMode: -> "create" onWebTermConnected: -> {command} = @getOptions() @runCommand command if command runCommand: (command, callback) -> return unless command if @remote if callback @webterm.once "WebTermEvent", callback command += ";echo $?|kdevent" return @remote.input "#{command}\n" if not @remote and not @triedAgain @utils.wait 2000, => @runCommand command @triedAgain = yes pistachio: -> """ {{> @header}} {{> @webterm}} """{$$, BufferedProcess, SelectListView} = require 'atom' git = require '../git' StatusView = require './status-view' CherryPickSelectCommits = require './cherry-pick-select-commits-view' module.exports = class CherryPickSelectBranch extends SelectListView initialize: (items, @currentHead) -> super @addClass 'overlay from-top' @setItems items atom.workspaceView.append this @focusFilterEditor() viewForItem: (item) -> $$ -> @li item confirmed: (item) -> @cancel() args = [ 'log' '--cherry-pick' '-z' '--format=%H%n%an%n%ar%n%s' "#{@currentHead}...#{item}" ] git.cmd args: args stdout: (data) -> @save ?= '' @save += data exit: (exit) -> if exit is 0 and @save? new CherryPickSelectCommits(@save.split('\0')[...-1]) @save = null else new StatusView(type: 'warning', message: "No commits available to cherry-pick.") $(document).ready -> $('#query').autocompleter { source: '/autocomplete/keywords', offset: 'results', highlightMatches: true } $('#location').autocompleter { source: '/autocomplete/places', offset: 'results', minLength: 4, highlightMatches: true } $('#flash a.close').click(sweet_hide) fix_lang_menu() sweet_hide = -> alert_box = $(this).parent() properties = { height: 'toggle', marginBottom: 'toggle', marginTop: 'toogle', opacity: 'toggle', paddingBottom: 'toggle', paddingTop: 'toogle' } alert_box.animate properties, 'fast', check_flash check_flash = -> flash_area = $('#flash') flash_area.slideUp() if $('li', flash_area).length? fix_lang_menu = -> lang_menu = $('li.lang').first() lang_submenu = $('ul', lang_menu).first() lang_menu_w = lang_menu.width() lang_submenu_w = lang_submenu.width() left_margin = lang_menu_w - (lang_submenu_w + 1) lang_submenu.css 'margin-left', left_margin + 'px' define [ "backbone" "sp-utils-middleware" "common" "view/page" "view/modal" ],( Backbone Middleware common Page Modal )-> showPage=(View,options={},callback)-> common.app.content.show View, options, callback class MiddlewareRouter extends Middleware auth:(async,args)-> async.resolve "auth" middleware = new MiddlewareRouter Router = Backbone.Router.extend routes: "":"index" "!/rooms(/:id)": "rooms" "!/roomadd/:token": "roomAdd" "!/404": "error404" "*default":"default_router" index: middleware.wrap -> view = showPage Page.IndexPage rooms: middleware.wrap (id)-> auto_id = common.user.get 'active_room_id' unless id? if auto_id? @navigate "!/rooms/#{auto_id}", {trigger: true} return view = showPage Page.MainPage view.setRoom id if id? roomAdd: middleware.wrap (token)-> common.api.post_rooms_join(token).done (data)-> Backbone.trigger "rooms:needUpdate" common.router "!/rooms/#{data.id}", {trigger:true} error404: middleware.wrap -> showPage Page.Error404Page default_router:-> @navigate "!/404", {trigger:true,replace:true} class TourUserView extends ActionButtonView template: 'tour/interesting_user' className: 'tour-interesting-user' templateHelpers: => disabled_label: Factlink.Global.t.follow_user.capitalize() disable_label: Factlink.Global.t.unfollow.capitalize() enabled_label: Factlink.Global.t.following.capitalize() templateHelpers: => disabled_label: Factlink.Global.t.follow_user.capitalize() disable_label: Factlink.Global.t.unfollow.capitalize() enabled_label: Factlink.Global.t.following.capitalize() enableHoverState: -> return if @justClicked super @$el.addClass 'hover' disableHoverState: -> super @$el.removeClass 'hover' updateButton: -> super @$el.toggleClass 'secondary', @buttonEnabled() buttonEnabled: -> @model.followers.followed_by_me() primaryAction: -> @model.follow() # TODO: favourite @updateButton() secondaryAction: -> @model.unfollow() @updateButton() class window.TourUsersListView extends Backbone.Marionette.CollectionView itemView: TourUserView className: 'tour-interesting-users-list' class CallbackDataSource extends DataSource constructor: (form_field, source) -> super(form_field, source) @results = {} search: (chosen, response_cb) -> ds = this # Call @source function, setting this to the chosen object # @param request # @param response_cb @source.call chosen, chosen.get_search_request(), (data) -> ds.did_search(chosen, response_cb, data) did_search: (chosen, response_cb, data) -> results = {} # Keep only results that have been chosen for value in chosen.choices() results[value] = @results[value] @results = results # Merge with new results options = (this.add_option child for child in data) response_cb options add_option: (child) -> item = @results[child.value] || child item.array_index = item.value item.html = item.label || item if not item.html? item.selected = item.selected || false item.disabled = item.disabled || false @results[item.value] = item item get_option_element: (array_index) -> this.get_option_element_by_value(array_index) get_item: (array_index) -> @results[array_index]$ -> $(".js-emoji").each -> $(@).html(emojione.toImage($(@).text())) {Document, Point, Range, Site} = require 'telepath' _ = require 'underscore-plus' module.exports = _: _ BufferedNodeProcess: require '../src/buffered-node-process' BufferedProcess: require '../src/buffered-process' Directory: require '../src/directory' Document: Document File: require '../src/file' fs: require '../src/fs-utils' Git: require '../src/git' Point: Point Range: Range Site: Site # The following classes can't be used from a Task handler and should therefore # only be exported when not running as a child node process unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE {$, $$, $$$, View} = require '../src/space-pen-extensions' module.exports.$ = $ module.exports.$$ = $$ module.exports.$$$ = $$$ module.exports.Editor = require '../src/editor' module.exports.pathForRepositoryUrl = require('../src/project').pathForRepositoryUrl module.exports.RootView = require '../src/root-view' module.exports.SelectList = require '../src/select-list' module.exports.ScrollView = require '../src/scroll-view' module.exports.Task = require '../src/task' module.exports.View = View # Define the Configuration docpadConfig = { templateData: site: title: "Dorian Patterson" getPreparedTitle: -> if @document.title then "#{@document.title} | #{@site.title}" else @site.title } # Export the Configuration module.exports = docpadConfig path = require 'path' Module = require 'module' ModuleCache = require '../src/module-cache' describe 'ModuleCache', -> beforeEach -> spyOn(Module, '_findPath').andCallThrough() it 'resolves atom shell module paths without hitting the filesystem', -> require.resolve('shell') expect(Module._findPath.callCount).toBe 0 it 'resolves relative core paths without hitting the filesystem', -> ModuleCache.add atom.getLoadSettings().resourcePath, { _atomModuleCache: extensions: '.json': [ path.join('spec', 'fixtures', 'module-cache', 'file.json') ] } expect(require('./fixtures/module-cache/file.json').foo).toBe 'bar' expect(Module._findPath.callCount).toBe 0 ### HTML Renderer @namespace Atoms.Core @class Attributes @author Javier Jimenez Villar || @soyjavi ### "use strict" Atoms.Core.Attributes = ### Set the parent instance to current instance. @method setParent ### scaffold: -> # Assign Parrent @parent = {} if @attributes?.parent? @parent = @attributes.parent delete @attributes.parent # Assign Container @container = @attributes.container or @parent.el or document.body delete @attributes.container # Assign Entity if @attributes?.entity? @entity = @attributes.entity delete @attributes.entity chemistry: (children) -> children = @attributes.children or @default.children for item, index in children for key of item when not @available or key in @available base = key.split(".") type = base[0] class_name = base[1] if Atoms[type][class_name]? attributes = item[key] if @default?.children?[index]?[key]? attributes = Atoms.Core.Helper.mix item[key], @default.children?[index]?[key] @children.push @instance type, class_name, attributes instance: (type, class_name, attributes) -> attributes.parent = @ new Atoms[type][class_name] attributes ViewRegistry = require '../src/view-registry' Panel = require '../src/panel' PanelContainer = require '../src/panel-container' describe "PanelContainer", -> [container] = [] class TestPanelItem constructior: -> beforeEach -> viewRegistry = new ViewRegistry container = new PanelContainer({viewRegistry}) describe "::addPanel(panel)", -> it 'emits an onDidAddPanel event with the index the panel was inserted at', -> container.onDidAddPanel addPanelSpy = jasmine.createSpy() panel1 = new Panel(item: new TestPanelItem(), location: 'left') container.addPanel(panel1) expect(addPanelSpy).toHaveBeenCalledWith({panel: panel1, index: 0}) panel2 = new Panel(item: new TestPanelItem(), location: 'left') container.addPanel(panel2) expect(addPanelSpy).toHaveBeenCalledWith({panel: panel2, index: 1}) describe "when a panel is destroyed", -> it 'emits an onDidRemovePanel event with the index of the removed item', -> container.onDidRemovePanel removePanelSpy = jasmine.createSpy() panel1 = new Panel(item: new TestPanelItem(), location: 'left') container.addPanel(panel1) panel2 = new Panel(item: new TestPanelItem(), location: 'left') container.addPanel(panel2) expect(removePanelSpy).not.toHaveBeenCalled() panel2.destroy() expect(removePanelSpy).toHaveBeenCalledWith({panel: panel2, index: 1}) panel1.destroy() expect(removePanelSpy).toHaveBeenCalledWith({panel: panel1, index: 0}) _ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['-l', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('-d', ignoredNames.join(',')) if ignoredNames.length > 0 paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths.push.apply(paths, _.compact(data.split('\n'))) @process = new BufferedProcess({command, args, stdout, exit}) deferred abort: -> if @process? @process.kill() @process = null $ -> $.rails.allowAction = (element) -> message = element.data('confirm') fire = $.rails.fire if message and fire(element, 'confirm') title = if $(document.body).hasClass('videos') then 'Delete this video' else 'Delete your account' dialog = new Dialog(title, message, confirmLabel: 'Yes') dialog.onConfirm () -> callback = fire(element, 'confirm:complete', [true]) if (callback) allowActionOrig = $.rails.allowAction $.rails.allowAction = () -> true element.trigger('click') $.rails.allowAction = allowActionOrig dialog.onClose () -> element.focus() dialog.show() not message or falseMeteor.methods setAvatarFromService: (dataURI, service) -> if not Meteor.userId() throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado' user = Meteor.user() {image, contentType} = RocketFile.dataURIParse dataURI rs = RocketFile.bufferToStream new Buffer(image, 'base64') ws = RocketFileAvatarInstance.createWriteStream user.username, contentType ws.on 'end', Meteor.bindEnvironment -> Meteor.users.update {_id: user._id}, {$set: {avatarOrigin: service}} rs.pipe(ws) resetAvatar: (image, service) -> if not Meteor.userId() throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado' user = Meteor.user() Avatars.remove {'copies.avatars.name': user.username} Meteor.users.update user._id, {$unset: {avatarOrigin: 1}} # This is a manifest file that'll be compiled into application.js, which will include all the files # listed below. # # Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, # or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. # # It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the # compiled file. # # Read Sprockets README (https:#github.com/sstephenson/sprockets#sprockets-directives) for details # about supported directives. # #= require jquery #= require jquery_ujs #= require rails-timeago #= require ansi_up #= require_tree . $(document).on 'click', 'a.disabled', (event) -> event.preventDefault() jQuery -> notificationNotice = $('.notifications') btn = notificationNotice.find('button') if $.notifyCheck() == $.NOTIFY_NOT_ALLOWED btn.click () => $.notifyRequest() notificationNotice.hide() else notificationNotice.hide() '*': 'editor': 'fontFamily': 'Fira Mono OT' 'showIndentGuide': true 'tabLength': 4 'softWrap': true 'invisibles': {} 'zoomFontWhenCtrlScrolling': false 'core': 'disabledPackages': [ 'language-objective-c' 'archive-view' 'autosave' 'bookmarks' 'language-clojure' 'language-perl' 'language-php' 'language-toml' 'snippets' 'welcome' 'spell-check' ] 'themes': [ 'seti-ui' 'seti-syntax' ] 'projectHome': '/home/ai/Dev' 'autoHideMenuBar': true 'exception-reporting': 'userId': '51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71' 'welcome': 'showOnStartup': false 'markdown-preview': 'breakOnSingleNewline': true 'spell-check': {} #= require trix/views/text_view #= require fixtures module "Trix.TextView" test "#createElementsForText", -> text = fixture("plain") elements = getElementsForText(text) equal elements.length, 1, "one element for plain string" el = elements[0] equal el.tagName.toLowerCase(), "span", "container element is a span" equal el.trixPosition, 0, "container element has a trixPosition" equal el.childNodes.length, 1, "container element has one child node" node = el.firstChild equal node.nodeType, Node.TEXT_NODE, "child node is a text node" equal node.data, text.toString(), "child node contains text string" equal node.trixPosition, 0, "child node has a trixPosition property" equal node.trixLength, text.getLength(), "child node has a trixLength property" text = Trix.Text.textForStringWithAttributes(text.toString() + "\n") elements = getElementsForText(text) equal elements.length, 2, "two elements for string ending with a newline" equal elements[0].lastChild.tagName.toLowerCase(), "br", "container element's last child is a BR" equal elements[1].tagName.toLowerCase(), "br", "last element is an extra BR" # Helpers getElementsForText = (text) -> element = document.createElement("div") textView = new Trix.TextView element, text textView.createElementsForText() $(document).ready -> assert = (condition) -> throw 'Assertion failed' unless condition contents = """ ################################################################# ################################################################# ################################################################# ################################################################# """ # assert contents == $('#sample').text() new window.TextFadeIn( $('#demo1'), 'milliseconds': 1 ).run() new window.TextFadeIn( $('#demo2'), contents, 'milliseconds': 1 ).run() new window.TextFadeIn( $('#demo3'), contents, 'milliseconds': 10 ).run() new window.TextFadeIn( $('#demo4'), contents, 'threads': 10 ).run() # assert contents == $('#sample').text() 'menu': [ { 'label': 'Edit' 'submenu': [ 'label': 'Lines' 'submenu': [ { 'label': 'Sort', 'command': 'sort-lines:sort' } { 'label': 'Reverse Sort', 'command': 'sort-lines:reverse-sort' } { 'label': 'Unique', 'command': 'sort-lines:unique' } { 'label': 'Case-insensitive Sort', 'command': 'sort-lines:case-insensitive-sort' } ] ] } ] #<< AppEngine/Helpers/Helpers class StrictObject extends Backbone.Events @expectedParameters: [] @applyParameters: [] @isAbstract: -> @ == StrictObject constructor: (conf) -> #check that this is not an abstract class if @__proto__.constructor.isAbstract() throw new Error "Unable to create instance of Abstract class '#{@.__proto__.constructor.getName()}'" #Check that all config params were passed through correctly AppEngine.Helpers.assertParametersExist @.__proto__.constructor.expectedParameters, conf AppEngine.Helpers.applyToObject @__proto__.constructor.applyParameters, conf, @ $(document).ready -> $('#messages-kiitos li').on 'click', (event) -> event.preventDefault() id = $(@).data('id') $.get "messages/#{id}"class Article constructor: -> set_title: (@title) -> set_content: (@content) -> set_date: (@date) -> set_section: (@section) -> parse: (html) -> page = $(html) @set_title page.find("#articleContent h1").text() raw_content = page.find("#masterContent .ArticleContent_Inner") @set_content _.chain(raw_content).map( (paragraph) -> $(paragraph).find("p").removeAttr("class").prop("outerHTML") ).reduce( (memo, obj) -> memo + obj ).value() root = exports ? this root.Article = Article React = require 'react' module.exports = React.PropTypes.shape( title: React.PropTypes.string children: React.PropTypes.array chapter_section: React.PropTypes.array current_level: React.PropTypes.number questions_answered_count: React.PropTypes.number ) assert = require 'assert' fs = require 'fs' path = require 'path' describe 'third-party module', -> fixtures = path.join __dirname, 'fixtures' xdescribe 'unzip', -> unzip = require 'unzip' it 'fires close event', (done) -> fs.createReadStream(path.join(fixtures, 'zip', 'a.zip')) .pipe(unzip.Parse()) .on('close', done) describe 'runas', -> it 'can be required in renderer', -> require 'runas' it 'can be required in node binary', (done) -> runas = path.join fixtures, 'module', 'runas.js' child = require('child_process').fork runas child.on 'message', (msg) -> assert.equal msg, 'ok' done() # Public: GrammarUtils.OperatingSystem - a module which exposes different # platform related helper functions. module.exports = isDarwin: -> @platform() is 'darwin' isWindows: -> @platform() is 'win32' isLinux: -> @platform() is 'linux' platform: -> process.platform module.exports = (e, dataTransfer, iconAndSize) -> image = iconAndSize[0] if image instanceof Image && !image.complete # Early exit; not loaded image will not work and more importantly it craches Safari 6 return if dataTransfer.setDragImage if image instanceof HTMLElement # Chrome hack; position the drag element where the UA are suppose to position it. # This since UA's requires it to be in the DOM and Chrome requires it to be in view… iconAndSize[0] = image = image.cloneNode true image.style.position = "absolute" image.style.left = "#{e.clientX - iconAndSize[1]}px" image.style.top = "#{e.clientY - iconAndSize[2]}px" document.body.appendChild image # Remove it from the DOM at the next run loop setTimeout(-> document.body.removeChild image , 0) dataTransfer.setDragImage.apply dataTransfer, iconAndSize React = require 'react/addons' Editable = require '../high_order/editable' List = require '../common/list' Revision = require './revision' RevisionStore = require '../../stores/revision_store' ServerActions = require '../../actions/server_actions' getState = -> revisions: RevisionStore.getModels() RevisionList = React.createClass( displayName: 'RevisionList' render: -> elements = @props.revisions.map (revision) => keys = 'rating_num': 'label': I18n.t('revision.class') 'desktop_only': true 'title': 'label': I18n.t('revision.title') 'desktop_only': false 'edited_by': 'label': I18n.t('revision.edited_by') 'desktop_only': true 'characters': 'label': I18n.t('revision.chars_added') 'desktop_only': true 'date': 'label': I18n.t('revision.date_time') 'desktop_only': true 'info_key': 'revisions.time_doc' ) module.exports = Editable(RevisionList, [RevisionStore], ServerActions.saveRevisions, getState) # # Use this module to define all third-party dependencies # that are used in Doubtfire # angular.module('doubtfire.config.vendor-dependencies', [ # ng* 'ngCookies' 'ngCsv' 'ngSanitize' # templates 'templates-app' 'templates-common' # ui.* 'ui.router' 'ui.bootstrap' 'ui.codemirror' # other libraries 'angularFileUpload' 'angular.filter' 'localization' 'markdown' 'nvd3' 'xeditable' 'LocalStorageModule' 'angular-md5' # analytics 'angulartics' 'angulartics.google.analytics' ]) Neighborly.Projects = {} if Neighborly.Projects is undefined Neighborly.Projects.New = init: Backbone.View.extend el: '.new-project-page' initialize: -> _.bindAll(this, 'changeCategoryImage') this.$('#project_category_id').change this.changeCategoryImage changeCategoryImage: (event)-> category = $(event.currentTarget).find(':selected').text().replace(/\s+/g, '-').toLowerCase() this.$el[0].className = this.$el[0].className.replace(/( category-.*)/, '') if category != 'select-an-option' this.$el.addClass("category-#{category}") modules: -> [Neighborly.SearchCities] angular.module 'ngtuvok' .factory "BlogService", (DataFactory) -> # $resource '/api/posts' posts = DataFactory.query -> console.log posts return getLastPost: -> # return $resource.query -> return posts MinimapSelectionView = require './minimap-selection-view' module.exports = active: false views: {} activate: (state) -> try atom.packages.activatePackage('minimap').then (minimapPackage) => @minimap = require minimapPackage.path return @deactivate() unless @minimap.versionMatch('3.x') @minimap.registerPlugin 'selection', this catch @deactivate deactivate: -> @minimap.unregisterPlugin 'selection' @minimap = null isActive: -> @active activatePlugin: -> return if @active @active = true @subscription = @minimap.eachMinimapView ({view}) => selectionView = new MinimapSelectionView(view) selectionView.attach() @views[view.editor.id] = selectionView deactivatePlugin: -> view.destroy() for id,view of @views return unless @active @active = false @views = {} @subscription.off() define (require) -> Backbone = require('backbone') settings = require('settings') router = require('router') AUTHORING = "#{location.protocol}//#{settings.cnxauthoring.host}:#{settings.cnxauthoring.port}" return class RoleAcceptance extends Backbone.Model id = window.location.pathname.match(/\/[^\/]+$/) url: "#{AUTHORING}/contents#{id}@draft/acceptance" initialize: () => @fetch reset: true, xhrFields: withCredentials: true .fail (response) => router.appView.render('error', {code: response.status}) 'menu': [ { 'label': 'View' 'submenu': [ 'label': 'Toggle Treeview' 'command': 'tree-view:toggle' ] } { 'label': 'Packages' 'submenu': [ 'label': 'Tree View' 'submenu': [ { 'label': 'Focus', 'command': 'tree-view:toggle-focus' } { 'label': 'Toggle', 'command': 'tree-view:toggle' } { 'label': 'Reveal Active File', 'command': 'tree-view:reveal-active-file' } ] ] } ] 'context-menu': '.tree-view': 'Add File': 'tree-view:add' 'Add Folder': 'tree-view:add' 'Rename': 'tree-view:move' 'Delete': 'tree-view:remove' JSONAPIClient = {Resource} = require 'json-api-client' config = require './config' apiClient = new JSONAPIClient config.host + '/api', 'Content-Type': 'application/json' 'Accept': 'application/vnd.api+json; version=1' apiClient.type('classifications').Resource = require './classification' apiClient.handleError = (request) -> response = try JSON.parse request.responseText if response?.error? errorMessage = response.error if response.error_description? errorMessage = "#{errorMessage} #{response.error_description}" else if response?.errors?[0].message? errorMessage = for {message} in response.errors if typeof message is 'string' message else ("#{key} #{error}" for key, error of message).join '\n' errorMessage = errorMessage.join '\n' errorMessage ?= request.responseText?.trim() || "#{request.status} #{request.statusText}" throw new Error errorMessage module.exports = apiClient window.zooAPI = apiClient class @Autosave constructor: (field, key) -> @field = field key = key.join("/") if key.join? @key = "autosave/#{key}" @field.data "autosave", this @restore() @field.on "input", => @save() restore: -> return unless window.localStorage? try text = window.localStorage.getItem @key catch return @field.val text if text?.length > 0 @field.trigger "input" save: -> return unless window.localStorage? text = @field.val() if text?.length > 0 try window.localStorage.setItem @key, text else @reset() reset: -> return unless window.localStorage? try window.localStorage.removeItem @key Model = require './model' class RequestHistory extends Model url: -> "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/history/request/#{ @requestId }/requests" initialize: (models, { @requestId }) => parse: (requestHistoryObjects) -> requestHistory = {} requestHistory.requestId = @requestId requestHistory.requestUpdates = requestHistoryObjects _.each requestHistory.requestUpdates, (requestUpdate, i) => requestUpdate.userHuman = requestUpdate.user?.split('@')[0] ? '—' requestUpdate.createdAtHuman = utils.humanTimeAgo requestUpdate.createdAt requestUpdate.stateHuman = constants.requestStates[requestUpdate.state] requestHistory module.exports = RequestHistoryQ = require 'q' {Base} = require "#{__dirname}/base" {Wrappers} = require "#{__dirname}/helpers/wrappers" {BeanBuilder} = require "#{__dirname}/helpers/bean_builder" class BaseTask extends Base app: null actions: null actionBuilder: null constructor: -> @actions = [] @actionBuilder = new BeanBuilder basePath: "#{__dirname}/tasks/actions", suffix: 'action' configure: (@app, config) -> super @app.getEmitter() @_configureActions config.actions if config.actions?.length _configureActions: (actions) -> @actions = (@_buildAction action for action in actions) return initialize: -> for action in @actions action.initialize() return _buildAction: (config) -> action = @actionBuilder.build config action.configure @app, @, config return action run: (data)-> promise = null scope = data: data for action in @actions if promise promise.then ((lastResult) -> scope.lastResult = lastResult Q.when action.run scope ), ((err) => @log 'warn', 'task.base', "Action #{action} performed not well.", err ) else promise = Q.when action.run scope return promise exports.BaseTask = BaseTaskBootstrap.BsPill = Bootstrap.ItemView.extend(Bootstrap.NavItem, Bootstrap.ItemSelection, template: Ember.Handlebars.compile ''' {{#if view.content.linkTo}} {{#linkTo view.content.linkTo}}{{view.title}}{{/linkTo}} {{else}} {{view view.pillAsLinkView}} {{/if}} ''' pillAsLinkView: Ember.View.extend( tagName: 'a' template: Ember.Handlebars.compile('{{view.parentView.title}}') attributeBindings: ['href'] href: "#" ) )net = require "net" {testCase} = require "nodeunit" {Configuration, Daemon} = require ".." {prepareFixtures, fixturePath} = require "./lib/test_helper" module.exports = testCase setUp: (proceed) -> prepareFixtures proceed "start and stop": (test) -> test.expect 2 configuration = new Configuration hostRoot: fixturePath("tmp"), httpPort: 0, dnsPort: 0 daemon = new Daemon configuration daemon.start() daemon.on "start", -> test.ok daemon.started daemon.stop() daemon.on "stop", -> test.ok !daemon.started test.done() "start rolls back when it can't boot a server": (test) -> test.expect 2 server = net.createServer() server.listen 0, -> port = server.address().port configuration = new Configuration hostRoot: fixturePath("tmp"), httpPort: port daemon = new Daemon configuration daemon.start() daemon.on "error", (err) -> test.ok err test.ok !daemon.started server.close() test.done() BroadcastServer = require './broadcast-server.coffee' module.exports = configDefaults: hostname: 'localhost' port: 8000 getEmojisFromCheatSheetSite: false automaticallyOpenInBrowser: true broadcastToOthers: false codeHighlight: true server: null activate: -> atom.workspaceView.command 'broadcast:start', => @start() atom.workspaceView.command 'broadcast:stop', => @stop() start: -> @server = new BroadcastServer() unless @server? @server.start() stop: -> @server?.stop() _ = require 'underscore' class Base constructor: (props) -> _.each props, (v, k) => @[k] = v validate: -> validProperty = (property)=> valid = false valid = typeof @[property] isnt 'undefined' if @validator and @validator[property] valid = @validator[property]() valid req = _.every @required, validProperty optionals = yes if @atLeastOne optionals = _.some @atLeastOne, (o)=> if _.isArray o return _.every o, validProperty else return validProperty o req and optionals optional: -> r = [] if @atLeastOne? r = _.flatten @atLeastOne r columns: -> _.union @required, @optional(), ['id'] requiredObject: -> r = {} _.every @required, (property) => r[property] = @[property] r publicObject: (addIns = {})-> r = addIns if @public _.every @public, (property) => r[property] = @[property] else _.every @required, (property) => r[property] = @[property] r.id = @id if typeof @id isnt 'undefined' r module.exports = Base Indicator = require('../models/indicator').model Theme = require('../models/theme').model _ = require('underscore') async = require('async') csv = require('express-csv') exports.index = (req, res) -> Theme.getFatThemes( (err, themes) -> if err? console.error err return res.render(500, "Error fetching the themes") res.render "indicators/index", themes: themes ) exports.show = (req, res) -> Indicator .findOne(_id: req.params.id, (err, indicator) -> if err? console.error err return res.render(500, "Error fetching the indicator") res.render("indicators/show", indicator: indicator, indicatorJSON: JSON.stringify(indicator) ) ) '.workspace, .workspace .editor': 'ctrl-M': 'markdown-preview:toggle' '.platform-darwin .markdown-preview': 'cmd-+': 'markdown-preview:zoom-in' 'cmd-=': 'markdown-preview:zoom-in' 'cmd--': 'markdown-preview:zoom-out' 'cmd-_': 'markdown-preview:zoom-out' 'cmd-0': 'markdown-preview:reset-zoom' '.platform-win32 .markdown-preview, .platform-linux .markdown-preview': 'ctrl-+': 'markdown-preview:zoom-in' 'ctrl-=': 'markdown-preview:zoom-in' 'ctrl--': 'markdown-preview:zoom-out' 'ctrl-_': 'markdown-preview:zoom-out' 'ctrl-0': 'markdown-preview:reset-zoom' {BufferedProcess} = require 'atom' class PscIde constructor: -> @pscIde = atom.config.get("linter-purescript.pscIdeExe") @getModules() .then (output) -> console.log output runCmd: (str) -> return new Promise (resolve,reject) => command = @pscIde args = [] stdout = (output) => console.log "psc-ide", str, "-->", output resolve (@trimQuote output) exit = (code) => console.log "exited with code #{code}" reject code if code is not 0 bp = new BufferedProcess({command,args,stdout,exit}) bp.process.stdin.write str + '\n' getList: (text) -> text.split(",").map (s) -> s.trim() trimQuote: (text) -> withQuotes = /"(.*)"/.exec(text) if withQuotes then withQuotes[1] else text getModules: -> @runCmd "print" .then (output) => @getList output getCompletion: (text) -> @runCmd "complete #{text} Project" .then (output) => completions = (@getList output).map @trimQuote completions getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) => new Promise (resolve) => @getCompletion prefix .then (completions) => resolve completions.map (c) => text: c module.exports = PscIde SpellCheckView = null module.exports = config: grammars: type: 'array' default: [ 'source.gfm' 'text.git-commit' 'text.plain' 'text.plain.null-grammar' ] activate: -> @disposable = atom.workspace.observeTextEditors(addViewToEditor) deactivate: -> @disposable.dispose() addViewToEditor = (editor) -> SpellCheckView ?= require './spell-check-view' new SpellCheckView(editor) path = require 'path' module.exports = (grunt) -> {rm} = require('./task-helpers')(grunt) grunt.registerTask 'partial-clean', 'Delete some of the build files', -> rm grunt.config.get('atom.buildDir') rm '/tmp/atom-coffee-cache' rm '/tmp/atom-cached-atom-shells' rm 'node' rm 'atom-shell' grunt.registerTask 'clean', 'Delete all the build files', -> rm 'node_modules' rm path.join(process.env.HOME, '.atom', '.node-gyp') grunt.task.run('partial-clean') mapboxgl.accessToken = 'pk.eyJ1IjoibWg2MTUwMzg5MSIsImEiOiJjaWhxbTJjOGMwNGt4dHBtMjczbzhieXZkIn0.J8-B8U-8nCtqiZ2CfxbV0g' position = new mapboxgl.LngLat(133.842941, 35.375086).wrap() map = new mapboxgl.Map { container: 'map' style: 'mapbox://styles/mapbox/streets-v8' center: [position.lng, position.lat] zoom: 8 } source = new mapboxgl.GeoJSONSource {data: 'data.geojson'} map.on 'style.load', -> map.addSource('markers', source) map.addLayer { id: 'markers' type: 'symbol' source: 'markers' layout: { 'icon-image': '{marker-symbol}-15' 'icon-optional': true } paint: { 'icon-color': '#0000FF' } } @locate = -> if navigator.geolocation navigator.geolocation.getCurrentPosition (position) -> lng = position.coords.longitude lat = position.coords.latitude lnglat = new mapboxgl.LngLat(lng, lat).wrap() map.flyTo { center: [lnglat.lng, lnglat.lat] zoom: 15 } browserify = require "browserify" connect = require "gulp-connect" error = require "./error.coffee" gulp = require "gulp" gutil = require "gulp-util" notify = require "gulp-notify" path = require "path" source = require "vinyl-source-stream" timer = require "gulp-duration" watchify = require "watchify" test_dir = "./tests/**/*.*" # connect.server # livereload: false # port: 4000 # root: path.resolve("./") rebundle = -> bundler.bundle() .on "error", notify.onError(error) .pipe source("d3plus.js") .pipe gulp.dest("./") .pipe timer("Total Build Time") .pipe(notify( title: "D3plus" message: "New Build Compiled" icon: __dirname + "/../icon.png" )) # .pipe connect.reload() .on "error", notify.onError(error) bundler = watchify(browserify(watchify.args)) .add "./src/init.coffee" .on "update", rebundle gulp.task "dev", -> rebundle() gulp.watch [test_dir], (file) -> fileName = path.relative("./", file.path) gutil.log gutil.colors.cyan(fileName), "changed" # gulp.src(test_dir).pipe connect.reload() # # layout.coffee # # Role: configure the interface for a level # # Responsibility: # * create dictionaries describing the interface elements # * associate them as children of the level {my} = require './my' {vector} = require './god/vector' {header} = require './layout/header' {controls} = require './layout/controls' {grid} = require './layout/grid' {inspector} = require './layout/inspector' {changelog} = require './layout/changelog' # Desired Structure # game # level # header # controls # grid # sprite1 # sprite2... # inspector exports.layout = [ header controls grid inspector changelog.world ] fs = require 'fs' crypto = require 'crypto' createHashID = -> crypto.createHash('sha1').update("#{Math.random()}").digest('hex'); module.exports = (file, callback) -> return callback("No `image` file. Make sure the `image` field is being set.") unless file path = "#{global.image_path}#{createHashID()}_#{file.name}" fs.rename file.path, path, (error) -> return callback(error) if error callback null, path ledger.bitcoin ||= {} ledger.bitcoin.Networks = bitcoin: name: 'bitcoin' ticker: 'btc' bip44_coin_type: '0' version: regular: 0 P2SH: 5 bitcoinjs: bitcoin.networks.bitcoin ws_chain: 'bitcoin' testnet: name: 'testnet' ticker: 'btctest' bip44_coin_type: '0' version: regular: 111 P2SH: 196 bitcoinjs: bitcoin.networks.testnet ws_chain: 'testnet3' litecoin: ticker: 'ltc' bip44_coin_type: '2' version: regular: 48 P2SH: 5 bitcoinjs: bitcoin.networks.litecoin litecoin_test: ticker: 'ltctest' bip44_coin_type: '1' version: regular: 111 P2SH: 196 dogecoin: ticker: 'doge' bip44_coin_type: '3' version: regular: 30 P2SH: 22 bitcoinjs: bitcoin.networks.dogecoin dogecoin_test: ticker: 'dogetest' bip44_coin_type: '1' version: regular: 113 P2SH: 196class Pane extends JView constructor: (options = {}, data) -> options.cssClass = KD.utils.curry "ws-pane", options.cssClass super options, data @headerButtons = {} @createHeader() @createButtons() if options.buttons?.length @on "PaneResized", @bound "handlePaneResized" createHeader: -> options = @getOptions() title = options.title or "" @header = new KDCustomHTMLView tagName : "span" if title is '' cssClass : "ws-header inner-header" partial : "

      #{title}

      " createButtons: -> # TODO: c/p from panel, should refactor both of them. @getOptions().buttons.forEach (buttonOptions) => if buttonOptions.itemClass Klass = buttonOptions.itemClass buttonOptions.callback = buttonOptions.callback?.bind this, this, @getDelegate() buttonView = new Klass buttonOptions else buttonOptions.callback = buttonOptions.callback?.bind this, this, @getDelegate() buttonView = new KDButtonView buttonOptions @headerButtons[buttonOptions.title] = buttonView @header.addSubView buttonView handlePaneResized: ->class API extends Restivus constructor: -> @authMethods = [] super addAuthMethod: (method) -> @authMethods.push method success: (result={}) -> if _.isObject(result) result.success = true return {} = statusCode: 200 body: result failure: (result) -> if _.isObject(result) result.success = false else result = success: false error: result return {} = statusCode: 400 body: result unauthorized: (msg) -> return {} = statusCode: 401 body: success: false error: msg or 'unauthorized' RocketChat.API = {} RocketChat.API.v1 = new API version: 'v1' useDefaultAuth: true prettyJson: false enableCors: false auth: token: 'services.resume.loginTokens.hashedToken' user: -> if @bodyParams?.payload? @bodyParams = JSON.parse @bodyParams.payload for method in RocketChat.API.v1.authMethods result = method.apply @, arguments if result not in [undefined, null, false] return result if @request.headers['x-auth-token'] token = Accounts._hashLoginToken @request.headers['x-auth-token'] return {} = userId: @request.headers['x-user-id'] token: token window.ClientController = showFact: (fact_id) -> fact = new Fact id: fact_id fact.on 'destroy', -> parent.remote.hide() parent.remote.stopHighlightingFactlink fact_id fact.fetch success: -> newClientModal = new DiscussionModalContainer FactlinkApp.discussionModalRegion.show newClientModal view = new DiscussionView model: fact view.on 'render', -> parent.remote.onModalReady() newClientModal.mainRegion.show view showNewFact: (params={}) -> clientModal = new DiscussionModalContainer FactlinkApp.discussionModalRegion.show clientModal FactlinkApp.guided = params.guided == 'true' if params.fact mp_track("Modal: Open prepare") factsNewView = new FactsNewView fact_text: params.fact title: params.title url: params.url factsNewView.on 'render', -> parent.remote.onModalReady() factsNewView.on 'factCreated', (fact) -> parent.highlightLastCreatedFactlink(fact.id, params.fact) clientModal.mainRegion.show factsNewView _ = require 'underscore' $ = jQuery assign = (node, attribute, value) -> if attribute node.attr attribute, value else children = node.children().detach() node.text value node.append(children) $.fn.render = (data) -> data = [data] unless $.isArray(data) context = this template = this.clone() # Iterate over the list of objects for object in data #values = filter_by_value(object, (key, value) -> true )#typeof value == "string") # values = _.map(object, (value, key) -> `{key : value}` ) #console.log values # objects = _.select(object, (key, value) -> typeof value == "object") # lists = _.select(object, (key, value) -> $.isArray() ) tmp = template.clone() for key, value of object if typeof value == "string" [klass, attribute] = key.split('@') assign tmp, attribute, value if tmp.hasClass klass tmp.find(".#{klass}").each -> assign $(this), attribute, value for key, value of object if $.isArray(value) tmp.find(".#{key}").children().first().render(value) for key, value of object if typeof value == "object" && not $.isArray(value) tmp.find(".#{key}").render(value) # Add rendered template to dom context.before(tmp) return context.remove() # Remove the original template from dom americano = require 'americano' fs = require 'fs' path = require 'path' realtimer = require './utils/realtimer' localizationManager = require './utils/localization_manager' useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js') config = common: set: 'view engine': if useBuildView then 'js' else 'jade' 'views': path.resolve __dirname, 'views' engine: js: (path, locales, callback) -> callback null, require(path)(locales) use:[ americano.bodyParser() americano.methodOverride() americano.errorHandler dumpExceptions: true showStack: true americano.static path.resolve(__dirname, '/../client/public'), maxAge: 86400000 ] afterStart: (app, server) -> sio = require 'socket.io' app.io = sio server app.io.on 'connection', (socket) -> realtimer.set(socket) localizationManager.initialize -> console.log "LocalizationManager initialized" development: [ americano.logger 'dev' ] production: [ americano.logger 'short' ] plugins: [ 'cozydb' ] module.exports = config jQuery -> $('.locales a:first').tab('show') $('.accordion-body').on('hidden', -> $(@).prev().find('i').first().removeClass().addClass('icon-chevron-right') ) $('.accordion-body').on('shown', -> $(@).prev().find('i').first().removeClass().addClass('icon-chevron-down')) $('.toggle-hidden').live('click', -> $(@).parents('td').find('div:hidden').show() false) $('#request_hidden_user_explanation_reasons input').live('click', -> $('#request_hidden_user_explanation').show() info_request_id = $('#hide_request_form').attr('info_request_id') reason = $(this).val() $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]") $.ajax "/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, type: "GET" dataType: "text" error: (data, textStatus, jqXHR) -> $('#request_hidden_user_explanation_field').attr("value", "Error: #{textStatus}") success: (data, textStatus, jqXHR) -> $('#request_hidden_user_explanation_field').attr("value", data) ) # Lookup table for compressing data tableTo = # User email: "@" password: "X" has_pro: "$" created_at: ":" updated_at: "#" data_Task: "dT" data_List: "dL" data_Time: "dX" # Class names Task: "T" List: "L" Time: "M" # Properties name: "n" completed: "c" id: "i" priority: "p" date: "d" deleted: "x" notes: "o" tasks: "t" list: "l" tableFrom = {} for k, v of tableTo tableFrom[v] = k # Get a value from the table get = (name, table) -> table[name] or name # Replace an obj with values from the table replace = (obj, table) -> out = {} for key, value of obj if typeof value is "object" and not Array.isArray(obj) for cKey, cValue of value out[get(key, table)] = replace(value, table) else out[get(key, table)] = value out makeObj = (obj) -> if typeof obj is "string" try obj = JSON.parse obj catch e return {} obj Shrink = compress: (obj) -> replace(makeObj(obj), tableTo) expand: (obj) -> replace(makeObj(obj), tableFrom) module?.exports = Shrink {CompositeDisposable} = require 'event-kit' MinimapPigmentsBinding = require './minimap-pigments-binding' module.exports = active: false bindings: {} isActive: -> @active activate: (state) -> @subscriptions = new CompositeDisposable consumeMinimapServiceV1: (@minimap) -> @minimap.registerPlugin 'pigments', this consumePigmentsServiceV1: (@pigments) -> @initialize() if @minimap? and @active deactivate: -> @minimap.unregisterPlugin 'pigments' @minimap = null activatePlugin: -> return if @active @active = true @initialize() if @pigments? initialize: -> @editorsSubscription = @pigments.observeColorBuffers (colorBuffer) => editor = colorBuffer.editor minimap = @minimap.minimapForEditor(editor) binding = new MinimapPigmentsBinding({editor, minimap, colorBuffer}) @bindings[editor.id] = binding subscription = editor.onDidDestroy => binding.destroy() delete @bindings[editor.id] subscription.dispose() bindingForEditor: (editor) -> return @bindings[editor.id] if @bindings[editor.id]? deactivatePlugin: -> return unless @active for id,binding of @bindings binding.destroy() delete @bindings[id] @active = false @editorsSubscription?.dispose() @subscriptions.dispose() ProjectMonitor.Views ||= {} class ProjectMonitor.Views.HomeView extends Backbone.View tagName: "ol" className: "projects" template: JST["backbone/templates/home"] initialize: (options) -> @_addTileView(tile) for tile in @collection.models @collection.on 'reset', => @.tearDownRegisteredSubViews() for model in @collection.models @_addTileView(model) @render() @collection.on 'add', (model) => unless model.id in (view.model.id for cid,view of @subViews) @_addTileView(model) @render() @collection.on 'remove', (model) => viewsToDelete = (view for cid,view of @subViews when view.model.id == model.id) for view in viewsToDelete view.tearDown() _addTileView: (model) -> if model.get("aggregate") view = new ProjectMonitor.Views.AggregateProjectView(model: model) else view = new ProjectMonitor.Views.ProjectView(model: model) @registerSubView(view) render: -> @$el.empty() @$el.append(subview.render().$el) for cid,subview of @subViews @ window.Binco.Select2 = load: (selector) -> selector = if typeof selector == 'string' then selector else '.select2-rails' $(selector).each((i,e) -> $(e).select2('destroy') if $(e).hasClass("select2-hidden-accessible") $(e).select2() ) $(document).on 'turbolinks:load', window.Binco.Select2.load window.Messages = new Meteor.Collection('messages') Template.chatTemplate.messages = -> Messages.find() $ -> $('#enter').submit( -> Meteor.subscribe('channel', $('#channel').val(), $('#user').val()) ) {Subscriber} = require 'emissary' module.exports = class Whitespace Subscriber.includeInto(this) constructor: -> atom.workspace.eachEditor (editor) => @handleEditorEvents(editor) destroy: -> @unsubscribe() handleEditorEvents: (editor) -> @subscribe editor, 'will-be-saved', => editor.transact => if atom.config.get('whitespace.removeTrailingWhitespace') @removeTrailingWhitespace(editor) if atom.config.get('whitespace.ensureSingleTrailingNewline') @ensureSingleTrailingNewline(editor) @subscribe editor, 'destroyed', => @unsubscribe(editor) removeTrailingWhitespace: (editor) -> editor.scan /[ \t]+$/g, ({lineText, match, replace}) -> if editor.getGrammar().scopeName is 'source.gfm' # GitHub Flavored Markdown permits two spaces at the end of a line [whitespace] = match replace('') unless whitespace is ' ' and whitespace isnt lineText else replace('') ensureSingleTrailingNewline: (editor) -> lastRow = editor.getLastBufferRow() lastLine = editor.lineForBufferRow(lastRow) if lastLine is '' row = lastRow - 1 while row and editor.lineForBufferRow(row) is '' editor.deleteBufferRow(row--) else selectedBufferRanges = editor.getSelectedBufferRanges() editor.appendText('\n') editor.setSelectedBufferRanges(selectedBufferRanges) $(document).foundation() hash = window.location.hash if hash # Open the Foundation tab whose URL matches the requested hash. # http://foundation.zurb.com/sites/docs/tabs.html $("[data-tabs] [href=\"#{hash}\"]").click() BaseModel = require '../BaseModel' Utils = require '../Utils' class ProjectIssues extends BaseModel list: (projectId, params = {}, fn = null) => @debug "ProjectIssues::issues()" if 'function' is typeof params fn = params params = {} params.page ?= 1 params.per_page ?= 100 do (-> data = [] cb = (err, retData) => if err return fn data if fn if retData.length == params.per_page @debug "Recurse ProjectIssues::list()" data = data.concat(retData) params.page++ return @get "projects/#{Utils.parseProjectId projectId}/issues", params, cb else data = data.concat(retData) return fn data if fn @get "projects/#{Utils.parseProjectId projectId}/issues", params, cb ).bind(@) module.exports = (client) -> new ProjectIssues client #oreList = query("select itemName from Ore order by itemName", (err, rows, result) -> # alert rows ) #alert oreList #alert "3333" refiningTable = null AddNewRefiningElement = -> quantity = parseInt($("#inputQuantity").val(), 10) unless isNaN(quantity) itemName = $("#oreInput1").val() oreRow = refiningTable.row((rowID) -> return refiningTable.cell(rowID, 0).data() is itemName ).index() if oreRow? # Found oreCell = refiningTable.cell(oreRow, 1) oreCell.data(oreCell.data() + quantity) else # Not found refiningTable.row.add([itemName, quantity]) refiningTable.draw() return $ -> refiningTable = $("#refiningSource").DataTable "paging": false "searching": false columns: [ { title: "Ore" } { title: "Quantity" } ] $(".select2").select2() #- $(oreList).each(function() { #- var opt = document.createElement("option"); #- opt.innerHTML = this; #- $("#oreInput1").appendChild(opt);}); $("#addButton").on("click", AddNewRefiningElement) return # Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it here: # https://github.com/bevry/cson#what-is-cson '.text.html': 'Translation Method': 'prefix': 'trans' 'body': '__(\'${1:text}\') ?>' 'Get URL': 'prefix': 'geturl' 'body': 'getUrl(\'${1:ref}\') ?>' 'Get Child HTML': 'prefix': 'chtml' 'body': 'getChildHtml(\'${1:child}\') ?>' '.text.xml': 'Magento layout block': 'prefix': 'block' 'body': '$5' 'Magento layout reference': 'prefix': 'ref' 'body': '$2' Template.displayETA.arrivals = (direction)-> stop = Session.get 'etaStop' if not stop return return Arrivals.find({ station: stop, direction: direction }) describe 'LinkGrabber', -> describe 'with links', -> it 'should find all links', -> links = LinkGrabber.fromHTMLString('

      Lorem ipsum dolor lorem ipsum

      ').allLinks() links.should.have.lengthOf(2) links[0].should.equal("http://foo/") links[1].should.equal("http://bar/")require('chai').should() fs = require 'fs' exec = require('child_process').exec opt = {cwd: __dirname} fixclosure = '../bin/fixclosure.js' describe 'Command line', -> it 'exec without args', (done) -> exec fixclosure, opt, (err, stdout, stderr) -> done(err) it 'exec with file', (done) -> exec fixclosure + ' fixtures/exec.js', opt, (err) -> done(err) $(-> $('[data-typeahead]').on 'keyup', (e)-> $this = $(this) pattern = $this.val().toLowerCase() searchClass = $this.data("typeahead-search") $($this.data("typeahead")).children().each (idx)-> if $(this).find("#{searchClass}").text().toLowerCase().search(pattern) == -1 $(this).hide() else $(this).show() )# Description: # Listens for words and sometimes replies with an Arnie quote # # Dependencies: # None # # Commands: # None # # Author: # Casey Lawrence # arnie_quotes = [ 'GET TO THE CHOPPA!', 'Your clothes, give them to me, NOW!', 'Hasta La Vista, Baby!', 'DDDAAANNNAAAA!', 'You are one ugly mothersucker.', 'It`s not a tumor!', 'When I said you should screw yourself I didn`t mean it literally.', 'Can you hurry up. My horse is getting tired.', 'Are these all your lunches? You mean you eat other peoples` lunches? STOP IT!!', 'I`m the party pooper.', 'Who is your daddy and what does he do?' ] module.exports = (robot) -> robot.hear /(^|\s)(arnold|arnie)(\s|$|[\W])/ig, (msg) -> msg.send msg.random arnie_quotes {CompositeDisposable} = require 'atom' class Commands constructor: (@linter) -> @_subscriptions = new CompositeDisposable @_subscriptions.add atom.commands.add 'atom-workspace', 'linter:next-error': @nextError.bind(@) 'linter:toggle': @toggleLinter.bind(@) 'linter:set-bubble-transparent': @setBubleTransparent.bind(@) # Default values @_messages = null toggleLinter: -> activeEditorLinter = @linter.getActiveEditorLinter() return unless activeEditorLinter activeEditorLinter.toggleStatus() setBubleTransparent: -> @linter.views.setBubbleTransparent() nextError: -> if not @_messages or (next = @_messages.next()).done next = (@_messages = @linter.views.getMessages().values()).next() return if next.done # There's no errors message = next.value return unless message.filePath return unless message.range atom.workspace.open(message.filePath).then -> atom.workspace.getActiveTextEditor().setCursorBufferPosition(message.range.start) destroy: -> @_messages = null @_subscriptions.dispose() module.exports = Commands {$} = require 'atom' module.exports = configDefaults: enabled: false activate: (state) -> @migrateOldAutosaveConfig() atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) => editor = event.targetView()?.getModel() @autosave(editor) atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) => @autosave(paneItem) $(window).preempt 'beforeunload', => for pane in atom.workspaceView.getPanes() @autosave(paneItem) for paneItem in pane.getItems() autosave: (paneItem) -> if atom.config.get('autosave.enabled') and paneItem?.getUri?()? paneItem?.save?() migrateOldAutosaveConfig: -> enabled = atom.config.get('core.autosave') return unless enabled? atom.config.set('autosave.enabled', enabled) atom.config.set('core.autosave', null) fs = require('fs') url = require('url') http = require('http') https = require('https') module.exports = class Reader messages = noSourceError: 'a valid source must be provided' httpStatusError: 'http status' source: null sourceType: null constructor: (@source) -> return unless @source switch when @_httpOptions(@source).protocol in ['http:', 'https:'] @sourceType = 'url' when fs.existsSync @source @sourceType = 'file' else @source = null getStream: (callback = ->) -> switch @sourceType when 'file' @getFileStream @source, callback when 'url' @getUrlStream @source, callback else callback new Error(messages.noSourceError) return getFileStream: (path, callback = ->) -> callback null, fs.createReadStream(path) return getUrlStream: (options, callback = ->) -> options = @_httpOptions options client = if options.protocol is 'https:' then https else http client.get options, (res) -> unless res.statusCode is 200 err = new Error "#{messages.httpStatusError} #{res.statusCode}: #{http.STATUS_CODES[res.statusCode]}" callback err return callback null, res .on 'error', callback return _httpOptions: (options) -> options = url.parse options if typeof options is 'string' options path = require('path') gm = require('gm') imageMagick = gm.subClass({ imageMagick: true }) class Imager minSize: 40 maxSize: 400 combine: (face, size, callback) -> if callback? size = @_parseSize(size) else callback = size size = width: @maxSize, height: @maxSize imageMagick() .in(face.eyes) .in(face.nose) .in(face.mouth) .mosaic() .resize(size.width, size.height) .trim() .gravity('Center') .extent(size.width, size.height) .background(face.color) .stream('png', callback) resize: (imagePath, size, callback) -> size = @_parseSize(size) imageMagick(imagePath) .resize(size.width, size.height) .trim() .autoOrient() .stream('png', callback) _clamp: (num) -> return Math.min(Math.max(num, @minSize), @maxSize) _parseSize: (size) -> [width, height] = size.split("x") height?= width return { width: @_clamp(width), height: @_clamp(height) } module.exports = new Imager() {View, $$, $$$} = require '../src/space-pen-extensions' {Document, Point, Range, Site} = require 'telepath' {Emitter, Subscriber} = require 'emissary' module.exports = _: require '../src/underscore-extensions' $: require '../src/jquery-extensions' $$: $$ $$$: $$$ BufferedNodeProcess: require '../src/buffered-node-process' BufferedProcess: require '../src/buffered-process' Directory: require '../src/directory' Document: Document Emitter: Emitter File: require '../src/file' fs: require '../src/fs-utils' Git: require '../src/git' Point: Point Range: Range ScrollView: require '../src/scroll-view' Site: Site stringscore: require '../vendor/stringscore' Subscriber: Subscriber View: View # The following classes can't be used from a Task handler and should therefore # only be exported when not running as a child node process unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE module.exports.Editor = require '../src/editor' module.exports.pathForRepositoryUrl = require('../src/project').pathForRepositoryUrl module.exports.RootView = require '../src/root-view' module.exports.SelectList = require '../src/select-list' module.exports.Task = require '../src/task' class IDEAppController extends AppController KD.registerAppClass this, name : "IDE" route : "/:name?/IDE" behavior : "application" preCondition : condition : (options, cb)-> cb KD.isLoggedIn() failure : (options, cb)-> KD.singletons.appManager.open 'IDE', conditionPassed : yes KD.showEnforceLoginModal() constructor: (options = {}, data) -> options.appInfo = type : "application" name : "IDE" super options, data layoutOptions = direction : "vertical" splitName : "BaseSplit" sizes : [ null, "250px" ] views : [ { type : "split" options : direction : "vertical" sizes : [ "250px", null] views : [ { type : "custom" name : "filesPane" paneClass : IDEFilesTabView }, { type : "custom" name : "editorPane" paneClass : IDETabView } ] }, { type : "custom" name : "socialsPane" paneClass : IDESocialsTabView } ] workspace = new Workspace { layoutOptions } workspace.once "ready", => @getView().addSubView workspace.getView() setActiveTabView: (tabView) -> @activeTabView = tabView "use strict" pathUtils = require("path") glob = require("glob") fs = require("fs") module.exports = (grunt) -> grunt = (require 'grunt-utilities') grunt grunt.initConfig name: 'tree_search' bower: install: options: install: yes targetDir: '.tmp' cleanup: no layout: (type, component) -> (require 'path').join 'components', component clean: dist: files: [ dot: true src: [".tmp"] ] coffee: dist: files: [ expand: true cwd: "lib" src: "**/*.coffee" dest: ".tmp/lib" ext: ".js" ] neuter: dist: options: template: "{%= src %}" loadPaths: ['.tmp', '.tmp/lib', '.tmp/components'] filepathTransform: require 'neuter-grunt-resolve-path' src: [".tmp/lib/<%= name %>.js"] dest: "dist/<%= name %>.js" grunt.registerTask "default", ["clean", "bower", "coffee", "neuter"] {expect} = require 'chai' Promise = require 'bluebird' Promise.longStackTraces() describe 'access service', -> access = null before Promise.coroutine -> db = require('../lib/db') host: process.env.DB_PORT_5432_TCP_ADDR ? 'localhost' user: process.env.DB_USER ? 'postgres' password: process.env.DB_PASSWORD database: process.env.DB ? 'gc' yield db.up() access = require('../lib/access') db describe 'init', -> it 'should return a token', Promise.coroutine -> token = yield access.init() expect(token).to.exist describe 'initialized', -> before Promise.coroutine -> yield access.init() describe 'getToken', -> it 'should return a token', Promise.coroutine -> token = yield access.getToken() expect(token).to.exist describe 'addToken', -> it 'should return a valid token', Promise.coroutine -> token = yield access.addToken() expect(yield access.check token).to.be.true describe 'check', -> it 'should return true for a valid token', Promise.coroutine -> token = yield access.getToken() result = yield access.check token expect(result).to.be.true it 'should return false for an invalid token', Promise.coroutine -> result = yield access.check 'foo' expect(result).to.be.false it 'should return false for a null token', Promise.coroutine -> result = yield access.check null expect(result).to.be.false define [ 'jquery' 'underscore' 'backbone' 'marionette' 'cs!controllers/routing' ], ($, _, Backbone, Marionette, routerController) -> return new (Marionette.AppRouter.extend controller: routerController appRoutes: '': 'workspace' # Show the workspace list of content 'workspace': 'workspace' 'content/:id': 'edit' # Edit an existing piece of content )() name: 'Idris Ipkg' scopeName: 'source.ipkg' fileTypes: ['ipkg'] patterns: [ { name: 'keyword.control.ipkg' match: '\\b(package|opts|modules|sourcedir|makefile|objs|executable|main|libs|pkgs|tests)\\b' } { name: 'string.quoted.double.ipkg' begin: '"' end: '"' } ] App.UsersIndexView = Ember.View.extend layoutName: "settings" classNames: ["settings"] App.UsersNewView = Ember.View.extend layoutName: "settings" classNames: ["settings"] App.UserEditView = Ember.View.extend layoutName: "settings" classNames: ["settings"] App.RoomsView = Ember.View.extend layoutName: "settings" classNames: ["settings"] App.todo = App.cable.subscriptions.create "TodoChannel", connected: -> # Called when the subscription is ready for use on the server disconnected: -> # Called when the subscription has been terminated by the server class AddWorkspaceView extends KDCustomHTMLView constructor: (options = {}, data) -> options.cssClass = 'add-workpace-view' super options, data @addSubView new KDCustomHTMLView tagName: 'figure' @addSubView @input = new KDInputView type : 'text' keydown : @bound 'handleKeyDown' @addSubView @cancel = new KDCustomHTMLView cssClass : 'cancel' click : @bound 'destroy' handleKeyDown: (event) -> if event.which is 13 data = @getData() options = name : @input.getValue() machineUId : data.machineUId machineLabel : data.machineLabel {activitySidebar} = KD.getSingleton 'mainView' activitySidebar.createNewWorkspace options Backbone = require 'backbone' cookies = require 'cookies-js' { keys, each } = require 'underscore' module.exports = class State extends Backbone.Model defaults: view_mode: 'grid' lightbox: false initialize: -> # set values from cookies each keys(@defaults), (key) => @set(key, val) if val = cookies.get key @on 'change:view_mode', @setCookie setCookie: (model, value)-> cookies.set keys(model.changed)[0], value# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 'context-menu': 'atom-text-editor': [ { 'label': 'Toggle titanium' 'command': 'titanium:toggle' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'titanium' 'submenu': [ { 'label': 'Toggle' 'command': 'titanium:toggle' } ] ] } ] C��P�����f� �S�R��� �$�(�+i4�9�?JEQF�G}H(KaP�U~W�[�`�a�ckdj�k�l�o�qr�t�x�}��T�@�Ȇ-���d�8�u�Ù$�K��v���M���ӯ��U�ʴ[�_�c�����I�1����^�����X�������~���y�����D���U��/J� 3 g�c9�� �#/%�)�-+1F3�5�;V>�BPDEG�K~P*T�T�VeXE[�_|f�hmxo�s�t�wX|�|ՀS�=���%���z���ێ=�7�\�t�6�(��Ь��-������E�E���������8��� �/�����������s���~ � �TUMBG��A$=(�(-.F0�529=<vA#F�F|H�L�O�S�X�[E`�a�ceh�i+ntrQw�x|��Ȃ�����S����N�@���|�7�����/�J�~��� ���'��� ���s�������i�������5���E�H���)� �  �z����"f%X)�+D-�.�3�8�>�?CpD�FK)PU�WH]�a�e�g0l�m�sCvLw�{%}ـ+�������'�t�Δv�Z��ڟ �e�T�2�~���]���l���}�����o���x�K�`���������S�������'use strict' angular.module('xoWebApp') .controller 'MainCtrl', ($scope, $location, stats, objects) -> $scope.stats = stats.stats $scope.byUUIDs = objects.byUUIDs $scope.hosts = objects.byTypes.host ? [] $scope.pools = objects.byTypes.pool ? [] $scope.SRs = objects.byTypes.SR ? [] $scope.VMs = objects.byTypes.VM ? [] $scope.goToSR = (uuid) -> $location.path "/srs/#{uuid}" $scope.goToVM = (uuid) -> $location.path "/vms/#{uuid}" # VMs checkboxes. do -> # This is the master checkbox. # Three states: true/false/null $scope.checked_master = false # This map marks which VMs are checked. $scope.checked_VMs = {} # Wheter all VMs are checked. $scope.all = false # Whether no VMs are checked. $scope.none = true $scope.$watchCollection 'checked_VMs', (checked_VMs) -> all = none = true i = 0 for _, checked of checked_VMs ++i if checked none = false break unless all else all = false break unless none $scope.all = all && (i == $scope.VMs.length) $scope.none = none angular.module('loomioApp').controller 'PollsPageController', ($scope, $q, $rootScope, Records, AbilityService, TranslationService, LoadingService, ModalService, PollCommonStartModal) -> $rootScope.$broadcast('currentComponent', { page: 'pollsPage'}) @pollIds = [] from = 0 per = 1 Records.polls.searchResultsCount().then (response) => @pollsCount = response @loadMore = => Records.polls.search(from: from, per: 1).then (response) => from += per @pollIds = @pollIds.concat _.pluck(response.polls, 'id') LoadingService.applyLoadingFunction @, 'loadMore' @loadMore().then(null, (error) -> $rootScope.$broadcast('pageError', error)) .finally => @loaded = true @loadedCount = -> @pollCollection.polls().length @canLoadMore = -> !@fragment && @loadedCount() < @pollsCount @startNewPoll = -> ModalService.open PollCommonStartModal, poll: -> Records.polls.build() @searchPolls = => if @fragment Records.polls.search(@fragment, per: 10) else $q.when() LoadingService.applyLoadingFunction @, 'searchPolls' @pollCollection = polls: => _.sortBy( _.filter(Records.polls.find(@pollIds), (poll) => _.isEmpty(@fragment) or poll.title.match(///#{@fragment}///i)), '-createdAt') return fs = require('fs') expect = require('chai').expect jsdom = require('jsdom').jsdom html = fs.readFileSync("#{__dirname}/index.html", 'utf-8') global.document = jsdom(html) global.window = document.parentWindow global.jQuery = $ = require('jquery') require('../jquery.serializeJSON.js') data = phone: '555.111.2222' website: 'http://www.example.com' user: name: 'Zombie Pirate' username: 'zombie' email: 'zombie@example.com' address: street: num: '123' name: 'Post St.' state: 'NY' city: 'New York' zip: '12345' '15b': ['tivs', 'ctide', 'billionaire'] about: plugin: 'Converts form to JSON' is_user: true has_car: 'audi' shoe: type: 'sneaker' describe 'Serialize Form to JSON', -> it 'should serialize a form to a correct JSON object', -> json = $('form').serializeJSON() expect(json).to.deep.equal(data) linterPath = atom.packages.getLoadedPackage("linter").path Linter = require "#{linterPath}/lib/linter" {CompositeDisposable} = require 'atom' class LinterPhp extends Linter # The syntax that the linter handles. May be a string or # list/tuple of strings. Names should be all lowercase. @syntax: ['text.html.php', 'source.php'] # A string, list, tuple or callable that returns a string, list or tuple, # containing the command line (with arguments) used to lint. cmd: 'php -l -n -d display_errors=On -d log_errors=Off' executablePath: null linterName: 'php' # A regex pattern used to extract information from the executable's output. regex: '(Parse|Fatal) (?error):(\\s*(?parse|syntax) error,?)?\\s*' + '(?(unexpected \'(?[^\']+)\')?.*) ' + 'in .*? on line (?\\d+)' constructor: (editor) -> super(editor) @disposables = new CompositeDisposable @disposables.add atom.config.observe 'linter-php.phpExecutablePath', => @executablePath = atom.config.get 'linter-php.phpExecutablePath' destroy: -> # atom.config.unobserve 'linter-php.phpExecutablePath' @disposables.dispose(); createMessage: (match) -> # message might be empty, we have to supply a value if match and match.type == 'parse' and not match.message message = 'parse error' super(match) module.exports = LinterPhp define (require) -> $ = require('jquery') _ = require('underscore') router = require('cs!router') SearchHeaderView = require('cs!../header/header') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./advanced-template') require('less!./advanced') return class AdvancedSearchView extends BaseView template: template regions: header: '.header' events: 'submit form': 'submitForm' onRender: () -> @regions.header.show(new SearchHeaderView()) submitForm: (e) -> e.preventDefault() $form = $(e.currentTarget) values = $form.serializeArray() query = @formatQuery(values) @search(query) search: (query) -> router.navigate("search?q=#{query}", {trigger: true}) formatQuery: (obj) -> query = _.map obj, (limit, index) -> if not limit.value then return if /\s/g.test(limit.value) and not /"/g.test(limit.value) limit.value = "\"#{limit.value}\"" return "#{limit.name}:#{limit.value}" return _.compact(query).join(' ') if Meteor.isClient UI.registerHelper('featureFlag', () -> flag = @valueOf() flags = Session.get('flags') if flags and flag of flags and flags[flag] == true Template._featureFlag else null ) Deps.autorun () -> if Meteor.userId()? #Set your flagging Meteor.call('flagsForUser', (err, results) -> Session.set('flags', results) ) class Filter constructor: (options) -> @list = options.list @icon = options.icon @form = options.form @attrs = options.attrs @open = options.open @close = options.close this.draw() draw: -> $(@icon).addClass 'filter-button' form = $('').appendTo @form text = $('').appendTo form new Button @icon, ICONS.search, scale: 0.5 translation: '-8 -8' form.submit -> false text.keyup => this.filter(text) text.change => this.filter(text) text.click => this.filter(text) $(@icon).click => if form.is ':hidden' this.filter(text) form.show() this.open() if this.open else form.hide() form[0].reset() this.filter(text) this.close() if this.close filter: (input) -> text = input.val().toLowerCase() if text == '' $('li', @list).show() return test = (node, attr) -> val = (node.attr(attr) || '').toLowerCase() val.indexOf(text) != -1 $('li', @list).each (ix, node) => node = $ node matches = (true for attr in @attrs when test node, attr) if matches.length > 0 then node.show() else node.hide() # Description: # None # # Dependencies: # "date-utils": ">=1.2.5" # "githubot": "0.2.0" # # Configuration: # HUBOT_GITHUB_TOKEN # # Commands: # hubot repo show - shows activity of repository # # Author: # vquaiato require('date-utils') module.exports = (robot) -> github = require("githubot")(robot) robot.respond /repo show (.*)$/i, (msg) -> repo = github.qualified_repo msg.match[1] oauth_token = process.env.HUBOT_GITHUB_TOKEN url = "https://api.github.com/repos/#{repo}/commits" github.get url, (commits) -> if commits.message msg.send "Achievement unlocked: [NEEDLE IN A HAYSTACK] repository #{commits.message}!" else if commits.length == 0 msg.send "Achievement unlocked: [LIKE A BOSS] no commits found!" else msg.send "http://github.com/#{repo}" send = 5 for c in commits if send d = new Date(Date.parse(c.commit.committer.date)).toFormat("DD/MM HH24:MI") msg.send "[#{d} -> #{c.commit.committer.name}] #{c.commit.message}" send -= 1 describe 'PodsList', -> subject = null beforeEach (done) -> subject = new SeedsStore('test') expect(subject.clear()).eventually.notify(done) it 'counts 0', (done) -> expect(subject.countForAll()).eventually.equal(0).notify(done) it 'counts n', (done) -> subject.update([{name: 1},{name: 2},{name: 3}]) expect(subject.countForAll()).eventually.equal(3).notify(done) it 'readPod', (done) -> subject.update([{name: 1}, {name: 2}]) expect(subject.readPod(1)).eventually.eql([{name: 1}]).notify(done)React = require 'react' LearningGuide = require '../flux/learning-guide' LoadableItem = require './loadable-item' Teacher = require './learning-guide/teacher' Student = require './learning-guide/student' LearningGuideStudentShell = React.createClass contextTypes: router: React.PropTypes.func render: -> {courseId} = @context.router.getCurrentParams() } /> LearningGuideTeacherShell = React.createClass contextTypes: router: React.PropTypes.func render: -> {courseId} = @context.router.getCurrentParams() } /> module.exports = {LearningGuideStudentShell, LearningGuideTeacherShell} fs = require 'fs-plus' path = require 'path' season = require 'season' temp = require('temp').track() runAtom = require './helpers/start-atom' describe "Smoke Test", -> return unless process.platform is 'darwin' # Fails on win32 atomHome = temp.mkdirSync('atom-home') beforeEach -> jasmine.useRealClock() season.writeFileSync(path.join(atomHome, 'config.cson'), { '*': { welcome: {showOnStartup: false}, core: {telemetryConsent: 'no'} } }) it "can open a file in Atom and perform basic operations on it", -> tempDirPath = temp.mkdirSync("empty-dir") runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> client .treeViewRootDirectories() .then ({value}) -> expect(value).toEqual([tempDirPath]) .waitForExist("atom-text-editor", 5000) .then (exists) -> expect(exists).toBe true .waitForPaneItemCount(1, 1000) .click("atom-text-editor") .waitUntil((-> @execute(-> document.activeElement.closest('atom-text-editor'))), 5000) .keys("Hello!") .execute -> atom.workspace.getActiveTextEditor().getText() .then ({value}) -> expect(value).toBe "Hello!" .dispatchCommand("editor:delete-line") # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> $('#search').on 'keyup', -> $('.search-bar form').submit(){Range} = require('atom') fuzzaldrin = require('fuzzaldrin') module.exports = class SnippetsProvider selector: '*' getSuggestions: ({scopeDescriptor, prefix}) -> return unless prefix?.length scopeSnippets = atom.config.get('snippets', {scope: scopeDescriptor}) @findSuggestionsForPrefix(scopeSnippets, prefix) findSuggestionsForPrefix: (snippets, prefix) -> return [] unless snippets? for __, snippet of snippets when snippet.prefix.lastIndexOf(prefix, 0) isnt -1 text: snippet.prefix replacementPrefix: prefix rightLabel: snippet.name onDidInsertSuggestion: ({editor}) -> atom.commands.dispatch(atom.views.getView(editor), 'snippets:expand') express = require 'express' app = express() app.get '/', (request, response) -> response.send('Hello World!') port = process.env.PORT or 5000 app.listen port, -> console.log("Listening on " + port) # Extract rendering/serving portion to own module shared by viewer and clicontainers = $(".ontology-version-state") final_states = ["done", "failed"] poll_time = 3000 # milliseconds return if _.isEmpty(containers) || !containers.length update = (container) -> updateContainer = (container) -> current_state = container.data('state') $.getJSON container.data('uri'), (data) -> state = data.state if state == current_state && !_.contains(final_states, state) enqueue(container) else current_state = state # display the new state container.find("span").text(state) if state == "pending" $(".pending_message").show() else $(".pending_message").hide() if _.contains(final_states, state) # replace spinner with refresh button container.find(".spinner"). replaceWith($(''). attr('href', document.location.href). attr('class', 'btn btn-info btn-sm'). append($(''). attr('class', 'icon-refresh')). text('refresh')) else enqueue(container) if _.isUndefined(container) containers.each -> updateContainer($(this)) else updateContainer(container) enqueue = (container) -> setTimeout (-> update(container)), poll_time enqueue() fs = require 'fs' path = require 'path' mkdir = (path, cb) -> cb = cb or -> mode = 0o777 & (~process.umask()) fs.mkdir path, mode, (err) -> if err?.code is 'ENOENT' mkdir path.dirname(path), (err) -> mkdir path, (err) -> cb null cb null module.exports = (opts) -> # Get full path to entry opts.entry = path.resolve opts.entry # Create bundler with our opts bundler = require('./bundle')(opts) # Bundle Javascript, output to file if opts.output or stdout bundler.bundle (err, content) -> if opts.output mkdir path.dirname(opts.output), (err) -> fs.writeFile opts.output, content, 'utf8', (err) -> throw err if err else console.log content display_locale_fields = () -> attr = $('#attr_list a.active').data('attr') locales = $('#locale').val() show = $("select[name='show-only']").val() $('#attr_fields .panel').hide() for locale in locales do (locale) -> value = $('#attr_fields .panel.' + attr + '.' + locale + ' :input').val().replace /^\s+|\s+$/g, "" if show == 'incomplete' display = value == '' else if show == 'complete' display = value != '' else display = true if display $('#attr_fields .panel.' + attr + '.' + locale).show() if $('#attr_fields .panel:visible').length == 0 and show != 'all' $('#attr_fields .no-translations').show() $ -> $('#attr_list a').click -> $('#attr_list a').removeClass('active') $(this).addClass('active') display_locale_fields() false $('#locale, #supported_locales_').select2({placeholder: Spree.translations['please_choose_language']}) $('#locale').change -> display_locale_fields() $("select[name='show-only']").change -> display_locale_fields() Crafty.defineScene 'New', -> #Crafty.e('2D,DOM,Color').attr( #x: 10 #y: 10 #w: 20 #h: 20 #).color('#0000FF') #Crafty.e('2D,Canvas,Color,Fourway').attr( #x: 100 #y: 100 #w: 40 #h: 40 #).color('#FF0000').fourway() Crafty.e('2D,WebGL,Color,Fourway,Player').attr( x: 100 y: 100 w: 40 h: 40 ).color('#FF0000').fourway(250) #Crafty.e('2D,WebGL,Color,FooBar,Collision').attr( #x: 300 #y: 200 #w: 40 #h: 40 #z: 2 #).color('#0000FF').onHit('Player', -> #@bind('TweenEnd', -> #@destroy() #) #@addComponent('Tween').tween( #w: 400 #h: 400 #x: 0 #y: 0 #alpha: 0.2 #1000 #) #) #Crafty.e('2D,Canvas,Color,GamepadMultiway') #.attr( #x: 100 #y: 100 #w: 40 #h: 40 #) #.color('#FF0000') #.gamepadMultiway(speed: 250) -> define ['backbone.marionette'], (Marionette) -> class Router extends Marionette.AppRouter routes: 'unit/:id': 'renderUnit', 'unit/?*params': 'renderUnitsWithFilter' renderUnit: (id)-> app.vent.trigger 'unit:render-one', id renderUnitsWithFilter: (params) -> app.vent.trigger 'units:render-with-filter', params Router #!/usr/bin/env coffee feathers = require("feathers") bodyParser = require("body-parser") path = require("path") twilio = require("twilio") config = require("./config") # Public Directory publicPath = path.resolve(__dirname, "../app") # Services transmissionService = require("./services/transmissionService") providerService = require("./services/providerService") twilioService = require("./services/twilioService") botService = require("./services/botService") # Create App Server app = feathers() # Configure app.configure(feathers.rest()) .configure(feathers.socketio()) # Enable parsing for POST, PUT and PATCH requests # in JSON and URL encoded forms .use(bodyParser.json()) .use(bodyParser.urlencoded(extended: true)) # Services .use("/api/transmission", transmissionService) .use("/api/torrents", providerService) .use("/api/bot", botService) # Public static content .use(feathers.static(publicPath)) .post("/api/sms", twilio.webhook(config.twilio.authToken), twilioService.receive) # Start server listening .listen config.server.port, -> console.log "Listening on http://localhost:" + config.server.port 'context-menu': '.tree-view': 'Add File': 'tree-view:add' 'Rename': 'tree-view:move' 'Delete': 'tree-view:remove' async = require 'async' fs = require 'fs' VariableScanner = require '../variable-scanner' class PathScanner constructor: (@path) -> @scanner = new VariableScanner load: (done) -> currentChunk = '' currentLine = 0 currentOffset = 0 lastIndex = 0 results = [] readStream = fs.createReadStream(@path) readStream.on 'data', (chunk) => currentChunk += chunk.toString() index = lastIndex while result = @scanner.search(currentChunk, lastIndex) result.range[0] += index result.range[1] += index for v in result v.path = @path v.range[0] += index v.range[1] += index v.definitionRange = result.range results = results.concat(result) {lastIndex} = result if result? currentChunk = currentChunk[lastIndex..-1] lastIndex = 0 readStream.on 'end', -> emit('scan-paths:path-scanned', results) done() module.exports = (paths) -> async.each( paths, (path, next) -> new PathScanner(path).load(next) @async() ) {elementMatchesSelector} = LocalTime class LocalTime.PageObserver constructor: (@selector, @callback) -> start: -> unless @started @observeWithMutationObserver() or @observeWithMutationEvent() @started = true observeWithMutationObserver: -> if MutationObserver? observer = new MutationObserver @processMutations observer.observe(document.documentElement, childList: true, subtree: true) true observeWithMutationEvent: -> addEventListener("DOMNodeInserted", @processInsertion, false) true findSignificantElements: (element) -> elements = [] if element?.nodeType is Node.ELEMENT_NODE elements.push(element) if elementMatchesSelector(element, @selector) elements.concat(element.querySelectorAll(@selector)...) elements processMutations: (mutations) => elements = [] for mutation in mutations switch mutation.type when "childList" for node in mutation.addedNodes elements.push(@findSignificantElements(node)...) @notify(elements) processInsertion: (event) => elements = @findSignificantElements(event.target) @notify(elements) notify: (elements) -> if elements?.length @callback?(elements) '.editor': 'ctrl-f2': 'bookmarks:view-all' 'f2': 'bookmarks:jump-to-next-bookmark' 'shift-f2': 'bookmarks:jump-to-previous-bookmark' '.platform-darwin .editor': 'cmd-f2': 'bookmarks:toggle-bookmark' 'cmd-shift-f2': 'bookmarks:clear-bookmarks' '.platform-win32 .editor': 'alt-ctrl-f2': 'bookmarks:toggle-bookmark' 'ctrl-shift-f2': 'bookmarks:clear-bookmarks' '.platform-linux .editor': 'ctrl-shift-f2': 'bookmarks:toggle-bookmark' 'alt-shift-f2': 'bookmarks:clear-bookmarks' import contest from "../../lib/contest" import label from "../../lib/label" import link from "../../lib/link" import page from "../../lib/page" import problem from "../../lib/problem" import topic from "../../lib/topic" import {ruen} from "../../lib/util" export default sparse_tables = () -> return { topic: topic( ruen("Sparse tables, двоичный подъем", "Sparse tables, binary ascent"), ruen("Задачи на sparse tables", "Problems on sparse tables"), [ problem(113919), problem(113550), ], "sparse_tables"), }_ = require 'underscore-plus' {View} = require 'atom' ImageEditor = require './image-editor' module.exports = class ImageEditorStatusView extends View @content: -> @div class: 'status-image inline-block', => @span class: 'image-size', outlet: 'imageSizeStatus' initialize: (@statusBar) -> @attach() @subscribe atom.workspaceView, 'pane-container:active-pane-item-changed', => @updateImageSize() attach: -> @statusBar.appendLeft this afterAttach: -> @updateImageSize() getImageSize: (view) -> imageWidth = view.originalWidth imageHeight = view.originalHeight @imageSizeStatus.text("#{imageWidth}px x #{imageHeight}px").show() updateImageSize: -> editor = atom.workspaceView.getActivePaneItem() if editor instanceof ImageEditor view = atom.workspaceView.getActiveView() if view.loaded @getImageSize(view) else # wait for image to load before getting originalWidth and originalHeight view.image.load => @getImageSize(view) else @imageSizeStatus.hide() 'use strict' module.exports = angular.module('astrifex', [ 'ui.router' 'md5.svg-star' require('../../../tmp/templates').name require('../common/index').name require('./maker/index').name ]) {$} = require 'atom' module.exports = configDefaults: enabled: false activate: -> atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) => editor = $(event.target).closest('.editor').view()?.getModel() @autosave(editor) atom.workspaceView.on 'pane:before-item-destroyed', (event, paneItem) => @autosave(paneItem) $(window).preempt 'beforeunload', => for pane in atom.workspaceView.getPanes() @autosave(paneItem) for paneItem in pane.getItems() autosave: (paneItem) -> return unless atom.config.get('autosave.enabled') return unless paneItem?.getUri?()? return unless paneItem?.isModified?() paneItem?.save?() # Description # Notifies based on the results of xcode builds and controls xcode builds # # Dependencies # None # # Configuration # None # # Commands: # hubot build - Start a build for bot named UNIMPLEMENTED # # Author: # bmnick url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error res.writeHead 204, { 'Content-Length': 0} res.end() # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ $ -> $('[data-toggle="tooltip"]').tooltip(placement: 'right') $('.datepicker').datepicker format: 'dd/mm/yyyy', $('select#member_university_name').on 'change', (e) => parentElement = $('#member_university_name_other').parents('.control-group') parentElement.hide() if e.target.value == 'Other (please specify)' parentElement.show() parentElement.find('input').focus() $('select#member_university_qualification').on 'change', (e) => parentElement = $('#member_university_qualification_other').parents('.control-group') parentElement.hide() if e.target.value == 'Other (please specify)' parentElement.show() parentElement.find('input').focus() RedisWrapper = require('../../infrastructure/RedisWrapper') rclient = RedisWrapper.client('sudomode') logger = require('logger-sharelatex') TIMEOUT_IN_SECONDS = 60 * 10 module.exports = SudoModeHandler = _buildKey: (userId) -> "SudoMode:{#{userId}}" activateSudoMode: (userId, callback=(err)->) -> if !userId? return callback(new Error('[SudoMode] user must not be supplied')) duration = TIMEOUT_IN_SECONDS logger.log {userId, duration}, "[SudoMode] activating sudo mode for user" rclient.set SudoModeHandler._buildKey(userId), '1', 'EX', duration, callback isSudoModeActive: (userId, callback=(err, isActive)->) -> if !userId? return callback(new Error('[SudoMode] user must not be supplied')) rclient.get SudoModeHandler._buildKey(userId), (err, result) -> if err? return callback(err) callback(null, result == '1') # Add a default clickhandler so we can use hrefs Backbone.View::defaultClickHandler = (e, routeTo=null) -> routeTo ||= $(e.target).closest("a").attr("href") # Return if a modifier key is pressed or when Backbone has not properly been initialized # Make sure we return "true" so other functions can determine what happened # Note that the capitalization in Backbone.[H]istory is intentional if e.metaKey or e.ctrlKey or e.altKey window.open routeTo, "_blank" else if not Backbone.History.started window.open routeTo, FactlinkApp.linkTarget else Backbone.View::navigateTo routeTo e.preventDefault() false Backbone.View::navigateTo = (routeTo) -> console.info "Navigating to " + routeTo, "from /" + Backbone.history.fragment if "/" + Backbone.history.fragment is routeTo Backbone.history.fragment = null Backbone.history.navigate routeTo, trigger: true replace: true else oldFragment = Backbone.history.fragment Backbone.history.navigate routeTo, false unless Backbone.history.loadUrl(routeTo) Backbone.history.navigate oldFragment, false window.open routeTo, FactlinkApp.linkTarget window.focus() # HACK: this is needed because internal events did not seem to work $(document).on "click", ":not(div.discussion-modal) a[rel=backbone]", Backbone.View::defaultClickHandler _ = require "underscore" $ = require "jquery" $1 = require "bootstrap/modal" ActionTool = require "./action_tool" preview_save_tool_template = require "./preview_save_tool_template" class PreviewSaveToolView extends ActionTool.View className: "bk-bs-modal" template: preview_save_tool_template initialize: (options) -> super(options) @render() render: () -> @$el.empty() @$el.html(@template()) @$el.attr("tabindex", "-1") @$el.on('hidden', () => @$el.modal('hide')) @$el.modal({show: false}) do: () -> canvas = @plot_view.canvas_view.canvas[0] @$('.bk-bs-modal-body img').attr("src", canvas.toDataURL()); @$el.modal('show') class PreviewSaveTool extends ActionTool.Model default_view: PreviewSaveToolView type: "PreviewSaveTool" tool_name: "Preview/Save" icon: "bk-tool-icon-preview-save" module.exports = Model: PreviewSaveTool View: PreviewSaveToolView _ = require "underscore" Widget = require "./widget" p = require "../../core/properties" class AbstractButton extends Widget.Model type: "AbstractButton" @define { callback: [ p.Instance ] label: [ p.String, "Button" ] icon: [ p.String ] button_type: [ p.String, "default" ] # TODO (bev) } module.exports = Model: AbstractButton ns = @edsc.models.data ns.Project = do (ko) -> class Project constructor: -> @datasets = ko.observableArray() toggleDataset: (dataset) => datasets = @datasets if datasets.contains(dataset) datasets.remove(dataset) else datasets.push(dataset) exports = Project 'use strict' App = items: [ {name: 'Learn Brunch', check: true} {name: 'Find a way to automate tests', check: true} {name: 'Apply to my projects', check: false} # '...' {name: 'Profit!', check: false} ] init: -> tmpl = require 'views/list' html = tmpl items: App.items document.getElementsByTagName('body')[0].innerHTML += html return module.exports = App if Meteor.isCordova if RocketChat.settings.get('Push_enable') is true Push.Configure {} Push.addListener 'token', (token) -> Meteor.call 'log', 'token', arguments Push.addListener 'error', (err) -> Meteor.call 'log', 'error', arguments if error.type == 'apn.cordova' Meteor.call 'log', err.error Push.addListener 'register', (evt) -> Meteor.call 'log', 'register', arguments Push.addListener 'alert', (notification) -> Meteor.call 'log', 'alert', arguments Push.addListener 'sound', (notification) -> Meteor.call 'log', 'sound', arguments Push.addListener 'badge', (notification) -> Meteor.call 'log', 'badge', arguments Push.addListener 'startup', (notification) -> Meteor.call 'log', 'startup', arguments Push.addListener 'message', (notification) -> Meteor.call 'log', 'message', argumentskd = require 'kd' KDListItemView = kd.ListItemView KDCustomHTMLView = kd.CustomHTMLView AvatarView = require 'app/commonviews/avatarviews/avatarview' module.exports = class UserItem extends KDListItemView constructor: (options = {}, data) -> options.type = 'user' options.justFirstName ?= yes super options, data viewAppended: -> { profile: { firstName, lastName, nickname} } = @getData() { size, justFirstName } = @getOptions() name = if justFirstName then firstName else "#{firstName} #{lastName}" @avatar = new AvatarView origin : nickname size : size or width: 22, height: 22 @name = new KDCustomHTMLView cssClass : 'name' partial : name @addSubView @avatar @addSubView @name @addSubView new KDCustomHTMLView tagName : 'span' cssClass : 'remove' click : => @getDelegate().emit 'KickUserRequested', this class window.ChosenActivator @activate: -> $(".js--chosen").not(".optional").chosen() $(".js--chosen.optional").chosen(allow_single_deselect: true) $ -> ChosenActivator.activate() AjaxModal.on_show -> # Give the browser just enough time to set the width of the select before # activating Chosen. Otherwise, it will sometimes appear as 0-width. setTimeout(ChosenActivator.activate, 25); Controller = require 'zooniverse/controllers/base-controller' Api = require 'zooniverse/lib/api' class SubjectMetadata extends Controller template: (context) -> " " metadata: volume: '' year: '' page_no: '' constructor: -> super classify_page = null @listenTo Api, 'ready', (e) => currentProject = require 'zooniverse-readymade/current-project' classify_page = currentProject.classifyPages[0] @listenTo classify_page.Subject, 'select', (e, subject) => @metadata = subject.metadata @el.html @template @ listenTo: (thing, eventName, handler) -> addEvent = if 'on' of thing then 'on' else 'addEventListener' removeEvent = if 'off' of thing then 'off' else 'removeEventListener' thing[addEvent] eventName, handler @on 'destroy', -> thing[removeEvent] eventName, handler module.exports = SubjectMetadataexports.config = files: javascripts: joinTo: 'js/app.js': /^(vendor|bower_components|app)/ stylesheets: joinTo: 'css/app.css' templates: joinTo: 'js/app.js' plugins: handlebars: include: enabled: false `// @ngInject` angular.module('cobudget').config (RestangularProvider, config) -> RestangularProvider.setBaseUrl(config.apiEndpoint) RestangularProvider.setDefaultHttpFields withCredentials: true RestangularProvider.setDefaultHeaders Accept: "application/json" RestangularProvider.setResponseInterceptor (data, operation, what, url, response, deferred) -> if operation is "get" # Trim the 's' off so we can reference the singular root note name # This is a total hack and won't work for resources like "people" return response.data[what.substring(0, what.length-1)] if operation is "getList" return response.data[what] class SidebarController extends KDViewController constructor:-> super mainController = KD.getSingleton 'mainController' mainController.on 'ManageRemotes', -> new ManageRemotesModal mainController.on 'ManageDatabases', -> new ManageDatabasesModal mainController.on 'AccountChanged', @bound 'accountChanged' mainController.ready @bound 'accountChanged' accountChanged:(account)-> account or= KD.whoami() {profile} = account sidebar = @getView() { avatar, finderHeader, navController avatarAreaIconMenu, finderController footerMenuController, resourcesController } = sidebar avatar.setData account finderHeader.setData account # temp fix # this should be done on framework level # check comments on KDObject::setData avatar.render() finderHeader.render() navController.reset() footerMenuController.reset() @resetAdminNavItems() avatarAreaIconMenu.accountChanged account # get registered users vms all ready to go (don't for guests right now): finderController.reset() if "registered" is account.type resourcesController.reset() resetAdminNavItems:-> # return unless KD.isLoggedIn() KD.whoami().fetchRole? (err, role)=> if role is "super-admin" @getView().navController.addItem title : "Admin Panel" type : "admin" loggedIn : yes callback : -> new AdminModal fs = require "fs" class ContentManifest filters: [ ] constructor: (file,@options) -> @rawContent = fs.readFileSync(file,"utf8") @list = @rawContent.split /\n/ addFilter: (pattern,filter) -> @filters.push { pattern: pattern, filter: filter } compile: -> content = "" for item in @list for f in @filters if item.match f.pattern content += f.filter(item) break return content module.exports = ContentManifest {_, $, fs, View} = require 'atom' MatchView = require './match-view' path = require 'path' module.exports = class ResultView extends View @content: (filePath, matches) -> iconClass = if fs.isReadmePath(filePath) then 'icon-book' else 'icon-file-text' @li class: 'path list-nested-item', 'data-path': _.escapeAttribute(filePath), => @div outlet: 'pathDetails', class: 'path-details list-item', => @span class: 'disclosure-arrow' @span class: iconClass + ' icon' @span class: 'path-name bright', filePath.replace(project.getPath()+path.sep, '') @span outlet: 'description', class: 'path-match-number' @ul outlet: 'matches', class: 'matches list-tree', => initialize: (@filePath, matches) -> @renderMatches(matches) renderMatches: (matches) -> @matches.empty() @description.text("(#{matches?.length})") if not matches or matches.length == 0 @hide() else @show() @matches.append new MatchView({@filePath, match}) for match in matches null confirm: -> rootView.openSync(@filePath) User = require '../../../models/user.coffee' Artwork = require '../../../models/artwork.coffee' ArtworkInquiry = require '../../../models/artwork_inquiry.coffee' openInquiryQuestionnaireFor = require '../../../components/inquiry_questionnaire/index.coffee' module.exports = (id) -> user = User.instantiate() inquiry = new ArtworkInquiry notification_delay: 600 artwork = new Artwork id: id artwork.fetch().then -> openInquiryQuestionnaireFor user: user artwork: artwork inquiry: inquiry AjaxPrefix.addAjaxPrefix(jQuery, -> CMS.prefix) @CMS = Models: {} Views: {} prefix: $("meta[name='path_prefix']").attr('content') _.extend CMS, Backbone.Events $ -> Backbone.emulateHTTP = true $.ajaxSetup headers : { 'X-CSRFToken': $.cookie 'csrftoken' } dataType: 'json' $(document).ajaxError (event, jqXHR, ajaxSettings, thrownError) -> if ajaxSettings.notifyOnError is false return if jqXHR.responseText try message = JSON.parse(jqXHR.responseText).error catch message = _.str.truncate(jqXHR.responseText, 300) else message = gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.") msg = new CMS.Views.Notification.Error( "title": gettext("Studio's having trouble saving your work") "message": message ) msg.show() window.onTouchBasedDevice = -> navigator.userAgent.match /iPhone|iPod|iPad/i $('body').addClass 'touch-based-device' if onTouchBasedDevice() # Generated on 2014-12-25 using generator-bower 0.0.1 'use strict' mountFolder = (connect, dir) -> connect.static require('path').resolve(dir) module.exports = (grunt) -> require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks) yeomanConfig = src: 'src' dist : 'dist' grunt.initConfig yeoman: yeomanConfig coffee: dist: files: [ expand: true cwd: '<%= yeoman.src %>' src: '{,*/}*.coffee' dest: '<%= yeoman.dist %>' ext: '.js' ] uglify: build: src: '<%=yeoman.dist %>/forty-datetime.js' dest: '<%=yeoman.dist %>/forty-datetime.min.js' # TODO Add testing # mochaTest: # test: # options: # reporter: 'spec' # compilers: 'coffee:coffee-script' # src: ['test/**/*.coffee'] # # karma: # options: # configFile: 'config/karma-conf.js' # unit: # singleRun: true # # # grunt.loadNpmTasks('grunt-karma') grunt.registerTask 'default', [ #'mochaTest' 'coffee' 'uglify' ] {CompositeDisposable} = require 'atom' module.exports = config: executablePath: type: 'string' title: 'PHP Executable Path' default: 'php' # Let OS's $PATH handle the rest activate: -> @regex = '(Parse|Fatal) ' + '(?error):(\\s*(?parse|syntax) error,?)?\\s*' + '(?(unexpected \'(?[^\']+)\')?.*) ' + 'in .*? on line (?\\d+)' @subscriptions = new CompositeDisposable @subscriptions.add atom.config.observe 'linter-php.executablePath', (executablePath) => @executablePath = executablePath deactivate: -> @subscriptions.dispose() provideLinter: -> path = require 'path' helpers = require('atom-linter') child_process = require 'child_process' provider = grammarScopes: ['text.html.php', 'source.php'] scope: 'file' lintOnFly: false lint: (textEditor) => filePath = textEditor.getPath() command = @executablePath parameters = [] parameters.push('--syntax-check') parameters.push('--no-php-ini') parameters.push('--define', 'display_errors=On') parameters.push('--define', 'log_errors=Off') parameters.push('--file', filePath) return helpers.exec(command, parameters).then (output) => messages = helpers.parse(output, @regex, {filePath: filePath}) console.log(messages) return messagesimport contest from "../../lib/contest" import label from "../../lib/label" import link from "../../lib/link" import page from "../../lib/page" import problem from "../../lib/problem" import topic from "../../lib/topic" import {ruen} from "../../lib/util" export default sparse_tables = () -> return { topic: topic( ruen("Sparse tables, двоичный подъем", "Sparse tables, binary ascent"), ruen("Задачи на sparse tables", "Problems on sparse tables"), [ problem(113919), ], "sparse_tables"), advancedProblems: [ problem(113550), ] }Wheelmap.ToolbarController = Ember.Controller.extend needs: 'map' statusFilters: ['yes', 'limited', 'no', 'unknown'] map: Ember.computed.alias('controllers.map') _extraFilter: false # Flag for executing special status filter behavior only once init: ()-> @_super() if $.cookie('last_status_filters') @set('statusFilters', JSON.parse($.cookie('last_status_filters'))) actions: toggleFilter: (wheelchair)-> statusFilters = @get('statusFilters') if !@_extraFilter && statusFilters.length == 4 # Extra logic if all status filters are set and one is clicked: deactivate the other filters statusFilters.clear() statusFilters.addObject(wheelchair) @_extraFilter = true else if statusFilters.contains(wheelchair) statusFilters.removeObject(wheelchair) else statusFilters.addObject(wheelchair) statusFiltersDidChange: (()-> $.cookie('last_status_filters', JSON.stringify(@get('statusFilters'))) ).observes('statusFilters.@each') filterNodes: (()-> self = @ @get('map').forEach (node)-> node.set('isVisible', self.get('statusFilters').contains(node.get('wheelchair'))) ).observes('map.@each.wheelchair', 'statusFilters.@each')module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['**/*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' indentation: level: 'ignore' src: ['src/*.coffee'] test: ['spec/*.coffee'] gruntfile: ['Gruntfile.coffee'] shell: test: command: 'node node_modules/.bin/jasmine-focused --coffee --captureExceptions --forceexit spec' options: stdout: true stderr: true failOnError: true 'update-atomdoc': command: 'npm update grunt-atomdoc donna tello atomdoc' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-atomdoc') grunt.registerTask 'clean', -> require('rimraf').sync('lib') grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['coffee', 'lint']) grunt.registerTask('test', ['coffee', 'lint', 'shell:test']) EnumerableWrapper = getLength: -> @value.length forEach: (callback) -> if @wrappers.constructor == Object callback(key, wrapper) for key, wrapper of @wrappers else if @wrappers.constructor == Array @wrappers.forEach(callback) map: (callback) -> @wrappers.map(callback) find: (callback) -> for wrapper, index in @wrappers when callback(wrapper, index, @wrappers) return wrapper false findIndex: (callback) -> for wrapper, index in @wrappers when callback(wrapper, index, @wrappers) return index return -1 push: (value) -> length = @value.push(value) @set(@value) return length pop: -> last = @value.pop() @set(@value) return last insertAt: (index, value) -> # Use apply to handle value as a single value or an array. args = [index, 0].concat(value) Array.prototype.splice.apply(@value, args) @set(@value) removeAt: (index, howMany = 1) -> removed = @value.splice(index, howMany) @set(@value) return removed module.exports = EnumerableWrapper # module.exports = class ObjectSelection constructor: (@options={}) -> @options.class ?= 'object-selection' setObject: (object) -> @_unbindObject(@object) @object = object @_bindObject(@object) @path.remove() if @path @path = null if @object @path = svg.path('').front() @path.node.setAttribute('class', @options.class + ' invisible-to-hit-test') @render() render: => @object.render(@path) _bindObject: (object) -> return unless object object.on 'change', @render _unbindObject: (object) -> return unless object object.off 'change', @render # # Auction related routes # express = require 'express' routes = require './routes' app = module.exports = express() app.set 'views', __dirname + '/templates' app.set 'view engine', 'jade' app.get '/auction-registration/:id', routes.auctionRegistration app.get '/auction/:id/bid/:artwork', routes.bid app.get '/auction/:id/buyers-premium', routes.buyersPremium define (require) -> $ = require('jquery') toc = require('cs!collections/toc') Node = require('cs!models/content/node') require('backbone-associations') return class Page extends Node defaults: authors: [] constructor: () -> super(arguments...) toc.add(@) parse: (response, options) -> resonse = super(arguments...) # jQuery can not build a jQuery object with or tags, # and will instead move all elements in them up one level. # Use a regex to extract everything in the body and put it into a div instead. $body = $('
      ' + response.content.replace(/^[\s\S]*|<\/body>[\s\S]*$/g, '') + '
      ') $body.children('.title').eq(0).remove() response.content = $body.html() return response should = require('chai').should() bundle = require '../lib/bundle' describe 'bundle', -> it 'should bundle all dependencies', (done) -> bundle entry: './fixtures/entry', exclude: /excluded/ include: ['./fixtures/included'] export: 'entry' , (err, bundle) -> done() 'use strict' IBAN = require 'iban' angular .module 'mm.iban', ['ng'] .directive 'ngIban', -> restrict: 'A' require: 'ngModel' link: (scope, elem, attrs, ctrl) -> parseIban = (value) -> if value? then value.toUpperCase().replace /\s/g, '' else undefined isValidIban = (value) -> return true if not(attrs.required or value) iban = parseIban(value) IBAN.isValid iban ctrl.$validators.ngIban = (modelValue) -> isValidIban modelValue ctrl.$parsers.unshift (viewValue) -> if viewValue? valid = isValidIban viewValue if valid parsed = parseIban viewValue if parsed isnt viewValue ctrl.$setViewValue parsed ctrl.$render() parsed else viewValue ctrl.$formatters.unshift (modelValue) -> if modelValue? valid = isValidIban modelValue if valid parsed = parseIban modelValue if parsed isnt modelValue scope[attrs.ngModel] = parsed parsed else modelValue return .filter 'iban', -> (string, separator) -> parseIban = (value) -> if value? then value.toUpperCase().replace /\s/g, '' else undefined isValidIban = (value) -> iban = parseIban(value) IBAN.isValid iban valid = isValidIban string if valid IBAN.printFormat string, separator else string {Controller} = require 'spine' template = require 'views/about_page' $ = require 'jqueryify' class AboutPage extends Controller className: 'about-page content-page' events: 'click nav button[name="turn-page"]': 'onClickNavButton' elements: 'nav button[name="turn-page"]': 'navButtons' constructor: -> super @html template @navButtons.first().click() $(window).on 'hashchange', @onPageChange onClickNavButton: ({currentTarget}) -> button = $(currentTarget) page = @el.find "[data-page='#{button.val()}']" page.add(page.siblings('[data-page]')).add(button).add(button.siblings('[name="turn-page"]')).removeClass 'before active after' page.prevAll('[data-page]').add(button.prevAll('[name="turn-page"]')).addClass 'before' page.add(button).addClass 'active' page.nextAll('[data-page]').add(button.nextAll('[name="turn-page"]')).addClass 'after' @onPageChange() onPageChange: => setTimeout => visibleProtoimages = @el.find 'img[data-src]:visible' @log visibleProtoimages @processProtoimage img for img in visibleProtoimages processProtoimage: (img) -> img = $(img) img.attr src: img.attr 'data-src' img.removeAttr 'data-src' module.exports = AboutPage @CodequestManager = do (Backbone, Marionette) -> Marionette.Renderer.oldRender = Marionette.Renderer.render Marionette.Renderer.render = (template, data) -> template = template() if typeof template == 'function' unless JST[template] return Marionette.Renderer.oldRender(template, data) return JST[template](data) App = new Marionette.Application() App.Behaviors = {} App.currentUser = undefined App.pageSize = 10 App.animationDurationMedium = 500 App.on 'start', -> App.router = new App.Router controller: App.Controller App.root = new App.Root.Layout Marionette.Behaviors.behaviorsLookup = -> App.Behaviors App.currentUser = new App.Entities.User gon.currentUser App.vent.on 'reload:current:user', -> App.currentUser.fetch() $(document).foundation() App.Panel.Controller.showNavbar() Backbone.history.start pushState: true menuIcon = $('.menu-icon') navigation = $('.top-bar') $('body').on 'click', '[data-navigate]', (e) -> e.preventDefault() href = $(e.currentTarget).attr('href') App.router.navigate href, {trigger: true} menuIcon.click() if navigation.hasClass('expanded') navigation.click() App $ -> CodequestManager.start()_ = require 'lodash' direction = require './direction' bindings = require '../key-bindings.json' module.exports = exports = (game) -> game.on 'key.*', (ch, key) -> action = bindings[key.name ? key.full] if action? parts = action.split('.') if parts[0] is 'direction' parts[1] = direction.normalize parts[1], 1 game.emit "action.#{parts.join '.'}", parts... exports.bindings = bindingsFiberUtils.synchronize = (guardObject, uniqueId, body, options={}) -> # Use the guard object to determine whether we have reentered. guards = guardObject._guards ?= {} guards[uniqueId] ?= new FiberUtils.OrderedFence options topLevel = guards[uniqueId].enter() try return body() finally guards[uniqueId].exit topLevel # Include CSS in page require('./catalog.scss') # Load App _ = require('lodash') React = require('react') {Routes, Route, Redirect} = require('react-router') App = require('./components/App') Page = require('./components/Page/Page') window.Catalog = (config) -> defaultPageOptions = handler: Page iframe: config.iframe or false styles: config.styles or [] router = Routes {location: 'hash'}, Route _.extend({handler: App}, config), config.pages.map((page) -> Route _.extend(key: page.name, defaultPageOptions, page) ).concat(Redirect({key: 'not-found', from: '*', to: '/'})) React.renderComponent(router, document.body) Redis = require 'redis' Url = require 'url' POO_TRACKER_KEY = "poops" POO_LATEST_KEY = "poops:latest_message" info = Url.parse process.env.POO_REDIS_URL or "redis://localhost:6379/0" redis_client = Redis.createClient(info.port, info.hostname) redis_clent.auth info.auth.split(":")[1] if info.auth module.exports = (robot) -> checkRedisForShit = -> redis_clent.lindex POO_TRACKER_KEY, -1, (err, reply) -> return console.error("Failed lindex with key '#{POO_TRACKER_KEY}' and index -1: #{err}") if err return if reply == null robot.messageRoom "#arrakis", "#{reply}" # clean up redis_clent.lrem POO_TRACKER_KEY, 0 redis_clent.set POO_LATEST_KEY, reply robot.respond /poo tracker( me)?/i, (res) -> redis_client.get POO_LATEST_KEY, (err, reply) -> return console.error("Failed get with key '#{POO_TRACKER_KEY}': #{err}") if err return if reply == null return res.send "Latest poo: #{reply}" setInterval -> checkRedisForShit() , 1000 reloadStylesheets = -> queryString = '?reload=' + new Date().getTime(); $('link[rel="stylesheet"]').each -> @href = @href.replace(/\?.*|$/, queryString); connect = (opts={}) -> # if user is running mozilla then use it's built-in WebSocket window.WebSocket ||= window.MozWebSocket connection = new WebSocket('ws://' + (opts.host || document.domain || 'localhost') + ':'+(opts.port || 8081)) connection.onopen = -> console.log("Connected to watcher") connection.onerror = -> console.log("Unable to connect to watcher") connection.onmessage = (message) -> switch message when 'reload-css' reloadStylesheets() when 'reload-js' window.location.reload() connect()# Description: # In which Hubot gives you bugzilla information # # Dependencies: # None # # Configuration: # None # # Commands: # hubot bug - Shows bug summary # # Author: # greenb QS = require 'querystring' Cheerio = require 'cheerio' module.exports = (robot) -> domain = 'http://bugs.sfolab.ibm.com' makePath = (bug) -> '/bugzilla/show_bug.cgi?id=' + bug robot.hear /hubot bug #?(\d+)/i, (msg) -> bug = msg.match[1] params = Bugzilla_login: process.env.BUGZILLA_USER Bugzilla_password: process.env.BUGZILLA_PASS id: bug GoAheadAndLogIn: 'Log in' msg.http(domain) .path(makePath(bug)) .header('Content-Type', 'application/x-www-form-urlencoded') .post(QS.stringify(params)) (err, res, body) -> if err msg.send 'Failed to query bug status. ' + err return if res.statusCode != 200 msg.send 'Failed to query bug status. Got status ' + res.statusCode return $ = Cheerio.load body title = $('title').text() msg.send title msg.send domain + makePath(bug) unless title == 'Invalid Bug ID' InquireViaPhoneModalView = require '../inquire_via_phone/index.coffee' module.exports = ($el) -> $el .find '.js-artwork-partner-stub-inquire-via-phone' .click (e) -> e.preventDefault() @modal = new InquireViaPhoneModalView width: '500px' copy: login: 'Log in to Artsy to call gallery' signup: 'Create an Artsy account to call gallery' register: 'Create an Artsy account to call gallery' artistIds: JSON.parse(e.target.dataset.artist_ids) userData: partner: JSON.parse(e.target.dataset.partner) $el .find '.js-artwork-partner-stub-phone-toggle' .click (e) -> e.preventDefault() $(this).hide() $el .find '.js-artwork-partner-stub-phone-toggleable' .show() _ = require 'underscore' class Base constructor: (props) -> _.each props, (v, k) => @[k] = v validate: -> validProperty = (property)=> valid = false valid = typeof @[property] isnt 'undefined' if @validator and @validator[property] valid = @validator[property]() valid req = _.every @required, validProperty optionals = yes if @atLeastOne optionals = _.some @atLeastOne, (o)=> if _.isArray o return _.every o, validProperty else return validProperty o req and optionals optional: -> r = [] if @atLeastOne? r = _.flatten @atLeastOne r columns: -> _.union @required, @optional(), ['id'] requiredObject: -> r = {} _.every @required, (property) => r[property] = @[property] _.every @optional(), (p)=> if @[p] r[p] = @[p] r publicObject: (addIns = {})-> r = addIns if @public _.every @public, (property) => r[property] = @[property] else _.every @required, (property) => r[property] = @[property] _.every @optional(), (p)=> if @[p] r[p] = @[p] r.id = @id if typeof @id isnt 'undefined' r module.exports = Base class Locker constructor: () -> @is_locked = false try: (fun, args...) -> if @is_locked return @is_locked = true ret = fun args... @is_locked = false return ret # a basic class with generic getter / setter function class BaseClass constructor: -> # ownProperty is unsafe. Rather put it on a dedicated property like.. @_tmp_model = {} # Try to find the property in @_model, else return the # tmp_model _get: (prop) -> if not @_model? @_tmp_model[prop] else @_model.val(prop) # Try to set the property in @_model, else set the # tmp_model _set: (prop, val) -> if not @_model? @_tmp_model[prop] = val else @_model.val(prop, val) # since we already assume that any instance of BaseClass uses a MapManager # We can create it here, to save lines of code _getModel: (Y, Operation)-> if not @_model? @_model = new Operation.MapManager(@).execute() for key, value of @_tmp_model @_model.val(key, value) _setModel: (@_model)-> delete @_tmp_model if module? exports.BaseClass = BaseClass exports.Locker = Locker poi: theme: "papercyan" layout: "horizonal" window: x: 60 y: 60 width: 1274 height: 616 webview: width: 800 shortcut: bosskey: "CmdOrCtrl+i" proxy: use: "none" socks5: host: "127.0.0.1" port: 1080 http: host: "127.0.0.1" port: 8099 shadowsocks: server: host: "106.185.25.115" port: 27017 local: port: 12451 password: "@_PoiPublic_@" method: "aes-256-cfb" timeout: 600000 noflo = require 'noflo' exports.getComponent = -> c = new noflo.Component c.description = 'Get user token from action' c.icon = 'key' c.inPorts.add 'in', datatype: 'object' c.outPorts.add 'token', datatype: 'string' c.outPorts.add 'out', datatype: 'object' c.outPorts.add 'error', datatype: 'object' noflo.helpers.WirePattern c, in: 'in' out: ['token', 'out'] async: true , (data, groups, out, callback) -> unless data.state?.user?['github-token'] return callback new Error "GitHub operations require logging in" out.token.send data.state.user['github-token'] out.out.send data.payload do callback configManager = require '../config-manager' resolve = require 'resolve' path = require 'path' # Check if there is a local coffee-script package, use that package if it exists scopedRequire = (filepath) -> basedir = path.dirname(filepath) rst = null try rst = path.dirname(resolve.sync('coffee-script', { basedir })) if rst then require rst else require 'coffee-script' module.exports = id: 'coffee-compile' selector: [ 'source.coffee' 'source.litcoffee' 'text.plain' 'text.plain.null-grammar' ] compiledScope: 'source.js' preCompile: (code, editor) -> return code compile: (code, editor) -> filepath = editor.getPath() coffee = if filepath then scopedRequire(filepath) else require('coffee-script') literate = editor.getGrammar().scopeName is "source.litcoffee" bare = configManager.get('noTopLevelFunctionWrapper') bare ?= true return coffee.compile code, {bare, literate} postCompile: (code, editor) -> return code # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details # 'context-menu': # 'atom-text-editor': [ # { # 'label': 'Toggle atom-repl' # 'command': 'atom-repl:toggle' # } # ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Hydrogen' 'submenu': [ { 'label': 'Run' 'command': 'hydrogen:run' }, { 'label': 'Run and Move Down' 'command': 'hydrogen:run-and-move-down' }, { 'label': 'Run All' 'command': 'hydrogen:run-all' }, { 'label': 'Run All Above' 'command': 'hydrogen:run-all-above' }, { 'label': 'Connect to Remote Kernel' 'command': 'hydrogen:connect-to-remote-kernel' } ] ] } ] CONFIG = require '../config' Request = require 'superagent' module.exports = (app, done) -> # Swagger interface app.get '/backend/:id*?', (req, res, next) -> Request .get("#{CONFIG.backendURI}/#{CONFIG.backendStaticPath}/#{req.params.id}") .end (err, backendResp) -> if backendResp.headers['content-type'] res.header 'content-type', backendResp.headers['content-type'] res.status backendResp.statusCode res.send backendResp.text done() loggedOutNav = require '../../../components/logged_out_nav/client/index.coffee' slides = require './experiments.coffee' { mountWithApolloProvider } = require '../../../react/apollo/index.js' { default: DescriptiveCarousel } = require '../../../react/components/ExperimentsCarousel/index.js' { CURRENT_PATH } = require('sharify').data module.exports = -> if CURRENT_PATH is '/experiments' mountWithApolloProvider DescriptiveCarousel, { slides }, $('.js-experiments-carousel') $html = $('html, body') $el = $('.js-about') $links = $el.find('a[href]') $sections = $el.find('.js-section[id]') loggedOutNav $sections: $sections scrollToId = (id) -> $target = $sections.filter("[id='#{id}']") offset = if ($page = $('.js-page')).length parseInt($page.css('margin-top'), 10) + parseInt($page.css('padding-top'), 10) else 0 yPos = $target.offset().top - offset $html.animate scrollTop: yPos, 'fast' $links .on 'click', (e) -> e.preventDefault() id = $(this).attr('href').split('#').pop() scrollToId id return unless location.hash # Prevent default anchor jump setTimeout (-> window.scrollTo(0, 0)), 1 id = location.hash.substring(1) scrollToId id class SharableClientTerminalPane extends TerminalPane constructor: (options = {}, data) -> sessionOptions = options.sessionKey options.vmName = sessionOptions.vmName options.vmRegion = sessionOptions.vmRegion options.joinUser = sessionOptions.host options.session = sessionOptions.key options.delay = 0 super options, data vmOn: -> Promise.resolve() getMode: -> 'shared' fetchVm: (callback)-> {vmName, vmRegion} = @getOptions() callback null, hostnameAlias : vmName region : vmRegion tv4 = require 'tv4' chai = require 'chai' if not chai yaml = require 'js-yaml' path = require 'path' fs = require 'fs' getSchema = (name) -> filepath = path.join __dirname, '../schema', name+'.json' content = fs.readFileSync filepath, { encoding: 'utf-8' } return JSON.parse content getExamples = (name) -> filepath = path.join __dirname, '../examples', name+'.yml' content = fs.readFileSync filepath, { encoding: 'utf-8' } return yaml.safeLoad content schemas = 'siteconfig': 'Site config' 'contentblock': 'Content block' describe 'Schemas', -> Object.keys(schemas).forEach (schemaName) -> description = schemas[schemaName] describe description, -> cases = getExamples schemaName schema = getSchema schemaName cases.forEach (testcase) -> describe "#{testcase._name}", -> if testcase._valid it "should be valid", -> results = tv4.validateMultiple testcase._data, schema chai.expect(results.errors).to.eql [] else it "should be invalid", -> results = tv4.validateMultiple testcase._data, schema chai.expect(results.errors).to.not.eql [] BaseViewer = require './base-viewer' module.exports = class SumatraViewer extends BaseViewer _getArgs = (opts = {}) -> args = ["--unique"] args.push "--noraise" if opts?.keepFocus args forwardSync: (pdfFile, texFile, line, col, opts = {}) -> args = _getArgs opts args.push "#{pdfFile}#src:#{line}#{texFile}" args.unshift 'okular' @runViewer args viewFile: (pdfFile, opts = {}) -> args = _getArgs opts args.push "#{pdfFile}" args.unshift 'okular' @runViewer args {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers' {TaskReview} = require 'task/review' Collection = require 'task/collection' TASK = require 'cc/tasks/C_UUID/m_uuid/GET' describe 'Task Collection', -> beforeEach -> @taskId = 'm_uuid/C_UUID' @task = _.extend({}, TASK, taskId: @taskId, moduleUUID: 'm_uuid', collectionUUID: 'C_UUID' ) Collection.load(@taskId, @task) it 'can get as a page', -> page = Collection.getAsPage(@taskId) expect( _.pluck(page.exercises, 'task_id') ) .to.deep.equal(['265', '265', '265']) it 'can get the index of a step', -> expect(Collection.getStepIndex(@taskId, '4572')).to.equal(1) it 'can get the module info', -> info = Collection.getModuleInfo(@taskId, 'test') expect(info).to.deep.equal( collectionUUID:"C_UUID", moduleUUID:"m_uuid", link:'test/contents/C_UUID:m_uuid' ) {CompositeDisposable} = require 'event-kit' FileIcons = require './file-icons' module.exports = class FileView extends HTMLElement initialize: (@file) -> @subscriptions = new CompositeDisposable() @subscriptions.add @file.onDidDestroy => @subscriptions.dispose() @draggable = true @classList.add('file', 'entry', 'list-item') @fileName = document.createElement('span') @fileName.classList.add('name', 'icon') @appendChild(@fileName) @fileName.textContent = @file.name @fileName.title = @file.name @fileName.dataset.name = @file.name @fileName.dataset.path = @file.path @fileName.classList.add(FileIcons.getService().iconClassForPath(@file.path)) @subscriptions.add @file.onDidStatusChange => @updateStatus() @updateStatus() updateStatus: -> @classList.remove('status-ignored', 'status-modified', 'status-added') @classList.add("status-#{@file.status}") if @file.status? getPath: -> @fileName.dataset.path isPathEqual: (pathToCompare) -> @file.isPathEqual(pathToCompare) module.exports = document.registerElement('tree-view-file', prototype: FileView.prototype, extends: 'li') Neighborly.Static ?= {} Neighborly.Static.Learn = init: Backbone.View.extend el: '.learn-page' initialize: -> $('.expand-section').click (event) -> that = this event.preventDefault() $(this).parents('.main-section').find('.section-content').slideToggle 500, -> elem = $(that).find('.expansion-btn') current_text = elem.text() elem.text(elem.attr('data-alternative-text')) elem.attr('data-alternative-text', current_text) $('.expand-section-icon').toggleClass('icon-fa-chevron-down'). toggleClass('icon-fa-chevron-up') packages: [ "advanced-open-file" "atom-alignment" "atom-handlebars" "auto-update-packages" "docblockr" "editorconfig" "emmet" "expand-region" "language-apache" "language-applescript" "language-awk" "language-env" "language-gitattributes" "language-gitignore" "language-hosts" "language-ini" "language-latex" "language-liquid" "language-lisp" "language-patch" "language-pegjs" "language-prolog" "language-svg" "language-tcl" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jshint" "linter-jsonlint" "linter-php" "linter-ui-default" "monokai" "package-sync" "pigments" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "tabs-to-spaces" ] $ -> $(document).off 'click', 'form .remove_fields' $(document).off 'click', 'form .add_fields' $(document).on 'click', 'form .remove_fields', (event) -> $(this).prev('input[type=hidden]').val('1') $(this).closest('.fields').hide() event.preventDefault() $(document).on 'click', 'form .add_fields', (event) -> time = new Date().getTime() regexp = new RegExp($(this).data('id'), 'g') $(this).before($(this).data('fields').replace(regexp, time)) event.preventDefault()`import Ember from 'ember'` DateableMixin = Ember.Mixin.create # Method to check if something has happened in the last val*period inLast: (field, val, period) -> sinceDate(field,val, period, new Date()) # Method to check if something will happen in the next val*period inNext: (field, val, period) -> untilDate(field,val, period, new Date()) # Checks if something happened in val*period from startDate sinceDate: (field, val, period, startDate) -> periodAgo = moment(startDate).subtract(val, period).toDate() @get(field) > periodAgo untilDate: (field, val, period, startDate) -> periodTo = moment(startDate).add(val, period).toDate() @get(field) < periodTo # Check if something has occured, ie the date isn't in the future hasOccured: (field) -> @get(field) < new Date() `export default DateableMixin` moment = require('lib/moment') exports.isDev = (req) -> # We are on DEV when Host has string like # '/dev.' or '/staging.' or '.local' or '.dev' or 'localhost' re = /(\/dev\.|\/staging\.|\.local$|\.dev$|localhost)/ return re.test(req.headers.Host) exports.prettyDate = (date) -> moment.utc(date).local().format('MMM Do YYYY') exports.halfDate = (date) -> moment.utc(date).local().format('MMM D') exports.isItFresh = (date) -> if moment.utc().eod() < moment.utc(date).add('days', 30).eod() return true return false exports.capitalize = (str) -> str ?= '' str.charAt(0).toUpperCase() + str.slice(1)remote = require 'remote' windowManager = remote.require './lib/window' window.akashicRecordsWindow = null initialAkashicRecordsWindow = -> window.akashicRecordsWindow = windowManager.createWindow x: config.get 'poi.window.x', 0 y: config.get 'poi.window.y', 0 width: 820 height: 650 window.akashicRecordsWindow.loadUrl "file://#{__dirname}/index.html" if process.env.DEBUG? window.akashicRecordsWindow.openDevTools detach: true if config.get('plugin.Akashic.enable', true) initialAkashicRecordsWindow() module.exports = name: 'Akashic' priority: 10 displayName: [, ' 航海日志'] description: '日志' author: 'W.G.' link: 'https://github.com/JenningsWu' version: '1.0.0' handleClick: -> window.akashicRecordsWindow.show() angular.module('loomioApp').directive 'pendingInvitationsCard', -> scope: {group: '='} restrict: 'E' templateUrl: 'generated/components/memberships_page/pending_invitations_card/pending_invitations_card.html' replace: true controller: ($scope, CurrentUser, Records, ModalService, CancelInvitationForm, AppConfig) -> $scope.canSeeInvitations = -> CurrentUser.isAdminOf($scope.group) if $scope.canSeeInvitations() Records.invitations.fetchPendingByGroup($scope.group.key) $scope.baseUrl = AppConfig.baseUrl $scope.openCancelForm = (invitation) -> ModalService.open CancelInvitationForm, invitation: -> invitation $scope.invitationCreatedAt = (invitation) -> moment(invitation.createdAt).format('DD MMM YY') Spine = require('spine') _ = require('underscore/underscore') ToolWindow = require('controllers/ToolWindow') class Dashboard extends Spine.Controller constructor: -> super elements: '.tools': 'workspace' tools: [] channels: [] sources: ["GalaxyZooSubject", "SkyServerSubject"] count: 0 render: => @html require('views/dashboard')() addTool: (tool) -> @tools.push tool @channels.push tool.channel @createWindow(tool) createTool: (className) -> console.log className @count += 1 name = className.name.toLowerCase() tool = new className className: "#{name} tool" index: @count channel: "#{name}-#{@count}" sources: @sources channels: @channels console.log tool @addTool tool tool.bind "subscribed", (source) => sourceTool = _.find @tools, (sTool) -> sTool.channel == source tool.receiveData sourceTool.filteredData createWindow: (tool) -> window = new ToolWindow {tool: tool} window.render() window.el.toggleClass 'settings-active' @workspace.append window.el window.bind 'remove-tool', @removeTool removeTool: (tool) => @tools = _.without @tools, tool @channels = _.without @channels, tool.channel removeTools: => _.each @tools, @removeTool @workspace.html '' module.exports = Dashboard'packages': [ 'advanced-new-file' 'advanced-railscasts-syntax' 'atom-color-highlight' 'auto-copyright' 'autocomplete-paths' 'autocomplete-plus' 'autocomplete-snippets' 'block-travel' 'bug-report' 'file-type-icons' 'highlight-selected' 'indentation-indicator' 'language-generic-config' 'language-haml' 'language-r' 'language-swift' 'language-todotxt' 'language-treetop' 'linter' 'linter-coffeelint' 'linter-csslint' 'linter-less' 'linter-rubocop' 'linter-scss-lint' 'linter-shellcheck' 'minimap' 'package-sync' 'red-wavy-underline' 'set-syntax' 'soft-wrap-indicator' 'sort-lines' 'symbol-gen' 'tabs-to-spaces' 'toggle-quotes' 'white-cursor' 'word-jumper' ] Tasks = new Meteor.Collection("tasks") Lists = new Meteor.Collection("lists") Folders = new Meteor.Collection("folders") if Meteor.isClient Template.todos.tasks = -> Tasks.find() Template.todos.events 'click a.completeBox': (e) -> now = moment() Tasks.update this._id, $set: completed: not @completed dateCompleted: now modified: now Template.newTaskForm.events 'submit #new-task, click #addTaskButton': (e) -> e.preventDefault() body = $('#new-task-text').val() $('#new-task-text').val("") now = moment() priority = 'low' list = 'Home' Tasks.insert body: body date: now.format('D MMM YYYY') dateDue: now dateCreated: now dateCompleted: false modified: now list: list priority: priority completed: false repeating: false Controller = require 'zooniverse/controllers/base-controller' class SiteHeader extends Controller className: 'site-navigation' template: require './templates/site-header' elements: '.site-links': 'linksContainer' addNavLink: (href, label) -> a = @linksContainer.append '
      ' a.attr 'href', href module.exports = SiteHeader describe "Bacon.once", -> describe "should send single event and end", -> expectStreamEvents( -> Bacon.once("pow") ["pow"]) describe "accepts an Error event as parameter", -> expectStreamEvents( -> Bacon.once(new Bacon.Error("oop")) [error()]) describe "Allows wrapped events, for instance, Bacon.Error", -> expectStreamEvents( -> Bacon.once(error()) [error()]) it "Responds synchronously", -> values = [] s = Bacon.once(1) s.onValue(values.push.bind(values)) expect(values).to.deep.equal([1]) s.onValue(values.push.bind(values)) expect(values).to.deep.equal([1]) ReturnValue = require 'nanocyte-component-return-value' PassThroughIfLengthGreaterThanMin = require '../src/pass-through-if-length-greater-than-min' describe 'PassThroughIfLengthGreaterThanMin', -> beforeEach -> @sut = new PassThroughIfLengthGreaterThanMin it 'should exist', -> expect(@sut).to.be.an.instanceOf ReturnValue describe '->onEnvelope', -> describe 'when a message of length greater than the min', -> it 'should return the message', -> envelope = message: [1,2,3] config: min: 2 expect(@sut.onEnvelope envelope).to.deep.equal [1,2,3] describe 'when a message of length less than the min', -> it 'should not return the message', -> envelope = message: [1,2,3] config: min: 4 expect(@sut.onEnvelope envelope).not.to.exist describe 'when a message of length equal to the min', -> it 'should return the message', -> envelope = message: [1,2,3] config: min: 3 expect(@sut.onEnvelope envelope).to.deep.equal [1,2,3] describe 'when a message is not an array', -> it 'should not return the message', -> envelope = message: 2 config: min: 2 expect(@sut.onEnvelope envelope).not.to.exist class @Gquery extends Backbone.Model initialize : -> window.gqueries.add(this) @references = 1 future_value: -> @get('future') present_value: -> @get 'present' safe_present_value: => x = @present_value() # if @get('key') == 'chp_heat_and_electricity_from_wet_biomass' # return (if @is_acceptable_value(x) then -x else 0) if @is_acceptable_value(x) then x else 0 safe_future_value: => x = @future_value() if @is_acceptable_value(x) then x else 0 handle_api_result : (result) -> @set present: result.present future: result.future unit : result.unit is_acceptable_value : (n) -> return true if _.isBoolean(n) x = parseInt(n, 10) _.isNumber(x) && !_.isNaN(x) # cocoa retain-release clone retain: => @references += 1 release: => @references -= 1 class GqueryList extends Backbone.Collection model : Gquery with_key: (key) => @find (g) -> g.get('key') == key keys: => _.compact(@pluck('key')) find_or_create_by_key: (key, owner) => if g = @with_key key g.retain() return g else return new Gquery key: key cleanup: => @each (g) => @remove g if g.references == 0 window.gqueries = new GqueryList ################################################################################ # Client-side Config # Voltage = settings: defaultTemplate: 'voltagePage' config: (appConfig) -> @settings = _.extend(@settings, appConfig) render: (router) -> router.render 'voltageBlank' router.render 'voltagePage' @Voltage = Voltage ################################################################################ # Bootstrap Code # Meteor.subscribe 'voltagePages' Meteor.startup -> $('', href: '//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css' rel: 'stylesheet' ).appendTo 'head' ################################################################################ # Register Global Helpers # Handlebars.registerHelper "voltagePage", -> new Handlebars.SafeString Template.voltagePage(this) module.exports = configDefaults: numbers: { one: 1, two: 2 } class Quality constructor: (@name, @description, @defaultValue, @defaultProgress, @maxProgress) -> angular.module 'qbn.quality', ['qbn.state'] .factory 'qualityLibrary', (makeGameState) -> library = {} api = register: (id, name, options) -> quality = Object.freeze new Quality() library[id] = makeGameState quality # Qualities are stored in state form return this # Allow Chaining resolve: (q) -> if q instanceof Quality q else library[q.toString()] return Object.freeze api NotificationPlugin = require "../../notification-plugin" class Campfire extends NotificationPlugin @receiveEvent: (config, event) -> # Build the message if event.error message = "#{event.error.exceptionClass}" + (if event.error.message then ": #{event.error.message}" else "") + " (#{event.error.url})" else message = "#{event.trigger.message} in #{event.project.name} (#{event.project.url})" + ( if event.error then " in #{event.error.context} (#{event.error.url})" else "") # Build the request payload = message: body: message type: "TextMessage" # Send the request to campfire @httpPostJson "https://#{config.authToken}:X@#{config.domain}.campfirenow.com/room/#{config.roomId}/speak.xml", payload module.exports = Campfirenoflo = require 'noflo' findHandler = (actionParts, routes) -> normalized = routes.map (route) -> if route.indexOf('*') is -1 # No wildcards here return route routeParts = route.split ':' for part, idx in routeParts continue unless part is '*' continue unless actionParts[idx] routeParts[idx] = actionParts[idx] return routeParts.join ':' return normalized.indexOf actionParts.join(':') exports.getComponent = -> c = new noflo.Component c.inPorts.add 'routes', datatype: 'string' required: true control: true c.inPorts.add 'in', datatype: 'all' c.outPorts.add 'pass', datatype: 'all' c.outPorts.add 'handle', datatype: 'all' addressable: true c.outPorts.add 'handling', datatype: 'integer' routes = '' c.inPorts.routes.on 'data', (data) -> routes = data sentTo = null sentToIdx = null c.inPorts.in.on 'data', (data) -> handled = routes.split ',' handler = findHandler data.action.split(':'), handled if handler is -1 sentTo = c.outPorts.pass else c.outPorts.handling.send handler sentTo = c.outPorts.handle sentToIdx = handler sentTo.send data, sentToIdx c.inPorts.in.on 'disconnect', -> return unless sentTo sentTo.disconnect sentToIdx sentTo = null sentToIdx = null c.shutdown = -> sentTo = null sentToIdx = null routes = '' return c resize = () -> screenWidth = $(window).width() + "px" screenHeight = $(window).height() + "px" $("#intro, #intro .item, #intro-video, #intro-video .item").css width: screenWidth height: screenHeight $ -> resize() $(window).resize resize `import BaseRoute from './_base'` `import ajax from 'ic-ajax'` Route = BaseRoute.extend model: -> mePath = '/api/me' # return the current user as the model if authenticated, otherwise a blank object new Ember.RSVP.Promise (resolve, reject) => ajax url: mePath dataType: 'json' .then (result) => user = Ember.Object.create(result) if result.isAnon @set 'session.isAnon', true @set 'session.currentUser', null else @set 'session.isAnon', false @set 'session.currentUser', user resolve(user) ajax url: mePath method: 'post' , (result) -> reject() clearSession: -> @set 'session.currentUser', undefined @set 'session.isAnon', true @set 'settings.editMode', false actions: toggleEditMode: -> @toggleProperty 'settings.editMode' @send 'flushUpdateQueue' flushUpdateQueue: -> return unless @get('session.currentUser.isAdmin') updateQueue = @get('updateQueue') while updateQueue.get('length') section = updateQueue.popObject() section.save() error: (result, transition) -> if result.status is 403 @clearSession() @transitionTo 'signout' `export default Route` Q = require 'q' class NCN constructor: (@host = '') -> return request = (method, url, data) -> deferred = Q.defer() x = new XMLHttpRequest() x.responseType = 'json' x.addEventListener 'load', () -> deferred.resolve x.response x.addEventListener 'error', () -> deferred.reject x x.open('method', host + path) x.send(JSON.stringify(data)) deferred.promise get: (path, data) -> buildParam = (prefix, obj) -> for key, value of data if _.isObject obj then buildParam(key + '.', value) else encodeURIComponent(prefix + key) + '=' + encodeURIComponent(value) _.fltten(buildParam('', data)).join('&') prefix = if _.contains(path '?') then '?' else ':' request('GET', @host + path + prefix + qs) post: (path, data) -> request('POST', @host + path, data) del: (path, data) -> request('DELETE', @host + path) put: (path, data) -> request('PUT', @host + path) exports = NCN packages: [ "auto-indent" "git-blame" "git-diff-popup" "git-plus" "merge-conflicts" "package-sync" "ruby-test" ] packages: [ "advanced-open-file" "atom-alignment" "atom-beautify" "atom-transpose" "change-case" "color-picker" "docblockr" "editorconfig" "emmet" "expand-region" "git-blame" "language-apache" "language-applescript" "language-awk" "language-babel" "language-diff" "language-env" "language-gitattributes" "language-gitignore" "language-har" "language-hosts" "language-ini" "language-javascript-jsx" "language-latex" "language-liquid" "language-lisp" "language-pegjs" "language-pip" "language-prolog" "language-sca" "language-svg" "language-tcl" "language-tex" "language-viml" "language-x86" "linter" "linter-coffeescript" "linter-eslint" "linter-flake8" "linter-jsonlint" "linter-php" "linter-shellcheck" "linter-ui-default" "monokai" "package-sync" "plist-converter" "resize-indent" "sort-lines" "ssh-config" "svg-preview" "tabs-to-spaces" "teletype" ] class Quality constructor: (@id, @name, @description, @defaultValue, @defaultProgress, @maxProgress, @progressEscalation, @visible) -> Object.freeze @ increase: (whole, partial) -> levelUp = () => @value++ @maxProgress += @maxProgress * @progressEscalation return levelUp() for [1..whole] @progress += partial while @progress > @maxProgress @progress -= @maxProgress levelUp() return angular.module 'qbn.quality', ['qbn.state'] .factory 'qualities', (makeGameState) -> library = {} api = register: (args...) -> quality = new Quality args... library[quality.id] = makeGameState quality # Qualities are stored in state form. return this # Allow Chaining lookup: (q) -> if q instanceof Quality q else library[q?.toString()] getAll: () -> quality for _, quality of library when quality.visible return Object.freeze api angular.module('doubtfire.projects.states.dashboard.directives.task-dashboard.directives.task-status-card', []) # # Status of the card # .directive('taskStatusCard', -> restrict: 'E' templateUrl: 'projects/states/dashboard/directives/task-dashboard/directives/task-status-card/task-status-card.tpl.html' scope: task: '=' controller: ($scope, $stateParams, alertService, taskService, listenerService, ConfirmationModal, ExtensionModal) -> # Cleanup listeners = listenerService.listenTo($scope) # Reapply triggers available reapplyTriggers = -> if $stateParams.tutor? $scope.triggers = _.map(taskService.statusKeys, taskService.statusData) else studentTriggers = _.map(taskService.switchableStates.student, taskService.statusData) filteredStudentTriggers = $scope.task.filterFutureStates(studentTriggers) $scope.triggers = filteredStudentTriggers # Required changes when task changes listeners.push $scope.$watch('task.id', -> return unless $scope.task? reapplyTriggers() ) # Triggers a new task status $scope.triggerTransition = (trigger) -> $scope.task.triggerTransition(trigger, $scope.unitRole) # Allow upload of new files for an updated submission $scope.updateFilesInSubmission = -> taskService.presentTaskSubmissionModal($scope.task, $scope.task.status, true) $scope.applyForExtension = () -> ExtensionModal.show($scope.task) ) window.MultiShippingAddress ||= {} $.extend(MultiShippingAddress, { SameAsBilling: {} }) class MultiShippingAddress.SameAsBilling.CopyBillToShip constructor: (@$form) -> @findShippingAddresses() @bindForm() billAddress: null shippingAddresses: [] getName: ($input) -> $input.attr('name').match(/.*\[(.*)\]$/)[1] bindForm: -> @$form.on 'submit', => @getBillAddress() @copyBillAddress() findShippingAddresses: -> shippingAddresses = @$form.find('.js-shipping-address') @createToggleForm(address) for address in shippingAddresses createToggleForm: (address) -> @shippingAddresses.push(new MultiShippingAddress.SameAsBilling.ToggleForm ($ address)) copyBillAddress: -> @copyFormValues(address.inputs()) for address in @shippingAddresses when address.isChecked() copyFormValues: (addressInputs) -> @copyInputValue(($ input), addressInputs) for input in @billAddress copyInputValue: ($input, addressInputs) -> name = @getName $input addressInputs.filter("[name*=#{ name }]").val $input.val() getBillAddress: -> @billAddress = @$form.find('#billing').find('input, select') shownToGroup = {} angular.module('loomioApp').factory 'LegacyTrialExpiredModal', (ModalService, AppConfig, AhoyService) -> appropriateToShow: (group, user) -> user.isAdminOf(group) and group.showLegacyTrialExpiredModal # !shownToGroup[group.id] and # AppConfig.chargify? and # group.hasNoSubscription() and # user.isAdminOf(group) and # user.locale == 'en' and # group.cohortId > 0 and group.cohortId < 5 showIfAppropriate: (group, user) -> return false unless @appropriateToShow(group, user) shownToGroup[group.id] = true ModalService.open this, group: => group user: => user templateUrl: 'generated/components/legacy_trial_expired_modal/legacy_trial_expired_modal.html' controller: ($scope, ChoosePlanModal, ModalService) -> $scope.submit = -> AhoyService.track('legacy-trial-expired-modal__submit clicked') ModalService.open ChoosePlanModal, group: -> $scope.group assert = require 'assert' should = require 'should' peg = require 'pegjs' fs = require 'fs' requirejs = require('requirejs') requirejs.config nodeRequire: require brain = new (requirejs 'dist/lib/geekywalletlib.js') grammar = fs.readFileSync 'lib/syntax/grammar.peg', 'utf8' parser = peg.buildParser grammar wallet = fs.readFileSync 'examples/plain.wallet', 'utf8' lines = null describe 'peg parser', -> it 'should parse a nested wallet file', -> try result = parser.parse wallet (result != null).should.be.tree lines = result.group.lines catch e console.log(e) assert false {Testing, expect, sinon, _, ReactTestUtils} = require 'shared/specs/helpers' {Coach} = require 'concept-coach/coach' {CCModal} = require 'concept-coach/modal' describe 'Coach wrapper component', -> beforeEach -> @props = open: false displayLauncher: true moduleUUID: 'm_uuid' collectionUUID: 'C_UUID' it 'renders launch state', -> Testing.renderComponent( Coach, props: @props ).then ({dom, element}) -> expect(dom.textContent).to.contain('Launch Concept Coach') expect(ReactTestUtils.scryRenderedComponentsWithType(element, CCModal)).to.be.empty it 'renders coach when open=true', -> @props.open = true Testing.renderComponent( Coach, props: @props ).then ({dom, element}) -> expect(ReactTestUtils.scryRenderedComponentsWithType(element, CCModal)).not.to.be.empty angular.module("admin.utils").directive "variantAutocomplete", ($timeout) -> restrict: 'C' link: (scope, element, attrs) -> $timeout -> if $("#variant_autocomplete_template").length > 0 variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text()) if Spree.routes element.parent().children(".options_placeholder").attr "id", element.parent().data("index") element.select2 placeholder: t('admin.orders.select_variant') minimumInputLength: 3 quietMillis: 300 ajax: url: Spree.routes.variants_search datatype: "json" data: (term, page) -> q: term distributor_id: scope.distributor_id order_cycle_id: scope.order_cycle_id eligible_for_subscriptions: scope.eligible_for_subscriptions results: (data, page) -> window.variants = data # this is how spree auto complete JS code picks up variants results: data formatResult: (variant) -> variantTemplate variant: variant formatSelection: (variant) -> element.parent().children(".options_placeholder").html variant.options_text variant.name {Range} = require('atom') fuzzaldrin = require('fuzzaldrin') module.exports = class SnippetsProvider selector: '*' filterSuggestions: true constructor: -> @showIcon = atom.config.get('autocomplete-plus.defaultProvider') is 'Symbol' getSuggestions: ({scopeDescriptor, prefix}) -> return unless prefix?.length scopeSnippets = atom.config.get('snippets', {scope: scopeDescriptor}) @findSuggestionsForPrefix(scopeSnippets, prefix) findSuggestionsForPrefix: (snippets, prefix) -> return [] unless snippets? suggestions = [] for __, snippet of snippets when firstCharsEqual(snippet.prefix, prefix) suggestions.push iconHTML: if @showIcon then undefined else false type: 'snippet' text: snippet.prefix replacementPrefix: prefix rightLabel: snippet.name description: snippet.description descriptionMoreURL: snippet.descriptionMoreURL suggestions.sort(ascendingPrefixComparator) suggestions onDidInsertSuggestion: ({editor}) -> atom.commands.dispatch(atom.views.getView(editor), 'snippets:expand') ascendingPrefixComparator = (a, b) -> a.prefix - b.prefix firstCharsEqual = (str1, str2) -> str1[0].toLowerCase() is str2[0].toLowerCase() //= require swagger-ui-dist $ -> options = $(".swagger").data("swagger-options") ui = SwaggerUIBundle({ url: options.api_docs_url, dom_id: "#swagger-ui", deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout", configs: { preFetch: (req) -> req.headers["X-Access-Token"] = options.access_token return req } }) window.ui = ui path = require 'path' url = require 'url' {allowUnsafeNewFunction} = require 'loophole' archive = allowUnsafeNewFunction -> require 'ls-archive' {File} = require 'pathwatcher' fs = require 'fs-plus' Serializable = require 'serializable' module.exports= class ArchiveEditor extends Serializable atom.deserializers.add(this) @activate: -> atom.workspace.registerOpener (filePath='') -> # Don't open URIs with a protocol such as http: if not url.parse(filePath).protocol and archive.isPathSupported(filePath) new ArchiveEditor(path: filePath) constructor: ({path}) -> @file = new File(path) serializeParams: -> path: @getPath() deserializeParams: (params={}) -> if fs.isFileSync(params.path) params else console.warn "Could not build archive editor for path '#{params.path}' because that file no longer exists" getPath: -> @file.getPath() destroy: -> @file?.off() getViewClass: -> require './archive-editor-view' getTitle: -> if @getPath()? path.basename(@getPath()) else 'untitled' getUri: -> @getPath() isEqual: (other) -> other instanceof ArchiveEditor and @getUri() is other.getUri() module "localized" test "local time", -> assertLocalized "one" assertLocalized "two" test "local time in the past", -> assertLocalized "past" test "local time in the future", -> assertLocalized "future" test "local date", -> assertLocalized "date", "date" assertLocalized = (id, type = "time") -> switch type when "time" momentFormat = "MMMM D, YYYY h:mma" compare = "toString" when "date" momentFormat = "MMMM D, YYYY" compare = "dayOfYear" el = document.getElementById id ok datetime = el.getAttribute "datetime" ok local = el.innerText datetimeParsed = moment datetime localParsed = moment local, momentFormat ok datetimeParsed.isValid() ok localParsed.isValid() equal datetimeParsed[compare](), localParsed[compare]() App.CategoriesShowRoute = Em.Route.extend model: (params) -> App.Category.find(params.id) setupController: (controller, model) -> @_super controller, model @controllerFor('pagedTransactions').setProperties page: 1 renderTemplate: -> @_super() @render 'transactions', into: 'categories.show' outlet: 'transactions' controller: @controllerFor('pagedTransactions') describe 'Custom Element Base', -> registerCustomElement = require('../base.min.js') {getCustomElement} = require('./helper') it 'fires the events in order', -> lastRan = null element = new (registerCustomElement(getCustomElement({ name: 'x-spec-event-order' created: -> lastRan = 'created' initialize: -> lastRan = 'initialize' attached: -> expect(lastRan).toBe('initialize') lastRan = 'attached' detached: -> lastRan = 'detached' attributeChanged: -> lastRan = 'attributeChanged' }))) expect(lastRan).toBe('created') element.setAttribute('a-b', 'c') expect(lastRan).toBe('attributeChanged') document.body.appendChild(element) expect(lastRan).toBe('attached') element.remove() expect(lastRan).toBe('detached') it 'does not fire attributeChanged on config change', -> executed = false element = new (registerCustomElement(getCustomElement({ name: 'x-spec-attributechanged-fired' attributeChanged: -> executed = true config: {asd: {type: Boolean, default: false}} }))) element.setAttribute('asd', false) expect(executed).toBe(false) element.setAttribute('asd-a', false) expect(executed).toBe(true) class OpinionatorsAvatarView extends Backbone.Marionette.Layout tagName: 'span' className: 'opinionators-avatar' template: 'opinionators/avatar' onRender: -> UserPopoverContentView.makeTooltip @, @model class window.OpinionatorsAvatarsView extends Backbone.Marionette.CompositeView tagName: 'span' className: 'opinionators-avatars' template: "opinionators/avatars" itemView: OpinionatorsAvatarView itemViewContainer: ".js-opinionators-avatars-collection" events: 'click .js-show-all' : 'show_all' number_of_items: 4 initialize: (options) -> @listenTo @collection, 'add remove reset sync', @render _initialEvents: -> # don't use default bindings to collection appendHtml: (collectionView, itemView, index) -> super if index < @truncatedListSizes().numberToShow templateHelpers: => numberOfOthers: @truncatedListSizes().numberOfOthers truncatedListSizes: -> truncatedListSizes @collection.totalRecords, @number_of_items show_all: (e) -> e.stopPropagation() e.preventDefault() @number_of_items = Infinity @render() "*": core: disabledPackages: [ "archive-view" "background-tips" "deprecation-cop" "dev-live-reload" "welcome" "update-package-dependencies" "timecop" "exception-reporting" "image-view" "metrics" "open-on-github" "release-notes" "styleguide" "autocomplete" "tree-view" "bookmarks" "autosave" ] projectHome: "~" themes: [ "one-dark-ui" "monokai" ] editor: fontFamily: "Monaco" tabLength: 4 softTabs: false softWrap: true softWrapAtPreferredLineLength: true invisibles: {} autoIndentOnPaste: false welcome: showOnStartup: false linter: statusBar: "Show all errors" showHighlighting: false showErrorInline: false lintOnChange: false lintOnEditorFocus: false autosave: enabled: true script: enableExecTime: false emmet: extensionsPath: "~/.emmet" "linter-jscs": onlyConfig: true preset: "jquery" ".applescript.source": editor: commentStart: "-- " ".ini.source": editor: commentStart: "# " ".source.viml": editor: commentStart: "\" " module.exports = { data: window.preload or {} tasks: {} init: (fn) -> fn.call(this) add: (obj) -> @tasks[key] = fn.bind(this) for key, fn of obj return obj bind: (fn) -> return @callback = fn change: -> return @callback(@data) if @callback } 'use strict' class UserViolationsPrefsCtrl constructor: (@scope, @UserViolationsPrefsFcty, @growlNotifications, @localStorage) -> @getPrefs() @selectedFlag = {} _fillPrefs: (data) => @prefs = data @groupData = _.groupBy(@prefs, 'category') for x of @groupData @selectedFlag[x] = ! _.some(@groupData[x], {'is_active': false}) _fillUpdatePrefs: (data) => @localStorage.userprefs = @groupData @growlNotifications.add(data.reason, 'success', 2000) getPrefs: -> @UserViolationsPrefsFcty.getInitialUserViolationsPrefs().then @_fillPrefs updatePrefs: => @UserViolationsPrefsFcty.updateUserViolationsPrefs(@prefs).then @_fillUpdatePrefs, (error) => @growlNotifications.add(error.data.reason, 'error', 2000) selectToggle: (category) => for x in @groupData[category] x.is_active = ! @selectedFlag[category] @selectedFlag[category] = ! @selectedFlag[category] angular.module('holmesApp') .controller 'UserViolationsPrefsCtrl', ($scope, UserViolationsPrefsFcty, growlNotifications, $localStorage) -> $scope.model = new UserViolationsPrefsCtrl($scope, UserViolationsPrefsFcty, growlNotifications, $localStorage) Wheelmap.FakeMapView = Ember.View.extend classNames: 'fake-map' attributeBindings: ['style'] style: (()-> location = @get('controller.location') unless location? return '' "background-image: url(http://api.tiles.mapbox.com/v4/sozialhelden.map-iqt6py1k/#{location.lng},#{location.lat},17/1280x1280.jpg70?access_token=pk.eyJ1Ijoic296aWFsaGVsZGVuIiwiYSI6IldvNHpkUUkifQ.5lLzFYw4MmAUkqLMoEcI3g)" ).property('controller.location')parser = require 'nomnom' braveMouse = require '../brave-mouse' braveMousePackageJson = require '../../package.json' module.exports = (argv) -> opts = parser .script 'brave-mouse' .options help: abbr: 'h' flag: true help: 'Print this help message' version: abbr: 'v' flag: true help: 'Print brave-mouse’s version' .parse argv.slice 2 if opts.version return console.log 'v' + braveMousePackageJson.version gulp = require 'gulp' browserSync = require 'browser-sync' config = require './config.coffee' argv = require('yargs').argv nodemon = require 'gulp-nodemon' gulp.task 'api', -> nodemon script: 'server/server.js' ext: 'coffee' ignore: ['src/*', 'gulp/*', 'gulpfile.coffee', 'tests/*'] gulp.task 'serve', [ 'vendor', 'jade', 'sass', 'coffee', 'images', 'api' ], -> browserSync server: {baseDir: config.path} port: 4000 open: false reloadOnRestart: false notify: false ghostMode: argv.ghost || false gulp.watch 'src/**/*.scss', ['sass'] if argv.bdd gulp.watch( 'src/**/*.coffee', [['coffee', 'protractor'], browserSync.reload] ) gulp.watch 'src/**/*.jade', [['jade', 'protractor'], browserSync.reload] gulp.watch( ['features/**/*.coffee', 'features/**/*.feature'], [['protractor'], browserSync.reload] ) else gulp.watch 'src/**/*.coffee', ['coffee', browserSync.reload] gulp.watch 'src/**/*.jade', ['jade', browserSync.reload] module.exports = gulp React = require 'react' Favourite = require './favourite' module.exports = React.createClass displayName: 'SubjectTools' render: ->
      { if @props.subject? && @props.user?}
      _ = require 'underscore' expect = chai.expect React = require 'react' ReactAddons = require('react/addons') ReactTestUtils = React.addons.TestUtils {Promise} = require 'es6-promise' {commonActions} = require './utilities' sandbox = null Wrapper = React.createClass render: -> React.createElement(@props._wrapped_component, _.extend(_.omit(@props, '_wrapped_component'), ref: 'element') ) Testing = { renderComponent: (component, options = {}) -> options.props ||= {} unmountAfter = options.unmountAfter or 1 root = document.createElement('div') promise = new Promise( (resolve, reject) -> props = _.clone(options.props) props._wrapped_component = component wrapper = React.render( React.createElement(Wrapper, props), root ) resolve({ root, wrapper, element: wrapper.refs.element, dom: React.findDOMNode(wrapper.refs.element) }) ) # defer adding the then callback so it'll be called after whatever is attached after the return _.defer -> promise.then -> _.delay( -> React.unmountComponentAtNode(root) , unmountAfter ) return arguments promise actions: commonActions } module.exports = {Testing, expect, sinon, React, _, ReactTestUtils} mid = new Date('02/25/14 00:00:00') Template.agenda.day1 = -> @items.filter((i) -> i.time < mid).sort((a, b) -> a.time >= b.time) Template.agenda.day2 = -> @items.filter((i) -> i.time > mid).sort((a, b) -> a.time >= b.time) Template.agenda.canSee = -> u = User.current() u and (u.admin() or u.moderator()) Template.agenda.canEdit = -> u = User.current() u and u.admin() Template.agenda.events 'submit #add-form': (event, context) -> event.preventDefault() time = context.find('#time').value class1 = context.find('#class1').value class2 = context.find('#class2').value class3 = context.find('#class3').value icon = context.find('#icon').value if not time then return time = new Date(time) if not time console.error('bad time string') return AgendaItem.create({time: time, class1: class1, class2: class2, class3: class3, icon: icon}) 'click #edit': -> Session.set('editingAgenda', not Session.get('editingAgenda'))class Space.eventSourcing.Projection extends Space.Object @mixin Space.messaging.EventSubscribing collections: {} _isInReplayMode: false _state: null _queuedEvents: null constructor: -> super @_state = 'projecting' @_queuedEvents = [] @dependencies = {} _.extend @dependencies, @constructor::dependencies, @collections on: (event, isRebuildEvent=false) -> return unless @canHandleEvent(event) if @_is('projecting') or (@_is('rebuilding') and isRebuildEvent) Space.messaging.EventSubscribing.on.call this, event else @_queuedEvents.push event enterRebuildMode: -> @_state = 'rebuilding' exitRebuildMode: -> @_state = 'projecting' @on(event) for event in @_queuedEvents _is: (expectedState) -> true if expectedState is @_state #!node_modules/.bin/coffee ### # server.coffee # # © 2014 Dan Nichols # See LICENSE for more details # # Our NodeJS server application. Nothing too special here, a quick ExpressJS # app that serves a single page AngularJS app. In production all it will # handle is the single page app, as all static content will be handled by a # reverse proxy. ### 'use strict' # Register the coffee interpreter require 'coffee-script/register' # External libs mongoose = require 'mongoose' app = require('express')() # Load the environment env = require './lib/config/environment' # Load models require('./lib/models') env # Configure Express require('./lib/express') app # Application Routes require('./lib/routes') app # Errors require('./lib/errors') app # Setup the mailer require('./lib/mailer') app # Open database connection #mongoose.connect env.mongo.uri, env.mongo.options # Start server app.listen env.port, -> console.log 'Express server listening on port %d in %s mode', env.port, app.get('env') return # Expose app module.exports = exports = app # Enable any date choosers on page jQuery -> $(".date-chooser").each -> new window.DateChooser($(this)) $("form [data-show-when]").each -> new window.ShowHide($(this)) $("form [data-disable-when]").each -> new window.DisableChecker($(this)) $("table tr.clickable-row").each -> $(this).addClass("clickable-row-active") $(this).on "click", -> window.location = $(this).data("link") $(".time-select").each -> new window.TimeTabber($(this)) return BaseTool = window.Ubret.BaseTool or require('./base_tool') class FitsViewer extends BaseTool constructor: through2 = require 'through2' parsePropertiesFile = (fileContent) -> out = {} lines = fileContent.split '\n' for line in lines if match = line.match '([a-zA-Z0-9\._-]+)[ ]?=[ ]?(.*)' [__, key, value] = match out[key] = value out i18n = () -> through2.obj (file, encoding, callback) -> i18nContent = {} content = parsePropertiesFile(file.contents.toString(encoding)) for key, value of content key = key.replace(/\./g, '_') i18nContent[key] = {message: value.replace(/\\:/g, ':'), description: "Description for #{key}"} # Insert the newly created content file.contents = new Buffer(JSON.stringify(i18nContent), encoding) @push file callback() buildLangFilePlugin = () -> through2.obj (chunk, encoding, callback) -> languages = {} tag = chunk.relative.substring(0, chunk.relative.indexOf("/")) langFile = parsePropertiesFile(chunk.contents.toString(encoding)) languages = "window.ledger.i18n.Languages['" + tag + "'] = " + "'" + langFile['language.name'] + "';" chunk.contents = new Buffer(JSON.stringify(languages), encoding) @push chunk callback() module.exports = {i18n, buildLangFilePlugin}# # Kissmetrics Batch class BatchKissmetricsClient @HOST: 'api.kissmetrics.com' @HTTP_METHOD: 'POST' @API_VERSION: 'v1' @process: (queue, apiKey, apiSecret, productGUID) -> http = require 'http' apiVersion = BatchKissmetricsClient.API_VERSION urlPath = "#{apiVersion}/products/#{productGUID}/tracking/e" baseUrl = "http://#{BatchKissmetricsClient.HOST}/#{urlPath}" signature = BatchKissmetricsClient._generateSignature baseUrl, apiSecret # return "#{baseUrl}?_signature=#{signature}" request = http.request host: BatchKissmetricsClient.HOST path: "#{baseUrl}?_signature=#{signature}" headers: 'X-KM-ApiKey': apiKey requestBody = JSON.stringify {data: queue.get()} request.write requestBody queue.clear() return request @_generateSignature: (url, apiSecret) -> 'temporary-signature' constructor: (@options) -> @queue = options.queue add: (timestamp, data) -> data.timestamp = timestamp @_transformData data @queue.add data _transformData: (data) -> data.identity = data._p delete data._p if data.type is 'record' data.event = data._n delete data._n if data.type is 'alias' data.alias = data._n delete data._n delete data.type module.exports = BatchKissmetricsClient {APLArray} = require '../array' @['⊃'] = (omega, alpha) -> if alpha # Pick (`⊃`) # # ⍬⊃3 <=> 3 # 2⊃'PICK' <=> 'C' # 1 0⊃2 2⍴'ABCD' <=> 'C' # 1⊃'foo' 'bar' <=> 'bar' if alpha.shape.length > 1 throw RankError pick = alpha.toArray() if pick.length isnt omega.shape.length throw RankError omega.get pick else # Disclose (`⊃`) # # ⊃(1 2 3)(4 5 6) <=> 1 2 3 # ⊃(1 2)(3 4 5) <=> 1 2 # ⊃'AB' <=> 'A' # ⊃123 <=> 123 # ⊃⍬ <=> 0 #! ⊃'' <=> ' ' pick = [] if omega.empty() APLArray.zero else x = omega.get pick if x instanceof APLArray then x else APLArray.scalar x # Description: # Rajinikanth is Chuck Norris of India, witness his awesomeness. # # Dependencies: # "cheerio": "0.7.0" # # Configuration: # None # # Commands: # hubot rajinikanth|rajini -- random Rajinikanth awesomeness # hubot rajinikanth|rajini me -- let's see how would do as Rajinikanth # # Author: # juzerali cheerio = require('cheerio') url = "http://rajinikanthfacts.com/" module.exports = (robot) -> robot.respond /(rajinikanth|rajini)( me )?(.*)/i, (msg)-> user = msg.match[3] msg.http(url) .get() (err, res, body) -> if err msg.send "Rajinikanth says: #{err}" else $ = cheerio.load(body) fact = $(".fact").find(".ftext").text() if !!user fact = fact.replace /raji?ni(kanth?)?/ig, user msg.send fact# The SplitStr component receives a string in the in port, splits it by # string specified in the delimiter port, and send each part as a separate # packet to the out port noflo = require "../../lib/NoFlo" class SplitStr extends noflo.Component constructor: -> @delimiterString = "\n" @strings = [] @groups = [] @inPorts = in: new noflo.Port() delimiter: new noflo.Port() @outPorts = out: new noflo.Port() @inPorts.delimiter.on "data", (data) => if data.substr(0, 1) is '/' and data.substr(data.length - 1, 1) is '/' # Handle regular expressions data = new RegExp data.substr 1, data.length - 2 @delimiterString = data @inPorts.in.on "begingroup", (group) => @groups.push(group) @inPorts.in.on "data", (data) => @strings.push data @inPorts.in.on "disconnect", (data) => return @outPorts.out.disconnect() if @strings.length is 0 for group in @groups @outPorts.out.beginGroup(group) @strings.join(@delimiterString).split(@delimiterString).forEach (line) => @outPorts.out.send line for group in @groups @outPorts.out.endGroup() @outPorts.out.disconnect() @strings = [] @groups = [] exports.getComponent = -> new SplitStr() LINES_TO_JUMP = 10 getEditSession = -> atom.workspaceView.getActiveView()?.activeEditSession module.exports = activate: (state) -> atom.workspaceView.command 'line-jumper:move-up', => getEditSession()?.moveCursorUp(LINES_TO_JUMP) atom.workspaceView.command 'line-jumper:move-down', => getEditSession()?.moveCursorDown(LINES_TO_JUMP) atom.workspaceView.command 'line-jumper:select-up', => getEditSession()?.selectUp(LINES_TO_JUMP) atom.workspaceView.command 'line-jumper:select-down', => getEditSession()?.selectDown(LINES_TO_JUMP) # Like sands through the hourglass, so are the days of our lives. date = new Date().getTime() require 'atom' require 'window' window.setUpEnvironment() window.startup() atom.show() console.log "Load time: #{new Date().getTime() - date}" class CMS.Views.ModuleEdit extends Backbone.View tagName: 'section' className: 'edit-pane' events: 'click .cancel': 'cancel' 'click .module-edit': 'editSubmodule' 'click .save-update': 'save' initialize: -> @$el.load @model.editUrl(), => @model.loadModule(@el) # Load preview modules XModule.loadModules('display') save: (event) -> event.preventDefault() @model.save().success(-> alert("Your changes have been saved.") ).error(-> alert("There was an error saving your changes. Please try again.") ) cancel: (event) -> event.preventDefault() CMS.popView() editSubmodule: (event) -> event.preventDefault() previewType = $(event.target).data('preview-type') moduleType = $(event.target).data('type') CMS.pushView new CMS.Views.ModuleEdit model: new CMS.Models.Module id: $(event.target).data('id') type: if moduleType == 'None' then null else moduleType previewType: if previewType == 'None' then null else previewType require './shim/phantomjs-bind' window.Promise = require 'bluebird' if process.env.NODE_ENV == 'development' Promise.longStackTraces() window.Rdb = require('rdb/index') $(document).ready -> quick_add_url_button = $('#quick-add-url-button') input = $('#quick-add-url') status = quick_add_url_button quick_add_url_button.click -> status.text('Submitting URL') url = input.val() $.ajax '/src_images/', type: 'post' contentType: 'application/json' dataType: 'json' data: JSON.stringify(url: url) success: (data) -> status.text('Submitted URL') count = 0 timer = setInterval -> $.ajax "/src_images/#{data.id}", type: 'head', success: -> clearInterval(timer) window.location.replace("/gend_images/new?src=#{data.id}") error: -> clearInterval(timer) status.text('Error loading URL') count += 1 if count >= 10 clearInterval(timer) , 1000 error: -> status.text('Error submitting URL') input.keypress (e) -> if e.which == 13 quick_add_url_button.click() Chaplin = require 'chaplin' module.exports = class BaseView extends Chaplin.View autoRender: true getTemplateFunction: -> @template delegateNewEvents: (events) -> @_delegateEvents events # This is different from Chaplin.View::dispose in that it doesn't try to # remove the el on disposal. dispose: -> return if @disposed throw new Error('Your `initialize` method must include a super call to Chaplin `initialize`') unless @subviews? # Dispose subviews subview.dispose() for subview in @subviews # Unbind handlers of global events @unsubscribeAllEvents() # Unbind all referenced handlers @stopListening() # Remove all event handlers on this module @off() # Remove all event handlers on view @undelegateEvents() # Remove element references, options, # model/collection references and subview lists properties = [ 'el', '$el', 'options', 'model', 'collection', 'subviews', 'subviewsByName', '_callbacks' ] delete this[prop] for prop in properties # Finished @disposed = true # You’re frozen when your heart’s not open Object.freeze? this class CursorPositionView extends HTMLElement initialize: -> @classList.add('cursor-position', 'inline-block') @activeItemSubscription = atom.workspace.onDidChangeActivePaneItem (activeItem) => @subscribeToActiveTextEditor() @subscribeToActiveTextEditor() destroy: -> @activeItemSubscription.dispose() @cursorSubscription?.dispose() subscribeToActiveTextEditor: -> @cursorSubscription?.dispose() @cursorSubscription = @getActiveTextEditor()?.onDidChangeCursorPosition => @updatePosition() @updatePosition() getActiveTextEditor: -> atom.workspace.getActiveTextEditor() updatePosition: -> if position = @getActiveTextEditor()?.getCursorBufferPosition() @textContent = "#{position.row + 1}:#{position.column + 1}" else @textContent = '' module.exports = document.registerElement('status-bar-cursor', prototype: CursorPositionView.prototype, extends: 'div') PEG = require 'pegjs' {fs} = require 'atom' grammarSrc = fs.read(require.resolve('./snippet-body.pegjs')) module.exports = PEG.buildParser(grammarSrc, trackLineAndColumn: true) goog.provide 'app.Routes' goog.require 'este.Routes' class app.Routes extends este.Routes ###* @constructor @extends {este.Routes} ### constructor: -> super() @home = new este.Route '/', Routes.MSG_HOME @newSong = new este.Route '/@me/songs/new', Routes.MSG_NEW_SONG @song = new este.Route '/@me/songs/:urlArtist/:urlName', 'Routes.MSG_NEW_SONG' @notFound = new este.Route '*' @list = [ @home @newSong @song @notFound ] ###* @desc app.Routes ### @MSG_HOME: goog.getMsg 'Songary | Your personal songbook' ###* @desc app.Routes ### @MSG_NEW_SONG: goog.getMsg 'New Song | Songary' # ###* # @desc app.Routes # ### # @MSG_SONG: goog.getMsg '{$songName} - {$artist} | Songary'path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getComputedStyle(el) styleObject = {} for property of styleProperties value = styleProperties.getPropertyValue property camelizedAttr = property.replace /\-([a-z])/g, (a, b) -> b.toUpperCase() styleObject[camelizedAttr] = value styleObject getFullExtension: (filePath) -> basename = path.basename(filePath) position = basename.indexOf('.') if position > 0 then basename[position..] else '' updateEditorsForPath: (oldPath, newPath) -> editors = atom.workspace.getTextEditors() for editor in editors filePath = editor.getPath() if filePath?.startsWith(oldPath) editor.getBuffer().setPath(filePath.replace(oldPath, newPath)) define(['listener'], (Listener) -> class SinglePlayerListener extends Listener notify: (player1, player2, point) -> console.log "Collision: #{player1} #{player2} #{point}" @game.killPlayer(player2, point) SinglePlayerListener ) _ = require "underscore" Markup = require "./markup" p = require "../../core/properties" class DivView extends Markup.View tagName: "div" render: () -> super() if @mget('render_as_text') == true @$el.text(@mget('text')) else @$el.html(@mget('text')) return @ class Div extends Markup.Model type: "Div" default_view: DivView props: () -> return _.extend {}, super(), { render_as_text: [ p.Bool, false] } module.exports = Model: Div View: DivView # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.workspace': 'ctrl-alt-b': 'latex:build' ### WebSocket Interface for the WebSocketRails client. ### class WebSocketRails.WebSocketConnection constructor: (@url,@dispatcher) -> @_conn = new WebSocket("ws://#{@url}") @_conn.onmessage = @on_message @_conn.onclose = @on_close trigger: (event_name, data, connection_id) => payload = JSON.stringify [event_name, data] @_conn.send payload trigger_channel: (channel_name, event_name, data, connection_id) => payload = JSON.stringify [channel_name, event_name, data] @_conn.send payload on_message: (event) => data = JSON.parse event.data console.log data @dispatcher.new_message data on_close: (event) => @dispatcher.dispatch 'connection_close', {} 'menu': [ 'label': 'Edit' 'submenu': [ 'label': 'Select Grammar' 'command': 'grammar-selector:show' ] ] Authenticate: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' SubscriptionList: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' on: 204: 'check-configure-whitelist' 'check-configure-whitelist': task: 'meshblu-core-task-check-configure-whitelist' datastoreCollection: 'devices' on: 204: 'get-subscriptions' 'get-subscriptions': task: 'meshblu-core-task-get-subscriptions' datastoreCollection: 'subscriptions' UpdateDevice: start: 'authenticate' tasks: 'authenticate': filter: 'Authenticate' on: 204: 'check-configure-whitelist' 'check-configure-whitelist': task: 'meshblu-core-task-check-configure-whitelist' datastoreCollection: 'devices' on: 204: 'update-device' 'update-device': task: 'meshblu-core-task-update-device' datastoreCollection: 'devices' on: 678: 'clear-device-in-cache' 'clear-device-in-cache': task: 'meshblu-core-task-clear-device-in-cache' cacheNamespace: 'cache:device' window.Posts ?= {} window.Posts.PostsFactory = ($http, $q)-> fetchPosts = (page) -> params = {} angular.extend(params, {category: @filter.join(",")}) unless filterPresent() angular.extend(params, {page: page}) if page != 1 angular.extend(params, {sort: @sort}) if @sort != "top" $http({method: "GET", cache: true, url: PostsFactory.url, params: params}).then (response) => @posts = response.data.posts @categories = response.data.categories return $q.reject("CNF") unless _categoryExists(@categories, @filter) response fetchCategories = -> $http({method: "GET", cache: true, url: PostsFactory.url}).then (response) => @categories = response.data.categories response setOptions = (options = {}) -> @sort = options.sort @filter = _.without(options.filter, "").sort() filterPresent = -> !_.isEmpty(@filter) _categoryExists = (categories, category) -> return true if _.isEmpty(category) !_.isEmpty(_.intersection(_.pluck(categories, 'slug'), category)) PostsFactory = url: "#{window.UtisakApiUrl}/vesti" posts: @posts categories: @categories filter: @filter filterPresent: filterPresent fetchCategories: fetchCategories fetchPosts: fetchPosts setOptions: setOptions ETahi.QuestionCheckComponent = ETahi.QuestionComponent.extend layoutName: 'components/question/check_component' multipleAdditionalData: false displayContent: Em.computed.alias('checked') checked: ((key, value, oldValue) -> if arguments.length > 1 #setter @set('model.answer', value) else #getter answer = @get('model.answer') answer == 'true' || answer == true ).property('model.answer') actions: additionalDataAction: ()-> @get('additionalData').pushObject({}) angular.module("admin.utils").factory "StatusMessage", -> new class StatusMessage types: progress: {style: {color: '#ff9906'}} alert: {style: {color: 'grey'}} notice: {style: {color: 'grey'}} success: {style: {color: '#9fc820'}} failure: {style: {color: '#da5354'}} statusMessage: text: "" style: {} invalidMessage: "" setValidation: (isValid) -> if isValid StatusMessage.invalidMessage = '' else StatusMessage.invalidMessage = t("admin.form_invalid") active: -> @statusMessage.text != '' display: (type, text) -> @statusMessage.text = text @statusMessage.style = @types[type].style null clear: -> @statusMessage.text = '' @statusMessage.style = {} {View} = require 'atom' module.exports = class CursorPositionView extends View @content: -> @div class: 'cursor-position inline-block' initialize: (@statusBar) -> @subscribe @statusBar, 'active-buffer-changed', @updateCursorPositionText @subscribe atom.workspaceView, 'cursor:moved', @updateCursorPositionText destroy: -> @remove() afterAttach: -> @updateCursorPositionText() updateCursorPositionText: => editor = atom.workspace.getActiveEditor() if position = editor?.getCursorBufferPosition() @text("#{position.row + 1},#{position.column + 1}").show() else @hide() React = require('react/addons') TestUtils = React.addons.TestUtils module.exports = # Generates a shallow render for a given component with properties and children shallowRenderComponent: (component, props, children...) -> shallowRenderer = TestUtils.createRenderer() shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0])) shallowRenderer.getRenderOutput() angular.module('clurtch.components.tabs.find.controllers', []) .controller 'FindCtrl', [ '$scope' 'Yelp' 'SortTwoColumns' ($scope, Yelp, SortTwoColumns)-> Yelp.get().success (data) -> $scope.items = $scope.sortTwoColumns data.businesses ] path = require 'path' fs = require 'fs' mkdirp = require 'mkdirp' MetaCoffee = (require './prettyfier') require './index' targetDirectory = process.argv[2] fileName = process.argv[3] code = fs.readFileSync fileName, "utf-8" compiled = MetaCoffee.compile code targetFileName = path.basename fileName, path.extname fileName mkdirp.sync targetDirectory fs.writeFileSync (path.join targetDirectory, targetFileName), compiled, "utf-8" connect = require 'connect' express = require 'express' requisite = require 'requisite' root = require('./utils').root stylus = require 'stylus' app = express() app.set 'views', root '/views' app.set 'view engine', 'jade' app.locals.pretty = true # Stylus middleware. Serves bunlded CSS/Stylus files from assets/css at # static/css. app.use '/static/css', stylus.middleware src: root '/assets/css' dest: root '/static/css' # Express static middleware. Having this first in the middleware stack ensures # that static js files are still served normally, instead of being bunlded by # requisite. app.use express.static root() # Requisite middleware. Takes an entry module and bundles all dependencies # required from there. Serves bundled JavaScript files from assets/js at # static/js. app.use '/static/js', requisite.middleware export: 'app' entry: root '/assets/js/app' paths: [root()] app.use connect.logger 'dev' app.use connect.errorHandler() app.get '/', (req, res) -> res.render 'index' module.exports = app describe "DotLedger.Views.Transactions.Table", -> createView = -> collection = new DotLedger.Collections.Transactions view = new DotLedger.Views.Transactions.Table collection: collection view it "should be defined", -> expect(DotLedger.Views.Transactions.Table).toBeDefined() it "should use the correct template", -> expect(DotLedger.Views.Transactions.Table).toUseTemplate('transactions/table') it "can be rendered", -> view = createView() expect(view.render).not.toThrow() moment = require('moment') config = require('./config') util = require('util') module.exports = (program) -> posts = [] config.postsDb.createReadStream() .on('data', (data) -> write = true if program.year? unless moment(data.value.created_time).year() is program.year write = false if program.month? unless moment(data.value.created_time).month() is (program.month - 1) # Stupid JS dates write = false if write posts.push data.value ) .on('error', (err) -> console.log('LevelDB Error', err) ) .on('close', (err) -> console.log util.inspect(posts, { depth: null }) ) module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [firstArgs..., callback] = originalArgs if !callback? || typeof callback != 'function' throw new Error( "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" ) timer = new metrics.Timer(key) start = new Date() realMethod.call this, firstArgs..., (callbackArgs...) -> timer.done() elapsedTime = new Date() - start if logger? logger.log {key, elapsedTime}, "[Metrics] timed async method call" callback.apply this, callbackArgs validateParameters = (params) -> result = { warnings: [] errors: [] } for paramName, param of params if param['required'] == true and (param['example'] == '' or param['example'] == undefined) text = "Required URI parameter '#{paramName}' has no example value." result['errors'].push text switch param['type'] when 'string' unless isNaN(Number(String(param['example']))) text = "URI parameter '#{paramName}' is declared as 'string' but it is a number." result['errors'].push text when 'number' if isNaN(parseFloat(param['example'])) text = "URI parameter '#{paramName}' is declared as 'number' but it is a string." result['errors'].push text when 'boolean' if param['example'] != 'true' or param['example'] != 'false' text = "URI parameter '#{paramName}' is decalred as 'boolean' but it is not. " result['errors'].push text if param['values'].length > 0 values = param['values'].map (value) -> value['value'] unless values.indexOf(param['example']) > -1 text = "URI parameter '#{paramName}' example value is not one of enum values." result['errors'].push text return result module.exports = validateParameters kd = require 'kd' KDView = kd.View KDTabView = kd.TabView KDTabPaneView = kd.TabPaneView TeamMembersCommonView = require './teammemberscommonview.coffee' module.exports = class AdminMembersView extends KDView constructor: (options = {}, data) -> options.cssClass = 'member-related' super options, data @createTabView() createTabView: -> data = @getData() tabView = new KDTabView hideHandleCloseIcons: yes tabView.addPane allMembersPane = new KDTabPaneView name: 'All Members' tabView.addPane adminsPane = new KDTabPaneView name: 'Admins' tabView.addPane moderatorsPane = new KDTabPaneView name: 'Moderators' tabView.addPane blockedMembersPane = new KDTabPaneView name: 'Blocked' allMembersPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchMembers' }, data adminsPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchAdmins' }, data moderatorsPane.addSubView new TeamMembersCommonView { fetcherMethod: 'fetchModerators' }, data # blockedMembersPane.addSubView new TeamMembersView {}, data tabView.showPaneByIndex 0 @addSubView tabView linterPath = atom.packages.getLoadedPackage("linter").path Linter = require "#{linterPath}/lib/linter" {CompositeDisposable} = require 'atom' class LinterPhp extends Linter # The syntax that the linter handles. May be a string or # list/tuple of strings. Names should be all lowercase. @syntax: ['text.html.php', 'source.php'] # A string, list, tuple or callable that returns a string, list or tuple, # containing the command line (with arguments) used to lint. cmd: 'php -l -n -d display_errors=On -d log_errors=Off' executablePath: null linterName: 'php' # A regex pattern used to extract information from the executable's output. regex: '(Parse|Fatal) (?error):(\\s*(?parse|syntax) error,?)?\\s*' + '(?(unexpected \'(?[^\']+)\')?.*) ' + 'in .*? on line (?\\d+)' constructor: (editor) -> super(editor) @disposables = new CompositeDisposable @disposables.add atom.config.observe 'linter-php.phpExecutablePath', => @executablePath = atom.config.get 'linter-php.phpExecutablePath' destroy: -> # atom.config.unobserve 'linter-php.phpExecutablePath' @disposables.dispose(); createMessage: (match) -> # message might be empty, we have to supply a value if match and match.type == 'parse' and not match.message message = 'parse error' super(match) module.exports = LinterPhp "*": editor: showIndentGuide: true fontFamily: "Inconsolata" invisibles: {} scrollPastEnd: true softWrap: true softWrapAtPreferredLineLength: true preferredLineLength: 100 core: ignoredNames: [ ".bundle" ".git" "log" "repositories" "tmp" "vendor" ] hideGitIgnoredFiles: true disabledPackages: [ "background-tips" "exception-reporting" "metrics" "latexer" ] "spell-check": grammars: [ "text.plain" "source.gfm" "text.git-commit" ] welcome: showOnStartup: false "release-notes": viewedVersion: "0.89.0" "autocomplete-bibtex": bibtex: [ "/Users/briandanielak/Documents/bibtex/2015-10-21-zotero-library/2015-10-21-zotero-library.bib" ] "autocomplete-plus": {} Zen: softWrap: true typewriter: true minimap: true width: 140 "markdown-table-formatter": {} latex: {} "make-runner": {} {View} = require 'space-pen' $ = require 'jquery' _ = nodeRequire 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) -> editor.underlayer.append(new WrapGuideView(editor)) if editor.attached @content: -> @div class: 'wrap-guide' initialize: (@editor) -> @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getDefaultColumn: -> config.get('editor.preferredLineLength') ? 80 getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @getDefaultColumn() unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @getDefaultColumn() updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', columnWidth).show() else @hide() else @hide() exports.config = (config) -> # File path glob patterns. # All file paths matching these glob patterns will be watched for changes, # and when they are detected, the matching URL cache will be expired. config.watch "app/assets/**" config.watch "vendor/assets/**" # Match file paths to their corresponding URLs. # The first argument is the match pattern, and the second argument is the # translation function. Any captures made by the matching pattern will be # passed into the translation function in the order they are matched. The # returned URL String from the translation function will be used to expire # the cache for that URL. config.match ':location/assets/javascripts/*', javascript_path config.match ':location/assets/stylesheets/*', stylesheet_path # Establish a white list of URL Strings of the paths to cache. # If an incoming request URL does not match an include pattern, it will not # be cached and will be simply reverse proxied to the server. config.include /\.js$/ return javascript_path = (location, filepath) -> return "/assets/#{filepath}?body=1" stylesheet_path = (location, filepath) -> return "/assets/application.css?body=1" sysPath = require 'path' compileHBS = require './ember-handlebars-compiler' module.exports = class EmberHandlebarsCompiler brunchPlugin: yes type: 'template' extension: 'hbs' precompile: off root: null modulesPrefix: 'module.exports = ' constructor: (@config) -> if @config.files.templates.precompile is on @precompile = on if @config.files.templates.root? @root = sysPath.join 'app', @config.files.templates.root, sysPath.sep if @config.modules.wrapper is off @modulesPrefix = '' null compile: (data, path, callback) -> try tmplPath = path.replace @root, '' tmplPath = tmplPath.replace /\\/g, '/' tmplPath = tmplPath.substr 0, tmplPath.length - sysPath.extname(tmplPath).length tmplName = "Ember.TEMPLATES['#{tmplPath}']" if @precompile is on content = compileHBS data.toString() result = "#{@modulesPrefix}#{tmplName} = Ember.Handlebars.template(#{content});" else content = JSON.stringify data.toString() result = "#{@modulesPrefix}#{tmplName} = Ember.Handlebars.compile(#{content});" catch err error = err finally callback error, result React = require 'react' ReactDOM = require 'react-dom' module.exports = React.createClass XLINK_NS: 'http://www.w3.org/1999/xlink' getDefaultProps: -> src: '' aspectRatio: NaN getInitialState: -> naturalWidth: 0 naturalHeight: 0 componentDidMount: -> @loadImage @props.src componentWillReceiveProps: (nextProps) -> unless nextProps.src is @props.src @loadImage nextProps.src loadImage: (src) -> img = new Image img.onload = => {naturalWidth, naturalHeight} = img @setState {naturalWidth, naturalHeight} img.src = src render: -> min = Math.min @state.naturalWidth, @state.naturalHeight width = min height = min if @props.aspectRatio < 1 width = @props.aspectRatio * height else if @props.aspectRatio > 1 height = @props.aspectRatio * width x = (@state.naturalWidth - width) / 2 y = (@state.naturalHeight - height) / 2 componentDidUpdate: -> image = ReactDOM.findDOMNode @refs.image image.setAttribute 'width', @state.naturalWidth image.setAttribute 'height', @state.naturalHeight image.setAttributeNS @XLINK_NS, 'href', @props.src currentTest = {} startTime = null QUnit.testStart (context) -> currentTest = {} currentTest.name = context.name currentTest.assertions = 0 currentTest.backtrace = [] startTime = (new Date()).getTime() QUnit.log (context) -> if context.result currentTest.assertions++ return stackTrace = [] currentTest.backtrace = [] # qunit handles exceptions in a werid way. It prepends "Died" # to the stacktrace and shoves that in message if context.message.match(/^Died/) currentTest.error = true currentTest.message = context.source stackTrace = context.message # General Assertion Error else if context.message currentTest.assertions++ currentTest.failed = true currentTest.message = context.message stackTrace = context.source # Failed expectations else if context.expected currentTest.failed = true currentTest.message = "Expected: #{context.expected}, Actual: #{context.actual}" stackTrace = context.source # format the backtrace accordingly for line in stackTrace.split("\n") matches = line.match(/(file:\/\/|https?:\/\/|\/.+:\d+)/) if matches currentTest.backtrace.push matches[1] else currentTest.backtrace.push line QUnit.testDone (context) -> currentTest.time = (new Date()).getTime() - startTime window.logger.message(currentTest) QUnit.done (context) -> window.unitTestsDone = true QUnit.config.autorun = false class CommentListViewController extends KDListViewController constructor: (options = {}, data) -> options.viewOptions or= type : 'comments' dataPath : 'id' itemClass : CommentListItemView itemOptions : activity : data super options, data commentView = @getDelegate() @getListView().on 'ItemWasAdded', (item) -> commentView.forwardEvent item, 'MentionStarted' commentView.forwardEvent item, 'MentionHappened' commentView.forwardEvent item, 'MouseEnterHappenedOnMention' commentView.forwardEvent item, 'MouseLeaveHappenedOnMention' instantiateListItems: (items) -> super items.sort (a, b) -> a.createdAt - b.createdAt addItem: (item, index) -> super item, index loadView: (mainView) -> super mainView {replies} = @getData() @instantiateListItems replies if replies.length setScrollView: (mainView) -> mainView.addSubView @customScrollView or @scrollView @scrollView.addSubView @getListView() @showLazyLoader no if @getOption 'startWithLazyLoader' @scrollView.on 'LazyLoadThresholdReached', @bound 'showLazyLoader' ### # Mentions is a named function that will process Mentions # @param {Object} message - The message object ### class MentionsServer constructor: (message) -> # If message starts with /me, replace it for text formatting mentions = [] message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) -> mentions.push mention if mentions.length isnt 0 mentions = _.unique mentions verifiedMentions = [] mentions.forEach (mention) -> verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}}) verifiedMentions.push verifiedMention if verifiedMention? if verifiedMentions.length isnt 0 message.mentions = verifiedMentions return message RocketChat.callbacks.add 'beforeSaveMessage', MentionsServerangular.module('loomioApp').directive 'previousProposalsCard', ($routeParams) -> scope: {discussion: '='} restrict: 'E' templateUrl: 'generated/components/thread_page/previous_proposals_card/previous_proposals_card.html' replace: true controller: ($scope, $rootScope, $location, Records) -> Records.votes.fetchMyVotes($scope.discussion) Records.proposals.fetchByDiscussion($scope.discussion).then -> $rootScope.$broadcast 'threadPageProposalsLoaded' lastRecentlyClosedProposal = -> return unless $scope.anyProposals() and !$scope.discussion.hasActiveProposal() proposal = $scope.discussion.closedProposals()[0] proposal if moment().add(-1, 'month') < proposal.closedAt $scope.$on 'setSelectedProposal', (event, proposal) -> $scope.selectedProposalId = (proposal or lastRecentlyClosedProposal() or {}).id $scope.anyProposals = -> $scope.discussion.closedProposals().length > 0 return #= require libraries #= require_tree . $ -> $('.alert').delay(4000).fadeOut('slow') $('.chosen').chosen() $('.timeago').timeago() # Have a loading screen when turbolinks is working it's magic document.addEventListener 'page:fetch', -> html = "
      " $('body').prepend(html) document.addEventListener 'page:receive', -> $('#loading').remove() argv = require('yargs') .options('d', { alias: 'dir', default: '.', describe: 'Served files directory' }) .options('p', { alias: 'port', default: '1234', describe: 'Runs Shuss on the specified port' }) .options('verbose', { boolean: true, describe: 'Speak to me' }) .options('l', { alias: 'livereload' boolean: true, describe: 'Enables LiveReload' }) .options('f', { alias: 'file', describe: 'Config file path' }) .options('v', { alias: 'version' boolean: true, describe: 'Return actual Shuss version' }) .argv ShussServer = require './shuss-server' class ShussCli constructor:(@argv)-> run:(@config, @logger)=> if @argv.version @_version() else @_start() _version: ()-> console.log require('../package').version _start: ()-> @logger.debug 'starting' @config.load @argv @config.loadFile path if path = @argv.file @config.validate() @logger.resetConfig() new ShussServer(@config, @logger).start() module.exports = new ShussCli argv exports.beforeEach = (fn) -> global.beforeEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) exports.afterEach = (fn) -> global.afterEach -> result = fn() if result instanceof Promise waitsForPromise(-> result) ['it', 'fit', 'ffit', 'fffit'].forEach (name) -> exports[name] = (description, fn) -> global[name] description, -> result = fn() if result instanceof Promise waitsForPromise(-> result) waitsForPromise = (fn) -> promise = fn() waitsFor 'spec promise to resolve', 30000, (done) -> promise.then( done, (error) -> jasmine.getEnv().currentSpec.fail(error) done() ) define ['angular', 'angularRoute', 'controllers'], (angular) -> getFirstPage = -> if window.isAuthenticated '/user/' + window.user + '/' else '/welcome/' app = angular.module('coviolations', ['ngRoute', 'coviolations.controllers']) .config ['$routeProvider', '$locationProvider', ($routeProvider, $locationProvider) -> $routeProvider .when '/', redirectTo: getFirstPage() .when '/welcome/', templateUrl: '/static/views/index.html' controller: 'IndexCtrl' .when '/projects/manage/', templateUrl: '/static/views/manage.html' controller: 'ManageCtrl' .when '/projects/:owner/:name/', templateUrl: '/static/views/project.html' controller: 'ProjectCtrl' .when '/tasks/:pk/', templateUrl: '/static/views/task.html' controller: 'TaskCtrl' .when '/user/:user/', templateUrl: '/static/views/dashboard.html' controller: 'UserPageCtrl' .when '/not_found/', templateUrl: '/static/views/not_found.html' .when '/access/:task/', templateUrl: '/static/views/access.html' controller: 'AccessCtrl' .when '/access/:owner/:name/', templateUrl: '/static/views/access.html' controller: 'AccessCtrl' .otherwise redirectTo: '/not_found/' ] app.run ($rootScope) -> $rootScope.getId = (obj) -> obj._id if obj #= require qunit #= require rails #= require_directory ./unit window.setupFrame = (env, url) -> stop() env.iframe = document.createElement 'iframe' env.iframe.src = "/frame" env.iframe.onload = -> env.iframe.onload = -> env.window = env.win = env.iframe.contentWindow env.document = env.doc = env.iframe.contentDocument env.$ = env.iframe.contentWindow.jQuery start() fixture = document.getElementById 'qunit-fixture' fixture.appendChild env.iframe window.click = (element) -> event = document.createEvent 'MouseEvents' event.initEvent 'click', true, true element.dispatchEvent event $(document).delegate 'a[href]', 'click', (event) -> return if event.defaultPrevented || event.isDefaultPrevented?() window.location = event.target.href return # Target form submissions to iframe guid = 1 $(document).bind 'submit', (event) -> return if event.defaultPrevented || event.isDefaultPrevented?() name = "frame#{guid++}" iframe = $ "
      ` module.exports = activate: -> rootView.command 'link:open', -> editSession = rootView.getActivePaneItem() return unless editSession? token = editSession.tokenForBufferPosition(editSession.getCursorBufferPosition()) return unless token? unless @selector? TextMateScopeSelector = require 'text-mate-scope-selector' @selector = new TextMateScopeSelector('markup.underline.link') if @selector.matches(token.scopes) require('shell').openExternal token.value class Choice constructor: (@id, @title, @text, @visibleReqs, @activeReqs, @next) -> Object.freeze @ reqsAreMet = (reqs, qualities) -> for qualityName, predicate of reqs quality = qualities.lookup qualityName return false unless predicate quality return true isVisibleWith: (qualities) -> reqsAreMet @visibleReqs, qualities isActiveWith: (qualities) -> reqsAreMet @activeReqs, qualities angular.module 'qbn.choice', ['qbn.quality'] .factory 'frontalChoices', (qualities) -> library = [] api = register: (choice) -> library.push choice # Choices are stored in immutable form return this # Allow Chaining getAll: () -> library.filter (storylet) -> storylet.isVisibleWith qualities return Object.freeze api .factory 'choiceFactory', () -> (args...) -> new Choice args... "*": core: themes: [ "one-light-ui" "solarized-dark-syntax" ] editor: fontFamily: "mononoki" fontSize: 18 invisibles: {} showIndentGuide: true showInvisibles: true "exception-reporting": userId: "76d6bd0a-16fd-42b8-0163-bce5c8c7e379" welcome: showOnStartup: false whitespace: ensureSingleTrailingNewline: false window.ReactUserSearch = React.createBackboneClass displayName: 'ReactUserSearch' render: -> _div [], _a [rel:"backbone", href:@model().link()], _img ["feed-activity-user-avatar image-30px", alt:" ", src: @model().avatar_url(30)] _strong ['search-user-name'], _a [rel:"backbone", href:@model().link()], @model().get('name') window.Tahi ||= {} Tahi.utils = toCamel: (string) -> string.replace /(\-[a-z])/g, ($1) -> $1.toUpperCase().replace "-", "" windowHistory: -> window.history bindColumnResize: -> $(window).off('resize.columns').on 'resize.columns', => @resizeColumnHeaders() resizeColumnHeaders: -> $headers = $('.columns .column-header') return unless $headers.length $headers.css('height', '') heights = $headers.find('h2').map -> $(this).outerHeight() max = Math.max.apply(Math, heights) $headers.css('height', max) $('.column-content').css('top', max) togglePropertyAfterDelay: (obj, prop, startVal, endVal, ms) -> obj.set(prop, startVal) setTimeout( -> Ember.run.schedule("actions", obj, 'set', prop, endVal) ms) gulp = require 'gulp' tsc = require 'gulp-typescript' # Main task gulp.task 'default', ['build'] gulp.task 'build', ['copy', 'typescript-build'] gulp.task 'copy', ()-> gulp.src 'src/html/**' .pipe gulp.dest 'dest/html' gulp.task 'watch', ['build'], ()-> gulp.watch 'src/**/*.html', ['copy'] gulp.watch 'src/**/*.ts', ['typescript-build'] # Sub task tscBuildOptions = { target: "ES5", noImplicitAny: true, } gulp.task 'typescript-build', ()-> gulp.src 'src/ts/**/*.ts' .pipe tsc tscBuildOptions .pipe gulp.dest 'dest/js' gulp.task 'test-build', ['build'], ()-> gulp.src 'test/src/ts/**/*.ts' .pipe tsc tscBuildOptions .pipe gulp.dest 'test/dest/js' 'body': 'meta-t': 'fuzzy-finder:toggle-file-finder' 'meta-b': 'fuzzy-finder:toggle-buffer-finder' 'ctrl-.': 'fuzzy-finder:find-under-cursor' 'meta-T': 'fuzzy-finder:toggle-git-status-finder' '.platform-darwin .image-view': 'cmd-+': 'image-view:zoom-in' 'cmd-=': 'image-view:zoom-in' 'cmd--': 'image-view:zoom-out' 'cmd-_': 'image-view:zoom-out' 'cmd-0': 'image-view:reset-zoom' '.platform-win32 .image-view': 'ctrl-+': 'image-view:zoom-in' 'ctrl-=': 'image-view:zoom-in' 'ctrl--': 'image-view:zoom-out' 'ctrl-_': 'image-view:zoom-out' 'ctrl-0': 'image-view:reset-zoom' '.platform-linux .image-view': 'ctrl-+': 'image-view:zoom-in' 'ctrl-=': 'image-view:zoom-in' 'ctrl--': 'image-view:zoom-out' 'ctrl-_': 'image-view:zoom-out' 'ctrl-0': 'image-view:reset-zoom' express = require 'express' session = require 'express-session' body_parser = require 'body-parser' app = express() app.use express.static 'app/public' app.use session secret: 'secret-TODO-change-me' app.use body_parser.json() app.use body_parser.urlencoded extended: true app.get '/', (req, res) -> res.send 'hello, world' server = app.listen 3000, -> port = server.address().port console.log 'Started jachi-koro %s', port fs = require 'fs' path = require 'path' class Cli constructor: -> @error = null buildOptions: (name) -> options = {} options.name = name options getValidators: -> @validators = {} for filename in fs.readdirSync(path.join(__dirname, 'validators')) name = path.basename(filename, '.coffee') @validators[name] = require(path.join(__dirname, 'validators', filename)) report: (message) -> if message @error = 1 console.log(message) run: -> @getValidators() for name, validate of @validators options = @buildOptions(name) @report(validate(options)) @error module.exports = Cli 'use strict' $(document).foundation() angular .module('app', [ 'ngAnimate', # 'ngAria', 'ngCookies', 'ngMessages', 'ngResource', 'ngRoute', 'ngSanitize', # 'ngTouch', 'angular-growl', 'angularSpinner', ]) .config [ '$routeProvider', '$httpProvider', '$logProvider', 'growlProvider', ( $routeProvider, $httpProvider, $logProvider, growlProvider, ) -> $logProvider.debugEnabled false $routeProvider .when '/', templateUrl: 'static/view/listing.html' controller: 'ListingCtrl' .otherwise redirectTo: '/' growlProvider.globalPosition 'top-center' growlProvider.globalInlineMessages true growlProvider.globalTimeToLive success: 4000 info: 4000 warning: 4000 error: 4000 growlProvider.globalDisableCountDown true growlProvider.globalDisableIcons true $httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor) ] DOM = require '../reactGUI/ReactDOMFactories-shim' createReactClass = require '../reactGUI/createReactClass-shim' createSetStateOnEventMixin = require '../reactGUI/createSetStateOnEventMixin' {classSet} = require '../core/util' module.exports = createReactClass displayName: 'StrokeWidthPicker' getState: (tool=@props.tool) -> {strokeWidth: tool.strokeWidth} getInitialState: -> @getState() mixins: [createSetStateOnEventMixin('toolDidUpdateOptions')] componentWillReceiveProps: (props) -> @setState @getState(props.tool) render: -> {ul, li, svg, circle, div} = DOM strokeWidths = @props.lc.opts.strokeWidths (div {}, strokeWidths.map((strokeWidth, ix) => buttonClassName = classSet 'square-toolbar-button': true 'selected': strokeWidth == @state.strokeWidth buttonSize = 28 (div { key: strokeWidth }, (div \ { className: buttonClassName, onClick: => @props.lc.trigger 'setStrokeWidth', strokeWidth }, (svg \ { width: buttonSize-2 height: buttonSize-2 viewPort: "0 0 #{strokeWidth} #{strokeWidth}" version: "1.1" xmlns: "http://www.w3.org/2000/svg" }, (circle { cx: Math.ceil(buttonSize/2-1), cy: Math.ceil(buttonSize/2-1), r: strokeWidth/2 }) ) ) ) ) ) noflo = require "noflo" jsdom = require "jsdom" class ScrapeHtml extends noflo.Component constructor: -> @html = "" @textSelector = "" @crapSelectors = [] @inPorts = in: new noflo.Port() textSelector: new noflo.Port() crapSelector: new noflo.ArrayPort() @outPorts = out: new noflo.Port() error: new noflo.Port() html = "" @inPorts.in.on "data", (data) => html += data @inPorts.in.on "disconnect", => @html = html html = "" @scrapeHtml() @inPorts.textSelector.on "data", (data) => @textSelector = data @inPorts.textSelector.on "disconnect", => @scrapeHtml() @inPorts.crapSelector.on "data", (data) => @crapSelectors.push data scrapeHtml: -> return unless @html.length return unless @textSelector.length target = @outPorts.out jsdom.env @html, ['http://code.jquery.com/jquery.min.js'], (err, win) => if err @outPorts.error.send err return @outPorts.error.disconnect() win.$(crap).remove() for crap in @crapSelectors data = win.$(@textSelector).text() @outPorts.out.send data @outPorts.out.disconnect() @html = "" exports.getComponent = -> new ScrapeHtml path = require 'path' protocol = require 'protocol' # Private: Handles requests with 'atom' protocol. # # It's created by {AtomApplication} upon instantiation, and is used to create a # custom resource loader by adding the 'atom' custom protocol. module.exports = class AtomProtocolHandler constructor: (@resourcePath) -> @registerAtomProtocol() # Private: Creates the 'atom' custom protocol handler. registerAtomProtocol: -> protocol.registerProtocol 'atom', (request) => relativePath = path.normalize(request.url.substr(7)) filePath = path.join(@resourcePath, 'node_modules', relativePath) return new protocol.RequestFileJob(filePath) Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @metadata.name) disable: -> atom.config.removeAtKeyPath('core.themes', @metadata.name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch e console.warn "Failed to load theme named '#{@name}'", e.stack ? e this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise module.exports = (grunt, options) -> return { client: options: paths: ['styles'] files: '<%= build %>/css/servicemap.css': 'styles/servicemap.less' '<%= build %>/css/bootstrap.css': 'styles/bootstrap/bootstrap.less' '<%= build %>/css/servicemap_ie.css': 'styles/servicemap_ie.less' '<%= build %>/css/servicemap_ie9.css': 'styles/servicemap_ie9.less' } requirejs.config({ paths: { fabric: [ 'lib/fabric'] } }) define ['game', 'synchronizedtime', 'position', 'lib/fabric'], (Game, SynchronizedTime, Position) -> # Fabric is deliberately not set as an argument console.log "Fabric: ", fabric console.log "Position: ", new Position([1,2], 0, 5) canvas = new fabric.Canvas('canvas') window.canvas = canvas rect = new fabric.Rect({ left: 100, top: 100, fill: 'red', width: 20, height: 20 }) # "add" rectangle onto canvas canvas.add(rect) game = new Game() game.start() setInterval((-> SynchronizedTime.time += 1 game.timer_tick() ), 1000 ) # Object which holds the methods that can be called from the factlink core iframe modalOpen = false FactlinkJailRoot.annotatedSiteReceiver = modalFrameReady: (featureToggles) -> FactlinkJailRoot.can_haz = featureToggles window.FACTLINK_ON_CORE_LOAD?() openModalOverlay: -> return if modalOpen FactlinkJailRoot.$modalFrame.addClass 'factlink-control-visible' modalOpen = true FactlinkJailRoot.trigger 'modalOpened' highlightNewFactlink: (displaystring, id) -> FactlinkJailRoot.selectRanges(FactlinkJailRoot.search(displaystring), id) FactlinkJailRoot.trigger 'factlinkAdded' closeModal_noAction: -> FactlinkJailRoot.$modalFrame.removeClass 'factlink-control-visible' setTimeout( -> return unless modalOpen modalOpen = false FactlinkJailRoot.trigger 'modalClosed' , 300) # For compatibility, please remove the next time you see this closeModal_highlightNewFactlink: (displaystring, id) -> @highlightNewFactlink(displaystring, id) @closeModal_noAction() closeModal_deleteFactlink: (id) -> $("span.factlink[data-factid=#{id}]").each (i, val) -> $(val).contents().unwrap() @closeModal_noAction() class VMAPParser module.exports = VMAPParserbongo = require 'bongo' module.exports = class SharedMachine extends bongo.Base @share() `import DS from 'ember-data'` Commit = DS.Model.extend remoteId: DS.attr('string') message: DS.attr('string') state: DS.attr('string') remoteUrl: DS.attr('string') project: DS.belongsTo('project') expiresAt: DS.attr('date') createdAt: DS.attr('date') authoredAt: DS.attr('date') author: DS.belongsTo('author') tickets: DS.hasMany('ticket') reviewer: DS.belongsTo('user', {async: true}) fix: DS.hasMany('commit', {inverse: 'fix', async: true}) fixed: DS.hasMany('commit', {inverse: 'fixed', async: true}) shortHash: Ember.computed('remoteId', -> @get('remoteId').substr(0,6) ) isRejected: Ember.computed('state', -> ['rejected', 'auto_rejected'].contains(@get('state')) ) isPassed: Ember.computed('state', -> @get('state') == 'passed' ) isFixed: Ember.computed('state', -> @get('state') == 'fixed' ) isAccepted: Ember.computed('state', -> @get('state') == 'accepted' ) belongsToMe: Ember.computed -> @store.find('user', 'me').get('person') is @get('author') hasReviewer: Ember.computed.notEmpty('reviewer.id') `export default Commit` define [ 'jquery' 'mockjax' ], ($) -> $.mockjax url: '/api/me' proxy: 'data/me.json' $.mockjax url: '/api/content' proxy: 'data/content.json' $.mockjax (settings) -> # url: '/content/' id = settings.url.match(/\/content\/(.*)$/); if id return {proxy: 'data/content/' + id[1] + '.json'} # Load the actual app require(['cs!../scripts/config']) {BufferedProcess} = require 'atom' StatusView = require './status-view' # if all param true, then 'git add .' gitWrite = (all=false)-> dir = atom.project.getRepo().getWorkingDirectory() currentFile = atom.workspace.getActiveEditor().getPath() toStage = if all then '.' else currentFile new BufferedProcess({ command: 'git' args: ['add', toStage] options: cwd: dir stderr: (data) -> new StatusView(type: 'alert', message: data.toString()) exit: (data) -> new StatusView(type: 'success', message: "Added #{toStage}") }) module.exports = gitWrite FactlinkJailRoot.createFactFromSelection = (current_user_opinion) -> success = -> window.document.getSelection().removeAllRanges() FactlinkJailRoot.createButton.hide() FactlinkJailRoot.off 'modalOpened', success selInfo = text: window.document.getSelection().toString() title: window.document.title text = selInfo.text siteUrl = FactlinkJailRoot.siteUrl() siteTitle = selInfo.title FactlinkJailRoot.on 'modalOpened', success FactlinkJailRoot.factlinkCoreEnvoy 'prepareNewFactlink', text, siteUrl, siteTitle, current_user_opinion FactlinkJailRoot.textSelected = -> # At least 4 words of at least 2 characters /(\w{2,}[\s-_&\/#%.,;:!()]+){4}/.test window.document.getSelection().toString() $(document).ready -> $('.literally').literallycanvas() $(document).bind 'touchmove', (e) -> if e.target == document.documentElement e.preventDefault() oldConsole = console window.console = { log: (args...) -> oldConsole.log(args...) $('.log').append($("
      #{args}
      ")) } define (require) -> $ = require('jquery') toc = require('cs!collections/toc') Node = require('cs!models/content/node') require('backbone-associations') return class Page extends Node defaults: authors: [] constructor: () -> super(arguments...) toc.add(@) parse: (response, options) -> resonse = super(arguments...) # jQuery can not build a jQuery object with or tags, # and will instead move all elements in them up one level. # Use a regex to extract everything in the body and put it into a div instead. $body = $('
      ' + response.content.replace(/^[\s\S]*|<\/body>[\s\S]*$/g, '') + '
      ') $body.children('.title').eq(0).remove() $body.children('.abstract').eq(0).remove() response.content = $body.html() return response ### irc-message Copyright (c) 2013 Fionn Kelleher. All rights reserved. Licensed under the BSD 2-Clause License (FreeBSD) - see LICENSE.md. ### Transform = require("stream").Transform Message = require "irc-message" util = require "util" class MessageStream constructor: (options) -> @buffer = "" Transform.call(this, options) util.inherits MessageStream, Transform MessageStream::_transform = (chunk, encoding, done) -> @buffer += chunk.toString() lines = @buffer.split "\r\n" @buffer = lines.pop() for line in lines @emit "line", line try message = new Message line @push message catch err @emit "error", err done() exports = module.exports = MessageStream React = require 'react' classnames = require 'classnames' # Renders ONLY the list of tabs (not tab body), with @props.chilren inline with the tabs # Usefull for rendering controls beside the Tabs TabsWithChildren = React.createClass propTypes: onClick: React.PropTypes.func.isRequired tabs: React.PropTypes.arrayOf( React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.element ]) ).isRequired getInitialState: -> tabIndex: 0 onTabClick: (tabIndex, ev) -> ev.preventDefault() @setState({tabIndex}) @props.onClick(ev, tabIndex) renderTab: (tab, index) -> isSelected = index is @state.tabIndex
    • {tab}
    • render: ->
        {_.map @props.tabs, @renderTab} {@props.children}
      module.exports = TabsWithChildren jQuery -> $("input.datepicker").datepicker format: "yyyy-mm-dd" startDate: new Date() autoclose: true express = require 'express' mongoose = require 'mongoose' ext_type = require 'connect-ext-type' { createServer } = require 'http' { join } = require 'path' module.exports = express().configure -> @set 'port', process.env.PORT or 8070 @set 'view engine', 'jade' @set 'views', join __dirname, 'views' @set 'url', process.env.URL or "http://localhost:#{@settings.port}/" @locals url: @settings.url blockchain_api: process.env.BLOCKCHAIN_API pubkey_address: process.env.PUBKEY_ADDRESS pretty: @settings.env is 'development' @db = mongoose.connect process.env.MONGO_URI or 'mongodb://localhost/' @models = require('./models')(@db) @use express.basicAuth 'u2', 'b1tr4t3d' @use express.favicon() @use express.logger 'dev' @use express.bodyParser() @use express.methodOverride() @use ext_type '.json': 'application/json', '.txt': 'text/plain' server = createServer this require('./websocket').call(this, server) require('./assets').call(this) if (@settings.env is 'development') or process.env.SERVE_ASSETS # assets are pre-compiled and served by nginx on production @use '/u', require('./user')(this) server.listen @settings.port, => console.log "Listening on #{@settings.port}" class FinderPane extends Pane constructor: (options = {}, data) -> super options, data vmController = KD.getSingleton 'vmController' vmController.fetchDefaultVmName (vmName) => @finder = new NFinderController nodeIdPath : 'path' nodeParentIdPath : 'parentPath' contextMenu : yes useStorage : no @addSubView @finder.getView() @finder.updateVMRoot vmName, "/home/#{KD.nick()}" @finder.on 'FileNeedsToBeOpened', (file) => file.fetchContents (err, contents) -> appManager = KD.getSingleton 'appManager' appManager.tell 'IDE', 'openFile', file, contents bindListeners: -> appManager = KD.getSingleton 'appManager' @finderController.on 'FileNeedsToBeOpened', (file) => file.fetchContents (err, contents) -> appManager.tell 'IDE', 'openFile', file, contents @finderController.treeController.on 'TerminalRequested', (vm) => appManager.tell 'IDE', 'openVMTerminal', vm @on 'VMMountRequested', (vm) => @finderController.mountVm vm @on 'VMUnmountRequested', (vm) => @finderController.unmountVm vm.hostnameAlias qbnApp = angular.module 'qbnApp', [] # The immutable objects that make up the game itself serve as prototypes for the objects that make # up the mutable game state. This function takes a game definition object and makes a state # instance of it. # # By convention, any property on the prototype of the form "defaultThing" will be copied on the # instance as a property called "thing". This is to allow easy instantiation of default, starting # values. instantiate = (proto) -> instance = Object.create proto for key, value of proto when /^default\w/.test(key) [_, first, rest] = /^default(\w)(\w*)/.exec(key) newName = first.toLowerCase() + rest instance[newName] = value return instance qbnApp.controller 'QBN', ($scope) -> $scope.qualities = [ instantiate new Quality 'Punchiness', '', 7 instantiate new Quality 'Thinkyness', '', 2 ] $scope.storylets = [ new Storylet 'The Thinker\'s Apprentice', 'You do some thinking.' new Storylet 'Change Location', 'Yeah, but where to go?' new Storylet 'A Mysterious Occurrence', 'So mysterious, you don\'t even know about it.' ] $scope.eventText = 'Event' $scope.choices = [ new Choice 'Choice A', 'Requires Punchiness 7' new Choice 'Choice B', 'Requires Thinkyness 5' ] $scope.currentStorylet = null; return {RootView} = require 'atom-api' shell = require 'shell' describe "link package", -> [editor] = [] beforeEach -> atom.activatePackage('javascript-tmbundle', sync: true) atom.activatePackage('hyperlink-helper-tmbundle', sync: true) window.rootView = new RootView rootView.open('sample.js') atom.activatePackage('link') rootView.attachToDom() editor = rootView.getActiveView() editor.insertText("// http://github.com\n") describe "when the cursor is on a link", -> it "opens the link using the 'open' command", -> spyOn(shell, 'openExternal') editor.trigger('link:open') expect(shell.openExternal).not.toHaveBeenCalled() editor.setCursorBufferPosition([0,5]) editor.trigger('link:open') expect(shell.openExternal).toHaveBeenCalled() expect(shell.openExternal.argsForCall[0][0]).toBe "http://github.com" noflo = require 'noflo' coap = require 'coap' # @runtime noflo-nodejs exports.getComponent = -> c = new noflo.Component c.icon = 'cog' c.description = 'Send request' # Add input ports c.inPorts.add 'url', datatype: 'object' require: yes # Add output ports c.outPorts.add 'request', datatype: 'object' noflo.helpers.WirePattern c, in: 'url' out: 'request' forwardGroups: true , (data, groups, out) -> req = coap.request data req.end -> out.send req # Finally return the component instance c {BaseTaskAction} = require "#{__dirname}/../../base_task_action" {TempFileHolder} = require "#{__dirname}/../../helpers/temp_file_holder" {GoogleTranslatorTtsStrategy} = require "#{__dirname}/../../plugins/say/tts_strategies/google_translator" class BuildToSpeechAction extends BaseTaskAction language: null constructor: -> @tempFileHolder = new TempFileHolder() configure: (app, task, config) -> super app, task, config @language = config.language ? 'en' initialize: -> super() @tts = new GoogleTranslatorTtsStrategy @tempFileHolder run: (scope) -> @tts.call text: "Project #{scope.data.response.name} has currently state #{scope.data.state}." language: @language exports.BuildToSpeechAction = BuildToSpeechActionwindow.events_at_penn ?= {} Template.new_event.helpers 'empty_object': {} Template.new_event.events 'submit .create-event': (e) -> e.preventDefault() event = window.events_at_penn.parse_event_from_form $('.create-event') Meteor.call('create_event', event, (error, id) -> Meteor.Router.to "/event/#{title_id}" ) fs = require 'fs' module.exports.create = (KONFIG)-> connectionString = "mongodb://#{KONFIG.mongo}" conn = { connectionString } fileName = "./deployment/generated_files/mongomigration.json" fs.writeFileSync fileName, JSON.stringify { conn } #-------------------------------------------------------- # Requirements #-------------------------------------------------------- gulp = require 'gulp' plugins = require('gulp-load-plugins')() config = require "../config.coffee" #-------------------------------------------------------- # Watch for changes and reload #-------------------------------------------------------- gulp.task "watch", -> plugins.watch "#{config.sourcePath}/#{config.cssDirectory}/**/*.{styl,sass,scss,css}", (e, cb) -> gulp.start "stylesheets", cb plugins.watch "#{config.sourcePath}/#{config.imagesDirectory}/**/*", (e, cb) -> gulp.start "copy-images", cb plugins.watch "#{config.sourcePath}/#{config.jsDirectory}/**/*.{coffee,js}", (e, cb) -> gulp.start "javascripts", cb plugins.watch "#{config.sourcePath}/#{config.vendorPath}/**/*", (e, cb) -> gulp.start "bower", cb server = plugins.livereload() plugins.livereload.listen() plugins.watch "#{config.publicPath}/**/*.{css,js,svg,jpg,gif,png}" .pipe plugins.livereload() plugins.watch "#{config.publicPath}/**/*.html", (e, cb) -> server.changed() cb() returnrequest = require 'request' npmconf = require 'npmconf' config = require './config' tree = require './tree' semver = require 'semver' _ = require 'underscore' module.exports = class Fetcher getAvailablePackages: (atomVersion, callback) -> if _.isFunction(atomVersion) callback = atomVersion atomVersion = null npmconf.load config.getUserConfigPath(), (error, userConfig) -> if error? callback(error) else requestSettings = url: config.getAtomPackagesUrl() json: true auth: username: userConfig.get('username', 'builtin') password: userConfig.get('_password', 'builtin') sendImmediately: true request.get requestSettings, (error, response, body={}) -> if error? callback(error) else packages = body.rows ? [] packages = _.map packages, (pack) -> bestMatch = null for metadata in _.values(pack.value.releases) if atomVersion? continue unless semver.satisfies(atomVersion, metadata.engines.atom) if bestMatch? bestMatch = metadata if semver.gt(metadata.version, bestMatch.version) else bestMatch = metadata bestMatch callback(null, packages) run: (options) -> @getAvailablePackages (error, packages) -> if error? options.callback(error) else console.log "Available Atom packages (#{packages.length})" tree packages, ({name, version}) -> "#{name}@#{version}" options.callback() # dom.d.ts: https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts # This fix is needed because these definitions are absent from typescript's official lib.d.ts and are used in dom.d.ts. # 06 march 2015: these definitions can actually be found in : # https://github.com/Microsoft/TypeScript/blob/master/src/lib/extensions.d.ts # and also in # https://github.com/Microsoft/TypeScript/blob/master/src/lib/es6.d.ts fix = """ interface ArrayBufferView {} declare var ArrayBufferView: {}; interface ArrayBuffer {} declare var ArrayBuffer: {}; interface Uint8Array {} declare var Uint8Array: {}; interface Int32Array {} declare var Int32Array: {}; interface Float32Array {} declare var Float32Array: {}; """ fs = require 'fs' SupAPI.addPlugin 'typescript', 'dom', { defs: fs.readFileSync(__dirname + '/dom.d.ts', encoding: 'utf8') + fix } path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error) #= require clipboard.min $.fn.initSnippetCopyToClipboard = () -> this.each () -> $element = $(this) $element.prepend('') clipboardSnippets = new Clipboard('[data-clipboard-snippet]', target: (trigger) -> $(trigger).siblings( "code" ).get(0) ) clipboardSnippets.on 'success', (e) -> e.clearSelection() showTooltip e.trigger, 'Copied!' return clipboardSnippets.on 'error', (e) -> showTooltip e.trigger, fallbackMessage(e.action) return showTooltip = (elem, msg) -> elem.setAttribute 'data-toggle', 'tooltip' elem.setAttribute 'data-placement', 'bottom' elem.setAttribute 'title', msg $(elem).tooltip(delay: {"hide": 1000 }) $(elem).tooltip('show') $(elem).on 'hidden.bs.tooltip', -> $(this).tooltip('destroy') $(this).blur() return $ -> $('.snippet').initSnippetCopyToClipboard()module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['**/*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' indentation: level: 'ignore' src: ['src/*.coffee'] test: ['spec/*.coffee'] gruntfile: ['Gruntfile.coffee'] shell: test: command: 'node --harmony_collections --force node_modules/.bin/jasmine-focused --coffee --captureExceptions spec' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.registerTask 'clean', -> require('rimraf').sync('lib') grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['coffee', 'lint']) grunt.registerTask('test', ['coffee', 'lint', 'shell:test']) module.exports = selector: ['.source.ruby'] id: 'aligner-ruby' # package name config: '=>-alignment': title: 'Padding for =>' description: 'Pad left or right of the character' type: 'string' enum: ['left', 'right'] default: 'left' '=>-leftSpace': title: 'Left space for =>' description: 'Add 1 whitespace to the left' type: 'boolean' default: true '=>-rightSpace': title: 'Right space for =>' description: 'Add 1 whitespace to the right' type: 'boolean' default: true '=>-scope': title: 'Character scope' description: 'Scope string to match' type: 'string' default: 'key-value' remote = require 'remote' window.$ = window.jQuery = require "../assets/js/jquery-2.1.1.min.js" require "../assets/js/jquery.hotkeys.js" #LESS less = remote.require 'less' parser = new(less.Parser)({ paths: ['less/'], filename: 'style.less' }); parser.parse '@import "main.less";', (e, tree) -> $('#stylesheet').html tree.toCSS({ compress: true }); # Views MainView = require './views/main-view' HomeView = require './views/home-view' # Apply Main View $(document).ready -> main = new MainView $('body').html(main) view = new HomeView main.setBodyView(view) view.applyData() module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize() {CompositeDisposable} = require 'event-kit' {requirePackages} = require 'atom-utils' class MinimapHighlightSelected constructor: -> @subscriptions = new CompositeDisposable activate: (state) -> consumeMinimapServiceV1: (@minimap) -> @minimap.registerPlugin 'highlight-selected', this consumeHighlightSelectedServiceV1: (@highlightSelected) -> @init() if @minimap? and @active? deactivate: -> @deactivatePlugin() @minimapPackage = null @highlightSelectedPackage = null @highlightSelected = null @minimap = null isActive: -> @active activatePlugin: -> return if @active @subscriptions.add @minimap.onDidActivate @init @subscriptions.add @minimap.onDidDeactivate @dispose @active = true @init() if @highlightSelected? init: -> @decorations = [] @highlightSelected.onDidAddMarker (marker) => @markerCreated(marker) dispose: -> @decorations.forEach (decoration) -> decoration.destroy() @decorations = null markerCreated: (marker) => activeMinimap = @minimap.getActiveMinimap() return unless activeMinimap? decoration = activeMinimap.decorateMarker(marker, {type: 'highlight', class: @highlightSelected.makeClasses()}) @decorations.push decoration deactivatePlugin: -> return unless @active @active = false @dispose() @subscriptions.dispose() module.exports = new MinimapHighlightSelected class ModelSaver constructor: ( @element, @options )-> @mask = new Lanes.Views.TimedMask( @element, @options.message ) @mask.prefixActions( "Save" ) _.bindAll(this,'_onError','_onSuccess') save: -> @options.model.save({ success: this._onSuccess, error: this._onError }) _onSuccess: (rec,resp,options)-> @mask.displaySuccess() this._callback(true,resp) _onError: (rec,resp,options)-> @mask.displayFailure(rec.lastServerMessage) this._callback(false,resp) _callback: (success,resp)-> @options.callback(success,resp,@options.model) if @options.callback Lanes.Views.SaveNotify = ( view, options={} )-> el = if view.jquery then view else view.$el _.defaults( options, { model: view.model, message: "Saving, Please Wait…"} ) ms = new ModelSaver(el, options) ms.save() ScriptView = require './script-view' configUri = "atom://script" grammarMap = CoffeeScript: interpreter: "coffee" makeargs: (code) -> ['-e', code] Python: interpreter: "python" makeargs: (code) -> ['-c', code] module.exports = activate: -> atom.project.registerOpener (uri) => interpreter = grammarMap[@lang]["interpreter"] makeargs = grammarMap[@lang]["makeargs"] @scriptView = new ScriptView(interpreter, makeargs) if uri is configUri atom.workspaceView.command "script:run-selection", => editor = atom.workspace.getActiveEditor() code = editor.getSelectedText() if not code? or not code code = editor.getText() if not editor? console.log("Editor unavailable") return grammar = editor.getGrammar() @lang = grammar.name if grammar.name == "Null Grammar" console.log("Need to select a language in the lower left or") console.log("save the file with an appropriate extension.") return if ! grammar.name in grammarMap console.log("Interpreter not configured for " + @lang) console.log("Send a pull request to add support!") return atom.workspaceView.open(configUri, split: 'right') @scriptView.runit(code) React = require 'react' # TODO: Maybe infer the on/off methods from a list if none is specified: # ON_OFF_METHODS = # addEventListener: 'removeEventListener' # DOM elements # addListener: 'removeListener' # Node EventEmitter class # listen: 'stopListening' # Panoptes Model and JSONAPIClient Resource classes (change this to match Node?) # on: 'off' # jQuery-ish module.exports = React.createClass displayName: 'ChangeListener' propTypes: target: React.PropTypes.any.isRequired eventName: React.PropTypes.string on: React.PropTypes.string off: React.PropTypes.string handler: React.PropTypes.func.isRequired getDefaultProps: -> on: 'listen' off: 'stopListening' getInitialState: -> payload: [] componentDidMount: -> @startListeningTo @props.target componentWillReceiveProps: (nextProps) -> unless nextProps.target is @props.target @stopListeningTo @props.target @startListeningTo nextProps.target componentWillUnmount: -> @stopListeningTo @props.target startListeningTo: (target) -> target[@props.on] @getListenerArgs()... stopListeningTo: (target) -> target[@props.off] @getListenerArgs()... getListenerArgs: -> args = [@handleTargetChange] if @props.eventName? args.unshift @props.eventName args handleTargetChange: (payload...) -> if @isMounted() @setState {payload} render: -> # TODO: Figure out why returning `@props.children` here fails to re-render them on change. # Then we can remove the requirement for a separate `handler` function. @props.handler @state.payload... module.exports = class InsertNlJsx constructor: (@editor) -> @adviseBefore(@editor, 'insertText', @insertText) # patched TextEditor::insertText # if a newLine is entered between a JSX tag open and close marked_
      _
      # then add another newLine and reposition cursor insertText: (text, options) => return true unless ( text is "\n" ) return true if @editor.hasMultipleCursors() # for time being cursorBufferPosition = @editor.getCursorBufferPosition() return true unless cursorBufferPosition.column > 0 return true unless 'JSXEndTagStart' is @editor.scopeDescriptorForBufferPosition(cursorBufferPosition).getScopesArray().pop() cursorBufferPosition.column-- return true unless 'JSXStartTagEnd' is @editor.scopeDescriptorForBufferPosition(cursorBufferPosition).getScopesArray().pop() indentLength = /^\s*\S/.exec(@editor.lineTextForBufferRow(cursorBufferPosition.row))?[0].length pad = new Array(indentLength).join(' ') @editor.insertText("\n#{pad}#{@editor.getTabText()}\n#{pad}") @editor.moveUp() @editor.moveToEndOfLine() false # from https://github.com/atom/underscore-plus/blob/master/src/underscore-plus.coffee adviseBefore: (object, methodName, advice) -> original = object[methodName] object[methodName] = (args...) -> unless advice.apply(this, args) == false original.apply(this, args) angular.module 'angular.tourist' .directive 'tourStep', ['$tourist', '$window', ($tourist, $window) -> restrict: 'EAC' controller: ['$scope', ($scope) -> @element = null # JQLite doesnt support offset, so we implement it here _boundingOffset = (element) -> return unless element? doc = element.ownerDocument documentElem = doc.documentElement box = element.getBoundingClientRect?() return unless box? { top: box.top + ($window.pageYOffset || documentElem.scrollTop) - (documentElem.clientTop || 0), left: box.left + ($window.pageXOffset || documentElem.scrollLeft) - (documentElem.clientLeft || 0), width: element.offsetWidth, height: element.offsetHeight } @activate = (step) => offset = @offset() scrollLeft = offset.left + offset.width / 2 - $window.innerWidth / 2 scrollTop = offset.top + offset.height / 2 - $window.innerHeight / 2 if !step.activated? || step.activated.apply(@, [scrollTop, scrollLeft, offset]) != false $window.scrollTo(scrollLeft, scrollTop) @offset = () => _boundingOffset(@element[0]) ] link: (scope, element, attrs, ctrl) -> ctrl.element = element $tourist.registerStep(attrs.tourStep, ctrl) ] Batman.LifecycleEvents = initialize: -> @::fireLifecycleEvent = fire lifecycleEvent: (eventName, normalizeFunction) -> beforeName = "before#{Batman.helpers.camelize(eventName)}" afterName = "after#{Batman.helpers.camelize(eventName)}" addCallback = (eventName) -> (callbackName, options) -> switch Batman.typeOf(callbackName) when 'String' callback = -> @[callbackName].apply(this, arguments) when 'Function' callback = callbackName when 'Object' callback = options options = callbackName options = normalizeFunction?(options) || options target = @prototype || this Batman.initializeObject(target) handlers = target._batman[eventName] ||= [] handlers.push(options: options, callback: callback) @[beforeName] = addCallback(beforeName) @::[beforeName] = addCallback(beforeName) @[afterName] = addCallback(afterName) @::[afterName] = addCallback(afterName) fire = (eventName, arg) -> return unless handlers = @_batman.get(eventName) result = true for {options, callback} in handlers continue if options?.if and !options.if.call(this, arg) continue if options?.unless and options.unless.call(this, arg) result = false if callback.call(this, arg) == false return result class WorkspaceLayoutBuilder extends KDSplitComboView init: -> @splitViews = {} {direction, sizes, views, cssClass, splitName} = @getOption 'layoutOptions' @baseSplitName = splitName splitOptions = { type : direction viewsConfig : views sizes cssClass } @addSubView @createSplitView splitOptions, splitName createSplitView: (splitOptions, splitName) -> {type, sizes, viewsConfig, cssClass} = splitOptions views = [] viewsConfig.forEach (config) => if config.type is 'split' {options} = config {splitName} = options splitView = @createSplitView type : options.direction sizes : options.sizes cssClass : options.cssClass viewsConfig : config.views @splitViews[splitName] = splitView if splitName views.push splitView else wrapper = new KDView cssClass: 'pane-wrapper' wrapper.on 'viewAppended', => wrapper.addSubView @getDelegate().createPane config views.push wrapper SplitViewClass = @getOptions().splitViewClass or SplitViewWithOlderSiblings splitView = new SplitViewClass { type, sizes, views, cssClass } @splitViews[@baseSplitName] = splitView if @baseSplitName return splitView getSplitViewByName: (name) -> return @splitViews[name] or null # Start the crash reporter before anything else. require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub') path = require 'path' ipc = require 'ipc' ipc.send('call-window-method', 'openDevTools') try require '../src/window' Atom = require '../src/atom' window.atom = new Atom # Show window synchronously so a focusout doesn't fire on input elements # that are focused in the very first spec run. atom.getCurrentWindow().show() unless atom.getLoadSettings().headless # Add 'exports' to module search path. exportsPath = path.join(atom.getLoadSettings().resourcePath, 'exports') require('module').globalPaths.push(exportsPath) process.env.NODE_PATH = exportsPath # Set NODE_PATH env variable since tasks may need it. document.title = "Spec Suite" testRunner = require(atom.getLoadSettings().testRunnerPath) testRunner({ logFile: atom.getLoadSettings().logFile headless: atom.getLoadSettings().headless testPaths: atom.getLoadSettings().testPaths }) catch error if atom?.getLoadSettings().headless console.error(error.stack ? error) atom.exit(1) else throw error app = angular.module 'draw', [ 'ngRoute' ] app.config ($locationProvider) -> # if window.history && window.history.pushState $locationProvider.html5Mode true module.exports = app{View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => editor.underlayer.append(new WrapGuideView(editor)) if editor.attached @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) -> @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', columnWidth).show() else @hide() else @hide() gulp = require 'gulp' del = require 'del' haml = require 'gulp-haml' sourcemaps = require 'gulp-sourcemaps' coffee = require 'gulp-coffee' SRC = 'src' DEST = 'out' gulp.task 'default', ['haml', 'coffee'] gulp.task 'haml', -> gulp.src "#{SRC}/haml/**/*.haml" .pipe haml compiler: 'visionmedia' .pipe gulp.dest DEST gulp.task 'coffee', -> gulp.src "#{SRC}/coffee/**/*.coffee" .pipe sourcemaps.init() .pipe coffee() .pipe sourcemaps.write() .pipe gulp.dest "#{DEST}/scripts" gulp.task 'clean', (callback) -> del DEST, callback noflo = require 'noflo' class Gate extends noflo.Component description: 'This component forwards received packets when the gate is open' constructor: -> @open = false @inPorts = in: new noflo.Port 'all' open: new noflo.Port 'bang' close: new noflo.Port 'bang' @outPorts = out: new noflo.Port 'all' @inPorts.in.on 'connect', => return unless @open @outPorts.out.connect() @inPorts.in.on 'begingroup', (group) => return unless @open @outPorts.out.beginGroup group @inPorts.in.on 'data', (data) => return unless @open @outPorts.out.send data @inPorts.in.on 'endgroup', => return unless @open @outPorts.out.endGroup() @inPorts.in.on 'disconnect', => return unless @open @outPorts.out.disconnect() @inPorts.open.on 'data', => @open = true @inPorts.close.on 'data', => @open = false exports.getComponent = -> new Gate casper = require('casper').create() d = -> console.log arguments... casper.start 'http://func/ucp.php?mode=register', -> @test.assertHttpStatus 200 @test.assertExists 'input[value="I agree to these terms"]' @click 'input[value="I agree to these terms"]' casper.then -> @test.assertHttpStatus 200 @test.assertDoesntExist 'input[value="I agree to these terms"]' casper.run() 'use strict' module.exports = angular.module('astrifex.maker', []) .config(($stateProvider) -> $stateProvider.state 'maker', url: '' templateUrl: 'app/maker/layout.html' controller: 'makerController' return ).controller('makerController', require('./makerController')) angular.module('loomioApp').factory '$exceptionHandler', ($log, AppConfig) -> if !AppConfig.errbit.key? return -> client = new airbrakeJs.Client projectId: AppConfig.errbit.key projectKey: AppConfig.errbit.key reporter: 'xhr' host: AppConfig.errbit.url client.addFilter (notice) -> notice.context.environment = AppConfig.environment if notice.errors[0].type == "" null else notice (exception, cause) -> $log.error(exception) client.notify error: exception, params: current_user_id: AppConfig.currentUserId angular_cause: cause "*": "exception-reporting": userId: "1e725750-c66d-33e4-9fce-f627ac32bde5" "release-notes": viewedVersion: "0.94.0" welcome: showOnStartup: false metrics: userId: "c2f08243ecb4a9bc44bd9e46d4f067086d9357e3" editor: fontSize: 11 showInvisibles: true showIndentGuide: true invisibles: {} core: disabledPackages: [ "metrics" "select-rectangle" "vim-mode" ] themes: [ "atom-dark-ui-slim" "atom-dark-syntax" ] linter: showErrorInline: true "go-plus": goPath: "~/.go" "tree-view": {} "autocomplete-plus": {} gulp = require "gulp" gutil = require "gulp-util" coffee = require "gulp-coffee" del = require "del" path = require "path" {spawn} = require "child_process" prefix = gutil.env.prefix || "./build" resourceDir = path.join prefix, "Resources" gulp.task "clean", (done) -> del(prefix, done) gulp.task "js", -> gulp.src(["./Resources/**/*.js"]) .pipe(gulp.dest(resourceDir)) gulp.task "coffee", -> gulp.src("./Resources/**/*.coffee") .pipe(coffee(bare: true)) .pipe(gulp.dest(resourceDir)) gulp.task "tiapp", -> gulp.src(["./tiapp.xml"]) .pipe(gulp.dest(prefix)) gulp.task "precompile", ["js", "coffee", "tiapp"] gulp.task "build", ["precompile"], (done) -> spawn( "./node_modules/.bin/titanium" ["build", "--project-dir", prefix].concat(process.argv) cwd: "./" stdio: "inherit" ) .on("close", done) gulp.task "default", ["build"] DS.RESTAdapter.configure 'plurals', corpus: 'corpora' search: 'searches' cwb_search: 'cwb_searches' metadata_category: 'metadata_categories' App.Adapter = DS.RESTAdapter.extend buildURL: (record, suffix) -> url = @_super(record, suffix) url = "/search_engines#{url}" unless record.search(/_search$/) is -1 url didCreateRecord: (store, type, record, json) -> @_super(store, type, record, json) if record.setupResultPages? root = @rootForType(type) record.setupResultPages(json[root]) didFindRecord: (store, type, payload, id) -> @_super(store, type, payload, id) record = type.find(id) if record.setupResultPages? root = @rootForType(type) record.setupResultPages(payload[root]) # Arrays and hashes should just be passed along to be (de)serialized by the # standard mechanisms. Ember Data does not include these attribute types (yet) # because of complications wrt knowing when an attribute becomes dirty, but we # define them ourselves and just make sure to dirty the object ourselves when # needed. App.Adapter.registerTransform 'array', deserialize: (serialized) -> serialized serialize: (deserialized) -> deserialized App.Adapter.registerTransform 'hash', deserialize: (serialized) -> serialized serialize: (deserialized) -> deserialized class ComputeEventListener extends KDObject constructor:(options = {})-> super interval : options.interval ? 4000 @kloud = KD.singletons.kontrol.getKite name : "kloud" environment : "vagrant" @listeners = [] @tickInProgress = no @running = no @timer = null listen:-> return if @running @running = yes @timer = KD.utils.repeat @getOption('interval'), @bound 'tick' stop:-> return unless @running @running = no KD.utils.killWait @timer addListener:(type, eventId)-> @listeners.push { type, eventId } tick:-> return unless @listeners.length return if @tickInProgress @tickInProgress = yes @kloud.event(@listeners) .then (res)=> log res .catch (err)=> warn "Eventer error:", err @stop() .finally => @tickInProgress = no isActive = (type, inverse = false) -> name = 'is' name = name + 'Not' if inverse name = name + _.capitalize type (view) -> unless view instanceof Spacebars.kw throw new Error "#{name} options must be key value pair such " + "as {{#{name} regex='route/path'}}. You passed: " + "#{JSON.stringify view}" pattern = className: Match.Optional String regex: String check view.hash, pattern route = Router.current().route return false unless route {className, regex} = view.hash className ?= if inverse then 'disabled' else 'active' isPath = true if type is 'path' test = testExp route, regex, isPath test = not test if inverse if test then className else false testExp = (route, exp, isPath = false) -> if isPath pattern = route.path() else pattern = route.name re = new RegExp exp, 'i' re.test pattern helpers = isActiveRoute: isActive 'route' isActivePath: isActive 'path' isNotActiveRoute: isActive 'route', true isNotActivePath: isActive 'path', true Template.registerHelper name, func for own name, func of helpers '.workspace': 'ctrl-shift-9': 'github:toggle-git-panel' 'ctrl-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel' describe "Basic setup", -> it "should add chosen to jQuery object", -> expect(jQuery.fn.chosen).toBeDefined() fs = require 'fs' print = (s) -> fs.write "/dev/stderr", s, 'w' page = new WebPage() page.onConsoleMessage = (msg) -> console.error msg timeoutId = null deferTimeout = -> clearTimeout timeoutId if timeoutId timeoutId = setTimeout -> console.error "Timeout" phantom.exit 1 , 3000 page.open phantom.args[0], -> deferTimeout() setInterval -> tests = page.evaluate -> tests = document.getElementById('qunit-tests')?.children return unless tests for test in tests when test.className isnt 'running' and not test.recorded test.recorded = true if test.className is 'pass' '.' else if test.className is 'fail' 'F' return unless tests for test in tests when test deferTimeout() print test result = page.evaluate -> result = document.getElementById('qunit-testresult') tests = document.getElementById('qunit-tests').children if result.innerText.match /completed/ console.error "" for test in tests when test.className is 'fail' console.error test.innerText console.error result.innerText return parseInt result.getElementsByClassName('failed')[0].innerText return phantom.exit result if result? , 100 'use strict' app = angular.module('holmesApp', [ 'ngCookies', 'ngSanitize', 'ngRoute', 'angularMoment', 'restangular' ]) .config ($routeProvider, RestangularProvider, ConfigConst) -> $routeProvider .when '/', redirectTo: '/domains' .when '/domains', templateUrl: 'views/domains.html' controller: 'DomainsCtrl' .when '/domains/:domainId', templateUrl: 'views/domain.html' controller: 'DomainCtrl' .when '/domains/:domainId/reviews/:reviewId', templateUrl: 'views/reviews.html' controller: 'ReviewsCtrl' .when '/violations/:violationKey', templateUrl: 'views/violation.html' controller: 'ViolationCtrl' .otherwise redirectTo: '/' RestangularProvider.setBaseUrl(ConfigConst.baseUrl) path = require 'path' rek = require 'rekuire' module.exports.config = framework: 'custom' frameworkPath: require.resolve 'protractor-cucumber-framework' # Capabilities to be passed to the webdriver instance. capabilities: 'chromeOptions': args: ['--test-type'] # Disable the "unsupported flag" prompt. See: https://github.com/angular/protractor/issues/835 cucumberOpts: require: [rek.path 'GeneralStepDefs'] tags: [] format: 'pretty' onPrepare: -> # Support a non-angular site browser.ignoreSynchronization = true browser.manage().timeouts().setScriptTimeout 5000 browser.manage().timeouts().implicitlyWait 5000 {View} = require 'atom' # Status bar view for the soft wrap indicator. module.exports = class SoftWrapIndicatorView extends View @content: -> @div class: 'inline-block', => @a 'Wrap', class: 'soft-wrap-indicator', outlet: 'light' # Initializes the view by subscribing to various events. # # statusBar - {StatusBar} of the application initialize: (@statusBar) -> @subscribe @statusBar, 'active-buffer-changed', @update atom.workspace.eachEditor (editor) => @subscribe editor.displayBuffer, 'soft-wrap-changed', @update @subscribe this, 'click', => @getActiveEditor()?.toggleSoftWrap() # Internal: Executes after the view is added to the status bar. afterAttach: -> @update() # Gets the currently active `Editor`. # # Returns the {Editor} that is currently active or `null` if there is not one active. getActiveEditor: -> atom.workspace.getActiveEditor() # Updates the indicator based on the current state of the application. update: => if @getActiveEditor()?.getSoftWrap() @light.addClass('lit').show() else if @getActiveEditor()? @light.removeClass('lit').show() else @light.hide() # Tear down any state and detach. destroy: -> @remove() {View} = require 'atom' ImageEditor = require './image-editor' module.exports = class ImageEditorStatusView extends View @content: -> @div class: 'status-image inline-block', => @span class: 'image-size', outlet: 'imageSizeStatus' initialize: (filePath, image) -> @filePath = filePath @image = image if @filePath and @image @attach() @subscribe atom.workspaceView, 'pane-container:active-pane-item-changed', => editor = atom.workspaceView.getActivePaneItem() if editor instanceof ImageEditor and @filePath is editor.filePath @imageSizeStatus.parent().show() else @imageSizeStatus.parent().hide() @subscribe atom.workspaceView, 'pane:before-item-destroyed', => @detach() attach: -> statusBar = atom.workspaceView.statusBar if statusBar statusBar.appendLeft this @getImageSize() getImageSize: -> imageWidth = @image.width() imageHeight = @image.height() @imageSizeStatus.text("#{imageWidth}px x #{imageHeight}px").show() RenameModel = require './atom-ternjs-rename' RenameView = require './atom-ternjs-rename-view' module.exports = class ViewManager renamePanel: null renameModel: null manager: null constructor: (manager) -> @manager = manager @registerViewProvider() registerViewProvider: -> atom.views.addViewProvider modelConstructor: RenameModel viewConstructor: RenameView showRename: -> if @renamePanel @renamePanel.show() return @renameModel = new RenameModel(@manager) @renamePanel = atom.workspace.addBottomPanel item: @renameModel hideRename: -> @renamePanel?.hide() @focusEditor() focusEditor: -> editor = atom.workspace.getActiveTextEditor() return unless editor view = atom.views.getView(editor) view?.focus?() fs = require 'fs' path = require 'path' module.exports = list: (archivePath, callback) -> switch path.extname(archivePath) when '.tar' then @listTar(archivePath, callback) when '.gz' then @listGzip(archivePath, callback) when '.zip' then @listZip(archivePath, callback) else callback([]) listZip: (archivePath, callback) -> unzip = require 'unzip' paths = [] fileStream = fs.createReadStream(archivePath) zipStream = fileStream.pipe(unzip.Parse()) zipStream.on 'entry', (entry) -> paths.push(entry.path) entry.autodrain() zipStream.on 'close', -> callback(paths) listGzip: (archivePath, callback) -> if path.extname(path.basename(archivePath, '.gz')) isnt '.tar' callback([]) return zlib = require 'zlib' gzipStream = fs.createReadStream(archivePath).pipe(zlib.createGunzip()) @readTarStream(gzipStream, callback) listTar: (archivePath, callback) -> fileStream = fs.createReadStream(archivePath) @readTarStream(fileStream, callback) readTarStream: (inputStream, callback) -> tar = require 'tar' paths = [] tarStream = inputStream.pipe(tar.Parse()) tarStream.on 'entry', (entry) -> paths.push(entry.props.path) tarStream.on 'end', -> callback(paths) # Tub class YAML = require 'yamljs' class TubConfig constructor: (tub, appdir, yml) -> # body... @dir = appdir @tub = tub @file = "#{@dir}/.jakhu/#{@tub}tub_config.yml" @yml = yml @yaml = {} fs.openSync @file create: (args) -> # body... @yaml.name = @tub @yaml.language = @yml.language @yaml.dir = "/app" @yaml.app = @yml.name write: (args) -> # body... @sy = YAML.stringify(@yaml) fs.appendFileSync @file, @sy genTubConfig = (tub, appdir, yml) -> # body... tc = new TubConfig(tub, appdir, yml) tc.create() tc.write() module.exports = {genTubConfig: genTubConfig} # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ $ -> animateMetric = $(".metric-box strong").each -> $this = $(this) starting_point = 0 $target_count = parseInt($this.text().replace(/\,/g, '')) # set the test to 0 $this.counter = starting_point tween = createjs.Tween.get($this).to( {counter: $target_count}, 2000 , createjs.Ease.quintOut) tween.addEventListener 'change', (event) -> $this.text(Math.round($this.counter).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")) return # For more information see: http://emberjs.com/guides/routing/ ETahi.Router.map ()-> @route('flow_manager') @resource 'paper', { path: '/papers/:paper_id' }, -> @route('edit') @route('manage') @route('submit') @route('task', {path: '/papers/:paper_id/tasks/:task_id'}) @route('paper_new', { path: '/papers/new' }) @route('signin', {path: '/users/sign_in'}) @route('signup', {path: '/users/sign_up'}) @route('profile', {path: '/profile'}) @resource('affiliation') @resource('author') @resource 'admin', -> @resource 'journal', path: '/journals/:journal_id', -> @resource 'manuscript_manager_template', path: '/manuscript_manager_templates', -> @route('new') @route('edit', path: '/:template_id/edit') ETahi.Router.reopen rootURL: '/' location: 'history' describe 'Indie', -> Validate = require('../lib/validate') Indie = require('../lib/indie') indie = null beforeEach -> indie?.dispose() indie = new Indie({}) describe 'Validations', -> it 'just cares about a name', -> linter = {} Validate.linter(linter, true) expect(linter.name).toBe(null) linter.name = 'a' Validate.linter(linter, true) expect(linter.name).toBe('a') linter.name = 2 expect -> Validate.linter(linter, true) .toThrow() describe 'constructor', -> it 'sets a scope for message registry to know', -> expect(indie.scope).toBe('project') angular.module("doubtfire.common.pdf-viewer", []) .directive('pdfViewer', -> restrict: 'E' templateUrl: 'common/pdf-panel/pdf-panel.tpl.html' scope: pdfUrl: '=' controller: ($scope, $sce, $timeout) -> $scope.isSafari = navigator.userAgent.indexOf("Safari") > 0 && navigator.userAgent.indexOf("Chrome") == -1 # Watch the URL, and hide the view if it hasn't loaded $scope.$watch 'pdfUrl', (newUrl) -> return unless newUrl? $scope.shouldShowIframe = false # Add a timeout to reset the iframe $timeout (nowLoading) -> $scope.shouldShowIframe = true $scope.googleDocsUrl = $sce.trustAsResourceUrl "https://docs.google.com/gview?url=#{newUrl}&embedded=true" ) # modules Game = require '../models/game' # CONTROLLER # ---------- module.exports = (app) -> # GET /api/games app.get '/api/games/', 'games.list', (req, res) -> list = [] Game.findAll().then (games) -> list.push formatGame(game) for game in games res.json list # GET /api/games/:id app.get '/api/games/:id', 'games.get', (req, res) -> res.findOrFail Game, req.params.id, (game) -> res.json formatGame(game) # METHODS # ------- formatGame = (game) -> result = game return result import * as Preact from 'preact' VNode = Preact.h('a', null).constructor export createElement = (element, props, children...) -> if props? && (Array.isArray(props) || typeof props != 'object' || props instanceof VNode) children.unshift props props = {} Preact.h element, props, ...children export class Component extends Preact.Component constructor: -> super() noflo = require 'noflo' unless noflo.isBrowser() chai = require 'chai' unless chai ReadFile = require '../components/ReadFile.coffee' else ReadFile = require 'noflo-browserfile/components/ReadFile.js' describe 'ReadFile component', -> c = null ins = null out = null beforeEach -> c = ReadFile.getComponent() ins = noflo.internalSocket.createSocket() out = noflo.internalSocket.createSocket() c.inPorts.in.attach ins c.outPorts.out.attach out describe 'when instantiated', -> it 'should have an input port', -> chai.expect(c.inPorts.in).to.be.an 'object' it 'should have an output port', -> chai.expect(c.outPorts.out).to.be.an 'object' # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.table-edit atom-text-editor': 'enter': 'core:confirm' 'ctrl-enter': 'editor:newline' 'tab': 'table-edit:move-right' 'shift-tab': 'table-edit:move-left' 'ctrl-tab': 'editor:indent' '.platform-darwin': 'ctrl-g': 'go-to-line:toggle' '.platform-win32': 'ctrl-g': 'go-to-line:toggle' '.platform-linux': 'ctrl-i': 'go-to-line:toggle' '.go-to-line .mini.editor input': 'enter': 'core:confirm', 'escape': 'core:cancel' '.platform-darwin .go-to-line .mini.editor input': 'cmd-w': 'core:cancel' '.platform-win32 .go-to-line .mini.editor input': 'ctrl-w': 'core:cancel' '.platform-linux .go-to-line .mini.editor input': 'ctrl-w': 'core:cancel' define ['lib/amd/Backbone','neo4j/webadmin/modules/databrowser/views/PropertyContainerView'], (Backbone, PropertyContainerView) -> describe "PropertyContainerView", -> it "recognizes non-quoted strings as strings", -> pcv = new PropertyContainerView(template:null) expect(pcv.shouldBeConvertedToString "a").toBe(true) expect(pcv.shouldBeConvertedToString "åäö").toBe(true) expect(pcv.shouldBeConvertedToString "åäö #$ asd ").toBe(true) expect(pcv.shouldBeConvertedToString ";åäö #$ asd ").toBe(true) expect(pcv.shouldBeConvertedToString "1").toBe(false) expect(pcv.shouldBeConvertedToString "12").toBe(false) expect(pcv.shouldBeConvertedToString "12.523").toBe(false) expect(pcv.shouldBeConvertedToString "['1','2','3']").toBe(false) expect(pcv.shouldBeConvertedToString "[1,2,3]").toBe(false) expect(pcv.shouldBeConvertedToString '"a quoted string"').toBe(false) Neighborly.Users ?= {} Neighborly.Users.Payments = modules: -> [] init: Backbone.View.extend el: '.user-payments-content' initialize: -> $accounts = $(".account-method") for account in $accounts $account = $(account) if $account.data('path') $.get($account.data('path')).success (data) => $account.html data Initjs.initializePartial() 'context-menu': '.tree-view': 'Add file': 'tree-view:add' {View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => @appendToEditorPane(rootView, editor) if editor.attached @appendToEditorPane: (rootView, editor) -> if underlayer = editor.find('.underlayer') underlayer.append(new WrapGuideView(editor)) @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) => @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', "#{columnWidth}px").show() else @hide() else @hide() express = require('express') module.exports = -> router = express.Router() router.get '/framestream', (req, res) -> req.socket.setTimeout Infinity messageCount = 1 subscriberCount = 0 subscriber = require('./redis_client')() subscriber.subscribe 'updates' subscriber.on 'error', (err) -> console.error('Redis Error: ' + err) subscriber.on 'subscribe', (err) -> subscriberCount++ subscriber.on "message", (channel, message) -> messageCount++ res.write 'id: ' + messageCount + '\n' res.write 'data: ' + message + '\n\n' res.writeHead 200, 'Content-Type': 'text/event-stream' 'Cache-Control': 'no-cache' 'Connection': 'keep-alive' res.write '\n' req.on 'close', -> subscriberCount-- subscriber.unsubscribe() subscriber.quit() router #= require env #= require jquery #= require jquery/jquery-migrate #= require jquery/jquery.cookies.js #= require i18n.js #= require bootstrap #= require bootstrap-select #= require custom-bootstrap.js.coffee #= require function #= require map-overlay.js #= require handlebars #= require ember #= require ember-data #= require spin #= require leaflet/leaflet-src #= require leaflet/leaflet.locate #= require ember-leaflet #= require jquery/jquery.magnific-popup.js #= require responsive-popover #= require dropzone #= require_self #= require wheelmap I18n.defaultLocale = 'de' I18n.locale = $('html').attr('lang') I18n.fallbacks = true Ember.Application.reopen # Transition end event customEvents: (()-> customEvents = {} if $.support.transition? customEvents[$.support.transition.end] = 'transitionEnd' customEvents ).property() Wheelmap = @Wheelmap = Ember.Application.create # LOG_TRANSITIONS: true rootElement: '#wheelmap' DS.RESTAdapter.reopen buildURL: (type, id)-> # Needed for not having wrong cached urls @_super(type, id) + '.json' Wheelmap.Router.reopen rootURL: '/map/' class @Overlay constructor: (contentSelector, options) -> @contentSelector = contentSelector @options = options || {} defaults = domType: OverlayDomWrapper dimensionsType: OverlayDimensions @options = $.extend(defaults, @options) @dom = new @options.domType() $('body').append(@dom.el).append(@dom.mask) @createDimensions = -> new @options.dimensionsType(@originalContent) open: (target) -> @prepareOpen(target) @setDimensions() @show() prepareOpen: (target = document) -> @dom.mask.show() @lockScroll() @originalContent = $(target).find(@contentSelector) @overlayContent = @originalContent.clone() @dom.el.append(@overlayContent) @dimensions = @createDimensions() setDimensions: -> @dom.el.css('left', @dimensions.margin()) @dom.el.css('top', @dimensions.top()) @dom.el.width(@dimensions.width()) @dom.closeButton().css('left', @dimensions.closeButtonLeftPosition()) show: -> @overlayContent.show() @dom.el.show() @overlayContent.trigger('overlay:show') setMaskHeight: -> @dom.mask.height($(document).height()) lockScroll: -> $('body').addClass('scroll-lock') unless window.mobileLayout() close: -> @dom.el.empty().hide() @dom.mask.hide() $('body').removeClass('scroll-lock') #= require ./abstract_binding class Batman.DOM.RouteBinding extends Batman.DOM.AbstractBinding onAnchorTag: false onlyObserve: Batman.BindingDefinitionOnlyObserve.Data @accessor 'dispatcher', -> @view.lookupKeypath('dispatcher') || Batman.App.get('current.dispatcher') bind: -> if (@node.nodeName is 'A' || @node.nodeName is 'a') @onAnchorTag = true super return if @onAnchorTag && @node.getAttribute('target') Batman.DOM.events.click(@node, @routeClick) routeClick: (node, event) => return if event.__batmanActionTaken event.__batmanActionTaken = true params = @pathFromValue(@get('filteredValue')) Batman.redirect(params) if params? dataChange: (value) -> if value path = @pathFromValue(value) if @onAnchorTag if path and Batman.navigator path = Batman.navigator.linkTo(path) else path = "#" @node.href = path pathFromValue: (value) -> if value if value.isNamedRouteQuery value.get('path') else @get('dispatcher')?.pathFromParams(value) Trix.galleryFilter = (snapshot) -> filter = new Filter snapshot filter.perform() filter.getSnapshot() class Filter constructor: (snapshot) -> {@document, @selectedRange} = snapshot perform: -> @removeGalleryAttribute() @applyGalleryAttribute() getSnapshot: -> {@document, @selectedRange} # Private removeGalleryAttribute: -> for range in @findRangesOfGalleryBlocks() @document = @document.removeAttributeAtRange("gallery", range) applyGalleryAttribute: -> offset = 0 for range in @findRangesOfGalleryPieces() when range[1] - range[0] > 1 range[0] += offset range[1] += offset unless @document.getCharacterAtPosition(range[1]) is "\n" @document = @document.insertBlockBreakAtRange(range[1]) offset++ unless range[0] is 0 unless @document.getCharacterAtPosition(range[0] - 1) is "\n" @document = @document.insertBlockBreakAtRange(range[0]) offset++ @document = @document.applyBlockAttributeAtRange("gallery", true, range) findRangesOfGalleryBlocks: -> @document.findRangesForBlockAttribute("gallery") findRangesOfGalleryPieces: -> @document.findRangesForTextAttribute("presentation", withValue: "gallery") React = require 'react' BS = require 'react-bootstrap' MESSAGES = { student: [

      Tutor shows your weakest topics so you can practice to improve.

      Try to get all of your topics to green!

      ] teacher: [

      Tutor shows the weakest topics for each period.

      Students may need your help in those areas.

      ] teacher_student: [

      Tutor shows the weakest topics for the student.

      They may need your help in those areas.

      ] } module.exports = React.createClass displayName: 'LearningGuideInfoLink' type: React.PropTypes.oneOf(['student', 'teacher', 'teacher_student']).isRequired render: -> tooltip =

      The performance forecast is an estimate of your understanding of a topic.

      It is personalized display based on your answers to reading questions, homework problems, and previous practices.

      {MESSAGES[@props.type]}
      # ************************************* # # Application # -> Manifest # # ************************************* # ------------------------------------- # Namespace # ------------------------------------- #= require presenter # ------------------------------------- # Routes # ------------------------------------- #= require routes # ------------------------------------- # Services # ------------------------------------- #= require services/progress #= require services/hotkeys # ------------------------------------- # Directives # ------------------------------------- #= require directives/progress #= require directives/slideLoader #= require directives/slides #= require directives/slide #= require directives/ytVideo jQuery ($) -> if window.location.hash is '' window.location = '/#/' data = metrics: anon: colour: 'orange', number: 'loading...', title: 'Anonymous Visitors' , normal: colour: 'blue', number: 'loading...', title: 'Normal Visitors' , premium: colour: 'green', number: 'loading...', title: 'Premium Visitors' source = $('#metric-block-template').html() template = Handlebars.compile source $('.metric-channel-blocks').html template(data) socket = io.connect "http://#{window.location.hostname}" socket.emit 'ready' socket.on 'metric', (payload) -> for key of payload.metrics data.metrics[key].number = payload.metrics[key] $('.metric-channel-blocks').html template(data) MinimapSelectionView = require './minimap-selection-view' module.exports = active: false views: {} activate: (state) -> try atom.packages.activatePackage('minimap').then (minimapPackage) => @minimap = minimapPackage.mainModule return @deactivate() unless @minimap.versionMatch('>= 3.5.0') @minimap.registerPlugin 'selection', this catch @deactivate deactivate: -> @minimap.unregisterPlugin 'selection' @minimap = null isActive: -> @active activatePlugin: -> return if @active @active = true @subscription = @minimap.observeMinimaps (o) => minimap = o.view ? o selectionView = new MinimapSelectionView(minimap) @views[minimap.getTextEditor().id] = selectionView deactivatePlugin: -> return unless @active view.destroy() for id,view of @views @active = false @views = {} @subscription.off() FS = require 'fs' Q = require 'q' ### Class for generating JSON product type representations from CSV files. ### class ProductTypeGenerator _options = {} constructor: (options = {}) -> @_options = options ### Creates sphere product type representation files using JSON format. @param {array} types Entire types CSV as an array of records. @param {array} attributes Entire attributes CSV as an array of records. @param {function} callback The callback function to be invoked when the method finished its work. @return Result of the given callback ### run: (types, attributes, callback) -> callback true module.exports = ProductTypeGeneratorImport = require '../lib/import' CONS = require '../lib/constants' fs = require 'fs' argv = require('optimist') .usage('Usage: $0 --projectKey key --clientId id --clientSecret secret --csv file --language lang --publish') .default('lang', 'en') .describe('projectKey', 'your SPHERE.IO project-key') .describe('clientId', 'your OAuth client id for the SPHERE.IO API') .describe('clientSecret', 'your OAuth client secret for the SPHERE.IO API') .describe('csv', 'CSV file containing products to import') .describe('language', 'Default language to using during import') .describe('publish', 'When given, all changes will be published immediately') .demand(['projectKey', 'clientId', 'clientSecret', 'csv']) .argv timeout = argv.timeout timeout or= 60000 CONS.DEFAULT_LANGUAGE = argv.language options = config: project_key: argv.projectKey client_id: argv.clientId client_secret: argv.clientSecret timeout: timeout show_progress: true importer = new Import options importer.publishProducts = argv.publish fs.readFile argv.csv, 'utf8', (err, content) -> if err console.error "Problems on reading file '#{argv.csv}': " + err process.exit 2 importer.import content, (result) -> console.log result.message process.exit 0 if result.status is true process.exit 1Page = require 'controllers/page' Api = require 'zooniverse/lib/api' class HomePage extends Page el: $('.home') className: 'home' template: require 'views/home' elements: '.participants': 'participants' '.images': 'images' constructor: -> super @html @template Api.current.get '/projects/spacewarp', (project) => @participants.html @formatNumber project.user_count @images.html @formatNumber project.classification_count formatNumber: (n) -> n.toString().replace /(\d)(?=(\d{3})+(?!\d))/g, '$1,' module.exports = HomePage# Description: # To create something that's… that's genuinely new, # you have to… to start again. # # Dependencies: # None # # Configuration: # None # # Commands: # - Display an Ive # # Author: # arbales ives = [ "http://www.blogcdn.com/www.engadget.com/media/2012/03/jony-ive-10-20-09.jpg", "http://betanews.com/wp-content/uploads/media/60/6057.png", "http://www.socialgazelle.com/wp-content/uploads/2012/05/jonathan-ive.jpg", "http://www3.pcmag.com/media/images/238530-jonathan-ive.jpg", "http://farm5.static.flickr.com/4089/5213864251_6a686844ca.jpg", "http://www.ipadforums.net/wallpapers/data/500/jonathan_ive.JPG", "http://www.wearesuperfamous.com/wp-content/jonny_ive11.jpg" ] module.exports = (robot) -> robot.hear /.*(essential|elegant|efficient|experience|incredible|meticulous|unibody|from the ground up).*/i, (msg) -> msg.send msg.random ives {Tool} = require './base' {createShape} = require '../core/shapes' module.exports = class Pan extends Tool name: 'Pan' iconName: 'pan' usesSimpleAPI: false didBecomeActive: (lc) -> unsubscribeFuncs = [] @unsubscribe = => for func in unsubscribeFuncs func() unsubscribeFuncs.push lc.on 'lc-pointerdown', ({rawX, rawY}) => @oldPosition = lc.position @pointerStart = {x: rawX, y: rawY} unsubscribeFuncs.push lc.on 'lc-pointerdrag', ({rawX, rawY}) => dp = { x: (rawX - @pointerStart.x), y: (rawY - @pointerStart.y) } lc.setPan(@oldPosition.x + dp.x, @oldPosition.y + dp.y) willBecomeInactive: (lc) -> @unsubscribe() 'atom-workspace': 'cmd-shift-c': 'git:toggle-git-panel' '.git-StagingView': 'left': 'git:focus-diff-view' '.git-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'git:commit' 'ctrl-enter': 'git:commit' '.git-FilePatchView': '/': 'git:toggle-patch-selection-mode' 'tab': 'git:select-next-hunk' 'shift-tab': 'git:select-previous-hunk' 'right': 'git:focus-git-panel' '.git-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel' Meteor.startup -> Migrations.add version: 7 up: -> console.log 'Populate urls in messages' query = ChatMessage.find({ 'urls.0': { $exists: true }, urls: { $type: 2 } }) count = query.count() query.forEach (message, index) -> console.log "#{index + 1} / #{count}" message.urls = message.urls.map (url) -> if _.isString url return {url: url} return url OEmbed.RocketUrlParser message console.log 'End' class Link constructor: (@page, @$link) -> allows_process: (event) -> !(this._cross_origin_link(event.currentTarget) || this._non_standard_click(event)) process: -> type = if (@$link.data('push') == 'partial') 'partial' else 'template' @page.load(@$link.attr("href"), @$link.data('target'), type) # We split host because IE returns host with port and other browsers not # _cross_origin_link: (link) -> (location.protocol != link.protocol) || (location.host.split(':')[0] != link.host.split(':')[0]) _non_standard_click: (event) -> event.metaKey || event.ctrlKey || event.shiftKey || event.altKey window._Wiselinks = {} if window._Wiselinks == undefined window._Wiselinks.Link = Link# Secure version of the ledger.storage.ChromeStore. This store uses AES encryption for storing keys and data class @ledger.storage.SecureStore extends ledger.storage.ChromeStore # @param [String] name The store name # @param [String] key The secure key used to encrypt and decrypt data with AES constructor: (name, key) -> super(name) @_aes = new ledger.crypto.AES(key) @_hasCalledKeys = no @_keysCache = [] # @see Store.keys keys: (cb) -> if @_hasCalledKeys _.defer => cb?(@_keysCache) else super (encrypted_keys) => @_keysCache = _.uniq(@_keysCache.concat(_.compact(Try(=> @_aes.decrypt(encrypted_key)).orNull() for encrypted_key in encrypted_keys))) @_hasCalledKeys = yes cb?(@_keysCache) _preprocessKey: (key) -> super(@_aes.encrypt(key)) _deprocessKey: (raw_key) -> key = Try(=> @_aes.decrypt(super(raw_key))).orNull() @_keysCache.push key unless _(@_keysCache).contains(key) key _preprocessValue: (value) -> Try(=> @_aes.encrypt(super(value))).orNull() _deprocessValue: (raw_value) -> Try(=> super(@_aes.decrypt(raw_value))).orNull() $( -> $('a.pdf-languages-trigger').click -> $(this).toggleClass 'active' $('.download-languages').toggleClass 'active' categories = [ { href: '#tab-essentials-content', contentSelector: '.tab-essentials-content', anchorSelector: '[href="#tab-essentials-content"]' } { href: '#tab-useful-content', contentSelector: '.tab-useful-content', anchorSelector: '[href="#tab-useful-content"]' } { href: '#tab-personal-content', contentSelector: '.tab-personal-content', anchorSelector: '[href="#tab-personal-content"]' } ] showActive categories window.onhashchange = -> showActive categories )$ -> $("#slider").slider value: 1 min: 1 max: 3 slide: (event, ui) -> num = ui.value+1 verbosity = while num -= 1 then 'v' $("#job_verbosity").val verbosity.join('') if $('#job-results').size() > 0 div = $ '#job-results' project_id = div.data 'project_id' job_id = div.data 'job_id' get_job_status = -> $.getJSON "/projects/#{project_id}/jobs/#{job_id}", (data) -> if data.results == null setTimeout get_job_status, 3000 else div.removeClass('hide').html data.results title = div.siblings('h3') title.find('img').remove() text = title.text().replace /Running/, 'Task' text = text.replace /\.\.\./, 'completed' title.text text $('.alert-message').remove() if data.success $('.tabs .pull-right').html 'SUCCESS' else $('.tabs .pull-right').html 'FAILED' setTimeout get_job_status, 3000 ".source.viml": editor: commentStart: '" ' #= require clipboard $ -> clipboard = new Clipboard '.js-clipboard-trigger', text: (trigger) -> $target = $(trigger.nextElementSibling || trigger.previousElementSibling) $target.data('clipboard-text') || $target.text().trim() clipboard.on 'success', (e) -> $(e.trigger). tooltip(trigger: 'manual', placement: 'auto bottom', title: 'Copied!'). tooltip('show') # Clear the selection and blur the trigger so it loses its border e.clearSelection() $(e.trigger).blur() # Manually hide the tooltip after 1 second setTimeout(-> $(e.trigger).tooltip('hide') , 1000) define (require) -> Backbone = require('backbone') settings = require('cs!settings') SEARCH_URI = "#{location.protocol}//#{settings.cnxarchive.host}:#{settings.cnxarchive.port}/search" return class SearchResults extends Backbone.Model url: () -> "#{SEARCH_URI}#{@query}" defaults: query: limits: [] sort: [] results: items: [] total: 0 initialize: (options = {}) -> @query = options.query or '' @fetch success: () => @set('loaded', true) parse: (response, options) -> response = super(arguments...) authors = new Backbone.Collection() _.each response.results.limits, (limit) -> if limit.author then authors.add(limit.author) _.each response.results.items, (item) -> _.each item.authors, (author, index) -> item.authors[index] = authors.get(author).toJSON() return response class PanelView extends HTMLElement constructor: -> module.exports = PanelView_ = require 'underscore' sd = require('sharify').data Backbone = require 'backbone' Artworks = require '../../../collections/artworks.coffee' LayeredSearchView = require('./layered-search.coffee').LayeredSearchView SaleView = require './sale.coffee' module.exports = class BelowTheFold extends Backbone.View initialize: (options) -> { @saved, @artwork } = options $.when.apply(null, @artwork.fetchRelatedCollections()).then => # Find the first related collection that has any results availableFeature = _.find @artwork.relatedCollections, (xs) -> xs.length if availableFeature @["setup#{availableFeature.kind}"]() else # Always fallback to layered search if there are no features available @setupLayeredSearch() setupLayeredSearch: -> new LayeredSearchView el: @$el, artwork: @artwork @done() setupSales: -> new SaleView el: @$el, sale: @artwork.sales.first(), saved: @saved @done() setupFairs: -> throw 'I don\'t know how to do this yet!' setupShows: -> throw 'I don\'t know how to do this yet!' done: -> @$el.attr 'data-state', 'fade-in' module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: 'src' src: ['*.coffee'] dest: 'lib' ext: '.js' coffeelint: options: max_line_length: level: 'ignore' src: ['src/**/*.coffee'] test: ['spec/**/*.coffee'] cpplint: files: ['src/**/*.cc'] reporter: 'spec' verbosity: 1 filters: build: include: false namespaces: false legal: copyright: false readability: braces: false shell: rebuild: command: 'npm build .' options: stdout: true stderr: true failOnError: true test: command: 'jasmine-focused --captureExceptions --coffee spec/' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('node-cpplint') grunt.registerTask('lint', ['coffeelint', 'cpplint']) grunt.registerTask('default', ['lint', 'coffee', 'shell:rebuild']) grunt.registerTask('test', ['default', 'shell:test']) grunt.registerTask 'clean', -> rm = require('rimraf').sync rm('lib') rm('build') {$$} = require 'space-pen' SelectList = require 'select-list' $ = require 'jquery' _ = require 'underscore' module.exports = class CommandPaletteView extends SelectList @activate: (rootView) -> @instance = new CommandPaletteView(rootView) @viewClass: -> "#{super} command-palette" filterKey: 'eventDescription' previouslyFocusedElement: null keyBindings: null initialize: (@rootView) -> @command 'command-palette:toggle', => @cancel() false super attach: -> super @keyBindings = _.losslessInvert(keymap.bindingsForElement(@previouslyFocusedElement)) events = [] for eventName, eventDescription of _.extend($(window).events(), @previouslyFocusedElement.events()) events.push({eventName, eventDescription}) if eventDescription events = _.sortBy events, (e) -> e.eventDescription @setArray(events) @appendTo(@rootView) @miniEditor.setText('') @miniEditor.focus() itemForElement: ({eventName, eventDescription}) -> keyBindings = @keyBindings $$ -> @li class: 'event', 'data-event-name': eventName, => @div eventDescription, class: 'event-description' @div class: 'right', => @div eventName, class: 'event-name' for binding in keyBindings[eventName] ? [] @div binding, class: 'key-binding' @div class: 'clear-float' confirmed: ({eventName}) -> @cancel() @previouslyFocusedElement.trigger(eventName) cancelled: -> React = require 'react' ReactDOM = {render} = require 'react-dom' {Router, Route, Link} = require 'react-router' createBrowserHistory = require 'history/lib/createBrowserHistory' routes = require './router' routes = require './router' history = createBrowserHistory() if process.env.NON_ROOT isnt 'true' and window.location? and window.location.hash isnt "" window.location.pathname = window.location.hash.slice(1) history.listen (location) -> window.dispatchEvent new CustomEvent 'locationchange' location = if process.env.NON_ROOT == "true" null else Router.HistoryLocation render {routes}, document.getElementById('panoptes-main-container') logDeployedCommit = require './lib/log-deployed-commit' logDeployedCommit() "*": "exception-reporting": userId: "30e6f2d0-42d3-ab77-4984-dde4c431f019" welcome: showOnStartup: false core: {} editor: invisibles: {} fontFamily: "Hack" autosave: enabled: true "git-diff": showIconsInEditorGutter: true "ruby-test": testFramework: "minitest" rspecAllCommand: "vagrant ssh -c \"rspec --tty spec\"" rspecFileCommand: "vagrant ssh -c \"rspec --tty {relative_path}\"" rspecSingleCommand: "vagrant ssh -c \"rspec --tty {relative_path}:{line_number}\"" "git-blame": {} globals = require 'globals' module.exports = getOperation : (current, selected) -> arr = [ @planTitle.FREE @planTitle.HOBBYIST @planTitle.DEVELOPER @planTitle.PROFESSIONAL ] current = arr.indexOf current selected = arr.indexOf selected return switch when selected > current then @operation.UPGRADE when selected is current then @operation.INTERVAL_CHANGE when selected < current then @operation.DOWNGRADE planInterval: MONTH : 'month' YEAR : 'year' planTitle: FREE : 'free' HOBBYIST : 'hobbyist' DEVELOPER : 'developer' PROFESSIONAL : 'professional' provider: STRIPE : 'stripe' PAYPAL : 'paypal' KODING : 'koding' operation: UPGRADE : 1 INTERVAL_CHANGE : 0 DOWNGRADE : -1 FAILED_ATTEMPT_LIMIT: 3 TOO_MANY_ATTEMPT_BLOCK_KEY: 'BlockForTooManyAttempts' TOO_MANY_ATTEMPT_BLOCK_DURATION: globals.config.paymentBlockDuration error: ERR_USER_NOT_CONFIRMED: 'You need to confirm your email to purchase a Koding subscription.' events: WORKFLOW_STARTED: 'workflowStarted' WORKFLOW_COULD_NOT_START: 'workflowCouldNotStart' "*": core: telemetryConsent: "limited" themes: [ "one-light-ui" "one-light-syntax" ] editor: fontFamily: "'SF Mono', Menlo, Consolas, DejaVu Sans Mono, monospace" fontSize: 12 lineHeight: 1.7 "one-dark-ui": tabCloseButton: "Left" "one-light-ui": tabCloseButton: "Left" 'exception-reporting': 'userId': 'ee24cf00-f793-9081-be2a-2cdae5536b7f' 'release-notes': 'viewedVersion': '0.64.0' 'welcome': 'showOnStartup': false 'metrics': 'userId': '51eeb6113c1ae801c9aade9b6d679aa5189ced25' 'editor': 'fontFamily': 'Source Code Pro' 'fontSize': 14 'preferredLineLength': 100 'showInvisibles': true 'core': 'projectHome': '/Volumes/Data/Users/Lee/Source' 'themes': [ 'atom-dark-ui' 'railscasts-syntax' ] 'ignoredNames': [ '.git' '.svn' '.DS_Store' ] 'disabledPackages': [] 'whitespace': 'ensureSingleTrailingNewline': true 'auto-copyright': 'owner': 'Lifted Studios' module.exports = class BroadcastTarget editor: null listener: null isMarkdownPreview: false constructor: -> @editor = atom.workspace.activePaneItem @isMarkdownPreview = @editor[0]? @editor.on 'markdown-preview:markdown-changed', => @listener?() setListener: (listener) -> @listener = listener getContent: -> return if @isMarkdownPreview then @getMarkdownPreviewContent() else @getOtherContent() getMarkdownPreviewContent: -> content = @editor[0].outerHTML if atom.config.get 'broadcast.getEmojisFromCheatSheetSite' content = content.replace /[\w-\.\/]+pngs/g, @urlToCheatSheetSite else content = content.replace /[\w-\.\/]+node_modules\/roaster\/node_modules/g, '' getOtherContent: -> content = @editor.getText?() return '
      ' + content + '
      ' class Workbench.Views.SensorMapView extends Backbone.Marionette.ItemView template: false initialize: -> @zoom = 13 onDestroy: -> @map.remove() if @map onShow: -> if @el.id is "" console.warn "No Map Element" else @location = [@model.get("latitude"), @model.get("longitude")] @map = L.map(@el.id).setView(@location, @zoom) L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: t('map.attribution') }).addTo(@map) L.marker(@location).addTo(@map) Species.TaxonConceptDocumentsRoute = Ember.Route.extend renderTemplate: -> @getDocuments() @render('taxon_concept/documents') getDocuments: -> model = this.modelFor("taxonConcept") $.ajax( url: "/api/v1/documents?taxon_concept_id=" + model.get('id'), success: (data) -> model.set('cites_cop_docs', data.cites_cop_docs) model.set('ec_srg_docs', data.ec_srg_docs) model.set('cites_ac_docs', data.cites_ac_docs) model.set('cites_pc_docs', data.cites_pc_docs) model.set('other_docs', data.other_docs) error: (jqXHR, textStatus, errorThrown) -> console.log("AJAX Error:" + textStatus) ) Link = require('react-router').Link module.exports = React.createClass displayName: 'HelloWorld' render: ->

      Hello world!

      You're looking at the Coffeescript React Quickstart project by Kyle Mathews.

      It has a number of nice goodies included like:

      • Full Coffeescript support provided by coffee-react-transform
      • Live reloading for both CSS and Javascript! This really speeds up your development. Live reload of Javascript enabled by the react-hot-loader project.
      • Gulpfile with both development and production tasks to simplify building your project.
      • Starter Sass project with sensible defaults. Check them out on the styleguide page
      'name': 'Weave.jl markdown' scopeName: 'source.weave.md' 'fileTypes': [ 'jmd' 'jmdw' 'mdw' ] patterns: [ { 'include' : 'source.weave.noweb' } { 'begin': '^([`~]{3,})(\\{|\\{\\.|)(julia)(;|)\\s*(.*?)(\\}|)\\s*$' 'beginCaptures': '1': 'name': 'markup.heading.weave.md' '3': 'name': 'markup.bold.weave.md' '5': 'contentName' : 'source.embedded.julia' 'patterns': [ { 'include': 'source.julia' } ] 'end': '^[`~]{3,}\\s*$' 'endCaptures': '0': 'name': 'markup.heading.weave.md' 'contentName': 'source.embedded.julia' 'patterns': [ { 'include': 'source.julia' } ] } { 'include': 'source.gfm' } { 'include': 'text.md' } ] angular.module('admin.payments').directive "stripeElements", ($injector, AdminStripeElements) -> restrict: 'E' template: "" scope: selected: "=" link: (scope, elem, attr)-> if $injector.has('stripeObject') stripe = $injector.get('stripeObject') card = stripe.elements().create 'card', hidePostalCode: false style: base: fontFamily: "Roboto, Arial, sans-serif" fontSize: '16px' color: '#5c5c5c' '::placeholder': color: '#6c6c6c' card.mount(elem.find('.card-element').get(0)) # Elements validates user input as it is typed. To help your customers # catch mistakes, you should listen to change events on the card Element # and display any errors: card.addEventListener 'change', (event) -> displayError = elem.find('.card-errors').get(0) if event.error displayError.textContent = event.error.message else displayError.textContent = '' return scope.$watch "selected", (value) -> if (value) AdminStripeElements.stripe = stripe AdminStripeElements.card = card avatarResponder = require('./avatar_responder') Campfire.Transcript.messageTemplates = require('./message_templates') window.Chicisimo = Responders: [] Campfire.USER_ACTIONS = ['enter','leave','kick','conference_created','lock','unlock','topic_change','allow_guests','disallow_guests'] swizzle(Campfire.Message, { authorElement: ($super) -> return $super().select('span.author')[0] if Campfire.USER_ACTIONS.include(this.kind) $super() }) Campfire.Chicisimo = Class.create({ initialize: (chat) -> chat.transcript.messages.forEach(this.executeResponders) chat.layoutmanager.layout() chat.windowmanager.scrollToBottom() ,onMessagesInserted: (messages) -> scrolledToBottom = chat.windowmanager.isScrolledToBottom() messages.forEach(this.executeResponders) chat.windowmanager.scrollToBottom() if scrolledToBottom ,executeResponders: (message) -> Chicisimo.Responders.forEach((responder) -> responder(message) ) }) Chicisimo.Responders.push(avatarResponder) Campfire.Responders.push("Chicisimo") window.chat.installPropaneResponder("Chicisimo", "chicisimo") # tool tips d3panels.tooltip_create = (selection, options) -> selection.append("div") .attr("class", "d3panels-tooltip") .style("opacity", 0) d3panels.tooltip_activate = (objects, tipdiv, options) -> objects.on("mouseover", (d) -> tipdiv.html(d.tooltip) h = tipdiv.node().getBoundingClientRect().height tipdiv.style("left", (d3.event.pageX + d.r*3)+"px") .style("top", (d3.event.pageY - h/2)+"px") .transition() .duration(0) .style("opacity", 0.9)) objects.on("mouseout", (d) -> tipdiv.transition() .duration(1000) .style("opacity", 0)) d3panels.tooltip_destroy = (tipdiv) -> tipdiv.remove() {toggleQuotes} = require 'toggle-quotes' {CompositeDisposable} = require 'atom' module.exports = config: quoteCharacters: type: 'string' default: '"\'' activate: -> @subscriptions.add atom.commands.add 'atom-text-editor', 'toggle-quotes:toggle', -> if editor = atom.workspace.getActiveTextEditor() toggleQuotes(editor) deactivate: -> @subscriptions.dispose() Q = require 'q' # Provides a set of methods for voting data CRUD operations class API constructor: (@db) -> throw "must provide db connection" unless @db createUser: (name) -> # Q.nfcall( # @db.models.User.create, # name: name # ) # @db.models.User.create({ # name: name # }, (err, user) -> deferred = Q.defer() user = new @db.models.User({name: name}) user.save (err) -> if err deferred.reject(new Error(err)) else deferred.resolve(user) deferred.promise incrementVote: -> decrementVote: (voteId) -> listUsers: (userId) -> module.exports = APIkd = require 'kd' nick = require 'app/util/nick' Tracker = require 'app/util/tracker' module.exports = (machine) -> return unless analytics return unless typeof analytics.user is 'function' { initialTurnOn } = analytics.user().traits() return if initialTurnOn initialTurnOn = yes analytics.identify nick(), { initialTurnOn } execute machine execute = (machine) -> track Tracker.BUTTON_CLICKED kd.singletons.computeController.once 'MachineBuilt', (event) -> { machineId } = event return if machineId isnt machine._id track Tracker.MODAL_DISPLAYED track = (action) -> Tracker.track action, { category: Tracker.CATEGORY_TURN_ON_VM } module.exports = configDefaults: showOnRightSideOfStatusBar: false activate: -> atom.workspaceView.command('grammar-selector:show', createGrammarListView) atom.packages.once('activated', createGrammarStatusView) createGrammarListView = -> editor = atom.workspace.getActiveEditor() if editor? GrammarListView = require './grammar-list-view' view = new GrammarListView(editor) view.attach() createGrammarStatusView = -> {statusBar} = atom.workspaceView if statusBar? GrammarStatusView = require './grammar-status-view' view = new GrammarStatusView(statusBar) view.attach() describe "Lanes.Models.Collection", -> it "it triggers promise on loading", (done) -> Model = Lanes.Test.defineModel props: { id: 'integer', title: 'string' } LT.syncSucceedWith([ { id: 1, title: 'first value' } { id: 2, title: 'second value' } ]) collection = Model.where(name: 'foo') expect(collection.requestInProgress).toBeDefined() collection.whenLoaded -> expect( collection.isLoaded() ).toBe(true) done() it "triggers length when changed", -> Model = Lanes.Test.defineModel props: { id: 'integer', title: 'string' } collection = new Model.Collection spy = jasmine.createSpy('onLengthChange') collection.on("change:length", spy) model = collection.add({ id: 1, title: 'first' }) expect(spy).toHaveBeenCalled() spy.calls.reset() collection.remove(model) expect(spy).toHaveBeenCalled() spy.calls.reset() collection.reset([{ id:11, title: 'last'}]) expect(spy).toHaveBeenCalled() microflo = (target) -> build = [ "make -f ./node_modules/microflo-emscripten/Makefile" target "BUILD_DIR=build" "MICROFLO=./node_modules/.bin/microflo" "GRAPH=graph.fbp" "MICROFLO_SOURCE_DIR=`pwd`/node_modules/microflo/microflo" "LIBRARY=`pwd`/components/arduino-standard.json" ] return build.join ' ' module.exports = -> # Project configuration @initConfig # lint coffeelint: code: files: src: ['lib/*.coffee', 'spec/*.coffee'] options: max_line_length: value: 100 level: 'warn' no_trailing_semicolons: level: 'warn' # TODO: Browser build exec: microflo_emscripten: microflo "build-emscripten" mochaTest: nodejs: src: ['spec/*.coffee'] options: reporter: 'spec' require: 'coffee-script/register' grep: process.env.TESTS # Grunt plugins used for building @loadNpmTasks 'grunt-exec' # Grunt plugins used for testing @loadNpmTasks 'grunt-mocha-test' # Our local tasks @registerTask 'build', [ 'exec:microflo_emscripten' ] @registerTask 'test', [ 'build' 'mochaTest' ] @registerTask 'default', ['test'] module.exports = current: 'ami-bf235ad5' # Ordered by creation date list: [ 'ami-5dd50436' 'ami-bf235ad5' ] #= require ./abstract_binding class Batman.DOM.ViewBinding extends Batman.DOM.AbstractBinding skipChildren: true onlyObserve: Batman.BindingDefinitionOnlyObserve.Data constructor: (definition) -> @superview = definition.view super dataChange: (viewClassOrInstance) -> return unless viewClassOrInstance? if viewClassOrInstance.isView @view = viewClassOrInstance else @view = new viewClassOrInstance @yieldName = "<#{@view.constructor.name}-#{@view._batmanID()}>" @superview.declareYieldNode(@yieldName, @node) @superview.subviews.set(@yieldName, @view) die: -> @superview.unset(@yieldName) @superview = null @view = null super ValidationMixin = getInitialState: -> validationErrors: [] hasErrors: false componentDidMount: -> if @props.validators @loadValidators() loadValidators: -> @validators = _.map @props.validators, (options, name) => new window.validators[name].constructor(options) validate: (value, callback) -> if @props.validators newErrors = _.map @validators, (validator) => validator.validate value, @props.displayName # There is probably a better way to do this newErrors = _.flatten newErrors newErrors = _.without newErrors, null, undefined @setState validationErrors: newErrors hasErrors: (newErrors.length != 0) , callback() else callback() if callback module.exports = ValidationMixin$ -> $('#currency').change -> $.ajax( type: 'POST' url: $(this).data('href') data: currency: $(this).val() ).done -> window.location.reload() # Copyright 2012 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:#www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ##core/zone # # Provides a default handler for the `events.zone.update` event, attached to the # document body. define ["core/spi", "core/events"], (spi, events) -> spi.domReady -> spi.body().on events.zone.update, (event) -> zone = spi.wrap this zone.trigger events.zone.willUpdate # TODO: purge existing children? zone.update event.memo zone.show() unless zone.visible() zone.trigger events.zone.didUpdate # No meaningful value is returned. trueopenMultiPageModal = require '../../../components/multi_page_modal/index.coffee' SpecialistView = require '../../../components/contact/general_specialist.coffee' module.exports.init = -> $('.js-contact-specialist').click (e) -> e.preventDefault() new SpecialistView $('.js-multi-page-modal').click (e) -> e.preventDefault() openMultiPageModal $(this).data('id') goog.provide 'app.react.pages.NotFound' class app.react.pages.NotFound ###* @constructor ### constructor: -> {div,h1,p} = React.DOM @create = React.createClass render: -> div className: 'notfound', h1 null, "This page isn't available" p null, "The link may be broken, or the page may have been removed."class ViewerAppController extends KDViewController KD.registerAppClass this, name : "Viewer" route : "/Develop" multiple : yes openWith : "forceNew" behavior : "application" preCondition : condition : (options, cb)-> {path, vmName} = options return cb true unless path path = FSHelper.plainPath path publicPath = path.replace \ ///.*\/(.*\.#{KD.config.userSitesDomain})\/(.*)///, 'http://$1/$2' cb publicPath isnt path, {path: publicPath} failure : (options, cb)-> correctPath = \ "/home/#{KD.nick()}/Sites/#{KD.nick()}.#{KD.config.userSitesDomain}/" KD.getSingleton("appManager").notify "File must be under: #{correctPath}" constructor:(options = {}, data)-> options.view = new PreviewerView params : options.params options.appInfo = title : "Preview" cssClass : "ace" super options, data open:(path)-> @getView().openPath path$ -> console.log "Document ready." startRenderer() startNetworking() startInput() import fetch from 'isomorphic-fetch'; port = (process.env.OPENSHIFT_NODEJS_PORT || process.env.PORT || '3000') ip = (process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1') export API_URL = (if (typeof window == 'undefined') then ('http://' + ip + ':' + port) else '') + '/api/' export callApiWithBody = (endpoint, method, headers, body) -> response = await fetch(API_URL + endpoint, { credentials: 'same-origin', method: method, headers, body }) try return await response.json() catch return {} export default callApi = (endpoint, data) -> method = if data then 'POST' else 'GET' headers = { 'Content-Type': 'application/json' } body = JSON.stringify(data) return callApiWithBody(endpoint, method, headers, body) CSV = require('csv') Q = require('q') argv = require('optimist') .usage('Usage: $0 --types product-types.csv --attributes product-types-attributes.csv') .demand(['types', 'attributes']) .argv ProductTypeGenerator = require('../main').ProductTypeGenerator ### Reads a CSV file by given path and returns a promise for the result. @param {string} path The path of the CSV file. @return Promise of csv read result. ### readCsvPromise = (path) -> deferred = Q.defer() CSV().from.path(path) .to (data) -> deferred.resolve(data) .on "error", (error) -> deferred.reject(new Error(error)) deferred.promise promises = Q.all [readCsvPromise(argv.types), readCsvPromise(argv.attributes)] Q.spread promises, (types, attributes) -> generator = new ProductTypeGenerator generator.run types, attributes, (success) -> process.exit 1 unless success$(document).ready -> # Photo grid photoGrid = $(".photo-grid") photoGrid.on "reload:grid", -> opts = wookmarkOptions(calculateGridWidth()) photoGrid.find(".photo, .user-block").wookmark(opts) photoGrid.trigger "reload:grid" $(window).resize -> photoGrid.trigger "reload:grid" # Description size tweaking on photo show image = $(".display .image img") description = image.siblings(".description") if image.length > 0 image.on "resize:description", -> if description.length > 0 description.innerWidth(image.width()) if description.is(":hidden") description.fadeIn() $(".display").imagesLoaded -> image.trigger "resize:description" $(window).resize -> image.trigger "resize:description" class EditorPane extends Pane constructor: (options = {}, data) -> options.cssClass = KD.utils.curry "editor-pane", options.cssClass super options, data @createEditor() createEditor: -> {file, content} = @getOptions() isLocalFile = no unless file instanceof FSFile return new Error "File must be an instance of FSFile" unless content return new Error "You must pass file content to EditorPane" @ace = new Ace { delegate : this }, file @addSubView @ace @ace.once "ace.ready", => @getEditor().setValue content, 1 @ace.setReadOnly yes if @getOptions().readOnly getEditor: -> return @ace.editor getValue: -> return @getEditor().getSession().getValue() $.fn.edit = -> form = new Phalange( el: @ ) @ class Phalange extends Backbone.View initialize: -> @text = @$el.text() events: "click": "append" "submit": "submit" "blur": "submit" submit: -> @text = @_input().val() @$el.trigger 'phalange:submit', @text @hideForm() @setText() setText: -> @$el.text @_input().val() hideForm: -> @_phalange().hide() append: -> @$el.text '' @$el.append @_$form() unless @_phalange_present() _phalange_present: -> @_phalange().length is 1 _phalange: -> @$el.find('.phalange-form') _input: -> @$el.find('input') _$form: -> template = """
      """ $(template) module?.exports = Phalange events = require "events" class Port extends events.EventEmitter constructor: (name) -> @name = name @socket = null @from = null attach: (socket) -> throw new Error "#{@name}: Socket already attached #{@socket.getId()} - #{socket.getId()}" if @socket @socket = socket @attachSocket socket attachSocket: (socket) -> @emit "attach", socket @from = socket.from socket.on "connect", => @emit "connect", socket socket.on "data", (data) => @emit "data", data socket.on "disconnect", => @emit "disconnect", socket detach: (socket) -> @emit "detach", @socket @from = null @socket = null send: (data, id) -> return @socket.send data if @isConnected() @socket.once "connect", => @socket.send data @socket.connect id connect: (id) -> throw new Error "No connection available" unless @socket @socket.connect id disconnect: -> return unless @socket @socket.disconnect() isConnected: -> unless @socket return false @socket.isConnected() exports.Port = Port noflo = require "noflo" class DuplicateProperty extends noflo.Component constructor: -> @properties = {} @inPorts = property: new noflo.ArrayPort() in: new noflo.Port() @outPorts = out: new noflo.Port() @inPorts.property.on "data", (data) => @setProperty data @inPorts.in.on "begingroup", (group) => @outPorts.out.beginGroup group @inPorts.in.on "data", (data) => @addProperties data @inPorts.in.on "endgroup", => @outPorts.out.endGroup() @inPorts.in.on "disconnect", => @outPorts.out.disconnect() setProperty: (prop) -> if typeof prop is "object" @prop = prop return propParts = prop.split "=" @properties[propParts[0]] = propParts[1] addProperties: (object) -> for original, newprop of @properties object[newprop] = object[original] @outPorts.out.send object exports.getComponent = -> new DuplicateProperty window.App ||= {} App.Visualization = require './visualization.js' App.Story = require './story.js' App.Trix = require 'script!trix' $(document).ready -> # Activate tooltips $('[data-toggle="tooltip"]').tooltip() $body = $('body') # visualizations if $body.hasClass 'visualizations' # /visualizations/:id # /visualizations/:id/edit appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit') appVisualization.render() $( window ).resize appVisualization.resize # stories else if $body.hasClass 'stories' # /stories/:id # /stories/:id/edit appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit') appStory.render() $( window ).resize appStory.resize # Add file input feedback # based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/ $(document).on 'change', '.btn-file :file', () -> label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '') $(this).parent().siblings('.btn-file-output').html label # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ roundUpBy = (value, round_to) -> return round_to * Math.ceil(value / round_to) $ -> metricsInview = new (Waypoint.Inview)( element: $('.metric-box')[0] enter: (direction) -> $(".metric-box strong").each (index) -> $this = $(this) $target_count = parseInt($this.text().replace(/\,/g, '')) jQuery(counter: 0).animate { counter: $target_count }, duration: 400 + index * 200 easing: "easeInOutQuint" step: -> $this.text Math.ceil(@counter).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") complete: -> jQuery(counter: $target_count).animate { counter: (3 + $target_count) }, duration: 1300 + index * 600 easing: "easeOutQuint" step: -> $this.text Math.ceil(@counter).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") return return return # only run this once this.destroy() ) class PG.Legend defaults: className: "legend" constructor: (container, @graphs, options) -> @container = $(container) @options = $.extend @defaults, options @element = $("
      ").addClass(@options.className) @container.append @element @legend = new Rickshaw.Graph.Legend graph: @graphs[0] element: @element.get(0) naturalOrder: yes instance = @ @graphSeries = {} for line, i in @legend.lines $label = $(line.element).find("span").first() $label.attr "rel", line.series.name @graphSeries[line.series.name] = series : _.map @graphs, (graph) -> graph.series[graph.series.length - 1 - i] disabled : no $label.on "click", -> instance.toggle $(this) toggle: ($label) -> $line = $label.parent(".line") name = $label.attr("rel") graphSeries = @graphSeries[name] if graphSeries.disabled graphSeries.disabled = no series.disabled = no for series in graphSeries.series $label.removeClass "#{@options.className}__label_disabled" $line.removeClass "disabled" else return if _.every(_.pluck(_.without(@graphSeries, graphSeries), "disabled")) graphSeries.disabled = yes series.disabled = yes for series in graphSeries.series $label.addClass "#{@options.className}__label_disabled" $line.addClass "disabled" @updateGraphs() updateGraphs: -> graph.update() for graph in @graphs '.text.restructuredtext': 'image': 'prefix': 'image' 'body': '.. image:: ${1:path}\n$0' 'link': 'prefix': 'link' 'body': '\\`${1:Title} <${2:http://link}>\\`_$0' 'section 1': 'prefix': 'sec' 'body': '${1:subsection name}\n================$0\n' 'section 2': 'prefix': 'subs' 'body': '${1:subsection name}\n****************$0\n' 'section 3': 'prefix': 'sss' 'body': '${1:subsection name}\n----------------$0\n' gulp = require 'gulp' coffee = require 'gulp-coffee' concat = require 'gulp-concat' gutil = require 'gulp-util' uglify = require 'gulp-uglify' wrap = require 'gulp-wrap-umd' gulp.task 'build', -> sink = concat('main.js') gulp.src('lib/base64-binary.js') .pipe(sink, end: false) gulp.src('src/validateSSH.coffee') .pipe(coffee(bare: true)).on('error', gutil.log) .pipe(sink) sink .pipe(wrap exports: 'validateOpenSSHKey' ) .pipe(uglify()) .pipe(gulp.dest('./dist/')) gulp.task 'default', -> gulp.run 'build' gulp.watch [ 'lib/base64-binary.js', 'src/validateSSH.coffee' ], (event) -> gulp.run 'build' React = require 'react' {PureRenderMixin} = require('react/addons').addons cx = require 'classname' styleMixin = require 'mixins/style-mixin' module.exports = React.createClass mixins: [ styleMixin require('./style.scss') PureRenderMixin ] getIconTypeClass: -> if @props.type? "cc-icon-#{@props.type}" else '' render: -> className = cx 'cc-icon': yes "#{@props.size or ''}": yes "#{do @getIconTypeClass}": yes AtomPackage = require './atom-package' Package = require './package' ### Internal: Loads and resolves packages. ### module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.pushAtKeyPath('core.themes', @metadata.name) disable: -> atom.config.removeAtKeyPath('core.themes', @metadata.name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch e console.warn "Failed to load theme named '#{@name}'", e.stack ? e this activate: -> @measure 'activateTime', => @loadStylesheets() @activateNow() module.exports = { name: "JSX" namespace: "jsx" fallback: ['js'] ### Supported Grammars ### grammars: [ "JSX" "JavaScript (JSX)" "Babel ES6 JavaScript" "JavaScript with JSX" ] ### Supported extensions ### extensions: [ "jsx", "js" ] defaultBeautifier: "JS Beautify" options: e4x: type: 'boolean' default: true description: "Support e4x/jsx syntax" } module.exports.listen = (port) -> createApp().listen port createApp = () -> express = require 'express' bodyParser = require 'body-parser' errors = require './errors' allowCrossDomain = (request, response, next) -> response.header 'Access-Control-Allow-Origin', '*' response.header( 'Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS' ) response.header( 'Access-Control-Allow-Headers', 'Content-Type, Content-Length, X-Requested-With' ) #response.header('Access-Control-Allow-Credentials', 'true') if 'OPTIONS' == request.method response.send 200 else next() defaultHeaders = (request, response, next) -> response.header 'Content-Type', 'application/json; charset=utf-8' next() serverErrorHandling = (err, request, response, next) -> if err if err instanceof errors.HttpError response.send err.statusCode, err.message else response.send 500 jsonParser = (request, response, next) -> bodyParser.json() request, response, (err) -> if err next new errors.BadRequest {error: 'Invalid JSON'} next(err) app = express() app.use allowCrossDomain app.use defaultHeaders app.use jsonParser app.use require './request_handler' require('./api')(app) app.use serverErrorHandling return app Rectangle = require './drawing-tools/rectangle' Details = require './tasks/details' module.exports = id: 'bhl' background: 'background.jpg' producer: 'Missouri Botanical Garden & Zooniverse' title: 'Illustrated Life' summary: 'Help catalogue scientific illustrations' description: 'Short description' pages: [{ 'About': '''

      All about the project

      This is where we\'ll go into detail.


      Lorem ipsum dolor sir amet.

      Break it into sections, add pictures, whatever.

      ''' }] tasks: illustration: type: 'drawing' question: 'Draw rectangles around the illustrations on this page.' choices: [{ type: Rectangle label: 'Mark the illustrations' color: '#333333' }] next: 'details' details: type: 'details' question: 'Add information about the illustrations.' choices: [{ label: 'Type' value: '' },{ label: 'Artist' value: '' }] next: 'details' firstTask: 'illustration' program = require 'commander' program .command('new [name]') .description('create a new app and/or extension') .usage('[name] [options]') .option('-t, --template [name]', 'template to use') .option('-c, --config [config file]', 'config file to use') .action (name, opts={}) -> if not name return console.log 'Name of project required' require('./generator') name, opts program .command('watch [name]') .description('watch for changes and reload') .action (opts={}) -> require('./watch') opts help = -> console.log program.helpInformation() program.parse process.argv help() unless program.args.length window.Echotron ||= {} Echotron.Echoes ||= {} Echotron.Echoes.foreground ||= [] Echotron.Echoes.midground ||= [] Echotron.Echoes.background ||= [] class Echotron.Echo extends THREE.Object3D uniformAttrs: {} # Override, calling super. Setup your Echo however you need. constructor: -> super @active = yes @initUniforms() # Setup list of uniforms sent to shaders. initUniforms: -> @uniforms = {} for name, type of @uniformAttrs @uniforms[name] = type: type value: null # Define an accessor property on the prototype unless name of this do (name, type) => Object.defineProperty @constructor::, name, get: -> @uniforms[name].value set: (val) -> @uniforms[name].value = val return # Tells this layer to start to die. It will no longer receive song events, # and will be pruned when @alive() returns false. kill: -> @active = no # Called by LayerStack expired: -> not @active and not @alive() # Override. Should return false when the layer can be destoryed. alive: -> @active # Override. Do stuff on beats. onBeat: -> # Override. Do stuff on bars. onBar: -> # Override. Do stuff on segment. onSegment: -> # Override. Do stuff on bars. onTatum: -> # Override. Update state per frame. update: (elapsed) -> 'use strict' class Game constructor: -> peer = new Peer 'server', {host: 'localhost', port: 9999} conn = peer.connect 'device' conn.on 'open', => conn.send 'Conneced.' conn.on 'data', (id) => console.log id @resizeWindow() $(window).resize => @resizeWindow() dartsUi = new DartsUi $('#darts-ui')[0] dartsUi.setListener (score, ratio) -> console.log score + ', ' + ratio + ' = ' + score * ratio resizeWindow: -> bodyHeight = $('body').height() headerHeight = $('.header').height() + 11 footerHeight = $('.footer').height() + 11 canvasHeight = bodyHeight - headerHeight - footerHeight - 20 $('#darts-ui').width(canvasHeight).height(canvasHeight) window.Game = Game window.Game = class Game constructor: (grid, moves, status, winner) -> console.log 'Game ctor' @gameBoard = new GameBoard($('#canvas'), $('#canvasOverlay'), { grid: grid, moves: moves, winner: winner, afterMoveAnimation: $.proxy(this.afterMove, this) }) @setFinished(winner) if status == 'finished' afterMove: -> gameBoard = @gameBoard console.log 'afterMove' if gameBoard.nextColour == 1 gameBoard.activate false console.log gameBoard.grid game = this $.ajax { dataType: "json", type: "POST", contentType: "application/json", data: JSON.stringify { grid: gameBoard.grid, moves: gameBoard.moves } beforeSend: (xhr) -> xhr.setRequestHeader("X-Http-Method-Override", "PUT") success: (result) -> console.log result new_move = result.moves[result.moves.length - 1] if result.status == 'finished' game.setFinished(result.winner) else gameBoard.move new_move[1] gameBoard.activate true } setFinished: (winner) -> if winner $('.messagePanel').text "Game over, #{winner} won" else $('.messagePanel').text "Game over, drawn" @gameBoard.activate false Crafty.c 'Mine', init: -> @requires 'Color, Enemy' mine: (attr = {}) -> @attr _.defaults(attr, w: 25, h: 25, health: 200) @origin 'center' @color '#555555' @enemy() this child_process = require 'child_process' module.exports = activate: (state) -> atom.commands.add 'atom-workspace', 'wp-phptidy:run': => @run() run: -> editor = atom.workspace.getActivePaneItem() editor.save() file = editor?.buffer.file filepath = file?.path if filepath.length child_process.exec(__dirname + '/../vendor/wp-phptidy.php replace ' + filepath)$ -> saveSequence = (sequence) -> if sequence? localStorage.setItem('sequence', sequence) true loadSequence = -> localStorage.getItem('sequence') input = $("input#fragment") button = $("#methods button") sequence = loadSequence() if sequence? input.val(sequence) unless window.location.search button.click() button.on "click", -> val = input.val() saveSequence(val) false class window.DP.Realtime init: -> if typeof Pusher == 'function' @pusher = new Pusher(DP.PUSHER_KEY) @channel = @pusher.subscribe DP.Round.url @channel.bind('new:charge', _.bind(@newCharge, this)) console.log(["Subscribing to real-time", @pusher, @channel]) newCharge: -> console.log(["REAL-TIME: New Charge", arguments]) @reloadDonations() reloadDonations: (data)-> if !data $.get('/round_status/' + DP.Round.url, {}, @renderDonations) else @renderDonations(data) renderDonations: (data)-> console.log(["Round status", data]) $('.donations').html(data.donations_template) $('.payment-info').html(data.payment_info_template) @secondsLeft = data.seconds_left if data.closed window.location.href = window.location.href renderTimer: -> if @secondsLeft <= 0 window.location.href = window.location.href $timer = $('.timer') minutes = Math.floor(@secondsLeft / 60) seconds = @secondsLeft % 60 if seconds <= 9 seconds = "0" + seconds $timer.html(minutes + ":" + seconds + " time left") @secondsLeft -= 1 jQuery -> ($ '#account-next-step').on 'click', (e) -> do e.preventDefault do ($ '#account-form').submit if ($ '#user_qae_info_source_other').length toggleOther = (checkbox) -> if checkbox.is(':checked') ($ '#qae_info_source_other').removeClass('visuallyhidden') else ($ '#qae_info_source_other').addClass('visuallyhidden') toggleOther($ '#user_qae_info_source_other') ($ '#user_qae_info_source_other').on 'change', -> toggleOther($ @) 'use strict' @start = (limit) -> window.startDate = new Date().getTime() window.elapsedSeconds = 0 window.seconds = 0 window.minutes = 0 window.limit = limit window.timerID = setInterval(timeCounter, 1000) return @stop = -> clearInterval timerID return timeCounter = -> if elapsedSeconds >= limit stop() return time = new Date().getTime() - startDate window.elapsedSeconds = parseInt(Math.floor(time / 100) / 10) allTheTime = elapsedSeconds minutes = parseInt(allTheTime/60) allTheTime -= minutes * 60 seconds = parseInt(allTheTime) document.getElementById('seconds').innerHTML = seconds document.getElementById('minutes').innerHTML = minutes return kd = require 'kd' KDCustomHTMLView = kd.CustomHTMLView KodingSwitch = require 'app/commonviews/kodingswitch' CustomLinkView = require 'app/customlinkview' module.exports = class IDEChatHeadWatchItemView extends KDCustomHTMLView constructor: (options = {}, data) -> options.partial ?= 'Watch' super options, data { delegate, isWatching } = @getOptions() @addSubView new KodingSwitch cssClass : 'tiny' defaultValue : isWatching callback : delegate.bound 'setWatchState' @addSubView new CustomLinkView title : '' cssClass : 'info' href : 'http://learn.koding.com/guides/collaboration/#what-does-quot-watch-quot-mode-mean-' target : '_blank' $ -> $('.reminder_active').on 'change', -> $('.reminder_days_before').prop "disabled", !@.checked select2_options = theme: 'bootstrap' placeholder: 'Selecione os usuários' maximumSelectionLength: 7 $('.select_users').select2 select2_options $('.js-account').click (e)-> path = '/main_account.json' account_id = $(@).data('account-id') $.getJSON(path, { account_id: account_id }) .done (data)-> console.log data m|U+�� +c���D�� F �PW%�/#a&�)U,a0�2Q6L:[>�B�EG�H�L O�O�QT�X\[�]�_IcMh�lar�svByt{}|���� ���L�x�ɑ�{�����ѡ�����n�K���B�޹üA�<����&���a�p���T�C���������&�:���%��� � � �m;� &!�%�)�,�.�16j;�@�EnH�K�O�S�T�X�\�a�grj n�o�rOt�x}@�B��������"���'�2���������������������������p�ųųA�A�˼K�R��8�������F�F�F�F�����������������D���������������������r�"�"�8�3�>�>�����������A�A�����������������+�+����m�m�m�m�m�m�m���������sss: : � �Gqqqqqq���#�#�#�%�)�)�)�)�)�)�)�)�)�.�.�.�/�/�/�/�1�3�3B6]8]8]8�=�=�=�=�=�=�=�=�@�@�@�@�@�@�@�@�@�@�@EEXHXHXHaL�L�L�L�O�O�O�O�T�T�T�W�W�Z�^�^�^�^^c^c.d.d�d�d�d�d�d�deeeekpnpn�sTwTwTwTwTwTwTw{{{{M��Ĉw�w���0��������������� �������������������`�`�`�`�`�`�`�`�x�x�x���w�w�w�w�w�w�w�G�g�|�|�|�����Q�Q�Q�Q�Q�Q�7�7��������������������������������������������V�V�V�V�V�V�a�a�a�a�a�l�l����� � � ���������'rz4\\\Odddddddddddddddddd%%%~ ~ J#J#J#T&�)�)�)�)�)�)�)�*B.I0I0I0I04444445I8I8�<�<�A�A�A�AEEEEEEE�I�ILL GroupSet = resourPeer = require './peer' Guid = require 'guid' module.exports = createPeer: -> id = Guid.create().toString() new Peer(id, host: 'ec2-54-218-51-127.us-west-2.compute.amazonaws.com', port: 8080) connectDocument: (doc, connection) -> nextOutputEventId = 1 outputListener = (event) -> event.id = nextOutputEventId++ console.log 'sending event', event.id, event connection.send(event) doc.outputEvents.on('changed', outputListener) queuedEvents = [] nextInputEventId = 1 handleInputEvent = (event) -> console.log 'received event', event.id, event doc.handleInputEvent(event) nextInputEventId = event.id + 1 flushQueuedEvents = -> loop eventHandled = false for event, index in queuedEvents when event.id is nextInputEventId handleInputEvent(event) queuedEvents.splice(index, 1) eventHandled = true break break unless eventHandled connection.on 'data', (event) -> if event.id is nextInputEventId handleInputEvent(event) flushQueuedEvents() else console.log 'enqueing event', event.id, event queuedEvents.push(event) connection.on 'close', -> doc.outputEvents.removeListener('changed', outputListener) connection.on 'error', (error) -> console.error 'connection error', error.stack ? error {View} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' module.exports = class WrapGuideView extends View @activate: -> rootView.eachEditor (editor) => @appendToEditorPane(rootView, editor) if editor.attached @appendToEditorPane: (rootView, editor) -> if underlayer = editor.find('.underlayer') underlayer.append(new WrapGuideView(editor)) @content: -> @div class: 'wrap-guide' defaultColumn: 80 initialize: (@editor) => @observeConfig 'editor.fontSize', => @updateGuide() @subscribe @editor, 'editor:path-changed', => @updateGuide() @subscribe @editor, 'editor:min-width-changed', => @updateGuide() @subscribe $(window), 'resize', => @updateGuide() getGuideColumn: (path) -> customColumns = config.get('wrapGuide.columns') return @defaultColumn unless _.isArray(customColumns) for customColumn in customColumns continue unless _.isObject(customColumn) pattern = customColumn['pattern'] continue unless pattern return parseInt(customColumn['column']) if new RegExp(pattern).test(path) @defaultColumn updateGuide: -> column = @getGuideColumn(@editor.getPath(), @defaultColumn) if column > 0 columnWidth = @editor.charWidth * column if columnWidth < @editor.layerMinWidth or columnWidth < @editor.width() @css('left', "#{columnWidth}px").show() else @hide() else @hide() path = require 'path' {Directory} = require 'pathwatcher' GitRepository = require '../src/git-repository' GitRepositoryProvider = require '../src/git-repository-provider' describe "GitRepositoryProvider", -> describe ".repositoryForDirectory(directory)", -> describe "when specified a Directory with a Git repository", -> provider = new GitRepositoryProvider atom.project the_result = 'dummy_value' the_second_result = 'dummy_value2' it "returns a Promise that resolves to a GitRepository", -> waitsForPromise -> directory = new Directory path.join(__dirname, 'fixtures/git/master.git') provider.repositoryForDirectory(directory).then (result) -> the_result = result runs -> expect(the_result).toBeInstanceOf GitRepository expect(provider.pathToRepository[the_result.getPath()]).toBeTruthy() expect(the_result.statusTask).toBeTruthy() waitsForPromise -> directory = new Directory path.join(__dirname, 'fixtures/git/master.git/objects') provider.repositoryForDirectory(directory).then (result) -> the_second_result = result runs -> expect(the_second_result).toBeInstanceOf GitRepository expect(the_second_result).toBe the_result describe "when specified a Directory without a Git repository", -> provider = new GitRepositoryProvider atom.project the_result = 'dummy_value' it "returns a Promise that resolves to null", -> waitsForPromise -> directory = new Directory '/tmp' provider.repositoryForDirectory(directory).then (result) -> the_result = result runs -> expect(the_result).toBe null ###* @namespace scoping into the hquery namespace ### this.hQuery ||= {} # =require core.coffee ###* This represents all interventional, surgical, diagnostic, or therapeutic procedures or treatments pertinent to the patient. @class @augments hQuery.CodedEntry @exports Procedure as hQuery.Procedure ### class hQuery.Procedure extends hQuery.CodedEntry constructor: (@json) -> super(@json) ###* @returns {hQuery.Actor} The provider that performed the procedure ### performer: -> new hQuery.Actor @json['performer'] ###* @returns {hQuery.CodedValue} A SNOMED code indicating the body site on which the procedure was performed ### site: -> new hQuery.CodedValue @json['site']['code'], @json['site']['codeSystem'] ###* @returns {hQuery.CodedValue} A SNOMED code indicating where the procedure was performed. ### source: -> if @json['source'] && @json['source']['code'] && @json['source']['codeSystem'] new hQuery.CodedValue @json['source']['code'], @json['source']['codeSystem'] else null ###* @returns {Date} The actual or intended start of an incision. ### incisionDatetime: -> hQuery.dateFromUtcSeconds @json['incisionDatetime']module.exports = """ fragment commercial on Artwork { _id id is_acquireable is_inquireable is_in_auction sale_message artists { name is_consignable } partner { id name type is_pre_qualify contact_message } fair { id name } edition_sets { id is_acquireable edition_of price dimensions { in cm } } } """ DeferredAtomPackage = require 'deferred-atom-package' LoadPathsTask = require './src/load-paths-task' module.exports = class FuzzyFinder extends DeferredAtomPackage loadEvents: [ 'fuzzy-finder:toggle-file-finder' 'fuzzy-finder:toggle-buffer-finder' 'fuzzy-finder:find-under-cursor' ] instanceClass: 'fuzzy-finder/src/fuzzy-finder-view' activate: (rootView) -> super if rootView.project.getPath()? callback = (paths) => @projectPaths = paths new LoadPathsTask(rootView, callback).start() onLoadEvent: (event, instance) -> if @projectPaths? and not @instance.projectPaths? @instance.projectPaths = @projectPaths @instance.reloadProjectPaths = false switch event.type when 'fuzzy-finder:toggle-file-finder' instance.toggleFileFinder() when 'fuzzy-finder:toggle-buffer-finder' instance.toggleBufferFinder() when 'fuzzy-finder:find-under-cursor' instance.findUnderCursor() # Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. #.. # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps 'atom-workspace atom-text-editor:not([mini])[data-grammar~=fsharp]': 'alt-enter': 'FSI:Send-Selection' 'alt-/':'FSI:Send-Line' 'ctrl-space': 'fsharp:autocomplete' 'cmd-space': 'fsharp:autocomplete' 'atom-workspace': 'f5': 'FAKE:Build-Default' '.platform-darwin atom-workspace atom-text-editor:not([mini])[data-grammar~=fsharp]': 'ctrl-cmd-l':'FSI:Send-Line' Darkswarm.directive "ofnRegistrationLimitModal", (Navigation, $modal, Loading) -> restrict: 'A' link: (scope, elem, attr)-> scope.modalInstance = $modal.open templateUrl: 'registration/limit_reached.html' windowClass: "login-modal large" backdrop: 'static' scope.modalInstance.result.then scope.close, scope.close scope.close = -> Loading.message = "Taking you back to the home page" Navigation.go "/" _ = require 'underscore' module.exports = projectPaths: null fuzzyFinderView: null loadPathsTask: null activate: (state) -> rootView.command 'fuzzy-finder:toggle-file-finder', => @createView().toggleFileFinder() rootView.command 'fuzzy-finder:toggle-buffer-finder', => @createView().toggleBufferFinder() rootView.command 'fuzzy-finder:find-under-cursor', => @createView().findUnderCursor() rootView.command 'fuzzy-finder:toggle-git-status-finder', => @createView().toggleGitFinder() if project.getPath()? LoadPathsTask = require 'fuzzy-finder/lib/load-paths-task' @loadPathsTask = new LoadPathsTask((paths) => @projectPaths = paths) @loadPathsTask.start() for editSession in project.getEditSessions() editSession.lastOpened = state[editSession.getPath()] deactivate: -> @loadPathsTask?.abort() @loadPathsTask = null @fuzzyFinderView?.cancel() @fuzzyFinderView = null @projectPaths = null serialize: -> @fuzzyFinderView?.getOpenedPaths() createView: -> unless @fuzzyFinderView FuzzyFinderView = require 'fuzzy-finder/lib/fuzzy-finder-view' @fuzzyFinderView = new FuzzyFinderView() if @projectPaths?.length > 0 and not @fuzzyFinderView.projectPaths? @fuzzyFinderView.projectPaths = @projectPaths @fuzzyFinderView.reloadProjectPaths = false @fuzzyFinderView @AudioRecorder = new class start: (cb) -> window.AudioContext = window.AudioContext or window.webkitAudioContext navigator.getUserMedia = navigator.getUserMedia or navigator.webkitGetUserMedia window.URL = window.URL or window.webkitURL @audio_context = new AudioContext ok = (stream) => @startUserMedia(stream) cb?.call(@) if not navigator.getUserMedia? return cb false navigator.getUserMedia {audio: true}, ok, (e) -> console.log('No live audio input: ' + e) startUserMedia: (stream) -> @stream = stream input = @audio_context.createMediaStreamSource(stream) @recorder = new Recorder(input, {workerPath: '/recorderWorker.js'}) @recorder.record() stop: (cb) -> @recorder.stop() if cb? @getBlob cb @stream.getAudioTracks()[0].stop() @recorder.clear() delete @audio_context delete @recorder delete @stream getBlob: (cb) -> @recorder.exportWAV cb# joke me - Pull a random joke from /r/jokes module.exports = (robot) -> robot.respond /joke me/i, (msg) -> msg.http('http://www.reddit.com/r/jokes.json') .get() (err, res, body) -> try data = JSON.parse body children = data.data.children joke = msg.random(children).data.selftext msg.send joke catch ex msg.send "Erm, something went EXTREMELY wrong - #{ex}" _ = require 'underscore' Artist = require '../../models/artist' AuctionLots = require '../../collections/auction_lots' @artist = (req, res) -> artist = null auctionLots = null currentPage = parseInt req.query.page || 1 sort = req.query.sort render = _.after 2, -> res.render 'artist', auctionLots : auctionLots artist : artist new Artist(id: req.params.id).fetch cache : true success: (response) -> artist = response; render() error : res.backboneError new AuctionLots([], id : req.params.id sortBy: sort state : { currentPage: currentPage } ).fetch cache : true success: (response) -> auctionLots = response; render() error : res.backboneError Artwork = require '../../models/artwork' ComparableSales = require '../../collections/comparable_sales' @artwork = (req, res) -> artwork = null auctionLots = null render = _.after 2, -> res.render 'artwork', artwork: artwork auctionLots: auctionLots new Artwork(id: req.params.id).fetch cache : true success : (response) -> artwork = response; render() new ComparableSales([], id: req.params.id ).fetch cache : true success : (response) -> auctionLots = response; render() error : res.backboneError fs = require 'fs-plus' path = require 'path' Keymap = require 'atom-keymap' season = require 'season' Keymap::loadBundledKeymaps = -> @loadKeyBindings(path.join(@resourcePath, 'keymaps')) @emit('bundled-keymaps-loaded') Keymap::getUserKeymapPath = -> if userKeymapPath = season.resolve(path.join(@configDirPath, 'keymap')) userKeymapPath else path.join(@configDirPath, 'keymap.cson') Keymap::loadUserKeymap = -> userKeymapPath = @getUserKeymapPath() if fs.isFileSync(userKeymapPath) @loadKeyBindings(userKeymapPath, watch: true, suppressErrors: true) asar = require 'asar' path = require 'path' module.exports = (grunt) -> grunt.registerTask 'output-build-filetypes', 'Log counts for each filetype in the built application', -> shellAppDir = grunt.config.get('atom.shellAppDir') types = {} registerFile = (filePath) -> extension = path.extname(filePath) or path.basename(filePath) types[extension] ?= 0 types[extension]++ if extension is '.asar' asar.listPackage(filePath).forEach (archivePath) -> archivePath = archivePath.substring(1) unless asar.statFile(filePath, archivePath, true).files registerFile(archivePath) grunt.file.recurse shellAppDir, (absolutePath, rootPath, relativePath, fileName) -> registerFile(absolutePath) extensions = Object.keys(types).sort (extension1, extension2) -> diff = types[extension2] - types[extension1] if diff is 0 extension1.toLowerCase().localeCompare(extension2.toLowerCase()) else diff extensions.forEach (extension) -> grunt.log.error "#{extension}: #{types[extension]}" path = require 'path' module.exports = (grunt) -> grunt.registerTask 'output-build-filetypes', 'Log counts for each filetype in the built application', -> shellAppDir = grunt.config.get('atom.shellAppDir') types = {} grunt.file.recurse shellAppDir, (absolutePath, rootPath, relativePath, fileName) -> extension = path.extname(fileName) or fileName types[extension] ?= 0 types[extension]++ extensions = Object.keys(types).sort (extension1, extension2) -> types[extension2] - types[extension1] extensions.forEach (extension) -> grunt.log.error "#{extension}: #{types[extension]}" # Like sands through the hourglass, so are the days of our lives. require './window' Atom = require './atom' window.atom = Atom.loadOrCreate('editor') atom.initialize() atom.startEditorWindow() # Workaround for focus getting cleared upon window creation windowFocused = -> window.removeEventListener('focus', windowFocused) setTimeout (-> document.querySelector('atom-workspace').focus()), 0 window.addEventListener('focus', windowFocused) Template.loginHeader.helpers logoUrl: -> asset = RocketChat.settings.get('Assets_logo') if asset? return asset.url or asset.defaultUrl $ = require 'jquery' fs = require 'fs' Theme = require 'theme' describe "@load(name)", -> themes = null beforeEach -> $("#jasmine-content").append $("
      ") afterEach -> theme.deactivate() for theme in themes describe "TextMateTheme", -> it "applies the theme's stylesheet to the current window", -> expect($(".editor").css("background-color")).not.toBe("rgb(20, 20, 20)") themePath = require.resolve(fs.join('fixtures', 'test.tmTheme')) themes = Theme.load(themePath) expect($(".editor").css("background-color")).toBe("rgb(20, 20, 20)") describe "AtomTheme", -> it "Loads and applies css from package.json in the correct order", -> expect($(".editor").css("padding-top")).not.toBe("101px") expect($(".editor").css("padding-right")).not.toBe("102px") expect($(".editor").css("padding-bottom")).not.toBe("103px") themePath = require.resolve(fs.join('fixtures', 'test-atom-theme')) themes = Theme.load(themePath) expect($(".editor").css("padding-top")).toBe("101px") expect($(".editor").css("padding-right")).toBe("102px") expect($(".editor").css("padding-bottom")).toBe("103px") _ = require 'underscore' class NumericPrefix count: null complete: null operatorToRepeat: null constructor: (@count) -> @complete = false isComplete: -> @complete compose: (@operatorToRepeat) -> @complete = true if @operatorToRepeat.setCount? @operatorToRepeat.setCount @count @count = 1 addDigit: (digit) -> @count = @count * 10 + digit execute: -> _.times @count, => @operatorToRepeat.execute() select: -> _.times @count, => @operatorToRepeat.select() class Delete motion: null complete: null constructor: (@editor) -> @complete = false isComplete: -> @complete execute: -> if @motion @motion.select() @editor.delete() else @editor.deleteLine() compose: (motion) -> @motion = motion @complete = true module.exports = { NumericPrefix, Delete } 'exception-reporting': 'userId': '3ba70428-f782-5321-e73a-7b678f36511c' 'release-notes': 'viewedVersion': '0.94.0' 'welcome': 'showOnStartup': false 'metrics': 'userId': '9e20623847c7c22109bc7b34e71c459485f8781a' 'editor': 'showInvisibles': true 'fontFamily': 'Monaco' 'showIndentGuide': true 'softTabs': false 'fontSize': 14 'core': 'themes': [ 'monokai-tweaked-ui' 'monokai-tweaked-syntax' ] 'projectHome': '/Users/MoOx/Sync/Development' 'autosave': {} 'autocomplete-plus': {} 'Rdio': 'showEqualizer (WindowResizePerformanceIssue )': false fs = require 'fs-utils' Theme = require 'theme' CSON = require 'cson' module.exports = class AtomTheme extends Theme loadStylesheet: (stylesheetPath)-> @stylesheets[stylesheetPath] = window.loadStylesheet(stylesheetPath) load: -> if fs.extension(@path) in ['.css', '.less'] @loadStylesheet(@path) else metadataPath = fs.resolveExtension(fs.join(@path, 'package'), ['cson', 'json']) if fs.isFile(metadataPath) stylesheetNames = CSON.readObject(metadataPath)?.stylesheets if stylesheetNames @loadStylesheet(fs.join(@path, name)) for name in stylesheetNames else @loadStylesheet(stylesheetPath) for stylesheetPath in fs.list(@path, ['.css', '.less']) super 'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new app: brunch new --skeleton You can specify directory on disk, Git URL or GitHub url (gh:user/repo). Some suggestions: * `gh:brunch/dead-simple` if you want no opinions. Just initializes configs and empty directories. * `gh:paulmillr/brunch-with-chaplin`: Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) } # The view class for each link child item in the tree view. Each child item # is
    • tag with an anchor surrounding the name. class window.sirius.TreeChildItemDemandLinkView extends window.sirius.TreeChildItemLinkView $a = window.sirius showContext: (e) => if !@added_menu_item @targets[0].get('contextMenu').options.menuItems.push label: 'Visualize Demand' className: 'context_menu_item' event: => dviz = new $a.DemandVisualizer(@targets[0].get('demand'), @targets[0]) $('body').append(dviz.el) dviz.render() $(dviz.el).dialog('open') @added_menu_item = true superfs = require 'fs' path = require 'path' _ = require 'underscore-plus' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) fillTemplate = (filePath, data) -> template = _.template(String(fs.readFileSync("#{filePath}.in"))) filled = template(data) outputPath = path.join(grunt.config.get('atom.buildDir'), path.basename(filePath)) fs.writeFileSync(outputPath, filled) outputPath grunt.registerTask 'mkdeb', 'Create debian package', -> done = @async() if process.arch is 'ia32' arch = 'i386' else if process.arch is 'x64' arch = 'amd64' else return done("Unsupported arch #{process.arch}") {name, version, description} = grunt.file.readJSON('package.json') section = 'devel' maintainer = 'GitHub ' installDir = '/usr' iconName = 'atom' data = {name, version, description, section, arch, maintainer, installDir, iconName} controlFilePath = fillTemplate(path.join('resources', 'linux', 'debian', 'control'), data) desktopFilePath = fillTemplate(path.join('resources', 'linux', 'Atom.desktop'), data) icon = path.join('resources', 'atom.png') buildDir = grunt.config.get('atom.buildDir') cmd = path.join('script', 'mkdeb') args = [version, arch, controlFilePath, desktopFilePath, icon, buildDir] spawn({cmd, args}, done) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ window.merge_requests = -> # Click to add a comment $("td > div.add-comment").on 'click', (event) -> show_comment_box(event.target.parentElement.parentElement) $('#push-comments').on 'click', (event) -> false window.show_comment_box = (tr) -> if tr.dataset.expanded == 'true' $(tr.nextSibling).find('textarea').focus() return tr.dataset.expanded = true location = tr.dataset.location html = "\ \ " $(html).insertAfter tr $(tr.nextSibling).find('textarea').focus() window.hide_comment_box = (cancel_link) -> tr = cancel_link.parentElement.parentElement tr.previousSibling.dataset.expanded = false $(tr).remove() if window.location.pathname.match(/\/apply$/) $ -> changeSection = (e, noscroll)-> hash = window.location.hash sectionId = hash.substring 1 $('.section').each ()-> section = $ @ if section.attr('id') is sectionId section.toggleClass 'hide', false else section.toggleClass 'hide', true $('.wizard-nav a').each ()-> link = $ @ parent = link.parent() if link.attr('href') is hash parent.toggleClass 'active', true else parent.toggleClass 'active', false window.scrollTo 0, 0 unless noscroll $(window).on 'hashchange', changeSection showDownloadWarning = -> $('#download-warning').modal() submitUpdateForm = -> $('#update-button').submit() initialize = (e)-> $('.download-forms').click( showDownloadWarning submitUpdateForm ) firstSectionHash = $('.wizard-nav a').eq(0).attr 'href' if window.location.hash.length <= 1 window.location.hash = firstSectionHash else changeSection null, !!e $(document).ajaxComplete initialize initialize() module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') coffee: glob_to_multiple: expand: true cwd: '.' src: ['index.coffee'] dest: 'tasks' ext: '.js' coffeelint: options: no_empty_param_list: level: 'error' max_line_length: level: 'ignore' src: ['*.coffee'] shell: test: command: 'node_modules/jasmine-focused/bin/jasmine-focused --captureExceptions --coffee spec' options: stdout: true stderr: true failOnError: true grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.registerTask 'clean', -> grunt.file.delete('tasks') if grunt.file.exists('tasks') grunt.registerTask('lint', ['coffeelint']) grunt.registerTask('default', ['lint', 'coffee']) grunt.registerTask('test', ['default', 'shell:test']) SocketIOThrottle = require './SocketIOThrottle' class Limiter constructor: (@socket) -> throttle: (@callback=->) => @throttled throttled: => originalArguments = arguments new SocketIOThrottle().throttle @socket, => @callback.apply this, originalArguments module.exports = Limiter $ -> updateDisplay = -> if localStorage.lastSyncTime? $('.sync-stats').html "You last synced on #{localStorage.lastSyncTime}" $('.collection-num').html localStorage.num $('.collection-total').html localStorage.total if JSON.parse(localStorage.releases).length > 0 $('.search').html localStorage.releases updateDisplay() $('#sync-collection').on 'click', (event) -> $(this).text('Syncing...') $(this).attr('disabled', true) localStorage.lastSyncTime = new Date() localStorage.num = 0 localStorage.total = 0 localStorage.releases = JSON.stringify [] updateDisplay() syncCollection(1) syncCollection = (page) -> $.get '/collection/sync', { page: page }, (data) -> localStorage.num = parseInt(localStorage.num) + data.num localStorage.total = data.total previousReleases = JSON.parse(localStorage.releases) localStorage.releases = JSON.stringify(previousReleases.concat data.releases) updateDisplay() if data.page < data.total_pages syncCollection(page + 1) else $('#sync-collection').text('Sync Now') $('#sync-collection').attr('disabled', false) define ['../core', './field'], (c, field) -> class ConceptModel extends c.Backbone.Model parse: (resp) -> @fields = [] # Parse and attach field model instances to concept for attrs in resp.fields @fields.push(new field.FieldModel attrs, parse: true) return resp class ConceptCollection extends c.Backbone.Collection model: ConceptModel url: -> c.getSessionUrl('concepts') initialize: -> super c.subscribe c.SESSION_OPENED, => @fetch(reset: true) c.subscribe c.SESSION_CLOSED, => @reset() @on 'reset', @resolve search: (query, handler) -> c.Backbone.ajax url: c._.result @, 'url' data: query: query dataType: 'json' success: (resp) -> handler(resp) { ConceptModel, ConceptCollection } Model = require './model' class Request extends Model url: => "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/requests/request/#{ @get('id') }" deletePaused: => $.ajax url: "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/requests/request/#{ @get('requestId') }/paused" type: 'DELETE' unpause: => $.ajax url: "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/requests/request/#{ @get('requestId') }/unpause" type: 'POST' module.exports = Requestrequire('backbone').$ = $ $ -> if location.pathname is '/2016-year-in-art' require('../apps/editorial_features/components/eoy/client.coffee').init else if location.pathname.includes('/venice-biennale') require('../apps/editorial_features/components/venice_2017/client.coffee').init()rewire = require 'rewire' helpers = rewire '../src/helpers' describe 'helpers', -> describe 'replaceConfigSlashes()', -> it 'should replace slashes with backslashes in config', -> helpers.__set__ 'isWindows', true unix = require './fixtures/unix_config' win = require './fixtures/win_config' expect(helpers.replaceConfigSlashes unix.config).to.eql win.config ConfigPanel = require 'config-panel' PackageConfigView = require 'package-config-view' ### Internal ### module.exports = class InstalledPackagesConfigPanel extends ConfigPanel @content: -> @div class: 'installed-packages' initialize: -> for pack in atom.getLoadedPackages() @append(new PackageConfigView(pack.metadata)) Mixin = require 'mixto' module.exports = class Focusable extends Mixin @included: -> @property 'focusContext' @behavior 'focused', -> @$focusContext .flatMapLatest((context) -> context?.$focusedObject) .map((focusedObject) => focusedObject is this) focus: -> throw new Error("Object must be assigned a focusContext to be focus") unless @focusContext @focusContext.focusedObject = this blur: -> throw new Error("Object must be assigned a focusContext to be blurred") unless @focusContext @focusContext.focusedObject = null if @focused checkToken = require('../lib/token').checkToken errors = require '../middlewares/errors' module.exports.checkDevice = (req, res, next) -> auth = req.header('authorization') [err, isAuthenticated, name] = checkToken auth if err or not isAuthenticated or not name next errors.notAuthorized() else req.params.id = "_design/filter-#{name}-#{req.params.id}" next() module.exports.fixBody = (req, res, next) -> req.body.views = {} if "views" not in req.body next() module.exports = class OverlayManager constructor: (@container) -> @overlays = {} render: (props) -> {presenter, editor, overlayDecorations} = props lineHeight = presenter.getLineHeight() existingDecorations = null for markerId, {headPixelPosition, tailPixelPosition, decorations} of overlayDecorations for decoration in decorations pixelPosition = if decoration.position is 'tail' then tailPixelPosition else headPixelPosition @renderOverlay(editor, decoration, pixelPosition, lineHeight) existingDecorations ?= {} existingDecorations[decoration.id] = true for id, overlay of @overlays unless existingDecorations? and id of existingDecorations @container.removeChild(overlay) delete @overlays[id] return renderOverlay: (editor, decoration, pixelPosition, lineHeight) -> item = atom.views.getView(decoration.item) unless overlay = @overlays[decoration.id] overlay = @overlays[decoration.id] = document.createElement('atom-overlay') overlay.appendChild(item) @container.appendChild(overlay) itemWidth = item.offsetWidth itemHeight = item.offsetHeight left = pixelPosition.left if left + itemWidth - editor.getScrollLeft() > editor.getWidth() and left - itemWidth >= editor.getScrollLeft() left -= itemWidth top = pixelPosition.top + lineHeight if top + itemHeight - editor.getScrollTop() > editor.getHeight() and top - itemHeight - lineHeight >= editor.getScrollTop() top -= itemHeight + lineHeight overlay.style.top = top + 'px' overlay.style.left = left + 'px' path = require 'path' fs = require 'fs-plus' FuzzyFinderView = require './fuzzy-finder-view' module.exports = class GitStatusView extends FuzzyFinderView toggle: -> if @hasParent() @cancel() else if atom.project.getRepo()? @populate() @attach() getEmptyMessage: (itemCount) -> if itemCount is 0 'Nothing to commit, working directory clean' else super populate: -> paths = [] for filePath, status of atom.project.getRepo().statuses filePath = path.join(atom.project.getPath(), filePath) paths.push(filePath) if fs.isFileSync(filePath) @setItems(paths) window.Backbone ||= {} window.Backbone.Views ||= {} class Backbone.Views.IndicatorSelectorView extends Backbone.Diorama.NestingView template: Handlebars.templates['indicator_selector.hbs'] className: 'modal indicator-selector' events: "click .close": "close" "click .indicators li .info": "selectIndicator" initialize: (options) -> @section = options.section @indicators = new Backbone.Collections.IndicatorCollection() @indicators.fetch( success: @render ) render: => $('body').addClass('stop-scrolling') @closeSubViews() @$el.html(@template( thisView: @ indicators: @indicators.models section: @section )) @renderSubViews() return @ selectIndicator: -> @close() onClose: -> $('body').removeClass('stop-scrolling') @closeSubViews() module.exports = findMisspellings: (text) -> wordRegex = /(?:^|\s)([a-zA-Z]+)(?=\s|\.|$)/g row = 0 misspellings = [] for line in text.split('\n') while matches = wordRegex.exec(line) word = matches[1] continue unless $native.isMisspelled(word) startColumn = matches.index + matches[0].length - word.length endColumn = startColumn + word.length misspellings.push([[row, startColumn], [row, endColumn]]) row++ callTaskMethod('misspellingsFound', misspellings) NotificationPlugin = require "../../notification-plugin" class GithubIssue extends NotificationPlugin BASE_URL = "https://api.github.com" stacktraceLines = (stacktrace) -> ("#{line.file}:#{line.lineNumber} - #{line.method}" for line in stacktrace when line.inProject) markdownBody = (event) -> """ ## #{event.trigger.message} in #{event.project.name} **#{event.error.exceptionClass}** in **#{event.error.context}** #{event.error.message if event.error.message} [View on bugsnag.com](#{event.error.url}) ## Stacktrace #{stacktraceLines(event.error.stacktrace).join("\n")} [View full stacktrace](#{event.error.url}) """ @receiveEvent: (config, event, callback) -> # Build the ticket payload = title: "#{event.error.exceptionClass} in #{event.error.context}" body: markdownBody(event) # Send the request @request .post("#{BASE_URL}/repos/#{config.repo}/issues") .auth(config.username, config.password) .send(payload) .on "error", (err) -> callback(err) .end (res) -> return callback(res.error) if res.error callback null, id: res.body.id number: res.body.number url: res.body.html_url module.exports = GithubIssue# build-dependencies: bus describe "EventStream.doError", -> it "calls function before sending error to listeners", -> called = [] bus = new Bacon.Bus() s = bus.flatMap((x) -> new Bacon.Error(1)).doError((x) -> called.push(x)) s.onValue(->) s.onError(->) bus.push(1) expect(called).to.deep.equal([1]) describe "does not alter the stream", -> expectStreamEvents( -> series(1, [1, 2]).doError(->) [1, 2]) it "toString", -> expect(Bacon.never().doError((->)).toString()).to.equal("Bacon.never().doError(function)") fs = require 'fs' path = require 'path' grunt = require 'grunt' temp = require 'temp' describe 'create-windows-installer task', -> it 'creates a nuget package', -> outputDirectory = temp.mkdirSync('grunt-atom-shell-installer-') grunt.config.init pkg: grunt.file.readJSON(path.join(__dirname, 'fixtures', 'package.json')) 'create-windows-installer': appDirectory: path.join(__dirname, 'fixtures', 'app') outputDirectory: outputDirectory grunt.loadTasks(path.resolve(__dirname, '..', 'tasks')) tasksDone = false grunt.registerTask 'done', 'done', -> tasksDone = true grunt.task.run(['create-windows-installer', 'done']).start() waitsFor -> tasksDone runs -> expect(fs.existsSync(path.join(outputDirectory, 'myapp.nupkg'))).toBe true _ = require "underscore" module.exports = (target, source) -> _.extend {}, target, _.pick(source, [ "commandId" "stepId" "userId" "avatarId" ])# Keybindings require three things to be fully defined: A selector that is # matched against the focused element, the keystroke and the command to # execute. # # Below is a basic keybinding which registers on all platforms by applying to # the root workspace element. # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps '.editor': 'ctrl-cmd-/': 'vertical-align:align' class EnvironmentRuleItem extends EnvironmentItem constructor: (options = {}, data) -> options.cssClass = 'rule' options.joints = ['right'] options.allowedConnections = EnvironmentDomainItem : ['left'] super options, data contextMenuItems: -> colorSelection = new ColorSelection selectedColor : @getOption 'colorTag' colorSelection.on "ColorChanged", @bound 'setColorTag' items = Edit : disabled : KD.isGuest() action : 'edit' Delete : disabled : KD.isGuest() action : 'delete' separator : yes customView : colorSelection return items cmedit: -> new AddFirewallRuleModal {}, @getData() confirmDestroy: -> data = @getData() options = deleteMesage : "#{data.name} has been removed." content : "
      This will remove the rule #{data.name} permanently, there is no way back!
      " deletionModal = new DomainDeletionModal options, @getData() deletionModal.on "domainRemoved", @bound "destroy" Meteor.methods sendMessageLivechat: (message) -> if s.trim(message.msg) isnt '' if isNaN(TimeSync.serverOffset()) message.ts = new Date() else message.ts = new Date(Date.now() + TimeSync.serverOffset()) message.u = _id: Meteor.userId() username: 'visitor' message.temp = true # message = RocketChat.callbacks.run 'beforeSaveMessage', message ChatMessage.insert message _ = require 'underscore' module.exports = projectPaths: null fuzzyFinderView: null loadPathsTask: null activate: (state) -> rootView.command 'fuzzy-finder:toggle-file-finder', => @createView().toggleFileFinder() rootView.command 'fuzzy-finder:toggle-buffer-finder', => @createView().toggleBufferFinder() rootView.command 'fuzzy-finder:find-under-cursor', => @createView().findUnderCursor() rootView.command 'fuzzy-finder:toggle-git-status-finder', => @createView().toggleGitFinder() if project.getPath()? LoadPathsTask = require 'fuzzy-finder/lib/load-paths-task' @loadPathsTask = new LoadPathsTask((paths) => @projectPaths = paths) @loadPathsTask.start() for editSession in project.getEditSessions() editSession.lastOpened = state[editSession.getPath()] deactivate: -> @loadPathsTask?.abort() @loadPathsTask = null @fuzzyFinderView?.cancel() @fuzzyFinderView = null @projectPaths = null serialize: -> @fuzzyFinderView?.getOpenedPaths() createView: -> unless @fuzzyFinderView FuzzyFinderView = require 'fuzzy-finder/lib/fuzzy-finder-view' @fuzzyFinderView = new FuzzyFinderView() if @projectPaths?.length > 0 and not @fuzzyFinderView.projectPaths? @fuzzyFinderView.projectPaths = @projectPaths @fuzzyFinderView.reloadProjectPaths = false @fuzzyFinderView _ = require 'underscore' Backbone = require 'backbone' qs = require 'qs' FilterArtworks = require '../../collections/filter_artworks.coffee' FilterView = require './view.coffee' { FILTER_ROOT } = require('sharify').data module.exports = setupFilter: (options) -> defaults = startHistory: yes { aggregations, el, stuckParam, stuckFacet } = _.defaults options, defaults queryParams = qs.parse(location.search.replace(/^\?/, '')) params = new Backbone.Model _.extend queryParams, page: 1 size: 10 aggregations: aggregations for_sale: true if stuckParam params.set stuckParam, stuckFacet.id collection = new FilterArtworks view = new FilterView el: el collection: collection params: params stuckFacet: stuckFacet stuckParam: stuckParam aggregations: aggregations collection.fetch data: params.toJSON() success: -> collection.trigger 'initial:fetch' { params: params, collection: collection, view: view } DB = require '../lib/db' describe "DB", -> db = null test1 = off test2 = off data = testproject1: title: "Test project 1" group: "Test" paths: [ "/Users/project-1" ] testproject2: title: "Test project 2" paths: [ "/Users/project-2" ] beforeEach -> db = new DB() spyOn(db, 'readFile').andCallFake (callback) -> callback(data) spyOn(db, 'writeFile').andCallFake (projects, callback) -> data = projects callback() it "finds all projects when given no options", -> runs -> db.find (projects) -> expect(projects.length).toBe 2 test1 = on it "can add and delete a project", -> waitsFor -> test1 project3 = title: "Test project 3" paths: [ "/Users/project-3" ] runs -> db.add project3, (id) -> expect(id).toBe 'testproject3' db.find (projects) -> expect(projects.length).toBe 3 db.delete "testproject3", () -> db.find (projects) -> expect(projects.length).toBe 2_ = require 'underscore' Backbone = require 'backbone' Items = require '../collections/items.coffee' LayoutSyle = require './mixins/layout_style.coffee' { Image, Markdown } = require 'artsy-backbone-mixins' { SECURE_IMAGES_URL } = require('sharify').data module.exports = class FeaturedLink extends Backbone.Model _.extend @prototype, Image(SECURE_IMAGES_URL) _.extend @prototype, Markdown _.extend @prototype, LayoutSyle imageUrlForLayout: (collectionLength) -> @imageUrl @imageSizeForLayout collectionLength hasImageForLayout: (collectionLength) -> @hasImage @imageSizeForLayout collectionLength # Description: # Report the status of a Minecraft server # Uses http://api.syfaro.net/ # # Dependencies: # None # # Configuration: # server_url and server_port, below # # Commands: # mcstatus - Report the status of the configured minecraft server. # # Author: # annabunches default_url = 'mc.wtf.cat' default_port = '10070' get_mc_server_status = (msg, url, port) -> msg.http(request_url) .header(Accept: 'application/json') .get() (err, res, body) -> request_url = "http://api.syfaro.net/server/status?ip=#{url}&port=#{port}&players=true" if err? msg.send "Error: #{err}" return try data = JSON.parse(body) catch error msg.send "Error parsing JSON" return if not data.online status = "offline." else status = "online, with #{data.players.now}/#{data.players.max} players." if data.players.now > 0 status += ' (' + [player.name for player in data.players.sample].join(', ') + ')' msg.send "Minecraft server #{url}:#{port} is #{status}" module.exports = (robot) -> robot.respond /mcstatus/i, (res) -> get_mc_server_status(res, default_url, default_port) fs = require 'fs' path = require 'path' grunt = require 'grunt' temp = require 'temp' describe 'create-windows-installer task', -> it 'creates a nuget package', -> outputDirectory = temp.mkdirSync('grunt-atom-shell-installer-') grunt.config.init pkg: grunt.file.readJSON(path.join(__dirname, 'fixtures', 'app', 'resources', 'app', 'package.json')) 'create-windows-installer': appDirectory: path.join(__dirname, 'fixtures', 'app') outputDirectory: outputDirectory grunt.loadTasks(path.resolve(__dirname, '..', 'tasks')) tasksDone = false grunt.registerTask 'done', 'done', -> tasksDone = true grunt.task.run(['create-windows-installer', 'done']).start() waitsFor -> tasksDone runs -> expect(fs.existsSync(path.join(outputDirectory, 'myapp.nupkg'))).toBe true {Emitter} = require 'event-kit' # Experimental: This will likely change, do not use. module.exports = class Notification constructor: (@type, @message, @options={}) -> @emitter = new Emitter @timestamp = new Date() @dismissed = true @dismissed = false if @isDismissable() @displayed = false onDidDismiss: (callback) -> @emitter.on 'did-dismiss', callback onDidDisplay: (callback) -> @emitter.on 'did-display', callback getOptions: -> @options getType: -> @type getMessage: -> @message getTimestamp: -> @timestamp getDetail: -> @options.detail isEqual: (other) -> @getMessage() is other.getMessage() \ and @getType() is other.getType() \ and @getDetail() is other.getDetail() dismiss: -> return unless @isDismissable() and not @isDismissed() @dismissed = true @emitter.emit 'did-dismiss', this isDismissed: -> @dismissed isDismissable: -> !!@options.dismissable wasDisplayed: -> @displayed setDisplayed: (@displayed) -> @emitter.emit 'did-display', this getIcon: -> return @options.icon if @options.icon? switch @type when 'fatal' then 'bug' when 'error' then 'flame' when 'warning' then 'alert' when 'info' then 'info' when 'success' then 'check' Handlebars.registerHelper 'ifEqual', (v1, v2, options) -> if v1 is v2 then options.fn @ else options.inverse @ Handlebars.registerHelper 'ifLT', (v1, v2, options) -> if v1 < v2 then options.fn @ else options.inverse @ Handlebars.registerHelper 'ifGT', (v1, v2, options) -> if v1 > v2 then options.fn @ else options.inverse @ Handlebars.registerHelper 'pluralize', (number, single, plural) -> if number is 1 then single else plural Handlebars.registerHelper 'hardBreak', (string, options) -> string?.replace(/(:|-)/g, '$1') Handlebars.registerHelper 'eachWithFn', (items, options) -> _(items).map((item, i, items) => item._counter = i item._1counter = i + 1 item._first = if i is 0 then true else false item._last = if i is (items.length - 1) then true else false item._even = if (i + 1) % 2 is 0 then true else false item._thirded = if (i + 1) % 3 is 0 then true else false item._sixthed = if (i + 1) % 6 is 0 then true else false _.isFunction(options.hash.fn) and options.hash.fn.apply options, [item, i, items] options.fn(item) ).join('') fs = require 'fs' path = require 'path' grunt = require 'grunt' temp = require 'temp' describe 'create-windows-installer task', -> it 'creates a nuget package', -> outputDirectory = __dirname grunt.config.init pkg: grunt.file.readJSON(path.join(__dirname, 'fixtures', 'app', 'resources', 'app', 'package.json')) 'create-windows-installer': appDirectory: path.join(__dirname, 'fixtures', 'app') outputDirectory: outputDirectory grunt.loadTasks(path.resolve(__dirname, '..', 'tasks')) tasksDone = false grunt.registerTask 'done', 'done', -> tasksDone = true grunt.task.run(['create-windows-installer', 'done']).start() waitsFor 30000, -> tasksDone runs -> expect(fs.existsSync(path.join(outputDirectory, 'myapp.1.0.0.nupkg'))).toBe true Backbone = require 'backbone' ArtworkFilterRouter = require './router.coffee' module.exports.init = (options = {}) -> new ArtworkFilterRouter options require './analytics.coffee' Backbone.history.start(pushState: true) unless Backbone.History.started DeferredAtomPackage = require 'deferred-atom-package' LoadPathsTask = require './src/load-paths-task' module.exports = class FuzzyFinder extends DeferredAtomPackage loadEvents: [ 'fuzzy-finder:toggle-file-finder' 'fuzzy-finder:toggle-buffer-finder' 'fuzzy-finder:find-under-cursor' ] instanceClass: 'fuzzy-finder/src/fuzzy-finder-view' activate: (rootView) -> super if rootView.project.getPath()? callback = (paths) => @projectPaths = paths new LoadPathsTask(rootView, callback).start() onLoadEvent: (event, instance) -> if @projectPaths? and not @instance.projectPaths? @instance.projectPaths = @projectPaths @instance.reloadProjectPaths = false switch event.type when 'fuzzy-finder:toggle-file-finder' instance.toggleFileFinder() when 'fuzzy-finder:toggle-buffer-finder' instance.toggleBufferFinder() when 'fuzzy-finder:find-under-cursor' instance.findUnderCursor() # # The artist page found at /artist/:id. # express = require 'express' routes = require './routes' sections = require './sections' timeout = require 'connect-timeout' uncapitalize = require 'express-uncapitalize' app = module.exports = express() app.set 'views', __dirname + '/templates' app.set 'view engine', 'jade' app.get '/artist/:id/follow', routes.follow app.get '/artist/:id', timeout('25s'), uncapitalize(), routes.index for { slug } in sections app.get "/artist/:id/#{slug}", uncapitalize(), routes.tab _ = require 'underscore' Backbone = require 'backbone' View = require './view.coffee' Jump = require '../../../components/jump/view.coffee' module.exports = class PartnershipsRouter extends Backbone.Router routes: 'gallery-partnerships': 'toTop' 'gallery-partnerships/:slug': 'toSection' 'institution-partnerships': 'toTop' 'institution-partnerships/:slug': 'toSection' 'auction-partnerships': 'toTop' 'auction-partnerships/:slug': 'toSection' initialize: -> @$window = $(window) @$body = $('body') @view = new View el: @$body @setupJump() setupJump: -> @jump = new Jump threshold: @$window.height(), direction: 'bottom' @$body.append @jump.$el toTop: -> @jump.scrollToTop() if @$window.scrollTop() isnt 0 toSection: (slug) -> $nav = $ '.partnerships-section-nav' selector = "##{slug}" @jump.scrollToPosition $(selector)?.offset()?.top - $nav.outerHeight() / 2 Augury.Views.Home.Index = Backbone.View.extend( initialize: -> render: -> @env = _(Augury.connections).findWhere(id: Augury.env.id) @$el.html JST["admin/templates/home/index"](env: @env) $('#content-header').find('.page-title').text('Overview') this ) $ -> projects = $('#projects').clone() $('#languages a').click (e) -> language = $(this).data().language $('#noprojects').hide() if language? language = [language] unless $.isArray(language) $('#languages li') .addClass('disabled') .find($.map(language, (l) -> "a[data-language=#{l}]").join(',')) .add(this) .parent('li') .removeClass('disabled') $('#projects').quicksand $(projects).find(".#{language.join(', .')}"), duration: 0, -> if $('#projects .project:visible').length == 0 $('#noprojects').show() else $('#languages li').removeClass('disabled') $('#projects').html(projects.find('.project')) projects = $('#projects').clone() $('#projects').css('height', 'auto') return false cozydb = require 'cozydb' tagsView = map: (doc) -> doc.tags?.forEach? (tag, index) -> type = if index is 0 then 'calendar' else 'tag' emit [type, tag], true reduce: "_count" module.exports = tag: byName : cozydb.defaultRequests.by 'name' alarm: all : cozydb.defaultRequests.all byDate : (doc) -> emit new Date(doc.trigg), doc tags : tagsView event: all : cozydb.defaultRequests.all byDate : (doc) -> emit new Date(doc.start), doc tags : tagsView byCalendar: cozydb.defaultRequests.by 'tags[0]' contact: all : cozydb.defaultRequests.all webdavaccount: all : cozydb.defaultRequests.all `import Em from "vendor/ember"` Component = Em.Component.extend type: Em.computed "content.type", -> "oxisection-" + @get "content.type" actions: buttonClick: (button) -> Em.set button, "loading", true if button.action @container.lookup("route:openxpki").sendAjax data: action:button.action .then -> Em.set button, "loading", false , -> Em.set button, "loading", false else console.log('Transition'); @container.lookup("route:openxpki").transitionTo "openxpki", btn.page `export default Component` Backbone = require 'backbone' template = -> require('./index.jade') arguments... module.exports = class CategoryFilterView extends Backbone.View events: 'click .cf-categories__category' : 'toggleCategory' initialize: ({ @params, @aggregations, @categoryMap }) -> throw new Error "Requires a params model" unless @params throw new Error "Requires an aggregations collection" unless @aggregations @listenTo @params, 'change:medium change:gene_id', @render @listenTo @aggregations, 'reset', @render setCategory: (e) -> @params.set gene_id: $(e.currentTarget).data('id') toggleCategory: (e) -> category = $(e.currentTarget).data('id') if @params.get('gene_id') is category @params.unset('gene_id') else @params.set gene_id: category, page: 1 hasResults: (counts, id) -> _.any counts, (count) -> count.id is id render: -> @$el.html template categories: @categoryMap[@params.get('medium') || 'global'] selectedCategory: @params.get('gene_id') hasResults: @hasResults counts: @aggregations.get('MEDIUM')?.get('counts') fs = require 'fs' p = require 'path' minimatch = require 'minimatch' clone = require 'clone' util = require './util' config = require '../config' module.exports = read: (path) -> fs.readFileSync(path) .toString() .trim() find: (path, version) -> try util.log path, "Looking for #{version}" for dir in fs.readdirSync(config.nvmPath).reverse() if minimatch dir, "v#{version}*" PATH = "#{config.nvmPath}/#{dir}/bin" util.log path, "Using #{PATH}" return PATH catch nvmrc: (path) -> try version = @read "#{path}/.nvmrc" util.log path, "Detected .nvmrc" @find path, version catch nvmDefault: (path) -> try version = @read "#{config.nvmPath}/alias/default" util.log path, "Detected ~/.nvm/alias/default" @find path, version catch node: -> nodePath = p.dirname(process.execPath) "/usr/local/bin:#{nodePath}" getPATH: (path) -> PATH = @nvmrc path PATH or= @nvmDefault path PATH or= @node() PATH get: (path, port) -> processEnv = clone process.env processEnv.PORT = port processEnv.PATH = "#{@getPATH(path)}:#{processEnv.PATH}" processEnv# lulz - BRING THE LOLZ from bukk.it Select = require("soupselect").select HtmlParser = require "htmlparser" util = require 'util' module.exports = (robot) -> robot.respond /l[ou]lz/i, (msg) -> msg.http("http://bukk.it") .get() (err, res, body) -> handler = new HtmlParser.DefaultHandler() parser = new HtmlParser.Parser handler parser.parseComplete body results = ("http://bukk.it/#{link.attribs.href}" for link in Select handler.dom, "td a") msg.send msg.random results _ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask aborted: false constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['-l', rootPath] args.unshift("--addVCSIgnores") if config.get('nak.addVCSIgnores') args.unshift("-d", ignoredNames.join(',')) if ignoredNames.length > 0 paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths = paths.concat(_.compact(data.split("\n"))) new BufferedProcess({command, args, stdout, exit}) deferred abort: -> @aborted = true $ -> $('.housing-location-table').DataTable({ dom: "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>", pagingType: "simple_numbers", "columnDefs": [ { "orderable": false, "targets": [5,6,7,8] }, { "searchable": false, "targets": [2,3,4,5,6,7,8] } ], "dom": '<"wrapper"ftpr>' }) $('.housing-location-table-no-edit').DataTable({ dom: "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>", pagingType: "simple_numbers", "columnDefs": [ { "orderable": false, "targets": [5,6,7,8] }, { "searchable": false, "targets": [2,3,4,5,6,7,8] } ], "dom": '<"wrapper"ftpr>' }) $('div.dataTables_filter input').focus() _ = require 'underscore' module.exports = projectPaths: null fuzzyFinderView: null loadPathsTask: null activate: (state) -> rootView.command 'fuzzy-finder:toggle-file-finder', => @createView().toggleFileFinder() rootView.command 'fuzzy-finder:toggle-buffer-finder', => @createView().toggleBufferFinder() rootView.command 'fuzzy-finder:find-under-cursor', => @createView().findUnderCursor() rootView.command 'fuzzy-finder:toggle-git-status-finder', => @createView().toggleGitFinder() if project.getPath()? PathLoader = require './path-loader' @loadPathsTask = PathLoader.startTask (paths) => @projectPaths = paths for editSession in project.getEditSessions() editSession.lastOpened = state[editSession.getPath()] deactivate: -> if @loadPathsTask? @loadPathsTask.terminate() @loadPathsTask = null if @fuzzyFinderView? @fuzzyFinderView.cancel() @fuzzyFinderView.remove() @fuzzyFinderView = null @projectPaths = null serialize: -> if @fuzzyFinderView? paths = {} for editSession in project.getEditSessions() path = editSession.getPath() paths[path] = editSession.lastOpened if path? paths createView: -> unless @fuzzyFinderView @loadPathsTask?.terminate() FuzzyFinderView = require './fuzzy-finder-view' @fuzzyFinderView = new FuzzyFinderView(@projectPaths) @fuzzyFinderView # Description # Blames Obama for everything that's bad in your life. # # Dependencies: # "cheerio": "0.10.7", # "request": "2.14.0" # # Configuration: # None # # Commands: # thanks obama - A random image from http://thanks-obama.tumblr.com # # Notes: # It would be nice if we could load a larger sample of images. # # Author: # raykrueger # request = require 'request' cheerio = require 'cheerio' url = "http://thanks-obama.tumblr.com/" module.exports = (robot) -> robot.hear /thanks obama/i, (msg) -> request url, (error, response, body)-> throw error if error $ = cheerio.load(body) images = $("div.cont.group img").toArray() image = images[Math.floor(Math.random()*images.length)] msg.send $(image).attr("src") if image ProjectMonitor.Views ||= {} class ProjectMonitor.Views.HomeView extends Backbone.View tagName: "ol" className: "projects" template: JST["backbone/templates/home"] initialize: (options) -> @_addTileView(tile) for tile in @collection.models @collection.on 'reset', => for cid,view of @subViews view.tearDown() for model in @collection.models @_addTileView(model) @render() @collection.on 'add', (model) => unless model.id in (view.model.id for cid,view of @subViews) @_addTileView(model) @render() @collection.on 'remove', (model) => viewsToDelete = (view for cid,view of @subViews when view.model.id == model.id) for view in viewsToDelete view.tearDown() _addTileView: (model) -> if model.get("aggregate") view = new ProjectMonitor.Views.AggregateProjectView(model: model) else view = new ProjectMonitor.Views.ProjectView(model: model) @registerSubView(view) render: -> @$el.empty() @$el.append(subview.render().$el) for cid,subview of @subViews @ path = require 'path' {fs} = require 'atom' Dialog = require './dialog' module.exports = class MoveDialog extends Dialog constructor: (@initialPath) -> if fs.isDirectorySync(@initialPath) prompt = 'Enter the new path for the directory.' else prompt = 'Enter the new path for the file.' super prompt: prompt initialPath: atom.project.relativize(@initialPath) select: true iconClass: 'icon-arrow-right' onConfirm: (newPath) -> newPath = atom.project.resolve(newPath) if @initialPath is newPath @close() return if fs.existsSync(newPath) @showError("'#{newPath}' already exists. Try a different path.") return directoryPath = path.dirname(newPath) try fs.makeTreeSync(directoryPath) unless fs.existsSync(directoryPath) fs.moveSync(@initialPath, newPath) if repo = atom.project.getRepo() repo.getPathStatus(@initialPath) repo.getPathStatus(newPath) @close() catch error @showError("#{error.message} Try a different path.") class Kandan.Views.Chatbox extends Backbone.View template: JST['chatbox'] tagName: 'div' className: 'chatbox' events: "keypress .chat-input": 'postMessageOnEnter' "click .post" : 'postMessage' postMessageOnEnter: (event)-> if event.keyCode == 13 @postMessage(event) event.preventDefault() postMessage: (event)-> $chatbox = $(event.target).parent().find(".chat-input") chatInput = $chatbox.val() return false if chatInput.trim().length==0 activity = new Kandan.Models.Activity({ 'content': chatInput, 'action': 'message', 'channel_id': @channel.get('id') }) $chatbox.val("") Kandan.Helpers.Channels.addActivity( _.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()), Kandan.Helpers.Activities.ACTIVE_STATE, true ) activity.save({},{success: (model, response)-> $("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}") $scrollbox = $(event.target).parent().find(".paginated-activities") $scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight')) }) render: ()-> @channel = @options.channel $(@el).html(@template()) @ RocketChat.settings.onload 'Site_Url', (key, value, initialLoad) -> if value?.trim() isnt '' __meteor_runtime_config__.ROOT_URL = value if Meteor.absoluteUrl.defaultOptions?.rootUrl? Meteor.absoluteUrl.defaultOptions.rootUrl = value if window.location.pathname.match(/\/apply$/) $ -> changeSection = -> hash = window.location.hash sectionId = hash.substring 1 $('.section').each ()-> section = $ @ if section.attr('id') is sectionId section.toggleClass 'hide', false else section.toggleClass 'hide', true $('.wizard-nav a').each ()-> link = $ @ parent = link.parent() if link.attr('href') is hash parent.toggleClass 'active', true else parent.toggleClass 'active', false scrollToTop = -> window.scrollTo 0, 0 $(window).on 'hashchange', changeSection $(window).on 'hashchange', scrollToTop showDownloadWarning = -> $('#download-warning').modal() submitUpdateForm = -> $('#update-button').submit() initialize = (e)-> $('.download-forms').click( showDownloadWarning submitUpdateForm ) firstSectionHash = $('.wizard-nav a').eq(0).attr 'href' if window.location.hash.length <= 1 window.location.hash = firstSectionHash else changeSection() $(document).ajaxComplete initialize initialize() Backbone = require 'backbone' { acquireArtwork } = require('../../../../components/acquire/view.coffee') module.exports = class MetaDataView extends Backbone.View events: 'click #artwork-page-edition-sets input[type=radio]': 'addEditionToOrder' 'click .js-purchase': 'buy' initialize: -> @editionSetId = @$('#artwork-page-edition-sets li').first().find('input').val() addEditionToOrder: (e) -> @editionSetId = $(e.target).val() buy: (e) -> acquireArtwork @model, $(e.target), @editionSetId _ = require 'underscore' Backbone = require 'backbone' module.exports = class Params extends Backbone.Model urlWhitelist:[ 'page' 'medium' 'color', 'price_range', 'width', 'height', 'gene_id', 'sort', 'major_periods', 'partner_cities' ] defaults: size: 50 page: 1 for_sale: true color: null medium: null major_periods: [] partner_cities: [] aggregations: ['TOTAL', 'COLOR', 'MEDIUM', 'MAJOR_PERIOD', 'PARTNER_CITY'] ranges: price_range: min: 50.00 max: 50000.00 width: min: 1 max: 120 height: min: 1 max: 120 initialize: (attributes, { @categoryMap, @fullyQualifiedLocations }) -> current: -> categories = @categoryMap[@get('medium') || 'global'] extra_aggregation_gene_ids = _.pluck categories, 'id' _.extend @attributes, extra_aggregation_gene_ids: extra_aggregation_gene_ids, aggregation_partner_cities: @allLocations() allLocations: -> @fullyQualifiedLocations.concat((@get('aggregation_partner_cities') || [])).concat @get('partner_cities') whitelisted: -> whitelisted = _.pick @current(), @urlWhitelist omitted = _.omit whitelisted, (val, key) -> (key is 'page' and val is 1) or not val? Tasks = require './Tasks' Task = require '../models/Task' class TasksActive extends Tasks model: Task url: "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/tasks/active" parse: (tasks) -> _.each tasks, (task, i) => task.JSONString = utils.stringJSON task task.id = task.taskId.id task.name = task.mesosTask.name task.resources = @parseResources task task.memoryHuman = if task.resources?.memoryMb? then "#{ task.resources.memoryMb }Mb" else '' task.host = task.offer.hostname?.split('.')[0] task.startedAt = task.taskId.startedAt task.startedAtHuman = moment(task.taskId.startedAt).from() task.rack = task.taskId.rackId tasks[i] = task app.allTasks[task.id] = task tasks parseResources: (task) -> cpus: _.find(task.mesosTask.resources, (resource) -> resource.name is 'cpus')?.scalar?.value ? '' memoryMb: _.find(task.mesosTask.resources, (resource) -> resource.name is 'mem')?.scalar?.value ? '' comparator: 'startedAt' module.exports = TasksActiveCollection = require './collection' class Webhooks extends Collection model: require '../models/Webhook' url: "#{ env.SINGULARITY_BASE }/#{ constants.apiBase }/webhooks" parse: (webhooks) => _.each webhooks, (webhook, i) => webhooks[i] = url: webhook webhooks comparator: 'url' module.exports = WebhooksBackbone = require 'backbone' Form = require '../../form/index.coffee' CurrentUser = require '../../../models/current_user.coffee' module.exports = class ContactView extends Backbone.View className: 'scontact' template: (->) events: 'click button': 'submit' initialize: -> @user = CurrentUser.orNull() submit: (e) -> @form ?= new Form model: @model, $form: @$('form') @form.submit e render: -> @$el.html @template(user: @user) this jQuery -> $('.locales a:first').tab('show') $('.accordion-body').on('hidden', -> $(@).prev().find('i').first().removeClass().addClass('icon-chevron-right') ) $('.accordion-body').on('shown', -> $(@).prev().find('i').first().removeClass().addClass('icon-chevron-down')) $('body').on('.toggle-hidden', 'click', -> $(@).parents('td').find('div:hidden').show() false) $('#request_hidden_user_explanation_reasons').on('click', 'input', -> $('#request_hidden_user_subject, #request_hidden_user_explanation, #request_hide_button').show() info_request_id = $('#hide_request_form').attr('data-info-request-id') reason = $(this).val() $('#request_hidden_user_explanation_field').val("[loading default text...]") $.ajax "/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, type: "GET" dataType: "text" error: (data, textStatus, jqXHR) -> $('#request_hidden_user_explanation_field').val("Error: #{textStatus}") success: (data, textStatus, jqXHR) -> $('#request_hidden_user_explanation_field').val(data) ) # Your keymap # # Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors # to apply styles to elements, Atom keymaps use selectors to associate # keystrokes with events in specific contexts. # # You can create a new keybinding in this file by typing "key" and then hitting # tab. # # Here's an example taken from Atom's built-in keymap: # # '.editor': # 'enter': 'editor:newline' # # '.workspace': # 'ctrl-P': 'core:move-up' # 'ctrl-p': 'core:move-down' # # In the example above, 'ctrl-P' is equivalent to 'ctrl-shift-p'. # # You can find more information about keymaps in these guides: # * https://atom.io/docs/latest/customizing-atom#customizing-key-bindings # * https://atom.io/docs/latest/advanced/keymaps `import TravisRoute from 'travis/routes/basic'` Route = TravisRoute.extend renderTemplate: -> @render 'repo' @render 'build', into: 'repo' setupController: -> @_super.apply this, arguments @controllerFor('repo').activate('index') @controllerFor('repos').activate(@get('reposTabName')) @currentRepoDidChange() @controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange') deactivate: -> @controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange') currentRepoDidChange: -> if repo = @controllerFor('repos').get('firstObject') @controllerFor('repo').set('repo', repo) actions: redirectToGettingStarted: -> @transitionTo('getting_started') `export default Route` $ = require 'jquery' {$$} = require 'space-pen' module.exports = class Gists @activate: -> new Gists constructor: -> rootView.command 'gist:create', '.editor', => @createGist() createGist: -> editor = rootView.getActiveView() return unless editor? gist = { public: false, files: {} } gist.files[editor.getBuffer().getBaseName()] = content: editor.getSelectedText() or editor.getText() $.ajax url: 'https://api.github.com/gists' type: 'POST' dataType: 'json' contentType: 'application/json; charset=UTF-8' data: JSON.stringify(gist) success: (response) => pasteboard.write(response.html_url) notification = $$ -> @div class: 'notification', => @span class: 'icon icon-gist mega-icon' @div class: 'content', => @h3 "Gist #{response.id} created", class: 'title' @p "The url is on your clipboard", class: 'message' rootView.append(notification.hide()) notification.fadeIn().delay(2000).fadeOut(complete: -> $(this).remove()) async = require 'async' Account = require '../models/account' CozyInstance = require '../models/cozy_instance' fixtures = require 'cozy-fixtures' module.exports.main = (req, res, next) -> async.parallel [ (cb) -> CozyInstance.getLocale cb (cb) -> Account.getAll cb ], (err, results) -> if err? # for now we handle error case loosely res.render 'index.jade', imports: "" else [locale, accounts] = results accounts = accounts.map Account.clientVersion res.render 'index.jade', imports: """ window.locale = "#{locale}"; window.accounts = #{JSON.stringify accounts}; """ module.exports.loadFixtures = (req, res, next) -> fixtures.load silent: true, callback: (err) -> if err? then next err else res.send 200, message: 'LOAD FIXTURES SUCCESS' _ = require 'underscore' child_process = require 'child_process' EventEmitter = require 'event-emitter' module.exports = class Task callback: null constructor: (taskPath) -> bootstrap = """ require('coffee-script'); require('coffee-cache').setCacheDir('/tmp/atom-coffee-cache'); require('task-bootstrap'); """ taskPath = require.resolve(taskPath) env = _.extend({}, process.env, {taskPath, userAgent: navigator.userAgent}) args = [bootstrap, '--harmony_collections'] @childProcess = child_process.fork '--eval', args, {env, cwd: __dirname} @on "task:log", -> console.log(arguments...) @on "task:warn", -> console.warn(arguments...) @on "task:error", -> console.error(arguments...) @on "task:completed", (args...) => @callback(args...) @handleEvents() handleEvents: -> @childProcess.removeAllListeners() @childProcess.on 'message', ({event, args}) => @trigger(event, args...) start: (args...) -> @handleEvents() @callback = args.pop() @childProcess.send({args}) terminate: -> return unless @childProcess? @childProcess.removeAllListeners() @childProcess.kill() @childProcess = null @off() _.extend Task.prototype, EventEmitter #= require_self #= require_tree . DotLedger.module 'Collections', -> class @Base extends Backbone.Collection parse: (response, options)-> @_fetch_options_data = options.data || {} @pagination = JSON.parse options.xhr.getResponseHeader('X-Pagination') @metadata = JSON.parse options.xhr.getResponseHeader('X-Metadata') response nextPage: -> @trigger 'page:change', @pagination.next_page if @pagination && @pagination.next_page? data = _.extend( @_fetch_options_data, page: @pagination.next_page ) @fetch reset: true data: data previousPage: -> @trigger 'page:change', @pagination.previous_page if @pagination && @pagination.previous_page? data = _.extend( @_fetch_options_data, page: @pagination.previous_page ) @fetch reset: true data: data _ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['-l', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('-d', ignoredNames.join(',')) if ignoredNames.length > 0 args.unshift('--follow') paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths.push(_.compact(data.split('\n'))...) @process = new BufferedProcess({command, args, stdout, exit}) deferred abort: -> if @process? @process.kill() @process = null ### # Hilights is a named function that will process Highlights # @param {Object} message - The message object ### class HighlightWordsClient constructor: (message) -> msg = message if not _.isString message if _.trim message.html msg = message.html else return message to_highlight = Meteor.user()?.settings?.preferences?['highlights'] _.forEach to_highlight, (highlight) -> if not _.isBlank(highlight) msg = msg.replace(new RegExp("(^|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(#{s.escapeRegExp(highlight)})($|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(?![^<]*>|[^<>]*<\\/)", 'gmi'), '$1$2$3') message.html = msg return message RocketChat.callbacks.add 'renderMessage', HighlightWordsClient util = require "./util" bcrypt = require "bcrypt" _ = require "lodash" checkLists = (fromDevice, toDevice, whitelist, blacklist, openByDefault) -> return false if !fromDevice or !toDevice return true if toDevice.uuid == fromDevice.uuid return true if toDevice.owner == fromDevice.uuid return _.contains(whitelist, fromDevice.uuid) if whitelist and whitelist.length return !_.contains(blacklist, fromDevice.uuid) if blacklist and blacklist.length openByDefault module.exports = canDiscover: (fromDevice, toDevice) -> checkLists fromDevice, toDevice, toDevice?.discoverWhitelist, toDevice?.discoverBlacklist, true canReceive: (fromDevice, toDevice) -> checkLists fromDevice, toDevice, toDevice?.receiveWhitelist, toDevice?.receiveBlacklist, false canSend: (fromDevice, toDevice) -> checkLists fromDevice, toDevice, toDevice?.sendWhitelist, toDevice?.sendBlacklist, false canConfigure: (fromDevice, toDevice, message) -> return false if !fromDevice or !toDevice if toDevice.token and message and message.token return true if bcrypt.compareSync message.token, toDevice.token return true if fromDevice.uuid == toDevice.uuid return toDevice.owner == fromDevice.uuid if toDevice.owner return util.sameLAN fromDevice.ipAddress, toDevice.ipAddress module.exports = process.atomBinding 'shell' if process.platform is 'win32' and process.type is 'renderer' module.exports.showItemInFolder = require('remote').process.atomBinding('shell').showItemInFolder define [ 'react' 'timezone' 'underscore' 'jquery' 'jquery.instructure_date_and_time' ], (React, tz, _, $) -> FriendlyDatetime = React.createClass propTypes: datetime: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.instanceOf(Date) ]) render: -> datetime = @props.datetime return React.DOM.time() unless datetime? datetime = tz.parse(datetime) unless _.isDate datetime fudged = $.fudgeDateForProfileTimezone(datetime) timeTitle = $.datetimeString(datetime) @transferPropsTo React.DOM.time { title: $.datetimeString(datetime) dateTime: datetime.toISOString() }, React.DOM.span className: 'visible-desktop', # something like: Mar 6, 2014 $.friendlyDatetime(fudged) React.DOM.span className: 'hidden-desktop', # something like: 3/3/2014 fudged.toLocaleDateString() 'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new application. You can specify directory on disk, Git URL or GitHub url (gh:user/repo). Some suggestions: * `gh:brunch/dead-simple` if you want no opinions. Just initializes configs and empty directories. * `gh:paulmillr/brunch-with-chaplin`: Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) } module.exports = """ query artist($artist_id: String!, $shows: Boolean!, $articles: Boolean!) { artist(id: $artist_id) { ... on Artist @include(if: $shows) { group_shows: shows(at_a_fair: false, solo_show:false, sort: start_at_desc, is_reference: true, size: 99) { ... relatedShow } solo_shows: shows(at_a_fair: false, solo_show:true, sort: start_at_desc, is_reference: true, size: 99) { ... relatedShow } fair_booths: shows(at_a_fair: true, sort: start_at_desc, size: 99) { ... relatedShow } } articles (limit: 99, sort: PUBLISHED_AT_DESC) @include(if: $articles) { href thumbnail_title published_at } } } #{require './show_fragment.coffee'} """{Document, Point, Range} = require 'telepath' module.exports = _: require 'underscore-plus' BufferedNodeProcess: require '../src/buffered-node-process' BufferedProcess: require '../src/buffered-process' Directory: require '../src/directory' Document: Document File: require '../src/file' fs: require 'fs-plus' Git: require '../src/git' Point: Point Range: Range # The following classes can't be used from a Task handler and should therefore # only be exported when not running as a child node process unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE {$, $$, $$$, View} = require '../src/space-pen-extensions' module.exports.$ = $ module.exports.$$ = $$ module.exports.$$$ = $$$ module.exports.Editor = require '../src/editor-view' module.exports.WorkspaceView = require '../src/workspace-view' module.exports.SelectList = require '../src/select-list' module.exports.ScrollView = require '../src/scroll-view' module.exports.Task = require '../src/task' module.exports.View = View $ -> $(":checkbox").change -> id = $(this).val() checked = $(this).is(":checked") url = $(this).data("url") $.ajax type: "PUT" url: url dataType: "json" data: id: id developers_can_push: checked success: -> new Flash("Branch updated.", "notice") location.reload true error: -> new Flash("Failed to update branch!", "alert") $(document).on("click", '.toggle-nav-collapse', (e) -> e.preventDefault() collapsed = 'page-sidebar-collapsed' expanded = 'page-sidebar-expanded' $('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}") $('header').toggleClass("header-collapsed header-expanded") $('.sidebar-wrapper').toggleClass("sidebar-collapsed sidebar-expanded") $('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left") $.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' }) ) path = require "path" fs = require "fs-plus" module.exports = class StorageFolder constructor: (containingPath) -> @path = path.join(containingPath, "storage") if containingPath? storeSync: (name, object) -> return unless @path? fs.writeFileSync(@pathForKey(name), JSON.stringify(object), 'utf8') store: (name, object) -> return unless @path? fs.writeFile(@pathForKey(name), JSON.stringify(object), 'utf8') load: (name) -> return unless @path? statePath = @pathForKey(name) try stateString = fs.readFileSync(statePath, 'utf8') catch error unless error.code is 'ENOENT' console.warn "Error reading state file: #{statePath}", error.stack, error return undefined try JSON.parse(stateString) catch error console.warn "Error parsing state file: #{statePath}", error.stack, error pathForKey: (name) -> path.join(@getPath(), name) getPath: -> @path 'body': 'meta-\\': 'tree-view:toggle' 'meta-|': 'tree-view:reveal-active-file' '.tree-view': 'right': 'tree-view:expand-directory' 'ctrl-]': 'tree-view:expand-directory' 'left': 'tree-view:collapse-directory' 'ctrl-[': 'tree-view:collapse-directory' 'enter': 'tree-view:open-selected-entry' 'm': 'tree-view:move' 'a': 'tree-view:add' 'delete': 'tree-view:remove' 'backspace': 'tree-view:remove' '.tree-view-dialog .mini.editor': 'enter': 'core:confirm' 'escape': 'core:cancel' _ = require 'underscore' BufferedProcess = require 'buffered-process' $ = require 'jquery' module.exports = class LoadPathsTask constructor: (@callback) -> start: -> rootPath = project.getPath() ignoredNames = config.get('fuzzyFinder.ignoredNames') ? [] ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? []) ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles') command = require.resolve 'nak' args = ['-l', rootPath] args.unshift('--addVCSIgnores') if config.get('nak.addVCSIgnores') args.unshift('-d', ignoredNames.join(',')) if ignoredNames.length > 0 paths = [] deferred = $.Deferred() exit = (code) => if code is -1 deferred.reject({command, code}) else @callback(paths) deferred.resolve() stdout = (data) -> paths.push.apply(paths, _.compact(data.split('\n'))) @process = new BufferedProcess({command, args, stdout, exit}) deferred abort: -> if @process? @process.kill() @process = null ETahi.ApplicationController = Ember.Controller.extend delayedSave: false currentUser: ( -> @getCurrentUser() ).property() isLoggedIn: ( -> !Ember.isBlank(@get('currentUser.id')) ).property('currentUser.id') isAdmin: Ember.computed.alias 'currentUser.siteAdmin' canViewAdminLinks: false # this will get overridden by inject except in testing cases. getCurrentUser: -> null clearError:( -> @set('error', null) ).observes('currentPath') overlayBackground: Ember.computed.defaultTo('defaultBackground') overlayRedirect: [] defaultBackground: 'overlay_background' testing: ( -> Ember.testing || ETahi.environment == "test" ).property() showSaveStatusDiv: Ember.computed.and('testing', 'delayedSave') navigationVisible: false accountLinksVisible: false actions: toggleNavigation: -> @toggleProperty 'navigationVisible' if @get('navigationVisible') $('html').addClass 'navigation-visible' else $('html').removeClass 'navigation-visible' routeTo: (routeName) -> @send 'toggleNavigation' @set 'accountLinksVisible', false @transitionToRoute routeName toggleAccountLinks: -> @toggleProperty 'accountLinksVisible' return false # WARNING: be very careful when changing this stuff, there are many edge cases! # Add a default clickhandler so we can use hrefs defaultClickHandler = (e) -> if Backbone.History.started # Capitalization in Backbone.[H]istory is intentional $link = $(e.target).closest("a") url = $link.attr("href") target = $link.attr("target") if e.metaKey or e.ctrlKey or e.altKey target = "_blank" if target? window.open url, target else navigateTo url, $link.attr("target") false # prevent default else true navigateTo = (url, target='_self') -> if "/" + Backbone.history.fragment is url # Allow reloads by clicking links without polluting the history Backbone.history.fragment = null Backbone.history.navigate url, trigger: true replace: true else if Backbone.history.loadUrl(url) # Try if there is a Backbone route available Backbone.history.fragment = null # Force creating a state in the history Backbone.history.navigate url, false else window.open url, target window.focus() # HACK: this is needed because internal events did not seem to work $(document).on "click", ":not(body.client) a[rel=backbone]", defaultClickHandler # Your keymap # # Atom keymaps work similarly to style sheets. Just as style sheets use # selectors to apply styles to elements, Atom keymaps use selectors to associate # keystrokes with events in specific contexts. # # You can create a new keybinding in this file by typing "key" and then hitting # tab. # # Here's an example taken from Atom's built-in keymap: # # 'atom-text-editor': # 'enter': 'editor:newline' # # 'atom-workspace': # 'ctrl-shift-p': 'core:move-up' # 'ctrl-p': 'core:move-down' # # You can find more information about keymaps in these guides: # * https://atom.io/docs/latest/using-atom-basic-customization#customizing-key-bindings # * https://atom.io/docs/latest/behind-atom-keymaps-in-depth # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it here: # https://github.com/bevry/cson#what-is-cson path = require 'path' CSON = require 'season' fs = require 'fs-plus' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'compile-packages-slug', 'Add bundled package metadata information to to the main package.json file', -> appDir = grunt.config.get('atom.appDir') modulesDirectory = path.join(appDir, 'node_modules') packages = {} for moduleDirectory in fs.listSync(modulesDirectory) continue if path.basename(moduleDirectory) is '.bin' metadata = grunt.file.readJSON(path.join(moduleDirectory, 'package.json')) continue unless metadata?.engines?.atom? pack = {metadata, keymaps: {}, menus: {}} for keymapPath in fs.listSync(path.join(moduleDirectory, 'keymaps'), ['.cson', '.json']) relativePath = path.relative(appDir, keymapPath) pack.keymaps[relativePath] = CSON.readFileSync(keymapPath) for menuPath in fs.listSync(path.join(moduleDirectory, 'menus'), ['.cson', '.json']) relativePath = path.relative(appDir, menuPath) pack.menus[relativePath] = CSON.readFileSync(menuPath) packages[metadata.name] = pack metadata = grunt.file.readJSON(path.join(appDir, 'package.json')) metadata._atomPackages = packages grunt.file.write(path.join(appDir, 'package.json'), JSON.stringify(metadata)) isActive = (type, inverse = false) -> name = 'is' name = name + 'Not' if inverse name = name + 'Active' + _.capitalize type (view) -> unless view instanceof Spacebars.kw throw new Error "#{name} options must be key value pair such " + "as {{#{name} regex='route/path'}}. You passed: " + "#{JSON.stringify view}" pattern = className: Match.Optional String regex: String check view.hash, pattern controller = Router.current() return false unless controller {className, regex} = view.hash className ?= if inverse then 'disabled' else 'active' isPath = true if type is 'path' test = testExp controller, regex, isPath test = not test if inverse if test then className else false testExp = (controller, exp, isPath = false) -> if isPath pattern = controller.location.get().path else pattern = controller.route?.getName() re = new RegExp exp, 'i' re.test pattern helpers = isActiveRoute: isActive 'route' isActivePath: isActive 'path' isNotActiveRoute: isActive 'route', true isNotActivePath: isActive 'path', true Template.registerHelper name, func for own name, func of helpers {Emitter} = require 'atom' _ = require 'underscore-plus' DB = require './db' Project = require './project' module.exports = class Projects constructor: () -> @emitter = new Emitter @db = new DB() @db.onUpdate () => @emitter.emit 'projects-updated' onUpdate: (callback) -> @emitter.on 'projects-updated', callback getAll: (callback) -> @db.find (projectSettings) -> projects = [] for key, setting of projectSettings if setting.paths? project = new Project(setting) projects.push(project) callback(projects) getCurrent: (callback) -> @getAll (projects) -> for project in projects if project.isCurrent() callback(project)###* * Copyright 2015 ppy Pty. Ltd. * * This file is part of osu!web. osu!web is distributed with the hope of * attracting more community contributions to the core ecosystem of osu!. * * osu!web is free software: you can redistribute it and/or modify * it under the terms of the Affero GNU General Public License version 3 * as published by the Free Software Foundation. * * osu!web is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with osu!web. If not, see . * ### {div,i} = React.DOM el = React.createElement @BeatmapIcon = React.createClass mixins: [React.addons.PureRenderMixin] getDefaultProps: -> showTitle: true render: -> beatmap = @props.beatmap difficultyRating = if @props.overrideVersion? @props.overrideVersion else BeatmapHelper.getDiffRating beatmap.difficulty_rating showTitle = @props.showTitle && !@props.overrideVersion? mode = if beatmap.convert then 'osu' else beatmap.mode div className: "beatmap-icon beatmap-icon--#{difficultyRating} beatmap-icon--#{@props.modifier}" title: beatmap.version if showTitle el Icon, name: "osumode-#{mode}" fs = require 'fs-plus' path = require 'path' ipc = require 'ipc' module.exports = class AtomPortable @getPortableAtomHomePath: -> execDirectoryPath = path.dirname(process.execPath) path.join(execDirectoryPath, '..', '.atom') @isPortableInstall: (platform, environmentAtomHome, defaultHome) -> return false unless platform is 'win32' return false if environmentAtomHome return false if not fs.existsSync(@getPortableAtomHomePath()) # currently checking only that the directory exists and is writable, # probably want to do some integrity checks on contents in future @portableAtomHomePathWritable(defaultHome) @portableAtomHomePathWritable: (defaultHome) -> writable = false message = "" try writePermissionTestFile = path.join(@getPortableAtomHomePath(), "write.test") fs.writeFileSync(writePermissionTestFile, "test") if not fs.existsSync(writePermissionTestFile) fs.removeSync(writePermissionTestFile) writable = true catch error message = "Failed to use portable Atom home directory (#{@getPortableAtomHomePath()}). Using the default instead (#{defaultHome}). #{error.message}" ipc.on 'check-portable-home-writable', (event, arg) -> event.sender.send 'check-portable-home-writable-response', {writable, message} writable _ = require 'underscore' traverse = require 'traverse' KONFIG = {} do -> unless 'first' of Array.prototype Object.defineProperty Array.prototype, 'first', get: -> this[0] unless 'last' of Array.prototype Object.defineProperty Array.prototype, 'last', get: -> this[this.length - 1] try module.exports = KONFIG = JSON.parse process.env.KONFIG_JSON catch err console.error 'error: could not parse KONFIG_JSON environment variable' console.error err process.exit 1 traverse.forEach KONFIG, (node) -> if val = process.env["KONFIG_#{this.path.join('_').toUpperCase()}"] try parsedVal = JSON.parse val if typeof node is typeof parsedVal val = parsedVal else if val is parsedVal.toString() val = parsedVal return val or node KONFIG.getConfigScriptTag = (mixin = {}) -> config = _.extend {}, @client.runtimeOptions, mixin """ """ class Teaspoon.Jasmine1.Fixture extends Teaspoon.fixture window.fixture = @ @load: -> args = arguments throw "Teaspoon can't load fixtures outside of describe." unless @env().currentSuite || @env().currentSpec if @env().currentSuite @env().beforeEach => fixture.__super__.constructor.load.apply(@, args) @env().afterEach => @cleanup() super else @env().currentSpec.after => @cleanup() super @set: -> args = arguments throw "Teaspoon can't load fixtures outside of describe." unless @env().currentSuite || @env().currentSpec if @env().currentSuite @env().beforeEach => fixture.__super__.constructor.set.apply(@, args) @env().afterEach => @cleanup() super else @env().currentSpec.after => @cleanup() super @env: -> window.jasmine.getEnv() # TODO: Register fixture framework with core window.fixture = Teaspoon.Jasmine1.Fixture `import Em from "vendor/ember"` Component = Em.Component.extend initializeValue: Em.on "init", -> prompt = @get "content.prompt" if prompt options = @get "content.options" options.unshift label: prompt value: "" else options = @get "content.options" if @get "content.is_optional" if not @get "content.editable" options.unshift label: "" value: "" initializeTypeahead: Em.on "didInsertElement", -> @$().find(".typeahead").typeahead source: @get("content.options").map (o) -> o.label label: "" updateValue: Em.observer "label", -> label = @get "label" values = (i.value for i in @get("content.options") when i.label is label) if values.length is 1 @set "content.value", values[0] else @set "content.value", label sanitizeValue: Em.observer "content.options", -> options = (o.value for o in @get "content.options") value = @get "content.value" if value not in options @set "content.value", options[0] editing: true actions: toggleEdit: -> @toggleProperty "editing" `export default Component` ### Route Filters Filters for managing user access to application routes. ### # Define Filters # Check if a User is Logged In # If a user is not logged in and attempts to go to an authenticated route, # re-route them to the login screen. checkUserLoggedIn = -> if not Meteor.loggingIn() or Meteor.user() Router.go '/login' @pause # Check if a User Exists # If a user is logged in and attempts to go to a public route, re-route # them to the main "logged in" screen. userAuthenticated = -> if not Meteor.loggingIn() and Meteor.user() Router.go '/' # Run Filters Router.onBeforeAction checkUserLoggedIn, except: [ 'signup', 'login', 'recover-password', 'reset-password' ] Router.onBeforeAction userAuthenticated, only: [ 'signup', 'login', 'recover-password', 'reset-password' ] Git = require 'git' describe "Git", -> describe "getPath()", -> it "returns the repository path for a working directory file path", -> repo = new Git(require.resolve('fixtures/git/nohead.git/HEAD')) expect(repo.getPath()).toBe require.resolve('fixtures/git/nohead.git') + '/' repo = new Git(require.resolve('fixtures/git/master.git/HEAD')) expect(repo.getPath()).toBe require.resolve('fixtures/git/master.git') + '/' it "returns the repository path for a repository path", -> repo = new Git(require.resolve('fixtures/git/nohead.git')) expect(repo.getPath()).toBe require.resolve('fixtures/git/nohead.git') + '/' repo = new Git(require.resolve('fixtures/git/master.git')) expect(repo.getPath()).toBe require.resolve('fixtures/git/master.git') + '/' describe "getHead()", -> it "returns null for a empty repository", -> repo = new Git(require.resolve('fixtures/git/nohead.git')) expect(repo.getHead()).toBeNull it "returns a branch name for a non-empty repository", -> repo = new Git(require.resolve('fixtures/git/master.git')) expect(repo.getHead()).toBe 'refs/heads/master' describe "getShortHead()", -> it "returns null for a empty repository", -> repo = new Git(require.resolve('fixtures/git/nohead.git')) expect(repo.getShortHead()).toBeNull it "returns a branch name for a non-empty repository", -> repo = new Git(require.resolve('fixtures/git/master.git')) expect(repo.getShortHead()).toBe 'master' @spendflowAutomaticNotes = "Managed automatically" module.exports = current: 'ami-5dd50436' # Ordered by creation date list: [ 'ami-a7986fcc' 'ami-b920d7d2' 'ami-9b02f0f0' 'ami-e7a05a8c' 'ami-5dd50436' ] @spendflowPrecision = 2 # TODO: Allow changing accounting.js settings from a UI accounting.settings.currency.symbol = "" accounting.settings.currency.precision = 2 accounting.settings.number.precision = 2 getTitle = (self) -> if not self.meta? return return self.meta.ogTitle or self.meta.twitterTitle or self.meta.title or self.meta.pageTitle getDescription = (self) -> if not self.meta? return description = self.meta.ogDescription or self.meta.twitterDescription or self.meta.description if not description? return return _.unescape description.replace /(^[“\s]*)|([”\s]*$)/g, '' Template.oembedUrlWidget.helpers description: -> description = getDescription this return Blaze._escape(description) if _.isString description title: -> title = getTitle this return Blaze._escape(title) if _.isString title target: -> if not this.parsedUrl?.host || !document?.location?.host || this.parsedUrl.host isnt document.location.host return '_blank' image: -> if not this.meta? return decodedOgImage = @meta.ogImage?.replace?(/&/g, '&') return decodedOgImage or this.meta.twitterImage show: -> return getDescription(this)? or getTitle(this)? collapsed: -> if this.collapsed? return this.collapsed else return Meteor.user()?.settings?.preferences?.collapseMediaByDefault is true fs = require 'graceful-fs' request = require 'superagent' { resolve } = require 'path' cache = require '../../../lib/cache' module.exports = class Reflection url: -> "http://artsy-reflection.s3.amazonaws.com/__reflection/forceartsynet#{@path}" constructor: ({ @path }) -> # request: -> request.get(@url()).type('text/html; charset=utf8') render: (cb, next) -> cache.get @url(), (err, cached) => return next() if err? return cb(cached) if cached? @request().end (res) => return next() if res.error cb (response = @injectAnalytics res.text) cache.set @url(), response renderAnalytics: -> [ '../../../components/main_layout/templates/mixpanel.html' '../../../components/main_layout/templates/google_analytics.html' ] .map((path) -> fs.readFileSync(resolve __dirname, path).toString() ).join '' injectAnalytics: (response) -> response.replace '', "#{@renderAnalytics()}" fs = require 'fs' path = require 'path' grunt = require 'grunt' temp = require 'temp' describe 'create-windows-installer task', -> it 'creates a nuget package', -> outputDirectory = temp.mkdirSync('grunt-atom-shell-installer-') grunt.config.init pkg: grunt.file.readJSON(path.join(__dirname, 'fixtures', 'app', 'package.json')) 'create-windows-installer': appDirectory: path.join(__dirname, 'fixtures', 'app') outputDirectory: outputDirectory grunt.loadTasks(path.resolve(__dirname, '..', 'tasks')) tasksDone = false grunt.registerTask 'done', 'done', -> tasksDone = true grunt.task.run(['create-windows-installer', 'done']).start() waitsFor -> tasksDone runs -> expect(fs.existsSync(path.join(outputDirectory, 'myapp.nupkg'))).toBe true DNS = require("dns") HTTP = require("http") ProxyRequest = require("./proxy") Replay = require("./replay") # Route HTTP requests to our little helper. HTTP.request = (options, callback)-> request = new ProxyRequest(options, Replay.chain.start) if callback request.once "response", (response)-> callback response return request # Redirect HTTP requests to 127.0.0.1 for all hosts defined as localhost original_lookup = DNS.lookup DNS.lookup = (domain, family, callback)-> unless callback [family, callback] = [null, family] if Replay.isLocalhost(domain) if family == 6 callback null, "::1", 6 else callback null, "127.0.0.1", 4 else original_lookup domain, family, callback module.exports = Replay $ -> $(document).on 'keydown', (event) -> active = $(document.activeElement) if active.is('.group-dropdown-search, .selector-link') switch event.which when 40 # select next group with down arrow target = active.parent().next('.group-item').find('.selector-link') target = $('#group-dropdown-items').find('.selector-link').first() if target.length is 0 when 38 # select prev group with up arrow target = active.parent().prev('.group-item').find('.selector-link') target = $('#group-dropdown-items').find('.selector-link').last() if target.length is 0 if target? target.focus() event.preventDefault() if !active.is('input, textarea, select') or event.which == 27 switch event.which when 71, 27 # G or ESC for groups search dropdown $('#groups>a').click() $('#groups').find('.group-dropdown-search').focus() event.preventDefault() when 78 # N for notifications dropdown $('#notifications-container>a').click() when 83 # S for search box $('#search_form_query').focus() event.preventDefault() when 85 # U for user dropdown $("#user>a").click()$ -> $(".topbar-wrapper").dropdown() $ -> $(".alert-message").alert() # This is a manifest file that'll be compiled into including all the files listed below. # Add new JavaScript/Coffee code in separate files in this directory and they'll automatically # be included in the compiled file accessible from http://example.com/assets/application.js # It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the # the compiled file. # #= require jquery #= require jquery_ujs #= require jquery.ui.all #= require twitter/bootstrap #= require select2 #= require best_in_place #= require accounting #= require accounting-jquery #= require bootstrap-datepicker #= require bookyt/table_select #= require_tree . window.keymap.bindKeys '.editor', 'meta-m': 'markdown-preview:toggle' window.keymap.bindKeys '.markdown-preview', 'meta-m': 'markdown-preview:toggle' # USE # Add smooth-scroll attribute to the element with anchors link. # The target elements must have the id or name with the same value of the anchor's href class @Components.Utils.SmoothScroll @autoInit: -> $('[smooth-scroll]').each (i, nav) => new @($(nav)) constructor: (@nav) -> @scrollOnClick() @scrollOnLoad() scrollOnClick: -> # Based on http://css-tricks.com/snippets/jquery/smooth-scrolling/ $('a[href*=#]:not([href=#])', @nav).on 'click', (ev) => if location.pathname.replace(/^\//,'') == ev.delegateTarget.pathname.replace(/^\//,'') && location.hostname == ev.delegateTarget.hostname @scrollTo @getTargetByHash(ev.delegateTarget.hash) scrollOnLoad: -> setTimeout => @scrollTo @getTargetByHash(location.hash) , 500 scrollTo: (target) -> return unless target.length $('html,body').animate({ scrollTop: target.offset().top }, 1000) false getTargetByHash: (hash) -> if $(hash).length then $(hash) else $("[name='#{hash.slice(1)}']") assert = require 'assert' fs = require 'fs' path = require 'path' temp = require 'temp' describe 'third-party module', -> fixtures = path.join __dirname, 'fixtures' temp.track() describe 'runas', -> it 'can be required in renderer', -> require 'runas' it 'can be required in node binary', (done) -> runas = path.join fixtures, 'module', 'runas.js' child = require('child_process').fork runas child.on 'message', (msg) -> assert.equal msg, 'ok' done() describe 'pathwatcher', -> it 'emits file events correctly', (done) -> pathwatcher = require 'pathwatcher' temp.mkdir 'dir', (err, dir) -> watcher = pathwatcher.watch dir, (event) -> assert.equal event, 'change' watcher.close() done() fs.writeFile path.join(dir, 'file'), -> ### WebSocket Interface for the WebSocketRails client. ### class WebSocketRails.WebSocketConnection constructor: (@url,@dispatcher) -> @url = "ws://#{@url}" unless @url.match(/^wss?:\/\//) @message_queue = [] @_conn = new WebSocket(@url) @_conn.onmessage = @on_message @_conn.onclose = @on_close @_conn.onerror = @on_error trigger: (event) => if @dispatcher.state != 'connected' @message_queue.push event else @_conn.send event.serialize() on_message: (event) => data = JSON.parse event.data @dispatcher.new_message data on_close: (event) => close_event = new WebSocketRails.Event(['connection_closed', event]) @dispatcher.state = 'disconnected' @dispatcher.dispatch close_event on_error: (event) => error_event = new WebSocketRails.Event(['connection_error', event]) @dispatcher.state = 'disconnected' @dispatcher.dispatch error_event flush_queue: => for event in @message_queue @_conn.send event.serialize() @message_queue = [] Component = require 'core/Component' Result = require 'core/Result' ### ### module.exports = class Scriptable extends Component constructor: (owner) -> super @_tasks = [] @owner.addListener 'update', @_scriptable_update _scriptable_update: => # get current task task = @_tasks[0] if task result = task() console.assert result instanceof Result, 'Task did not return Result object' if result.done? @_tasks.shift() if result.next? @_tasks.unshift -> result.next.apply null, result.arguments # remove task if finished # @_tasks.shift() if task.apply @ ### @param [function] task Must return a {Result} ### addTask: (task) => @_tasks.push task # task.apply @ # variant autocompletion $(document).ready -> if $("#variant_autocomplete_template").length > 0 window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text()) window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text()) window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text()) return formatVariantResult = (variant) -> variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined` variantTemplate variant: variant $.fn.variantAutocomplete = -> @select2 placeholder: Spree.translations.variant_placeholder minimumInputLength: 3 initSelection: (element, callback) -> $.get Spree.routes.variants_search + "/" + element.val(), {}, (data) -> callback data ajax: url: Spree.url(Spree.routes.variants_api) quietMillis: 200 datatype: "json" data: (term, page) -> q: product_name_or_sku_cont: term token: Spree.api_key results: (data, page) -> window.variants = data["variants"] results: data["variants"] formatResult: formatVariantResult formatSelection: (variant) -> if !!variant.options_text variant.name + " (#{variant.options_text})" else variant.name module.exports = class GitRepository constructor: (path) -> unless repo = $git.getRepository(path) throw new Error("No Git repository found searching path: " + path) repo.constructor = GitRepository repo.__proto__ = GitRepository.prototype return repo getHead: $git.getHead getPath: $git.getPath getStatus: $git.getStatus isIgnored: $git.isIgnored checkoutHead: $git.checkoutHead getDiffStats: $git.getDiffStats isSubmodule: $git.isSubmodule refreshIndex: $git.refreshIndex destroy: $git.destroy Utils = require '../../../utils' FormField = React.createClass render: -> module.exports = FormField if Meteor.isServer url = Npm.require('url') RocketChat.settings.get 'Site_Url', (key, value) -> if value?.trim() isnt '' __meteor_runtime_config__.ROOT_URL = value __meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = value if Meteor.absoluteUrl.defaultOptions?.rootUrl? Meteor.absoluteUrl.defaultOptions.rootUrl = value if Meteor.isServer RocketChat.hostname = url.parse(value).hostname process.env.MOBILE_ROOT_URL = value process.env.MOBILE_DDP_URL = value # WebAppInternals.generateBoilerplate() 'menu': [ { 'label': 'View' 'submenu': [ 'label': 'Toggle Treeview' 'command': 'tree-view:toggle' ] } { 'label': 'Packages' 'submenu': [ 'label': 'Tree View' 'submenu': [ { 'label': 'Toggle', 'command': 'tree-view:toggle' } { 'label': 'Reveal Active File', 'command': 'tree-view:reveal-active-file' } ] ] } ] 'context-menu': '.tree-view': 'Add File': 'tree-view:add' 'Rename': 'tree-view:move' 'Delete': 'tree-view:remove' # If you want some example snippets, check out: # - https://raw.githubusercontent.com/atom/language-coffee-script/master/snippets/language-coffee-script.cson '.source.__package-name__': 'If': 'prefix': 'if' 'body': 'if ${1:condition}\n ${0:# body...}' NotificationPlugin = require "../../notification-plugin" class UserVoice extends NotificationPlugin @receiveEvent: (config, event, callback) -> return if event?.trigger?.type == "reopened" # Build the payload payload = name: "Bugsnag" client: config.apiKey email: "bugsnag@bugsnag.com" ticket: subject: "#{event.error.exceptionClass} in #{event.error.context}" message: """ #{event.error.exceptionClass} in #{event.error.context} #{event.error.message if event.error.message} #{event.error.url} Stacktrace: #{@basicStacktrace(event.error.stacktrace)} """ # Send the request url = if config.url.startsWith(/https?:\/\//) then config.url else "https://#{config.url}" @request .post("#{url}/api/v1/tickets.json") .timeout(4000) .send(payload) .type("form") .on "error", (err) -> callback(err) .end (res) -> return callback(res.error) if res.error callback null, id: res.body.ticket.id number: res.body.ticket.ticket_number url: "#{url}/admin/tickets/#{res.body.ticket.ticket_number}" module.exports = UserVoice NotificationPlugin = require "../../notification-plugin" class Campfire extends NotificationPlugin @receiveEvent: (config, event, callback) -> # Build the message message = "#{event.trigger.message} in #{event.project.name}!" if event.error message += " #{event.error.exceptionClass}" if event.error.exceptionClass message += ": #{event.error.message}" if event.error.message message += " (#{event.error.url})" else message += " (#{event.project.url})" # Send the request to campfire @request .post("https://#{config.domain}.campfirenow.com/room/#{config.roomId}/speak.json") .auth(config.authToken, "X") .redirects(0) .send message: body: message type: "TextMessage" .on "error", (err) -> callback err .end (res) -> return callback(new Error("Bad response code: #{res.status}")) unless 200 <= res.status < 300 callback null, id: res.body.message.id module.exports = Campfire{OnigScanner} = require '../lib/oniguruma' describe "OnigScanner", -> it "returns the index of the matching pattern", -> scanner = new OnigScanner(["a", "b", "c"]) expect(scanner.findNextMatch("xxaxxbxxc", 0).index).toBe 0 expect(scanner.findNextMatch("xxaxxbxxc", 4).index).toBe 1 expect(scanner.findNextMatch("xxaxxbxxc", 7).index).toBe 2 it "includes the scanner with the results", -> scanner = new OnigScanner(["a"]) expect(scanner.findNextMatch("a", 0).scanner).toBe scanner path = require 'path' module.exports = (grunt) -> {spawn} = require('./task-helpers')(grunt) grunt.registerTask 'codesign', 'Codesign the app', -> done = @async() if process.platform is 'darwin' and process.env.XCODE_KEYCHAIN unlockKeychain (error) -> if error? done(error) else signApp(done) else signApp(done) unlockKeychain = (callback) -> cmd = 'security' {XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN} = process.env args = ['unlock-keychain', '-p', XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN] spawn {cmd, args}, (error) -> callback(error) signApp = (callback) -> switch process.platform when 'darwin' cmd = 'codesign' args = ['-f', '-v', '-s', 'Developer ID Application: GitHub', grunt.config.get('atom.shellAppDir')] spawn {cmd, args}, (error) -> callback(error) when 'win32' cmd = 'signtool.bat' args = [path.join(grunt.config.get('atom.shellAppDir'), 'atom.exe')] spawn {cmd, args}, (error) -> callback(error) else callback() # Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation. class Cable.Connection constructor: (@consumer) -> @open() send: (data) -> if @isOpen() @webSocket.send(JSON.stringify(data)) true else false open: -> return if @isState("open", "connecting") @webSocket = new WebSocket(@consumer.url) @installEventHandlers() close: -> return if @isState("closed", "closing") @webSocket?.close() reopen: -> if @isOpen() @closeSilently => @open() else @open() isOpen: -> @isState("open") # Private isState: (states...) -> @getState() in states getState: -> return state.toLowerCase() for state, value of WebSocket when value is @webSocket?.readyState null closeSilently: (callback = ->) -> @uninstallEventHandlers() @installEventHandler("close", callback) @installEventHandler("error", callback) try @webSocket.close() finally @uninstallEventHandlers() installEventHandlers: -> for eventName of @events @installEventHandler(eventName) installEventHandler: (eventName, handler) -> handler ?= @events[eventName].bind(this) @webSocket.addEventListener(eventName, handler) uninstallEventHandlers: -> for eventName of @events @webSocket.removeEventListener(eventName) events: message: (event) -> {identifier, message} = JSON.parse(event.data) @consumer.subscriptions.notify(identifier, "received", message) open: -> @consumer.subscriptions.reload() close: -> @consumer.subscriptions.notifyAll("disconnected") error: -> @consumer.subscriptions.notifyAll("disconnected") @closeSilently() toJSON: -> state: @getState() eval("window = {};") eval("attachEvent = function(){};") eval("console = {};") console.warn = -> self.postMessage type: 'warn' details: arguments console.log = -> self.postMessage type: 'log' details: arguments self.addEventListener 'message', (event) -> switch event.data.type when 'start' window.resourcePath = event.data.resourcePath importScripts(event.data.requirePath) self.task = require(event.data.taskPath) self.postMessage(type:'started') else self.task[event.data.type](event.data) path = require 'path' module.exports = (grunt) -> {cp, mkdir, rm, spawn} = require('./task-helpers')(grunt) grunt.registerTask 'install', 'Install the built application', -> installDir = grunt.config.get('atom.installDir') shellAppDir = grunt.config.get('atom.shellAppDir') if process.platform is 'win32' done = @async() runas = require 'runas' copyFolder = path.resolve 'script', 'copy-folder.cmd' # cmd /c ""script" "source" "destination"" arg = "/c \"\"#{copyFolder}\" \"#{shellAppDir}\" \"#{installDir}\"\"" if runas('cmd', [arg], hide: true) isnt 0 done("Failed to copy #{shellAppDir} to #{installDir}") createShortcut = path.resolve 'script', 'create-shortcut.cmd' args = ['/c', createShortcut, path.join(installDir, 'atom.exe'), 'Atom'] spawn {cmd: 'cmd', args}, done else rm installDir mkdir path.dirname(installDir) cp shellAppDir, installDir module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') meta: banner: '// rivets.js\n' + '// version: <%= pkg.version %>\n' + '// author: <%= pkg.author %>\n' + '// license: <%= pkg.licenses[0].type %>\n' coffee: all: files: 'lib/rivets.js': 'src/rivets.coffee' concat: all: options: banner: '<%= meta.banner %>' files: 'lib/rivets.js': 'lib/rivets.js' uglify: all: options: banner: '<%= meta.banner %>' files: 'lib/rivets.min.js': 'lib/rivets.js' jasmine: all: src: 'lib/rivets.js' options: specs: 'spec/rivets/**/*.js' helpers: 'spec/lib/**/*.js' watch: all: files: 'src/rivets.coffee' tasks: ['build', 'spec'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-jasmine' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.registerTask 'default', ['watch'] grunt.registerTask 'spec', ['jasmine'] grunt.registerTask 'build', ['coffee', 'concat', 'uglify'] # dashing.js is located in the dashing framework # It includes jquery & batman for you. #= require dashing.js #= require_directory . #= require_tree ../../widgets console.log("Yeah! The dashboard has started!") Dashing.on 'ready', -> Dashing.widget_margins ||= [5, 5] Dashing.widget_base_dimensions ||= [300, 360] Dashing.numColumns ||= 4 contentWidth = (Dashing.widget_base_dimensions[0] + Dashing.widget_margins[0] * 2) * Dashing.numColumns Batman.setImmediate -> $('.gridster').width(contentWidth) $('.gridster ul:first').gridster widget_margins: Dashing.widget_margins widget_base_dimensions: Dashing.widget_base_dimensions avoid_overlapped_widgets: !Dashing.customGridsterLayout draggable: stop: Dashing.showGridsterInstructions start: -> Dashing.currentWidgetPositions = Dashing.getWidgetPositions() ### # Copyright 2015-2016 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### class @Hits @generate: ({score, playmode}) -> elements = ['count300', 'count100', 'count50'] if playmode == 'mania' elements = ['countgeki', 'count300', 'countkatu', 'count100', 'count50'] header = '' values = '' for elem, i in elements header += osu.trans "beatmaps.beatmapset.show.scoreboard.stats.#{elem}" values += "#{score[elem]}" if i < elements.length - 1 header += '/' values += '/' header: header values: values module.exports = current: 'ami-5dd50436' # Ordered by creation date list: [ 'ami-5dd50436' ] #= require_self #= require_tree . Rahani.module 'Collections', -> class @Base extends Backbone.Collection class app.models.Entry extends app.Model # Attributes: name, type, path SEPARATORS_REGEXP = /\:?\ |#|::|->/g PARANTHESES_REGEXP = /\(.*?\)$/ constructor: -> super @text = @searchValue() searchValue: -> @name .toLowerCase() .replace '...', ' ' .replace ' event', '' .replace SEPARATORS_REGEXP, '.' .replace /\.+/g, '.' .replace PARANTHESES_REGEXP, '' .trim() fullPath: -> @doc.fullPath if @isIndex() then '' else @path filePath: -> @doc.fullPath @_filePath() fileUrl: -> @doc.fileUrl @_filePath() _filePath: -> result = @path.replace /#.*/, '' result += '.html' unless result[-5..-1] is '.html' result isIndex: -> @path is 'index' getType: -> @doc.types.findBy 'name', @type loadFile: (onSuccess, onError) -> ajax url: @fileUrl() dataType: 'html' success: onSuccess error: onError # Your snippets # # Atom snippets allow you to enter a simple prefix in the editor and hit tab to # expand the prefix into a larger code block with templated values. # # You can create a new snippet in this file by typing "snip" and then hitting # tab. # # An example CoffeeScript snippet to expand log to console.log: # # '.source.coffee': # 'Console log': # 'prefix': 'log' # 'body': 'console.log $1' # # Each scope (e.g. '.source.coffee' above) can only be declared once. # # This file uses CoffeeScript Object Notation (CSON). # If you are unfamiliar with CSON, you can read more about it here: # https://github.com/bevry/cson#what-is-cson Point = require 'point' _ = require 'underscore' module.exports = class Range constructor: (pointA = new Point(0, 0), pointB = new Point(0, 0)) -> pointA = Point.fromObject(pointA) pointB = Point.fromObject(pointB) if pointA.compare(pointB) <= 0 @start = pointA @end = pointB else @start = pointB @end = pointA copy: (range) -> new Range(_.clone(@start), _.clone(@end)) isEqual: (other) -> if other instanceof Array and other.length == 2 other = new Range(other...) other.start.isEqual(@start) and other.end.isEqual(@end) inspect: -> "[#{@start.inspect()} - #{@end.inspect()}]" isEmpty: -> @start.isEqual(@end) toDelta: -> rows = @end.row - @start.row if rows == 0 columns = @end.column - @start.column else columns = @end.column new Point(rows, columns) path = require 'path' fs = require 'fs-plus' {_} = require 'atom' ## Platform specific helpers module.exports = # Public: Returns true if being run from within Windows isWindows: -> !!process.platform.match /^win/ # Public: Some files can not exist on Windows filesystems, so we have to # selectively generate our fixtures. # # Returns nothing. generateEvilFiles: -> evilFilesPath = path.join(__dirname, 'fixtures', 'evil-files') fs.removeSync(evilFilesPath) if fs.existsSync(evilFilesPath) fs.mkdirSync(evilFilesPath) if (@isWindows()) filenames = [ "a_file_with_utf8.txt", "file with spaces.txt", "utfa\u0306.md" ] else filenames = [ "a_file_with_utf8.txt", "file with spaces.txt", "goddam\nnewlines", "quote\".txt", "utfa\u0306.md" ] for filename in filenames fd = fs.writeFileSync(path.join(evilFilesPath, filename), 'evil file!', flag: 'w') module.exports = """ query partners_results($includeAggregations: Boolean!, $includeResults: Boolean!, $near: String, $category: [String], $type: [PartnerClassification], $page: Int, $term: String) { category: filter_partners(eligible_for_listing:true, aggregations:[CATEGORY, TOTAL] size:0, near: $near, type: $type, default_profile_public:true, term: $term) @include(if: $includeAggregations) { total aggregations { counts { id name count } } } results: filter_partners(eligible_for_listing:true, aggregations:[TOTAL], sort: RELATIVE_SIZE_ASC, page: $page, size: 9, near: $near, partner_categories:$category type: $type, default_profile_public:true, term: $term) @include(if: $includeResults) { total hits { ... partner } } } #{require './partner_fragment.coffee'} """ class FSFolder extends FSFile fetchContents:(callback)-> # @emit "fs.fetchContents.started" # @kiteController.run # toDo : "ls" # withArgs : # command : @path # , (err, response)=> # if err # warn err # @emit "fs.fetchContents.finished", err # else # files = FSHelper.parseLsOutput [@path], response # @emit "fs.fetchContents.finished", files # callback? files @emit "fs.fetchContents.started" # a = Date.now() @kiteController.run withArgs : command : "ls #{FSHelper.escapeFilePath @path} -Llpva --group-directories-first --time-style=full-iso" , (err, response)=> # log "------------------------------------------------------------------" # log "l flag response in: #{Date.now()-a} msec." if err warn err @emit "fs.fetchContents.finished", err else files = FSHelper.parseLsOutput [@path], response @emit "fs.fetchContents.finished", files callback? files # forkRepoCommandMap = -> # git : "git clone" # svn : "svn checkout" # hg : "hg clone" # cloneRepo:(options, callback)-> # @kiteController.run "#{forkRepoCommandMap()[repoType]} #{repo} #{escapeFilePath getAppPath manifest}", (err, response)->window.keymap.bindKeys '.editor', 'ctrl-Z': 'editor:checkout-head-revision' module.exports = activate: (rootView) -> for buffer in rootView.project.getBuffers() @stripTrailingWhitespaceBeforeSave(buffer) rootView.project.on 'new-buffer', (buffer) => @stripTrailingWhitespaceBeforeSave(buffer) stripTrailingWhitespaceBeforeSave: (buffer) -> buffer.on 'before-save', -> buffer.scan /[ \t]+$/g, (match, range, { replace }) -> replace('') class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template '''
    • <%- name %><% if(admin){ %> Admin<% } %>
    • ''' @render: ($el)-> $users = $("
        ") $el.next().hide(); for user in Kandan.Data.ActiveUsers.all() displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace StepView = require './step.coffee' Form = require '../../form/index.coffee' LocationSearch = require '../../location_search/index.coffee' template = -> require('../templates/basic_info.jade') arguments... module.exports = class BasicInfo extends StepView template: -> template arguments... __events__: 'click button': 'serialize' serialize: (e) -> form = new Form model: @user, $form: @$('form') form.submit e, success: => @next() postRender: -> @locationSearch = new LocationSearch el: @$('.js-location-search') autofocus: false required: !@user.get('prequalified') @locationSearch.render @user.location()?.cityStateCountry() @listenTo @locationSearch, 'location:update', (location) -> @user.setLocation location remove: -> @locationSearch?.remove() super 'body': 'meta-up': 'core:move-to-top' 'meta-down': 'core:move-to-bottom' 'meta-shift-up': 'core:select-to-top' 'meta-shift-down': 'core:select-to-bottom' '.editor': 'meta-right': 'editor:move-to-end-of-line' 'meta-left': 'editor:move-to-beginning-of-line' 'alt-left': 'editor:move-to-beginning-of-word' 'alt-right': 'editor:move-to-end-of-word' 'meta-shift-left': 'editor:select-to-beginning-of-line' 'meta-shift-right': 'editor:select-to-end-of-line' 'alt-shift-left': 'editor:select-to-beginning-of-word' 'alt-shift-right': 'editor:select-to-end-of-word' 'alt-backspace': 'editor:backspace-to-beginning-of-word' 'meta-backspace': 'editor:backspace-to-beginning-of-line' 'alt-delete': 'editor:delete-to-end-of-word' 'ctrl-t': 'editor:transpose' NProgress.configure(showSpinner: false) defaultClass = 'tanuki-shape' pieces = [ 'path#tanuki-right-cheek', 'path#tanuki-right-eye, path#tanuki-right-ear', 'path#tanuki-nose', 'path#tanuki-left-eye, path#tanuki-left-ear', 'path#tanuki-left-cheek', ] pieceIndex = 0 firstPiece = pieces[0] currentTimer = null delay = 150 clearHighlights = -> $(".#{defaultClass}.highlight").attr('class', defaultClass) start = -> clearHighlights() pieceIndex = 0 pieces.reverse() unless pieces[0] == firstPiece currentTimer = setInterval(work, delay) stop = -> clearInterval(currentTimer) clearHighlights() work = -> clearHighlights() $(pieces[pieceIndex]).attr('class', "#{defaultClass} highlight") # If we hit the last piece, reset the index and then reverse the array to # get a nice back-and-forth sweeping look if pieceIndex == pieces.length - 1 pieceIndex = 0 pieces.reverse() else pieceIndex++ $(document).on('page:fetch', start) $(document).on('page:change', stop) class Kandan.Plugins.YouTubeEmbed @youtube_regex: /^http(s)?:\/\/www.youtube.com\/watch/i @youtube_id_regex: /\Wv=([\w|\-]*)/ @youtube_embed_template: _.template ''' ''' @init: ()-> Kandan.Modifiers.register @youtube_regex, (message, state)=> video_id = message.content.match(@youtube_id_regex)[1] thumb_url = "http://img.youtube.com/vi/#{ video_id }/0.jpg" message.content = @youtube_embed_template({ video_url: message.content, thumb_url: thumb_url }) return Kandan.Helpers.Activities.build_from_message_template(message){PathSearcher, PathScanner, search} = require 'scandal' module.exports = (rootPath, regexSource, options) -> callback = @async() searcher = new PathSearcher() scanner = new PathScanner(rootPath, rootPath) searcher.on 'results-found', (result) -> emit('scan:result-found', result) flags = "g" flags += "i" if options.ignoreCase regex = new RegExp(regexSource, flags) search regex, scanner, searcher, callback poi: theme: "paperdark" layout: "horizonal" window: x: 60 y: 60 width: 1274 height: 616 webview: width: 800 proxy: use: "none" socks5: host: "127.0.0.1" port: 1080 http: host: "127.0.0.1" port: 8099 shadowsocks: server: host: "106.185.25.115" port: 27017 local: port: 12451 password: "@_PoiPublic_@" method: "aes-256-cfb" timeout: 600000 module.exports = class OverlayManager constructor: (@container) -> @overlayNodesById = {} render: (props) -> {presenter} = props for decorationId, {pixelPosition, item} of presenter.state.content.overlays @renderOverlay(presenter, decorationId, item, pixelPosition) for id, overlayNode of @overlayNodesById unless presenter.state.content.overlays.hasOwnProperty(id) overlayNode.remove() delete @overlayNodesById[id] return renderOverlay: (presenter, decorationId, item, pixelPosition) -> item = atom.views.getView(item) unless overlayNode = @overlayNodesById[decorationId] overlayNode = @overlayNodesById[decorationId] = document.createElement('atom-overlay') overlayNode.appendChild(item) @container.appendChild(overlayNode) itemWidth = item.offsetWidth itemHeight = item.offsetHeight {scrollTop, scrollLeft} = presenter.state.content left = pixelPosition.left if left + itemWidth - scrollLeft > presenter.getContentFrameWidth() and left - itemWidth >= scrollLeft left -= itemWidth top = pixelPosition.top + presenter.getLineHeight() if top + itemHeight - scrollTop > presenter.getHeight() and top - itemHeight - presenter.getLineHeight() >= scrollTop top -= itemHeight + presenter.getLineHeight() overlayNode.style.top = top + 'px' overlayNode.style.left = left + 'px' # Redirect window.onerror to uncaughtException. window.onerror = (error) -> if global.process.listeners('uncaughtException').length > 0 global.process.emit 'uncaughtException', error true else false # Override default window.close, see: # https://github.com/atom/atom-shell/issues/70 window.close = -> require('remote').getCurrentWindow().close() # Override default window.open. window.open = (url, name, features) -> options = {} for feature in features.split ',' [name, value] = feature.split '=' options[name] = if value is 'yes' true else if value is 'no' false else value options.x ?= options.left options.y ?= options.top options.title ?= name options.width ?= 800 options.height ?= 600 BrowserWindow = require('remote').require 'browser-window' browser = new BrowserWindow options browser.loadUrl url browser if not RocketChat.models.OAuthApps.findOne('zapier') RocketChat.models.OAuthApps.insert _id: 'zapier' name: 'Zapier' active: true clientId: 'zapier' clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr' redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/AppAPI/' _createdAt: new Date _createdBy: _id: 'system' username: 'system' Backbone = require 'backbone' template = -> require('./index.jade') arguments... module.exports = class PaginatorView extends Backbone.View maxPage: 100 pagesInterval: 2 events: 'click li a' : 'setPage' initialize: ({ @params, @filter }) -> throw new Error 'Requires a params model' unless @params? throw new Error 'Requires a filter model' unless @filter? @listenTo @params, 'change:page', @render @listenTo @filter, 'change:total', @render setPage: (e) -> e.preventDefault() @params.set page: $(e.currentTarget).data('value') totalPages: -> calculated = Math.floor(@filter.get('total') / @params.get('size')) total = Math.min calculated, @maxPage render: -> @$el.html template current: parseInt @params.get('page') total: @totalPages() pagesInterval: @pagesInterval require "./test_helper.js" {Commands} = require "../../background_scripts/commands.js" context "Key mappings", should "lowercase keys correctly", -> assert.equal (Commands.normalizeKey ''), '' assert.equal (Commands.normalizeKey ''), '' assert.equal (Commands.normalizeKey ''), '' assert.equal (Commands.normalizeKey ''), '' assert.equal (Commands.normalizeKey ''), '' # Centralizes configuration for currently running split tests # # eg. # header_design: # key: 'header_design' # outcomes: # old: 8 # new: 2 # # Or, `outcomes` can be an array, when you specify `weighting: 'equal'. # weighting: 'equal' # outcomes: [ # 'old' # 'new' # ] # edge: 'new' # dimension: 'dimension1' # Optional GA dimension # scope: 'local' # Optionally disable global initialization # control_group: 'old' #Defaults to `control`, Reflection sees this. # # For equal weighting, add `weighting: 'equal'` and `outcomes` as an array. # # Note: if there are no running tests # this should export empty Object # module.exports = {} module.exports = { client_navigation: key: "client_navigation" outcomes: control: 50 experiment: 50 edge: "experiment" } # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # An example hack to make opened Markdown files have larger text: # # path = require 'path' # # atom.workspaceView.eachEditorView (editorView) -> # if path.extname(editorView.getEditor().getPath()) is '.md' # editorView.setFontSize(20) ipc = require 'ipc' # Public: Provides a registry for menu items that you'd like to appear in the # application menu. # # Should be accessed via `atom.menu`. module.exports = class MenuManager # Private: constructor: () -> @template = {} # Public: Refreshes the currently visible menu. update: -> @sendToBrowserProcess() # Private: Request a context menu to be displayed. sendToBrowserProcess: -> ipc.sendChannel 'update-application-menu', atom.keymap.keystrokesByCommandForSelector('body') assert = require 'assert' fs = require 'fs' path = require 'path' temp = require 'temp' describe 'third-party module', -> fixtures = path.join __dirname, 'fixtures' temp.track() describe 'runas', -> it 'can be required in renderer', -> require 'runas' it 'can be required in node binary', (done) -> runas = path.join fixtures, 'module', 'runas.js' child = require('child_process').fork runas child.on 'message', (msg) -> assert.equal msg, 'ok' done() describe 'pathwatcher', -> it 'emits file events correctly', (done) -> pathwatcher = require 'pathwatcher' temp.mkdir 'dir', (err, dir) -> assert err == null file = path.join dir, 'file' fs.writeFileSync file, 'content' watcher = pathwatcher.watch file, (event) -> assert.equal event, 'change' watcher.close() done() fs.writeFileSync file, 'content2' describe 'q', -> Q = require 'q' describe 'Q.when', -> it 'emits the fullfil callback', (done) -> Q(true).then (val) -> assert.equal val, true done() _ = require 'underscore' Backbone = require 'backbone' Profile = require '../../models/profile.coffee' { Following, FollowButton } = require '../../components/follow_button/index.coffee' CurrentUser = require '../../models/current_user.coffee' ShowInquiryModal = require '../contact/show_inquiry_modal.coffee' module.exports = class PartnerShowButtons extends Backbone.View initialize: (options) -> _.extend @, options @following = new Following(null, kind: 'profile') @following.syncFollows [@model.get('partner')?.default_profile_id] new FollowButton el: @$('.plus-follow-button') modelName: 'profile' model: new Profile(id: @model.get('partner')?.default_profile_id) following: @following context_module: 'Partner show module' events: 'click .partner-buttons-contact': 'contactGallery' contactGallery: -> new ShowInquiryModal show: @model {View} = require 'space-pen' module.exports = class WrapGuide extends View @activate: (rootView, state, config) -> requireStylesheet 'wrap-guide.css' for editor in rootView.getEditors() if rootView.parents('html').length @appendToEditorPane(rootView, editor, config) rootView.on 'editor-open', (e, editor) => @appendToEditorPane(rootView, editor, config) @appendToEditorPane: (rootView, editor, config) -> if underlayer = editor.pane()?.find('.underlayer') underlayer.append(new WrapGuide(rootView, editor, config)) @content: -> @div class: 'wrap-guide' getGuideColumn: null defaultColumn: 80 initialize: (@rootView, @editor, options = {}) => if typeof options.getGuideColumn is 'function' @getGuideColumn = options.getGuideColumn else @getGuideColumn = (path, defaultColumn) -> defaultColumn @updateGuide(@editor) @editor.on 'editor-path-change', => @updateGuide(@editor) config.on 'update', => @setFontSize(config.editor.fontSize) @editor.on 'before-remove', => @rootView.off('.wrap-guide') setFontSize: (fontSize) -> return if fontSize == @fontSize @fontSize = fontSize @updateGuide(@editor) updateGuide: (editor) -> column = @getGuideColumn(editor.getPath(), @defaultColumn) if column > 0 @css('left', "#{editor.charWidth * column}px").show() else @hide() assert = require 'assert' fs = require 'fs' path = require 'path' temp = require 'temp' describe 'third-party module', -> fixtures = path.join __dirname, 'fixtures' temp.track() # If the test is executed with the debug build on Windows, we will skip it # because native modules don't work with the debug build (see issue #2558). if process.platform isnt 'win32' or process.execPath.toLowerCase().indexOf('\\out\\d\\') is -1 describe 'runas', -> it 'can be required in renderer', -> require 'runas' it 'can be required in node binary', (done) -> runas = path.join fixtures, 'module', 'runas.js' child = require('child_process').fork runas child.on 'message', (msg) -> assert.equal msg, 'ok' done() describe 'ffi', -> return if process.platform is 'darwin' it 'does not crash', -> require 'ffi' describe 'q', -> Q = require 'q' describe 'Q.when', -> it 'emits the fullfil callback', (done) -> Q(true).then (val) -> assert.equal val, true done() express = require 'express' app = module.exports = express() to = require './to' app.get '/filter/artworks', to '/browse' app.get '/genes', to '/categories' app.get '/partner-application', to '/apply' app.get '/fair-application', to '/apply/fair' app.get '/fairs', to 'art-fairs' app.get '/settings', to '/user/edit' # Temporary: Can remove once 2015 sale is over. Due to an email error. app.get '/feature/public-art-fund-2014-spring-benefit', to '/feature/public-art-fund-2015-spring-benefit'class app.views.Resizer extends app.View @className: '_resizer' @events: dragstart: 'onDragStart' dragend: 'onDragEnd' drag: 'onDrag' @isSupported: -> 'ondragstart' of document.createElement('div') and !app.isMobile() init: -> @el.setAttribute('draggable', 'true') @appendTo $('._app') @style = $('style[data-resizer]') @size = @style.getAttribute('data-size') return MIN = 260 MAX = 600 resize: (value, save) -> value -= app.el.offsetLeft return unless value > 0 value = Math.min(Math.max(Math.round(value), MIN), MAX) newSize = "#{value}px" @style.innerHTML = @style.innerHTML.replace(new RegExp(@size, 'g'), newSize) @size = newSize if save app.settings.setSize(value) app.appCache?.updateInBackground() return onDragStart: (event) => @style.removeAttribute('disabled') event.dataTransfer.effectAllowed = 'link' event.dataTransfer.setData('Text', '') return onDrag: (event) => return if @lastDrag and @lastDrag > Date.now() - 50 @lastDrag = Date.now() @resize(event.clientX, false) return onDragEnd: (event) => @resize(event.clientX or (event.screenX - window.screenX), true) return # # Mock the Chrome extension API. # root = exports ? window root.chrome = { extension: { connect: -> { onMessage: { addListener: -> } postMessage: -> } onMessage: { addListener: -> } sendMessage: -> } } Manager = require 'modules/manager' tools = require 'config/toolset_config' ToolLoader = (dashboard, cb) -> project = dashboard.get('project') unless project and tools.projects.hasOwnProperty project project = 'default' Manager.set 'project', project # Set valid tools for later retrieval. # If project is Object, use tools key. If not, assume it's the array of tools. if (tools.projects[project] is Object(tools.projects[project])) and tools.projects[project].hasOwnProperty 'tools' Manager.set 'tools', tools.projects[project].tools else Manager.set 'tools', tools.projects[project] Ubret.Loader Manager.get('tools'), cb module.exports = ToolLoader App.TableSortable = getCellValue: (row, index) -> $(row).children("td").eq(index).text() comparer: (index) -> (a, b) -> valA = App.TableSortable.getCellValue(a, index) valB = App.TableSortable.getCellValue(b, index) return if $.isNumeric(valA) and $.isNumeric(valB) then valA - valB else valA.localeCompare(valB) initialize: -> $("table.sortable th").click -> table = $(this).parents("table").eq(0) rows = table.find("tr:gt(0)").not("tfoot tr").toArray().sort(App.TableSortable.comparer($(this).index())) @asc = !@asc if !@asc rows = rows.reverse() i = 0 while i < rows.length table.append rows[i] i++ return Menglifang.Widgets.Select2 = Ember.Select.extend classNames: ['mlf-select2'] placeholder: '请选择...' allowClear: true minimumInputLength: 0 maximumSelectionSize: 3 didInsertElement: -> @$().select2 placeholder: @get('placeholder') allowClear: @get('allowClear') minimumInputLength: @get('minimumInputLength') maximumSelectionSize: @get('maximumSelectionSize') willDestroyElement: -> @$().select2('destroy') Ember.Handlebars.helper 'select2', Menglifang.Widgets.Select2 Meteor.methods log: -> console.log.apply console, arguments Meteor.startup -> Push.debug = true Push.Configure apn: passphrase: '***' keyData: Assets.getText 'PushRocketChatKey.pem' certData: Assets.getText 'PushRocketChatCert_development.pem' gateway: 'gateway.sandbox.push.apple.com' 'apn-dev': passphrase: '***' keyData: Assets.getText 'PushRocketChatKey.pem' certData: Assets.getText 'PushRocketChatCert_development.pem' gateway: 'gateway.sandbox.push.apple.com' production: false badge: true sound: true alert: true vibrate: true _ = require 'underscore' module.exports = projectPaths: null fuzzyFinderView: null loadPathsTask: null activate: (state) -> rootView.command 'fuzzy-finder:toggle-file-finder', => @createView().toggleFileFinder() rootView.command 'fuzzy-finder:toggle-buffer-finder', => @createView().toggleBufferFinder() rootView.command 'fuzzy-finder:find-under-cursor', => @createView().findUnderCursor() rootView.command 'fuzzy-finder:toggle-git-status-finder', => @createView().toggleGitFinder() if project.getPath()? PathLoader = require './path-loader' @loadPathsTask = PathLoader.startTask (paths) => @projectPaths = paths for editSession in project.getEditSessions() editSession.lastOpened = state[editSession.getPath()] deactivate: -> @loadPathsTask?.terminate() @loadPathsTask = null @fuzzyFinderView?.cancel() @fuzzyFinderView = null @projectPaths = null serialize: -> if @fuzzyFinderView? paths = {} for editSession in project.getEditSessions() path = editSession.getPath() paths[path] = editSession.lastOpened if path? paths createView: -> unless @fuzzyFinderView @loadPathsTask?.terminate() FuzzyFinderView = require './fuzzy-finder-view' @fuzzyFinderView = new FuzzyFinderView(@projectPaths) @fuzzyFinderView window.ReactSigninPopover = React.createClass getInitialState: -> opened: false componentDidMount: -> window.currentUser.on 'change:username', @_onSignedInChange, @ componentWillUnmount: -> window.currentUser.off null, null, @ _onButtonClicked: (e) -> @setState opened: true _onSignedInChange: -> if FactlinkApp.signedIn() && @state.opened @props.onSubmit?() @setState opened: false @forceUpdate() submit: -> if FactlinkApp.signedIn() @props.onSubmit?() else @setState opened: !@state.opened render: -> if @state.opened && !FactlinkApp.signedIn() ReactPopover className: 'white-popover', attachment: 'right', _span ["signin-popover"], _a ["button-twitter small-connect-button signin-popover-button js-accounts-popup-link", href: "/auth/twitter" onMouseDown: @_onButtonClicked ], _i ["icon-twitter"] _a ["button-facebook small-connect-button signin-popover-button js-accounts-popup-link", href: "/auth/facebook" onMouseDown: @_onButtonClicked ], _i ["icon-facebook"] _a ["js-accounts-popup-link", href: "/users/sign_in_or_up" onMouseDown: @_onButtonClicked ], "or sign in/up with email." else _span() Species.GeoEntityAutoCompleteLookup = Ember.Mixin.create geoEntityQuery: null autoCompleteRegions: null autoCompleteCountries: null selectedGeoEntities: [] selectedGeoEntitiesIds: [] geoEntityQueryObserver: ( -> re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i") @set 'autoCompleteCountries', @get('geoEntities.countries').filter (item, index, enumerable) => re.test item.get('name') re = new RegExp("^[0-9]- "+@get('geoEntityQuery'),"i") @set 'autoCompleteRegions', @get('geoEntities.regions').filter (item, index, enumerable) => re.test item.get('name') ).observes('geoEntityQuery') geoEntitiesObserver: ( -> Ember.run.once(@, 'initForm') ).observes('geoEntities.@each.didLoad') initForm: -> @set 'selectedGeoEntities', @get('geoEntities.content').filter (geoEntity) => return @get('selectedGeoEntitiesIds').indexOf(geoEntity.get('id')) >= 0 @set('autoCompleteRegions', @get('geoEntities.regions')) @set('autoCompleteCountries', @get('geoEntities.countries')) actions: deleteGeoEntitySelection: (context) -> @get('selectedGeoEntities').removeObject(context) share.Queries.before.update (userId, query, fieldNames, modifier, options) -> if _.intersection(fieldNames, ["interface", "output", "startRecNum", "sortField", "sortReverse", "fields", "fieldsOrder"]).length modifier.$set = modifier.$set or {} modifier.$set.isOutputStale = true define (require) -> $ = require('jquery') settings = require('settings') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./header-template') require('less!./header') return class HeaderView extends BaseView template: template templateHelpers: () -> { page: @page url: @url } initialize: (options = {}) -> super() @page = options.page @url = @createLink(options.url or 'content') setLegacyLink: (url) -> @url = @createLink(url) @render() createLink: (url) -> "#{location.protocol}//#{settings.legacy}/#{url}" class DeployMonitor deploy = null chat = null monitorInterval = null monitorPeriodMs = 10000 deployHangTimeMs = 0 lastDeployStdout = null setDeploy: (deployJob, chatArg)-> deploy = deployJob chat = chatArg deploy.on('create', ()=> @.startMonitoring() ) deploy.on('close', ()=> @.removeDeploy() ) deploy.on('error', ()=> @.removeDeploy() ) hasDeploy: ()-> return !!deploy getDeploy: ()-> return deploy removeDeploy: ()-> @.stopMonitoring() deploy = null startMonitoring: ()-> if(deploy.data.stdout) lastDeployStdout = deploy.data.stdout else lastDeployStdout = '' monitorInterval = setInterval(()=> if(lastDeployStdout.length == deploy.data.stdout.length) deployHangTimeMs += monitorPeriodMs chat.send "Running #{Math.round(deployHangTimeMs / 1000)} secs: #{@_getLastText(lastDeployStdout)}" else lastDeployStdout = deploy.data.stdout deployHangTimeMs = 0 , monitorPeriodMs) stopMonitoring: ()-> clearInterval(monitorInterval) _getLastText: (text)-> textLines = text.split(/\r?\n/) n = textLines.length - 1 while(!textLines[n].trim() && n > 0) n-- return textLines[n] module.exports = new DeployMonitor # Copyright (c) 2017-present Arctic Ice Studio # Copyright (c) 2017-present Sven Greb # Project: igloo # Repository: https://github.com/arcticicestudio/igloo # License: MIT # References: # https://github.com/lee-dohm/package-sync packages: [ "atom-beautify" "atom-material-ui" "busy-signal" "color-picker" "docblockr" "file-icons" "highlight-selected" "intentions" "language-babel" "language-diff" "language-docker" "language-generic-config" "language-groovy" "language-systemd" "language-viml" "linter" "linter-eslint" "linter-js-yaml" "linter-jsonlint" "linter-less" "linter-markdown" "linter-stylelint" "linter-ui-default" "markdown-preview-enhanced" "minimap" "minimap-git-diff" "minimap-highlight-selected" "minimap-pigments" "nord-atom-syntax" "nord-atom-ui" "package-sync" "pigments" "prettier-atom" "project-folder" ] exports.MSGBYPAGE = 30 # safeDestroy parameters (to be tweaked) # loads 200 ids in memory at once exports.LIMIT_DESTROY = 200 # loads 30 messages in memory at once exports.LIMIT_UPDATE = 30 # send 5 request to the DS in parallel exports.CONCURRENT_DESTROY = 1 # number of IMAP & cozy UID&flags in memory when comparing boxes exports.FETCH_AT_ONCE = 1000 # maximum number of messages to fetch at once for each box exports.LIMIT_BY_BOX = 1000 # accounts refreshs in ms, 5 minutes exports.REFRESH_INTERVAL = 300000 # See https://atom.io/docs/latest/creating-a-package#menus for more details 'context-menu': 'atom-workspace': [ # { 'label': 'Enable Floobits', 'command': 'Floobits: Join Workspace' } # { 'label': 'Enable Floobits', 'command': 'Floobits: Join Recent Workspace' } ] 'menu': [ { 'label': 'Packages' 'submenu': [ 'label': 'Floobits' 'submenu': [ { 'label': 'Join Workspace', 'command': 'Floobits: Join Workspace' } # { 'label': 'Join Recent Workspace', 'command': 'Floobits: Join Recent Workspace' } { 'label': 'Leave Workspace', 'command': 'Floobits: Leave Workspace' } { 'label': 'Create Workspace', 'command': 'Floobits: Create Workspace' } { 'label': 'Add Current File', 'command': 'Floobits: Add Current File' } ] ] } ] # reference "Witness.coffee" # reference "Event.coffee" # reference "TimeoutError.coffee" { Event, TimeoutError } = @witness @witness.AsyncAction = class AsyncAction constructor: (@func, @args = [], @description, @timeout = AsyncAction.defaultTimeout) -> @on = Event.define "running", "passed", "failed" run: (context, done, fail) -> @on.running.raise() cancelledByTimeout = false context.done = (args...)=> if not cancelledByTimeout clearTimeout timeoutId @on.passed.raise() done.apply(null,args) context.fail = (args...) => if not cancelledByTimeout clearTimeout timeoutId @on.failed.raise.apply @on.failed, args fail.apply(null, args) failDueToTimeout = => cancelledByTimeout = true delete timeoutId error = new TimeoutError "Asynchronous action timed out." @on.failed.raise error fail error timeoutId = setTimeout failDueToTimeout, @timeout if @timeout > 0 try @func.apply context, @args catch e clearTimeout timeoutId fail e @on.failed.raise e AsyncAction.defaultTimeout = 1000 # milliseconds class window.FactRelation extends Backbone.Model defaults: evidence_type: 'FactRelation' setOpinion: (type) -> $.ajax url: @url() + "/opinion/" + type success: (data) => mp_track "Evidence: opinionate", type: type evidence_id: @id @set data type: "post" removeOpinion: -> $.ajax url: "#{@url()}/opinion" type: "delete" success: (data) => @set data getFact: -> return @_fact if @_fact? @_fact = new Fact(@get('from_fact')) @on 'change', => @_fact.set @get('from_fact') @_fact believe: -> @setOpinion "believes" disbelieve: -> @setOpinion "disbelieves" isBelieving: -> @get('current_user_opinion') == 'believes' isDisBelieving: -> @get('current_user_opinion') == 'disbelieves' creator: -> new User(@get('created_by')) can_destroy: -> @get 'can_destroy?' urlRoot: -> @collection.factRelationsUrl() validate: (attributes) -> unless attributes.evidence_id? or /^.*\S.*$/.test(attributes.displaystring) 'Should have either an evidence_id or a displaystring' DatePicker = require '../../components/date_picker' TimePicker = require '../../components/time_picker' module.exports = React.createClass displayName: 'PickersTest' render: -> datetime = new Date(1995,11,17) datetime.setHours(17) datetime.setMinutes(28)
        # Description: # # # Dependencies: # None # # Configuration: # None # # Commands: # # # Author: # dualmoon if not process.env.HUBOT_PUSHBULLET_API_KEY console.log "HUBOT_PUSHBULLET_API_KEY was not set! This plugin won't work!" else apiKey = process.env.HUBOT_PUSHBULLET_API_KEY ##check an env var to see if we want to open a websocket stream (HUBOT_PUSHBULLET_STREAM?) PushBullet = require 'pushbullet' pushbullet = new PushBullet apiKey module.exports = (robot) -> robot.respond /(?:pb|pushbullet) last/, (msg) -> options = limit: 1, modified_after: 0 msg.send "Pushbullet Pong." pushbullet.history options, (err, res) -> if not err console.log(res) module.exports = karma: true, shims: underscore: {exports: '_'} backbone: {exports: 'Backbone', deps: ['underscore']} 'backbone-orm': {exports: 'BackboneORM', deps: ['backbone', 'stream']} 'parameters': {exports: '__test__parameters__', deps: ['backbone-orm']} post_load: 'window._ = window.Backbone = null; window.BackboneORM = backbone_orm;' aliases: {'lodash': 'underscore'} $ -> selectors = [ # newsletter modal '.subscribe-banner' '.modal-title' '.modal-body p' '.modal-body .button-add.wide' # default view '.read-more' '.older-posts' '.newer-posts' '.poweredby' # post view 'footer .button-add.large.wide' 'a.post-meta' '.prefix-date' ] $(selector).html(i18n[selector]) for selector in selectors when i18n[selector] # inline css selector = '.read-next-story .post:before' property = "" $('head').append(property) # pagination selector = '.page-number' pageNumber = $(selector).html().split(' ') pageNumberi18n = i18n[selector].split(' ') pageNumber[n] = pageNumberi18n[n] for n in [0, 2] $(selector).html(pageNumber.join(' ')) # forms window.fieldEmail.placeholder = i18n.fieldEmail window.newsletter_subscribe.value = i18n.newsletter_subscribe jQuery -> $('#form-translation textarea').autosize() $('.add-translation').click (event) -> event.preventDefault() $('#form-translation #locale').val('') $('#form-translation #key').val('') $('#form-translation #value').trigger('autosize') $('#form-translation #value').focus() $('.edit-translation').click (event) -> event.preventDefault() $('#form-translation #locale').val($(@).data('locale')) $('#form-translation #key').val($(@).data('key')) $('#form-translation #value').val($(@).html().trim()) $('#form-translation #value').trigger('autosize') $('#form-translation #value').focus() $('#form-translation #value')[0].setSelectionRange(0,0) # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ jQuery -> $(document).keydown (event) -> if $("#shortcuts_available").length action = null target = $(event.target) if target.is("input") || target.is("textarea") if event.which == 27 # Escape key action = -> target.blur() else action = switch event.which when 'A'.charCodeAt(0) then "/transactions/all" when 'L'.charCodeAt(0) then "/transactions" when 'N'.charCodeAt(0) then "/transactions/new" when 'R'.charCodeAt(0) then "/sellers/revenue" when 'S'.charCodeAt(0) then "/sellers" when 'E'.charCodeAt(0) then -> if $("#seller_list").length text = prompt "Seller number:" if text? number = window.get_seller_id(text) if number? window.location.href = "/sellers/" + number + "/edit" else alert("Seller number not found: " + text) if action event.stopPropagation() if typeof action == 'string' window.location.href = action else action() $("#accordion").accordion({ heightStyle: "content", collapsible: true }) @activate_login_form = -> $("#login_form").removeClass 'hidden' $("#login_placeholder").addClass 'hidden' Sprangular.directive 'shippingRateSelection', -> restrict: 'E' templateUrl: 'shipping/rates.html' scope: order: '=' controller: ($scope, Checkout, Env) -> $scope.loading = false $scope.address = {} $scope.currencySymbol = Env.currency.symbol $scope.$watch 'order.shippingRate', (rate, oldRate) -> return if !oldRate || rate.id == oldRate.id order = $scope.order if rate order.shipTotal = rate.cost else order.shipTotal = 0 order.updateTotals() $scope.$watch('order.actualShippingAddress()', -> $scope.address = $scope.order.actualShippingAddress() , true) validateAddress = (address) -> $scope.isValid = address.firstname && address.lastname && address.city && address.address1 && address.zipcode && address.country && address.state && address.phone $scope.$watch('address', validateAddress, true) # use $scope.$watchGroup when its released $scope.$watch 'address.country.id + address.state.id + address.zipcode + isValid', (oldValue, newValue) -> return if $scope.loading || oldValue == newValue || !$scope.isValid $scope.loading = true Checkout.update('payment').then -> $scope.loading = false validateAddress($scope.address) 'use strict' React = require 'react' ManageStepsView = require './ManageStepsView' { connect } = require 'react-redux' { loadStepsByProject } = require 'appirio-tech-client-app-layer' ManageSteps = React.createClass propTypes: projectId: React.PropTypes.string.isRequired componentWillMount: -> { loadStepsByProject, projectId } = this.props loadStepsByProject projectId render: -> { projectId, stepsByProject, permissions } = this.props props = projectId: projectId stepIds: stepsByProject?.items || [] fetching: stepsByProject?.isFetching permissions: permissions || ['CREATE', 'UPDATE', 'DELETE'] React.createElement ManageStepsView, props mapStateToProps = (state, ownProps) -> id = ownProps.projectId projectId: id stepsByProject: state.stepsByProject[id] actionsToBind = { loadStepsByProject } module.exports = connect(mapStateToProps, actionsToBind)(ManageSteps) gravatar_url = (email_address) -> hash = CryptoJS.MD5 email_address.trim().toLowerCase() "http://www.gravatar.com/avatar/" + hash + "?d=404&s=50" Template.profilePage.onRendered -> url = gravatar_url(Template.parentData().emails[0].address) HTTP.get url, (error, response) -> if not error $('#gravatar_help').html('

        Uw avatar zoals geregistreerd bij gravatar.com.

        ') Template.profilePage.helpers email: -> @emails[0].address readonly: -> if @_id == Meteor.userId() then '' else 'readonly' Template.profilePage.events 'submit form': (e) -> e.preventDefault() if @_id == Meteor.userId() name = $('[name=name]').val() telephone_nr = $('[name=telephone_nr]').val() skype_id = $('[name=skype_id]').val() Meteor.users.update @_id, {$set: { name: name, telephone_nr: telephone_nr, skype_id: skype_id }} Router.go 'memberPage', {_id: @_id} 'click .cancel': (e) -> e.preventDefault() Router.go 'memberPage', {_id: @_id} Wheelmap.MapRoute = Ember.Route.extend setupController: (controller, model)-> @_super(controller, model) @controllerFor('toolbar').set('content', @store.findAll('category')) renderTemplate: (controller, model)-> @render 'index', outlet: 'map'AjaxPrefix.addAjaxPrefix(jQuery, -> CMS.prefix) @CMS = Models: {} Views: {} prefix: $("meta[name='path_prefix']").attr('content') _.extend CMS, Backbone.Events $ -> Backbone.emulateHTTP = true $.ajaxSetup headers : { 'X-CSRFToken': $.cookie 'csrftoken' } dataType: 'json' $(document).ajaxError (event, jqXHR, ajaxSettings, thrownError) -> if ajaxSettings.notifyOnError is false return if jqXHR.responseText message = _.str.truncate(jqXHR.responseText, 300) else message = gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.") msg = new CMS.Views.Notification.Error( "title": gettext("Studio's having trouble saving your work") "message": message ) msg.show() window.onTouchBasedDevice = -> navigator.userAgent.match /iPhone|iPod|iPad/i $('body').addClass 'touch-based-device' if onTouchBasedDevice() # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ draw_scoreboard = -> if !document.getElementById('scoreboard_graph') return $.get 'teams/get_score_data', (response,status) -> if typeof this.chart == "undefined" this.chart = c3.generate bindto: '#scoreboard_graph' data: xs: JSON.parse(response.teams) columns: JSON.parse(response.scores) type: 'step' axis: x: tick: count: 10 format: (x) -> moment(x * 1000).local().format 'LLL' y: label: text: 'Score' zoom: enabled: true else this.chart.load xs: JSON.parse(response.teams) columns: JSON.parse(response.scores) setTimeout draw_scoreboard, 30000 return return $(document).on('turbolinks:load', draw_scoreboard) class PhotoGallery constructor: (options) -> @$el = options.el @thumbnails = options.thumbnails @project = options.project setup: -> for thumbnail in @thumbnails new Thumbnail({ el: @$el, thumbnail: thumbnail, project: @project }).listen() class Thumbnail constructor: (options) -> @$el = options.el @thumbnail = $(options.thumbnail) @project = options.project listen: -> @thumbnail.on('click', @_changeImage) _changeImage: => extension = @thumbnail.css('background-image').split(".").pop().replace('")', "") thing = @thumbnail.attr('id') @$el.attr('src', "/assets/images/#{@project}/#{thing}.#{extension}") window.activateGallery = (project) -> new PhotoGallery({ el: $('.photo-display'), thumbnails: $('.thumbnails li'), project: project }).setup() window.Darkswarm = angular.module("Darkswarm", [ 'ngResource', 'mm.foundation', 'LocalStorageModule', 'infinite-scroll', 'angular-flash.service', 'templates', 'ngSanitize', 'ngAnimate', 'uiGmapgoogle-maps', 'duScroll', 'angularFileUpload', 'angularSlideables' ]).config ($httpProvider, $tooltipProvider, $locationProvider, $anchorScrollProvider) -> $httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest' $httpProvider.defaults.headers.common.Accept = "application/json, text/javascript, */*" # We manually handle our scrolling $anchorScrollProvider.disableAutoScrolling() {EventEmitter} = require 'events' aws = require 'aws-sdk' class Uploader extends EventEmitter # Constructor constructor: ({accessKey, secretKey, sessionToken, region, stream, objectName, objectParams, bucket, partSize, maxBufferSize, waitForPartAttempts, waitTime, debug}, @cb) -> super() aws.config.update accessKeyId: accessKey secretAccessKey: secretKey sessionToken: sessionToken region: region if region @objectName = objectName @objectParams = objectParams or {} @objectParams.Bucket ?= bucket @objectParams.Key ?= objectName @objectParams.Body ?= stream @timeout = 300000 @debug = debug or false throw new Error "Bucket must be given" unless @objectParams.Bucket @upload = new aws.S3.ManagedUpload { partSize: 10 * 1024 * 1024, queueSize: 1, params: @objectParams } @upload.minPartSize = 1024 * 1024 * 5 @upload.queueSize = 4 # Progress event @upload.on 'httpUploadProgress', (progress) => console.log "#{progress.loaded} / #{progress.total}" if @debug # Send stream send: (callback) -> @upload.send (err, data) -> if err then console.log err, data callback err, data module.exports = Uploader: Uploader # Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. # See the LICENCE file in the repository root for full licence text. import * as React from 'react' import { button, div, i } from 'react-dom-factories' el = React.createElement export class UserEntry extends React.Component delete: (e) => e.preventDefault() params = method: 'DELETE' dataType: 'json' $.ajax laroute.route('contest-entries.destroy', contest_entry: @props.entry.id), params .done (data) => $.publish 'contest:entries:update', data: data .fail osu.ajaxError render: -> div className: 'contest-userentry contest-userentry--ok', if !@props.locked button className: 'contest-userentry__delete' type: 'button' 'data-confirm': osu.trans('common.confirmation') title: osu.trans('common.buttons.delete') onClick: @delete i className: 'fas fa-times' div className: 'contest-userentry__fileicon', i className: 'far fa-file' div className: 'contest-userentry__filename u-ellipsis-overflow', @props.entry.filename div className: 'contest-userentry__entry-date', dangerouslySetInnerHTML: {__html: osu.timeago(@props.entry.created_at)} div className: 'contest-userentry__filesize', osu.formatBytes(@props.entry.filesize) module.exports = loadSegmentio = if not me.useSocialSignOn() then -> Promise.resolve([]) else _.once -> return new Promise (accept, reject) -> analytics = window.analytics = window.analytics or [] analytics.invoked = true analytics.methods = [ 'trackSubmit' 'trackClick' 'trackLink' 'trackForm' 'pageview' 'identify' 'reset' 'group' 'track' 'ready' 'alias' 'page' 'once' 'off' 'on' ] analytics.factory = (t) -> -> e = Array::slice.call(arguments) e.unshift t analytics.push e analytics for method in analytics.methods analytics[method] = analytics.factory method analytics.load = (t) -> e = document.createElement 'script' e.type = 'text/javascript' e.async = true e.src = (if document.location.protocol is 'https:' then 'https://' else 'http://') + 'cdn.segment.com/analytics.js/v1/' + t + '/analytics.min.js' n = document.getElementsByTagName('script')[0] n.parentNode.insertBefore e, n # Backbone.Mediator.publish 'application:service-loaded', service: 'segment' accept(analytics) return analytics.SNIPPET_VERSION = '3.1.0' analytics.load 'yJpJZWBw68fEj0aPSv8ffMMgof5kFnU9' #analytics.page() # Don't track the page view on initial inclusion svg = require 'svg.js' AppConfig = require 'shared/services/app_config.coffee' angular.module('loomioApp').directive 'progressChart', -> template: '
        ' replace: true scope: stanceCounts: '=' goal: '=' size: '@' restrict: 'E' controller: ['$scope', '$element', ($scope, $element) -> draw = svg($element[0]).size('100%', '100%') $scope.$watchCollection 'stanceCounts', -> y = 0 _.each $scope.stanceCounts, (count, index) -> height = ($scope.size * _.max([parseInt(count), 0])) / $scope.goal draw.rect($scope.size, height) .fill(AppConfig.pollColors.count[index]) .x(0) .y($scope.size - height - y) y += height draw.circle($scope.size / 2) .fill("#fff") .x($scope.size / 4) .y($scope.size / 4) draw.text(($scope.stanceCounts[0] || 0).toString()) .font(size: 16, anchor: 'middle') .x($scope.size / 2) .y(($scope.size / 4) + 3) ] Settings = require 'settings-sharelatex' module.exports = Features = externalAuthenticationSystemUsed: -> Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth? hasFeature: (feature) -> switch feature when 'homepage' return Settings.enableHomepage when 'registration' return not Features.externalAuthenticationSystemUsed() when 'github-sync' return Settings.enableGithubSync when 'v1-return-message' return Settings.accountMerge? and Settings.overleaf? when 'v2-banner' return Settings.showV2Banner when 'custom-togglers' return Settings.overleaf? when 'templates' return !Settings.overleaf? when 'affiliations' return Settings?.apis?.v1?.url? when 'rich-text' isEnabled = true # Switch to false to disable Settings.overleaf? and isEnabled else throw new Error("unknown feature: #{feature}") 'source.ruby': 'rubocop' 'source.ruby.rails': 'rubocop' 'source.python': 'flake8' 'source.js': 'jshint' 'source.haskell': 'hlint' 'text.tex.latex.haskell': 'hlint' 'source.coffee': 'coffeelint' 'source.go': 'gc' 'source.css': 'csslint' 'source.css.scss': 'scss-lint' 'source.puppet': 'puppet-lint' 'source.shell': 'shellcheck' 'source.c': 'clang' 'source.c++': 'clang' 'source.objc': 'clang' 'source.objc++': 'clang' 'source.rust': 'rustc' 'source.erlang': 'erlc' _ = require "underscore" Transform = require "./transform" Interpolator = require "./interpolator" p = require "../../core/properties" class StepInterpolator extends Interpolator.Model initialize: (attrs, options) -> super(attrs, options) props: -> return _.extend {}, super(), { mode: [ p.String, "after"] } compute: (x) -> # Apply the transform to a single value @sort(descending = false) ind = _.findLastIndex(@_x_sorted, (num) -> return x >= num ) ret = @_y_sorted[ind] return(ret) v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: StepInterpolator_ = require 'underscore-plus' {$$$, View} = require 'atom' # Displays the keybindings for a package namespace module.exports = class PackageKeymapView extends View @content: -> @section => @div class: 'section-heading icon icon-keyboard', 'Keybindings' @table class: 'package-keymap-table table native-key-bindings text', tabindex: -1, => @thead => @tr => @th 'Keystroke' @th 'Command' @th 'Selector' @tbody outlet: 'keybindingItems' initialize: (namespace) -> otherPlatformPattern = new RegExp("\\.platform-(?!#{_.escapeRegExp(process.platform)}\\b)") for {command, keystrokes, selector} in atom.keymap.getKeyBindings() continue unless command?.indexOf?("#{namespace}:") is 0 continue if otherPlatformPattern.test(selector) @keybindingItems.append $$$ -> @tr => @td keystrokes @td command @td selector @hide() unless @keybindingItems.children().length > 0 Chamber.Views.Rooms ||= {} class Chamber.Views.Rooms.ShowView extends Backbone.View template: JST["backbone/templates/rooms/show"] events: { "click input[type=submit]": "doSubmit", } initialize: -> @messages_index_view = new Chamber.Views.Messages.IndexView( { el: $("#messages", @el) messages: @options.messages } ) @participants_index_view = new Chamber.Views.Participants.IndexView( { el: $("#participants", @el) participants: @options.participants } ) doSubmit: (e) -> # Get the body of the message from the input input = $("#body") body = input.val() # Create a new message @options.messages.create({ body: body, room_id: room.id, }, { silent: true, error: -> # Since we cleared the input before, if there is an # error, we should repopulate the input field input.val(body) # TODO Add some kind of "notification" system that # warns the user that there was an error. }) # Clear the input field at once input.val("") e.preventDefault() return false class ControlIframe constructor: -> @el = document.createElement('iframe') #need to append to outer document before we can access frame document. FactlinkJailRoot.$factlinkCoreContainer.append(@el) @$el = $(@el) @doc = @el.contentWindow.document; @doc.open() #need doctype to avoid quirks mode @doc.write('') @doc.close() style = @doc.createElement('style') style.appendChild(@doc.createTextNode(FrameCss)) @doc.head.appendChild(style) setContent: (contentNode) -> bodyEl = @doc.body while bodyEl.firstChild bodyEl.removeChild(bodyEl.firstChild) bodyEl.appendChild(contentNode) destroy: -> return unless @el @doc = null @el.parentElement?.removeChild(@el) @$el = @el = null {CompositeDisposable} = require 'atom' {$, View} = require 'space-pen' module.exports = class ToolBarButtonView extends View @content: -> @button class: 'btn btn-default tool-bar-btn' initialize: (options) -> @subscriptions = new CompositeDisposable @priority = options.priority if options.tooltip @prop 'title', options.tooltip @subscriptions.add atom.tooltips.add(@, title: options.tooltip) if options.iconset @addClass "#{options.iconset} #{options.iconset}-#{options.icon}" else @addClass "icon-#{options.icon}" @on 'click', => if not @hasClass 'disabled' if typeof options.callback is 'string' atom.commands.dispatch @getPreviouslyFocusedElement(), options.callback else options.callback(options.data, @getPreviouslyFocusedElement()) @on 'mouseover', => @storeFocusedElement() setEnabled: (enabled) -> if enabled @removeClass 'disabled' else @addClass 'disabled' destroy: -> @subscriptions.dispose() getPreviouslyFocusedElement: () -> if @previouslyFocusedElement[0] and @previouslyFocusedElement[0] isnt document.body @eventElement = @previouslyFocusedElement[0] else @eventElement = atom.views.getView(atom.workspace) storeFocusedElement: -> @previouslyFocusedElement = $(document.activeElement) Yossarian.PlayerController = Ember.Controller.extend artists: null currentRecording: null lastRecording: null recordings: (-> @get('artists').toArray().map((artist) -> artist.get('recordings')).flatten().uniq().shuffle() ).property('artists.@each.recordings.@each') playing: (-> @get('currentRecording')? ).property('currentRecording') currentRecordingChanged: (-> @set('lastRecording', @get('currentRecording')) if @get('currentRecording') ).observes('currentRecording') artistsChanged: (-> @set('lastRecording', null) ).observes('artists.@each') play: -> @set('currentRecording', @get('lastRecording') || @get('recordings')[0]) actions: { play: -> @play() stop: -> @set('currentRecording', null) backward: -> index = @get('recordings').indexOf(@get('lastRecording')) recording = @get('recordings')[index - 1] @set('currentRecording', recording) if recording forward: -> index = @get('recordings').indexOf(@get('lastRecording')) recording = @get('recordings')[index + 1] @set('currentRecording', recording) if recording } Species.ElibrarySearchFormView = Ember.View.extend templateName: 'species/elibrary_search_form' classNames: ['search-block'] actions: toggleSearchOptions: () -> @.$('.search-form').toggle()#= require "../users/new" $ -> if isOnPage 'manage', 'users' mconf.Resources.addToBind -> mconf.Users.New.bind() window.onpopstate = (event) -> window.location.href = mconf.Base.urlFromParts(event.state) event.state $('input.resource-filter-field').each -> input = $(this) field = $(this).attr('data-attr-filter') baseUrl = $('input.resource-filter').data('load-url') $(this).on 'click', -> params = mconf.Base.getUrlParts(String(window.location)) if $(this).is(':checked') params[field] = $(this).val() opValue = if params[field] is 'true' then 'false' else 'true' opElement = $("input[data-attr-filter='#{field}'][value='#{opValue}']")[0] opElement.checked = false if opElement.checked else delete params[field] history.pushState(params, '', baseUrl + mconf.Base.urlFromParts(params)) $('input.resource-filter').trigger('update-resources') path = require 'path' ModuleCache = require '../../src/module-cache' module.exports = (grunt) -> grunt.registerTask 'generate-module-cache', 'Generate a module cache for all core modules and packages', -> appDir = grunt.config.get('atom.appDir') {packageDependencies} = grunt.file.readJSON('package.json') for packageName, version of packageDependencies ModuleCache.create(path.join(appDir, 'node_modules', packageName)) ModuleCache.create(appDir) Hummingbird.BootstrapTooltipComponent = Ember.Component.extend tagName: 'a' didInsertElement: -> @$().tooltip placement: @get('placement') title: @get('title') Sprangular.directive 'creditCardForm', -> restrict: 'E' templateUrl: 'credit_cards/form.html' scope: creditCard: '=' controller: ($scope) -> $scope.months = [ {index: 1, name: 'January'}, {index: 2, name: 'February'}, {index: 3, name: 'March'}, {index: 4, name: 'April'}, {index: 5, name: 'May'}, {index: 6, name: 'June'}, {index: 7, name: 'July'}, {index: 8, name: 'August'}, {index: 9, name: 'September'}, {index: 10, name: 'October'}, {index: 11, name: 'November'}, {index: 12, name: 'December'} ] currentYear = (new Date).getFullYear() $scope.years = [currentYear .. currentYear+15] $scope.$watch 'creditCard.number', -> $scope.creditCard.determineType() class IDE.FinderContextMenuController extends NFinderContextMenuController getFolderMenu: (fileView) -> fileData = fileView.getData() items = Expand : action : "expand" separator : yes Collapse : action : "collapse" separator : yes 'Change top folder' : separator : yes children : @getTopFolderItems fileView 'Make this the top folder' : action : 'makeTopFolder' 'Workspace from here' : action : 'createWorkspace' 'Terminal from here' : action : 'createTerminal' separator : yes Delete : action : 'delete' separator : yes Rename : action : 'rename' Duplicate : action : 'duplicate' Compress : children : 'as .zip' : action : 'zip' 'as .tar.gz' : action : 'tarball' 'Set permissions' : separator : yes children : customView : new NSetPermissionsView {}, fileData 'New file' : action : 'createFile' 'New folder' : action : 'createFolder' Refresh : action : 'refresh' if fileView.expanded delete items.Expand else delete items.Collapse return items module.exports = """ query($showHeroUnits: Boolean!) { home_page { artwork_modules( max_rails: 7, order: [ ACTIVE_BIDS, RECENTLY_VIEWED_WORKS RECOMMENDED_WORKS, FOLLOWED_ARTISTS, RELATED_ARTISTS, FOLLOWED_GALLERIES, SAVED_WORKS, LIVE_AUCTIONS, CURRENT_FAIRS, FOLLOWED_GENES, GENERIC_GENES]) { key params { id related_artist_id followed_artist_id } } hero_units(platform: DESKTOP) @include(if: $showHeroUnits){ mode heading title title_image_url retina_title_image_url: title_image_url(retina: true) subtitle link_text href background_image_url credit_line } } } """ asar = require 'asar' fs = require 'fs' path = require 'path' module.exports = (grunt) -> {cp, rm} = require('./task-helpers')(grunt) grunt.registerTask 'generate-asar', 'Generate asar archive for the app', -> done = @async() unpack = [ '*.node' '.ctags' 'ctags-darwin' 'ctags-linux' 'ctags-win32.exe' '**/node_modules/spellchecker/**' '**/resources/atom.png' ] unpack = "{#{unpack.join(',')}}" appDir = grunt.config.get('atom.appDir') unless fs.existsSync(appDir) grunt.log.error 'The app has to be built before generating asar archive.' return done(false) asar.createPackageWithOptions appDir, path.resolve(appDir, '..', 'app.asar'), {unpack}, (err) -> return done(err) if err? rm appDir fs.renameSync path.resolve(appDir, '..', 'new-app'), appDir ctagsFolder = path.join("#{appDir}.asar.unpacked", 'node_modules', 'symbols-view', 'vendor') for ctagsFile in fs.readdirSync(ctagsFolder) fs.chmodSync(path.join(ctagsFolder, ctagsFile), "755") done() Controller = require 'lib/controller' User = require 'models/user' Users = require 'models/users' BasicSettingsView = require 'views/settings/basic' UsersList = require 'views/users/list' module.exports = class SettingsController extends Controller basic: -> @adjustTitle 'Settings' @view = new BasicSettingsView users: (params) -> @adjustTitle 'Users' @reuse 'UsersList', compose: -> @users = new Users @users.fetch().done => if params.email @user = @users.findWhere email: params.email else @user = null @view = new UsersList collection: @users model: @user check: (options) -> if options.email isnt @view.model.get('id') @view.selectUser @users.findWhere(email: options.email) @view? options: email: params.email if @view?.model console.log 'MODEL!!!' MixedIndentWarningView = require './mixed-indent-warning-view' IndentChecker = require '../lib/indent-checker' {CompositeDisposable} = require 'atom' module.exports = MixedIndentWarning = editor: null mixedIndentWarningView: null modalPanel: null subscriptions: null activate: (state) -> # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable @subscriptions = new CompositeDisposable # Register command that toggles this view @subscriptions.add atom.commands.add 'atom-workspace', 'mixed-indent-warning:toggle': => @toggle() @subscriptions.add atom.commands.add 'atom-workspace', 'mixed-indent-warning:file': => @scanFile() deactivate: -> @subscriptions.dispose() toggle: -> console.log 'MixedIndentWarning was toggled!' scanFile: -> atom.workspace.observeTextEditors (editor) -> text = editor.getText() linesToDecorate = IndentChecker.getLinesWithLessCommonType(text) linesToDecorate.forEach (row) -> row = parseInt(row, 10) - 1 marker = editor.markBufferRange([[row, 0], [row, Infinity]], invalidate: 'never') marker.setProperties({MixedIndent: 'mixed-indent-incorrect'}) editor.decorateMarker(marker, type: 'line-number', class: "mixed-indent-incorrect") RefreshWeather = (options) -> options = options or {} options.elem = options.elem or "#weather-general" options.update_interval = options.update_interval or FAST_UPDATE elem = jq options.elem update_interval = null setWeatherInfo = (icon, temperature) -> elem.html "
        #{temperature}°C" resetWeatherInfo = -> elem.html "" update = -> jq.get "/homecontroller/weather/get_json?" + (new Date()).getTime(), (data) -> resetWeatherInfo() if data? and data.current? setWeatherInfo data.current.icon, data.current.feels_like startInterval = -> update() update_interval = setInterval -> update() , options.update_interval stopInterval = -> if update_interval? update_interval = clearInterval update_interval @update = update @startInterval = startInterval @stopInterval = stopInterval return @ jq => @refresh_weather = new RefreshWeather "elem": "#weather-general" @refresh_weather.startInterval() class window.EvidenceCollection extends Backbone.Collection comparator: (evidence) -> # TODO: breaks with relevance > 1000 -parseFloat(evidence.get('opinions')?.formatted_relevance || '0.0'); model: (attrs, options) -> switch attrs.evidence_type when 'FactRelation' new FactRelation attrs, options when 'Comment' new Comment attrs, options else `undefined` initialize: (models, opts) -> @type = opts.type @fact = opts.fact url: -> "/facts/#{@fact.id}/#{@type}_evidence/combined" React = require 'react' BS = require 'react-bootstrap' {TaskPlanStore} = require '../../../flux/task-plan' buildTooltip = ({isPublished}) -> saveMessage = if isPublished

        Save will update the assignment.

        else

        Publish will make the assignment visible to students on the open date. If open date is today, it will be available immediately.

        Save as draft will add the assignment to the teacher calendar only. It will not be visible to students, even if the open date has passed.

        {saveMessage}

        Cancel will discard all changes and return to the calendar.

        {

        Delete Assignment will remove the assignment from students dashboards. Students who have worked the assignment will still be able to review their work.

        if isPublished}
        HelpTooltip = React.createClass propTypes: isPublished: React.PropTypes.bool.isRequired render: -> module.exports = HelpTooltip #= require ./renderer class Turbolinks.ErrorRenderer extends Turbolinks.Renderer constructor: (@html) -> render: (callback) -> @renderView => @replaceDocumentHTML() @activateBodyScriptElements() callback() replaceDocumentHTML: -> document.documentElement.innerHTML = @html activateBodyScriptElements: -> for replaceableElement in @getScriptElements() element = @createScriptElement(replaceableElement) replaceableElement.parentNode.replaceChild(element, replaceableElement) getScriptElements: -> document.documentElement.querySelectorAll("script") class EnvironmentRuleItem extends EnvironmentItem constructor: (options = {}, data) -> options.cssClass = 'rule' options.joints = ['right'] options.allowedConnections = EnvironmentDomainItem : ['left'] super options, data @setClass "disabled" unless data.enabled contextMenuItems: -> colorSelection = new ColorSelection selectedColor : @getOption 'colorTag' colorSelection.on "ColorChanged", @bound 'setColorTag' items = Edit : disabled : KD.isGuest() action : 'edit' Delete : disabled : KD.isGuest() action : 'delete' separator : yes customView : colorSelection return items cmedit: -> modal = new AddFirewallRuleModal {}, @getData() modal.once "RuleUpdated", => @template.update() {enabled} = @getData() if enabled then @unsetClass "disabled" else @setClass "disabled" confirmDestroy: -> data = @getData() options = deleteMesage : "#{data.name} has been removed." content : "
        This will remove the rule #{data.name} permanently, there is no way back!
        " deletionModal = new DomainDeletionModal options, @getData() deletionModal.on "domainRemoved", @bound "destroy" jQuery -> percentageFormatter = (x) -> x * 100.0 + "%" $('.tournament.plot').each (i, element) -> element_id = $(element).attr('id') data = $.parseJSON($(element).attr('data-ratings')) options = { series: { lines: { show: true } }, yaxis: { min: 0.0, max: 0.0, tickFormatter: percentageFormatter }, xaxis: { min: 1000.0, max: 1000.0 } } plot_data = $.map(data, (rating, i) -> distribution = new NormalDistribution(rating['rating'], rating['rating_deviation']) range = distribution.getRange() range_points = range.getPoints() options.xaxis.min = Math.min(options.xaxis.min, range_points[0]) options.xaxis.max = Math.max(options.xaxis.max, range_points[range_points.length - 1]) pdfs = distribution.density(range) options.yaxis.max = Math.max(options.yaxis.max, jstat.max(pdfs) * 1.1) data = [] $.each(pdfs, (i) -> data.push([range_points[i], pdfs[i]]) ) return { data: data, hoverable: true, clickable: false, label: rating['user_name'] } ) plot = new Plot(element_id + ' .plot', options) plot.setData(plot_data) plot.render() popupCenter = (url, width, height, name) -> left = (screen.width/2)-(width/2) top = (screen.height/2)-(height/2) window.open(url, name, "menubar=no,toolbar=no,status=no,width=#{width},height=#{height},toolbar=no,left=#{left},top=#{top}") $("span.social-services-button a.popup").click((e) -> popupCenter($(this).attr("href"), $(this).attr("data-width"), $(this).attr("data-height"), "authPopup") e.stopPropagation() false ) document.addEventListener('signed in', ()-> window.location.reload(true) ) document.addEventListener('social error', (event) -> FactlinkApp.NotificationCenter.error(event.detail) ) angular.module('loomioApp').factory 'Session', ($rootScope, $translate, $window, Records, AppConfig) -> login: (data) -> Records.import(data) if @visitor() defaultParams = {participation_token: @visitor().participationToken} Records.stances.remote.defaultParams = defaultParams Records.polls.remote.defaultParams = defaultParams return unless AppConfig.currentUserId? $translate.use(@user().locale) $rootScope.$broadcast 'loggedIn', @user() @user() logout: -> AppConfig.loggingOut = true Records.sessions.remote.destroy('').then -> $window.location.href = '/' user: -> Records.users.find(AppConfig.currentUserId) or Records.users.build() visitor: -> Records.visitors.find(AppConfig.currentVisitorId) participant: -> @visitor() or @user() currentGroupId: -> @currentGroup? && @currentGroup.id require 'coffee-react/register' require "#{ROOT}/views/env" # i18n {join} = require 'path-extra' window.i18n = {} window.i18n.main = new(require 'i18n-2') locales: ['en-US', 'ja-JP', 'zh-CN', 'zh-TW'] defaultLocale: 'zh-CN' directory: join(__dirname, 'assets', 'i18n') extension: '.json' updateFiles: false devMode: false window.i18n.main.setLocale(window.language) window.__ = window.i18n.main.__.bind(window.i18n.main) try require 'poi-plugin-translator' catch error console.log error window.i18n.resources ?= {} window.i18n.resources.__ ?= (str) -> return str window.i18n.resources.translate ?= (locale, str) -> return str window.i18n.resources.setLocale ?= (str) -> return window.__r = window.i18n.resources.__.bind(window.i18n.resources) require './views' angular.module 'NotSoShitty.login' .config ($stateProvider) -> $stateProvider .state 'trello-login', url: '/login/trello' controller: 'TrelloLoginCtrl' templateUrl: 'login/states/trello/view.html' resolve: dummy: (localStorageService, $state, $q) -> deferred = $q.defer() if localStorageService.get 'trello_token' $state.go 'tab.current-sprint' else deferred.resolve() deferred.promise _ = require 'underscore' React = require 'react' {ExerciseCardMixin} = require '../task-plan/homework/exercises' {ExerciseStore} = require '../../flux/exercise' String = require '../../helpers/string' Exercise = React.createClass mixins: [ExerciseCardMixin] propTypes: exercise: React.PropTypes.object.isRequired getPanelStyle: -> "default" renderHeader: ->
        {for pool in ExerciseStore.poolTypes(@props.exercise) {String.titleize(pool)}}
        render: -> @renderExercise() module.exports = Exercise AWS = Meteor.require 'aws-sdk' AWS.config.update 'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q", 'secretAccessKey' : "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", 'region' : "us-west-2" s3 = new AWS.S3() bucket = "d2mpclient" Meteor.startup -> s3.listBuckets {}, (err, data)-> console.log "=== buckets ===" if err? console.log "Error loading buckets: "+err else if data? bucketFound = false for bucket, i in data.Buckets console.log " --> "+bucket.Name bucketFound = true if bucket.Name is bucket if not bucketFound console.log "Client bucket not found!" generateModDownloadURL = (mod)-> response = Async.runSync (done)-> done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath} response.result TentStatus.Models.StatusPost = class StatusPostModel extends TentStatus.Models.Post @model_name: 'status_post' @post_type: new TentClient.PostType(TentStatus.config.POST_TYPES.STATUS) @validate: (attrs, options = {}) -> errors = [] if (attrs.content?.text and attrs.content.text.match /^[\s\r\t]*$/) || (options.validate_empty and attrs.content?.text == "") errors.push { text: 'Status must not be empty' } if attrs.content?.text and TentStatus.Helpers.byteLength(attrs.content.text) > TentStatus.config.MAX_STATUS_LENGTH errors.push { text: "Status must be no more than #{TentStatus.config.MAX_STATUS_LENGTH} bytes" } return errors if errors.length null fetchReplies: (options = {}) => collection = TentStatus.Collections.StatusReplies.find(entity: @get('entity'), post_id: @get('id')) collection ?= new TentStatus.Collections.StatusReplies(entity: @get('entity'), post_id: @get('id')) limit = TentStatus.config.CONVERSATION_PER_PAGE collection.options.params = { mentions: @get('entity') + '+' + @get('id') types: [TentStatus.config.POST_TYPES.STATUS_REPLY] limit: limit } if collection.model_ids.length options.success?(collection.models(collection.model_ids.slice(0, limit))) else collection.fetch null, options null define (require) -> $ = require('jquery') Mathjax = require('mathjax') BaseView = require('cs!helpers/backbone/views/base') template = require('hbs!./body-template') require('less!./body') return class MediaBodyView extends BaseView template: template events: 'click .solution > .ui-toggle-wrapper > .ui-toggle': 'toggleSolution' initialize: () -> super() @listenTo(@model, 'changePage', @render) onRender: () -> MathJax.Hub.Queue(['Typeset', MathJax.Hub], @$el.get(0)) toggleSolution: (e) -> $solution = $(e.currentTarget).closest('.solution') $solution.toggleClass('ui-solution-visible') Backbone.Factlink ||= {} class Backbone.Factlink.CrossFadeRegion extends Backbone.Marionette.Region defaultFadeTime = 560 initialize: -> @on 'close', -> @$el?.stop() crossFade: (newView) -> if @currentView @$el.stop().fadeOut(@_fadeTime(), => @show newView) else @show(newView) open: (view) -> @$el.stop().hide().html(view.el).fadeIn(@_fadeTime()) resetFade: -> @$el?.stop().fadeOut(@_fadeTime(), => @reset()) _fadeTime: -> 3000 #@options?.fadeTime || defaultFadeTime ignoreEvent = (event) -> event.stopPropagation() event.preventDefault() class @JackUp.DragAndDrop constructor: (@droppableElement, @processor) -> @droppableElement .bind("dragenter", @_drag) .bind("drop", @_drop) .bind("drop", @_dragOut) _drag: (event) => ignoreEvent event event.originalEvent.dataTransfer.dropEffect = "copy" @droppableElement.addClass("hover") _dragOut: (event) => ignoreEvent event @droppableElement.removeClass("hover") _drop: (event) => ignoreEvent event @droppableElement.find('[data-placeholder]').hide() @processor.processFilesForEvent(event) window.ReactUserTabs = React.createBackboneClass render: -> spaced_middle_dot = " \u00b7 " _div ['main-region-tabs'], _a [ 'active' if @props.page == 'about' rel: 'backbone' href: "/#{@model().get('username')}" ], 'About' spaced_middle_dot _a [ href: "/#{@model().get('username')}/edit" ], 'Edit' spaced_middle_dot _a [ href: "/#{@model().get('username')}/password/edit" ], 'Change password' spaced_middle_dot _a [ 'active' if @props.page == 'notification-settings' rel: 'backbone' href: "/#{@model().get('username')}/notification-settings" ], 'Notification Settings' class ChatConversationListItemTitle extends JView constructor:(options = {}, data)-> options.cssClass = 'chat-item' data = [nick for nick in data when nick isnt KD.nick()].first super viewAppended:-> invitees = @getData() @accounts = [] for invitee in invitees KD.remote.cacheable invitee, (err, account)=> warn err if err @accounts.push account?.first or Object @setTemplate @pistachio() if @accounts.length is @getData().length getName:(index)-> "#{@accounts[index].profile.firstName} #{@accounts[index].profile.lastName}" pistachio:-> @setClass 'multiple' if @accounts.length > 1 @avatar = new AvatarView size : {width: 30, height: 30} origin : @accounts.first @participants = switch @accounts.length when 1 then @getName 0 when 2 then "#{@getName(0)} and #{@getName(1)}" else "#{@getName(0)}, #{@getName(1)} and #{data.length - 2} more." """
        {{> @avatar}}

        #{@participants}

        """ PlayScene = preload: -> create: -> update: -> game = new Phaser.Game 640, 480, Phaser.AUTO, 'game' game.state.add 'play', PlayScene game.state.start.play Organization = require "../../models/organization" # Need to support authentication via Organization API key as well module.exports = (req, res, next) -> if req.session.org_id Organization.findById req.session.org_id, (err, org)-> req.org = org req.session.org_id = org.id next() else res.redirect('/login') angular.module("doubtfire.api.models.task-completion-csv", []) .service("TaskCompletionCsv", (DoubtfireConstants, $window, currentUser, fileDownloaderService) -> this.downloadFile = (unit) -> fileDownloaderService.downloadFile "#{DoubtfireConstants.API_URL}/csv/units/#{unit.id}/task_completion.json?auth_token=#{currentUser.authenticationToken}", "#{unit.name}-task-completion.csv" return this ) .service("TutorAssessmentCsv", (DoubtfireConstants, $window, currentUser) -> this.downloadFile = (unit) -> fileDownloaderService.downloadFile "#{DoubtfireConstants.API_URL}/csv/units/#{unit.id}/tutor_assessments.json?auth_token=#{currentUser.authenticationToken}", "#{unit.name}-tutor-assessments.csv" return this ) BlockView = Backbone.View.extend( tagName: 'li' className: 'ui-model-blocks' events: 'click i.block-param': 'paramBlock' 'click i.block-remove': 'removeBlock' initialize: (options) -> @block = options.block @height = options.height @direction = options.direction || 'height' @displayClass = (if @direction is "width" then "inline" else "block") _.bindAll this, "render" @blockTemplate = _.template($('#blockView').html()) return paramBlock: (event) -> $('.modal-title').text 'Please wait ...' view = new adminFormView(url: @block.get('links')._self_form) removeBlock: (event) -> switchLoaderFullPage('on') $.ajax url: @block.get('links')._self_remove method: 'POST' success: (response) -> switchLoaderFullPage('off') Backbone.history.loadUrl Backbone.history.fragment error: -> $('.modal-title').text 'Block removal' $('.modal-body').html 'Erreur durant la suppression' switchLoaderFullPage('off') $("#OrchestraBOModal").modal "show" return render: -> $(@el).attr('style', @direction + ':' + @height + '%').addClass(@displayClass).html @blockTemplate( block: @block height: @height ) this ) #= require jquery #= require jquery_ujs #= require_self autoRefreshInterval = 3000 timeout = undefined scrollToBottom = ($container) -> if $container.length > 0 $container.scrollTop($container[0].scrollHeight) toggleRefreshButton = -> $('#auto-refresh').toggleClass('active') $('#auto-refresh i').toggleClass('fa-spin') $('#auto-refresh').hasClass('active') enableAutoRefresh = (force = false) -> if force || (getURLParameter('refresh') == '1') if toggleRefreshButton() timeout = setTimeout(-> Turbolinks.visit("#{document.location.pathname}?refresh=1") , autoRefreshInterval) else clearTimeout(timeout) Turbolinks.visit(document.location.pathname) init = -> scrollToBottom($('.logs')) enableAutoRefresh() $('#auto-refresh').on 'click', -> enableAutoRefresh(true) $(document).ready -> init() $(document).on 'page:load', init assert = require 'assert' joi = require 'joi' schema = require '../../../coffee/helper/schema' data = grupper : require '../../data/gruppe.json' bilder : require '../../data/bilde.json' turer : require '../../data/tur.json' områder : require '../../data/omrade.json' steder : require '../../data/sted.json' validate = (schemaType, dataType) -> s = schema[schemaType] s = s[dataType] if schemaType is 'type' j = joi.validate data[dataType], s, allowUnknown: true assert.strictEqual null, j.error for schemaType in ['required', 'optional', 'type'] do (schemaType) -> describe "#{schemaType}", -> for dataType of data do (dataType) -> it "should validate #{dataType}", -> validate schemaType, dataType fs = require "fs" logger = require "logger-sharelatex" module.exports = DraftModeManager = injectDraftMode: (filename, callback = (error) ->) -> fs.readFile filename, "utf8", (error, content) -> return callback(error) if error? modified_content = DraftModeManager._injectDraftOption content logger.log { content: content.slice(0,1024), # \documentclass is normally v near the top modified_content: modified_content.slice(0,1024), filename }, "injected draft class" fs.writeFile filename, modified_content, callback _injectDraftOption: (content) -> content # With existing options (must be first, otherwise both are applied) .replace(/\\documentclass\[/, "\\documentclass[draft,") # Without existing options .replace(/\\documentclass\{/, "\\documentclass[draft]{")'.text.restructuredtext': 'editor': 'commentStart': '.. ' describe "Skr.Models.Customer", -> it "can be instantiated", -> model = new Skr.Models.Customer() expect(model).toEqual(jasmine.any(Skr.Models.Customer)) it "sends failure messages when code isn't set", (done)-> model = new Skr.Models.Customer() Lanes.Testing.ModelSaver.perform(model, done).then (save)-> expect(save.error).toHaveBeenCalled() expect(model.errors.code).toContain("blank") it "saves when fields are set", (done)-> model = new Skr.Models.Customer( code: "SPECTEST", name: "A Spec Test Customer" billing_address: { name: "Billing Address" } shipping_address: { name: "Shipping Address" } ) Lanes.Testing.ModelSaver.perform(model, done).then (save)-> expect(save.error).not.toHaveBeenCalled() expect(model.errors).toBeNull() # model.save().then( null, -> # # done() # ) # expect(success).not.toHaveBeenCalled() # expect(failure).toHaveBeenCalled() # console.log model.errors # # -> # expect(false).toBeTrue # , -> # assert_equal 1, model.errors.length # done() angular.module('doubtfire.tasks.task-definition-selector',[]) # # A switch that that the selection of a specified task definition # Only handles task definition - not tasks in a project # .directive('taskDefinitionSelector', -> replace: true restrict: 'E' templateUrl: 'tasks/task-definition-selector/task-definition-selector.tpl.html' scope: # Unit required unit: "=" # What to do when definition is changed onSelectDefinition: "=" # Provide a btn-style to force the colour to change` buttonStyle: '@' controller: ($scope, groupService) -> $scope.buttonStyle = if $scope.buttonStyle? then $scope.buttonStyle else 'primary' $scope.groupSetName = (id) -> groupService.groupSetName(id, $scope.unit) $scope.hideGroupSetName = $scope.unit.group_sets.length is 0 $scope.selectedDefinition = null $scope.setSelectedDefinition = (taskDef) -> $scope.selectedDefinition = taskDef if $scope.onSelectDefinition? && _.isFunction($scope.onSelectDefinition) $scope.onSelectDefinition(taskDef) ) class Ribs.KeyboardHelpView extends Backbone.View className: "ribs-keyboard-shortcuts-overlay" events: 'click' : "remove" initialize: (options) -> @views = options.views $(window).on "keyup", @handleKeyup remove: -> $(window).off "keyup", @handleKeyup super handleKeyup: (event) => # ____ or ____ will remove overlay. @remove() if event.which is 27 false render: -> @$el.empty() for namespace, view of @views bindings = view.bindings isHidden = $(view.context?.el).is ":hidden" hasNoKeys = Object.keys(bindings).length is 0 unless isHidden or hasNoKeys h1 = $ "

        ", text: view.label ul = $ "
          " for binding in bindings li = $ "
        • ", class: "hotkey" li.append $ "", class: "key", text: binding.hotkey li.append $ "", class: "action", text: binding.label ul.append li @$el.append h1, ul Meteor.methods getRoomIdByNameOrId: (rid) -> if not Meteor.userId() throw new Meteor.Error 'error-invalid-user', 'Invalid user', { method: 'getRoomIdByNameOrId' } room = RocketChat.models.Rooms.findOneById(rid) or RocketChat.models.Rooms.findOneByName(rid) return null unless room? if room.usernames.indexOf(Meteor.user()?.username) isnt -1 return room._id if room.t isnt 'c' or RocketChat.authz.hasPermission(Meteor.userId(), 'view-c-room') isnt true throw new Meteor.Error 'error-not-allowed', 'Not allowed', { method: 'getRoomIdByNameOrId' } return room._id kd = require 'kd' KDTabView = kd.TabView module.exports = class ApplicationTabView extends KDTabView constructor: (options = {}, data) -> options.resizeTabHandles ?= yes options.lastTabHandleMargin ?= 80 options.closeAppWhenAllTabsClosed ?= yes options.enableMoveTabHandle ?= no options.detachPanes ?= no options.sortable ?= yes options.droppable ?= yes options.cssClass = kd.utils.curry 'application-tabview', options.cssClass super options, data appManager = kd.getSingleton "appManager" @on "PaneAdded", (pane) => @tabHandleContainer.repositionPlusHandle @handles tabView = this pane.on "KDTabPaneDestroy", -> # -1 because the pane is still there but will be destroyed after this event if tabView.panes.length - 1 is 0 if options.closeAppWhenAllTabsClosed appManager.quit appManager.getFrontApp() tabView.emit "AllTabsClosed" tabView.tabHandleContainer.repositionPlusHandle tabView.handles {tabHandle} = pane {plusHandle} = @getOptions().tabHandleContainer tabHandle.on "DragInAction", -> plusHandle?.hide() if tabHandle.dragIsAllowed tabHandle.on "DragFinished", -> plusHandle?.show() #= require ./fact_view.js class window.ExtendedFactView extends FactView tagName: "section" template: "facts/_extended_fact" showLines: 6; onRender: -> super() @renderUserPassportViews(); renderUserPassportViews: ()-> interacting_users = this.model.get('interacting_users') for user_activity in interacting_users.activity view = new UserPassportView model: new User(user_activity.user); el: @$('li.user[data-activity-id=' + user_activity.id + ']'); activity: user_activity view.render() ETahi.MessageTaskController = ETahi.TaskController.extend newCommentBody: "" actions: clearMessageContent: -> null postComment: -> userId = Tahi.currentUser.id.toString() commenter = @store.all('user').findBy('id', userId) commentFields = commenter: commenter messageTask: @get('model') body: @get('newCommentBody') newComment = @store.createRecord('comment', commentFields) App.FoundationExtras = initialize: -> $(document).foundation() $(window).trigger "load.zf.sticky" $(window).trigger "resize" Darkswarm.factory "FilterSelectorsService", -> # This stores all filters so we can access in-use counts etc # Accessed via activeSelector Directive new class FilterSelectorsService selectors: [] new: (obj = {})-> obj.active = false @selectors.push obj obj totalActive: => @selectors.filter (selector)-> selector.active .length filterText: (active)=> if @totalActive() == 0 if active then "Hide filters" else "Filter by" else "#{@totalActive()} filters active" clearAll: => for selector in @selectors selector.active = false class Georgia.Views.LinkFormContent extends Backbone.View template: JST['links/form_content'] className: 'tab-pane' events: 'change input': 'attributeChanged' 'change textarea': 'attributeChanged' initialize: (options) -> $(@el).attr 'id', "content_#{@model.cid}" render: -> $(@el).html(@template(content: @model)) @$('#text').autocomplete( source: '/api/pages/urls' minLength: 2 select: (event, ui) => event.preventDefault() event.stopPropagation() @$('#text').val(ui.item.url) ) .data( "autocomplete" )._renderItem = ( ul, item ) -> return $( "
        • " ) .data( "item.autocomplete", item ) .append( "" + item.url + "" ) .appendTo( ul ) this attributeChanged: (event) -> event.preventDefault() field = $(event.currentTarget) @model.set(field.attr('id'), field.val())### The Event object stores all the releavant information for events that are being queued for sending to the server. ### class WebSocketRails.Event constructor: (data) -> @name = data[0] attr = data[1] @id = (((1+Math.random())*0x10000)|0) unless attr['id']? @channel = if attr.channel? then attr.channel @data = if attr.data? then attr.data else "" @connection_id = data[2] is_channel: => @channel? serialize: => JSON.stringify [@name, @attributes()] attributes: => id: @id channel: @channel data: @data window.Tahi ||= {} class Tahi.PlaceholderElement constructor: (@element, options={}) -> @placeholder = @element.attributes['placeholder'].value $element = $(@element) $element.on 'focus', => @clearPlaceholder() $element.on 'blur', => @setPlaceholder() $element.on 'keydown', (e) => @supressEnterKey(e) @setPlaceholder() getText: () -> text = @element.innerText if text == @placeholder || text == '' then '' else text supressEnterKey: (e) -> if e.keyCode == 13 || e.which == 13 e.preventDefault() clearPlaceholder: -> if @element.innerText == @placeholder @element.innerText = '' @element.classList.remove('placeholder') setPlaceholder: -> if @element.innerText.trim() == '' @element.innerText = @placeholder @element.classList.add('placeholder') $("#post_playlist_id").select2({ language: { noResults: () -> term = $('.select2-search__field')[0].value || Playlist return 'Add '+term+ '' } escapeMarkup: (markup) -> return markup }); class SharableClientTerminalPane extends TerminalPane constructor: (options = {}, data) -> sessionOptions = options.sessionKey options.vmName = sessionOptions.vmName options.vmRegion = sessionOptions.vmRegion options.joinUser = sessionOptions.host options.session = sessionOptions.key options.delay = 0 super options, data vmOn: -> Promise.resolve() getMode: -> 'shared' fetchVm: (callback)-> {vmName, vmRegion} = @getOptions() callback null, hostnameAlias : vmName region : vmRegion angular.module('kassa').service('ProductService',[ '$http' '$routeParams' ($http, $routeParams)-> #handle price as a float, not a string convert = (resp)-> products = Array(resp.data.products || resp.data.product) for product in products product.price = parseFloat(product.price) resp destructure = (resp)-> resp.data.product || resp.data.products all = -> $http.get('/products').then(convert).then(destructure) find = (id)-> $http.get("/products/#{id}").then(convert).then(destructure) currentByRoute = -> find($routeParams.id) update = (product)-> $http.put("/products/#{product.id}", product: product).then(convert).then(destructure) { all: all find: find currentByRoute: currentByRoute update: update } ])Template.newTaskForm.events 'submit #new-task, click #addTaskButton': (e) -> e.preventDefault() body = $('#new-task-text').val() $('#new-task-text').val("") now = new Date() priority = 'low' list = 'Home' Tasks.insert body: body dateDue: moment(now).add('w', 1).toDate() dateCreated: now dateCompleted: false modified: now list: list priority: priority completed: false repeating: false list = Lists.findOne name: list Lists.update list._id, $inc: numTodos: 1 $ -> return unless $('#new_document') $('#files_uploader').fileupload dataType: 'json' maxFileSize: 10000000 acceptFileTypes: /(\.|\/)(pdf|txt|doc|docx|html)$/i #limitConcurrentUploads: 5 #progressall: (e, data) -> #progress = parseInt(data.loaded / data.total * 100, 10) #$('#progress .bar').css "width", "#{progress}%" #add: (e, data) -> import callApi from '../lib/callApi' import {getRawData} from './getters' export GET_DATA = 'GET_DATA' export INVALIDATE_DATA = 'INVALIDATE_DATA' export INVALIDATE_ALL_DATA = 'INVALIDATE_ALL_DATA' export SAVE_DATA_PROMISES = 'SAVE_DATA_PROMISES' export LOGOUT = 'LOGOUT' export LOGIN = 'POST_LOGIN' export SET_UNKNOWN_WARNING_SHOWN = 'SET_UNKNOWN_WARNING_SHOWN' export updateData = (url, minAgeToUpdate) -> (dispatch, getState) -> existingData = getRawData(getState(), url) existingDataTime = existingData?.updateTime if existingDataTime if not minAgeToUpdate? return # -200 to ensure that on age equal to minAgeToUpdate we re-request data if (new Date() - existingDataTime) < minAgeToUpdate * 1000 - 200 return dispatch type: GET_DATA payload: callApi url meta: url: url export invalidateData = (url) -> return type: INVALIDATE_DATA meta: url: url export saveDataPromises = (promises) -> return type: SAVE_DATA_PROMISES payload: dataPromises: promises export invalidateAllData = () -> return type: INVALIDATE_ALL_DATA export logout = () -> (dispatch) -> await callApi 'logout' dispatch(invalidateAllData()) export setUnknownWarningShown = () -> return type: SET_UNKNOWN_WARNING_SHOWN class Creator update: (el) => model = el.getAttribute(ObserveJS.attributeName) if model? @create(el, model) else @destroy(el) create: (el) => model = el.getAttribute(ObserveJS.attributeName) if ObserveJS.cache[model]? if el.instance? el.instance.loaded() return el.instance = new ObserveJS.cache[model](el) el.instance.element = -> el el.instance.on = (event, target, callback) -> callback = callback.bind(el.instance) if callback? el.instance.on.events.push([event, target, callback]) else callback = target target = el target.addEventListener(event, callback) el.instance.on.events = [] if el.instance.loaded? el.instance.loaded() else throw "error: #{model} is not registered. Add your model with ObserveJS.bind(#{model}, {})" destroy: (el) => el.instance.on.events?.forEach (event) -> event[1].removeEventListener(event[0], event[2]) el.instance.unloaded?() delete el.instance @ObserveJS.Creator = new Creator() define ['lib/amd/Backbone','neo4j/webadmin/modules/databrowser/views/PropertyContainerView'], (Backbone, PropertyContainerView) -> # TODO: Refactor out the "shouldBeConvertedToString" into it's own class describe "PropertyContainerView", -> pcv = new PropertyContainerView(template:null) it "recognizes ascii characters as strings", -> expect(pcv.shouldBeConvertedToString "a").toBe(true) expect(pcv.shouldBeConvertedToString "abcd123 ").toBe(true) it "recognizes swedish characters as strings", -> expect(pcv.shouldBeConvertedToString "åäö").toBe(true) expect(pcv.shouldBeConvertedToString "åäö #$ asd ").toBe(true) it "recognizes strings containing odd characters as strings", -> expect(pcv.shouldBeConvertedToString ";åäö #$ asd ").toBe(true) it "recognizes valid JSON values as not being strings", -> expect(pcv.shouldBeConvertedToString "1").toBe(false) expect(pcv.shouldBeConvertedToString "12").toBe(false) expect(pcv.shouldBeConvertedToString "12.523").toBe(false) expect(pcv.shouldBeConvertedToString "['1','2','3']").toBe(false) expect(pcv.shouldBeConvertedToString "[1,2,3]").toBe(false) expect(pcv.shouldBeConvertedToString '"a quoted string"').toBe(false) # Listens for a ready event from the framework, trigger init() # if the application ID is configured. $(Sugar).bind "ready", -> @Facebook.init() if @Configuration.FacebookAppId Sugar.Facebook = appId: false init: -> @appId = Sugar.Configuration.FacebookAppId if $(".fb_button").length > 0 $(".fb_button").addClass("fb_button_large").wrapInner "" @loadAsync() loadAsync: -> facebook_lib = this #$(this).bind "ready", -> window.fbAsyncInit = -> FB.init appId: Sugar.Facebook.appId #status: true # Check login status #cookie: true # Enable cookies to allow the server to access the session #xfbml: true # Parse XFBML $("body").append "
          " e = document.createElement("script") e.src = document.location.protocol + "//connect.facebook.net/en_US/all.js" e.async = true document.getElementById("fb-root").appendChild e $('input.icon-check[type="checkbox"]').each -> elm = $(this) icon = $('', class: 'fa fa-fw clickable') icon.insertAfter(elm) change = -> if elm.is(':checked') icon.removeClass('fa-square-o').addClass('fa-check-square') else icon.addClass('fa-square-o').removeClass('fa-check-square') elm.hide().change(change) icon.click -> elm.prop('checked', !elm.is(':checked')) change() change() {BattleServer} = require '../server' {Engine} = require '../engine' sinon = require 'sinon' describe 'BattleServer', -> describe '#queuePlayer', -> it "adds a new player to the server's queue", -> server = new BattleServer() server.queuePlayer({}) server.queuedPlayers().should.have.length 1 describe '#beginBattles', -> it 'tells the engine to create battles', -> engine = new Engine() server = new BattleServer(engine) stub = sinon.stub(engine, 'createBattle') server.queuePlayer({}) server.queuePlayer({}) server.beginBattles() stub.called.should.be.true AuthenticationController = require './../Authentication/AuthenticationController' AnalyticsController = require('./AnalyticsController') AnalyticsProxy = require('./AnalyticsProxy') module.exports = apply: (webRouter, privateApiRouter, publicApiRouter) -> webRouter.post '/event/:event', AnalyticsController.recordEvent webRouter.put '/editingSession/:projectId', AnalyticsController.updateEditingSession publicApiRouter.use '/analytics/graphs', AuthenticationController.httpAuth, AnalyticsProxy.call('/graphs') publicApiRouter.use '/analytics/recentTeamActivity', AuthenticationController.httpAuth, AnalyticsProxy.call('/recentTeamActivity') mongo = require 'mongoskin' uuid = require 'uuid' DB = process.env.DBPORT || 'users' db = mongo.db('mongodb://localhost:27017/#{DB}', {native_parser: true}) db.bind('user').bind({ getByID: (userID, callback) -> this.findOne({userID: userID}, callback) }) # Class for interracting with MongoDB using Mongoskin # @see https://github.com/kissjs/node-mongoskin Mongoskin reference class dbController # Retrive user data from database # # @example # dbController.findUser(userID, (err, data) -> # console.error if err # console.log data # ) # @param [String] userID Key that stored in DB for specific repository # @param [Function] cb Callback that will be called with two params: error and data # @author g07cha @findUser: (userID, cb) -> db.user.getByID(userID, cb(err, data)) # Add user to db # # @param [String] access_token Token for Github # @return [String] userID UUID for future queries # @author g07cha @addUser: (token) -> userID = uuid.v1(); console.log(db.user.insertOne({token: token, userID: userID})) userID module.exports = dbControllerdefine [ '../core' './base' ], (c, base) -> class QueryModel extends base.Model class QueryCollection extends base.Collection model: QueryModel url: -> c.session.url('queries') initialize: -> super c.subscribe c.SESSION_OPENED, => @fetch(reset: true) c.subscribe c.SESSION_CLOSE, => @reset() class SharedQueryCollection extends QueryCollection url: -> c.session.url('shared_queries') { QueryModel, QueryCollection, SharedQueryCollection } class Controller constructor: ($scope, $rootScope, $location, entryService, i18nService) -> $rootScope.$emit 'navigationConfig', labelForTitle: i18nService.get 'dictionaryTitle' backAction: () -> $location.path('/home') entryService.all().then (entries) => first_letters = _.map(entries, (entry) -> entry.entry_word[0]) $scope.letters = _.uniq(first_letters).sort() angular.module('app').controller 'dictionaryController', ['$scope', '$rootScope', '$location', 'entryService', 'i18nService', Controller] @pkgJson = require '../../package.json' # Start the crash reporter before anything else. require('crash-reporter').start(productName: @pkgJson.name, companyName: 'atom-shell-starter') fs = require('fs') path = require('path') Sequelize = require('sequelize') lodash = require('lodash') config = require('../../config/config') db = {} sequelize = new Sequelize config.db fs.readdirSync(__dirname) .filter (file) -> ~file.indexOf('.') and file != 'index.coffee' .forEach (file) -> model = sequelize.import path.join(__dirname, file) db[model.name] = model Object.keys(db).forEach (modelName) -> if 'associate' of db[modelName] db[modelName].associate db module.exports = lodash.extend sequelize: sequelize, Sequelize: Sequelize , db #= require_tree ../../../templates/events #= require marked markdown = (text) -> marked(text || '') underscore = (text) -> text.replace(/([a-z\d])([A-Z]+)/g, '$1_$2') .replace(/[-\s]+/g, '_') .toLowerCase() endsWith = (str, suffix)-> str.indexOf(suffix, str.length - suffix.length) != -1 pluralize = (text)-> if endsWith(text, 'y') "#{text.substr(0, text.length-1)}ies" else "#{text}s" eventTypeToTemplate = (type)-> underscored = underscore(type.replace('Event::','')) "events/#{pluralize(underscored)}/_#{underscored}" class window.WipEventView extends Backbone.View initialize: -> @model.on 'change', @render template: -> template_name = eventTypeToTemplate(@model.get('type')) JST[template_name] render: => $(@el).html(@template().render(@templateAttributes())) @$('time').timeago() # display new timestamp @ templateAttributes: -> attrs = @model.attributes attrs.body_html = @body_html() attrs body_html: (text) -> @model.get('body_html') || markdown(@model.get('body')) class CMSimple.Panels.ImageLibrary extends Mercury.Panel @toggle: (region)-> @instance ?= new CMSimple.Panels.ImageLibrary() @instance.toggle() constructor: ()-> super(null, 'insertMedia', title: 'Image Library', appendTo: '.mercury-toolbar-container', closeButton: true) @button = $('.mercury-insertMedia-button') @loadContent JST['views/image_library']() angular.module('loomioApp').factory 'UserHelpService', (CurrentUser) -> new class UserHelpService helpLocale: -> switch CurrentUser.locale when 'es', 'an', 'ca', 'gl' then 'es' else 'en' helpLink: -> "https://loomio.gitbooks.io/manual/content/#{@helpLocale()}/index.html" username_strategy = match: /(^|\s)@(\w*)$/; search: (name, callback)-> search_call = $.getJSON("/user_lookup",{query: name}) search_call.done (result)-> callback( result.map (r)-> r.name) search_call.fail -> callback([],true) replace: (entry)-> "@#{entry} " template: (entry)-> "@#{entry}" idea_title_strategy = match: /(^|\s)#(\w*)$/; search: (name, callback)-> search_call = $.getJSON("/idea_title_lookup",{query: name}) search_call.done (result)-> callback result search_call.fail -> callback([],true) replace: (entry)-> "##{entry.title.substring(0,10).replace(" ","_")}[#{entry.doi}] " template: (entry)-> "#{entry.title}" strategies = [username_strategy, idea_title_strategy ] $ -> $(".auto-complete").textcomplete(strategies,{}) ### # Copyright 2015-2017 ppy Pty. Ltd. # # This file is part of osu!web. osu!web is distributed with the hope of # attracting more community contributions to the core ecosystem of osu!. # # osu!web is free software: you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License version 3 # as published by the Free Software Foundation. # # osu!web is distributed WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with osu!web. If not, see . ### {div} = ReactDOMFactories bn = 'avatar' @UserAvatar = (props) -> modifiers = props .modifiers .map (m) => "#{bn}--#{m}" .join ' ' className = "#{bn} #{modifiers}" if props.user.id? div className: className style: backgroundImage: "url('#{props.user.avatar_url}')" else div className: "#{className} #{bn}--guest" uploader = new Slingshot.Upload('files') Template.fileList.helpers 'files': -> FileList.find {}, sort: LastModified: -1 'date': -> moment(@LastModified).fromNow() handleFiles = (event) -> if event.type == "drop" files = event.originalEvent.dataTransfer.files else files = event.target.files file = files[0] Session.set 'uploadingFile', file.name uploader.send file, (err, url) -> if err console.log err else Meteor.call 'listFiles' Template.fileList.events 'dropped #dropzone': handleFiles 'click #dropzone': (event) -> event.preventDefault() $('#dropzoneFile').trigger('click') 'change #dropzoneFile': handleFiles 'click .file': (event) -> event.preventDefault() Session.set 'currentFile', @ $('#currentFile').modal backdrop: false Template.uploadingFile.helpers uploading: -> filename = Session.get 'uploadingFile' if filename and uploader.status() is 'transferring' name: filename percent_uploaded: Math.round(uploader.progress() * 100) _ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread
          componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems Marbles.Views.PostActionRepost = class PostActionRepostView extends Marbles.Views.PostAction @view_name: 'post_action_repost' performAction: => post = TentStatus.Models.Post.find(cid: @parentView().post_cid) data = { permissions: public: true type: "https://tent.io/types/repost/v0##{(new TentClient.PostType post.get('type')).toStringWithoutFragment()}" mentions: [{ entity: post.get('entity'), post: post.get('id') }] refs: [{ entity: post.get('entity'), post: post.get('id') }] content: entity: post.get('entity') post: post.get('id') } TentStatus.Models.Post.create(data, error: (res, xhr) => @enable() alert("Error: #{JSON.parse(xhr.responseText)?.error}") # TODO: use a more unobtrusive notification success: (post, xhr) => @disable() ) enable: => @disabled = false disable: => @disabled = true SpellChecker = require 'spellchecker' module.exports = findMisspellings: (text) -> wordRegex = /(?:^|[\s\[\]])([a-zA-Z']+)(?=[\s\.\[\]]|$)/g row = 0 misspellings = [] for line in text.split('\n') while matches = wordRegex.exec(line) word = matches[1] continue unless SpellChecker.isMisspelled(word) startColumn = matches.index + matches[0].length - word.length endColumn = startColumn + word.length misspellings.push([[row, startColumn], [row, endColumn]]) row++ callTaskMethod('misspellingsFound', misspellings) React = require 'react' module.exports = React.createClass displayName: 'YaleLogin' render:-> return
          Welcome
          To begin marking and transcribing programs, please log in to your prefered account
          Yale Login
          Sprangular.controller 'AccountCtrl', ($scope, $location, $routeParams, Status, Account) -> Status.pageTitle = 'My Account' user = Account.user user.password = '' user.password_confirmation = '' $scope.editing = false $scope.user = user refreshAccount = -> Account.init().then -> $scope.user = Account.user $scope.edit = -> $scope.editing = true $scope.stopEdit = -> $scope.editing = false $scope.save = -> user.errors = {} Account.save(user) .then (content) -> $scope.editing = false $location.path('/') if !Account.isLogged , (errors) -> user.errors = errors refreshAccount() # Your init script # # Atom will evaluate this file each time a new window is opened. It is run # after packages are loaded/activated and after the previous editor state # has been restored. # # Settings to assign based on grammar name. fileTypes = "GitHub Markdown": (editor) -> editor.setSoftWrap(true) editor.setTabLength(4) "Java": (editor) -> editor.setTabLength(4) "Python": (editor) -> editor.setTabLength(4) # Apply grammar-specific settings. # # editor - Editor to which to apply the grammar-specific settings. applyGrammarSettings = (editor) -> func(editor) for name, func of fileTypes when name is editor.getGrammar().name # Executes for each and every Editor, past and future. atom.workspace.eachEditor (editor) -> applyGrammarSettings(editor) editor.on 'grammar-changed', -> applyGrammarSettings(editor) class ChatConversationListController extends CommonChatController constructor:-> super @getListView().on 'moveToIndexRequested', @bound 'moveItemToIndex' addItem:(data)-> # Make sure there is one conversation with same channel name {conversation, chatChannel} = data for chat in @itemsOrdered return if chat.conversation?.channel?.name is chatChannel?.name return if (conversation.invitees?.length or 1) < 2 super data loadItems:-> @removeAllItems() chatController = KD.getSingleton 'chatController' {JChatConversation} = KD.remote.api JChatConversation.fetchSome {}, (err, conversations)=> warn err if err for conversation in conversations chatController.addConversationToChatPanel \ conversation.publicName, conversation _ = require 'lodash' assert = require 'assert' module.exports = class ListString string: "" push = (how, elems...) -> for elem in elems if _.isArray elem push how, elem... else if _.isString elem elem = _.trim elem, ' ' continue if elem.length is 0 if @string.length is 0 @string = elem else @string = how(@string, elem) else if elem instanceof ListString @string = how @string, elem.string else assert(false, "Option should be either a string, an array of strings or a ListString") constructor: (elems...) -> @pushBack elems... pushFront: _.partial push, (string, elem) -> elem + " " + string pushBack: _.partial push, (string, elem) -> string + " " + elem toString: -> @string spawn = require("child_process").spawn exec = require("child_process").exec logger = require "logger-sharelatex" module.exports = DockerRunner = _docker: 'docker' _baseCommand: ['run', '--rm=true', '-t', '-v', '$COMPILE_DIR:/source', '--name=texlive-$PROJECT_ID', 'texlive'] run: (project_id, command, directory, timeout, callback = (error) ->) -> logger.log project_id: project_id, command: command, directory: directory, "running docker command" if command[0] != 'latexmk' throw 'Invalid command' docker_cmd = (arg.replace('$COMPILE_DIR', directory).replace('$PROJECT_ID', project_id) \ for arg in DockerRunner._baseCommand) docker_cmd = docker_cmd.concat (arg.replace('$COMPILE_DIR', '/source') for arg in command.slice(1)) proc = spawn DockerRunner._docker, docker_cmd, stdio: "inherit", cwd: directory timer = setTimeout timeout, () -> logger.warn "timeout achieved, stopping docker instance" exec 'docker', ['stop', "texlive-#{project_id}"] callback 'Compilation failed, timeout' proc.on "close", () -> clearTimeout timer callback() # Description: # Evaluate one line of Clojure script # # Dependencies: # None # # Configuration: # None # # Commands: # hubot clojure|clj